@llmindset/hf-mcp-server 0.2.32 → 0.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/gradio-endpoint-connector.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +16 -1
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/utils/tool-selection-strategy.d.ts.map +1 -1
- package/dist/server/utils/tool-selection-strategy.js +5 -1
- package/dist/server/utils/tool-selection-strategy.js.map +1 -1
- package/dist/server/utils/ui/audio-player.d.ts +1 -1
- package/dist/server/utils/ui/audio-player.d.ts.map +1 -1
- package/dist/server/utils/ui/audio-player.js.map +1 -1
- package/dist/web/assets/gradioWidgetDev-CHFFzaiX.js +1 -0
- package/dist/web/assets/main-DqGg20mH.js +145 -0
- package/dist/web/gradio-widget-dev.html +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +3 -3
- package/dist/server/types/mcp-ui-server-shim.d.ts +0 -34
- package/dist/server/types/mcp-ui-server-shim.d.ts.map +0 -1
- package/dist/server/types/mcp-ui-server-shim.js +0 -2
- package/dist/server/types/mcp-ui-server-shim.js.map +0 -1
- package/dist/web/assets/gradioWidgetDev-DR9EW8U9.js +0 -1
- package/dist/web/assets/main-BNxKgQmr.js +0 -145
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import{r as xc,a as h,R as He,j as l,b as Fi,g as yc,c as wc,d as bc}from"./index-DuDDhJyu.js";var wr={exports:{}},br={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* use-sync-external-store-shim.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ps;function _c(){if(ps)return br;ps=1;var e=xc();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(g,m){var f=m(),v=r({inst:{value:f,getSnapshot:m}}),p=v[0].inst,y=v[1];return s(function(){p.value=f,p.getSnapshot=m,c(p)&&y({inst:p})},[g,f,m]),o(function(){return c(p)&&y({inst:p}),g(function(){c(p)&&y({inst:p})})},[g]),i(f),f}function c(g){var m=g.getSnapshot;g=g.value;try{var f=m();return!n(g,f)}catch{return!0}}function u(g,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return br.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,br}var hs;function Sc(){return hs||(hs=1,wr.exports=_c()),wr.exports}var Cc=Sc();const Di=0,$i=1,Li=2,vs=3;var xs=Object.prototype.hasOwnProperty;function Xr(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Xr(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(xs.call(e,n)&&++r&&!xs.call(t,n)||!(n in t)||!Xr(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const tt=new WeakMap,pt=()=>{},Re=pt(),Yr=Object,oe=e=>e===Re,Ge=e=>typeof e=="function",wt=(e,t)=>({...e,...t}),Vi=e=>Ge(e.then),_r={},kn={},Po="undefined",wn=typeof window!=Po,Jr=typeof document!=Po,Rc=wn&&"Deno"in window,kc=()=>wn&&typeof window.requestAnimationFrame!=Po,zi=(e,t)=>{const n=tt.get(e);return[()=>!oe(t)&&e.get(t)||_r,r=>{if(!oe(t)){const o=e.get(t);t in kn||(kn[t]=o),n[5](t,wt(o,r),o||_r)}},n[6],()=>!oe(t)&&t in kn?kn[t]:!oe(t)&&e.get(t)||_r]};let Qr=!0;const Ec=()=>Qr,[eo,to]=wn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[pt,pt],Mc=()=>{const e=Jr&&document.visibilityState;return oe(e)||e!=="hidden"},Nc=e=>(Jr&&document.addEventListener("visibilitychange",e),eo("focus",e),()=>{Jr&&document.removeEventListener("visibilitychange",e),to("focus",e)}),Ac=e=>{const t=()=>{Qr=!0,e()},n=()=>{Qr=!1};return eo("online",t),eo("offline",n),()=>{to("online",t),to("offline",n)}},Tc={isOnline:Ec,isVisible:Mc},jc={initFocus:Nc,initReconnect:Ac},ys=!He.useId,fn=!wn||Rc,Ic=e=>kc()?window.requestAnimationFrame(e):setTimeout(e,1),Sr=fn?h.useEffect:h.useLayoutEffect,Cr=typeof navigator<"u"&&navigator.connection,ws=!fn&&Cr&&(["slow-2g","2g"].includes(Cr.effectiveType)||Cr.saveData),En=new WeakMap,Pc=e=>Yr.prototype.toString.call(e),Rr=(e,t)=>e===`[object ${t}]`;let Oc=0;const no=e=>{const t=typeof e,n=Pc(e),r=Rr(n,"Date"),o=Rr(n,"RegExp"),s=Rr(n,"Object");let i,a;if(Yr(e)===e&&!r&&!o){if(i=En.get(e),i)return i;if(i=++Oc+"~",En.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=no(e[a])+",";En.set(e,i)}if(s){i="#";const c=Yr.keys(e).sort();for(;!oe(a=c.pop());)oe(e[a])||(i+=a+":"+no(e[a])+",");En.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Oo=e=>{if(Ge(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?no(e):"",[e,t]};let Fc=0;const ro=()=>++Fc;async function Hi(...e){const[t,n,r,o]=e,s=wt({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=s.populateCache;const a=s.rollbackOnError;let c=s.optimisticData;const u=m=>typeof a=="function"?a(m):a!==!1,d=s.throwOnError;if(Ge(n)){const m=n,f=[],v=t.keys();for(const p of v)!/^\$(inf|sub)\$/.test(p)&&m(t.get(p)._k)&&f.push(p);return Promise.all(f.map(g))}return g(n);async function g(m){const[f]=Oo(m);if(!f)return;const[v,p]=zi(t,f),[y,x,w,b]=tt.get(t),_=()=>{const V=y[f];return(Ge(s.revalidate)?s.revalidate(v().data,m):s.revalidate!==!1)&&(delete w[f],delete b[f],V&&V[0])?V[0](Li).then(()=>v().data):v().data};if(e.length<3)return _();let C=r,N,E=!1;const S=ro();x[f]=[S,0];const $=!oe(c),L=v(),X=L.data,te=L._c,Z=oe(te)?X:te;if($&&(c=Ge(c)?c(Z,X):c,p({data:c,_c:Z})),Ge(C))try{C=C(Z)}catch(V){N=V,E=!0}if(C&&Vi(C))if(C=await C.catch(V=>{N=V,E=!0}),S!==x[f][0]){if(E)throw N;return C}else E&&$&&u(N)&&(i=!0,p({data:Z,_c:Re}));if(i&&!E)if(Ge(i)){const V=i(C,Z);p({data:V,error:Re,_c:Re})}else p({data:C,error:Re,_c:Re});if(x[f][1]=ro(),Promise.resolve(_()).then(()=>{p({_c:Re})}),E){if(d)throw N;return}return C}}const bs=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Dc=(e,t)=>{if(!tt.has(e)){const n=wt(jc,t),r=Object.create(null),o=Hi.bind(Re,e);let s=pt;const i=Object.create(null),a=(d,g)=>{const m=i[d]||[];return i[d]=m,m.push(g),()=>m.splice(m.indexOf(g),1)},c=(d,g,m)=>{e.set(d,g);const f=i[d];if(f)for(const v of f)v(g,m)},u=()=>{if(!tt.has(e)&&(tt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,c,a]),!fn)){const d=n.initFocus(setTimeout.bind(Re,bs.bind(Re,r,Di))),g=n.initReconnect(setTimeout.bind(Re,bs.bind(Re,r,$i)));s=()=>{d&&d(),g&&g(),tt.delete(e)}}};return u(),[e,o,u,s]}return[e,tt.get(e)[4]]},$c=(e,t,n,r,o)=>{const s=n.errorRetryCount,i=o.retryCount,a=~~((Math.random()+.5)*(1<<(i<8?i:8)))*n.errorRetryInterval;!oe(s)&&i>s||setTimeout(r,a,o)},Lc=Xr,[Gi,Vn]=Dc(new Map),Vc=wt({onLoadingSlow:pt,onSuccess:pt,onError:pt,onErrorRetry:$c,onDiscarded:pt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ws?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ws?5e3:3e3,compare:Lc,isPaused:()=>!1,cache:Gi,mutate:Vn,fallback:{}},Tc),zc=(e,t)=>{const n=wt(e,t);if(t){const{use:r,fallback:o}=e,{use:s,fallback:i}=t;r&&s&&(n.use=r.concat(s)),o&&i&&(n.fallback=wt(o,i))}return n},Hc=h.createContext({}),Gc="$inf$",Bi=wn&&window.__SWR_DEVTOOLS_USE__,Bc=Bi?window.__SWR_DEVTOOLS_USE__:[],Uc=()=>{Bi&&(window.__SWR_DEVTOOLS_REACT__=He)},Wc=e=>Ge(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],qc=()=>{const e=h.useContext(Hc);return h.useMemo(()=>wt(Vc,e),[e])},Zc=e=>(t,n,r)=>e(t,n&&((...s)=>{const[i]=Oo(t),[,,,a]=tt.get(Gi);if(i.startsWith(Gc))return n(...s);const c=a[i];return oe(c)?n(...s):(delete a[i],c)}),r),Kc=Bc.concat(Zc),Xc=e=>function(...n){const r=qc(),[o,s,i]=Wc(n),a=zc(r,i);let c=e;const{use:u}=a,d=(u||[]).concat(Kc);for(let g=d.length;g--;)c=d[g](c);return c(o,s||a.fetcher||null,a)},Yc=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};Uc();const kr=He.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Er={dedupe:!0},_s=Promise.resolve(Re),Jc=(e,t,n)=>{const{cache:r,compare:o,suspense:s,fallbackData:i,revalidateOnMount:a,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:g,keepPreviousData:m}=n,[f,v,p,y]=tt.get(r),[x,w]=Oo(e),b=h.useRef(!1),_=h.useRef(!1),C=h.useRef(x),N=h.useRef(t),E=h.useRef(n),S=()=>E.current,$=()=>S().isVisible()&&S().isOnline(),[L,X,te,Z]=zi(r,x),V=h.useRef({}).current,ne=oe(i)?oe(n.fallback)?Re:n.fallback[x]:i,G=(ee,ce)=>{for(const pe in V){const ae=pe;if(ae==="data"){if(!o(ee[ae],ce[ae])&&(!oe(ee[ae])||!o(be,ce[ae])))return!1}else if(ce[ae]!==ee[ae])return!1}return!0},J=h.useMemo(()=>{const ee=!x||!t?!1:oe(a)?S().isPaused()||s?!1:c!==!1:a,ce=Ee=>{const Ye=wt(Ee);return delete Ye._k,ee?{isValidating:!0,isLoading:!0,...Ye}:Ye},pe=L(),ae=Z(),Ne=ce(pe),dt=pe===ae?Ne:ce(ae);let ge=Ne;return[()=>{const Ee=ce(L());return G(Ee,ge)?(ge.data=Ee.data,ge.isLoading=Ee.isLoading,ge.isValidating=Ee.isValidating,ge.error=Ee.error,ge):(ge=Ee,Ee)},()=>dt]},[r,x]),R=Cc.useSyncExternalStore(h.useCallback(ee=>te(x,(ce,pe)=>{G(pe,ce)||ee()}),[r,x]),J[0],J[1]),M=!b.current,H=f[x]&&f[x].length>0,z=R.data,Y=oe(z)?ne&&Vi(ne)?kr(ne):ne:z,re=R.error,le=h.useRef(Y),be=m?oe(z)?oe(le.current)?Y:le.current:z:Y,_e=H&&!oe(re)?!1:M&&!oe(a)?a:S().isPaused()?!1:s?oe(Y)?!1:c:oe(Y)||c,Q=!!(x&&t&&M&&_e),ze=oe(R.isValidating)?Q:R.isValidating,ve=oe(R.isLoading)?Q:R.isLoading,Se=h.useCallback(async ee=>{const ce=N.current;if(!x||!ce||_.current||S().isPaused())return!1;let pe,ae,Ne=!0;const dt=ee||{},ge=!p[x]||!dt.dedupe,Ee=()=>ys?!_.current&&x===C.current&&b.current:x===C.current,Ye={isValidating:!1,isLoading:!1},fs=()=>{X(Ye)},ms=()=>{const Pe=p[x];Pe&&Pe[1]===ae&&delete p[x]},gs={isValidating:!0};oe(L().data)&&(gs.isLoading=!0);try{if(ge&&(X(gs),n.loadingTimeout&&oe(L().data)&&setTimeout(()=>{Ne&&Ee()&&S().onLoadingSlow(x,n)},n.loadingTimeout),p[x]=[ce(w),ro()]),[pe,ae]=p[x],pe=await pe,ge&&setTimeout(ms,n.dedupingInterval),!p[x]||p[x][1]!==ae)return ge&&Ee()&&S().onDiscarded(x),!1;Ye.error=Re;const Pe=v[x];if(!oe(Pe)&&(ae<=Pe[0]||ae<=Pe[1]||Pe[1]===0))return fs(),ge&&Ee()&&S().onDiscarded(x),!1;const Je=L().data;Ye.data=o(Je,pe)?Je:pe,ge&&Ee()&&S().onSuccess(pe,x,n)}catch(Pe){ms();const Je=S(),{shouldRetryOnError:xr}=Je;Je.isPaused()||(Ye.error=Pe,ge&&Ee()&&(Je.onError(Pe,x,Je),(xr===!0||Ge(xr)&&xr(Pe))&&(!S().revalidateOnFocus||!S().revalidateOnReconnect||$())&&Je.onErrorRetry(Pe,x,Je,vc=>{const yr=f[x];yr&&yr[0]&&yr[0](vs,vc)},{retryCount:(dt.retryCount||0)+1,dedupe:!0})))}return Ne=!1,fs(),!0},[x,r]),Xe=h.useCallback((...ee)=>Hi(r,C.current,...ee),[]);if(Sr(()=>{N.current=t,E.current=n,oe(z)||(le.current=z)}),Sr(()=>{if(!x)return;const ee=Se.bind(Re,Er);let ce=0;S().revalidateOnFocus&&(ce=Date.now()+S().focusThrottleInterval);const ae=Yc(x,f,(Ne,dt={})=>{if(Ne==Di){const ge=Date.now();S().revalidateOnFocus&&ge>ce&&$()&&(ce=ge+S().focusThrottleInterval,ee())}else if(Ne==$i)S().revalidateOnReconnect&&$()&&ee();else{if(Ne==Li)return Se();if(Ne==vs)return Se(dt)}});return _.current=!1,C.current=x,b.current=!0,X({_k:w}),_e&&(p[x]||(oe(Y)||fn?ee():Ic(ee))),()=>{_.current=!0,ae()}},[x]),Sr(()=>{let ee;function ce(){const ae=Ge(u)?u(L().data):u;ae&&ee!==-1&&(ee=setTimeout(pe,ae))}function pe(){!L().error&&(d||S().isVisible())&&(g||S().isOnline())?Se(Er).then(ce):ce()}return ce(),()=>{ee&&(clearTimeout(ee),ee=-1)}},[u,d,g,x]),h.useDebugValue(be),s){const ee=x&&oe(Y);if(!ys&&fn&&ee)throw new Error("Fallback data is required when using Suspense in SSR.");ee&&(N.current=t,E.current=n,_.current=!1);const ce=y[x],pe=!oe(ce)&&ee?Xe(ce):_s;if(kr(pe),!oe(re)&&ee)throw re;const ae=ee?Se(Er):_s;!oe(be)&&ee&&(ae.status="fulfilled",ae.value=!0),kr(ae)}return{mutate:Xe,get data(){return V.data=!0,be},get error(){return V.error=!0,re},get isValidating(){return V.isValidating=!0,ze},get isLoading(){return V.isLoading=!0,ve}}},cn=Xc(Jc);function Ui(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ui(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Wi(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ui(e))&&(r&&(r+=" "),r+=t);return r}const Fo="-",Qc=e=>{const t=tu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Fo);return a[0]===""&&a.length!==1&&a.shift(),qi(a,t)||eu(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},qi=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?qi(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Fo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ss=/^\[(.+)\]$/,eu=e=>{if(Ss.test(e)){const t=Ss.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tu=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)oo(n[o],r,o,t);return r},oo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Cs(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(nu(o)){oo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{oo(i,Cs(t,s),n,r)})})},Cs=(e,t)=>{let n=e;return t.split(Fo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nu=e=>e.isThemeGetter,ru=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},so="!",io=":",ou=io.length,su=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,u;for(let v=0;v<o.length;v++){let p=o[v];if(i===0&&a===0){if(p===io){s.push(o.slice(c,v)),c=v+ou;continue}if(p==="/"){u=v;continue}}p==="["?i++:p==="]"?i--:p==="("?a++:p===")"&&a--}const d=s.length===0?o:o.substring(c),g=iu(d),m=g!==d,f=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:f}};if(t){const o=t+io,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},iu=e=>e.endsWith(so)?e.substring(0,e.length-1):e.startsWith(so)?e.substring(1):e,au=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},lu=e=>({cache:ru(e.cacheSize),parseClassName:su(e),sortModifiers:au(e),...Qc(e)}),cu=/\s+/,uu=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(cu);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:g,modifiers:m,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:p}=n(d);if(g){c=d+(c.length>0?" "+c:c);continue}let y=!!p,x=r(y?v.substring(0,p):v);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=r(v),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=s(m).join(":"),b=f?w+so:w,_=b+x;if(i.includes(_))continue;i.push(_);const C=o(x,y);for(let N=0;N<C.length;++N){const E=C[N];i.push(b+E)}c=d+(c.length>0?" "+c:c)}return c};function du(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Zi(t))&&(r&&(r+=" "),r+=n);return r}const Zi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zi(e[r]))&&(n&&(n+=" "),n+=t);return n};function fu(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((d,g)=>g(d),e());return n=lu(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=uu(c,n);return o(c,d),d}return function(){return s(du.apply(null,arguments))}}const xe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ki=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mu=/^\d+\/\d+$/,gu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pu=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>mu.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),ft=e=>!!e&&Number.isInteger(Number(e)),Mr=e=>e.endsWith("%")&&W(e.slice(0,-1)),Qe=e=>gu.test(e),yu=()=>!0,wu=e=>pu.test(e)&&!hu.test(e),Yi=()=>!1,bu=e=>vu.test(e),_u=e=>xu.test(e),Su=e=>!T(e)&&!j(e),Cu=e=>Qt(e,ea,Yi),T=e=>Ki.test(e),Et=e=>Qt(e,ta,wu),Nr=e=>Qt(e,Nu,W),Rs=e=>Qt(e,Ji,Yi),Ru=e=>Qt(e,Qi,_u),Mn=e=>Qt(e,na,bu),j=e=>Xi.test(e),on=e=>en(e,ta),ku=e=>en(e,Au),ks=e=>en(e,Ji),Eu=e=>en(e,ea),Mu=e=>en(e,Qi),Nn=e=>en(e,na,!0),Qt=(e,t,n)=>{const r=Ki.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},en=(e,t,n=!1)=>{const r=Xi.exec(e);return r?r[1]?t(r[1]):n:!1},Ji=e=>e==="position"||e==="percentage",Qi=e=>e==="image"||e==="url",ea=e=>e==="length"||e==="size"||e==="bg-size",ta=e=>e==="length",Nu=e=>e==="number",Au=e=>e==="family-name",na=e=>e==="shadow",Tu=()=>{const e=xe("color"),t=xe("font"),n=xe("text"),r=xe("font-weight"),o=xe("tracking"),s=xe("leading"),i=xe("breakpoint"),a=xe("container"),c=xe("spacing"),u=xe("radius"),d=xe("shadow"),g=xe("inset-shadow"),m=xe("text-shadow"),f=xe("drop-shadow"),v=xe("blur"),p=xe("perspective"),y=xe("aspect"),x=xe("ease"),w=xe("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),j,T],N=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],S=()=>[j,T,c],$=()=>[$t,"full","auto",...S()],L=()=>[ft,"none","subgrid",j,T],X=()=>["auto",{span:["full",ft,j,T]},ft,j,T],te=()=>[ft,"auto",j,T],Z=()=>["auto","min","max","fr",j,T],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...S()],J=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],R=()=>[e,j,T],M=()=>[..._(),ks,Rs,{position:[j,T]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",Eu,Cu,{size:[j,T]}],Y=()=>[Mr,on,Et],re=()=>["","none","full",u,j,T],le=()=>["",W,on,Et],be=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[W,Mr,ks,Rs],ze=()=>["","none",v,j,T],ve=()=>["none",W,j,T],Se=()=>["none",W,j,T],Xe=()=>[W,j,T],ut=()=>[$t,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qe],breakpoint:[Qe],color:[yu],container:[Qe],"drop-shadow":[Qe],ease:["in","out","in-out"],font:[Su],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qe],shadow:[Qe],spacing:["px",W],text:[Qe],"text-shadow":[Qe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,T,j,y]}],container:["container"],columns:[{columns:[W,T,j,a]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[ft,"auto",j,T]}],basis:[{basis:[$t,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[W,$t,"auto","initial","none",T]}],grow:[{grow:["",W,j,T]}],shrink:[{shrink:["",W,j,T]}],order:[{order:[ft,"first","last","none",j,T]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[a,"screen",...J()]}],"min-w":[{"min-w":[a,"screen","none",...J()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,on,Et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,j,Nr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mr,T]}],"font-family":[{font:[ku,T,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,j,T]}],"line-clamp":[{"line-clamp":[W,"none",j,Nr]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",j,T]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",j,T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[W,"from-font","auto",j,Et]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[W,"auto",j,T]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",j,T]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",j,T]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ft,j,T],radial:["",j,T],conic:[ft,j,T]},Mu,Ru]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[W,j,T]}],"outline-w":[{outline:["",W,on,Et]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,Nn,Mn]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",g,Nn,Mn]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[W,Et]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,Nn,Mn]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[W,j,T]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[j,T]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",j,T]}],filter:[{filter:["","none",j,T]}],blur:[{blur:ze()}],brightness:[{brightness:[W,j,T]}],contrast:[{contrast:[W,j,T]}],"drop-shadow":[{"drop-shadow":["","none",f,Nn,Mn]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",W,j,T]}],"hue-rotate":[{"hue-rotate":[W,j,T]}],invert:[{invert:["",W,j,T]}],saturate:[{saturate:[W,j,T]}],sepia:[{sepia:["",W,j,T]}],"backdrop-filter":[{"backdrop-filter":["","none",j,T]}],"backdrop-blur":[{"backdrop-blur":ze()}],"backdrop-brightness":[{"backdrop-brightness":[W,j,T]}],"backdrop-contrast":[{"backdrop-contrast":[W,j,T]}],"backdrop-grayscale":[{"backdrop-grayscale":["",W,j,T]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,j,T]}],"backdrop-invert":[{"backdrop-invert":["",W,j,T]}],"backdrop-opacity":[{"backdrop-opacity":[W,j,T]}],"backdrop-saturate":[{"backdrop-saturate":[W,j,T]}],"backdrop-sepia":[{"backdrop-sepia":["",W,j,T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",j,T]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[W,"initial",j,T]}],ease:[{ease:["linear","initial",x,j,T]}],delay:[{delay:[W,j,T]}],animate:[{animate:["none",w,j,T]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,j,T]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[j,T,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ut()}],"translate-x":[{"translate-x":ut()}],"translate-y":[{"translate-y":ut()}],"translate-z":[{"translate-z":ut()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",j,T]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",j,T]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[W,on,Et,Nr]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ju=fu(Tu);function ue(...e){return ju(Wi(e))}function nt({className:e,...t}){return l.jsx("div",{"data-slot":"card",className:ue("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function rt({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:ue("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ot({className:e,...t}){return l.jsx("div",{"data-slot":"card-title",className:ue("leading-none font-semibold",e),...t})}function It({className:e,...t}){return l.jsx("div",{"data-slot":"card-description",className:ue("text-muted-foreground text-sm",e),...t})}function st({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:ue("px-6",e),...t})}function Es(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nr(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Es(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Es(e[o],null)}}}}function ke(...e){return h.useCallback(nr(...e),e)}function Pt(e,t=[]){let n=[];function r(s,i){const a=h.createContext(i),c=n.length;n=[...n,i];const u=g=>{var x;const{scope:m,children:f,...v}=g,p=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=h.useMemo(()=>v,Object.values(v));return l.jsx(p.Provider,{value:y,children:f})};u.displayName=s+"Provider";function d(g,m){var p;const f=((p=m==null?void 0:m[e])==null?void 0:p[c])||a,v=h.useContext(f);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>h.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Iu(o,...t)]}function Iu(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const g=c(s)[`__scope${u}`];return{...a,...g}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var bt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Pu=Fi[" useInsertionEffect ".trim().toString()]||bt;function rr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Ou({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const g=d.current;g!==a&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=h.useCallback(d=>{var g;if(a){const m=Fu(d)?d(e):d;m!==e&&((g=i.current)==null||g.call(i,m))}else s(d)},[a,e,s,i]);return[c,u]}function Ou({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),s=h.useRef(t);return Pu(()=>{s.current=t},[t]),h.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function Fu(e){return typeof e=="function"}function Du(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ra(e){const[t,n]=h.useState(void 0);return bt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function $u(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=Lu(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=ke(r.ref,Vu(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null};Ot.displayName="Presence";function Lu(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),s=h.useRef("none"),i=e?"mounted":"unmounted",[a,c]=$u(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=An(r.current);s.current=a==="mounted"?u:"none"},[a]),bt(()=>{const u=r.current,d=o.current;if(d!==e){const m=s.current,f=An(u);e?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),bt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,g=f=>{const p=An(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=f=>{f.target===t&&(s.current=An(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function An(e){return(e==null?void 0:e.animationName)||"none"}function Vu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Do=wc();const zu=yc(Do);function mn(e){const t=Hu(e),n=h.forwardRef((r,o)=>{const{children:s,...i}=r,a=h.Children.toArray(s),c=a.find(Bu);if(c){const u=c.props.children,d=a.map(g=>g===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:g);return l.jsx(t,{...i,ref:o,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var oa=mn("Slot");function Hu(e){const t=h.forwardRef((n,r)=>{const{children:o,...s}=n;if(h.isValidElement(o)){const i=Wu(o),a=Uu(s,o.props);return o.type!==h.Fragment&&(a.ref=r?nr(r,i):i),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gu=Symbol("radix.slottable");function Bu(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gu}function Uu(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Wu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fe=qu.reduce((e,t)=>{const n=mn(`Primitive.${t}`),r=h.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sa(e,t){e&&Do.flushSync(()=>e.dispatchEvent(t))}var or="Checkbox",[Zu]=Pt(or),[Ku,$o]=Zu(or);function Xu(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:g}=e,[m,f]=rr({prop:n,defaultProp:o??!1,onChange:c,caller:or}),[v,p]=h.useState(null),[y,x]=h.useState(null),w=h.useRef(!1),b=v?!!i||!!v.closest("form"):!0,_={checked:m,disabled:s,setChecked:f,control:v,setControl:p,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:xt(o)?!1:o,isFormControl:b,bubbleInput:y,setBubbleInput:x};return l.jsx(Ku,{scope:t,..._,children:Yu(g)?g(_):r})}var ia="CheckboxTrigger",aa=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:u,setControl:d,setChecked:g,hasConsumerStoppedPropagationRef:m,isFormControl:f,bubbleInput:v}=$o(ia,e),p=ke(o,d),y=h.useRef(c);return h.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const w=()=>g(y.current);return x.addEventListener("reset",w),()=>x.removeEventListener("reset",w)}},[s,g]),l.jsx(fe.button,{type:"button",role:"checkbox","aria-checked":xt(c)?"mixed":c,"aria-required":u,"data-state":ma(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:p,onKeyDown:q(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:q(n,x=>{g(w=>xt(w)?!0:!w),v&&f&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});aa.displayName=ia;var la=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:u,form:d,...g}=e;return l.jsx(Xu,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(aa,{...g,ref:t,__scopeCheckbox:n}),m&&l.jsx(fa,{__scopeCheckbox:n})]})})});la.displayName=or;var ca="CheckboxIndicator",ua=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=$o(ca,n);return l.jsx(Ot,{present:r||xt(s.checked)||s.checked===!0,children:l.jsx(fe.span,{"data-state":ma(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ua.displayName=ca;var da="CheckboxBubbleInput",fa=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:u,value:d,form:g,bubbleInput:m,setBubbleInput:f}=$o(da,e),v=ke(n,f),p=Du(s),y=ra(r);h.useEffect(()=>{const w=m;if(!w)return;const b=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(b,"checked").set,N=!o.current;if(p!==s&&C){const E=new Event("click",{bubbles:N});w.indeterminate=xt(s),C.call(w,xt(s)?!1:s),w.dispatchEvent(E)}},[m,p,s,o]);const x=h.useRef(xt(s)?!1:s);return l.jsx(fe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:u,value:d,form:g,...t,tabIndex:-1,ref:v,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});fa.displayName=da;function Yu(e){return typeof e=="function"}function xt(e){return e==="indeterminate"}function ma(e){return xt(e)?"indeterminate":e?"checked":"unchecked"}/**
|
|
10
|
-
* @license lucide-react v0.507.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/const Ju=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ms=e=>{const t=Qu(e);return t.charAt(0).toUpperCase()+t.slice(1)},ga=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ed=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
15
|
-
* @license lucide-react v0.507.0 - ISC
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the ISC license.
|
|
18
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var td={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
20
|
-
* @license lucide-react v0.507.0 - ISC
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the ISC license.
|
|
23
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/const nd=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>h.createElement("svg",{ref:c,...td,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ga("lucide",o),...!s&&!ed(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>h.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
|
|
25
|
-
* @license lucide-react v0.507.0 - ISC
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the ISC license.
|
|
28
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/const Ve=(e,t)=>{const n=h.forwardRef(({className:r,...o},s)=>h.createElement(nd,{ref:s,iconNode:t,className:ga(`lucide-${Ju(Ms(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Ms(e),n};/**
|
|
30
|
-
* @license lucide-react v0.507.0 - ISC
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the ISC license.
|
|
33
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/const rd=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],od=Ve("activity",rd);/**
|
|
35
|
-
* @license lucide-react v0.507.0 - ISC
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the ISC license.
|
|
38
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/const sd=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pa=Ve("check",sd);/**
|
|
40
|
-
* @license lucide-react v0.507.0 - ISC
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the ISC license.
|
|
43
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/const id=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ha=Ve("chevron-down",id);/**
|
|
45
|
-
* @license lucide-react v0.507.0 - ISC
|
|
46
|
-
*
|
|
47
|
-
* This source code is licensed under the ISC license.
|
|
48
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/const ad=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ld=Ve("chevron-up",ad);/**
|
|
50
|
-
* @license lucide-react v0.507.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const cd=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],ud=Ve("clock",cd);/**
|
|
55
|
-
* @license lucide-react v0.507.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const dd=[["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"}]],fd=Ve("copy",dd);/**
|
|
60
|
-
* @license lucide-react v0.507.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const md=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],gd=Ve("globe",md);/**
|
|
65
|
-
* @license lucide-react v0.507.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const pd=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],hd=Ve("settings",pd);/**
|
|
70
|
-
* @license lucide-react v0.507.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const vd=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],va=Ve("triangle-alert",vd);/**
|
|
75
|
-
* @license lucide-react v0.507.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const xd=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],xa=Ve("wifi-off",xd);/**
|
|
80
|
-
* @license lucide-react v0.507.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const yd=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],ya=Ve("wifi",yd);function Lo({className:e,...t}){return l.jsx(la,{"data-slot":"checkbox",className:ue("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(ua,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:l.jsx(pa,{className:"size-3.5"})})})}function wd({id:e,label:t,description:n,isEnabled:r,onToggle:o}){return l.jsx("div",{children:l.jsxs("div",{className:"items-top flex space-x-2",children:[l.jsx(Lo,{id:e,checked:r,onCheckedChange:s=>o(s===!0)}),l.jsxs("div",{className:"grid gap-1.5 leading-none",children:[l.jsx("label",{htmlFor:e,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:t}),l.jsx("p",{className:"text-sm text-muted-foreground",children:n})]})]})})}function Ns({title:e,description:t,tools:n,onToolToggle:r}){return l.jsxs(nt,{className:"w-full",children:[l.jsxs(rt,{children:[l.jsx(ot,{children:e}),l.jsx(It,{children:t})]}),l.jsx(st,{children:l.jsx("div",{className:"grid grid-cols-2 gap-6 mb-6",children:Object.entries(n).map(([o,s])=>l.jsx(wd,{id:s.id,label:s.label,description:s.description,isEnabled:s.settings.enabled,onToggle:i=>{r(s.id,i)}},o))})})]})}function ao({className:e,type:t,...n}){return l.jsx("input",{type:t,"data-slot":"input",className:ue("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var bd="Label",wa=h.forwardRef((e,t)=>l.jsx(fe.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wa.displayName=bd;var _d=wa;function Sd({className:e,...t}){return l.jsx(_d,{"data-slot":"label",className:ue("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Cd({spaceNames:e,spaceSubdomains:t,enabledSpaces:n,onSpaceToolToggle:r,onSpaceToolNameChange:o,onSpaceToolSubdomainChange:s}){const i=[0,1,2];return l.jsxs(nt,{className:"w-full",children:[l.jsxs(rt,{children:[l.jsx(ot,{children:"🚀 Gradio Spaces"}),l.jsxs(It,{children:["Configure up to 3 Gradio spaces for remote tool access. Edit the name and subdomain fields.",l.jsx("span",{className:"font-semibold",children:" Note: Changes may require reconnecting your MCP client."})]})]}),l.jsx(st,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center space-x-3 pb-2 border-b",children:[l.jsx("div",{className:"w-6"})," ",l.jsx("div",{className:"text-sm font-medium min-w-[80px]",children:"Space"}),l.jsx("div",{className:"flex-1 text-sm font-medium",children:"Name"}),l.jsx("div",{className:"flex-1 text-sm font-medium",children:"Subdomain"})]}),i.map(a=>l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx(Lo,{id:`space-tool-${a}`,checked:n[a]||!1,onCheckedChange:c=>r(a,c===!0)}),l.jsx(Sd,{htmlFor:`space-tool-${a}`,className:"text-sm font-medium min-w-[80px]",children:a+1}),l.jsx(ao,{placeholder:"username/space-name",value:e[a]||"",onChange:c=>o(a,c.target.value),className:"flex-1 text-sm"}),l.jsx(ao,{placeholder:"username-space-name",value:t[a]||"",onChange:c=>s(a,c.target.value),className:"flex-1 text-sm"})]},a))]})})]})}const As=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ts=Wi,Vo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ts(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],g=s==null?void 0:s[u];if(d===null)return null;const m=As(d)||As(g);return o[u][m]}),a=n&&Object.entries(n).reduce((u,d)=>{let[g,m]=d;return m===void 0||(u[g]=m),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:g,className:m,...f}=d;return Object.entries(f).every(v=>{let[p,y]=v;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,g,m]:u},[]);return Ts(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Rd=Vo("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function kd({className:e,variant:t,...n}){return l.jsx("div",{"data-slot":"alert",role:"alert",className:ue(Rd({variant:t}),e),...n})}function Ed({className:e,...t}){return l.jsx("div",{"data-slot":"alert-title",className:ue("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Md({className:e,...t}){return l.jsx("div",{"data-slot":"alert-description",className:ue("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}const Nd=Vo("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-green-100 text-green-800 [a&]:hover:bg-green-100/90"}},defaultVariants:{variant:"default"}});function Mt({className:e,variant:t,asChild:n=!1,...r}){const o=n?oa:"span";return l.jsx(o,{"data-slot":"badge",className:ue(Nd({variant:t}),e),...r})}var Ad="Separator",js="horizontal",Td=["horizontal","vertical"],ba=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=js,...o}=e,s=jd(r)?r:js,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(fe.div,{"data-orientation":s,...a,...o,ref:t})});ba.displayName=Ad;function jd(e){return Td.includes(e)}var Id=ba;function At({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return l.jsx(Id,{"data-slot":"separator",decorative:n,orientation:t,className:ue("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}/**
|
|
85
|
-
* table-core
|
|
86
|
-
*
|
|
87
|
-
* Copyright (c) TanStack
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the MIT license found in the
|
|
90
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
91
|
-
*
|
|
92
|
-
* @license MIT
|
|
93
|
-
*/function ht(e,t){return typeof e=="function"?e(t):e}function je(e,t){return n=>{t.setState(r=>({...r,[e]:ht(n,r[e])}))}}function sr(e){return e instanceof Function}function Pd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Od(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function F(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((d,g)=>r[g]!==d)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-u)*100)/100,m=g/16,f=(v,p)=>{for(v=String(v);v.length<p;)v=" "+v;return v};console.info(`%c⏱ ${f(g,5)} /${f(d,5)} ms`,`
|
|
94
|
-
font-size: .6rem;
|
|
95
|
-
font-weight: bold;
|
|
96
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function D(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function Fd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:F(()=>[e,n,t,s],(i,a,c,u)=>({table:i,column:a,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),D(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Dd(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},c=a.accessorKey;let u=(o=(s=a.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:c&&(c.includes(".")?d=m=>{let f=m;for(const p of c.split(".")){var v;f=(v=f)==null?void 0:v[p]}return f}:d=m=>m[a.accessorKey]),!u)throw new Error;let g={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:F(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(f=>f.getFlatColumns())]},D(e.options,"debugColumns")),getLeafColumns:F(()=>[e._getOrderColumnsFn()],m=>{var f;if((f=g.columns)!=null&&f.length){let v=g.columns.flatMap(p=>p.getLeafColumns());return m(v)}return[g]},D(e.options,"debugColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Ce="debugHeaders";function Is(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),i.push(c)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const $d={createTable:e=>{e.getHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],c=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],u=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Tn(t,[...a,...u,...c],e)},D(e.options,Ce)),e.getCenterHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Tn(t,n,e,"center")),D(e.options,Ce)),e.getLeftHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Tn(t,s,e,"left")},D(e.options,Ce)),e.getRightHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Tn(t,s,e,"right")},D(e.options,Ce)),e.getFooterGroups=F(()=>[e.getHeaderGroups()],t=>[...t].reverse(),D(e.options,Ce)),e.getLeftFooterGroups=F(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),D(e.options,Ce)),e.getCenterFooterGroups=F(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),D(e.options,Ce)),e.getRightFooterGroups=F(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),D(e.options,Ce)),e.getFlatHeaders=F(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),D(e.options,Ce)),e.getLeftFlatHeaders=F(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),D(e.options,Ce)),e.getCenterFlatHeaders=F(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),D(e.options,Ce)),e.getRightFlatHeaders=F(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),D(e.options,Ce)),e.getCenterLeafHeaders=F(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),D(e.options,Ce)),e.getLeftLeafHeaders=F(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),D(e.options,Ce)),e.getRightLeafHeaders=F(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),D(e.options,Ce)),e.getLeafHeaders=F(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,c,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(c=(u=r[0])==null?void 0:u.headers)!=null?c:[]].map(d=>d.getLeafHeaders()).flat()},D(e.options,Ce))}};function Tn(e,t,n,r){var o,s;let i=0;const a=function(m,f){f===void 0&&(f=1),i=Math.max(i,f),m.filter(v=>v.getIsVisible()).forEach(v=>{var p;(p=v.columns)!=null&&p.length&&a(v.columns,f+1)},0)};a(e);let c=[];const u=(m,f)=>{const v={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},p=[];m.forEach(y=>{const x=[...p].reverse()[0],w=y.column.depth===v.depth;let b,_=!1;if(w&&y.column.parent?b=y.column.parent:(b=y.column,_=!0),x&&(x==null?void 0:x.column)===b)x.subHeaders.push(y);else{const C=Is(n,b,{id:[r,f,b.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${p.filter(N=>N.column===b).length}`:void 0,depth:f,index:p.length});C.subHeaders.push(y),p.push(C)}v.headers.push(y),y.headerGroup=v}),c.push(v),f>0&&u(p,f-1)},d=t.map((m,f)=>Is(n,m,{depth:i,index:f}));u(d,i-1),c.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let p=0,y=0,x=[0];v.subHeaders&&v.subHeaders.length?(x=[],g(v.subHeaders).forEach(b=>{let{colSpan:_,rowSpan:C}=b;p+=_,x.push(C)})):p=1;const w=Math.min(...x);return y=y+w,v.colSpan=p,v.rowSpan=y,{colSpan:p,rowSpan:y}});return g((o=(s=c[0])==null?void 0:s.headers)!=null?o:[]),c}const zo=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return a._valuesCache[c]=u.accessorFn(a.original,r),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=a.getValue(c))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Od(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;c.push(d),u=d}return c.reverse()},getAllCells:F(()=>[e.getAllLeafColumns()],c=>c.map(u=>Fd(e,a,u,u.id)),D(e.options,"debugRows")),_getAllCellsByColumnId:F(()=>[a.getAllCells()],c=>c.reduce((u,d)=>(u[d.column.id]=d,u),{}),D(e.options,"debugRows"))};for(let c=0;c<e._features.length;c++){const u=e._features[c];u==null||u.createRow==null||u.createRow(a,e)}return a},Ld={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},_a=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};_a.autoRemove=e=>De(e);const Sa=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Sa.autoRemove=e=>De(e);const Ca=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};Ca.autoRemove=e=>De(e);const Ra=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Ra.autoRemove=e=>De(e);const ka=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});ka.autoRemove=e=>De(e)||!(e!=null&&e.length);const Ea=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Ea.autoRemove=e=>De(e)||!(e!=null&&e.length);const Ma=(e,t,n)=>e.getValue(t)===n;Ma.autoRemove=e=>De(e);const Na=(e,t,n)=>e.getValue(t)==n;Na.autoRemove=e=>De(e);const Ho=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Ho.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]};Ho.autoRemove=e=>De(e)||De(e[0])&&De(e[1]);const et={includesString:_a,includesStringSensitive:Sa,equalsString:Ca,arrIncludes:Ra,arrIncludesAll:ka,arrIncludesSome:Ea,equals:Ma,weakEquals:Na,inNumberRange:Ho};function De(e){return e==null||e===""}const Vd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:je("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?et.includesString:typeof r=="number"?et.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?et.equals:Array.isArray(r)?et.arrIncludes:et.weakEquals},e.getFilterFn=()=>{var n,r;return sr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:et[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(d=>d.id===e.id),i=ht(n,s?s.value:void 0);if(Ps(o,i,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const c={id:e.id,value:i};if(s){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?c:d))!=null?u:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=ht(t,o))==null?void 0:s.filter(i=>{const a=n.find(c=>c.id===i.id);if(a){const c=a.getFilterFn();if(Ps(c,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ps(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const zd=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),Hd=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},Gd=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},Bd=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},Ud=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},Wd=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Pd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},qd=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Zd=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Kd=(e,t)=>t.length,Ar={sum:zd,min:Hd,max:Gd,extent:Bd,mean:Ud,median:Wd,unique:qd,uniqueCount:Zd,count:Kd},Xd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:je("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Ar.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Ar.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return sr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Ar[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Yd(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const Jd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:je("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=F(n=>[un(t,n)],n=>n.findIndex(r=>r.id===e.id),D(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=un(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=un(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=F(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const c=i.shift(),u=a.findIndex(d=>d.id===c);u>-1&&s.push(a.splice(u,1)[0])}s=[...s,...a]}return Yd(s,n,r)},D(e.options,"debugTable"))}},Tr=()=>({left:[],right:[]}),Qd={getInitialState:e=>({columnPinning:Tr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:je("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,c;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((c=o==null?void 0:o.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=F(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},D(t.options,"debugRows")),e.getLeftVisibleCells=F(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),D(t.options,"debugRows")),e.getRightVisibleCells=F(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),D(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Tr():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Tr())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=F(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),D(e.options,"debugColumns")),e.getRightLeafColumns=F(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),D(e.options,"debugColumns")),e.getCenterLeafColumns=F(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},D(e.options,"debugColumns"))}};function ef(e){return e||(typeof document<"u"?document:null)}const jn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},jr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),tf={getDefaultColumnDef:()=>jn,getInitialState:e=>({columnSizing:{},columnSizingInfo:jr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:je("columnSizing",e),onColumnSizingInfoChange:je("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jn.minSize,(r=s??e.columnDef.size)!=null?r:jn.size),(o=e.columnDef.maxSize)!=null?o:jn.maxSize)},e.getStart=F(n=>[n,un(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),D(t.options,"debugColumns")),e.getAfter=F(n=>[n,un(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),D(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),Ir(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],c=Ir(s)?Math.round(s.touches[0].clientX):s.clientX,u={},d=(x,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(b=>{var _,C;const N=t.options.columnResizeDirection==="rtl"?-1:1,E=(w-((_=b==null?void 0:b.startOffset)!=null?_:0))*N,S=Math.max(E/((C=b==null?void 0:b.startSize)!=null?C:0),-.999999);return b.columnSizingStart.forEach($=>{let[L,X]=$;u[L]=Math.round(Math.max(X+X*S,0)*100)/100}),{...b,deltaOffset:E,deltaPercentage:S}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(b=>({...b,...u})))},g=x=>d("move",x),m=x=>{d("end",x),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=ef(n),v={moveHandler:x=>g(x.clientX),upHandler:x=>{f==null||f.removeEventListener("mousemove",v.moveHandler),f==null||f.removeEventListener("mouseup",v.upHandler),m(x.clientX)}},p={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),g(x.touches[0].clientX),!1),upHandler:x=>{var w;f==null||f.removeEventListener("touchmove",p.moveHandler),f==null||f.removeEventListener("touchend",p.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),m((w=x.touches[0])==null?void 0:w.clientX)}},y=nf()?{passive:!1}:!1;Ir(s)?(f==null||f.addEventListener("touchmove",p.moveHandler,y),f==null||f.addEventListener("touchend",p.upHandler,y)):(f==null||f.addEventListener("mousemove",v.moveHandler,y),f==null||f.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(x=>({...x,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?jr():(n=e.initialState.columnSizingInfo)!=null?n:jr())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let In=null;function nf(){if(typeof In=="boolean")return In;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return In=e,In}function Ir(e){return e.type==="touchstart"}const rf={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:je("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=F(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),D(t.options,"debugRows")),e.getVisibleCells=F(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],D(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>F(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),D(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function un(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const of={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},sf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:je("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>et.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return sr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:et[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},af={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:je("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...c}=i;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},lo=0,co=10,Pr=()=>({pageIndex:lo,pageSize:co}),lf={getInitialState:e=>({...e,pagination:{...Pr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:je("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>ht(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Pr():(o=e.initialState.pagination)!=null?o:Pr())},e.setPageIndex=r=>{e.setPagination(o=>{let s=ht(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?lo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:lo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?co:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:co)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,ht(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=ht(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=F(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},D(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Or=()=>({top:[],bottom:[]}),cf={getInitialState:e=>({rowPinning:Or(),...e}),getDefaultOptions:e=>({onRowPinningChange:je("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(c=>{let{id:u}=c;return u}):[],i=o?e.getParentRows().map(c=>{let{id:u}=c;return u}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(c=>{var u,d;if(n==="bottom"){var g,m;return{top:((g=c==null?void 0:c.top)!=null?g:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((m=c==null?void 0:c.bottom)!=null?m:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var f,v;return{top:[...((f=c==null?void 0:c.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((v=c==null?void 0:c.bottom)!=null?v:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((d=c==null?void 0:c.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Or():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Or())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=F(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),D(e.options,"debugRows")),e.getBottomRows=F(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),D(e.options,"debugRows")),e.getCenterRows=F(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},D(e.options,"debugRows"))}},uf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:je("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{uo(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=F(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Fr(e,n):{rows:[],flatRows:[],rowsById:{}},D(e.options,"debugTable")),e.getFilteredSelectedRowModel=F(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Fr(e,n):{rows:[],flatRows:[],rowsById:{}},D(e.options,"debugTable")),e.getGroupedSelectedRowModel=F(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Fr(e,n):{rows:[],flatRows:[],rowsById:{}},D(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return uo(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Go(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return fo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return fo(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},uo=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>uo(e,a.id,n,r,o))};function Fr(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(c=>{var u;const d=Go(c,n);if(d&&(r.push(c),o[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:s(c.subRows)}),d)return c}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function Go(e,t){var n;return(n=t[e.id])!=null?n:!1}function fo(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Go(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=fo(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const mo=/([0-9]+)/gm,df=(e,t,n)=>Aa(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),ff=(e,t,n)=>Aa(_t(e.getValue(n)),_t(t.getValue(n))),mf=(e,t,n)=>Bo(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),gf=(e,t,n)=>Bo(_t(e.getValue(n)),_t(t.getValue(n))),pf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},hf=(e,t,n)=>Bo(e.getValue(n),t.getValue(n));function Bo(e,t){return e===t?0:e>t?1:-1}function _t(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Aa(e,t){const n=e.split(mo).filter(Boolean),r=t.split(mo).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),c=[i,a].sort();if(isNaN(c[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const sn={alphanumeric:df,alphanumericCaseSensitive:ff,text:mf,textCaseSensitive:gf,datetime:pf,basic:hf},vf={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:je("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return sn.datetime;if(typeof s=="string"&&(r=!0,s.split(mo).length>1))return sn.alphanumeric}return r?sn.text:sn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return sr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:sn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(f=>f.id===e.id),c=i==null?void 0:i.findIndex(f=>f.id===e.id);let u=[],d,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":i!=null&&i.length&&c!==i.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(s||o||(d="remove")),d==="add"){var m;u=[...i,{id:e.id,desc:g}],u.splice(0,u.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=i.map(f=>f.id===e.id?{...f,desc:g}:f):d==="remove"?u=i.filter(f=>f.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},xf=[$d,rf,Jd,Qd,Ld,Vd,of,sf,vf,Xd,af,lf,cf,uf,tf];function yf(e){var t,n;const r=[...xf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,f)=>Object.assign(m,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let c={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var f;c=(f=m.getInitialState==null?void 0:m.getInitialState(c))!=null?f:c});const u=[];let d=!1;const g={_features:r,options:{...s,...e},initialState:c,_queue:m=>{u.push(m),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const f=ht(m,o.options);o.options=i(f)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,f,v)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(m,f,v))!=null?p:`${v?[v.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,f)=>{let v=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw new Error;return v},_getDefaultColumnDef:F(()=>[o.options.defaultColumn],m=>{var f;return m=(f=m)!=null?f:{},{header:v=>{const p=v.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:v=>{var p,y;return(p=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?p:null},...o._features.reduce((v,p)=>Object.assign(v,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...m}},D(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:F(()=>[o._getColumnDefs()],m=>{const f=function(v,p,y){return y===void 0&&(y=0),v.map(x=>{const w=Dd(o,x,y,p),b=x;return w.columns=b.columns?f(b.columns,w,y+1):[],w})};return f(m)},D(e,"debugColumns")),getAllFlatColumns:F(()=>[o.getAllColumns()],m=>m.flatMap(f=>f.getFlatColumns()),D(e,"debugColumns")),_getAllFlatColumnsById:F(()=>[o.getAllFlatColumns()],m=>m.reduce((f,v)=>(f[v.id]=v,f),{}),D(e,"debugColumns")),getAllLeafColumns:F(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,f)=>{let v=m.flatMap(p=>p.getLeafColumns());return f(v)},D(e,"debugColumns")),getColumn:m=>o._getAllFlatColumnsById()[m]};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const f=o._features[m];f==null||f.createTable==null||f.createTable(o)}return o}function wf(){return e=>F(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let u=0;u<o.length;u++){const d=zo(e,e._getRowId(o[u],u,i),o[u],u,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var c;d.originalSubRows=e.options.getSubRows(o[u],u),(c=d.originalSubRows)!=null&&c.length&&(d.subRows=r(d.originalSubRows,s+1,d))}}return a};return n.rows=r(t),n},D(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function bf(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function _f(e,t,n){return n.options.filterFromLeafRows?Sf(e,t,n):Cf(e,t,n)}function Sf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,u){u===void 0&&(u=0);const d=[];for(let m=0;m<c.length;m++){var g;let f=c[m];const v=zo(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(v.columnFilters=f.columnFilters,(g=f.subRows)!=null&&g.length&&u<i){if(v.subRows=a(f.subRows,u+1),f=v,t(f)&&!v.subRows.length){d.push(f),s[f.id]=f,o.push(f);continue}if(t(f)||v.subRows.length){d.push(f),s[f.id]=f,o.push(f);continue}}else f=v,t(f)&&(d.push(f),s[f.id]=f,o.push(f))}return d};return{rows:a(e),flatRows:o,rowsById:s}}function Cf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,u){u===void 0&&(u=0);const d=[];for(let m=0;m<c.length;m++){let f=c[m];if(t(f)){var g;if((g=f.subRows)!=null&&g.length&&u<i){const p=zo(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);p.subRows=a(f.subRows,u+1),f=p}d.push(f),o.push(f),s[f.id]=f}}return d};return{rows:a(e),flatRows:o,rowsById:s}}function Rf(){return e=>F(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var f;const v=e.getColumn(m.id);if(!v)return;const p=v.getFilterFn();p&&o.push({id:m.id,filterFn:p,resolvedValue:(f=p.resolveFilterValue==null?void 0:p.resolveFilterValue(m.value))!=null?f:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&c.length&&(i.push("__global__"),c.forEach(m=>{var f;s.push({id:m.id,filterFn:a,resolvedValue:(f=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?f:r})}));let u,d;for(let m=0;m<t.flatRows.length;m++){const f=t.flatRows[m];if(f.columnFilters={},o.length)for(let v=0;v<o.length;v++){u=o[v];const p=u.id;f.columnFilters[p]=u.filterFn(f,p,u.resolvedValue,y=>{f.columnFiltersMeta[p]=y})}if(s.length){for(let v=0;v<s.length;v++){d=s[v];const p=d.id;if(d.filterFn(f,p,d.resolvedValue,y=>{f.columnFiltersMeta[p]=y})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const g=m=>{for(let f=0;f<i.length;f++)if(m.columnFilters[i[f]]===!1)return!1;return!0};return _f(t.rows,g,e)},D(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function kf(e){return t=>F(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:s}=n;let{rows:i,flatRows:a,rowsById:c}=r;const u=o*s,d=u+o;i=i.slice(u,d);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:a,rowsById:c}:g=bf({rows:i,flatRows:a,rowsById:c}),g.flatRows=[];const m=f=>{g.flatRows.push(f),f.subRows.length&&f.subRows.forEach(m)};return g.rows.forEach(m),g},D(t.options,"debugTable"))}function Ef(){return e=>F(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(c=>{var u;return(u=e.getColumn(c.id))==null?void 0:u.getCanSort()}),i={};s.forEach(c=>{const u=e.getColumn(c.id);u&&(i[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=c=>{const u=c.map(d=>({...d}));return u.sort((d,g)=>{for(let f=0;f<s.length;f+=1){var m;const v=s[f],p=i[v.id],y=p.sortUndefined,x=(m=v==null?void 0:v.desc)!=null?m:!1;let w=0;if(y){const b=d.getValue(v.id),_=g.getValue(v.id),C=b===void 0,N=_===void 0;if(C||N){if(y==="first")return C?-1:1;if(y==="last")return C?1:-1;w=C&&N?0:C?y:-y}}if(w===0&&(w=p.sortingFn(d,g,v.id)),w!==0)return x&&(w*=-1),p.invertSorting&&(w*=-1),w}return d.index-g.index}),u.forEach(d=>{var g;o.push(d),(g=d.subRows)!=null&&g.length&&(d.subRows=a(d.subRows))}),u};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},D(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
97
|
-
* react-table
|
|
98
|
-
*
|
|
99
|
-
* Copyright (c) TanStack
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the MIT license found in the
|
|
102
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
103
|
-
*
|
|
104
|
-
* @license MIT
|
|
105
|
-
*/function Os(e,t){return e?Mf(e)?h.createElement(e,t):e:null}function Mf(e){return Nf(e)||typeof e=="function"||Af(e)}function Nf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Af(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Tf(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:yf(t)})),[r,o]=h.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const jf=Vo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",xl:"h-12 rounded-md px-8 text-base",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Nt=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?oa:"button";return l.jsx(i,{className:ue(jf({variant:t,size:n,className:e})),ref:s,...o})});Nt.displayName="Button";function Ta(e){const t=e+"CollectionProvider",[n,r]=Pt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:y,children:x}=p,w=He.useRef(null),b=He.useRef(new Map).current;return l.jsx(o,{scope:y,itemMap:b,collectionRef:w,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=mn(a),u=He.forwardRef((p,y)=>{const{scope:x,children:w}=p,b=s(a,x),_=ke(y,b.collectionRef);return l.jsx(c,{ref:_,children:w})});u.displayName=a;const d=e+"CollectionItemSlot",g="data-radix-collection-item",m=mn(d),f=He.forwardRef((p,y)=>{const{scope:x,children:w,...b}=p,_=He.useRef(null),C=ke(y,_),N=s(d,x);return He.useEffect(()=>(N.itemMap.set(_,{ref:_,...b}),()=>void N.itemMap.delete(_))),l.jsx(m,{[g]:"",ref:C,children:w})});f.displayName=d;function v(p){const y=s(e+"CollectionConsumer",p);return He.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${g}]`));return Array.from(y.itemMap.values()).sort((N,E)=>b.indexOf(N.ref.current)-b.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:f},v,r]}var If=h.createContext(void 0);function Uo(e){const t=h.useContext(If);return e||t||"ltr"}function it(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Pf(e,t=globalThis==null?void 0:globalThis.document){const n=it(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Of="DismissableLayer",go="dismissableLayer.update",Ff="dismissableLayer.pointerDownOutside",Df="dismissableLayer.focusOutside",Fs,ja=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ia=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=h.useContext(ja),[d,g]=h.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=h.useState({}),v=ke(t,E=>g(E)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(y),w=d?p.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,_=w>=x,C=Vf(E=>{const S=E.target,$=[...u.branches].some(L=>L.contains(S));!_||$||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},m),N=zf(E=>{const S=E.target;[...u.branches].some(L=>L.contains(S))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},m);return Pf(E=>{w===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},m),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Fs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ds(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Fs)}},[d,m,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ds())},[d,u]),h.useEffect(()=>{const E=()=>f({});return document.addEventListener(go,E),()=>document.removeEventListener(go,E)},[]),l.jsx(fe.div,{...c,ref:v,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,N.onFocusCapture),onBlurCapture:q(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,C.onPointerDownCapture)})});Ia.displayName=Of;var $f="DismissableLayerBranch",Lf=h.forwardRef((e,t)=>{const n=h.useContext(ja),r=h.useRef(null),o=ke(t,r);return h.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(fe.div,{...e,ref:o})});Lf.displayName=$f;function Vf(e,t=globalThis==null?void 0:globalThis.document){const n=it(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Pa(Ff,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zf(e,t=globalThis==null?void 0:globalThis.document){const n=it(e),r=h.useRef(!1);return h.useEffect(()=>{const o=s=>{s.target&&!r.current&&Pa(Df,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ds(){const e=new CustomEvent(go);document.dispatchEvent(e)}function Pa(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?sa(o,s):o.dispatchEvent(s)}var Dr=0;function Hf(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$s()),document.body.insertAdjacentElement("beforeend",e[1]??$s()),Dr++,()=>{Dr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dr--}},[])}function $s(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $r="focusScope.autoFocusOnMount",Lr="focusScope.autoFocusOnUnmount",Ls={bubbles:!1,cancelable:!0},Gf="FocusScope",Oa=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=h.useState(null),u=it(o),d=it(s),g=h.useRef(null),m=ke(t,p=>c(p)),f=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let p=function(b){if(f.paused||!a)return;const _=b.target;a.contains(_)?g.current=_:mt(g.current,{select:!0})},y=function(b){if(f.paused||!a)return;const _=b.relatedTarget;_!==null&&(a.contains(_)||mt(g.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&mt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),w.disconnect()}}},[r,a,f.paused]),h.useEffect(()=>{if(a){zs.add(f);const p=document.activeElement;if(!a.contains(p)){const x=new CustomEvent($r,Ls);a.addEventListener($r,u),a.dispatchEvent(x),x.defaultPrevented||(Bf(Kf(Fa(a)),{select:!0}),document.activeElement===p&&mt(a))}return()=>{a.removeEventListener($r,u),setTimeout(()=>{const x=new CustomEvent(Lr,Ls);a.addEventListener(Lr,d),a.dispatchEvent(x),x.defaultPrevented||mt(p??document.body,{select:!0}),a.removeEventListener(Lr,d),zs.remove(f)},0)}}},[a,u,d,f]);const v=h.useCallback(p=>{if(!n&&!r||f.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(y&&x){const w=p.currentTarget,[b,_]=Uf(w);b&&_?!p.shiftKey&&x===_?(p.preventDefault(),n&&mt(b,{select:!0})):p.shiftKey&&x===b&&(p.preventDefault(),n&&mt(_,{select:!0})):x===w&&p.preventDefault()}},[n,r,f.paused]);return l.jsx(fe.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Oa.displayName=Gf;function Bf(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mt(r,{select:t}),document.activeElement!==n)return}function Uf(e){const t=Fa(e),n=Vs(t,e),r=Vs(t.reverse(),e);return[n,r]}function Fa(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Vs(e,t){for(const n of e)if(!Wf(n,{upTo:t}))return n}function Wf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qf(e){return e instanceof HTMLInputElement&&"select"in e}function mt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qf(e)&&t&&e.select()}}var zs=Zf();function Zf(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Hs(e,t),e.unshift(t)},remove(t){var n;e=Hs(e,t),(n=e[0])==null||n.resume()}}}function Hs(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Kf(e){return e.filter(t=>t.tagName!=="A")}var Xf=Fi[" useId ".trim().toString()]||(()=>{}),Yf=0;function Bn(e){const[t,n]=h.useState(Xf());return bt(()=>{n(r=>r??String(Yf++))},[e]),e||(t?`radix-${t}`:"")}const Jf=["top","right","bottom","left"],St=Math.min,Ae=Math.max,Un=Math.round,Pn=Math.floor,We=e=>({x:e,y:e}),Qf={left:"right",right:"left",bottom:"top",top:"bottom"},em={start:"end",end:"start"};function po(e,t,n){return Ae(e,St(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function lt(e){return e.split("-")[0]}function tn(e){return e.split("-")[1]}function Wo(e){return e==="x"?"y":"x"}function qo(e){return e==="y"?"height":"width"}const tm=new Set(["top","bottom"]);function Ue(e){return tm.has(lt(e))?"y":"x"}function Zo(e){return Wo(Ue(e))}function nm(e,t,n){n===void 0&&(n=!1);const r=tn(e),o=Zo(e),s=qo(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Wn(i)),[i,Wn(i)]}function rm(e){const t=Wn(e);return[ho(e),t,ho(t)]}function ho(e){return e.replace(/start|end/g,t=>em[t])}const Gs=["left","right"],Bs=["right","left"],om=["top","bottom"],sm=["bottom","top"];function im(e,t,n){switch(e){case"top":case"bottom":return n?t?Bs:Gs:t?Gs:Bs;case"left":case"right":return t?om:sm;default:return[]}}function am(e,t,n,r){const o=tn(e);let s=im(lt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ho)))),s}function Wn(e){return e.replace(/left|right|bottom|top/g,t=>Qf[t])}function lm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Da(e){return typeof e!="number"?lm(e):{top:e,right:e,bottom:e,left:e}}function qn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Us(e,t,n){let{reference:r,floating:o}=e;const s=Ue(t),i=Zo(t),a=qo(i),c=lt(t),u=s==="y",d=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let f;switch(c){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:g};break;case"left":f={x:r.x-o.width,y:g};break;default:f={x:r.x,y:r.y}}switch(tn(t)){case"start":f[i]-=m*(n&&u?-1:1);break;case"end":f[i]+=m*(n&&u?-1:1);break}return f}const cm=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:g}=Us(u,r,c),m=r,f={},v=0;for(let p=0;p<a.length;p++){const{name:y,fn:x}=a[p],{x:w,y:b,data:_,reset:C}=await x({x:d,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});d=w??d,g=b??g,f={...f,[y]:{...f[y],..._}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:g}=Us(u,m,c)),p=-1)}return{x:d,y:g,placement:m,strategy:o,middlewareData:f}};async function gn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:g="floating",altBoundary:m=!1,padding:f=0}=at(t,e),v=Da(f),y=a[m?g==="floating"?"reference":"floating":g],x=qn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),_=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},C=qn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-C.top+v.top)/_.y,bottom:(C.bottom-x.bottom+v.bottom)/_.y,left:(x.left-C.left+v.left)/_.x,right:(C.right-x.right+v.right)/_.x}}const um=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=at(e,t)||{};if(u==null)return{};const g=Da(d),m={x:n,y:r},f=Zo(o),v=qo(f),p=await i.getDimensions(u),y=f==="y",x=y?"top":"left",w=y?"bottom":"right",b=y?"clientHeight":"clientWidth",_=s.reference[v]+s.reference[f]-m[f]-s.floating[v],C=m[f]-s.reference[f],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=N?N[b]:0;(!E||!await(i.isElement==null?void 0:i.isElement(N)))&&(E=a.floating[b]||s.floating[v]);const S=_/2-C/2,$=E/2-p[v]/2-1,L=St(g[x],$),X=St(g[w],$),te=L,Z=E-p[v]-X,V=E/2-p[v]/2+S,ne=po(te,V,Z),G=!c.arrow&&tn(o)!=null&&V!==ne&&s.reference[v]/2-(V<te?L:X)-p[v]/2<0,J=G?V<te?V-te:V-Z:0;return{[f]:m[f]+J,data:{[f]:ne,centerOffset:V-ne-J,...G&&{alignmentOffset:J}},reset:G}}}),dm=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...y}=at(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=lt(o),w=Ue(a),b=lt(a)===a,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=m||(b||!p?[Wn(a)]:rm(a)),N=v!=="none";!m&&N&&C.push(...am(a,p,v,_));const E=[a,...C],S=await gn(t,y),$=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&$.push(S[x]),g){const V=nm(o,i,_);$.push(S[V[0]],S[V[1]])}if(L=[...L,{placement:o,overflows:$}],!$.every(V=>V<=0)){var X,te;const V=(((X=s.flip)==null?void 0:X.index)||0)+1,ne=E[V];if(ne&&(!(g==="alignment"?w!==Ue(ne):!1)||L.every(R=>Ue(R.placement)===w?R.overflows[0]>0:!0)))return{data:{index:V,overflows:L},reset:{placement:ne}};let G=(te=L.filter(J=>J.overflows[0]<=0).sort((J,R)=>J.overflows[1]-R.overflows[1])[0])==null?void 0:te.placement;if(!G)switch(f){case"bestFit":{var Z;const J=(Z=L.filter(R=>{if(N){const M=Ue(R.placement);return M===w||M==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(M=>M>0).reduce((M,H)=>M+H,0)]).sort((R,M)=>R[1]-M[1])[0])==null?void 0:Z[0];J&&(G=J);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function Ws(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qs(e){return Jf.some(t=>e[t]>=0)}const fm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=at(e,t);switch(r){case"referenceHidden":{const s=await gn(t,{...o,elementContext:"reference"}),i=Ws(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:qs(i)}}}case"escaped":{const s=await gn(t,{...o,altBoundary:!0}),i=Ws(s,n.floating);return{data:{escapedOffsets:i,escaped:qs(i)}}}default:return{}}}}},$a=new Set(["left","top"]);async function mm(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=lt(n),a=tn(n),c=Ue(n)==="y",u=$a.has(i)?-1:1,d=s&&c?-1:1,g=at(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),c?{x:f*d,y:m*u}:{x:m*u,y:f*d}}const gm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await mm(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},pm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x,y:w}=y;return{x,y:w}}},...c}=at(e,t),u={x:n,y:r},d=await gn(t,c),g=Ue(lt(o)),m=Wo(g);let f=u[m],v=u[g];if(s){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=f+d[y],b=f-d[x];f=po(w,f,b)}if(i){const y=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=v+d[y],b=v-d[x];v=po(w,v,b)}const p=a.fn({...t,[m]:f,[g]:v});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[m]:s,[g]:i}}}}}},hm=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=at(e,t),d={x:n,y:r},g=Ue(o),m=Wo(g);let f=d[m],v=d[g];const p=at(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const b=m==="y"?"height":"width",_=s.reference[m]-s.floating[b]+y.mainAxis,C=s.reference[m]+s.reference[b]-y.mainAxis;f<_?f=_:f>C&&(f=C)}if(u){var x,w;const b=m==="y"?"width":"height",_=$a.has(lt(o)),C=s.reference[g]-s.floating[b]+(_&&((x=i.offset)==null?void 0:x[g])||0)+(_?0:y.crossAxis),N=s.reference[g]+s.reference[b]+(_?0:((w=i.offset)==null?void 0:w[g])||0)-(_?y.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:f,[g]:v}}}},vm=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=at(e,t),d=await gn(t,u),g=lt(o),m=tn(o),f=Ue(o)==="y",{width:v,height:p}=s.floating;let y,x;g==="top"||g==="bottom"?(y=g,x=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=g,y=m==="end"?"top":"bottom");const w=p-d.top-d.bottom,b=v-d.left-d.right,_=St(p-d[y],w),C=St(v-d[x],b),N=!t.middlewareData.shift;let E=_,S=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=w),N&&!m){const L=Ae(d.left,0),X=Ae(d.right,0),te=Ae(d.top,0),Z=Ae(d.bottom,0);f?S=v-2*(L!==0||X!==0?L+X:Ae(d.left,d.right)):E=p-2*(te!==0||Z!==0?te+Z:Ae(d.top,d.bottom))}await c({...t,availableWidth:S,availableHeight:E});const $=await i.getDimensions(a.floating);return v!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}};function ir(){return typeof window<"u"}function nn(e){return La(e)?(e.nodeName||"").toLowerCase():"#document"}function Te(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ke(e){var t;return(t=(La(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function La(e){return ir()?e instanceof Node||e instanceof Te(e).Node:!1}function $e(e){return ir()?e instanceof Element||e instanceof Te(e).Element:!1}function Ze(e){return ir()?e instanceof HTMLElement||e instanceof Te(e).HTMLElement:!1}function Zs(e){return!ir()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Te(e).ShadowRoot}const xm=new Set(["inline","contents"]);function bn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Le(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!xm.has(o)}const ym=new Set(["table","td","th"]);function wm(e){return ym.has(nn(e))}const bm=[":popover-open",":modal"];function ar(e){return bm.some(t=>{try{return e.matches(t)}catch{return!1}})}const _m=["transform","translate","scale","rotate","perspective"],Sm=["transform","translate","scale","rotate","perspective","filter"],Cm=["paint","layout","strict","content"];function Ko(e){const t=Xo(),n=$e(e)?Le(e):e;return _m.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Sm.some(r=>(n.willChange||"").includes(r))||Cm.some(r=>(n.contain||"").includes(r))}function Rm(e){let t=Ct(e);for(;Ze(t)&&!qt(t);){if(Ko(t))return t;if(ar(t))return null;t=Ct(t)}return null}function Xo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const km=new Set(["html","body","#document"]);function qt(e){return km.has(nn(e))}function Le(e){return Te(e).getComputedStyle(e)}function lr(e){return $e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(nn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zs(e)&&e.host||Ke(e);return Zs(t)?t.host:t}function Va(e){const t=Ct(e);return qt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&bn(t)?t:Va(t)}function pn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Va(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Te(o);if(s){const a=vo(i);return t.concat(i,i.visualViewport||[],bn(o)?o:[],a&&n?pn(a):[])}return t.concat(o,pn(o,[],n))}function vo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function za(e){const t=Le(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Un(n)!==s||Un(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Yo(e){return $e(e)?e:e.contextElement}function Ut(e){const t=Yo(e);if(!Ze(t))return We(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=za(t);let i=(s?Un(n.width):n.width)/r,a=(s?Un(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Em=We(0);function Ha(e){const t=Te(e);return!Xo()||!t.visualViewport?Em:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Te(e)?!1:t}function Tt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Yo(e);let i=We(1);t&&(r?$e(r)&&(i=Ut(r)):i=Ut(e));const a=Mm(s,n,r)?Ha(s):We(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,g=o.height/i.y;if(s){const m=Te(s),f=r&&$e(r)?Te(r):r;let v=m,p=vo(v);for(;p&&r&&f!==v;){const y=Ut(p),x=p.getBoundingClientRect(),w=Le(p),b=x.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,_=x.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,g*=y.y,c+=b,u+=_,v=Te(p),p=vo(v)}}return qn({width:d,height:g,x:c,y:u})}function cr(e,t){const n=lr(e).scrollLeft;return t?t.left+n:Tt(Ke(e)).left+n}function Ga(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Nm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ke(r),a=t?ar(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=We(1);const d=We(0),g=Ze(r);if((g||!g&&!s)&&((nn(r)!=="body"||bn(i))&&(c=lr(r)),Ze(r))){const f=Tt(r);u=Ut(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const m=i&&!g&&!s?Ga(i,c):We(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:n.y*u.y-c.scrollTop*u.y+d.y+m.y}}function Am(e){return Array.from(e.getClientRects())}function Tm(e){const t=Ke(e),n=lr(e),r=e.ownerDocument.body,o=Ae(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ae(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+cr(e);const a=-n.scrollTop;return Le(r).direction==="rtl"&&(i+=Ae(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Ks=25;function jm(e,t){const n=Te(e),r=Ke(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Xo();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=cr(r);if(u<=0){const d=r.ownerDocument,g=d.body,m=getComputedStyle(g),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(r.clientWidth-g.clientWidth-f);v<=Ks&&(s-=v)}else u<=Ks&&(s+=u);return{width:s,height:i,x:a,y:c}}const Im=new Set(["absolute","fixed"]);function Pm(e,t){const n=Tt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ze(e)?Ut(e):We(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Xs(e,t,n){let r;if(t==="viewport")r=jm(e,n);else if(t==="document")r=Tm(Ke(e));else if($e(t))r=Pm(t,n);else{const o=Ha(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return qn(r)}function Ba(e,t){const n=Ct(e);return n===t||!$e(n)||qt(n)?!1:Le(n).position==="fixed"||Ba(n,t)}function Om(e,t){const n=t.get(e);if(n)return n;let r=pn(e,[],!1).filter(a=>$e(a)&&nn(a)!=="body"),o=null;const s=Le(e).position==="fixed";let i=s?Ct(e):e;for(;$e(i)&&!qt(i);){const a=Le(i),c=Ko(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Im.has(o.position)||bn(i)&&!c&&Ba(e,i))?r=r.filter(d=>d!==i):o=a,i=Ct(i)}return t.set(e,r),r}function Fm(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ar(t)?[]:Om(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,d)=>{const g=Xs(t,d,o);return u.top=Ae(g.top,u.top),u.right=St(g.right,u.right),u.bottom=St(g.bottom,u.bottom),u.left=Ae(g.left,u.left),u},Xs(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Dm(e){const{width:t,height:n}=za(e);return{width:t,height:n}}function $m(e,t,n){const r=Ze(t),o=Ke(t),s=n==="fixed",i=Tt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=We(0);function u(){c.x=cr(o)}if(r||!r&&!s)if((nn(t)!=="body"||bn(o))&&(a=lr(t)),r){const f=Tt(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Ga(o,a):We(0),g=i.left+a.scrollLeft-c.x-d.x,m=i.top+a.scrollTop-c.y-d.y;return{x:g,y:m,width:i.width,height:i.height}}function Vr(e){return Le(e).position==="static"}function Ys(e,t){if(!Ze(e)||Le(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ke(e)===n&&(n=n.ownerDocument.body),n}function Ua(e,t){const n=Te(e);if(ar(e))return n;if(!Ze(e)){let o=Ct(e);for(;o&&!qt(o);){if($e(o)&&!Vr(o))return o;o=Ct(o)}return n}let r=Ys(e,t);for(;r&&wm(r)&&Vr(r);)r=Ys(r,t);return r&&qt(r)&&Vr(r)&&!Ko(r)?n:r||Rm(e)||n}const Lm=async function(e){const t=this.getOffsetParent||Ua,n=this.getDimensions,r=await n(e.floating);return{reference:$m(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vm(e){return Le(e).direction==="rtl"}const zm={convertOffsetParentRelativeRectToViewportRelativeRect:Nm,getDocumentElement:Ke,getClippingRect:Fm,getOffsetParent:Ua,getElementRects:Lm,getClientRects:Am,getDimensions:Dm,getScale:Ut,isElement:$e,isRTL:Vm};function Wa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hm(e,t){let n=null,r;const o=Ke(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:g,width:m,height:f}=u;if(a||t(),!m||!f)return;const v=Pn(g),p=Pn(o.clientWidth-(d+m)),y=Pn(o.clientHeight-(g+f)),x=Pn(d),b={rootMargin:-v+"px "+-p+"px "+-y+"px "+-x+"px",threshold:Ae(0,St(1,c))||1};let _=!0;function C(N){const E=N[0].intersectionRatio;if(E!==c){if(!_)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Wa(u,e.getBoundingClientRect())&&i(),_=!1}try{n=new IntersectionObserver(C,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}return i(!0),s}function Gm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Yo(e),d=o||s?[...u?pn(u):[],...pn(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const g=u&&a?Hm(u,n):null;let m=-1,f=null;i&&(f=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)})),n()}),u&&!c&&f.observe(u),f.observe(t));let v,p=c?Tt(e):null;c&&y();function y(){const x=Tt(e);p&&!Wa(p,x)&&n(),p=x,v=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),g==null||g(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(v)}}const Bm=gm,Um=pm,Wm=dm,qm=vm,Zm=fm,Js=um,Km=hm,Xm=(e,t,n)=>{const r=new Map,o={platform:zm,...n},s={...o.platform,_c:r};return cm(e,t,{...o,platform:s})};var Ym=typeof document<"u",Jm=function(){},zn=Ym?h.useLayoutEffect:Jm;function Zn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Zn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Zn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function qa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qs(e,t){const n=qa(e);return Math.round(t*n)/n}function zr(e){const t=h.useRef(e);return zn(()=>{t.current=e}),t}function Qm(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=h.useState(r);Zn(m,r)||f(r);const[v,p]=h.useState(null),[y,x]=h.useState(null),w=h.useCallback(R=>{R!==N.current&&(N.current=R,p(R))},[]),b=h.useCallback(R=>{R!==E.current&&(E.current=R,x(R))},[]),_=s||v,C=i||y,N=h.useRef(null),E=h.useRef(null),S=h.useRef(d),$=c!=null,L=zr(c),X=zr(o),te=zr(u),Z=h.useCallback(()=>{if(!N.current||!E.current)return;const R={placement:t,strategy:n,middleware:m};X.current&&(R.platform=X.current),Xm(N.current,E.current,R).then(M=>{const H={...M,isPositioned:te.current!==!1};V.current&&!Zn(S.current,H)&&(S.current=H,Do.flushSync(()=>{g(H)}))})},[m,t,n,X,te]);zn(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,g(R=>({...R,isPositioned:!1})))},[u]);const V=h.useRef(!1);zn(()=>(V.current=!0,()=>{V.current=!1}),[]),zn(()=>{if(_&&(N.current=_),C&&(E.current=C),_&&C){if(L.current)return L.current(_,C,Z);Z()}},[_,C,Z,L,$]);const ne=h.useMemo(()=>({reference:N,floating:E,setReference:w,setFloating:b}),[w,b]),G=h.useMemo(()=>({reference:_,floating:C}),[_,C]),J=h.useMemo(()=>{const R={position:n,left:0,top:0};if(!G.floating)return R;const M=Qs(G.floating,d.x),H=Qs(G.floating,d.y);return a?{...R,transform:"translate("+M+"px, "+H+"px)",...qa(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:H}},[n,a,G.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:Z,refs:ne,elements:G,floatingStyles:J}),[d,Z,ne,G,J])}const eg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Js({element:r.current,padding:o}).fn(n):{}:r?Js({element:r,padding:o}).fn(n):{}}}},tg=(e,t)=>({...Bm(e),options:[e,t]}),ng=(e,t)=>({...Um(e),options:[e,t]}),rg=(e,t)=>({...Km(e),options:[e,t]}),og=(e,t)=>({...Wm(e),options:[e,t]}),sg=(e,t)=>({...qm(e),options:[e,t]}),ig=(e,t)=>({...Zm(e),options:[e,t]}),ag=(e,t)=>({...eg(e),options:[e,t]});var lg="Arrow",Za=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(fe.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Za.displayName=lg;var cg=Za,Jo="Popper",[Ka,Xa]=Pt(Jo),[ug,Ya]=Ka(Jo),Ja=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return l.jsx(ug,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ja.displayName=Jo;var Qa="PopperAnchor",el=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Ya(Qa,n),i=h.useRef(null),a=ke(t,i),c=h.useRef(null);return h.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(fe.div,{...o,ref:a})});el.displayName=Qa;var Qo="PopperContent",[dg,fg]=Ka(Qo),tl=h.forwardRef((e,t)=>{var Q,ze,ve,Se,Xe,ut;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:v,...p}=e,y=Ya(Qo,n),[x,w]=h.useState(null),b=ke(t,ee=>w(ee)),[_,C]=h.useState(null),N=ra(_),E=(N==null?void 0:N.width)??0,S=(N==null?void 0:N.height)??0,$=r+(s!=="center"?"-"+s:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},X=Array.isArray(u)?u:[u],te=X.length>0,Z={padding:L,boundary:X.filter(gg),altBoundary:te},{refs:V,floatingStyles:ne,placement:G,isPositioned:J,middlewareData:R}=Qm({strategy:"fixed",placement:$,whileElementsMounted:(...ee)=>Gm(...ee,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[tg({mainAxis:o+S,alignmentAxis:i}),c&&ng({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?rg():void 0,...Z}),c&&og({...Z}),sg({...Z,apply:({elements:ee,rects:ce,availableWidth:pe,availableHeight:ae})=>{const{width:Ne,height:dt}=ce.reference,ge=ee.floating.style;ge.setProperty("--radix-popper-available-width",`${pe}px`),ge.setProperty("--radix-popper-available-height",`${ae}px`),ge.setProperty("--radix-popper-anchor-width",`${Ne}px`),ge.setProperty("--radix-popper-anchor-height",`${dt}px`)}}),_&&ag({element:_,padding:a}),pg({arrowWidth:E,arrowHeight:S}),m&&ig({strategy:"referenceHidden",...Z})]}),[M,H]=ol(G),z=it(v);bt(()=>{J&&(z==null||z())},[J,z]);const Y=(Q=R.arrow)==null?void 0:Q.x,re=(ze=R.arrow)==null?void 0:ze.y,le=((ve=R.arrow)==null?void 0:ve.centerOffset)!==0,[be,_e]=h.useState();return bt(()=>{x&&_e(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:J?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Se=R.transformOrigin)==null?void 0:Se.x,(Xe=R.transformOrigin)==null?void 0:Xe.y].join(" "),...((ut=R.hide)==null?void 0:ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(dg,{scope:n,placedSide:M,onArrowChange:C,arrowX:Y,arrowY:re,shouldHideArrow:le,children:l.jsx(fe.div,{"data-side":M,"data-align":H,...p,ref:b,style:{...p.style,animation:J?void 0:"none"}})})})});tl.displayName=Qo;var nl="PopperArrow",mg={top:"bottom",right:"left",bottom:"top",left:"right"},rl=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=fg(nl,r),i=mg[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(cg,{...o,ref:n,style:{...o.style,display:"block"}})})});rl.displayName=nl;function gg(e){return e!==null}var pg=e=>({name:"transformOrigin",options:e,fn(t){var y,x,w;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=ol(n),g={start:"0%",center:"50%",end:"100%"}[d],m=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,f=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let v="",p="";return u==="bottom"?(v=i?g:`${m}px`,p=`${-c}px`):u==="top"?(v=i?g:`${m}px`,p=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,p=i?g:`${f}px`):u==="left"&&(v=`${r.floating.width+c}px`,p=i?g:`${f}px`),{data:{x:v,y:p}}}});function ol(e){const[t,n="center"]=e.split("-");return[t,n]}var hg=Ja,vg=el,xg=tl,yg=rl,wg="Portal",sl=h.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=h.useState(!1);bt(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?zu.createPortal(l.jsx(fe.div,{...r,ref:t}),i):null});sl.displayName=wg;var Hr="rovingFocusGroup.onEntryFocus",bg={bubbles:!1,cancelable:!0},_n="RovingFocusGroup",[xo,il,_g]=Ta(_n),[Sg,ur]=Pt(_n,[_g]),[Cg,Rg]=Sg(_n),al=h.forwardRef((e,t)=>l.jsx(xo.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(xo.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(kg,{...e,ref:t})})}));al.displayName=_n;var kg=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...g}=e,m=h.useRef(null),f=ke(t,m),v=Uo(s),[p,y]=rr({prop:i,defaultProp:a??null,onChange:c,caller:_n}),[x,w]=h.useState(!1),b=it(u),_=il(n),C=h.useRef(!1),[N,E]=h.useState(0);return h.useEffect(()=>{const S=m.current;if(S)return S.addEventListener(Hr,b),()=>S.removeEventListener(Hr,b)},[b]),l.jsx(Cg,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:p,onItemFocus:h.useCallback(S=>y(S),[y]),onItemShiftTab:h.useCallback(()=>w(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(S=>S+1),[]),onFocusableItemRemove:h.useCallback(()=>E(S=>S-1),[]),children:l.jsx(fe.div,{tabIndex:x||N===0?-1:0,"data-orientation":r,...g,ref:f,style:{outline:"none",...e.style},onMouseDown:q(e.onMouseDown,()=>{C.current=!0}),onFocus:q(e.onFocus,S=>{const $=!C.current;if(S.target===S.currentTarget&&$&&!x){const L=new CustomEvent(Hr,bg);if(S.currentTarget.dispatchEvent(L),!L.defaultPrevented){const X=_().filter(G=>G.focusable),te=X.find(G=>G.active),Z=X.find(G=>G.id===p),ne=[te,Z,...X].filter(Boolean).map(G=>G.ref.current);ul(ne,d)}}C.current=!1}),onBlur:q(e.onBlur,()=>w(!1))})})}),ll="RovingFocusGroupItem",cl=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Bn(),u=s||c,d=Rg(ll,n),g=d.currentTabStopId===u,m=il(n),{onFocusableItemAdd:f,onFocusableItemRemove:v,currentTabStopId:p}=d;return h.useEffect(()=>{if(r)return f(),()=>v()},[r,f,v]),l.jsx(xo.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(fe.span,{tabIndex:g?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:q(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:q(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:q(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=Ng(y,d.orientation,d.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=m().filter(_=>_.focusable).map(_=>_.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const _=b.indexOf(y.currentTarget);b=d.loop?Ag(b,_+1):b.slice(_+1)}setTimeout(()=>ul(b))}}),children:typeof i=="function"?i({isCurrentTabStop:g,hasTabStop:p!=null}):i})})});cl.displayName=ll;var Eg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mg(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ng(e,t,n){const r=Mg(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Eg[r]}function ul(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ag(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dl=al,fl=cl,Tg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lt=new WeakMap,On=new WeakMap,Fn={},Gr=0,ml=function(e){return e&&(e.host||ml(e.parentNode))},jg=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ml(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ig=function(e,t,n,r){var o=jg(t,Array.isArray(e)?e:[e]);Fn[n]||(Fn[n]=new WeakMap);var s=Fn[n],i=[],a=new Set,c=new Set(o),u=function(g){!g||a.has(g)||(a.add(g),u(g.parentNode))};o.forEach(u);var d=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))d(m);else try{var f=m.getAttribute(r),v=f!==null&&f!=="false",p=(Lt.get(m)||0)+1,y=(s.get(m)||0)+1;Lt.set(m,p),s.set(m,y),i.push(m),p===1&&v&&On.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return d(t),a.clear(),Gr++,function(){i.forEach(function(g){var m=Lt.get(g)-1,f=s.get(g)-1;Lt.set(g,m),s.set(g,f),m||(On.has(g)||g.removeAttribute(r),On.delete(g)),f||g.removeAttribute(n)}),Gr--,Gr||(Lt=new WeakMap,Lt=new WeakMap,On=new WeakMap,Fn={})}},Pg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Tg(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Ig(r,o,n,"aria-hidden")):function(){return null}},Be=function(){return Be=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Be.apply(this,arguments)};function gl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Og(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Hn="right-scroll-bar-position",Gn="width-before-scroll-bar",Fg="with-scroll-bars-hidden",Dg="--removed-body-scroll-bar-size";function Br(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $g(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Lg=typeof window<"u"?h.useLayoutEffect:h.useEffect,ei=new WeakMap;function Vg(e,t){var n=$g(null,function(r){return e.forEach(function(o){return Br(o,r)})});return Lg(function(){var r=ei.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Br(a,null)}),s.forEach(function(a){o.has(a)||Br(a,i)})}ei.set(n,e)},[e]),n}function zg(e){return e}function Hg(e,t){t===void 0&&(t=zg);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function Gg(e){e===void 0&&(e={});var t=Hg(null);return t.options=Be({async:!0,ssr:!1},e),t}var pl=function(e){var t=e.sideCar,n=gl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Be({},n))};pl.isSideCarExport=!0;function Bg(e,t){return e.useMedium(t),pl}var hl=Gg(),Ur=function(){},dr=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Ur,onWheelCapture:Ur,onTouchMoveCapture:Ur}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,g=e.shards,m=e.sideCar,f=e.noRelative,v=e.noIsolation,p=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,b=e.gapMode,_=gl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Vg([n,t]),E=Be(Be({},_),o);return h.createElement(h.Fragment,null,d&&h.createElement(C,{sideCar:hl,removeScrollBar:u,shards:g,noRelative:f,noIsolation:v,inert:p,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:b}),i?h.cloneElement(h.Children.only(a),Be(Be({},E),{ref:N})):h.createElement(w,Be({},E,{className:c,ref:N}),a))});dr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};dr.classNames={fullWidth:Gn,zeroRight:Hn};var Ug=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wg(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ug();return t&&e.setAttribute("nonce",t),e}function qg(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Zg(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Kg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wg())&&(qg(t,n),Zg(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xg=function(){var e=Kg();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vl=function(){var e=Xg(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Yg={left:0,top:0,right:0,gap:0},Wr=function(e){return parseInt(e||"",10)||0},Jg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Wr(n),Wr(r),Wr(o)]},Qg=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Yg;var t=Jg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ep=vl(),Wt="data-scroll-locked",tp=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
106
|
-
.`.concat(Fg,` {
|
|
107
|
-
overflow: hidden `).concat(r,`;
|
|
108
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
109
|
-
}
|
|
110
|
-
body[`).concat(Wt,`] {
|
|
111
|
-
overflow: hidden `).concat(r,`;
|
|
112
|
-
overscroll-behavior: contain;
|
|
113
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
114
|
-
padding-left: `.concat(o,`px;
|
|
115
|
-
padding-top: `).concat(s,`px;
|
|
116
|
-
padding-right: `).concat(i,`px;
|
|
117
|
-
margin-left:0;
|
|
118
|
-
margin-top:0;
|
|
119
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
120
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.`).concat(Hn,` {
|
|
124
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.`).concat(Gn,` {
|
|
128
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.`).concat(Hn," .").concat(Hn,` {
|
|
132
|
-
right: 0 `).concat(r,`;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.`).concat(Gn," .").concat(Gn,` {
|
|
136
|
-
margin-right: 0 `).concat(r,`;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
body[`).concat(Wt,`] {
|
|
140
|
-
`).concat(Dg,": ").concat(a,`px;
|
|
141
|
-
}
|
|
142
|
-
`)},ti=function(){var e=parseInt(document.body.getAttribute(Wt)||"0",10);return isFinite(e)?e:0},np=function(){h.useEffect(function(){return document.body.setAttribute(Wt,(ti()+1).toString()),function(){var e=ti()-1;e<=0?document.body.removeAttribute(Wt):document.body.setAttribute(Wt,e.toString())}},[])},rp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;np();var s=h.useMemo(function(){return Qg(o)},[o]);return h.createElement(ep,{styles:tp(s,!t,o,n?"":"!important")})},yo=!1;if(typeof window<"u")try{var Dn=Object.defineProperty({},"passive",{get:function(){return yo=!0,!0}});window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{yo=!1}var Vt=yo?{passive:!1}:!1,op=function(e){return e.tagName==="TEXTAREA"},xl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!op(e)&&n[t]==="visible")},sp=function(e){return xl(e,"overflowY")},ip=function(e){return xl(e,"overflowX")},ni=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=yl(e,r);if(o){var s=wl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ap=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},lp=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yl=function(e,t){return e==="v"?sp(t):ip(t)},wl=function(e,t){return e==="v"?ap(t):lp(t)},cp=function(e,t){return e==="h"&&t==="rtl"?-1:1},up=function(e,t,n,r,o){var s=cp(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,g=0,m=0;do{if(!a)break;var f=wl(e,a),v=f[0],p=f[1],y=f[2],x=p-y-s*v;(v||x)&&yl(e,a)&&(g+=x,m+=v);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(g)<1||!d&&Math.abs(m)<1)&&(u=!0),u},$n=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ri=function(e){return[e.deltaX,e.deltaY]},oi=function(e){return e&&"current"in e?e.current:e},dp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fp=function(e){return`
|
|
143
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
144
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
145
|
-
`)},mp=0,zt=[];function gp(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(mp++)[0],s=h.useState(vl)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Og([e.lockRef.current],(e.shards||[]).map(oi),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var x=$n(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-x[0],_="deltaY"in p?p.deltaY:w[1]-x[1],C,N=p.target,E=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in p&&E==="h"&&N.type==="range")return!1;var S=ni(E,N);if(!S)return!0;if(S?C=E:(C=E==="v"?"h":"v",S=ni(E,N)),!S)return!1;if(!r.current&&"changedTouches"in p&&(b||_)&&(r.current=C),!C)return!0;var $=r.current||C;return up($,y,p,$==="h"?b:_)},[]),c=h.useCallback(function(p){var y=p;if(!(!zt.length||zt[zt.length-1]!==s)){var x="deltaY"in y?ri(y):$n(y),w=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&dp(C.delta,x)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(oi).filter(Boolean).filter(function(C){return C.contains(y.target)}),_=b.length>0?a(y,b[0]):!i.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),u=h.useCallback(function(p,y,x,w){var b={name:p,delta:y,target:x,should:w,shadowParent:pp(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(_){return _!==b})},1)},[]),d=h.useCallback(function(p){n.current=$n(p),r.current=void 0},[]),g=h.useCallback(function(p){u(p.type,ri(p),p.target,a(p,e.lockRef.current))},[]),m=h.useCallback(function(p){u(p.type,$n(p),p.target,a(p,e.lockRef.current))},[]);h.useEffect(function(){return zt.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Vt),document.addEventListener("touchmove",c,Vt),document.addEventListener("touchstart",d,Vt),function(){zt=zt.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,Vt),document.removeEventListener("touchmove",c,Vt),document.removeEventListener("touchstart",d,Vt)}},[]);var f=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:fp(o)}):null,f?h.createElement(rp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hp=Bg(hl,gp);var bl=h.forwardRef(function(e,t){return h.createElement(dr,Be({},e,{ref:t,sideCar:hp}))});bl.classNames=dr.classNames;var wo=["Enter"," "],vp=["ArrowDown","PageUp","Home"],_l=["ArrowUp","PageDown","End"],xp=[...vp,..._l],yp={ltr:[...wo,"ArrowRight"],rtl:[...wo,"ArrowLeft"]},wp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sn="Menu",[hn,bp,_p]=Ta(Sn),[Ft,Sl]=Pt(Sn,[_p,Xa,ur]),fr=Xa(),Cl=ur(),[Sp,Dt]=Ft(Sn),[Cp,Cn]=Ft(Sn),Rl=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=fr(t),[c,u]=h.useState(null),d=h.useRef(!1),g=it(s),m=Uo(o);return h.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),l.jsx(hg,{...a,children:l.jsx(Sp,{scope:t,open:n,onOpenChange:g,content:c,onContentChange:u,children:l.jsx(Cp,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:d,dir:m,modal:i,children:r})})})};Rl.displayName=Sn;var Rp="MenuAnchor",es=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fr(n);return l.jsx(vg,{...o,...r,ref:t})});es.displayName=Rp;var ts="MenuPortal",[kp,kl]=Ft(ts,{forceMount:void 0}),El=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Dt(ts,t);return l.jsx(kp,{scope:t,forceMount:n,children:l.jsx(Ot,{present:n||s.open,children:l.jsx(sl,{asChild:!0,container:o,children:r})})})};El.displayName=ts;var Oe="MenuContent",[Ep,ns]=Ft(Oe),Ml=h.forwardRef((e,t)=>{const n=kl(Oe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Dt(Oe,e.__scopeMenu),i=Cn(Oe,e.__scopeMenu);return l.jsx(hn.Provider,{scope:e.__scopeMenu,children:l.jsx(Ot,{present:r||s.open,children:l.jsx(hn.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Mp,{...o,ref:t}):l.jsx(Np,{...o,ref:t})})})})}),Mp=h.forwardRef((e,t)=>{const n=Dt(Oe,e.__scopeMenu),r=h.useRef(null),o=ke(t,r);return h.useEffect(()=>{const s=r.current;if(s)return Pg(s)},[]),l.jsx(rs,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Np=h.forwardRef((e,t)=>{const n=Dt(Oe,e.__scopeMenu);return l.jsx(rs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ap=mn("MenuContent.ScrollLock"),rs=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g,onInteractOutside:m,onDismiss:f,disableOutsideScroll:v,...p}=e,y=Dt(Oe,n),x=Cn(Oe,n),w=fr(n),b=Cl(n),_=bp(n),[C,N]=h.useState(null),E=h.useRef(null),S=ke(t,E,y.onContentChange),$=h.useRef(0),L=h.useRef(""),X=h.useRef(0),te=h.useRef(null),Z=h.useRef("right"),V=h.useRef(0),ne=v?bl:h.Fragment,G=v?{as:Ap,allowPinchZoom:!0}:void 0,J=M=>{var Q,ze;const H=L.current+M,z=_().filter(ve=>!ve.disabled),Y=document.activeElement,re=(Q=z.find(ve=>ve.ref.current===Y))==null?void 0:Q.textValue,le=z.map(ve=>ve.textValue),be=Hp(le,H,re),_e=(ze=z.find(ve=>ve.textValue===be))==null?void 0:ze.ref.current;(function ve(Se){L.current=Se,window.clearTimeout($.current),Se!==""&&($.current=window.setTimeout(()=>ve(""),1e3))})(H),_e&&setTimeout(()=>_e.focus())};h.useEffect(()=>()=>window.clearTimeout($.current),[]),Hf();const R=h.useCallback(M=>{var z,Y;return Z.current===((z=te.current)==null?void 0:z.side)&&Bp(M,(Y=te.current)==null?void 0:Y.area)},[]);return l.jsx(Ep,{scope:n,searchRef:L,onItemEnter:h.useCallback(M=>{R(M)&&M.preventDefault()},[R]),onItemLeave:h.useCallback(M=>{var H;R(M)||((H=E.current)==null||H.focus(),N(null))},[R]),onTriggerLeave:h.useCallback(M=>{R(M)&&M.preventDefault()},[R]),pointerGraceTimerRef:X,onPointerGraceIntentChange:h.useCallback(M=>{te.current=M},[]),children:l.jsx(ne,{...G,children:l.jsx(Oa,{asChild:!0,trapped:o,onMountAutoFocus:q(s,M=>{var H;M.preventDefault(),(H=E.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Ia,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g,onInteractOutside:m,onDismiss:f,children:l.jsx(dl,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:q(c,M=>{x.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(xg,{role:"menu","aria-orientation":"vertical","data-state":Bl(y.open),"data-radix-menu-content":"",dir:x.dir,...w,...p,ref:S,style:{outline:"none",...p.style},onKeyDown:q(p.onKeyDown,M=>{const z=M.target.closest("[data-radix-menu-content]")===M.currentTarget,Y=M.ctrlKey||M.altKey||M.metaKey,re=M.key.length===1;z&&(M.key==="Tab"&&M.preventDefault(),!Y&&re&&J(M.key));const le=E.current;if(M.target!==le||!xp.includes(M.key))return;M.preventDefault();const _e=_().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);_l.includes(M.key)&&_e.reverse(),Vp(_e)}),onBlur:q(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout($.current),L.current="")}),onPointerMove:q(e.onPointerMove,vn(M=>{const H=M.target,z=V.current!==M.clientX;if(M.currentTarget.contains(H)&&z){const Y=M.clientX>V.current?"right":"left";Z.current=Y,V.current=M.clientX}}))})})})})})})});Ml.displayName=Oe;var Tp="MenuGroup",os=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(fe.div,{role:"group",...r,ref:t})});os.displayName=Tp;var jp="MenuLabel",Nl=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(fe.div,{...r,ref:t})});Nl.displayName=jp;var Kn="MenuItem",si="menu.itemSelect",mr=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=h.useRef(null),i=Cn(Kn,e.__scopeMenu),a=ns(Kn,e.__scopeMenu),c=ke(t,s),u=h.useRef(!1),d=()=>{const g=s.current;if(!n&&g){const m=new CustomEvent(si,{bubbles:!0,cancelable:!0});g.addEventListener(si,f=>r==null?void 0:r(f),{once:!0}),sa(g,m),m.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(Al,{...o,ref:c,disabled:n,onClick:q(e.onClick,d),onPointerDown:g=>{var m;(m=e.onPointerDown)==null||m.call(e,g),u.current=!0},onPointerUp:q(e.onPointerUp,g=>{var m;u.current||(m=g.currentTarget)==null||m.click()}),onKeyDown:q(e.onKeyDown,g=>{const m=a.searchRef.current!=="";n||m&&g.key===" "||wo.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});mr.displayName=Kn;var Al=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=ns(Kn,n),a=Cl(n),c=h.useRef(null),u=ke(t,c),[d,g]=h.useState(!1),[m,f]=h.useState("");return h.useEffect(()=>{const v=c.current;v&&f((v.textContent??"").trim())},[s.children]),l.jsx(hn.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:l.jsx(fl,{asChild:!0,...a,focusable:!r,children:l.jsx(fe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:q(e.onPointerMove,vn(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,vn(v=>i.onItemLeave(v))),onFocus:q(e.onFocus,()=>g(!0)),onBlur:q(e.onBlur,()=>g(!1))})})})}),Ip="MenuCheckboxItem",Tl=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return l.jsx(Fl,{scope:e.__scopeMenu,checked:n,children:l.jsx(mr,{role:"menuitemcheckbox","aria-checked":Xn(n)?"mixed":n,...o,ref:t,"data-state":is(n),onSelect:q(o.onSelect,()=>r==null?void 0:r(Xn(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Tl.displayName=Ip;var jl="MenuRadioGroup",[Pp,Op]=Ft(jl,{value:void 0,onValueChange:()=>{}}),Il=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=it(r);return l.jsx(Pp,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(os,{...o,ref:t})})});Il.displayName=jl;var Pl="MenuRadioItem",Ol=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=Op(Pl,e.__scopeMenu),s=n===o.value;return l.jsx(Fl,{scope:e.__scopeMenu,checked:s,children:l.jsx(mr,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":is(s),onSelect:q(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Ol.displayName=Pl;var ss="MenuItemIndicator",[Fl,Fp]=Ft(ss,{checked:!1}),Dl=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Fp(ss,n);return l.jsx(Ot,{present:r||Xn(s.checked)||s.checked===!0,children:l.jsx(fe.span,{...o,ref:t,"data-state":is(s.checked)})})});Dl.displayName=ss;var Dp="MenuSeparator",$l=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$l.displayName=Dp;var $p="MenuArrow",Ll=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fr(n);return l.jsx(yg,{...o,...r,ref:t})});Ll.displayName=$p;var Lp="MenuSub",[Xv,Vl]=Ft(Lp),an="MenuSubTrigger",zl=h.forwardRef((e,t)=>{const n=Dt(an,e.__scopeMenu),r=Cn(an,e.__scopeMenu),o=Vl(an,e.__scopeMenu),s=ns(an,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const g=a.current;return()=>{window.clearTimeout(g),c(null)}},[a,c]),l.jsx(es,{asChild:!0,...u,children:l.jsx(Al,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Bl(n.open),...e,ref:nr(t,o.onTriggerChange),onClick:g=>{var m;(m=e.onClick)==null||m.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:q(e.onPointerMove,vn(g=>{s.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:q(e.onPointerLeave,vn(g=>{var f,v;d();const m=(f=n.content)==null?void 0:f.getBoundingClientRect();if(m){const p=(v=n.content)==null?void 0:v.dataset.side,y=p==="right",x=y?-5:5,w=m[y?"left":"right"],b=m[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:g.clientX+x,y:g.clientY},{x:w,y:m.top},{x:b,y:m.top},{x:b,y:m.bottom},{x:w,y:m.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(g),g.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:q(e.onKeyDown,g=>{var f;const m=s.searchRef.current!=="";e.disabled||m&&g.key===" "||yp[r.dir].includes(g.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),g.preventDefault())})})})});zl.displayName=an;var Hl="MenuSubContent",Gl=h.forwardRef((e,t)=>{const n=kl(Oe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Dt(Oe,e.__scopeMenu),i=Cn(Oe,e.__scopeMenu),a=Vl(Hl,e.__scopeMenu),c=h.useRef(null),u=ke(t,c);return l.jsx(hn.Provider,{scope:e.__scopeMenu,children:l.jsx(Ot,{present:r||s.open,children:l.jsx(hn.Slot,{scope:e.__scopeMenu,children:l.jsx(rs,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var g;i.isUsingKeyboardRef.current&&((g=c.current)==null||g.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:q(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:q(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:q(e.onKeyDown,d=>{var f;const g=d.currentTarget.contains(d.target),m=wp[i.dir].includes(d.key);g&&m&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),d.preventDefault())})})})})})});Gl.displayName=Hl;function Bl(e){return e?"open":"closed"}function Xn(e){return e==="indeterminate"}function is(e){return Xn(e)?"indeterminate":e?"checked":"unchecked"}function Vp(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Hp(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=zp(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Gp(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,g=c.x,m=c.y;d>r!=m>r&&n<(g-u)*(r-d)/(m-d)+u&&(o=!o)}return o}function Bp(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Gp(n,t)}function vn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Up=Rl,Wp=es,qp=El,Zp=Ml,Kp=os,Xp=Nl,Yp=mr,Jp=Tl,Qp=Il,eh=Ol,th=Dl,nh=$l,rh=Ll,oh=zl,sh=Gl,gr="DropdownMenu",[ih]=Pt(gr,[Sl]),Me=Sl(),[ah,Ul]=ih(gr),Wl=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Me(t),u=h.useRef(null),[d,g]=rr({prop:o,defaultProp:s??!1,onChange:i,caller:gr});return l.jsx(ah,{scope:t,triggerId:Bn(),triggerRef:u,contentId:Bn(),open:d,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(m=>!m),[g]),modal:a,children:l.jsx(Up,{...c,open:d,onOpenChange:g,dir:r,modal:a,children:n})})};Wl.displayName=gr;var ql="DropdownMenuTrigger",Zl=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Ul(ql,n),i=Me(n);return l.jsx(Wp,{asChild:!0,...i,children:l.jsx(fe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:nr(t,s.triggerRef),onPointerDown:q(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:q(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Zl.displayName=ql;var lh="DropdownMenuPortal",Kl=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Me(t);return l.jsx(qp,{...r,...n})};Kl.displayName=lh;var Xl="DropdownMenuContent",Yl=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ul(Xl,n),s=Me(n),i=h.useRef(!1);return l.jsx(Zp,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:q(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yl.displayName=Xl;var ch="DropdownMenuGroup",uh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(Kp,{...o,...r,ref:t})});uh.displayName=ch;var dh="DropdownMenuLabel",fh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(Xp,{...o,...r,ref:t})});fh.displayName=dh;var mh="DropdownMenuItem",gh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(Yp,{...o,...r,ref:t})});gh.displayName=mh;var ph="DropdownMenuCheckboxItem",Jl=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(Jp,{...o,...r,ref:t})});Jl.displayName=ph;var hh="DropdownMenuRadioGroup",vh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(Qp,{...o,...r,ref:t})});vh.displayName=hh;var xh="DropdownMenuRadioItem",yh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(eh,{...o,...r,ref:t})});yh.displayName=xh;var wh="DropdownMenuItemIndicator",Ql=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(th,{...o,...r,ref:t})});Ql.displayName=wh;var bh="DropdownMenuSeparator",_h=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(nh,{...o,...r,ref:t})});_h.displayName=bh;var Sh="DropdownMenuArrow",Ch=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(rh,{...o,...r,ref:t})});Ch.displayName=Sh;var Rh="DropdownMenuSubTrigger",kh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(oh,{...o,...r,ref:t})});kh.displayName=Rh;var Eh="DropdownMenuSubContent",Mh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return l.jsx(sh,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mh.displayName=Eh;var Nh=Wl,Ah=Zl,Th=Kl,jh=Yl,Ih=Jl,Ph=Ql;function Oh({...e}){return l.jsx(Nh,{"data-slot":"dropdown-menu",...e})}function Fh({...e}){return l.jsx(Ah,{"data-slot":"dropdown-menu-trigger",...e})}function Dh({className:e,sideOffset:t=4,...n}){return l.jsx(Th,{children:l.jsx(jh,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ue("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function $h({className:e,children:t,checked:n,...r}){return l.jsxs(Ih,{"data-slot":"dropdown-menu-checkbox-item",className:ue("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Ph,{children:l.jsx(pa,{className:"size-4"})})}),t]})}function as({className:e,...t}){return l.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:l.jsx("table",{"data-slot":"table",className:ue("w-full caption-bottom text-sm",e),...t})})}function Lh({className:e,...t}){return l.jsx("thead",{"data-slot":"table-header",className:ue("[&_tr]:border-b",e),...t})}function ls({className:e,...t}){return l.jsx("tbody",{"data-slot":"table-body",className:ue("[&_tr:last-child]:border-0",e),...t})}function we({className:e,...t}){return l.jsx("tr",{"data-slot":"table-row",className:ue("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Vh({className:e,...t}){return l.jsx("th",{"data-slot":"table-head",className:ue("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function O({className:e,...t}){return l.jsx("td",{"data-slot":"table-cell",className:ue("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function pr({columns:e,data:t,searchColumn:n,searchPlaceholder:r="Filter...",defaultColumnVisibility:o={},pageSize:s=25,defaultSorting:i=[]}){var y,x;const[a,c]=h.useState(i),[u,d]=h.useState([]),[g,m]=h.useState(o),[f,v]=h.useState({}),p=Tf({data:t,columns:e,onSortingChange:c,onColumnFiltersChange:d,getCoreRowModel:wf(),getPaginationRowModel:kf(),getSortedRowModel:Ef(),getFilteredRowModel:Rf(),onColumnVisibilityChange:m,onRowSelectionChange:v,initialState:{pagination:{pageSize:s}},state:{sorting:a,columnFilters:u,columnVisibility:g,rowSelection:f}});return l.jsxs("div",{className:"w-full",children:[l.jsxs("div",{className:"flex items-center py-4",children:[n&&l.jsx(ao,{placeholder:r,value:((y=p.getColumn(n))==null?void 0:y.getFilterValue())??"",onChange:w=>{var b;return(b=p.getColumn(n))==null?void 0:b.setFilterValue(w.target.value)},className:"max-w-sm"}),l.jsxs(Oh,{children:[l.jsx(Fh,{asChild:!0,children:l.jsxs(Nt,{variant:"outline",className:"ml-auto",children:["Columns ",l.jsx(ha,{className:"ml-2 h-4 w-4"})]})}),l.jsx(Dh,{align:"end",children:p.getAllColumns().filter(w=>w.getCanHide()).map(w=>l.jsx($h,{className:"capitalize",checked:w.getIsVisible(),onCheckedChange:b=>w.toggleVisibility(!!b),children:w.id},w.id))})]})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(as,{children:[l.jsx(Lh,{children:p.getHeaderGroups().map(w=>l.jsx(we,{children:w.headers.map(b=>l.jsx(Vh,{children:b.isPlaceholder?null:Os(b.column.columnDef.header,b.getContext())},b.id))},w.id))}),l.jsx(ls,{children:(x=p.getRowModel().rows)!=null&&x.length?p.getRowModel().rows.map(w=>l.jsx(we,{"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(b=>l.jsx(O,{children:Os(b.column.columnDef.cell,b.getContext())},b.id))},w.id)):l.jsx(we,{children:l.jsx(O,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})}),l.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[l.jsxs("div",{className:"text-muted-foreground flex-1 text-sm",children:[p.getFilteredRowModel().rows.length," row(s) total."]}),l.jsxs("div",{className:"space-x-2",children:[l.jsx(Nt,{variant:"outline",size:"sm",onClick:()=>p.previousPage(),disabled:!p.getCanPreviousPage(),children:"Previous"}),l.jsx(Nt,{variant:"outline",size:"sm",onClick:()=>p.nextPage(),disabled:!p.getCanNextPage(),children:"Next"})]})]})]})}function me(e,t="left"){return({column:n})=>{const r=t==="right"?"justify-end":t==="center"?"justify-center":"justify-start",o=n.getIsSorted();return l.jsx("div",{className:`flex ${r}`,children:l.jsxs(Nt,{variant:"ghost",onClick:()=>n.toggleSorting(n.getIsSorted()==="asc"),className:`${t==="right"?"ml-auto":""} hover:bg-muted/50 h-auto p-0 font-medium text-sm`,children:[e,o==="asc"&&l.jsx(ld,{className:"ml-1 h-3 w-3 text-muted-foreground"}),o==="desc"&&l.jsx(ha,{className:"ml-1 h-3 w-3 text-muted-foreground"})]})})}}const zh=300*1e3;function ec(e){const[t,n]=h.useState(new Map),r=h.useRef();return h.useEffect(()=>{const s=new Date().toISOString(),i=new Set(e.map(a=>a.id));n(a=>{const c=new Map(a);return e.forEach(u=>{c.set(u.id,{...u,lastSeenAt:s,disconnectedAt:void 0})}),c.forEach((u,d)=>{!i.has(d)&&!u.disconnectedAt&&c.set(d,{...u,isConnected:!1,connectionStatus:"Disconnected",disconnectedAt:s,lastActivity:u.lastActivity||s})}),c})},[e]),h.useEffect(()=>{const s=()=>{const i=Date.now();n(a=>{const c=new Map(a);return c.forEach((u,d)=>{if(u.disconnectedAt){const g=new Date(u.disconnectedAt).getTime();i-g>zh&&c.delete(d)}}),c})};return s(),r.current=setInterval(s,3e4),()=>{r.current&&clearInterval(r.current)}},[]),Array.from(t.values()).sort((s,i)=>s.isConnected!==i.isConnected?s.isConnected?-1:1:new Date(i.lastActivity).getTime()-new Date(s.lastActivity).getTime())}function ii(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function Hh(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}function Gh(e){return e.length<=12?e:`${e.slice(0,5)}...${e.slice(-5)}`}function Bh(e){return e.length<=42?e:`${e.slice(0,35)}.....${e.slice(-5)}`}function Uh({metrics:e}){const t=e.sessions||[],n=ec(t),r=()=>[{accessorKey:"clientInfo",header:me("Client"),cell:({row:o})=>{const s=o.original,i=s.clientInfo?`${Bh(s.clientInfo.name)}@${s.clientInfo.version}`:"unknown";return l.jsx("div",{className:"font-mono text-sm",title:s.clientInfo?`${s.clientInfo.name}@${s.clientInfo.version}`:"unknown",children:i})}},{accessorKey:"id",header:me("Session ID"),cell:({row:o})=>l.jsx("div",{className:"font-mono text-sm",title:o.getValue("id"),children:Gh(o.getValue("id"))})},{accessorKey:"isConnected",header:me("Status"),cell:({row:o})=>{const s=o.original;return l.jsxs(Mt,{variant:s.isConnected?"success":"secondary",className:"gap-1",children:[s.isConnected?l.jsx(ya,{className:"h-3 w-3"}):l.jsx(xa,{className:"h-3 w-3"}),s.isConnected?"Connected":"Disconnected"]})}},{accessorKey:"connectedAt",header:me("Connected"),cell:({row:o})=>l.jsx("div",{className:"text-sm",children:ii(o.getValue("connectedAt"))})},{accessorKey:"requestCount",header:me("Requests","right"),cell:({row:o})=>l.jsx("div",{className:"text-right font-mono text-sm",children:o.getValue("requestCount")})},{accessorKey:"lastActivity",header:me("Last Activity"),cell:({row:o})=>l.jsx("div",{className:"text-sm",children:ii(o.getValue("lastActivity"))})}];return l.jsxs(nt,{children:[l.jsxs(rt,{children:[l.jsx(ot,{children:"📊 Transport Metrics"}),l.jsx(It,{children:"Real-time connection and performance metrics for STDIO transport"})]}),l.jsxs(st,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),l.jsx("p",{className:"text-sm font-mono",children:"STDIO"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),l.jsx("p",{className:"text-sm font-mono",children:Hh(e.uptimeSeconds)})]})]}),l.jsxs(l.Fragment,{children:[l.jsx(At,{}),l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3",children:["Sessions (",n.filter(o=>o.isConnected).length," active,"," ",n.filter(o=>!o.isConnected).length," disconnected)"]}),l.jsx(pr,{columns:r(),data:n,searchColumn:"id",searchPlaceholder:"Filter sessions...",pageSize:10,defaultSorting:[{id:"lastActivity",desc:!0}]})]})]})]})]})}function ai(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function Wh(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}function Ln(e){return e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:`${Math.round(e/6e4)}m`}function qh(e){return e.length<=12?e:`${e.slice(0,5)}...${e.slice(-5)}`}function Zh(e){return e.length<=42?e:`${e.slice(0,35)}.....${e.slice(-5)}`}function Kh({metrics:e}){const t=e.sessions||[],n=ec(t),r={sse:"Server-Sent Events",streamableHttp:"Streamable HTTP"},o=()=>[{accessorKey:"clientInfo",header:me("Client"),cell:({row:s})=>{const i=s.original,a=i.clientInfo?`${Zh(i.clientInfo.name)}@${i.clientInfo.version}`:"unknown";return l.jsx("div",{className:"font-mono text-sm",title:i.clientInfo?`${i.clientInfo.name}@${i.clientInfo.version}`:"unknown",children:a})}},{accessorKey:"id",header:me("Session ID"),cell:({row:s})=>l.jsx("div",{className:"font-mono text-sm",title:s.getValue("id"),children:qh(s.getValue("id"))})},{accessorKey:"connectionStatus",header:me("Status"),cell:({row:s})=>{const i=s.original,a=i.connectionStatus||(i.isConnected?"Connected":"Disconnected");return a==="Connected"?l.jsxs(Mt,{variant:"success",className:"gap-1",children:[l.jsx(ya,{className:"h-3 w-3"}),"Connected"]}):a==="Distressed"?l.jsxs(Mt,{variant:"destructive",className:"gap-1",children:[l.jsx(va,{className:"h-3 w-3"}),"Distressed ",i.pingFailures?`(${i.pingFailures} failed)`:""]}):l.jsxs(Mt,{variant:"secondary",className:"gap-1",children:[l.jsx(xa,{className:"h-3 w-3"}),"Disconnected"]})}},{accessorKey:"connectedAt",header:me("Connected"),cell:({row:s})=>l.jsx("div",{className:"text-sm",children:ai(s.getValue("connectedAt"))})},{accessorKey:"requestCount",header:me("Requests","right"),cell:({row:s})=>l.jsx("div",{className:"text-right font-mono text-sm",children:s.getValue("requestCount")})},{accessorKey:"lastActivity",header:me("Last Activity"),cell:({row:s})=>l.jsx("div",{className:"text-sm",children:ai(s.getValue("lastActivity"))})}];return l.jsxs(nt,{children:[l.jsxs(rt,{children:[l.jsx(ot,{children:"📊 Transport Metrics"}),l.jsxs(It,{children:["Real-time connection and performance metrics for"," ",r[e.transport]||e.transport," transport"]})]}),l.jsxs(st,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),l.jsx("p",{className:"text-sm font-mono",children:r[e.transport]||e.transport})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),l.jsx("p",{className:"text-sm font-mono",children:Wh(e.uptimeSeconds)})]})]}),e.configuration&&l.jsx(l.Fragment,{children:l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Configuration"}),l.jsx("div",{className:"grid grid-cols-1 gap-2",children:e.pings&&l.jsx("div",{className:"text-xs text-muted-foreground bg-muted/30 p-2 rounded",children:e.pings.sent>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Ping Status:"})," ",e.pings.successful,"/",e.pings.sent," successful (",e.pings.sent>0?Math.round(e.pings.successful/e.pings.sent*100):0,"%)"]})})}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["SSE connections checked every ",Ln(e.configuration.heartbeatInterval||3e4),", sessions swept every ",Ln(e.configuration.staleCheckInterval),", removed after"," ",Ln(e.configuration.staleTimeout)," inactive",e.configuration.pingEnabled&&e.configuration.pingInterval&&`, pings sent every ${Ln(e.configuration.pingInterval)}`,e.configuration.pingEnabled&&`, marked distressed after ${e.configuration.pingFailureThreshold||1} failed ping${(e.configuration.pingFailureThreshold||1)!==1?"s":""}`]})]})}),l.jsx(At,{}),l.jsx("div",{children:l.jsx(as,{children:l.jsxs(ls,{children:[l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Active Connections"}),l.jsx(O,{className:"text-sm font-mono",children:e.connections.active}),l.jsx(O,{className:"font-medium text-sm",children:"Cleaned Sessions"}),l.jsx(O,{className:"text-sm font-mono",children:e.connections.cleaned??0})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Total Connections"}),l.jsx(O,{className:"text-sm font-mono",children:e.connections.total}),l.jsx(O,{className:"font-medium text-sm",children:"Requests per Minute (tot/3hr/hr)"}),l.jsxs(O,{className:"text-sm font-mono",children:[e.requests.averagePerMinute,"/",e.requests.last3Hours,"/",e.requests.lastHour]})]}),e.sessionLifecycle&&l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Sessions New/Res-fail/Del"}),l.jsxs(O,{className:"text-sm font-mono",colSpan:3,children:[e.sessionLifecycle.created,"/",e.sessionLifecycle.resumedFailed,"/",e.sessionLifecycle.deleted]})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Client Errors (4xx)"}),l.jsx(O,{className:"text-sm font-mono",children:e.errors.expected}),l.jsx(O,{className:"font-medium text-sm",children:"Server Errors (5xx)"}),l.jsx(O,{className:"text-sm font-mono",children:e.errors.unexpected})]}),e.pings&&l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Pings Sent"}),l.jsx(O,{className:"text-sm font-mono",children:e.pings.sent}),l.jsx(O,{className:"font-medium text-sm",children:"Ping Success Rate"}),l.jsx(O,{className:"text-sm font-mono",children:e.pings.sent>0?`${Math.round(e.pings.successful/e.pings.sent*100)}%`:"-"})]}),e.apiMetrics&&l.jsxs(l.Fragment,{children:[l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Anonymous Users"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.anonymous}),l.jsx(O,{className:"font-medium text-sm",children:"Authenticated Users"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.authenticated})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"401 Unauthorized Users"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.unauthorized}),l.jsx(O,{className:"font-medium text-sm",children:"403 Forbidden Users"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.forbidden})]})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Gradio Success/Fail"}),l.jsx(O,{className:"text-sm font-mono",children:e.gradioMetrics?`${e.gradioMetrics.success}/${e.gradioMetrics.failure}`:"0/0"}),l.jsx(O,{className:"font-medium text-sm",children:"-"}),l.jsx(O,{className:"text-sm font-mono",children:"-"})]})]})})}),l.jsxs(l.Fragment,{children:[l.jsx(At,{}),l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3",children:["Sessions (",n.filter(s=>s.isConnected).length," active,"," ",n.filter(s=>!s.isConnected).length," disconnected)"]}),l.jsx(pr,{columns:o(),data:n,searchColumn:"id",searchPlaceholder:"Filter sessions...",pageSize:10,defaultSorting:[{id:"lastActivity",desc:!0}]})]})]})]})]})}function li(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function Xh(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}function Yh(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime();return Math.floor(r/6e4)<5}function Jh(e){return e.length<=42?e:`${e.slice(0,35)}.....${e.slice(-5)}`}function Qh({metrics:e}){const t=e.clients,n=()=>[{accessorKey:"name",header:me("Client"),cell:({row:r})=>{const o=r.original,s=`${Jh(o.name)}@${o.version}`;return l.jsxs("div",{children:[l.jsx("p",{className:"font-medium font-mono text-sm",title:`${o.name}@${o.version}`,children:s}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["First seen ",li(o.firstSeen)]})]})}},{accessorKey:"requestCount",header:me("Initializations","right"),cell:({row:r})=>l.jsx("div",{className:"text-right font-mono text-sm",children:r.getValue("requestCount")})},{accessorKey:"isConnected",header:me("Status"),cell:({row:r})=>{const o=r.original;return l.jsx("div",{children:Yh(o.lastSeen)?l.jsxs(Mt,{variant:"success",className:"gap-1",children:[l.jsx(od,{className:"h-3 w-3"}),"Recent"]}):l.jsxs(Mt,{variant:"secondary",className:"gap-1",children:[l.jsx(ud,{className:"h-3 w-3"}),"Idle"]})})}},{accessorKey:"lastSeen",header:me("Last Seen","right"),cell:({row:r})=>l.jsx("div",{className:"text-right text-sm",children:li(r.getValue("lastSeen"))})}];return l.jsxs(nt,{children:[l.jsxs(rt,{children:[l.jsx(ot,{children:"📊 Transport Metrics"}),l.jsx(It,{children:"Real-time connection and performance metrics for Stateless HTTP JSON transport"})]}),l.jsxs(st,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-sm font-mono",children:"Stateless HTTP JSON"}),l.jsx(Mt,{variant:"secondary",children:e.sessionLifecycle?"analytics":"stateless"})]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),l.jsx("p",{className:"text-sm font-mono",children:Xh(e.uptimeSeconds)})]})]}),l.jsx(At,{}),l.jsx("div",{children:l.jsx(as,{children:l.jsxs(ls,{children:[l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Request Count (MCP)"}),l.jsx(O,{className:"text-sm font-mono",children:e.connections.total}),l.jsx(O,{className:"font-medium text-sm",children:"Requests per Minute (tot/3hr/hr)"}),l.jsxs(O,{className:"text-sm font-mono",children:[e.requests.averagePerMinute,"/",e.requests.last3Hours,"/",e.requests.lastHour]})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Client Errors (4xx)"}),l.jsx(O,{className:"text-sm font-mono",children:e.errors.expected}),l.jsx(O,{className:"font-medium text-sm",children:"Server Errors (5xx)"}),l.jsx(O,{className:"text-sm font-mono",children:e.errors.unexpected})]}),(e.staticPageHits200!==void 0||e.staticPageHits405!==void 0)&&l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(gd,{className:"h-3 w-3"}),"hf.co/mcp (200/405)"]})}),l.jsxs(O,{className:"text-sm font-mono",children:[e.staticPageHits200||0,"/",e.staticPageHits405||0]}),l.jsx(O,{className:"font-medium text-sm",children:l.jsx("div",{className:"flex items-center gap-1",children:"Auth Status (Anon/Auth/401)"})}),l.jsxs(O,{className:"text-sm font-mono",children:[e.connections.anonymous,"/",e.connections.authenticated,"/",e.connections.unauthorized||0]})]}),e.apiMetrics&&l.jsxs(l.Fragment,{children:[l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Tool API - Anonymous"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.anonymous}),l.jsx(O,{className:"font-medium text-sm",children:"Tool API - Authenticated"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.authenticated})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Tool API - 401 Unauthorized"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.unauthorized}),l.jsx(O,{className:"font-medium text-sm",children:"Tool API - 403 Forbidden"}),l.jsx(O,{className:"text-sm font-mono",children:e.apiMetrics.forbidden})]})]}),l.jsxs(we,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Gradio Success/Fail"}),l.jsx(O,{className:"text-sm font-mono",children:e.gradioMetrics?`${e.gradioMetrics.success}/${e.gradioMetrics.failure}`:"0/0"}),e.sessionLifecycle?l.jsxs(l.Fragment,{children:[l.jsx(O,{className:"font-medium text-sm",children:"Sessions New/Res-fail/Del"}),l.jsxs(O,{className:"text-sm font-mono",children:[e.sessionLifecycle.created,"/",e.sessionLifecycle.resumedFailed,"/",e.sessionLifecycle.deleted]})]}):l.jsxs(l.Fragment,{children:[l.jsx(O,{className:"font-medium text-sm",children:"-"}),l.jsx(O,{className:"text-sm font-mono",children:"-"})]})]})]})})}),l.jsxs(l.Fragment,{children:[l.jsx(At,{}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"Client Identities"}),l.jsx(pr,{columns:n(),data:t,searchColumn:"name",searchPlaceholder:"Filter clients...",pageSize:50,defaultSorting:[{id:"lastSeen",desc:!0}]})]})]})]})]})}const ev=e=>fetch(e).then(t=>{if(!t.ok)throw new Error(`Failed to fetch: ${t.status}`);return t.json()});function tv(){const{data:e,error:t}=cn("/api/transport-metrics",ev,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0});return t?l.jsxs(nt,{children:[l.jsx(rt,{children:l.jsx(ot,{children:"📊 Transport Metrics"})}),l.jsx(st,{children:l.jsxs(kd,{variant:"destructive",children:[l.jsx(va,{className:"h-4 w-4"}),l.jsx(Ed,{children:"Error Loading Metrics"}),l.jsxs(Md,{children:["Failed to load transport metrics: ",t.message]})]})})]}):e?e.transport==="stdio"?l.jsx(Uh,{metrics:e}):e.isStateless?l.jsx(Qh,{metrics:e}):l.jsx(Kh,{metrics:e}):l.jsxs(nt,{children:[l.jsx(rt,{children:l.jsx(ot,{children:"📊 Transport Metrics"})}),l.jsx(st,{children:l.jsxs("div",{className:"animate-pulse space-y-2",children:[l.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),l.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"}),l.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3"})]})})]})}const nv=e=>fetch(e).then(t=>{if(!t.ok)throw new Error(`Failed to fetch: ${t.status}`);return t.json()});function rv(){const[e,t]=h.useState(!1),{data:n,error:r}=cn("/api/transport-metrics",nv,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0}),o=!n&&!r,s=(n==null?void 0:n.transport)==="stdio",i=((n==null?void 0:n.methods)||[]).map(m=>{let f=m.errors,v,p;if(m.method.startsWith("tools/call:")&&(n!=null&&n.gradioMetrics)){const w=m.method.replace("tools/call:",""),b=n.gradioMetrics.byTool;b[w]&&(v=b[w].success,p=b[w].failure,f+=p)}const y=m.count>0?f/m.count*100:0;return{method:m.method,count:m.count,errors:f,errorRate:y,averageResponseTime:m.averageResponseTime,lastCalled:m.lastCalled,gradioSuccess:v,gradioFailure:p}}),a=e?i.filter(m=>m.method.startsWith("tools/call")||m.method.startsWith("prompts/get")):i,c=i.reduce((m,f)=>m+f.count,0),u=i.filter(m=>m.method.startsWith("tools/call")).reduce((m,f)=>m+f.count,0),d=i.filter(m=>m.method.startsWith("prompts/get")).reduce((m,f)=>m+f.count,0),g=[{accessorKey:"method",header:me("Method"),cell:({row:m})=>{const f=m.getValue("method");return l.jsx("div",{className:"font-mono text-sm",children:f==="tools/call"?l.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"tools/call"}):f.startsWith("tools/call:")?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"tools/call:"}),l.jsx("span",{className:"text-green-600 dark:text-green-400",children:f.replace("tools/call:","")})]}):f==="prompts/get"?l.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"prompts/get"}):f.startsWith("prompts/get:")?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"prompts/get:"}),l.jsx("span",{className:"text-orange-600 dark:text-orange-400",children:f.replace("prompts/get:","")})]}):f})}},{accessorKey:"count",header:me("Calls","right"),cell:({row:m})=>l.jsx("div",{className:"text-right font-mono",children:m.getValue("count").toLocaleString()})},{accessorKey:"errors",header:me("Errors","right"),cell:({row:m})=>{const f=m.getValue("errors");return l.jsx("div",{className:"text-right font-mono",children:f>0?l.jsx("span",{className:"text-red-600 dark:text-red-400",children:f}):"0"})}},{accessorKey:"gradioMetrics",header:me("Success/Failure","right"),cell:({row:m})=>{const f=m.original;return f.gradioSuccess!==void 0&&f.gradioFailure!==void 0?l.jsxs("div",{className:"text-right font-mono text-sm",children:[l.jsx("span",{className:"text-green-600 dark:text-green-400",children:f.gradioSuccess}),l.jsx("span",{className:"text-muted-foreground",children:"/"}),l.jsx("span",{className:"text-red-600 dark:text-red-400",children:f.gradioFailure})]}):l.jsx("div",{className:"text-right text-muted-foreground",children:"—"})}},{accessorKey:"errorRate",header:me("Error Rate","right"),cell:({row:m})=>{const f=m.getValue("errorRate");return l.jsx("div",{className:"text-right font-mono",children:f>0?l.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[f.toFixed(1),"%"]}):"0%"})}},{accessorKey:"averageResponseTime",header:me("Avg Response","right"),cell:({row:m})=>{const f=m.getValue("averageResponseTime");return l.jsx("div",{className:"text-right font-mono",children:f?`${f.toFixed(0)}ms`:"—"})}},{accessorKey:"lastCalled",header:me("Last Called","right"),cell:({row:m})=>l.jsx("div",{className:"text-right text-sm text-muted-foreground",children:new Date(m.getValue("lastCalled")).toLocaleTimeString()})}];return l.jsxs(nt,{children:[l.jsxs(rt,{children:[l.jsx(ot,{children:"HTTP JSON Transport Statistics"}),l.jsxs(It,{children:["MCP method call statistics and performance metrics",s?" (Empty in STDIO mode)":n!=null&&n.isStateless?"":" (Response times not available in stateful modes)"]})]}),l.jsxs(st,{children:[o&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading metrics..."})}),r&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsxs("div",{className:"text-sm text-destructive",children:["Error loading metrics: ",r.message]})}),s&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:"Method tracking is not available in STDIO mode. This data is only collected for HTTP-based transports."})}),n&&!s&&l.jsxs("div",{className:"space-y-4",children:[i.length>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",a.length," method",a.length!==1?"s":""," tracked since"," ",new Date(n.startupTime).toLocaleString()]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-sm font-medium",children:["Total MCP Calls: ",l.jsx("span",{className:"font-mono",children:c.toLocaleString()})]}),l.jsxs("div",{className:"text-sm font-medium",children:["Tool Calls: ",l.jsx("span",{className:"font-mono",children:u.toLocaleString()})]}),l.jsxs("div",{className:"text-sm font-medium",children:["Prompt Calls: ",l.jsx("span",{className:"font-mono",children:d.toLocaleString()})]})]})]}),i.length>0&&l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Lo,{id:"tool-prompt-calls-filter",checked:e,onCheckedChange:m=>t(!!m)}),l.jsx("label",{htmlFor:"tool-prompt-calls-filter",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"Show only Tools/Prompts"})]}),a.length===0?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:e?"No tool or prompt calls recorded yet.":"No method calls recorded yet."})}):l.jsx(pr,{columns:g,data:a,searchColumn:"method",searchPlaceholder:"Filter methods...",pageSize:50,defaultColumnVisibility:{method:!0,count:!0,errors:!1,gradioMetrics:!1,errorRate:!0,averageResponseTime:n.transport==="streamableHttpJson",lastCalled:!0},defaultSorting:[{id:"count",desc:!0}]})]})]})]})}function ci(e){return e.transport==="stdio"?e.defaultHfTokenSet&&e.hfTokenMasked?{text:e.hfTokenMasked,isWarning:!1}:{text:"Warning: No token set",isWarning:!0}:e.defaultHfTokenSet?{text:`⚠️ Using ${e.hfTokenMasked||"token"} as default`,isWarning:!0}:{text:"Using Authorization Headers",isWarning:!1}}function ov({isLoading:e,error:t,transportInfo:n}){const r=()=>{switch(n.transport){case"stdio":return"STDIO";case"sse":return"SSE";case"streamableHttp":case"streamableHttpJson":return"Streamable HTTP";default:return"Unknown"}},o=()=>{switch(n.transport){case"sse":return"/sse";case"streamableHttp":case"streamableHttpJson":return"/mcp";case"stdio":return"stdin/stdout";default:return"unknown"}},s=()=>n.transport==="streamableHttpJson"||n.transport==="streamableHttp"&&n.jsonResponseEnabled===!0,i=()=>s()?l.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 bg-green-100 text-green-800 text-[10px] rounded-sm whitespace-nowrap",children:"JSON (stateless)"}):n.transport==="streamableHttp"?l.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 bg-blue-100 text-blue-800 text-[10px] rounded-sm whitespace-nowrap",children:"Session Based"}):n.transport==="sse"?l.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 bg-purple-100 text-purple-800 text-[10px] rounded-sm whitespace-nowrap",children:"Event Stream"}):null;if(e)return l.jsx("div",{className:"text-center text-xs text-muted-foreground py-2",children:"Loading connection information..."});if(t)return l.jsxs("div",{className:"text-center text-xs text-destructive py-2",children:["Error: ",t]});const a=n.port||3e3,c=n.transport!=="stdio";return l.jsx("div",{className:"fixed bottom-0 left-0 w-full bg-muted/50 border-t border-border py-2 px-4",children:l.jsxs("div",{className:"max-w-[700px] mx-auto flex justify-between items-center text-xs",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:"Using"}),l.jsx("span",{className:"font-medium text-primary",children:r()}),n.transport==="stdio"&&l.jsxs("span",{className:"text-muted-foreground flex items-center",children:["Client Info :",n.stdioClient?l.jsx("span",{className:"ml-2 flex items-center",children:l.jsxs("span",{className:"ml-1 font-medium text-green-700",children:[n.stdioClient.name," ",n.stdioClient.version]})}):l.jsx("span",{className:"ml-2 text-muted-foreground",children:" (disconnected) "})]}),c&&l.jsxs("span",{className:"text-muted-foreground flex items-center",children:["on port ",l.jsx("span",{className:"font-mono mx-1",children:a}),"at ",l.jsx("span",{className:"font-mono mx-1",children:o()}),i()]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:" Default HF Token:"}),l.jsx("span",{className:`font-mono ${ci(n).isWarning?"text-red-500":""}`,children:ci(n).text})]})]})})}var hr="Tabs",[sv]=Pt(hr,[ur]),tc=ur(),[iv,cs]=sv(hr),nc=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Uo(a),[g,m]=rr({prop:r,onChange:o,defaultProp:s??"",caller:hr});return l.jsx(iv,{scope:n,baseId:Bn(),value:g,onValueChange:m,orientation:i,dir:d,activationMode:c,children:l.jsx(fe.div,{dir:d,"data-orientation":i,...u,ref:t})})});nc.displayName=hr;var rc="TabsList",oc=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=cs(rc,n),i=tc(n);return l.jsx(dl,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(fe.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});oc.displayName=rc;var sc="TabsTrigger",ic=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=cs(sc,n),a=tc(n),c=cc(i.baseId,r),u=uc(i.baseId,r),d=r===i.value;return l.jsx(fl,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(fe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:q(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:q(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:q(e.onFocus,()=>{const g=i.activationMode!=="manual";!d&&!o&&g&&i.onValueChange(r)})})})});ic.displayName=sc;var ac="TabsContent",lc=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=cs(ac,n),c=cc(a.baseId,r),u=uc(a.baseId,r),d=r===a.value,g=h.useRef(d);return h.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Ot,{present:o||d,children:({present:m})=>l.jsx(fe.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});lc.displayName=ac;function cc(e,t){return`${e}-trigger-${t}`}function uc(e,t){return`${e}-content-${t}`}var av=nc,lv=oc,cv=ic,uv=lc;function dv({className:e,...t}){return l.jsx(av,{"data-slot":"tabs",className:ue("flex flex-col gap-2",e),...t})}function fv({className:e,...t}){return l.jsx(lv,{"data-slot":"tabs-list",className:ue("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ht({className:e,...t}){return l.jsx(cv,{"data-slot":"tabs-trigger",className:ue("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Gt({className:e,...t}){return l.jsx(uv,{"data-slot":"tabs-content",className:ue("flex-1 outline-none",e),...t})}const ui="ALLOW_README_INCLUDE",di="NO_GRADIO_IMAGE_CONTENT";var ie;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ie||(ie={}));var fi;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fi||(fi={}));const I=ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gt=e=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(e)?I.array:e===null?I.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?I.promise:typeof Map<"u"&&e instanceof Map?I.map:typeof Set<"u"&&e instanceof Set?I.set:typeof Date<"u"&&e instanceof Date?I.date:I.object;default:return I.unknown}},k=ie.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ct extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),r}static assert(t){if(!(t instanceof ct))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ct.create=e=>new ct(e);const bo=(e,t)=>{let n;switch(e.code){case k.invalid_type:e.received===I.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case k.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ie.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:n=`Unrecognized key(s) in object: ${ie.joinValues(e.keys,", ")}`;break;case k.invalid_union:n="Invalid input";break;case k.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ie.joinValues(e.options)}`;break;case k.invalid_enum_value:n=`Invalid enum value. Expected ${ie.joinValues(e.options)}, received '${e.received}'`;break;case k.invalid_arguments:n="Invalid function arguments";break;case k.invalid_return_type:n="Invalid function return type";break;case k.invalid_date:n="Invalid date";break;case k.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ie.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case k.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case k.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case k.custom:n="Invalid input";break;case k.invalid_intersection_types:n="Intersection results could not be merged";break;case k.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case k.not_finite:n="Number must be finite";break;default:n=t.defaultError,ie.assertNever(e)}return{message:n}};let mv=bo;function gv(){return mv}const pv=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function A(e,t){const n=gv(),r=pv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===bo?void 0:bo].filter(o=>!!o)});e.common.issues.push(r)}class Ie{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return B;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return Ie.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return B;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const B=Object.freeze({status:"aborted"}),ln=e=>({status:"dirty",value:e}),Fe=e=>({status:"valid",value:e}),mi=e=>e.status==="aborted",gi=e=>e.status==="dirty",Zt=e=>e.status==="valid",Yn=e=>typeof Promise<"u"&&e instanceof Promise;var P;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(P||(P={}));class Rt{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pi=(e,t)=>{if(Zt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ct(e.common.issues);return this._error=n,this._error}}};function K(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}class se{get description(){return this._def.description}_getType(t){return gt(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:gt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ie,ctx:{common:t.parent.common,data:t.data,parsedType:gt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Yn(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)},o=this._parseSync({data:t,path:r.path,parent:r});return pi(r,o)}"~validate"(t){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return Zt(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(o=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>Zt(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(Yn(o)?o:Promise.resolve(o));return pi(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:k.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Yt({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return yt.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qe.create(this)}promise(){return tr.create(this,this._def)}or(t){return Qn.create([this,t],this._def)}and(t){return er.create(this,t,this._def)}transform(t){return new Yt({...K(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Co({...K(this._def),innerType:this,defaultValue:n,typeName:U.ZodDefault})}brand(){return new $v({typeName:U.ZodBranded,type:this,...K(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Ro({...K(this._def),innerType:this,catchValue:n,typeName:U.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return us.create(this,t)}readonly(){return ko.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hv=/^c[^\s-]{8,}$/i,vv=/^[0-9a-z]+$/,xv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,yv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wv=/^[a-z0-9_-]{21}$/i,bv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_v=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let qr;const Rv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ev=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Mv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Av=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dc="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Tv=new RegExp(`^${dc}$`);function fc(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function jv(e){return new RegExp(`^${fc(e)}$`)}function Iv(e){let t=`${dc}T${fc(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Pv(e,t){return!!((t==="v4"||!t)&&Rv.test(e)||(t==="v6"||!t)&&Ev.test(e))}function Ov(e,t){if(!bv.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Fv(e,t){return!!((t==="v4"||!t)&&kv.test(e)||(t==="v6"||!t)&&Mv.test(e))}class vt extends se{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==I.string){const s=this._getOrReturnCtx(t);return A(s,{code:k.invalid_type,expected:I.string,received:s.parsedType}),B}const r=new Ie;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),A(o,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),A(o,{code:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?A(o,{code:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&A(o,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Sv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"email",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")qr||(qr=new RegExp(Cv,"u")),qr.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"emoji",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")yv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"uuid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")wv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"nanoid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")hv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"cuid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")vv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"cuid2",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")xv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"ulid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),A(o,{validation:"url",code:k.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"regex",code:k.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),A(o,{code:k.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),A(o,{code:k.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),A(o,{code:k.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Iv(s).test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:k.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Tv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:k.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?jv(s).test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:k.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?_v.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"duration",code:k.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Pv(t.data,s.version)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"ip",code:k.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?Ov(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"jwt",code:k.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Fv(t.data,s.version)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"cidr",code:k.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Nv.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"base64",code:k.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Av.test(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{validation:"base64url",code:k.invalid_string,message:s.message}),r.dirty()):ie.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:k.invalid_string,...P.errToObj(r)})}_addCheck(t){return new vt({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...P.errToObj(t)})}url(t){return this._addCheck({kind:"url",...P.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...P.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...P.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...P.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...P.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...P.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...P.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...P.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...P.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...P.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...P.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...P.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...P.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...P.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...P.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...P.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...P.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...P.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...P.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...P.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...P.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...P.errToObj(n)})}nonempty(t){return this.min(1,P.errToObj(t))}trim(){return new vt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vt.create=e=>new vt({checks:[],typeName:U.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...K(e)});function Dv(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}class Kt extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==I.number){const s=this._getOrReturnCtx(t);return A(s,{code:k.invalid_type,expected:I.number,received:s.parsedType}),B}let r;const o=new Ie;for(const s of this._def.checks)s.kind==="int"?ie.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:k.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:k.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:k.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Dv(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),A(r,{code:k.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:k.not_finite,message:s.message}),o.dirty()):ie.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,P.toString(n))}gt(t,n){return this.setLimit("min",t,!1,P.toString(n))}lte(t,n){return this.setLimit("max",t,!0,P.toString(n))}lt(t,n){return this.setLimit("max",t,!1,P.toString(n))}setLimit(t,n,r,o){return new Kt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:P.toString(o)}]})}_addCheck(t){return new Kt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:P.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:P.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:P.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ie.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Kt.create=e=>new Kt({checks:[],typeName:U.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...K(e)});class xn extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==I.bigint)return this._getInvalidInput(t);let r;const o=new Ie;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:k.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:k.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),A(r,{code:k.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ie.assertNever(s);return{status:o.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return A(n,{code:k.invalid_type,expected:I.bigint,received:n.parsedType}),B}gte(t,n){return this.setLimit("min",t,!0,P.toString(n))}gt(t,n){return this.setLimit("min",t,!1,P.toString(n))}lte(t,n){return this.setLimit("max",t,!0,P.toString(n))}lt(t,n){return this.setLimit("max",t,!1,P.toString(n))}setLimit(t,n,r,o){return new xn({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:P.toString(o)}]})}_addCheck(t){return new xn({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:P.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}xn.create=e=>new xn({checks:[],typeName:U.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...K(e)});class _o extends se{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){const r=this._getOrReturnCtx(t);return A(r,{code:k.invalid_type,expected:I.boolean,received:r.parsedType}),B}return Fe(t.data)}}_o.create=e=>new _o({typeName:U.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...K(e)});class Jn extends se{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==I.date){const s=this._getOrReturnCtx(t);return A(s,{code:k.invalid_type,expected:I.date,received:s.parsedType}),B}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return A(s,{code:k.invalid_date}),B}const r=new Ie;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),A(o,{code:k.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),A(o,{code:k.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ie.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Jn({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:P.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:P.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Jn.create=e=>new Jn({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:U.ZodDate,...K(e)});class hi extends se{_parse(t){if(this._getType(t)!==I.symbol){const r=this._getOrReturnCtx(t);return A(r,{code:k.invalid_type,expected:I.symbol,received:r.parsedType}),B}return Fe(t.data)}}hi.create=e=>new hi({typeName:U.ZodSymbol,...K(e)});class vi extends se{_parse(t){if(this._getType(t)!==I.undefined){const r=this._getOrReturnCtx(t);return A(r,{code:k.invalid_type,expected:I.undefined,received:r.parsedType}),B}return Fe(t.data)}}vi.create=e=>new vi({typeName:U.ZodUndefined,...K(e)});class xi extends se{_parse(t){if(this._getType(t)!==I.null){const r=this._getOrReturnCtx(t);return A(r,{code:k.invalid_type,expected:I.null,received:r.parsedType}),B}return Fe(t.data)}}xi.create=e=>new xi({typeName:U.ZodNull,...K(e)});class yi extends se{constructor(){super(...arguments),this._any=!0}_parse(t){return Fe(t.data)}}yi.create=e=>new yi({typeName:U.ZodAny,...K(e)});class wi extends se{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fe(t.data)}}wi.create=e=>new wi({typeName:U.ZodUnknown,...K(e)});class kt extends se{_parse(t){const n=this._getOrReturnCtx(t);return A(n,{code:k.invalid_type,expected:I.never,received:n.parsedType}),B}}kt.create=e=>new kt({typeName:U.ZodNever,...K(e)});class bi extends se{_parse(t){if(this._getType(t)!==I.undefined){const r=this._getOrReturnCtx(t);return A(r,{code:k.invalid_type,expected:I.void,received:r.parsedType}),B}return Fe(t.data)}}bi.create=e=>new bi({typeName:U.ZodVoid,...K(e)});class qe extends se{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==I.array)return A(n,{code:k.invalid_type,expected:I.array,received:n.parsedType}),B;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(A(n,{code:i?k.too_big:k.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(A(n,{code:k.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(A(n,{code:k.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Rt(n,i,n.path,a)))).then(i=>Ie.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new Rt(n,i,n.path,a)));return Ie.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new qe({...this._def,minLength:{value:t,message:P.toString(n)}})}max(t,n){return new qe({...this._def,maxLength:{value:t,message:P.toString(n)}})}length(t,n){return new qe({...this._def,exactLength:{value:t,message:P.toString(n)}})}nonempty(t){return this.min(1,t)}}qe.create=(e,t)=>new qe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...K(t)});function Bt(e){if(e instanceof he){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=yt.create(Bt(r))}return new he({...e._def,shape:()=>t})}else return e instanceof qe?new qe({...e._def,type:Bt(e.element)}):e instanceof yt?yt.create(Bt(e.unwrap())):e instanceof Jt?Jt.create(Bt(e.unwrap())):e instanceof jt?jt.create(e.items.map(t=>Bt(t))):e}class he extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ie.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==I.object){const u=this._getOrReturnCtx(t);return A(u,{code:k.invalid_type,expected:I.object,received:u.parsedType}),B}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof kt&&this._def.unknownKeys==="strip"))for(const u in o.data)i.includes(u)||a.push(u);const c=[];for(const u of i){const d=s[u],g=o.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Rt(o,g,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof kt){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(A(o,{code:k.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const g=o.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Rt(o,g,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const g=await d.key,m=await d.value;u.push({key:g,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>Ie.mergeObjectSync(r,u)):Ie.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return P.errToObj,new he({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,i;const o=((i=(s=this._def).errorMap)==null?void 0:i.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:P.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new he({...this._def,unknownKeys:"strip"})}passthrough(){return new he({...this._def,unknownKeys:"passthrough"})}extend(t){return new he({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new he({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:U.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new he({...this._def,catchall:t})}pick(t){const n={};for(const r of ie.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new he({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ie.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new he({...this._def,shape:()=>n})}deepPartial(){return Bt(this)}partial(t){const n={};for(const r of ie.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}return new he({...this._def,shape:()=>n})}required(t){const n={};for(const r of ie.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof yt;)s=s._def.innerType;n[r]=s}return new he({...this._def,shape:()=>n})}keyof(){return mc(ie.objectKeys(this.shape))}}he.create=(e,t)=>new he({shape:()=>e,unknownKeys:"strip",catchall:kt.create(),typeName:U.ZodObject,...K(t)});he.strictCreate=(e,t)=>new he({shape:()=>e,unknownKeys:"strict",catchall:kt.create(),typeName:U.ZodObject,...K(t)});he.lazycreate=(e,t)=>new he({shape:e,unknownKeys:"strip",catchall:kt.create(),typeName:U.ZodObject,...K(t)});class Qn extends se{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new ct(a.ctx.common.issues));return A(n,{code:k.invalid_union,unionErrors:i}),B}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(c=>new ct(c));return A(n,{code:k.invalid_union,unionErrors:a}),B}}get options(){return this._def.options}}Qn.create=(e,t)=>new Qn({options:e,typeName:U.ZodUnion,...K(t)});function So(e,t){const n=gt(e),r=gt(t);if(e===t)return{valid:!0,data:e};if(n===I.object&&r===I.object){const o=ie.objectKeys(t),s=ie.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const c=So(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===I.array&&r===I.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],c=So(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===I.date&&r===I.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class er extends se{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(mi(s)||mi(i))return B;const a=So(s.value,i.value);return a.valid?((gi(s)||gi(i))&&n.dirty(),{status:n.value,value:a.data}):(A(r,{code:k.invalid_intersection_types}),B)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}er.create=(e,t,n)=>new er({left:e,right:t,typeName:U.ZodIntersection,...K(n)});class jt extends se{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==I.array)return A(r,{code:k.invalid_type,expected:I.array,received:r.parsedType}),B;if(r.data.length<this._def.items.length)return A(r,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&r.data.length>this._def.items.length&&(A(r,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Rt(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Ie.mergeArray(n,i)):Ie.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new jt({...this._def,rest:t})}}jt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jt({items:e,typeName:U.ZodTuple,rest:null,...K(t)})};class _i extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==I.map)return A(r,{code:k.invalid_type,expected:I.map,received:r.parsedType}),B;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:o._parse(new Rt(r,a,r.path,[u,"key"])),value:s._parse(new Rt(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return B;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of i){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return B;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}_i.create=(e,t,n)=>new _i({valueType:t,keyType:e,typeName:U.ZodMap,...K(n)});class yn extends se{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==I.set)return A(r,{code:k.invalid_type,expected:I.set,received:r.parsedType}),B;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(A(r,{code:k.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(A(r,{code:k.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(c){const u=new Set;for(const d of c){if(d.status==="aborted")return B;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new Rt(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,n){return new yn({...this._def,minSize:{value:t,message:P.toString(n)}})}max(t,n){return new yn({...this._def,maxSize:{value:t,message:P.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yn.create=(e,t)=>new yn({valueType:e,minSize:null,maxSize:null,typeName:U.ZodSet,...K(t)});class Si extends se{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Si.create=(e,t)=>new Si({getter:e,typeName:U.ZodLazy,...K(t)});class Ci extends se{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return A(n,{received:n.data,code:k.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ci.create=(e,t)=>new Ci({value:e,typeName:U.ZodLiteral,...K(t)});function mc(e,t){return new Xt({values:e,typeName:U.ZodEnum,...K(t)})}class Xt extends se{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return A(n,{expected:ie.joinValues(r),received:n.parsedType,code:k.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return A(n,{received:n.data,code:k.invalid_enum_value,options:r}),B}return Fe(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Xt.create(t,{...this._def,...n})}exclude(t,n=this._def){return Xt.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Xt.create=mc;class Ri extends se{_parse(t){const n=ie.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==I.string&&r.parsedType!==I.number){const o=ie.objectValues(n);return A(r,{expected:ie.joinValues(o),received:r.parsedType,code:k.invalid_type}),B}if(this._cache||(this._cache=new Set(ie.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=ie.objectValues(n);return A(r,{received:r.data,code:k.invalid_enum_value,options:o}),B}return Fe(t.data)}get enum(){return this._def.values}}Ri.create=(e,t)=>new Ri({values:e,typeName:U.ZodNativeEnum,...K(t)});class tr extends se{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==I.promise&&n.common.async===!1)return A(n,{code:k.invalid_type,expected:I.promise,received:n.parsedType}),B;const r=n.parsedType===I.promise?n.data:Promise.resolve(n.data);return Fe(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tr.create=(e,t)=>new tr({type:e,typeName:U.ZodPromise,...K(t)});class Yt extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{A(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return B;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?B:c.status==="dirty"||n.value==="dirty"?ln(c.value):c});{if(n.value==="aborted")return B;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?B:a.status==="dirty"||n.value==="dirty"?ln(a.value):a}}if(o.type==="refinement"){const i=a=>{const c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?B:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?B:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Zt(i))return B;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Zt(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):B);ie.assertNever(o)}}Yt.create=(e,t,n)=>new Yt({schema:e,typeName:U.ZodEffects,effect:t,...K(n)});Yt.createWithPreprocess=(e,t,n)=>new Yt({schema:t,effect:{type:"preprocess",transform:e},typeName:U.ZodEffects,...K(n)});class yt extends se{_parse(t){return this._getType(t)===I.undefined?Fe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}yt.create=(e,t)=>new yt({innerType:e,typeName:U.ZodOptional,...K(t)});class Jt extends se{_parse(t){return this._getType(t)===I.null?Fe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jt.create=(e,t)=>new Jt({innerType:e,typeName:U.ZodNullable,...K(t)});class Co extends se{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===I.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Co.create=(e,t)=>new Co({innerType:e,typeName:U.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(t)});class Ro extends se{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Yn(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ct(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ct(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ro.create=(e,t)=>new Ro({innerType:e,typeName:U.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});class ki extends se{_parse(t){if(this._getType(t)!==I.nan){const r=this._getOrReturnCtx(t);return A(r,{code:k.invalid_type,expected:I.nan,received:r.parsedType}),B}return{status:"valid",value:t.data}}}ki.create=e=>new ki({typeName:U.ZodNaN,...K(e)});class $v extends se{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class us extends se{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?B:s.status==="dirty"?(n.dirty(),ln(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?B:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new us({in:t,out:n,typeName:U.ZodPipeline})}}class ko extends se{_parse(t){const n=this._def.innerType._parse(t),r=o=>(Zt(o)&&(o.value=Object.freeze(o.value)),o);return Yn(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}ko.create=(e,t)=>new ko({innerType:e,typeName:U.ZodReadonly,...K(t)});var U;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(U||(U={}));const de=vt.create,Rn=Kt.create,vr=_o.create;kt.create;const gc=qe.create,ye=he.create;Qn.create;er.create;jt.create;const rn=Xt.create;tr.create;yt.create;Jt.create;const Lv=10,Eo={name:"space_search",description:"Find Hugging Face Spaces using semantic search. Include links to the Space when presenting the results.",schema:ye({query:de().min(1,"Query is required").max(100,"Query too long").describe("Semantic Search Query"),limit:Rn().optional().default(Lv).describe("Number of results to return"),mcp:vr().optional().default(!1).describe("Only return MCP Server enabled Spaces")}),annotations:{title:"Hugging Face Space Search"}},Mo={name:"model_search",description:"Find Machine Learning models hosted on Hugging Face. Returns comprehensive information about matching models including downloads, likes, tags, and direct links. Include links to the models in your response",schema:ye({query:de().optional().describe('Search term. Leave blank and specify "sort" and "limit" to get e.g. "Top 20 trending models", "Top 10 most recent models" etc" '),author:de().optional().describe("Organization or user who created the model (e.g., 'google', 'meta-llama', 'microsoft')"),task:de().optional().describe("Model task type (e.g., 'text-generation', 'image-classification', 'translation')"),library:de().optional().describe("Framework the model uses (e.g., 'transformers', 'diffusers', 'timm')"),sort:rn(["trendingScore","downloads","likes","createdAt","lastModified"]).optional().describe("Sort order: trendingScore, downloads , likes, createdAt, lastModified"),limit:Rn().min(1).max(100).optional().default(20).describe("Maximum number of results to return")}),annotations:{title:"Model Search"}};new Promise(e=>{});var Zr=65536;Vv();function Vv(){try{return new Uint32Array(Zr)}catch{const t=new Array(Zr);for(let n=0;n<Zr;n++)t[n]=0;return t}}const zv={name:"model_details",schema:ye({model_id:de().min(1,"Model ID is required").describe("The Model ID in author/model format (e.g., microsoft/DialoGPT-large)")})};ye({model_id:de().min(5,"Model ID is required").max(50).describe("The Model ID in author/model format (e.g. 'openai/gpt-oss-120b')")});const No={name:"paper_search",description:"Find Machine Learning research papers on the Hugging Face hub. Include 'Link to paper' When presenting the results. Consider whether tabulating results matches user intent.",schema:ye({query:de().min(3,"Supply at least one search term").max(200,"Query too long").describe("Semantic Search query"),results_limit:Rn().optional().default(12).describe("Number of results to return"),concise_only:vr().optional().default(!1).describe("Return a 2 sentence summary of the abstract. Use for broad search terms which may return a lot of results. Check with User if unsure.")}),annotations:{title:"Paper Search"}},Ao={name:"dataset_search",description:"Find Datasets hosted on the Hugging Face hub. Returns comprehensive information about matching datasets including downloads, likes, tags, and direct links. Include links to the datasets in your response",schema:ye({query:de().optional().describe('Search term. Leave blank and specify "sort" and "limit" to get e.g. "Top 20 trending datasets", "Top 10 most recent datasets" etc" '),author:de().optional().describe("Organization or user who created the dataset (e.g., 'google', 'facebook', 'allenai')"),tags:gc(de()).optional().describe("Tags to filter datasets (e.g., ['language:en', 'size_categories:1M<n<10M', 'task_categories:text-classification'])"),sort:rn(["trendingScore","downloads","likes","createdAt","lastModified"]).optional().describe("Sort order: trendingScore, downloads, likes, createdAt, lastModified"),limit:Rn().min(1).max(100).optional().default(20).describe("Maximum number of results to return")}),annotations:{title:"Dataset Search"}},Hv={name:"dataset_details",schema:ye({dataset_id:de().min(5,"Dataset ID is required").describe("The Dataset ID (e.g. Anthropic/hh-rlhf, squad)")})};ye({dataset_id:de().min(3,"Dataset ID is required").max(100).describe("The Dataset ID (e.g. 'Anthropic/hh-rlhf', 'squad')")});const To={name:"hub_repo_details",description:"Get details for one or more Hugging Face repos (model, dataset, or space). Auto-detects type unless specified.",schema:ye({repo_ids:gc(de().min(1)).min(1,"Provide at least one id").max(10,"Provide at most 10 repo ids").describe("Repo IDs for (models|dataset/space) - usually in author/name format (e.g. openai/gpt-oss-120b)"),repo_type:rn(["model","dataset","space"]).optional().describe("Specify lookup type; otherwise auto-detects"),include_readme:vr().default(!1).describe("Include README from the repo")}),annotations:{title:"Hub Repo Details"}},pc={name:"duplicate_space",schema:ye({sourceSpaceId:de().min(1).describe("Space ID to copy (e.g., 'username/space-name')"),newSpaceId:de().optional().describe("Name for the new space (optional, defaults to source space-name)"),hardware:rn(["freecpu","zerogpu"]).optional().describe('Either "freecpu" or "zerogpu" (defaults based on source). Both options are in the free tier.'),private:vr().optional().default(!0).describe("Check with User whether the new space should be public or private.")}),annotations:{title:"Duplicate Hugging Face Space"}};ye({username:de().optional().describe("Username to get spaces for (defaults to authenticated user)")});const hc={name:"space_files",schema:ye({spaceName:de().optional().describe('Space identifier in format "username/spacename"'),fileType:rn(["all","image","audio"]).optional().default("all").describe("Filter files by type: all (default), image, or audio files only")}),annotations:{title:"Space Files List"}};ye({fileType:rn(["all","image","audio","text"]).optional().default("all").describe("Filter by type")});ye({});ye({user_id:de().min(3,"User ID must be at least 3 characters long").describe('Hugging Face user ID or URL (e.g., "evalstate" or "hf.co/evalstate")').max(60).describe("Maximum length is 30 characters")});ye({paper_id:de().min(1,"Paper ID is required").describe('arXiv paper ID in various formats (e.g., "2502.16161", "arxiv:2502.16161", or full URL)').max(60).describe("Maximum length is 100 characters")});var ds=typeof window<"u"?window:{};function Gv(){var e=ds.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Bv(){var e=function(){};return Uv()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function Uv(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{ds.ActiveXObject&&(e=!0)}return e}Gv()?ds.DOMParser:Bv();const jo={name:"hf_doc_fetch",description:"Fetch a document from the Hugging Face or Gradio documentation library. For large documents, use offset to get subsequent chunks.",schema:ye({doc_url:de().max(200,"Query too long").describe("Documentation URL (Hugging Face or Gradio)"),offset:Rn().min(0).optional().describe("Token offset for large documents (use the offset from truncation message)")}),annotations:{title:"Fetch a document from the Hugging Face documentation library"}},Io={name:"hf_doc_search",description:"Search documentation about all of Hugging Face products and libraries (Transformers, Datasets, Diffusers, Gradio, Hub, and more). Use this for the most up-to-date information Returns excerpts grouped by Product and Document.",schema:ye({query:de().min(3,"Supply at least one search term").max(200,"Query too long").describe("Semantic search query"),product:de().optional().describe('Filter by Product (e.g., "hub", "dataset-viewer", "transformers"). Supply when known for focused results')}),annotations:{title:"Hugging Face Documentation Library Search"}};ye({space_id:de().min(1).describe("Space ID in 'username/repo' format")});const Ei=Eo.name,Mi=Mo.name,Wv=zv.name,Ni=No.name,Ai=Ao.name,qv=Hv.name,dn=To.name,Ti=pc.name,ji=hc.name,Ii=Io.name,Pi=jo.name;function Oi(e){const t=new Set,n=[];let r=!1;for(const o of e){if(o===Wv||o===qv){r=!0;continue}t.has(o)||(t.add(o),n.push(o))}return r&&!t.has(dn)&&(t.add(dn),n.push(dn)),n}const Kr=e=>fetch(e).then(t=>{if(!t.ok)throw new Error(`Failed to fetch: ${t.status}`);return t.json()});function Zv(){var S,$,L,X,te,Z,V,ne,G,J,R;const{data:e,error:t}=cn("/api/transport",Kr,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0});cn("/api/sessions",Kr,{refreshInterval:3e3,revalidateOnFocus:!0});const{data:n}=cn("/api/settings",Kr),r=((S=n==null?void 0:n.builtInTools)==null?void 0:S.includes(ui))??!1,o=(($=n==null?void 0:n.builtInTools)==null?void 0:$.includes(di))??!1,[s,i]=h.useState(["","",""]),[a,c]=h.useState(["","",""]),[u,d]=h.useState([!1,!1,!1]),[g,m]=h.useState(!1);h.useEffect(()=>{if(n!=null&&n.spaceTools&&!g){const M=["","",""],H=["","",""],z=[!1,!1,!1];n.spaceTools.forEach((Y,re)=>{re<3&&(M[re]=Y.name,H[re]=Y.subdomain,z[re]=!0)}),i(M),c(H),d(z),m(!0)}},[n,g]);const f=!e&&!t,v=t?t.message:null,p=async(M,H)=>{try{const z=n||{builtInTools:[]},Y=Oi(z.builtInTools),re=H?[...Y.filter(Q=>Q!==M),M]:Y.filter(Q=>Q!==M),le=Oi(re),be={...z,builtInTools:le};Vn("/api/settings",be,!1);const _e=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({builtInTools:le})});if(!_e.ok)throw new Error(`Failed to update tool settings: ${_e.status}`);Vn("/api/settings"),console.log(`${M} is now ${H?"enabled":"disabled"}`)}catch(z){console.error("Error updating tool settings:",z),alert(`Error updating ${M}: ${z instanceof Error?z.message:"Unknown error"}`),Vn("/api/settings")}},y=async(M,H)=>{const z=[...u];z[M]=H,d(z),await b(z)},x=async(M,H)=>{const z=[...s];z[M]=H,i(z),u[M]&&await b(u)},w=async(M,H)=>{const z=[...a];z[M]=H,c(z),u[M]&&await b(u)},b=async M=>{try{const H=[];for(let Y=0;Y<3;Y++)M[Y]&&s[Y]&&a[Y]&&H.push({_id:`space-${Y}`,name:s[Y],subdomain:a[Y],emoji:"🔧"});const z=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({spaceTools:H})});if(!z.ok)throw new Error(`Failed to update space tools: ${z.status}`)}catch(H){console.error("Error updating space tools:",H)}},_=async()=>{const M="https://huggingface.co/mcp";try{await navigator.clipboard.writeText(M)}catch(H){console.error("Failed to copy URL:",H)}},C=()=>{window.open("https://huggingface.co/settings/mcp","_blank")},N={paper_search:{id:Ni,label:No.annotations.title,description:No.description,settings:{enabled:((L=n==null?void 0:n.builtInTools)==null?void 0:L.includes(Ni))??!0}},space_search:{id:Ei,label:Eo.annotations.title,description:Eo.description,settings:{enabled:((X=n==null?void 0:n.builtInTools)==null?void 0:X.includes(Ei))??!0}},model_search:{id:Mi,label:Mo.annotations.title,description:Mo.description,settings:{enabled:((te=n==null?void 0:n.builtInTools)==null?void 0:te.includes(Mi))??!0}},dataset_search:{id:Ai,label:Ao.annotations.title,description:Ao.description,settings:{enabled:((Z=n==null?void 0:n.builtInTools)==null?void 0:Z.includes(Ai))??!0}},hub_repo_details:{id:dn,label:To.annotations.title,description:To.description,settings:{enabled:((V=n==null?void 0:n.builtInTools)==null?void 0:V.includes(dn))??!0}},include_readme:{id:ui,label:"Allow README Include (flag)",description:"Allows hub_repo_details to attach README content when the tool request explicitly opts in. Requires reconnect to take effect.",settings:{enabled:r}},doc_semantic_search:{id:Ii,label:Io.annotations.title,description:Io.description,settings:{enabled:((ne=n==null?void 0:n.builtInTools)==null?void 0:ne.includes(Ii))??!0}},doc_fetch:{id:Pi,label:jo.annotations.title,description:jo.description,settings:{enabled:((G=n==null?void 0:n.builtInTools)==null?void 0:G.includes(Pi))??!0}}},E={duplicate_space:{id:Ti,label:pc.annotations.title,description:"Duplicate a Hugging Face Space to your account.",settings:{enabled:((J=n==null?void 0:n.builtInTools)==null?void 0:J.includes(Ti))??!0}},space_files:{id:ji,label:hc.annotations.title,description:"List all files in a static Hugging Face Space with download URLs.",settings:{enabled:((R=n==null?void 0:n.builtInTools)==null?void 0:R.includes(ji))??!0}},no_gradio_images:{id:di,label:"Disable Gradio Images (flag)",description:"Strips image responses from Gradio spaces. Mirrors the 'no_image_content' URL parameter and requires reconnect to take effect.",settings:{enabled:o}}};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"min-h-screen p-4 sm:p-8 pb-20",children:l.jsx("div",{className:"max-w-4xl mx-auto",children:l.jsxs(dv,{defaultValue:"metrics",className:"w-full",children:[l.jsxs(fv,{className:"mb-6 w-full overflow-x-auto flex-nowrap",children:[l.jsx(Ht,{value:"metrics",className:"whitespace-nowrap",children:"📊 Metrics"}),l.jsx(Ht,{value:"mcp",className:"whitespace-nowrap",children:"🔧 MCP"}),!(e!=null&&e.externalApiMode)&&l.jsx(Ht,{value:"search",className:"whitespace-nowrap",children:"🔍 Search"}),!(e!=null&&e.externalApiMode)&&l.jsx(Ht,{value:"spaces",className:"whitespace-nowrap",children:"🚀 Spaces"}),!(e!=null&&e.externalApiMode)&&l.jsx(Ht,{value:"gradio",className:"whitespace-nowrap",children:"🚀 Gradio"}),l.jsx(Ht,{value:"home",className:"whitespace-nowrap",children:"🏠 Home"})]}),l.jsx(Gt,{value:"metrics",className:"mt-0",children:l.jsx(tv,{})}),l.jsx(Gt,{value:"mcp",className:"mt-0",children:l.jsx(rv,{})}),!(e!=null&&e.externalApiMode)&&l.jsx(Gt,{value:"search",className:"mt-0",children:l.jsx(Ns,{title:"🤗 Hugging Face Search Tools (MCP)",description:"Find and use Hugging Face and Community content.",tools:N,onToolToggle:p})}),!(e!=null&&e.externalApiMode)&&l.jsx(Gt,{value:"spaces",className:"mt-0",children:l.jsx(Ns,{title:"🤗 Hugging Face Space Tools (MCP)",description:"Manage and duplicate Hugging Face Spaces.",tools:E,onToolToggle:p})}),!(e!=null&&e.externalApiMode)&&l.jsx(Gt,{value:"gradio",className:"mt-0",children:l.jsx(Cd,{spaceNames:s,spaceSubdomains:a,enabledSpaces:u,onSpaceToolToggle:y,onSpaceToolNameChange:x,onSpaceToolSubdomainChange:w})}),l.jsx(Gt,{value:"home",className:"mt-0",children:l.jsxs(nt,{children:[l.jsxs(rt,{children:[l.jsx(ot,{children:"🤗 HF MCP Server"}),l.jsx(It,{children:"Connect with AI assistants through the Model Context Protocol"})]}),l.jsxs(st,{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"What's MCP?"}),l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. This HF MCP Server provides access to Hugging Face's ecosystem of models, datasets, and Spaces, allowing AI assistants to search, analyze, and interact with ML resources directly."})]}),l.jsx(At,{}),l.jsx("div",{className:"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:l.jsxs("div",{className:"flex items-start space-x-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"Tool Management Scope"}),((e==null?void 0:e.externalApiMode)||(e==null?void 0:e.transport)!=="stdio"&&!(e!=null&&e.externalApiMode))&&l.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300 leading-relaxed",children:e!=null&&e.externalApiMode?l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"External API Mode:"})," Tools are managed by an external API. Tool Selection Tabs are not available."]}):l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"Shared Mode:"})," Tool toggles in this interface affect"," ",l.jsx("strong",{children:"all connected MCP server instances"})," and control tool availability for all connected Hosts."]})})]})]})}),l.jsx(At,{}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs(Nt,{size:"xl",onClick:_,className:"w-full transition-all duration-200 active:bg-green-500 active:border-green-500 touch-manipulation",children:[l.jsx(fd,{className:"mr-2 h-5 w-5"}),"Copy MCP URL"]}),l.jsxs(Nt,{size:"xl",variant:"outline",onClick:C,className:"w-full touch-manipulation",children:[l.jsx(hd,{className:"mr-2 h-5 w-5"}),"Go to Settings"]})]})]})]})})]})})}),l.jsx(ov,{isLoading:f,error:v,transportInfo:e||{transport:"unknown"}})]})}bc.createRoot(document.getElementById("root")).render(l.jsx(h.StrictMode,{children:l.jsx(Zv,{})}));
|