@llmindset/hf-mcp-server 0.2.46 → 0.2.48
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/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +296 -157
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/transport/base-transport.d.ts +12 -0
- package/dist/server/transport/base-transport.d.ts.map +1 -1
- package/dist/server/transport/base-transport.js +25 -0
- package/dist/server/transport/base-transport.js.map +1 -1
- package/dist/server/transport/sse-transport.d.ts.map +1 -1
- package/dist/server/transport/sse-transport.js +6 -0
- package/dist/server/transport/sse-transport.js.map +1 -1
- package/dist/server/transport/stateless-http-transport.d.ts.map +1 -1
- package/dist/server/transport/stateless-http-transport.js +10 -2
- package/dist/server/transport/stateless-http-transport.js.map +1 -1
- package/dist/server/transport/streamable-http-transport.d.ts.map +1 -1
- package/dist/server/transport/streamable-http-transport.js +7 -2
- package/dist/server/transport/streamable-http-transport.js.map +1 -1
- package/dist/server/utils/gradio-discovery.d.ts.map +1 -1
- package/dist/server/utils/gradio-discovery.js +4 -1
- package/dist/server/utils/gradio-discovery.js.map +1 -1
- package/dist/server/utils/query-logger.d.ts +13 -13
- package/dist/server/utils/query-logger.d.ts.map +1 -1
- package/dist/server/utils/query-logger.js +41 -4
- package/dist/server/utils/query-logger.js.map +1 -1
- package/dist/server/web-server.d.ts.map +1 -1
- package/dist/server/web-server.js +1 -0
- package/dist/server/web-server.js.map +1 -1
- package/dist/shared/transport-metrics.d.ts +22 -0
- package/dist/shared/transport-metrics.d.ts.map +1 -1
- package/dist/shared/transport-metrics.js +70 -0
- package/dist/shared/transport-metrics.js.map +1 -1
- package/dist/web/assets/main-B_3qWYai.js +197 -0
- package/dist/web/index.html +1 -1
- package/package.json +2 -2
- package/dist/web/assets/main-b77rOMBk.js +0 -197
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import{r as _h,a as S,R as jt,j as d,b as ou,g as Sh,c as bh,d as Ch}from"./index-BBRBgpfp.js";var Da={exports:{}},Fa={};/**
|
|
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 Gi;function Rh(){if(Gi)return Fa;Gi=1;var t=_h();function e(m,f){return m===f&&(m!==0||1/m===1/f)||m!==m&&f!==f}var n=typeof Object.is=="function"?Object.is:e,a=t.useState,r=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue;function o(m,f){var l=f(),p=a({inst:{value:l,getSnapshot:f}}),g=p[0].inst,v=p[1];return s(function(){g.value=l,g.getSnapshot=f,c(g)&&v({inst:g})},[m,l,f]),r(function(){return c(g)&&v({inst:g}),m(function(){c(g)&&v({inst:g})})},[m]),i(l),l}function c(m){var f=m.getSnapshot;m=m.value;try{var l=f();return!n(m,l)}catch{return!0}}function u(m,f){return f()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return Fa.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,Fa}var Bi;function Eh(){return Bi||(Bi=1,Da.exports=Rh()),Da.exports}var Ph=Eh();const iu=0,lu=1,cu=2,Ki=3;var Wi=Object.prototype.hasOwnProperty;function no(t,e){var n,a;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((a=t.length)===e.length)for(;a--&&no(t[a],e[a]););return a===-1}if(!n||typeof t=="object"){a=0;for(n in t)if(Wi.call(t,n)&&++a&&!Wi.call(e,n)||!(n in e)||!no(t[n],e[n]))return!1;return Object.keys(e).length===a}}return t!==t&&e!==e}const Bt=new WeakMap,lr=()=>{},it=lr(),ao=Object,Oe=t=>t===it,Tt=t=>typeof t=="function",fr=(t,e)=>({...t,...e}),uu=t=>Tt(t.then),$a={},On={},Go="undefined",_n=typeof window!=Go,so=typeof document!=Go,Ih=_n&&"Deno"in window,Ah=()=>_n&&typeof window.requestAnimationFrame!=Go,du=(t,e)=>{const n=Bt.get(t);return[()=>!Oe(e)&&t.get(e)||$a,a=>{if(!Oe(e)){const r=t.get(e);e in On||(On[e]=r),n[5](e,fr(r,a),r||$a)}},n[6],()=>!Oe(e)&&e in On?On[e]:!Oe(e)&&t.get(e)||$a]};let oo=!0;const Nh=()=>oo,[io,lo]=_n&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[lr,lr],jh=()=>{const t=so&&document.visibilityState;return Oe(t)||t!=="hidden"},Th=t=>(so&&document.addEventListener("visibilitychange",t),io("focus",t),()=>{so&&document.removeEventListener("visibilitychange",t),lo("focus",t)}),Oh=t=>{const e=()=>{oo=!0,t()},n=()=>{oo=!1};return io("online",e),io("offline",n),()=>{lo("online",e),lo("offline",n)}},kh={isOnline:Nh,isVisible:jh},Mh={initFocus:Th,initReconnect:Oh},Zi=!jt.useId,fn=!_n||Ih,Dh=t=>Ah()?window.requestAnimationFrame(t):setTimeout(t,1),La=fn?S.useEffect:S.useLayoutEffect,Va=typeof navigator<"u"&&navigator.connection,Qi=!fn&&Va&&(["slow-2g","2g"].includes(Va.effectiveType)||Va.saveData),kn=new WeakMap,Fh=t=>ao.prototype.toString.call(t),za=(t,e)=>t===`[object ${e}]`;let $h=0;const co=t=>{const e=typeof t,n=Fh(t),a=za(n,"Date"),r=za(n,"RegExp"),s=za(n,"Object");let i,o;if(ao(t)===t&&!a&&!r){if(i=kn.get(t),i)return i;if(i=++$h+"~",kn.set(t,i),Array.isArray(t)){for(i="@",o=0;o<t.length;o++)i+=co(t[o])+",";kn.set(t,i)}if(s){i="#";const c=ao.keys(t).sort();for(;!Oe(o=c.pop());)Oe(t[o])||(i+=o+":"+co(t[o])+",");kn.set(t,i)}}else i=a?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return i},Bo=t=>{if(Tt(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?co(t):"",[t,e]};let Lh=0;const uo=()=>++Lh;async function fu(...t){const[e,n,a,r]=t,s=fr({populateCache:!0,throwOnError:!0},typeof r=="boolean"?{revalidate:r}:r||{});let i=s.populateCache;const o=s.rollbackOnError;let c=s.optimisticData;const u=f=>typeof o=="function"?o(f):o!==!1,h=s.throwOnError;if(Tt(n)){const f=n,l=[],p=e.keys();for(const g of p)!/^\$(inf|sub)\$/.test(g)&&f(e.get(g)._k)&&l.push(g);return Promise.all(l.map(m))}return m(n);async function m(f){const[l]=Bo(f);if(!l)return;const[p,g]=du(e,l),[v,y,_,x]=Bt.get(e),w=()=>{const D=v[l];return(Tt(s.revalidate)?s.revalidate(p().data,f):s.revalidate!==!1)&&(delete _[l],delete x[l],D&&D[0])?D[0](cu).then(()=>p().data):p().data};if(t.length<3)return w();let b=a,I,E=!1;const R=uo();y[l]=[R,0];const T=!Oe(c),P=p(),O=P.data,M=P._c,z=Oe(M)?O:M;if(T&&(c=Tt(c)?c(z,O):c,g({data:c,_c:z})),Tt(b))try{b=b(z)}catch(D){I=D,E=!0}if(b&&uu(b))if(b=await b.catch(D=>{I=D,E=!0}),R!==y[l][0]){if(E)throw I;return b}else E&&T&&u(I)&&(i=!0,g({data:z,_c:it}));if(i&&!E)if(Tt(i)){const D=i(b,z);g({data:D,error:it,_c:it})}else g({data:b,error:it,_c:it});if(y[l][1]=uo(),Promise.resolve(w()).then(()=>{g({_c:it})}),E){if(h)throw I;return}return b}}const Ji=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},Vh=(t,e)=>{if(!Bt.has(t)){const n=fr(Mh,e),a=Object.create(null),r=fu.bind(it,t);let s=lr;const i=Object.create(null),o=(h,m)=>{const f=i[h]||[];return i[h]=f,f.push(m),()=>f.splice(f.indexOf(m),1)},c=(h,m,f)=>{t.set(h,m);const l=i[h];if(l)for(const p of l)p(m,f)},u=()=>{if(!Bt.has(t)&&(Bt.set(t,[a,Object.create(null),Object.create(null),Object.create(null),r,c,o]),!fn)){const h=n.initFocus(setTimeout.bind(it,Ji.bind(it,a,iu))),m=n.initReconnect(setTimeout.bind(it,Ji.bind(it,a,lu)));s=()=>{h&&h(),m&&m(),Bt.delete(t)}}};return u(),[t,r,u,s]}return[t,Bt.get(t)[4]]},zh=(t,e,n,a,r)=>{const s=n.errorRetryCount,i=r.retryCount,o=~~((Math.random()+.5)*(1<<(i<8?i:8)))*n.errorRetryInterval;!Oe(s)&&i>s||setTimeout(a,o,r)},qh=no,[hu,Zn]=Vh(new Map),Uh=fr({onLoadingSlow:lr,onSuccess:lr,onError:lr,onErrorRetry:zh,onDiscarded:lr,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Qi?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Qi?5e3:3e3,compare:qh,isPaused:()=>!1,cache:hu,mutate:Zn,fallback:{}},kh),Hh=(t,e)=>{const n=fr(t,e);if(e){const{use:a,fallback:r}=t,{use:s,fallback:i}=e;a&&s&&(n.use=a.concat(s)),r&&i&&(n.fallback=fr(r,i))}return n},Gh=S.createContext({}),Bh="$inf$",mu=_n&&window.__SWR_DEVTOOLS_USE__,Kh=mu?window.__SWR_DEVTOOLS_USE__:[],Wh=()=>{mu&&(window.__SWR_DEVTOOLS_REACT__=jt)},Zh=t=>Tt(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],Qh=()=>{const t=S.useContext(Gh);return S.useMemo(()=>fr(Uh,t),[t])},Jh=t=>(e,n,a)=>t(e,n&&((...s)=>{const[i]=Bo(e),[,,,o]=Bt.get(hu);if(i.startsWith(Bh))return n(...s);const c=o[i];return Oe(c)?n(...s):(delete o[i],c)}),a),Xh=Kh.concat(Jh),Yh=t=>function(...n){const a=Qh(),[r,s,i]=Zh(n),o=Hh(a,i);let c=t;const{use:u}=o,h=(u||[]).concat(Xh);for(let m=h.length;m--;)c=h[m](c);return c(r,s||o.fetcher||null,o)},em=(t,e,n)=>{const a=e[t]||(e[t]=[]);return a.push(n),()=>{const r=a.indexOf(n);r>=0&&(a[r]=a[a.length-1],a.pop())}};Wh();const qa=jt.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Ua={dedupe:!0},Xi=Promise.resolve(it),tm=(t,e,n)=>{const{cache:a,compare:r,suspense:s,fallbackData:i,revalidateOnMount:o,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:h,refreshWhenOffline:m,keepPreviousData:f}=n,[l,p,g,v]=Bt.get(a),[y,_]=Bo(t),x=S.useRef(!1),w=S.useRef(!1),b=S.useRef(y),I=S.useRef(e),E=S.useRef(n),R=()=>E.current,T=()=>R().isVisible()&&R().isOnline(),[P,O,M,z]=du(a,y),D=S.useRef({}).current,W=Oe(i)?Oe(n.fallback)?it:n.fallback[y]:i,H=(ee,ae)=>{for(const Se in D){const ce=Se;if(ce==="data"){if(!r(ee[ce],ae[ce])&&(!Oe(ee[ce])||!r(Me,ae[ce])))return!1}else if(ae[ce]!==ee[ce])return!1}return!0},J=S.useMemo(()=>{const ee=!y||!e?!1:Oe(o)?R().isPaused()||s?!1:c!==!1:o,ae=Fe=>{const ze=fr(Fe);return delete ze._k,ee?{isValidating:!0,isLoading:!0,...ze}:ze},Se=P(),ce=z(),be=ae(Se),$e=Se===ce?be:ae(ce);let _e=be;return[()=>{const Fe=ae(P());return H(Fe,_e)?(_e.data=Fe.data,_e.isLoading=Fe.isLoading,_e.isValidating=Fe.isValidating,_e.error=Fe.error,_e):(_e=Fe,Fe)},()=>$e]},[a,y]),F=Ph.useSyncExternalStore(S.useCallback(ee=>M(y,(ae,Se)=>{H(Se,ae)||ee()}),[a,y]),J[0],J[1]),q=!x.current,K=l[y]&&l[y].length>0,re=F.data,fe=Oe(re)?W&&uu(W)?qa(W):W:re,me=F.error,ye=S.useRef(fe),Me=f?Oe(re)?Oe(ye.current)?fe:ye.current:re:fe,k=K&&!Oe(me)?!1:q&&!Oe(o)?o:R().isPaused()?!1:s?Oe(fe)?!1:c:Oe(fe)||c,$=!!(y&&e&&q&&k),X=Oe(F.isValidating)?$:F.isValidating,ne=Oe(F.isLoading)?$:F.isLoading,U=S.useCallback(async ee=>{const ae=I.current;if(!y||!ae||w.current||R().isPaused())return!1;let Se,ce,be=!0;const $e=ee||{},_e=!g[y]||!$e.dedupe,Fe=()=>Zi?!w.current&&y===b.current&&x.current:y===b.current,ze={isValidating:!1,isLoading:!1},qe=()=>{O(ze)},Ge=()=>{const nt=g[y];nt&&nt[1]===ce&&delete g[y]},rt={isValidating:!0};Oe(P().data)&&(rt.isLoading=!0);try{if(_e&&(O(rt),n.loadingTimeout&&Oe(P().data)&&setTimeout(()=>{be&&Fe()&&R().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ae(_),uo()]),[Se,ce]=g[y],Se=await Se,_e&&setTimeout(Ge,n.dedupingInterval),!g[y]||g[y][1]!==ce)return _e&&Fe()&&R().onDiscarded(y),!1;ze.error=it;const nt=p[y];if(!Oe(nt)&&(ce<=nt[0]||ce<=nt[1]||nt[1]===0))return qe(),_e&&Fe()&&R().onDiscarded(y),!1;const ht=P().data;ze.data=r(ht,Se)?ht:Se,_e&&Fe()&&R().onSuccess(Se,y,n)}catch(nt){Ge();const ht=R(),{shouldRetryOnError:xr}=ht;ht.isPaused()||(ze.error=nt,_e&&Fe()&&(ht.onError(nt,y,ht),(xr===!0||Tt(xr)&&xr(nt))&&(!R().revalidateOnFocus||!R().revalidateOnReconnect||T())&&ht.onErrorRetry(nt,y,ht,ka=>{const mt=l[y];mt&&mt[0]&&mt[0](Ki,ka)},{retryCount:($e.retryCount||0)+1,dedupe:!0})))}return be=!1,qe(),!0},[y,a]),Z=S.useCallback((...ee)=>fu(a,b.current,...ee),[]);if(La(()=>{I.current=e,E.current=n,Oe(re)||(ye.current=re)}),La(()=>{if(!y)return;const ee=U.bind(it,Ua);let ae=0;R().revalidateOnFocus&&(ae=Date.now()+R().focusThrottleInterval);const ce=em(y,l,(be,$e={})=>{if(be==iu){const _e=Date.now();R().revalidateOnFocus&&_e>ae&&T()&&(ae=_e+R().focusThrottleInterval,ee())}else if(be==lu)R().revalidateOnReconnect&&T()&&ee();else{if(be==cu)return U();if(be==Ki)return U($e)}});return w.current=!1,b.current=y,x.current=!0,O({_k:_}),k&&(g[y]||(Oe(fe)||fn?ee():Dh(ee))),()=>{w.current=!0,ce()}},[y]),La(()=>{let ee;function ae(){const ce=Tt(u)?u(P().data):u;ce&&ee!==-1&&(ee=setTimeout(Se,ce))}function Se(){!P().error&&(h||R().isVisible())&&(m||R().isOnline())?U(Ua).then(ae):ae()}return ae(),()=>{ee&&(clearTimeout(ee),ee=-1)}},[u,h,m,y]),S.useDebugValue(Me),s){const ee=y&&Oe(fe);if(!Zi&&fn&&ee)throw new Error("Fallback data is required when using Suspense in SSR.");ee&&(I.current=e,E.current=n,w.current=!1);const ae=v[y],Se=!Oe(ae)&&ee?Z(ae):Xi;if(qa(Se),!Oe(me)&&ee)throw me;const ce=ee?U(Ua):Xi;!Oe(Me)&&ee&&(ce.status="fulfilled",ce.value=!0),qa(ce)}return{mutate:Z,get data(){return D.data=!0,Me},get error(){return D.error=!0,me},get isValidating(){return D.isValidating=!0,X},get isLoading(){return D.isLoading=!0,ne}}},cn=Yh(tm);function pu(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=pu(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function gu(){for(var t,e,n=0,a="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=pu(t))&&(a&&(a+=" "),a+=e);return a}const Ko="-",rm=t=>{const e=am(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:i=>{const o=i.split(Ko);return o[0]===""&&o.length!==1&&o.shift(),vu(o,e)||nm(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},vu=(t,e)=>{var i;if(t.length===0)return e.classGroupId;const n=t[0],a=e.nextPart.get(n),r=a?vu(t.slice(1),a):void 0;if(r)return r;if(e.validators.length===0)return;const s=t.join(Ko);return(i=e.validators.find(({validator:o})=>o(s)))==null?void 0:i.classGroupId},Yi=/^\[(.+)\]$/,nm=t=>{if(Yi.test(t)){const e=Yi.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},am=t=>{const{theme:e,classGroups:n}=t,a={nextPart:new Map,validators:[]};for(const r in n)fo(n[r],a,r,e);return a},fo=(t,e,n,a)=>{t.forEach(r=>{if(typeof r=="string"){const s=r===""?e:el(e,r);s.classGroupId=n;return}if(typeof r=="function"){if(sm(r)){fo(r(a),e,n,a);return}e.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([s,i])=>{fo(i,el(e,s),n,a)})})},el=(t,e)=>{let n=t;return e.split(Ko).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},sm=t=>t.isThemeGetter,om=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,a=new Map;const r=(s,i)=>{n.set(s,i),e++,e>t&&(e=0,a=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=a.get(s))!==void 0)return r(s,i),i},set(s,i){n.has(s)?n.set(s,i):r(s,i)}}},ho="!",mo=":",im=mo.length,lm=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const s=[];let i=0,o=0,c=0,u;for(let p=0;p<r.length;p++){let g=r[p];if(i===0&&o===0){if(g===mo){s.push(r.slice(c,p)),c=p+im;continue}if(g==="/"){u=p;continue}}g==="["?i++:g==="]"?i--:g==="("?o++:g===")"&&o--}const h=s.length===0?r:r.substring(c),m=cm(h),f=m!==h,l=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:l}};if(e){const r=e+mo,s=a;a=i=>i.startsWith(r)?s(i.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},cm=t=>t.endsWith(ho)?t.substring(0,t.length-1):t.startsWith(ho)?t.substring(1):t,um=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const r=[];let s=[];return a.forEach(i=>{i[0]==="["||e[i]?(r.push(...s.sort(),i),s=[]):s.push(i)}),r.push(...s.sort()),r}},dm=t=>({cache:om(t.cacheSize),parseClassName:lm(t),sortModifiers:um(t),...rm(t)}),fm=/\s+/,hm=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=e,i=[],o=t.trim().split(fm);let c="";for(let u=o.length-1;u>=0;u-=1){const h=o[u],{isExternal:m,modifiers:f,hasImportantModifier:l,baseClassName:p,maybePostfixModifierPosition:g}=n(h);if(m){c=h+(c.length>0?" "+c:c);continue}let v=!!g,y=a(v?p.substring(0,g):p);if(!y){if(!v){c=h+(c.length>0?" "+c:c);continue}if(y=a(p),!y){c=h+(c.length>0?" "+c:c);continue}v=!1}const _=s(f).join(":"),x=l?_+ho:_,w=x+y;if(i.includes(w))continue;i.push(w);const b=r(y,v);for(let I=0;I<b.length;++I){const E=b[I];i.push(x+E)}c=h+(c.length>0?" "+c:c)}return c};function mm(){let t=0,e,n,a="";for(;t<arguments.length;)(e=arguments[t++])&&(n=yu(e))&&(a&&(a+=" "),a+=n);return a}const yu=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=yu(t[a]))&&(n&&(n+=" "),n+=e);return n};function pm(t,...e){let n,a,r,s=i;function i(c){const u=e.reduce((h,m)=>m(h),t());return n=dm(u),a=n.cache.get,r=n.cache.set,s=o,o(c)}function o(c){const u=a(c);if(u)return u;const h=hm(c,n);return r(c,h),h}return function(){return s(mm.apply(null,arguments))}}const Ye=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},xu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gm=/^\d+\/\d+$/,vm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ym=/\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$/,xm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_m=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dr=t=>gm.test(t),Pe=t=>!!t&&!Number.isNaN(Number(t)),sr=t=>!!t&&Number.isInteger(Number(t)),Ha=t=>t.endsWith("%")&&Pe(t.slice(0,-1)),Ut=t=>vm.test(t),Sm=()=>!0,bm=t=>ym.test(t)&&!xm.test(t),_u=()=>!1,Cm=t=>wm.test(t),Rm=t=>_m.test(t),Em=t=>!oe(t)&&!ie(t),Pm=t=>Wr(t,Cu,_u),oe=t=>xu.test(t),Sr=t=>Wr(t,Ru,bm),Ga=t=>Wr(t,Tm,Pe),tl=t=>Wr(t,Su,_u),Im=t=>Wr(t,bu,Rm),Mn=t=>Wr(t,Eu,Cm),ie=t=>wu.test(t),nn=t=>Zr(t,Ru),Am=t=>Zr(t,Om),rl=t=>Zr(t,Su),Nm=t=>Zr(t,Cu),jm=t=>Zr(t,bu),Dn=t=>Zr(t,Eu,!0),Wr=(t,e,n)=>{const a=xu.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},Zr=(t,e,n=!1)=>{const a=wu.exec(t);return a?a[1]?e(a[1]):n:!1},Su=t=>t==="position"||t==="percentage",bu=t=>t==="image"||t==="url",Cu=t=>t==="length"||t==="size"||t==="bg-size",Ru=t=>t==="length",Tm=t=>t==="number",Om=t=>t==="family-name",Eu=t=>t==="shadow",km=()=>{const t=Ye("color"),e=Ye("font"),n=Ye("text"),a=Ye("font-weight"),r=Ye("tracking"),s=Ye("leading"),i=Ye("breakpoint"),o=Ye("container"),c=Ye("spacing"),u=Ye("radius"),h=Ye("shadow"),m=Ye("inset-shadow"),f=Ye("text-shadow"),l=Ye("drop-shadow"),p=Ye("blur"),g=Ye("perspective"),v=Ye("aspect"),y=Ye("ease"),_=Ye("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...w(),ie,oe],I=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],R=()=>[ie,oe,c],T=()=>[Dr,"full","auto",...R()],P=()=>[sr,"none","subgrid",ie,oe],O=()=>["auto",{span:["full",sr,ie,oe]},sr,ie,oe],M=()=>[sr,"auto",ie,oe],z=()=>["auto","min","max","fr",ie,oe],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],J=()=>[Dr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],F=()=>[t,ie,oe],q=()=>[...w(),rl,tl,{position:[ie,oe]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",Nm,Pm,{size:[ie,oe]}],fe=()=>[Ha,nn,Sr],me=()=>["","none","full",u,ie,oe],ye=()=>["",Pe,nn,Sr],Me=()=>["solid","dashed","dotted","double"],k=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[Pe,Ha,rl,tl],X=()=>["","none",p,ie,oe],ne=()=>["none",Pe,ie,oe],U=()=>["none",Pe,ie,oe],Z=()=>[Pe,ie,oe],pe=()=>[Dr,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ut],breakpoint:[Ut],color:[Sm],container:[Ut],"drop-shadow":[Ut],ease:["in","out","in-out"],font:[Em],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ut],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ut],shadow:[Ut],spacing:["px",Pe],text:[Ut],"text-shadow":[Ut],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dr,oe,ie,v]}],container:["container"],columns:[{columns:[Pe,oe,ie,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:b()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[sr,"auto",ie,oe]}],basis:[{basis:[Dr,"full","auto",o,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,Dr,"auto","initial","none",oe]}],grow:[{grow:["",Pe,ie,oe]}],shrink:[{shrink:["",Pe,ie,oe]}],order:[{order:[sr,"first","last","none",ie,oe]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[o,"screen",...J()]}],"min-w":[{"min-w":[o,"screen","none",...J()]}],"max-w":[{"max-w":[o,"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,nn,Sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ie,Ga]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ha,oe]}],"font-family":[{font:[Am,oe,e]}],"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:[r,ie,oe]}],"line-clamp":[{"line-clamp":[Pe,"none",ie,Ga]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",ie,oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",ie,Sr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Pe,"auto",ie,oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,oe]}],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",ie,oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sr,ie,oe],radial:["",ie,oe],conic:[sr,ie,oe]},jm,Im]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:me()}],"rounded-s":[{"rounded-s":me()}],"rounded-e":[{"rounded-e":me()}],"rounded-t":[{"rounded-t":me()}],"rounded-r":[{"rounded-r":me()}],"rounded-b":[{"rounded-b":me()}],"rounded-l":[{"rounded-l":me()}],"rounded-ss":[{"rounded-ss":me()}],"rounded-se":[{"rounded-se":me()}],"rounded-ee":[{"rounded-ee":me()}],"rounded-es":[{"rounded-es":me()}],"rounded-tl":[{"rounded-tl":me()}],"rounded-tr":[{"rounded-tr":me()}],"rounded-br":[{"rounded-br":me()}],"rounded-bl":[{"rounded-bl":me()}],"border-w":[{border:ye()}],"border-w-x":[{"border-x":ye()}],"border-w-y":[{"border-y":ye()}],"border-w-s":[{"border-s":ye()}],"border-w-e":[{"border-e":ye()}],"border-w-t":[{"border-t":ye()}],"border-w-r":[{"border-r":ye()}],"border-w-b":[{"border-b":ye()}],"border-w-l":[{"border-l":ye()}],"divide-x":[{"divide-x":ye()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ye()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Me(),"hidden","none"]}],"divide-style":[{divide:[...Me(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...Me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,ie,oe]}],"outline-w":[{outline:["",Pe,nn,Sr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",h,Dn,Mn]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",m,Dn,Mn]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ye()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Pe,Sr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ye()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",f,Dn,Mn]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Pe,ie,oe]}],"mix-blend":[{"mix-blend":[...k(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":k()}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ie,oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ie,oe]}],filter:[{filter:["","none",ie,oe]}],blur:[{blur:X()}],brightness:[{brightness:[Pe,ie,oe]}],contrast:[{contrast:[Pe,ie,oe]}],"drop-shadow":[{"drop-shadow":["","none",l,Dn,Mn]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",Pe,ie,oe]}],"hue-rotate":[{"hue-rotate":[Pe,ie,oe]}],invert:[{invert:["",Pe,ie,oe]}],saturate:[{saturate:[Pe,ie,oe]}],sepia:[{sepia:["",Pe,ie,oe]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,oe]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,ie,oe]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,ie,oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,ie,oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,ie,oe]}],"backdrop-invert":[{"backdrop-invert":["",Pe,ie,oe]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,ie,oe]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,ie,oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,ie,oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",ie,oe]}],ease:[{ease:["linear","initial",y,ie,oe]}],delay:[{delay:[Pe,ie,oe]}],animate:[{animate:["none",_,ie,oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,ie,oe]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[ie,oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",ie,oe]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",ie,oe]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[Pe,nn,Sr,Ga]}],stroke:[{stroke:["none",...F()]}],"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"]}},Mm=pm(km);function Ve(...t){return Mm(gu(t))}function Qt({className:t,...e}){return d.jsx("div",{"data-slot":"card",className:Ve("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...e})}function Jt({className:t,...e}){return d.jsx("div",{"data-slot":"card-header",className:Ve("@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",t),...e})}function Xt({className:t,...e}){return d.jsx("div",{"data-slot":"card-title",className:Ve("leading-none font-semibold",t),...e})}function Ar({className:t,...e}){return d.jsx("div",{"data-slot":"card-description",className:Ve("text-muted-foreground text-sm",t),...e})}function Yt({className:t,...e}){return d.jsx("div",{"data-slot":"card-content",className:Ve("px-6",t),...e})}function nl(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ga(...t){return e=>{let n=!1;const a=t.map(r=>{const s=nl(r,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<a.length;r++){const s=a[r];typeof s=="function"?s():nl(t[r],null)}}}}function lt(...t){return S.useCallback(ga(...t),t)}function Nr(t,e=[]){let n=[];function a(s,i){const o=S.createContext(i),c=n.length;n=[...n,i];const u=m=>{var y;const{scope:f,children:l,...p}=m,g=((y=f==null?void 0:f[t])==null?void 0:y[c])||o,v=S.useMemo(()=>p,Object.values(p));return d.jsx(g.Provider,{value:v,children:l})};u.displayName=s+"Provider";function h(m,f){var g;const l=((g=f==null?void 0:f[t])==null?void 0:g[c])||o,p=S.useContext(l);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[u,h]}const r=()=>{const s=n.map(i=>S.createContext(i));return function(o){const c=(o==null?void 0:o[t])||s;return S.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return r.scopeName=t,[a,Dm(r,...e)]}function Dm(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const a=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=a.reduce((o,{useScope:c,scopeName:u})=>{const m=c(s)[`__scope${u}`];return{...o,...m}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}function Ie(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t==null||t(r),n===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}var hr=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},Fm=ou[" useInsertionEffect ".trim().toString()]||hr;function va({prop:t,defaultProp:e,onChange:n=()=>{},caller:a}){const[r,s,i]=$m({defaultProp:e,onChange:n}),o=t!==void 0,c=o?t:r;{const h=S.useRef(t!==void 0);S.useEffect(()=>{const m=h.current;m!==o&&console.warn(`${a} is changing from ${m?"controlled":"uncontrolled"} to ${o?"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.`),h.current=o},[o,a])}const u=S.useCallback(h=>{var m;if(o){const f=Lm(h)?h(t):h;f!==t&&((m=i.current)==null||m.call(i,f))}else s(h)},[o,t,s,i]);return[c,u]}function $m({defaultProp:t,onChange:e}){const[n,a]=S.useState(t),r=S.useRef(n),s=S.useRef(e);return Fm(()=>{s.current=e},[e]),S.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,a,s]}function Lm(t){return typeof t=="function"}function Vm(t){const e=S.useRef({value:t,previous:t});return S.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function Pu(t){const[e,n]=S.useState(void 0);return hr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const a=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,o;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,o=u.blockSize}else i=t.offsetWidth,o=t.offsetHeight;n({width:i,height:o})});return a.observe(t,{box:"border-box"}),()=>a.unobserve(t)}else n(void 0)},[t]),e}function zm(t,e){return S.useReducer((n,a)=>e[n][a]??n,t)}var jr=t=>{const{present:e,children:n}=t,a=qm(e),r=typeof n=="function"?n({present:a.isPresent}):S.Children.only(n),s=lt(a.ref,Um(r));return typeof n=="function"||a.isPresent?S.cloneElement(r,{ref:s}):null};jr.displayName="Presence";function qm(t){const[e,n]=S.useState(),a=S.useRef(null),r=S.useRef(t),s=S.useRef("none"),i=t?"mounted":"unmounted",[o,c]=zm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=Fn(a.current);s.current=o==="mounted"?u:"none"},[o]),hr(()=>{const u=a.current,h=r.current;if(h!==t){const f=s.current,l=Fn(u);t?c("MOUNT"):l==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==l?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,c]),hr(()=>{if(e){let u;const h=e.ownerDocument.defaultView??window,m=l=>{const g=Fn(a.current).includes(CSS.escape(l.animationName));if(l.target===e&&g&&(c("ANIMATION_END"),!r.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},f=l=>{l.target===e&&(s.current=Fn(a.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:S.useCallback(u=>{a.current=u?getComputedStyle(u):null,n(u)},[])}}function Fn(t){return(t==null?void 0:t.animationName)||"none"}function Um(t){var a,r;let e=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Wo=bh();const Hm=Sh(Wo);function hn(t){const e=Gm(t),n=S.forwardRef((a,r)=>{const{children:s,...i}=a,o=S.Children.toArray(s),c=o.find(Km);if(c){const u=c.props.children,h=o.map(m=>m===c?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:m);return d.jsx(e,{...i,ref:r,children:S.isValidElement(u)?S.cloneElement(u,void 0,h):null})}return d.jsx(e,{...i,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}var Iu=hn("Slot");function Gm(t){const e=S.forwardRef((n,a)=>{const{children:r,...s}=n;if(S.isValidElement(r)){const i=Zm(r),o=Wm(s,r.props);return r.type!==S.Fragment&&(o.ref=a?ga(a,i):i),S.cloneElement(r,o)}return S.Children.count(r)>1?S.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Bm=Symbol("radix.slottable");function Km(t){return S.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Bm}function Wm(t,e){const n={...e};for(const a in e){const r=t[a],s=e[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...o)=>{const c=s(...o);return r(...o),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Zm(t){var a,r;let e=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Qm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=Qm.reduce((t,e)=>{const n=hn(`Primitive.${e}`),a=S.forwardRef((r,s)=>{const{asChild:i,...o}=r,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...o,ref:s})});return a.displayName=`Primitive.${e}`,{...t,[e]:a}},{});function Au(t,e){t&&Wo.flushSync(()=>t.dispatchEvent(e))}var ya="Checkbox",[Jm]=Nr(ya),[Xm,Zo]=Jm(ya);function Ym(t){const{__scopeCheckbox:e,checked:n,children:a,defaultChecked:r,disabled:s,form:i,name:o,onCheckedChange:c,required:u,value:h="on",internal_do_not_use_render:m}=t,[f,l]=va({prop:n,defaultProp:r??!1,onChange:c,caller:ya}),[p,g]=S.useState(null),[v,y]=S.useState(null),_=S.useRef(!1),x=p?!!i||!!p.closest("form"):!0,w={checked:f,disabled:s,setChecked:l,control:p,setControl:g,name:o,form:i,value:h,hasConsumerStoppedPropagationRef:_,required:u,defaultChecked:ur(r)?!1:r,isFormControl:x,bubbleInput:v,setBubbleInput:y};return d.jsx(Xm,{scope:e,...w,children:ep(m)?m(w):a})}var Nu="CheckboxTrigger",ju=S.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...a},r)=>{const{control:s,value:i,disabled:o,checked:c,required:u,setControl:h,setChecked:m,hasConsumerStoppedPropagationRef:f,isFormControl:l,bubbleInput:p}=Zo(Nu,t),g=lt(r,h),v=S.useRef(c);return S.useEffect(()=>{const y=s==null?void 0:s.form;if(y){const _=()=>m(v.current);return y.addEventListener("reset",_),()=>y.removeEventListener("reset",_)}},[s,m]),d.jsx(We.button,{type:"button",role:"checkbox","aria-checked":ur(c)?"mixed":c,"aria-required":u,"data-state":Fu(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:g,onKeyDown:Ie(e,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:Ie(n,y=>{m(_=>ur(_)?!0:!_),p&&l&&(f.current=y.isPropagationStopped(),f.current||y.stopPropagation())})})});ju.displayName=Nu;var Tu=S.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:a,checked:r,defaultChecked:s,required:i,disabled:o,value:c,onCheckedChange:u,form:h,...m}=t;return d.jsx(Ym,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:o,required:i,onCheckedChange:u,name:a,form:h,value:c,internal_do_not_use_render:({isFormControl:f})=>d.jsxs(d.Fragment,{children:[d.jsx(ju,{...m,ref:e,__scopeCheckbox:n}),f&&d.jsx(Du,{__scopeCheckbox:n})]})})});Tu.displayName=ya;var Ou="CheckboxIndicator",ku=S.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:a,...r}=t,s=Zo(Ou,n);return d.jsx(jr,{present:a||ur(s.checked)||s.checked===!0,children:d.jsx(We.span,{"data-state":Fu(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e,style:{pointerEvents:"none",...t.style}})})});ku.displayName=Ou;var Mu="CheckboxBubbleInput",Du=S.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:a,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:i,required:o,disabled:c,name:u,value:h,form:m,bubbleInput:f,setBubbleInput:l}=Zo(Mu,t),p=lt(n,l),g=Vm(s),v=Pu(a);S.useEffect(()=>{const _=f;if(!_)return;const x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set,I=!r.current;if(g!==s&&b){const E=new Event("click",{bubbles:I});_.indeterminate=ur(s),b.call(_,ur(s)?!1:s),_.dispatchEvent(E)}},[f,g,s,r]);const y=S.useRef(ur(s)?!1:s);return d.jsx(We.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??y.current,required:o,disabled:c,name:u,value:h,form:m,...e,tabIndex:-1,ref:p,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Du.displayName=Mu;function ep(t){return typeof t=="function"}function ur(t){return t==="indeterminate"}function Fu(t){return ur(t)?"indeterminate":t?"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 tp=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rp=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,a)=>a?a.toUpperCase():n.toLowerCase()),al=t=>{const e=rp(t);return e.charAt(0).toUpperCase()+e.slice(1)},$u=(...t)=>t.filter((e,n,a)=>!!e&&e.trim()!==""&&a.indexOf(e)===n).join(" ").trim(),np=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="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 ap={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 sp=S.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:s,iconNode:i,...o},c)=>S.createElement("svg",{ref:c,...ap,width:e,height:e,stroke:t,strokeWidth:a?Number(n)*24/Number(e):n,className:$u("lucide",r),...!s&&!np(o)&&{"aria-hidden":"true"},...o},[...i.map(([u,h])=>S.createElement(u,h)),...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 Et=(t,e)=>{const n=S.forwardRef(({className:a,...r},s)=>S.createElement(sp,{ref:s,iconNode:e,className:$u(`lucide-${tp(al(t))}`,`lucide-${t}`,a),...r}));return n.displayName=al(t),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 op=[["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"}]],Lu=Et("activity",op);/**
|
|
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 ip=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vu=Et("check",ip);/**
|
|
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 lp=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zu=Et("chevron-down",lp);/**
|
|
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 cp=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],up=Et("chevron-up",cp);/**
|
|
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 dp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],qu=Et("clock",dp);/**
|
|
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 fp=[["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"}]],hp=Et("copy",fp);/**
|
|
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 mp=[["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"}]],pp=Et("globe",mp);/**
|
|
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 gp=[["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"}]],vp=Et("settings",gp);/**
|
|
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 yp=[["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"}]],Uu=Et("triangle-alert",yp);/**
|
|
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 xp=[["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"}]],Hu=Et("wifi-off",xp);/**
|
|
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 wp=[["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"}]],Gu=Et("wifi",wp);function Qo({className:t,...e}){return d.jsx(Tu,{"data-slot":"checkbox",className:Ve("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",t),...e,children:d.jsx(ku,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:d.jsx(Vu,{className:"size-3.5"})})})}function _p({id:t,label:e,description:n,isEnabled:a,onToggle:r}){return d.jsx("div",{children:d.jsxs("div",{className:"items-top flex space-x-2",children:[d.jsx(Qo,{id:t,checked:a,onCheckedChange:s=>r(s===!0)}),d.jsxs("div",{className:"grid gap-1.5 leading-none",children:[d.jsx("label",{htmlFor:t,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e}),d.jsx("p",{className:"text-sm text-muted-foreground",children:n})]})]})})}function sl({title:t,description:e,tools:n,onToolToggle:a}){return d.jsxs(Qt,{className:"w-full",children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:t}),d.jsx(Ar,{children:e})]}),d.jsx(Yt,{children:d.jsx("div",{className:"grid grid-cols-2 gap-6 mb-6",children:Object.entries(n).map(([r,s])=>d.jsx(_p,{id:s.id,label:s.label,description:s.description,isEnabled:s.settings.enabled,onToggle:i=>{a(s.id,i)}},r))})})]})}function po({className:t,type:e,...n}){return d.jsx("input",{type:e,"data-slot":"input",className:Ve("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",t),...n})}var Sp="Label",Bu=S.forwardRef((t,e)=>d.jsx(We.label,{...t,ref:e,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=t.onMouseDown)==null||r.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Bu.displayName=Sp;var bp=Bu;function Cp({className:t,...e}){return d.jsx(bp,{"data-slot":"label",className:Ve("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",t),...e})}function Rp({spaceNames:t,spaceSubdomains:e,enabledSpaces:n,onSpaceToolToggle:a,onSpaceToolNameChange:r,onSpaceToolSubdomainChange:s}){const i=[0,1,2];return d.jsxs(Qt,{className:"w-full",children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:"🚀 Gradio Spaces"}),d.jsxs(Ar,{children:["Configure up to 3 Gradio spaces for remote tool access. Edit the name and subdomain fields.",d.jsx("span",{className:"font-semibold",children:" Note: Changes may require reconnecting your MCP client."})]})]}),d.jsx(Yt,{children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center space-x-3 pb-2 border-b",children:[d.jsx("div",{className:"w-6"})," ",d.jsx("div",{className:"text-sm font-medium min-w-[80px]",children:"Space"}),d.jsx("div",{className:"flex-1 text-sm font-medium",children:"Name"}),d.jsx("div",{className:"flex-1 text-sm font-medium",children:"Subdomain"})]}),i.map(o=>d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx(Qo,{id:`space-tool-${o}`,checked:n[o]||!1,onCheckedChange:c=>a(o,c===!0)}),d.jsx(Cp,{htmlFor:`space-tool-${o}`,className:"text-sm font-medium min-w-[80px]",children:o+1}),d.jsx(po,{placeholder:"username/space-name",value:t[o]||"",onChange:c=>r(o,c.target.value),className:"flex-1 text-sm"}),d.jsx(po,{placeholder:"username-space-name",value:e[o]||"",onChange:c=>s(o,c.target.value),className:"flex-1 text-sm"})]},o))]})})]})}const ol=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,il=gu,Jo=(t,e)=>n=>{var a;if((e==null?void 0:e.variants)==null)return il(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=e,i=Object.keys(r).map(u=>{const h=n==null?void 0:n[u],m=s==null?void 0:s[u];if(h===null)return null;const f=ol(h)||ol(m);return r[u][f]}),o=n&&Object.entries(n).reduce((u,h)=>{let[m,f]=h;return f===void 0||(u[m]=f),u},{}),c=e==null||(a=e.compoundVariants)===null||a===void 0?void 0:a.reduce((u,h)=>{let{class:m,className:f,...l}=h;return Object.entries(l).every(p=>{let[g,v]=p;return Array.isArray(v)?v.includes({...s,...o}[g]):{...s,...o}[g]===v})?[...u,m,f]:u},[]);return il(t,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Ep=Jo("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 Pp({className:t,variant:e,...n}){return d.jsx("div",{"data-slot":"alert",role:"alert",className:Ve(Ep({variant:e}),t),...n})}function Ip({className:t,...e}){return d.jsx("div",{"data-slot":"alert-title",className:Ve("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function Ap({className:t,...e}){return d.jsx("div",{"data-slot":"alert-description",className:Ve("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}const Np=Jo("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 Kt({className:t,variant:e,asChild:n=!1,...a}){const r=n?Iu:"span";return d.jsx(r,{"data-slot":"badge",className:Ve(Np({variant:e}),t),...a})}var jp="Separator",ll="horizontal",Tp=["horizontal","vertical"],Ku=S.forwardRef((t,e)=>{const{decorative:n,orientation:a=ll,...r}=t,s=Op(a)?a:ll,o=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(We.div,{"data-orientation":s,...o,...r,ref:e})});Ku.displayName=jp;function Op(t){return Tp.includes(t)}var kp=Ku;function dr({className:t,orientation:e="horizontal",decorative:n=!0,...a}){return d.jsx(kp,{"data-slot":"separator",decorative:n,orientation:e,className:Ve("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}/**
|
|
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 cr(t,e){return typeof t=="function"?t(e):t}function vt(t,e){return n=>{e.setState(a=>({...a,[t]:cr(n,a[t])}))}}function xa(t){return t instanceof Function}function Mp(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Dp(t,e){const n=[],a=r=>{r.forEach(s=>{n.push(s);const i=e(s);i!=null&&i.length&&a(i)})};return a(t),n}function ge(t,e,n){let a=[],r;return s=>{let i;n.key&&n.debug&&(i=Date.now());const o=t(s);if(!(o.length!==a.length||o.some((h,m)=>a[m]!==h)))return r;a=o;let u;if(n.key&&n.debug&&(u=Date.now()),r=e(...o),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-i)*100)/100,m=Math.round((Date.now()-u)*100)/100,f=m/16,l=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${l(m,5)} /${l(h,5)} ms`,`
|
|
94
|
+
font-size: .6rem;
|
|
95
|
+
font-weight: bold;
|
|
96
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return r}}function ve(t,e,n,a){return{debug:()=>{var r;return(r=t==null?void 0:t.debugAll)!=null?r:t[e]},key:!1,onChange:a}}function Fp(t,e,n,a){const r=()=>{var i;return(i=s.getValue())!=null?i:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(a),renderValue:r,getContext:ge(()=>[t,n,e,s],(i,o,c,u)=>({table:i,column:o,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ve(t.options,"debugCells"))};return t._features.forEach(i=>{i.createCell==null||i.createCell(s,n,e,t)},{}),s}function $p(t,e,n,a){var r,s;const o={...t._getDefaultColumnDef(),...e},c=o.accessorKey;let u=(r=(s=o.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?r:typeof o.header=="string"?o.header:void 0,h;if(o.accessorFn?h=o.accessorFn:c&&(c.includes(".")?h=f=>{let l=f;for(const g of c.split(".")){var p;l=(p=l)==null?void 0:p[g]}return l}:h=f=>f[o.accessorKey]),!u)throw new Error;let m={id:`${String(u)}`,accessorFn:h,parent:a,depth:n,columnDef:o,columns:[],getFlatColumns:ge(()=>[!0],()=>{var f;return[m,...(f=m.columns)==null?void 0:f.flatMap(l=>l.getFlatColumns())]},ve(t.options,"debugColumns")),getLeafColumns:ge(()=>[t._getOrderColumnsFn()],f=>{var l;if((l=m.columns)!=null&&l.length){let p=m.columns.flatMap(g=>g.getLeafColumns());return f(p)}return[m]},ve(t.options,"debugColumns"))};for(const f of t._features)f.createColumn==null||f.createColumn(m,t);return m}const ot="debugHeaders";function cl(t,e,n){var a;let s={id:(a=n.id)!=null?a:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],o=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(o),i.push(c)};return o(s),i},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(i=>{i.createHeader==null||i.createHeader(s,t)}),s}const Lp={createTable:t=>{t.getHeaderGroups=ge(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,a,r)=>{var s,i;const o=(s=a==null?void 0:a.map(m=>n.find(f=>f.id===m)).filter(Boolean))!=null?s:[],c=(i=r==null?void 0:r.map(m=>n.find(f=>f.id===m)).filter(Boolean))!=null?i:[],u=n.filter(m=>!(a!=null&&a.includes(m.id))&&!(r!=null&&r.includes(m.id)));return $n(e,[...o,...u,...c],t)},ve(t.options,ot)),t.getCenterHeaderGroups=ge(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,a,r)=>(n=n.filter(s=>!(a!=null&&a.includes(s.id))&&!(r!=null&&r.includes(s.id))),$n(e,n,t,"center")),ve(t.options,ot)),t.getLeftHeaderGroups=ge(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,a)=>{var r;const s=(r=a==null?void 0:a.map(i=>n.find(o=>o.id===i)).filter(Boolean))!=null?r:[];return $n(e,s,t,"left")},ve(t.options,ot)),t.getRightHeaderGroups=ge(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,a)=>{var r;const s=(r=a==null?void 0:a.map(i=>n.find(o=>o.id===i)).filter(Boolean))!=null?r:[];return $n(e,s,t,"right")},ve(t.options,ot)),t.getFooterGroups=ge(()=>[t.getHeaderGroups()],e=>[...e].reverse(),ve(t.options,ot)),t.getLeftFooterGroups=ge(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),ve(t.options,ot)),t.getCenterFooterGroups=ge(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),ve(t.options,ot)),t.getRightFooterGroups=ge(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),ve(t.options,ot)),t.getFlatHeaders=ge(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),ve(t.options,ot)),t.getLeftFlatHeaders=ge(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),ve(t.options,ot)),t.getCenterFlatHeaders=ge(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),ve(t.options,ot)),t.getRightFlatHeaders=ge(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),ve(t.options,ot)),t.getCenterLeafHeaders=ge(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),ve(t.options,ot)),t.getLeftLeafHeaders=ge(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),ve(t.options,ot)),t.getRightLeafHeaders=ge(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),ve(t.options,ot)),t.getLeafHeaders=ge(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,a)=>{var r,s,i,o,c,u;return[...(r=(s=e[0])==null?void 0:s.headers)!=null?r:[],...(i=(o=n[0])==null?void 0:o.headers)!=null?i:[],...(c=(u=a[0])==null?void 0:u.headers)!=null?c:[]].map(h=>h.getLeafHeaders()).flat()},ve(t.options,ot))}};function $n(t,e,n,a){var r,s;let i=0;const o=function(f,l){l===void 0&&(l=1),i=Math.max(i,l),f.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&o(p.columns,l+1)},0)};o(t);let c=[];const u=(f,l)=>{const p={depth:l,id:[a,`${l}`].filter(Boolean).join("_"),headers:[]},g=[];f.forEach(v=>{const y=[...g].reverse()[0],_=v.column.depth===p.depth;let x,w=!1;if(_&&v.column.parent?x=v.column.parent:(x=v.column,w=!0),y&&(y==null?void 0:y.column)===x)y.subHeaders.push(v);else{const b=cl(n,x,{id:[a,l,x.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:w,placeholderId:w?`${g.filter(I=>I.column===x).length}`:void 0,depth:l,index:g.length});b.subHeaders.push(v),g.push(b)}p.headers.push(v),v.headerGroup=p}),c.push(p),l>0&&u(g,l-1)},h=e.map((f,l)=>cl(n,f,{depth:i,index:l}));u(h,i-1),c.reverse();const m=f=>f.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,v=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],m(p.subHeaders).forEach(x=>{let{colSpan:w,rowSpan:b}=x;g+=w,y.push(b)})):g=1;const _=Math.min(...y);return v=v+_,p.colSpan=g,p.rowSpan=v,{colSpan:g,rowSpan:v}});return m((r=(s=c[0])==null?void 0:s.headers)!=null?r:[]),c}const Xo=(t,e,n,a,r,s,i)=>{let o={id:e,index:a,original:n,depth:r,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(o._valuesCache.hasOwnProperty(c))return o._valuesCache[c];const u=t.getColumn(c);if(u!=null&&u.accessorFn)return o._valuesCache[c]=u.accessorFn(o.original,a),o._valuesCache[c]},getUniqueValues:c=>{if(o._uniqueValuesCache.hasOwnProperty(c))return o._uniqueValuesCache[c];const u=t.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(o._uniqueValuesCache[c]=u.columnDef.getUniqueValues(o.original,a),o._uniqueValuesCache[c]):(o._uniqueValuesCache[c]=[o.getValue(c)],o._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=o.getValue(c))!=null?u:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>Dp(o.subRows,c=>c.subRows),getParentRow:()=>o.parentId?t.getRow(o.parentId,!0):void 0,getParentRows:()=>{let c=[],u=o;for(;;){const h=u.getParentRow();if(!h)break;c.push(h),u=h}return c.reverse()},getAllCells:ge(()=>[t.getAllLeafColumns()],c=>c.map(u=>Fp(t,o,u,u.id)),ve(t.options,"debugRows")),_getAllCellsByColumnId:ge(()=>[o.getAllCells()],c=>c.reduce((u,h)=>(u[h.column.id]=h,u),{}),ve(t.options,"debugRows"))};for(let c=0;c<t._features.length;c++){const u=t._features[c];u==null||u.createRow==null||u.createRow(o,t)}return o},Vp={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},Wu=(t,e,n)=>{var a,r;const s=n==null||(a=n.toString())==null?void 0:a.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};Wu.autoRemove=t=>bt(t);const Zu=(t,e,n)=>{var a;return!!(!((a=t.getValue(e))==null||(a=a.toString())==null)&&a.includes(n))};Zu.autoRemove=t=>bt(t);const Qu=(t,e,n)=>{var a;return((a=t.getValue(e))==null||(a=a.toString())==null?void 0:a.toLowerCase())===(n==null?void 0:n.toLowerCase())};Qu.autoRemove=t=>bt(t);const Ju=(t,e,n)=>{var a;return(a=t.getValue(e))==null?void 0:a.includes(n)};Ju.autoRemove=t=>bt(t);const Xu=(t,e,n)=>!n.some(a=>{var r;return!((r=t.getValue(e))!=null&&r.includes(a))});Xu.autoRemove=t=>bt(t)||!(t!=null&&t.length);const Yu=(t,e,n)=>n.some(a=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(a)});Yu.autoRemove=t=>bt(t)||!(t!=null&&t.length);const ed=(t,e,n)=>t.getValue(e)===n;ed.autoRemove=t=>bt(t);const td=(t,e,n)=>t.getValue(e)==n;td.autoRemove=t=>bt(t);const Yo=(t,e,n)=>{let[a,r]=n;const s=t.getValue(e);return s>=a&&s<=r};Yo.resolveFilterValue=t=>{let[e,n]=t,a=typeof e!="number"?parseFloat(e):e,r=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(a)?-1/0:a,i=n===null||Number.isNaN(r)?1/0:r;if(s>i){const o=s;s=i,i=o}return[s,i]};Yo.autoRemove=t=>bt(t)||bt(t[0])&&bt(t[1]);const Gt={includesString:Wu,includesStringSensitive:Zu,equalsString:Qu,arrIncludes:Ju,arrIncludesAll:Xu,arrIncludesSome:Yu,equals:ed,weakEquals:td,inNumberRange:Yo};function bt(t){return t==null||t===""}const zp={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:vt("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],a=n==null?void 0:n.getValue(t.id);return typeof a=="string"?Gt.includesString:typeof a=="number"?Gt.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?Gt.equals:Array.isArray(a)?Gt.arrIncludes:Gt.weakEquals},t.getFilterFn=()=>{var n,a;return xa(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(a=e.options.filterFns)==null?void 0:a[t.columnDef.filterFn])!=null?n:Gt[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,a,r;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((a=e.options.enableColumnFilters)!=null?a:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(a=>a.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,a;return(n=(a=e.getState().columnFilters)==null?void 0:a.findIndex(r=>r.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(a=>{const r=t.getFilterFn(),s=a==null?void 0:a.find(h=>h.id===t.id),i=cr(n,s?s.value:void 0);if(ul(r,i,t)){var o;return(o=a==null?void 0:a.filter(h=>h.id!==t.id))!=null?o:[]}const c={id:t.id,value:i};if(s){var u;return(u=a==null?void 0:a.map(h=>h.id===t.id?c:h))!=null?u:[]}return a!=null&&a.length?[...a,c]:[c]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),a=r=>{var s;return(s=cr(e,r))==null?void 0:s.filter(i=>{const o=n.find(c=>c.id===i.id);if(o){const c=o.getFilterFn();if(ul(c,i.value,o))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(a)},t.resetColumnFilters=e=>{var n,a;t.setColumnFilters(e?[]:(n=(a=t.initialState)==null?void 0:a.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function ul(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const qp=(t,e,n)=>n.reduce((a,r)=>{const s=r.getValue(t);return a+(typeof s=="number"?s:0)},0),Up=(t,e,n)=>{let a;return n.forEach(r=>{const s=r.getValue(t);s!=null&&(a>s||a===void 0&&s>=s)&&(a=s)}),a},Hp=(t,e,n)=>{let a;return n.forEach(r=>{const s=r.getValue(t);s!=null&&(a<s||a===void 0&&s>=s)&&(a=s)}),a},Gp=(t,e,n)=>{let a,r;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(a===void 0?i>=i&&(a=r=i):(a>i&&(a=i),r<i&&(r=i)))}),[a,r]},Bp=(t,e)=>{let n=0,a=0;if(e.forEach(r=>{let s=r.getValue(t);s!=null&&(s=+s)>=s&&(++n,a+=s)}),n)return a/n},Kp=(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!Mp(n))return;if(n.length===1)return n[0];const a=Math.floor(n.length/2),r=n.sort((s,i)=>s-i);return n.length%2!==0?r[a]:(r[a-1]+r[a])/2},Wp=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Zp=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,Qp=(t,e)=>e.length,Ba={sum:qp,min:Up,max:Hp,extent:Gp,mean:Bp,median:Kp,unique:Wp,uniqueCount:Zp,count:Qp},Jp={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:vt("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(a=>a!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,a;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((a=e.options.enableGrouping)!=null?a:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],a=n==null?void 0:n.getValue(t.id);if(typeof a=="number")return Ba.sum;if(Object.prototype.toString.call(a)==="[object Date]")return Ba.extent},t.getAggregationFn=()=>{var n,a;if(!t)throw new Error;return xa(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(a=e.options.aggregationFns)==null?void 0:a[t.columnDef.aggregationFn])!=null?n:Ba[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,a;t.setGrouping(e?[]:(n=(a=t.initialState)==null?void 0:a.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const a=e.getColumn(n);return a!=null&&a.columnDef.getGroupingValue?(t._groupingValuesCache[n]=a.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,a)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var r;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function Xp(t,e,n){if(!(e!=null&&e.length)||!n)return t;const a=t.filter(s=>!e.includes(s.id));return n==="remove"?a:[...e.map(s=>t.find(i=>i.id===s)).filter(Boolean),...a]}const Yp={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:vt("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=ge(n=>[un(e,n)],n=>n.findIndex(a=>a.id===t.id),ve(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var a;return((a=un(e,n)[0])==null?void 0:a.id)===t.id},t.getIsLastColumn=n=>{var a;const r=un(e,n);return((a=r[r.length-1])==null?void 0:a.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=ge(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,a)=>r=>{let s=[];if(!(e!=null&&e.length))s=r;else{const i=[...e],o=[...r];for(;o.length&&i.length;){const c=i.shift(),u=o.findIndex(h=>h.id===c);u>-1&&s.push(o.splice(u,1)[0])}s=[...s,...o]}return Xp(s,n,a)},ve(t.options,"debugTable"))}},Ka=()=>({left:[],right:[]}),eg={getInitialState:t=>({columnPinning:Ka(),...t}),getDefaultOptions:t=>({onColumnPinningChange:vt("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const a=t.getLeafColumns().map(r=>r.id).filter(Boolean);e.setColumnPinning(r=>{var s,i;if(n==="right"){var o,c;return{left:((o=r==null?void 0:r.left)!=null?o:[]).filter(m=>!(a!=null&&a.includes(m))),right:[...((c=r==null?void 0:r.right)!=null?c:[]).filter(m=>!(a!=null&&a.includes(m))),...a]}}if(n==="left"){var u,h;return{left:[...((u=r==null?void 0:r.left)!=null?u:[]).filter(m=>!(a!=null&&a.includes(m))),...a],right:((h=r==null?void 0:r.right)!=null?h:[]).filter(m=>!(a!=null&&a.includes(m)))}}return{left:((s=r==null?void 0:r.left)!=null?s:[]).filter(m=>!(a!=null&&a.includes(m))),right:((i=r==null?void 0:r.right)!=null?i:[]).filter(m=>!(a!=null&&a.includes(m)))}})},t.getCanPin=()=>t.getLeafColumns().some(a=>{var r,s,i;return((r=a.columnDef.enablePinning)!=null?r:!0)&&((s=(i=e.options.enableColumnPinning)!=null?i:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(o=>o.id),{left:a,right:r}=e.getState().columnPinning,s=n.some(o=>a==null?void 0:a.includes(o)),i=n.some(o=>r==null?void 0:r.includes(o));return s?"left":i?"right":!1},t.getPinnedIndex=()=>{var n,a;const r=t.getIsPinned();return r?(n=(a=e.getState().columnPinning)==null||(a=a[r])==null?void 0:a.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=ge(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,a,r)=>{const s=[...a??[],...r??[]];return n.filter(i=>!s.includes(i.column.id))},ve(e.options,"debugRows")),t.getLeftVisibleCells=ge(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,a)=>(a??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),ve(e.options,"debugRows")),t.getRightVisibleCells=ge(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,a)=>(a??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),ve(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,a;return t.setColumnPinning(e?Ka():(n=(a=t.initialState)==null?void 0:a.columnPinning)!=null?n:Ka())},t.getIsSomeColumnsPinned=e=>{var n;const a=t.getState().columnPinning;if(!e){var r,s;return!!((r=a.left)!=null&&r.length||(s=a.right)!=null&&s.length)}return!!((n=a[e])!=null&&n.length)},t.getLeftLeafColumns=ge(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(a=>e.find(r=>r.id===a)).filter(Boolean),ve(t.options,"debugColumns")),t.getRightLeafColumns=ge(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(a=>e.find(r=>r.id===a)).filter(Boolean),ve(t.options,"debugColumns")),t.getCenterLeafColumns=ge(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,a)=>{const r=[...n??[],...a??[]];return e.filter(s=>!r.includes(s.id))},ve(t.options,"debugColumns"))}};function tg(t){return t||(typeof document<"u"?document:null)}const Ln={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Wa=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),rg={getDefaultColumnDef:()=>Ln,getInitialState:t=>({columnSizing:{},columnSizingInfo:Wa(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:vt("columnSizing",t),onColumnSizingInfoChange:vt("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,a,r;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Ln.minSize,(a=s??t.columnDef.size)!=null?a:Ln.size),(r=t.columnDef.maxSize)!=null?r:Ln.maxSize)},t.getStart=ge(n=>[n,un(e,n),e.getState().columnSizing],(n,a)=>a.slice(0,t.getIndex(n)).reduce((r,s)=>r+s.getSize(),0),ve(e.options,"debugColumns")),t.getAfter=ge(n=>[n,un(e,n),e.getState().columnSizing],(n,a)=>a.slice(t.getIndex(n)+1).reduce((r,s)=>r+s.getSize(),0),ve(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:a,...r}=n;return r})},t.getCanResize=()=>{var n,a;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((a=e.options.enableColumnResizing)!=null?a:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const a=r=>{if(r.subHeaders.length)r.subHeaders.forEach(a);else{var s;n+=(s=r.column.getSize())!=null?s:0}};return a(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const a=e.getColumn(t.column.id),r=a==null?void 0:a.getCanResize();return s=>{if(!a||!r||(s.persist==null||s.persist(),Za(s)&&s.touches&&s.touches.length>1))return;const i=t.getSize(),o=t?t.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[a.id,a.getSize()]],c=Za(s)?Math.round(s.touches[0].clientX):s.clientX,u={},h=(y,_)=>{typeof _=="number"&&(e.setColumnSizingInfo(x=>{var w,b;const I=e.options.columnResizeDirection==="rtl"?-1:1,E=(_-((w=x==null?void 0:x.startOffset)!=null?w:0))*I,R=Math.max(E/((b=x==null?void 0:x.startSize)!=null?b:0),-.999999);return x.columnSizingStart.forEach(T=>{let[P,O]=T;u[P]=Math.round(Math.max(O+O*R,0)*100)/100}),{...x,deltaOffset:E,deltaPercentage:R}}),(e.options.columnResizeMode==="onChange"||y==="end")&&e.setColumnSizing(x=>({...x,...u})))},m=y=>h("move",y),f=y=>{h("end",y),e.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},l=tg(n),p={moveHandler:y=>m(y.clientX),upHandler:y=>{l==null||l.removeEventListener("mousemove",p.moveHandler),l==null||l.removeEventListener("mouseup",p.upHandler),f(y.clientX)}},g={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),m(y.touches[0].clientX),!1),upHandler:y=>{var _;l==null||l.removeEventListener("touchmove",g.moveHandler),l==null||l.removeEventListener("touchend",g.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((_=y.touches[0])==null?void 0:_.clientX)}},v=ng()?{passive:!1}:!1;Za(s)?(l==null||l.addEventListener("touchmove",g.moveHandler,v),l==null||l.addEventListener("touchend",g.upHandler,v)):(l==null||l.addEventListener("mousemove",p.moveHandler,v),l==null||l.addEventListener("mouseup",p.upHandler,v)),e.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:o,isResizingColumn:a.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Wa():(n=t.initialState.columnSizingInfo)!=null?n:Wa())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((a,r)=>a+r.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((a,r)=>a+r.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((a,r)=>a+r.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((a,r)=>a+r.getSize(),0))!=null?e:0}}};let Vn=null;function ng(){if(typeof Vn=="boolean")return Vn;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Vn=t,Vn}function Za(t){return t.type==="touchstart"}const ag={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:vt("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(a=>({...a,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,a;const r=t.columns;return(n=r.length?r.some(s=>s.getIsVisible()):(a=e.getState().columnVisibility)==null?void 0:a[t.id])!=null?n:!0},t.getCanHide=()=>{var n,a;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((a=e.options.enableHiding)!=null?a:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=ge(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(a=>a.column.getIsVisible()),ve(e.options,"debugRows")),t.getVisibleCells=ge(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,a,r)=>[...n,...a,...r],ve(e.options,"debugRows"))},createTable:t=>{const e=(n,a)=>ge(()=>[a(),a().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),ve(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var a;t.setColumnVisibility(n?{}:(a=t.initialState.columnVisibility)!=null?a:{})},t.toggleAllColumnsVisible=n=>{var a;n=(a=n)!=null?a:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((r,s)=>({...r,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var a;t.toggleAllColumnsVisible((a=n.target)==null?void 0:a.checked)}}};function un(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const sg={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},og={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:vt("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const a=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,a,r,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((a=e.options.enableGlobalFilter)!=null?a:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Gt.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:a}=t.options;return xa(a)?a:a==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[a])!=null?e:Gt[a]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},ig={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:vt("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var a,r;if(!e){t._queue(()=>{e=!0});return}if((a=(r=t.options.autoResetAll)!=null?r:t.options.autoResetExpanded)!=null?a:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=a=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(a),t.toggleAllRowsExpanded=a=>{a??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=a=>{var r,s;t.setExpanded(a?{}:(r=(s=t.initialState)==null?void 0:s.expanded)!=null?r:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const a=t.getState().expanded;return a===!0||Object.values(a).some(Boolean)},t.getIsAllRowsExpanded=()=>{const a=t.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||t.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},t.getExpandedDepth=()=>{let a=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const i=s.split(".");a=Math.max(a,i.length)}),a},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(a=>{var r;const s=a===!0?!0:!!(a!=null&&a[t.id]);let i={};if(a===!0?Object.keys(e.getRowModel().rowsById).forEach(o=>{i[o]=!0}):i=a,n=(r=n)!=null?r:!s,!s&&n)return{...i,[t.id]:!0};if(s&&!n){const{[t.id]:o,...c}=i;return c}return a})},t.getIsExpanded=()=>{var n;const a=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:a===!0||a!=null&&a[t.id])},t.getCanExpand=()=>{var n,a,r;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((a=e.options.enableExpanding)!=null?a:!0)&&!!((r=t.subRows)!=null&&r.length)},t.getIsAllParentsExpanded=()=>{let n=!0,a=t;for(;n&&a.parentId;)a=e.getRow(a.parentId,!0),n=a.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},go=0,vo=10,Qa=()=>({pageIndex:go,pageSize:vo}),lg={getInitialState:t=>({...t,pagination:{...Qa(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:vt("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var a,r;if(!e){t._queue(()=>{e=!0});return}if((a=(r=t.options.autoResetAll)!=null?r:t.options.autoResetPageIndex)!=null?a:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=a=>{const r=s=>cr(a,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(r)},t.resetPagination=a=>{var r;t.setPagination(a?Qa():(r=t.initialState.pagination)!=null?r:Qa())},t.setPageIndex=a=>{t.setPagination(r=>{let s=cr(a,r.pageIndex);const i=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...r,pageIndex:s}})},t.resetPageIndex=a=>{var r,s;t.setPageIndex(a?go:(r=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?r:go)},t.resetPageSize=a=>{var r,s;t.setPageSize(a?vo:(r=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?r:vo)},t.setPageSize=a=>{t.setPagination(r=>{const s=Math.max(1,cr(a,r.pageSize)),i=r.pageSize*r.pageIndex,o=Math.floor(i/s);return{...r,pageIndex:o,pageSize:s}})},t.setPageCount=a=>t.setPagination(r=>{var s;let i=cr(a,(s=t.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),t.getPageOptions=ge(()=>[t.getPageCount()],a=>{let r=[];return a&&a>0&&(r=[...new Array(a)].fill(null).map((s,i)=>i)),r},ve(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:a}=t.getState().pagination,r=t.getPageCount();return r===-1?!0:r===0?!1:a<r-1},t.previousPage=()=>t.setPageIndex(a=>a-1),t.nextPage=()=>t.setPageIndex(a=>a+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var a;return(a=t.options.pageCount)!=null?a:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var a;return(a=t.options.rowCount)!=null?a:t.getPrePaginationRowModel().rows.length}}},Ja=()=>({top:[],bottom:[]}),cg={getInitialState:t=>({rowPinning:Ja(),...t}),getDefaultOptions:t=>({onRowPinningChange:vt("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,a,r)=>{const s=a?t.getLeafRows().map(c=>{let{id:u}=c;return u}):[],i=r?t.getParentRows().map(c=>{let{id:u}=c;return u}):[],o=new Set([...i,t.id,...s]);e.setRowPinning(c=>{var u,h;if(n==="bottom"){var m,f;return{top:((m=c==null?void 0:c.top)!=null?m:[]).filter(g=>!(o!=null&&o.has(g))),bottom:[...((f=c==null?void 0:c.bottom)!=null?f:[]).filter(g=>!(o!=null&&o.has(g))),...Array.from(o)]}}if(n==="top"){var l,p;return{top:[...((l=c==null?void 0:c.top)!=null?l:[]).filter(g=>!(o!=null&&o.has(g))),...Array.from(o)],bottom:((p=c==null?void 0:c.bottom)!=null?p:[]).filter(g=>!(o!=null&&o.has(g)))}}return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(g=>!(o!=null&&o.has(g))),bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(g=>!(o!=null&&o.has(g)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:a,enablePinning:r}=e.options;return typeof a=="function"?a(t):(n=a??r)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:a,bottom:r}=e.getState().rowPinning,s=n.some(o=>a==null?void 0:a.includes(o)),i=n.some(o=>r==null?void 0:r.includes(o));return s?"top":i?"bottom":!1},t.getPinnedIndex=()=>{var n,a;const r=t.getIsPinned();if(!r)return-1;const s=(n=r==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(i=>{let{id:o}=i;return o});return(a=s==null?void 0:s.indexOf(t.id))!=null?a:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,a;return t.setRowPinning(e?Ja():(n=(a=t.initialState)==null?void 0:a.rowPinning)!=null?n:Ja())},t.getIsSomeRowsPinned=e=>{var n;const a=t.getState().rowPinning;if(!e){var r,s;return!!((r=a.top)!=null&&r.length||(s=a.bottom)!=null&&s.length)}return!!((n=a[e])!=null&&n.length)},t._getPinnedRows=(e,n,a)=>{var r;return((r=t.options.keepPinnedRows)==null||r?(n??[]).map(i=>{const o=t.getRow(i,!0);return o.getIsAllParentsExpanded()?o:null}):(n??[]).map(i=>e.find(o=>o.id===i))).filter(Boolean).map(i=>({...i,position:a}))},t.getTopRows=ge(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),ve(t.options,"debugRows")),t.getBottomRows=ge(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),ve(t.options,"debugRows")),t.getCenterRows=ge(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,a)=>{const r=new Set([...n??[],...a??[]]);return e.filter(s=>!r.has(s.id))},ve(t.options,"debugRows"))}},ug={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:vt("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const a={...n},r=t.getPreGroupedRowModel().flatRows;return e?r.forEach(s=>{s.getCanSelect()&&(a[s.id]=!0)}):r.forEach(s=>{delete a[s.id]}),a})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const a=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),r={...n};return t.getRowModel().rows.forEach(s=>{yo(r,s.id,a,!0,t)}),r}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=ge(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Xa(t,n):{rows:[],flatRows:[],rowsById:{}},ve(t.options,"debugTable")),t.getFilteredSelectedRowModel=ge(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Xa(t,n):{rows:[],flatRows:[],rowsById:{}},ve(t.options,"debugTable")),t.getGroupedSelectedRowModel=ge(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Xa(t,n):{rows:[],flatRows:[],rowsById:{}},ve(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let a=!!(e.length&&Object.keys(n).length);return a&&e.some(r=>r.getCanSelect()&&!n[r.id])&&(a=!1),a},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=t.getState();let a=!!e.length;return a&&e.some(r=>!n[r.id])&&(a=!1),a},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,a)=>{const r=t.getIsSelected();e.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!r,t.getCanSelect()&&r===n)return s;const o={...s};return yo(o,t.id,n,(i=a==null?void 0:a.selectChildren)!=null?i:!0,e),o})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return ei(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return xo(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return xo(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return a=>{var r;n&&t.toggleSelected((r=a.target)==null?void 0:r.checked)}}}},yo=(t,e,n,a,r)=>{var s;const i=r.getRow(e,!0);n?(i.getCanMultiSelect()||Object.keys(t).forEach(o=>delete t[o]),i.getCanSelect()&&(t[e]=!0)):delete t[e],a&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(o=>yo(t,o.id,n,a,r))};function Xa(t,e){const n=t.getState().rowSelection,a=[],r={},s=function(i,o){return i.map(c=>{var u;const h=ei(c,n);if(h&&(a.push(c),r[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:s(c.subRows)}),h)return c}).filter(Boolean)};return{rows:s(e.rows),flatRows:a,rowsById:r}}function ei(t,e){var n;return(n=e[t.id])!=null?n:!1}function xo(t,e,n){var a;if(!((a=t.subRows)!=null&&a.length))return!1;let r=!0,s=!1;return t.subRows.forEach(i=>{if(!(s&&!r)&&(i.getCanSelect()&&(ei(i,e)?s=!0:r=!1),i.subRows&&i.subRows.length)){const o=xo(i,e);o==="all"?s=!0:(o==="some"&&(s=!0),r=!1)}}),r?"all":s?"some":!1}const wo=/([0-9]+)/gm,dg=(t,e,n)=>rd(mr(t.getValue(n)).toLowerCase(),mr(e.getValue(n)).toLowerCase()),fg=(t,e,n)=>rd(mr(t.getValue(n)),mr(e.getValue(n))),hg=(t,e,n)=>ti(mr(t.getValue(n)).toLowerCase(),mr(e.getValue(n)).toLowerCase()),mg=(t,e,n)=>ti(mr(t.getValue(n)),mr(e.getValue(n))),pg=(t,e,n)=>{const a=t.getValue(n),r=e.getValue(n);return a>r?1:a<r?-1:0},gg=(t,e,n)=>ti(t.getValue(n),e.getValue(n));function ti(t,e){return t===e?0:t>e?1:-1}function mr(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function rd(t,e){const n=t.split(wo).filter(Boolean),a=e.split(wo).filter(Boolean);for(;n.length&&a.length;){const r=n.shift(),s=a.shift(),i=parseInt(r,10),o=parseInt(s,10),c=[i,o].sort();if(isNaN(c[0])){if(r>s)return 1;if(s>r)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>o)return 1;if(o>i)return-1}return n.length-a.length}const an={alphanumeric:dg,alphanumericCaseSensitive:fg,text:hg,textCaseSensitive:mg,datetime:pg,basic:gg},vg={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:vt("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const r of n){const s=r==null?void 0:r.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return an.datetime;if(typeof s=="string"&&(a=!0,s.split(wo).length>1))return an.alphanumeric}return a?an.text:an.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,a;if(!t)throw new Error;return xa(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(a=e.options.sortingFns)==null?void 0:a[t.columnDef.sortingFn])!=null?n:an[t.columnDef.sortingFn]},t.toggleSorting=(n,a)=>{const r=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(i=>{const o=i==null?void 0:i.find(l=>l.id===t.id),c=i==null?void 0:i.findIndex(l=>l.id===t.id);let u=[],h,m=s?n:r==="desc";if(i!=null&&i.length&&t.getCanMultiSort()&&a?o?h="toggle":h="add":i!=null&&i.length&&c!==i.length-1?h="replace":o?h="toggle":h="replace",h==="toggle"&&(s||r||(h="remove")),h==="add"){var f;u=[...i,{id:t.id,desc:m}],u.splice(0,u.length-((f=e.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else h==="toggle"?u=i.map(l=>l.id===t.id?{...l,desc:m}:l):h==="remove"?u=i.filter(l=>l.id!==t.id):u=[{id:t.id,desc:m}];return u})},t.getFirstSortDir=()=>{var n,a;return((n=(a=t.columnDef.sortDescFirst)!=null?a:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var a,r;const s=t.getFirstSortDir(),i=t.getIsSorted();return i?i!==s&&((a=e.options.enableSortingRemoval)==null||a)&&(!(n&&(r=e.options.enableMultiRemove)!=null)||r)?!1:i==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,a;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((a=e.options.enableSorting)!=null?a:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,a;return(n=(a=t.columnDef.enableMultiSort)!=null?a:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const a=(n=e.getState().sorting)==null?void 0:n.find(r=>r.id===t.id);return a?a.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,a;return(n=(a=e.getState().sorting)==null?void 0:a.findIndex(r=>r.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(a=>a.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return a=>{n&&(a.persist==null||a.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(a):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,a;t.setSorting(e?[]:(n=(a=t.initialState)==null?void 0:a.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},yg=[Lp,ag,Yp,eg,Vp,zp,sg,og,vg,Jp,ig,lg,cg,ug,rg];function xg(t){var e,n;const a=[...yg,...(e=t._features)!=null?e:[]];let r={_features:a};const s=r._features.reduce((f,l)=>Object.assign(f,l.getDefaultOptions==null?void 0:l.getDefaultOptions(r)),{}),i=f=>r.options.mergeOptions?r.options.mergeOptions(s,f):{...s,...f};let c={...{},...(n=t.initialState)!=null?n:{}};r._features.forEach(f=>{var l;c=(l=f.getInitialState==null?void 0:f.getInitialState(c))!=null?l:c});const u=[];let h=!1;const m={_features:a,options:{...s,...t},initialState:c,_queue:f=>{u.push(f),h||(h=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();h=!1}).catch(l=>setTimeout(()=>{throw l})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const l=cr(f,r.options);r.options=i(l)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,l,p)=>{var g;return(g=r.options.getRowId==null?void 0:r.options.getRowId(f,l,p))!=null?g:`${p?[p.id,l].join("."):l}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(f,l)=>{let p=(l?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!p&&(p=r.getCoreRowModel().rowsById[f],!p))throw new Error;return p},_getDefaultColumnDef:ge(()=>[r.options.defaultColumn],f=>{var l;return f=(l=f)!=null?l:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,v;return(g=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?g:null},...r._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...f}},ve(t,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:ge(()=>[r._getColumnDefs()],f=>{const l=function(p,g,v){return v===void 0&&(v=0),p.map(y=>{const _=$p(r,y,v,g),x=y;return _.columns=x.columns?l(x.columns,_,v+1):[],_})};return l(f)},ve(t,"debugColumns")),getAllFlatColumns:ge(()=>[r.getAllColumns()],f=>f.flatMap(l=>l.getFlatColumns()),ve(t,"debugColumns")),_getAllFlatColumnsById:ge(()=>[r.getAllFlatColumns()],f=>f.reduce((l,p)=>(l[p.id]=p,l),{}),ve(t,"debugColumns")),getAllLeafColumns:ge(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,l)=>{let p=f.flatMap(g=>g.getLeafColumns());return l(p)},ve(t,"debugColumns")),getColumn:f=>r._getAllFlatColumnsById()[f]};Object.assign(r,m);for(let f=0;f<r._features.length;f++){const l=r._features[f];l==null||l.createTable==null||l.createTable(r)}return r}function wg(){return t=>ge(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},a=function(r,s,i){s===void 0&&(s=0);const o=[];for(let u=0;u<r.length;u++){const h=Xo(t,t._getRowId(r[u],u,i),r[u],u,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(h),n.rowsById[h.id]=h,o.push(h),t.options.getSubRows){var c;h.originalSubRows=t.options.getSubRows(r[u],u),(c=h.originalSubRows)!=null&&c.length&&(h.subRows=a(h.originalSubRows,s+1,h))}}return o};return n.rows=a(e),n},ve(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function _g(t){const e=[],n=a=>{var r;e.push(a),(r=a.subRows)!=null&&r.length&&a.getIsExpanded()&&a.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function Sg(t,e,n){return n.options.filterFromLeafRows?bg(t,e,n):Cg(t,e,n)}function bg(t,e,n){var a;const r=[],s={},i=(a=n.options.maxLeafRowFilterDepth)!=null?a:100,o=function(c,u){u===void 0&&(u=0);const h=[];for(let f=0;f<c.length;f++){var m;let l=c[f];const p=Xo(n,l.id,l.original,l.index,l.depth,void 0,l.parentId);if(p.columnFilters=l.columnFilters,(m=l.subRows)!=null&&m.length&&u<i){if(p.subRows=o(l.subRows,u+1),l=p,e(l)&&!p.subRows.length){h.push(l),s[l.id]=l,r.push(l);continue}if(e(l)||p.subRows.length){h.push(l),s[l.id]=l,r.push(l);continue}}else l=p,e(l)&&(h.push(l),s[l.id]=l,r.push(l))}return h};return{rows:o(t),flatRows:r,rowsById:s}}function Cg(t,e,n){var a;const r=[],s={},i=(a=n.options.maxLeafRowFilterDepth)!=null?a:100,o=function(c,u){u===void 0&&(u=0);const h=[];for(let f=0;f<c.length;f++){let l=c[f];if(e(l)){var m;if((m=l.subRows)!=null&&m.length&&u<i){const g=Xo(n,l.id,l.original,l.index,l.depth,void 0,l.parentId);g.subRows=o(l.subRows,u+1),l=g}h.push(l),r.push(l),s[l.id]=l}}return h};return{rows:o(t),flatRows:r,rowsById:s}}function Rg(){return t=>ge(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,a)=>{if(!e.rows.length||!(n!=null&&n.length)&&!a){for(let f=0;f<e.flatRows.length;f++)e.flatRows[f].columnFilters={},e.flatRows[f].columnFiltersMeta={};return e}const r=[],s=[];(n??[]).forEach(f=>{var l;const p=t.getColumn(f.id);if(!p)return;const g=p.getFilterFn();g&&r.push({id:f.id,filterFn:g,resolvedValue:(l=g.resolveFilterValue==null?void 0:g.resolveFilterValue(f.value))!=null?l:f.value})});const i=(n??[]).map(f=>f.id),o=t.getGlobalFilterFn(),c=t.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());a&&o&&c.length&&(i.push("__global__"),c.forEach(f=>{var l;s.push({id:f.id,filterFn:o,resolvedValue:(l=o.resolveFilterValue==null?void 0:o.resolveFilterValue(a))!=null?l:a})}));let u,h;for(let f=0;f<e.flatRows.length;f++){const l=e.flatRows[f];if(l.columnFilters={},r.length)for(let p=0;p<r.length;p++){u=r[p];const g=u.id;l.columnFilters[g]=u.filterFn(l,g,u.resolvedValue,v=>{l.columnFiltersMeta[g]=v})}if(s.length){for(let p=0;p<s.length;p++){h=s[p];const g=h.id;if(h.filterFn(l,g,h.resolvedValue,v=>{l.columnFiltersMeta[g]=v})){l.columnFilters.__global__=!0;break}}l.columnFilters.__global__!==!0&&(l.columnFilters.__global__=!1)}}const m=f=>{for(let l=0;l<i.length;l++)if(f.columnFilters[i[l]]===!1)return!1;return!0};return Sg(e.rows,m,t)},ve(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function Eg(t){return e=>ge(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,a)=>{if(!a.rows.length)return a;const{pageSize:r,pageIndex:s}=n;let{rows:i,flatRows:o,rowsById:c}=a;const u=r*s,h=u+r;i=i.slice(u,h);let m;e.options.paginateExpandedRows?m={rows:i,flatRows:o,rowsById:c}:m=_g({rows:i,flatRows:o,rowsById:c}),m.flatRows=[];const f=l=>{m.flatRows.push(l),l.subRows.length&&l.subRows.forEach(f)};return m.rows.forEach(f),m},ve(e.options,"debugTable"))}function Pg(){return t=>ge(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const a=t.getState().sorting,r=[],s=a.filter(c=>{var u;return(u=t.getColumn(c.id))==null?void 0:u.getCanSort()}),i={};s.forEach(c=>{const u=t.getColumn(c.id);u&&(i[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const o=c=>{const u=c.map(h=>({...h}));return u.sort((h,m)=>{for(let l=0;l<s.length;l+=1){var f;const p=s[l],g=i[p.id],v=g.sortUndefined,y=(f=p==null?void 0:p.desc)!=null?f:!1;let _=0;if(v){const x=h.getValue(p.id),w=m.getValue(p.id),b=x===void 0,I=w===void 0;if(b||I){if(v==="first")return b?-1:1;if(v==="last")return b?1:-1;_=b&&I?0:b?v:-v}}if(_===0&&(_=g.sortingFn(h,m,p.id)),_!==0)return y&&(_*=-1),g.invertSorting&&(_*=-1),_}return h.index-m.index}),u.forEach(h=>{var m;r.push(h),(m=h.subRows)!=null&&m.length&&(h.subRows=o(h.subRows))}),u};return{rows:o(n.rows),flatRows:r,rowsById:n.rowsById}},ve(t.options,"debugTable","getSortedRowModel",()=>t._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 dl(t,e){return t?Ig(t)?S.createElement(t,e):t:null}function Ig(t){return Ag(t)||typeof t=="function"||Ng(t)}function Ag(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function Ng(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function jg(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=S.useState(()=>({current:xg(e)})),[a,r]=S.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...t,state:{...a,...t.state},onStateChange:i=>{r(i),t.onStateChange==null||t.onStateChange(i)}})),n.current}const Tg=Jo("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"}}),br=S.forwardRef(({className:t,variant:e,size:n,asChild:a=!1,...r},s)=>{const i=a?Iu:"button";return d.jsx(i,{className:Ve(Tg({variant:e,size:n,className:t})),ref:s,...r})});br.displayName="Button";function nd(t){const e=t+"CollectionProvider",[n,a]=Nr(e),[r,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:y}=g,_=jt.useRef(null),x=jt.useRef(new Map).current;return d.jsx(r,{scope:v,itemMap:x,collectionRef:_,children:y})};i.displayName=e;const o=t+"CollectionSlot",c=hn(o),u=jt.forwardRef((g,v)=>{const{scope:y,children:_}=g,x=s(o,y),w=lt(v,x.collectionRef);return d.jsx(c,{ref:w,children:_})});u.displayName=o;const h=t+"CollectionItemSlot",m="data-radix-collection-item",f=hn(h),l=jt.forwardRef((g,v)=>{const{scope:y,children:_,...x}=g,w=jt.useRef(null),b=lt(v,w),I=s(h,y);return jt.useEffect(()=>(I.itemMap.set(w,{ref:w,...x}),()=>void I.itemMap.delete(w))),d.jsx(f,{[m]:"",ref:b,children:_})});l.displayName=h;function p(g){const v=s(t+"CollectionConsumer",g);return jt.useCallback(()=>{const _=v.collectionRef.current;if(!_)return[];const x=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(v.itemMap.values()).sort((I,E)=>x.indexOf(I.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:l},p,a]}var Og=S.createContext(void 0);function ri(t){const e=S.useContext(Og);return t||e||"ltr"}function er(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var a;return(a=e.current)==null?void 0:a.call(e,...n)},[])}function kg(t,e=globalThis==null?void 0:globalThis.document){const n=er(t);S.useEffect(()=>{const a=r=>{r.key==="Escape"&&n(r)};return e.addEventListener("keydown",a,{capture:!0}),()=>e.removeEventListener("keydown",a,{capture:!0})},[n,e])}var Mg="DismissableLayer",_o="dismissableLayer.update",Dg="dismissableLayer.pointerDownOutside",Fg="dismissableLayer.focusOutside",fl,ad=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sd=S.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:o,...c}=t,u=S.useContext(ad),[h,m]=S.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,l]=S.useState({}),p=lt(e,E=>m(E)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),_=h?g.indexOf(h):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,w=_>=y,b=Vg(E=>{const R=E.target,T=[...u.branches].some(P=>P.contains(R));!w||T||(r==null||r(E),i==null||i(E),E.defaultPrevented||o==null||o())},f),I=zg(E=>{const R=E.target;[...u.branches].some(P=>P.contains(R))||(s==null||s(E),i==null||i(E),E.defaultPrevented||o==null||o())},f);return kg(E=>{_===u.layers.size-1&&(a==null||a(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},f),S.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fl=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),hl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=fl)}},[h,f,n,u]),S.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),hl())},[h,u]),S.useEffect(()=>{const E=()=>l({});return document.addEventListener(_o,E),()=>document.removeEventListener(_o,E)},[]),d.jsx(We.div,{...c,ref:p,style:{pointerEvents:x?w?"auto":"none":void 0,...t.style},onFocusCapture:Ie(t.onFocusCapture,I.onFocusCapture),onBlurCapture:Ie(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Ie(t.onPointerDownCapture,b.onPointerDownCapture)})});sd.displayName=Mg;var $g="DismissableLayerBranch",Lg=S.forwardRef((t,e)=>{const n=S.useContext(ad),a=S.useRef(null),r=lt(e,a);return S.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),d.jsx(We.div,{...t,ref:r})});Lg.displayName=$g;function Vg(t,e=globalThis==null?void 0:globalThis.document){const n=er(t),a=S.useRef(!1),r=S.useRef(()=>{});return S.useEffect(()=>{const s=o=>{if(o.target&&!a.current){let c=function(){od(Dg,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",r.current),r.current=c,e.addEventListener("click",r.current,{once:!0})):c()}else e.removeEventListener("click",r.current);a.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",s),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>a.current=!0}}function zg(t,e=globalThis==null?void 0:globalThis.document){const n=er(t),a=S.useRef(!1);return S.useEffect(()=>{const r=s=>{s.target&&!a.current&&od(Fg,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function hl(){const t=new CustomEvent(_o);document.dispatchEvent(t)}function od(t,e,n,{discrete:a}){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),a?Au(r,s):r.dispatchEvent(s)}var Ya=0;function qg(){S.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??ml()),document.body.insertAdjacentElement("beforeend",t[1]??ml()),Ya++,()=>{Ya===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ya--}},[])}function ml(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var es="focusScope.autoFocusOnMount",ts="focusScope.autoFocusOnUnmount",pl={bubbles:!1,cancelable:!0},Ug="FocusScope",id=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=t,[o,c]=S.useState(null),u=er(r),h=er(s),m=S.useRef(null),f=lt(e,g=>c(g)),l=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(a){let g=function(x){if(l.paused||!o)return;const w=x.target;o.contains(w)?m.current=w:or(m.current,{select:!0})},v=function(x){if(l.paused||!o)return;const w=x.relatedTarget;w!==null&&(o.contains(w)||or(m.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const b of x)b.removedNodes.length>0&&or(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const _=new MutationObserver(y);return o&&_.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),_.disconnect()}}},[a,o,l.paused]),S.useEffect(()=>{if(o){vl.add(l);const g=document.activeElement;if(!o.contains(g)){const y=new CustomEvent(es,pl);o.addEventListener(es,u),o.dispatchEvent(y),y.defaultPrevented||(Hg(Zg(ld(o)),{select:!0}),document.activeElement===g&&or(o))}return()=>{o.removeEventListener(es,u),setTimeout(()=>{const y=new CustomEvent(ts,pl);o.addEventListener(ts,h),o.dispatchEvent(y),y.defaultPrevented||or(g??document.body,{select:!0}),o.removeEventListener(ts,h),vl.remove(l)},0)}}},[o,u,h,l]);const p=S.useCallback(g=>{if(!n&&!a||l.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(v&&y){const _=g.currentTarget,[x,w]=Gg(_);x&&w?!g.shiftKey&&y===w?(g.preventDefault(),n&&or(x,{select:!0})):g.shiftKey&&y===x&&(g.preventDefault(),n&&or(w,{select:!0})):y===_&&g.preventDefault()}},[n,a,l.paused]);return d.jsx(We.div,{tabIndex:-1,...i,ref:f,onKeyDown:p})});id.displayName=Ug;function Hg(t,{select:e=!1}={}){const n=document.activeElement;for(const a of t)if(or(a,{select:e}),document.activeElement!==n)return}function Gg(t){const e=ld(t),n=gl(e,t),a=gl(e.reverse(),t);return[n,a]}function ld(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function gl(t,e){for(const n of t)if(!Bg(n,{upTo:e}))return n}function Bg(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Kg(t){return t instanceof HTMLInputElement&&"select"in t}function or(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Kg(t)&&e&&t.select()}}var vl=Wg();function Wg(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=yl(t,e),t.unshift(e)},remove(e){var n;t=yl(t,e),(n=t[0])==null||n.resume()}}}function yl(t,e){const n=[...t],a=n.indexOf(e);return a!==-1&&n.splice(a,1),n}function Zg(t){return t.filter(e=>e.tagName!=="A")}var Qg=ou[" useId ".trim().toString()]||(()=>{}),Jg=0;function Yn(t){const[e,n]=S.useState(Qg());return hr(()=>{n(a=>a??String(Jg++))},[t]),t||(e?`radix-${e}`:"")}const Xg=["top","right","bottom","left"],pr=Math.min,pt=Math.max,ea=Math.round,zn=Math.floor,Mt=t=>({x:t,y:t}),Yg={left:"right",right:"left",bottom:"top",top:"bottom"},ev={start:"end",end:"start"};function So(t,e,n){return pt(t,pr(e,n))}function tr(t,e){return typeof t=="function"?t(e):t}function rr(t){return t.split("-")[0]}function Qr(t){return t.split("-")[1]}function ni(t){return t==="x"?"y":"x"}function ai(t){return t==="y"?"height":"width"}const tv=new Set(["top","bottom"]);function kt(t){return tv.has(rr(t))?"y":"x"}function si(t){return ni(kt(t))}function rv(t,e,n){n===void 0&&(n=!1);const a=Qr(t),r=si(t),s=ai(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ta(i)),[i,ta(i)]}function nv(t){const e=ta(t);return[bo(t),e,bo(e)]}function bo(t){return t.replace(/start|end/g,e=>ev[e])}const xl=["left","right"],wl=["right","left"],av=["top","bottom"],sv=["bottom","top"];function ov(t,e,n){switch(t){case"top":case"bottom":return n?e?wl:xl:e?xl:wl;case"left":case"right":return e?av:sv;default:return[]}}function iv(t,e,n,a){const r=Qr(t);let s=ov(rr(t),n==="start",a);return r&&(s=s.map(i=>i+"-"+r),e&&(s=s.concat(s.map(bo)))),s}function ta(t){return t.replace(/left|right|bottom|top/g,e=>Yg[e])}function lv(t){return{top:0,right:0,bottom:0,left:0,...t}}function cd(t){return typeof t!="number"?lv(t):{top:t,right:t,bottom:t,left:t}}function ra(t){const{x:e,y:n,width:a,height:r}=t;return{width:a,height:r,top:n,left:e,right:e+a,bottom:n+r,x:e,y:n}}function _l(t,e,n){let{reference:a,floating:r}=t;const s=kt(e),i=si(e),o=ai(i),c=rr(e),u=s==="y",h=a.x+a.width/2-r.width/2,m=a.y+a.height/2-r.height/2,f=a[o]/2-r[o]/2;let l;switch(c){case"top":l={x:h,y:a.y-r.height};break;case"bottom":l={x:h,y:a.y+a.height};break;case"right":l={x:a.x+a.width,y:m};break;case"left":l={x:a.x-r.width,y:m};break;default:l={x:a.x,y:a.y}}switch(Qr(e)){case"start":l[i]-=f*(n&&u?-1:1);break;case"end":l[i]+=f*(n&&u?-1:1);break}return l}const cv=async(t,e,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,o=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:m}=_l(u,a,c),f=a,l={},p=0;for(let g=0;g<o.length;g++){const{name:v,fn:y}=o[g],{x:_,y:x,data:w,reset:b}=await y({x:h,y:m,initialPlacement:a,placement:f,strategy:r,middlewareData:l,rects:u,platform:i,elements:{reference:t,floating:e}});h=_??h,m=x??m,l={...l,[v]:{...l[v],...w}},b&&p<=50&&(p++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(u=b.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:h,y:m}=_l(u,f,c)),g=-1)}return{x:h,y:m,placement:f,strategy:r,middlewareData:l}};async function mn(t,e){var n;e===void 0&&(e={});const{x:a,y:r,platform:s,rects:i,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:f=!1,padding:l=0}=tr(e,t),p=cd(l),v=o[f?m==="floating"?"reference":"floating":m],y=ra(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:h,strategy:c})),_=m==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),w=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},b=ra(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:x,strategy:c}):_);return{top:(y.top-b.top+p.top)/w.y,bottom:(b.bottom-y.bottom+p.bottom)/w.y,left:(y.left-b.left+p.left)/w.x,right:(b.right-y.right+p.right)/w.x}}const uv=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:a,placement:r,rects:s,platform:i,elements:o,middlewareData:c}=e,{element:u,padding:h=0}=tr(t,e)||{};if(u==null)return{};const m=cd(h),f={x:n,y:a},l=si(r),p=ai(l),g=await i.getDimensions(u),v=l==="y",y=v?"top":"left",_=v?"bottom":"right",x=v?"clientHeight":"clientWidth",w=s.reference[p]+s.reference[l]-f[l]-s.floating[p],b=f[l]-s.reference[l],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=I?I[x]:0;(!E||!await(i.isElement==null?void 0:i.isElement(I)))&&(E=o.floating[x]||s.floating[p]);const R=w/2-b/2,T=E/2-g[p]/2-1,P=pr(m[y],T),O=pr(m[_],T),M=P,z=E-g[p]-O,D=E/2-g[p]/2+R,W=So(M,D,z),H=!c.arrow&&Qr(r)!=null&&D!==W&&s.reference[p]/2-(D<M?P:O)-g[p]/2<0,J=H?D<M?D-M:D-z:0;return{[l]:f[l]+J,data:{[l]:W,centerOffset:D-W-J,...H&&{alignmentOffset:J}},reset:H}}}),dv=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=tr(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=rr(r),_=kt(o),x=rr(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=f||(x||!g?[ta(o)]:nv(o)),I=p!=="none";!f&&I&&b.push(...iv(o,g,p,w));const E=[o,...b],R=await mn(e,v),T=[];let P=((a=s.flip)==null?void 0:a.overflows)||[];if(h&&T.push(R[y]),m){const D=rv(r,i,w);T.push(R[D[0]],R[D[1]])}if(P=[...P,{placement:r,overflows:T}],!T.every(D=>D<=0)){var O,M;const D=(((O=s.flip)==null?void 0:O.index)||0)+1,W=E[D];if(W&&(!(m==="alignment"?_!==kt(W):!1)||P.every(F=>kt(F.placement)===_?F.overflows[0]>0:!0)))return{data:{index:D,overflows:P},reset:{placement:W}};let H=(M=P.filter(J=>J.overflows[0]<=0).sort((J,F)=>J.overflows[1]-F.overflows[1])[0])==null?void 0:M.placement;if(!H)switch(l){case"bestFit":{var z;const J=(z=P.filter(F=>{if(I){const q=kt(F.placement);return q===_||q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,K)=>q+K,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:z[0];J&&(H=J);break}case"initialPlacement":H=o;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function Sl(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function bl(t){return Xg.some(e=>t[e]>=0)}const fv=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:a="referenceHidden",...r}=tr(t,e);switch(a){case"referenceHidden":{const s=await mn(e,{...r,elementContext:"reference"}),i=Sl(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bl(i)}}}case"escaped":{const s=await mn(e,{...r,altBoundary:!0}),i=Sl(s,n.floating);return{data:{escapedOffsets:i,escaped:bl(i)}}}default:return{}}}}},ud=new Set(["left","top"]);async function hv(t,e){const{placement:n,platform:a,elements:r}=t,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=rr(n),o=Qr(n),c=kt(n)==="y",u=ud.has(i)?-1:1,h=s&&c?-1:1,m=tr(e,t);let{mainAxis:f,crossAxis:l,alignmentAxis:p}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return o&&typeof p=="number"&&(l=o==="end"?p*-1:p),c?{x:l*h,y:f*u}:{x:f*u,y:l*h}}const mv=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,a;const{x:r,y:s,placement:i,middlewareData:o}=e,c=await hv(e,t);return i===((n=o.offset)==null?void 0:n.placement)&&(a=o.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},pv=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:a,placement:r}=e,{mainAxis:s=!0,crossAxis:i=!1,limiter:o={fn:v=>{let{x:y,y:_}=v;return{x:y,y:_}}},...c}=tr(t,e),u={x:n,y:a},h=await mn(e,c),m=kt(rr(r)),f=ni(m);let l=u[f],p=u[m];if(s){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",_=l+h[v],x=l-h[y];l=So(_,l,x)}if(i){const v=m==="y"?"top":"left",y=m==="y"?"bottom":"right",_=p+h[v],x=p-h[y];p=So(_,p,x)}const g=o.fn({...e,[f]:l,[m]:p});return{...g,data:{x:g.x-n,y:g.y-a,enabled:{[f]:s,[m]:i}}}}}},gv=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:a,placement:r,rects:s,middlewareData:i}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=tr(t,e),h={x:n,y:a},m=kt(r),f=ni(m);let l=h[f],p=h[m];const g=tr(o,e),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=f==="y"?"height":"width",w=s.reference[f]-s.floating[x]+v.mainAxis,b=s.reference[f]+s.reference[x]-v.mainAxis;l<w?l=w:l>b&&(l=b)}if(u){var y,_;const x=f==="y"?"width":"height",w=ud.has(rr(r)),b=s.reference[m]-s.floating[x]+(w&&((y=i.offset)==null?void 0:y[m])||0)+(w?0:v.crossAxis),I=s.reference[m]+s.reference[x]+(w?0:((_=i.offset)==null?void 0:_[m])||0)-(w?v.crossAxis:0);p<b?p=b:p>I&&(p=I)}return{[f]:l,[m]:p}}}},vv=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,a;const{placement:r,rects:s,platform:i,elements:o}=e,{apply:c=()=>{},...u}=tr(t,e),h=await mn(e,u),m=rr(r),f=Qr(r),l=kt(r)==="y",{width:p,height:g}=s.floating;let v,y;m==="top"||m==="bottom"?(v=m,y=f===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=m,v=f==="end"?"top":"bottom");const _=g-h.top-h.bottom,x=p-h.left-h.right,w=pr(g-h[v],_),b=pr(p-h[y],x),I=!e.middlewareData.shift;let E=w,R=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(a=e.middlewareData.shift)!=null&&a.enabled.y&&(E=_),I&&!f){const P=pt(h.left,0),O=pt(h.right,0),M=pt(h.top,0),z=pt(h.bottom,0);l?R=p-2*(P!==0||O!==0?P+O:pt(h.left,h.right)):E=g-2*(M!==0||z!==0?M+z:pt(h.top,h.bottom))}await c({...e,availableWidth:R,availableHeight:E});const T=await i.getDimensions(o.floating);return p!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function wa(){return typeof window<"u"}function Jr(t){return dd(t)?(t.nodeName||"").toLowerCase():"#document"}function gt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Vt(t){var e;return(e=(dd(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function dd(t){return wa()?t instanceof Node||t instanceof gt(t).Node:!1}function Ct(t){return wa()?t instanceof Element||t instanceof gt(t).Element:!1}function Ft(t){return wa()?t instanceof HTMLElement||t instanceof gt(t).HTMLElement:!1}function Cl(t){return!wa()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof gt(t).ShadowRoot}const yv=new Set(["inline","contents"]);function Sn(t){const{overflow:e,overflowX:n,overflowY:a,display:r}=Rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+n)&&!yv.has(r)}const xv=new Set(["table","td","th"]);function wv(t){return xv.has(Jr(t))}const _v=[":popover-open",":modal"];function _a(t){return _v.some(e=>{try{return t.matches(e)}catch{return!1}})}const Sv=["transform","translate","scale","rotate","perspective"],bv=["transform","translate","scale","rotate","perspective","filter"],Cv=["paint","layout","strict","content"];function oi(t){const e=ii(),n=Ct(t)?Rt(t):t;return Sv.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||bv.some(a=>(n.willChange||"").includes(a))||Cv.some(a=>(n.contain||"").includes(a))}function Rv(t){let e=gr(t);for(;Ft(e)&&!Gr(e);){if(oi(e))return e;if(_a(e))return null;e=gr(e)}return null}function ii(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ev=new Set(["html","body","#document"]);function Gr(t){return Ev.has(Jr(t))}function Rt(t){return gt(t).getComputedStyle(t)}function Sa(t){return Ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gr(t){if(Jr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Cl(t)&&t.host||Vt(t);return Cl(e)?e.host:e}function fd(t){const e=gr(t);return Gr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ft(e)&&Sn(e)?e:fd(e)}function pn(t,e,n){var a;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=fd(t),s=r===((a=t.ownerDocument)==null?void 0:a.body),i=gt(r);if(s){const o=Co(i);return e.concat(i,i.visualViewport||[],Sn(r)?r:[],o&&n?pn(o):[])}return e.concat(r,pn(r,[],n))}function Co(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hd(t){const e=Rt(t);let n=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const r=Ft(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:a,o=ea(n)!==s||ea(a)!==i;return o&&(n=s,a=i),{width:n,height:a,$:o}}function li(t){return Ct(t)?t:t.contextElement}function Ur(t){const e=li(t);if(!Ft(e))return Mt(1);const n=e.getBoundingClientRect(),{width:a,height:r,$:s}=hd(e);let i=(s?ea(n.width):n.width)/a,o=(s?ea(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const Pv=Mt(0);function md(t){const e=gt(t);return!ii()||!e.visualViewport?Pv:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Iv(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==gt(t)?!1:e}function Cr(t,e,n,a){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=li(t);let i=Mt(1);e&&(a?Ct(a)&&(i=Ur(a)):i=Ur(t));const o=Iv(s,n,a)?md(s):Mt(0);let c=(r.left+o.x)/i.x,u=(r.top+o.y)/i.y,h=r.width/i.x,m=r.height/i.y;if(s){const f=gt(s),l=a&&Ct(a)?gt(a):a;let p=f,g=Co(p);for(;g&&a&&l!==p;){const v=Ur(g),y=g.getBoundingClientRect(),_=Rt(g),x=y.left+(g.clientLeft+parseFloat(_.paddingLeft))*v.x,w=y.top+(g.clientTop+parseFloat(_.paddingTop))*v.y;c*=v.x,u*=v.y,h*=v.x,m*=v.y,c+=x,u+=w,p=gt(g),g=Co(p)}}return ra({width:h,height:m,x:c,y:u})}function ba(t,e){const n=Sa(t).scrollLeft;return e?e.left+n:Cr(Vt(t)).left+n}function pd(t,e){const n=t.getBoundingClientRect(),a=n.left+e.scrollLeft-ba(t,n),r=n.top+e.scrollTop;return{x:a,y:r}}function Av(t){let{elements:e,rect:n,offsetParent:a,strategy:r}=t;const s=r==="fixed",i=Vt(a),o=e?_a(e.floating):!1;if(a===i||o&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mt(1);const h=Mt(0),m=Ft(a);if((m||!m&&!s)&&((Jr(a)!=="body"||Sn(i))&&(c=Sa(a)),Ft(a))){const l=Cr(a);u=Ur(a),h.x=l.x+a.clientLeft,h.y=l.y+a.clientTop}const f=i&&!m&&!s?pd(i,c):Mt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}}function Nv(t){return Array.from(t.getClientRects())}function jv(t){const e=Vt(t),n=Sa(t),a=t.ownerDocument.body,r=pt(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=pt(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+ba(t);const o=-n.scrollTop;return Rt(a).direction==="rtl"&&(i+=pt(e.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:o}}const Rl=25;function Tv(t,e){const n=gt(t),a=Vt(t),r=n.visualViewport;let s=a.clientWidth,i=a.clientHeight,o=0,c=0;if(r){s=r.width,i=r.height;const h=ii();(!h||h&&e==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}const u=ba(a);if(u<=0){const h=a.ownerDocument,m=h.body,f=getComputedStyle(m),l=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(a.clientWidth-m.clientWidth-l);p<=Rl&&(s-=p)}else u<=Rl&&(s+=u);return{width:s,height:i,x:o,y:c}}const Ov=new Set(["absolute","fixed"]);function kv(t,e){const n=Cr(t,!0,e==="fixed"),a=n.top+t.clientTop,r=n.left+t.clientLeft,s=Ft(t)?Ur(t):Mt(1),i=t.clientWidth*s.x,o=t.clientHeight*s.y,c=r*s.x,u=a*s.y;return{width:i,height:o,x:c,y:u}}function El(t,e,n){let a;if(e==="viewport")a=Tv(t,n);else if(e==="document")a=jv(Vt(t));else if(Ct(e))a=kv(e,n);else{const r=md(t);a={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ra(a)}function gd(t,e){const n=gr(t);return n===e||!Ct(n)||Gr(n)?!1:Rt(n).position==="fixed"||gd(n,e)}function Mv(t,e){const n=e.get(t);if(n)return n;let a=pn(t,[],!1).filter(o=>Ct(o)&&Jr(o)!=="body"),r=null;const s=Rt(t).position==="fixed";let i=s?gr(t):t;for(;Ct(i)&&!Gr(i);){const o=Rt(i),c=oi(i);!c&&o.position==="fixed"&&(r=null),(s?!c&&!r:!c&&o.position==="static"&&!!r&&Ov.has(r.position)||Sn(i)&&!c&&gd(t,i))?a=a.filter(h=>h!==i):r=o,i=gr(i)}return e.set(t,a),a}function Dv(t){let{element:e,boundary:n,rootBoundary:a,strategy:r}=t;const i=[...n==="clippingAncestors"?_a(e)?[]:Mv(e,this._c):[].concat(n),a],o=i[0],c=i.reduce((u,h)=>{const m=El(e,h,r);return u.top=pt(m.top,u.top),u.right=pr(m.right,u.right),u.bottom=pr(m.bottom,u.bottom),u.left=pt(m.left,u.left),u},El(e,o,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fv(t){const{width:e,height:n}=hd(t);return{width:e,height:n}}function $v(t,e,n){const a=Ft(e),r=Vt(e),s=n==="fixed",i=Cr(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=Mt(0);function u(){c.x=ba(r)}if(a||!a&&!s)if((Jr(e)!=="body"||Sn(r))&&(o=Sa(e)),a){const l=Cr(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else r&&u();s&&!a&&r&&u();const h=r&&!a&&!s?pd(r,o):Mt(0),m=i.left+o.scrollLeft-c.x-h.x,f=i.top+o.scrollTop-c.y-h.y;return{x:m,y:f,width:i.width,height:i.height}}function rs(t){return Rt(t).position==="static"}function Pl(t,e){if(!Ft(t)||Rt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Vt(t)===n&&(n=n.ownerDocument.body),n}function vd(t,e){const n=gt(t);if(_a(t))return n;if(!Ft(t)){let r=gr(t);for(;r&&!Gr(r);){if(Ct(r)&&!rs(r))return r;r=gr(r)}return n}let a=Pl(t,e);for(;a&&wv(a)&&rs(a);)a=Pl(a,e);return a&&Gr(a)&&rs(a)&&!oi(a)?n:a||Rv(t)||n}const Lv=async function(t){const e=this.getOffsetParent||vd,n=this.getDimensions,a=await n(t.floating);return{reference:$v(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Vv(t){return Rt(t).direction==="rtl"}const zv={convertOffsetParentRelativeRectToViewportRelativeRect:Av,getDocumentElement:Vt,getClippingRect:Dv,getOffsetParent:vd,getElementRects:Lv,getClientRects:Nv,getDimensions:Fv,getScale:Ur,isElement:Ct,isRTL:Vv};function yd(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qv(t,e){let n=null,a;const r=Vt(t);function s(){var o;clearTimeout(a),(o=n)==null||o.disconnect(),n=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:h,top:m,width:f,height:l}=u;if(o||e(),!f||!l)return;const p=zn(m),g=zn(r.clientWidth-(h+f)),v=zn(r.clientHeight-(m+l)),y=zn(h),x={rootMargin:-p+"px "+-g+"px "+-v+"px "+-y+"px",threshold:pt(0,pr(1,c))||1};let w=!0;function b(I){const E=I[0].intersectionRatio;if(E!==c){if(!w)return i();E?i(!1,E):a=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!yd(u,t.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(b,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(t)}return i(!0),s}function Uv(t,e,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,u=li(t),h=r||s?[...u?pn(u):[],...pn(e)]:[];h.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const m=u&&o?qv(u,n):null;let f=-1,l=null;i&&(l=new ResizeObserver(y=>{let[_]=y;_&&_.target===u&&l&&(l.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=l)==null||x.observe(e)})),n()}),u&&!c&&l.observe(u),l.observe(e));let p,g=c?Cr(t):null;c&&v();function v(){const y=Cr(t);g&&!yd(g,y)&&n(),g=y,p=requestAnimationFrame(v)}return n(),()=>{var y;h.forEach(_=>{r&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),m==null||m(),(y=l)==null||y.disconnect(),l=null,c&&cancelAnimationFrame(p)}}const Hv=mv,Gv=pv,Bv=dv,Kv=vv,Wv=fv,Il=uv,Zv=gv,Qv=(t,e,n)=>{const a=new Map,r={platform:zv,...n},s={...r.platform,_c:a};return cv(t,e,{...r,platform:s})};var Jv=typeof document<"u",Xv=function(){},Qn=Jv?S.useLayoutEffect:Xv;function na(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,a,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(a=n;a--!==0;)if(!na(t[a],e[a]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(e,r[a]))return!1;for(a=n;a--!==0;){const s=r[a];if(!(s==="_owner"&&t.$$typeof)&&!na(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function xd(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Al(t,e){const n=xd(t);return Math.round(e*n)/n}function ns(t){const e=S.useRef(t);return Qn(()=>{e.current=t}),e}function Yv(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:a=[],platform:r,elements:{reference:s,floating:i}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[h,m]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,l]=S.useState(a);na(f,a)||l(a);const[p,g]=S.useState(null),[v,y]=S.useState(null),_=S.useCallback(F=>{F!==I.current&&(I.current=F,g(F))},[]),x=S.useCallback(F=>{F!==E.current&&(E.current=F,y(F))},[]),w=s||p,b=i||v,I=S.useRef(null),E=S.useRef(null),R=S.useRef(h),T=c!=null,P=ns(c),O=ns(r),M=ns(u),z=S.useCallback(()=>{if(!I.current||!E.current)return;const F={placement:e,strategy:n,middleware:f};O.current&&(F.platform=O.current),Qv(I.current,E.current,F).then(q=>{const K={...q,isPositioned:M.current!==!1};D.current&&!na(R.current,K)&&(R.current=K,Wo.flushSync(()=>{m(K)}))})},[f,e,n,O,M]);Qn(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[u]);const D=S.useRef(!1);Qn(()=>(D.current=!0,()=>{D.current=!1}),[]),Qn(()=>{if(w&&(I.current=w),b&&(E.current=b),w&&b){if(P.current)return P.current(w,b,z);z()}},[w,b,z,P,T]);const W=S.useMemo(()=>({reference:I,floating:E,setReference:_,setFloating:x}),[_,x]),H=S.useMemo(()=>({reference:w,floating:b}),[w,b]),J=S.useMemo(()=>{const F={position:n,left:0,top:0};if(!H.floating)return F;const q=Al(H.floating,h.x),K=Al(H.floating,h.y);return o?{...F,transform:"translate("+q+"px, "+K+"px)",...xd(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:K}},[n,o,H.floating,h.x,h.y]);return S.useMemo(()=>({...h,update:z,refs:W,elements:H,floatingStyles:J}),[h,z,W,H,J])}const ey=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:a,padding:r}=typeof t=="function"?t(n):t;return a&&e(a)?a.current!=null?Il({element:a.current,padding:r}).fn(n):{}:a?Il({element:a,padding:r}).fn(n):{}}}},ty=(t,e)=>({...Hv(t),options:[t,e]}),ry=(t,e)=>({...Gv(t),options:[t,e]}),ny=(t,e)=>({...Zv(t),options:[t,e]}),ay=(t,e)=>({...Bv(t),options:[t,e]}),sy=(t,e)=>({...Kv(t),options:[t,e]}),oy=(t,e)=>({...Wv(t),options:[t,e]}),iy=(t,e)=>({...ey(t),options:[t,e]});var ly="Arrow",wd=S.forwardRef((t,e)=>{const{children:n,width:a=10,height:r=5,...s}=t;return d.jsx(We.svg,{...s,ref:e,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});wd.displayName=ly;var cy=wd,ci="Popper",[_d,Sd]=Nr(ci),[uy,bd]=_d(ci),Cd=t=>{const{__scopePopper:e,children:n}=t,[a,r]=S.useState(null);return d.jsx(uy,{scope:e,anchor:a,onAnchorChange:r,children:n})};Cd.displayName=ci;var Rd="PopperAnchor",Ed=S.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:a,...r}=t,s=bd(Rd,n),i=S.useRef(null),o=lt(e,i),c=S.useRef(null);return S.useEffect(()=>{const u=c.current;c.current=(a==null?void 0:a.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),a?null:d.jsx(We.div,{...r,ref:o})});Ed.displayName=Rd;var ui="PopperContent",[dy,fy]=_d(ui),Pd=S.forwardRef((t,e)=>{var $,X,ne,U,Z,pe;const{__scopePopper:n,side:a="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:f=!1,updatePositionStrategy:l="optimized",onPlaced:p,...g}=t,v=bd(ui,n),[y,_]=S.useState(null),x=lt(e,ee=>_(ee)),[w,b]=S.useState(null),I=Pu(w),E=(I==null?void 0:I.width)??0,R=(I==null?void 0:I.height)??0,T=a+(s!=="center"?"-"+s:""),P=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},O=Array.isArray(u)?u:[u],M=O.length>0,z={padding:P,boundary:O.filter(my),altBoundary:M},{refs:D,floatingStyles:W,placement:H,isPositioned:J,middlewareData:F}=Yv({strategy:"fixed",placement:T,whileElementsMounted:(...ee)=>Uv(...ee,{animationFrame:l==="always"}),elements:{reference:v.anchor},middleware:[ty({mainAxis:r+R,alignmentAxis:i}),c&&ry({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?ny():void 0,...z}),c&&ay({...z}),sy({...z,apply:({elements:ee,rects:ae,availableWidth:Se,availableHeight:ce})=>{const{width:be,height:$e}=ae.reference,_e=ee.floating.style;_e.setProperty("--radix-popper-available-width",`${Se}px`),_e.setProperty("--radix-popper-available-height",`${ce}px`),_e.setProperty("--radix-popper-anchor-width",`${be}px`),_e.setProperty("--radix-popper-anchor-height",`${$e}px`)}}),w&&iy({element:w,padding:o}),py({arrowWidth:E,arrowHeight:R}),f&&oy({strategy:"referenceHidden",...z})]}),[q,K]=Nd(H),re=er(p);hr(()=>{J&&(re==null||re())},[J,re]);const fe=($=F.arrow)==null?void 0:$.x,me=(X=F.arrow)==null?void 0:X.y,ye=((ne=F.arrow)==null?void 0:ne.centerOffset)!==0,[Me,k]=S.useState();return hr(()=>{y&&k(window.getComputedStyle(y).zIndex)},[y]),d.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:J?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(U=F.transformOrigin)==null?void 0:U.x,(Z=F.transformOrigin)==null?void 0:Z.y].join(" "),...((pe=F.hide)==null?void 0:pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(dy,{scope:n,placedSide:q,onArrowChange:b,arrowX:fe,arrowY:me,shouldHideArrow:ye,children:d.jsx(We.div,{"data-side":q,"data-align":K,...g,ref:x,style:{...g.style,animation:J?void 0:"none"}})})})});Pd.displayName=ui;var Id="PopperArrow",hy={top:"bottom",right:"left",bottom:"top",left:"right"},Ad=S.forwardRef(function(e,n){const{__scopePopper:a,...r}=e,s=fy(Id,a),i=hy[s.placedSide];return d.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:d.jsx(cy,{...r,ref:n,style:{...r.style,display:"block"}})})});Ad.displayName=Id;function my(t){return t!==null}var py=t=>({name:"transformOrigin",options:t,fn(e){var v,y,_;const{placement:n,rects:a,middlewareData:r}=e,i=((v=r.arrow)==null?void 0:v.centerOffset)!==0,o=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,h]=Nd(n),m={start:"0%",center:"50%",end:"100%"}[h],f=(((y=r.arrow)==null?void 0:y.x)??0)+o/2,l=(((_=r.arrow)==null?void 0:_.y)??0)+c/2;let p="",g="";return u==="bottom"?(p=i?m:`${f}px`,g=`${-c}px`):u==="top"?(p=i?m:`${f}px`,g=`${a.floating.height+c}px`):u==="right"?(p=`${-c}px`,g=i?m:`${l}px`):u==="left"&&(p=`${a.floating.width+c}px`,g=i?m:`${l}px`),{data:{x:p,y:g}}}});function Nd(t){const[e,n="center"]=t.split("-");return[e,n]}var gy=Cd,vy=Ed,yy=Pd,xy=Ad,wy="Portal",jd=S.forwardRef((t,e)=>{var o;const{container:n,...a}=t,[r,s]=S.useState(!1);hr(()=>s(!0),[]);const i=n||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?Hm.createPortal(d.jsx(We.div,{...a,ref:e}),i):null});jd.displayName=wy;var as="rovingFocusGroup.onEntryFocus",_y={bubbles:!1,cancelable:!0},bn="RovingFocusGroup",[Ro,Td,Sy]=nd(bn),[by,Ca]=Nr(bn,[Sy]),[Cy,Ry]=by(bn),Od=S.forwardRef((t,e)=>d.jsx(Ro.Provider,{scope:t.__scopeRovingFocusGroup,children:d.jsx(Ro.Slot,{scope:t.__scopeRovingFocusGroup,children:d.jsx(Ey,{...t,ref:e})})}));Od.displayName=bn;var Ey=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...m}=t,f=S.useRef(null),l=lt(e,f),p=ri(s),[g,v]=va({prop:i,defaultProp:o??null,onChange:c,caller:bn}),[y,_]=S.useState(!1),x=er(u),w=Td(n),b=S.useRef(!1),[I,E]=S.useState(0);return S.useEffect(()=>{const R=f.current;if(R)return R.addEventListener(as,x),()=>R.removeEventListener(as,x)},[x]),d.jsx(Cy,{scope:n,orientation:a,dir:p,loop:r,currentTabStopId:g,onItemFocus:S.useCallback(R=>v(R),[v]),onItemShiftTab:S.useCallback(()=>_(!0),[]),onFocusableItemAdd:S.useCallback(()=>E(R=>R+1),[]),onFocusableItemRemove:S.useCallback(()=>E(R=>R-1),[]),children:d.jsx(We.div,{tabIndex:y||I===0?-1:0,"data-orientation":a,...m,ref:l,style:{outline:"none",...t.style},onMouseDown:Ie(t.onMouseDown,()=>{b.current=!0}),onFocus:Ie(t.onFocus,R=>{const T=!b.current;if(R.target===R.currentTarget&&T&&!y){const P=new CustomEvent(as,_y);if(R.currentTarget.dispatchEvent(P),!P.defaultPrevented){const O=w().filter(H=>H.focusable),M=O.find(H=>H.active),z=O.find(H=>H.id===g),W=[M,z,...O].filter(Boolean).map(H=>H.ref.current);Dd(W,h)}}b.current=!1}),onBlur:Ie(t.onBlur,()=>_(!1))})})}),kd="RovingFocusGroupItem",Md=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:s,children:i,...o}=t,c=Yn(),u=s||c,h=Ry(kd,n),m=h.currentTabStopId===u,f=Td(n),{onFocusableItemAdd:l,onFocusableItemRemove:p,currentTabStopId:g}=h;return S.useEffect(()=>{if(a)return l(),()=>p()},[a,l,p]),d.jsx(Ro.ItemSlot,{scope:n,id:u,focusable:a,active:r,children:d.jsx(We.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...o,ref:e,onMouseDown:Ie(t.onMouseDown,v=>{a?h.onItemFocus(u):v.preventDefault()}),onFocus:Ie(t.onFocus,()=>h.onItemFocus(u)),onKeyDown:Ie(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){h.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=Ay(v,h.orientation,h.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=f().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const w=x.indexOf(v.currentTarget);x=h.loop?Ny(x,w+1):x.slice(w+1)}setTimeout(()=>Dd(x))}}),children:typeof i=="function"?i({isCurrentTabStop:m,hasTabStop:g!=null}):i})})});Md.displayName=kd;var Py={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Iy(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Ay(t,e,n){const a=Iy(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Py[a]}function Dd(t,e=!1){const n=document.activeElement;for(const a of t)if(a===n||(a.focus({preventScroll:e}),document.activeElement!==n))return}function Ny(t,e){return t.map((n,a)=>t[(e+a)%t.length])}var Fd=Od,$d=Md,jy=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Fr=new WeakMap,qn=new WeakMap,Un={},ss=0,Ld=function(t){return t&&(t.host||Ld(t.parentNode))},Ty=function(t,e){return e.map(function(n){if(t.contains(n))return n;var a=Ld(n);return a&&t.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Oy=function(t,e,n,a){var r=Ty(e,Array.isArray(t)?t:[t]);Un[n]||(Un[n]=new WeakMap);var s=Un[n],i=[],o=new Set,c=new Set(r),u=function(m){!m||o.has(m)||(o.add(m),u(m.parentNode))};r.forEach(u);var h=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(f){if(o.has(f))h(f);else try{var l=f.getAttribute(a),p=l!==null&&l!=="false",g=(Fr.get(f)||0)+1,v=(s.get(f)||0)+1;Fr.set(f,g),s.set(f,v),i.push(f),g===1&&p&&qn.set(f,!0),v===1&&f.setAttribute(n,"true"),p||f.setAttribute(a,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return h(e),o.clear(),ss++,function(){i.forEach(function(m){var f=Fr.get(m)-1,l=s.get(m)-1;Fr.set(m,f),s.set(m,l),f||(qn.has(m)||m.removeAttribute(a),qn.delete(m)),l||m.removeAttribute(n)}),ss--,ss||(Fr=new WeakMap,Fr=new WeakMap,qn=new WeakMap,Un={})}},ky=function(t,e,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),r=jy(t);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),Oy(a,r,n,"aria-hidden")):function(){return null}},Ot=function(){return Ot=Object.assign||function(e){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ot.apply(this,arguments)};function Vd(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(n[a[r]]=t[a[r]]);return n}function My(t,e,n){if(n||arguments.length===2)for(var a=0,r=e.length,s;a<r;a++)(s||!(a in e))&&(s||(s=Array.prototype.slice.call(e,0,a)),s[a]=e[a]);return t.concat(s||Array.prototype.slice.call(e))}var Jn="right-scroll-bar-position",Xn="width-before-scroll-bar",Dy="with-scroll-bars-hidden",Fy="--removed-body-scroll-bar-size";function os(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function $y(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(a){var r=n.value;r!==a&&(n.value=a,n.callback(a,r))}}}})[0];return n.callback=e,n.facade}var Ly=typeof window<"u"?S.useLayoutEffect:S.useEffect,Nl=new WeakMap;function Vy(t,e){var n=$y(null,function(a){return t.forEach(function(r){return os(r,a)})});return Ly(function(){var a=Nl.get(n);if(a){var r=new Set(a),s=new Set(t),i=n.current;r.forEach(function(o){s.has(o)||os(o,null)}),s.forEach(function(o){r.has(o)||os(o,i)})}Nl.set(n,t)},[t]),n}function zy(t){return t}function qy(t,e){e===void 0&&(e=zy);var n=[],a=!1,r={read:function(){if(a)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]:t},useMedium:function(s){var i=e(s,a);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(s){for(a=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){a=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(s),i=n}var c=function(){var h=i;i=[],h.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){i.push(h),u()},filter:function(h){return i=i.filter(h),n}}}};return r}function Uy(t){t===void 0&&(t={});var e=qy(null);return e.options=Ot({async:!0,ssr:!1},t),e}var zd=function(t){var e=t.sideCar,n=Vd(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=e.read();if(!a)throw new Error("Sidecar medium not found");return S.createElement(a,Ot({},n))};zd.isSideCarExport=!0;function Hy(t,e){return t.useMedium(e),zd}var qd=Uy(),is=function(){},Ra=S.forwardRef(function(t,e){var n=S.useRef(null),a=S.useState({onScrollCapture:is,onWheelCapture:is,onTouchMoveCapture:is}),r=a[0],s=a[1],i=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,h=t.enabled,m=t.shards,f=t.sideCar,l=t.noRelative,p=t.noIsolation,g=t.inert,v=t.allowPinchZoom,y=t.as,_=y===void 0?"div":y,x=t.gapMode,w=Vd(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=f,I=Vy([n,e]),E=Ot(Ot({},w),r);return S.createElement(S.Fragment,null,h&&S.createElement(b,{sideCar:qd,removeScrollBar:u,shards:m,noRelative:l,noIsolation:p,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:x}),i?S.cloneElement(S.Children.only(o),Ot(Ot({},E),{ref:I})):S.createElement(_,Ot({},E,{className:c,ref:I}),o))});Ra.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ra.classNames={fullWidth:Xn,zeroRight:Jn};var Gy=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function By(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Gy();return e&&t.setAttribute("nonce",e),t}function Ky(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Wy(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Zy=function(){var t=0,e=null;return{add:function(n){t==0&&(e=By())&&(Ky(e,n),Wy(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Qy=function(){var t=Zy();return function(e,n){S.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Ud=function(){var t=Qy(),e=function(n){var a=n.styles,r=n.dynamic;return t(a,r),null};return e},Jy={left:0,top:0,right:0,gap:0},ls=function(t){return parseInt(t||"",10)||0},Xy=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],a=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[ls(n),ls(a),ls(r)]},Yy=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Jy;var e=Xy(t),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,a-n+e[2]-e[0])}},ex=Ud(),Hr="data-scroll-locked",tx=function(t,e,n,a){var r=t.left,s=t.top,i=t.right,o=t.gap;return n===void 0&&(n="margin"),`
|
|
106
|
+
.`.concat(Dy,` {
|
|
107
|
+
overflow: hidden `).concat(a,`;
|
|
108
|
+
padding-right: `).concat(o,"px ").concat(a,`;
|
|
109
|
+
}
|
|
110
|
+
body[`).concat(Hr,`] {
|
|
111
|
+
overflow: hidden `).concat(a,`;
|
|
112
|
+
overscroll-behavior: contain;
|
|
113
|
+
`).concat([e&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
114
|
+
padding-left: `.concat(r,`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(o,"px ").concat(a,`;
|
|
120
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.`).concat(Jn,` {
|
|
124
|
+
right: `).concat(o,"px ").concat(a,`;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.`).concat(Xn,` {
|
|
128
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.`).concat(Jn," .").concat(Jn,` {
|
|
132
|
+
right: 0 `).concat(a,`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.`).concat(Xn," .").concat(Xn,` {
|
|
136
|
+
margin-right: 0 `).concat(a,`;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
body[`).concat(Hr,`] {
|
|
140
|
+
`).concat(Fy,": ").concat(o,`px;
|
|
141
|
+
}
|
|
142
|
+
`)},jl=function(){var t=parseInt(document.body.getAttribute(Hr)||"0",10);return isFinite(t)?t:0},rx=function(){S.useEffect(function(){return document.body.setAttribute(Hr,(jl()+1).toString()),function(){var t=jl()-1;t<=0?document.body.removeAttribute(Hr):document.body.setAttribute(Hr,t.toString())}},[])},nx=function(t){var e=t.noRelative,n=t.noImportant,a=t.gapMode,r=a===void 0?"margin":a;rx();var s=S.useMemo(function(){return Yy(r)},[r]);return S.createElement(ex,{styles:tx(s,!e,r,n?"":"!important")})},Eo=!1;if(typeof window<"u")try{var Hn=Object.defineProperty({},"passive",{get:function(){return Eo=!0,!0}});window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{Eo=!1}var $r=Eo?{passive:!1}:!1,ax=function(t){return t.tagName==="TEXTAREA"},Hd=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!ax(t)&&n[e]==="visible")},sx=function(t){return Hd(t,"overflowY")},ox=function(t){return Hd(t,"overflowX")},Tl=function(t,e){var n=e.ownerDocument,a=e;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=Gd(t,a);if(r){var s=Bd(t,a),i=s[1],o=s[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},ix=function(t){var e=t.scrollTop,n=t.scrollHeight,a=t.clientHeight;return[e,n,a]},lx=function(t){var e=t.scrollLeft,n=t.scrollWidth,a=t.clientWidth;return[e,n,a]},Gd=function(t,e){return t==="v"?sx(e):ox(e)},Bd=function(t,e){return t==="v"?ix(e):lx(e)},cx=function(t,e){return t==="h"&&e==="rtl"?-1:1},ux=function(t,e,n,a,r){var s=cx(t,window.getComputedStyle(e).direction),i=s*a,o=n.target,c=e.contains(o),u=!1,h=i>0,m=0,f=0;do{if(!o)break;var l=Bd(t,o),p=l[0],g=l[1],v=l[2],y=g-v-s*p;(p||y)&&Gd(t,o)&&(m+=y,f+=p);var _=o.parentNode;o=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(h&&Math.abs(m)<1||!h&&Math.abs(f)<1)&&(u=!0),u},Gn=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ol=function(t){return[t.deltaX,t.deltaY]},kl=function(t){return t&&"current"in t?t.current:t},dx=function(t,e){return t[0]===e[0]&&t[1]===e[1]},fx=function(t){return`
|
|
143
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
144
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
145
|
+
`)},hx=0,Lr=[];function mx(t){var e=S.useRef([]),n=S.useRef([0,0]),a=S.useRef(),r=S.useState(hx++)[0],s=S.useState(Ud)[0],i=S.useRef(t);S.useEffect(function(){i.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var g=My([t.lockRef.current],(t.shards||[]).map(kl),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var o=S.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var y=Gn(g),_=n.current,x="deltaX"in g?g.deltaX:_[0]-y[0],w="deltaY"in g?g.deltaY:_[1]-y[1],b,I=g.target,E=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in g&&E==="h"&&I.type==="range")return!1;var R=Tl(E,I);if(!R)return!0;if(R?b=E:(b=E==="v"?"h":"v",R=Tl(E,I)),!R)return!1;if(!a.current&&"changedTouches"in g&&(x||w)&&(a.current=b),!b)return!0;var T=a.current||b;return ux(T,v,g,T==="h"?x:w)},[]),c=S.useCallback(function(g){var v=g;if(!(!Lr.length||Lr[Lr.length-1]!==s)){var y="deltaY"in v?Ol(v):Gn(v),_=e.current.filter(function(b){return b.name===v.type&&(b.target===v.target||v.target===b.shadowParent)&&dx(b.delta,y)})[0];if(_&&_.should){v.cancelable&&v.preventDefault();return}if(!_){var x=(i.current.shards||[]).map(kl).filter(Boolean).filter(function(b){return b.contains(v.target)}),w=x.length>0?o(v,x[0]):!i.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=S.useCallback(function(g,v,y,_){var x={name:g,delta:v,target:y,should:_,shadowParent:px(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),h=S.useCallback(function(g){n.current=Gn(g),a.current=void 0},[]),m=S.useCallback(function(g){u(g.type,Ol(g),g.target,o(g,t.lockRef.current))},[]),f=S.useCallback(function(g){u(g.type,Gn(g),g.target,o(g,t.lockRef.current))},[]);S.useEffect(function(){return Lr.push(s),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:f}),document.addEventListener("wheel",c,$r),document.addEventListener("touchmove",c,$r),document.addEventListener("touchstart",h,$r),function(){Lr=Lr.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,$r),document.removeEventListener("touchmove",c,$r),document.removeEventListener("touchstart",h,$r)}},[]);var l=t.removeScrollBar,p=t.inert;return S.createElement(S.Fragment,null,p?S.createElement(s,{styles:fx(r)}):null,l?S.createElement(nx,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function px(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const gx=Hy(qd,mx);var Kd=S.forwardRef(function(t,e){return S.createElement(Ra,Ot({},t,{ref:e,sideCar:gx}))});Kd.classNames=Ra.classNames;var Po=["Enter"," "],vx=["ArrowDown","PageUp","Home"],Wd=["ArrowUp","PageDown","End"],yx=[...vx,...Wd],xx={ltr:[...Po,"ArrowRight"],rtl:[...Po,"ArrowLeft"]},wx={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Cn="Menu",[gn,_x,Sx]=nd(Cn),[Tr,Zd]=Nr(Cn,[Sx,Sd,Ca]),Ea=Sd(),Qd=Ca(),[bx,Or]=Tr(Cn),[Cx,Rn]=Tr(Cn),Jd=t=>{const{__scopeMenu:e,open:n=!1,children:a,dir:r,onOpenChange:s,modal:i=!0}=t,o=Ea(e),[c,u]=S.useState(null),h=S.useRef(!1),m=er(s),f=ri(r);return S.useEffect(()=>{const l=()=>{h.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>h.current=!1;return document.addEventListener("keydown",l,{capture:!0}),()=>{document.removeEventListener("keydown",l,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),d.jsx(gy,{...o,children:d.jsx(bx,{scope:e,open:n,onOpenChange:m,content:c,onContentChange:u,children:d.jsx(Cx,{scope:e,onClose:S.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:f,modal:i,children:a})})})};Jd.displayName=Cn;var Rx="MenuAnchor",di=S.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t,r=Ea(n);return d.jsx(vy,{...r,...a,ref:e})});di.displayName=Rx;var fi="MenuPortal",[Ex,Xd]=Tr(fi,{forceMount:void 0}),Yd=t=>{const{__scopeMenu:e,forceMount:n,children:a,container:r}=t,s=Or(fi,e);return d.jsx(Ex,{scope:e,forceMount:n,children:d.jsx(jr,{present:n||s.open,children:d.jsx(jd,{asChild:!0,container:r,children:a})})})};Yd.displayName=fi;var xt="MenuContent",[Px,hi]=Tr(xt),ef=S.forwardRef((t,e)=>{const n=Xd(xt,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,s=Or(xt,t.__scopeMenu),i=Rn(xt,t.__scopeMenu);return d.jsx(gn.Provider,{scope:t.__scopeMenu,children:d.jsx(jr,{present:a||s.open,children:d.jsx(gn.Slot,{scope:t.__scopeMenu,children:i.modal?d.jsx(Ix,{...r,ref:e}):d.jsx(Ax,{...r,ref:e})})})})}),Ix=S.forwardRef((t,e)=>{const n=Or(xt,t.__scopeMenu),a=S.useRef(null),r=lt(e,a);return S.useEffect(()=>{const s=a.current;if(s)return ky(s)},[]),d.jsx(mi,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ax=S.forwardRef((t,e)=>{const n=Or(xt,t.__scopeMenu);return d.jsx(mi,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Nx=hn("MenuContent.ScrollLock"),mi=S.forwardRef((t,e)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:f,onDismiss:l,disableOutsideScroll:p,...g}=t,v=Or(xt,n),y=Rn(xt,n),_=Ea(n),x=Qd(n),w=_x(n),[b,I]=S.useState(null),E=S.useRef(null),R=lt(e,E,v.onContentChange),T=S.useRef(0),P=S.useRef(""),O=S.useRef(0),M=S.useRef(null),z=S.useRef("right"),D=S.useRef(0),W=p?Kd:S.Fragment,H=p?{as:Nx,allowPinchZoom:!0}:void 0,J=q=>{var $,X;const K=P.current+q,re=w().filter(ne=>!ne.disabled),fe=document.activeElement,me=($=re.find(ne=>ne.ref.current===fe))==null?void 0:$.textValue,ye=re.map(ne=>ne.textValue),Me=qx(ye,K,me),k=(X=re.find(ne=>ne.textValue===Me))==null?void 0:X.ref.current;(function ne(U){P.current=U,window.clearTimeout(T.current),U!==""&&(T.current=window.setTimeout(()=>ne(""),1e3))})(K),k&&setTimeout(()=>k.focus())};S.useEffect(()=>()=>window.clearTimeout(T.current),[]),qg();const F=S.useCallback(q=>{var re,fe;return z.current===((re=M.current)==null?void 0:re.side)&&Hx(q,(fe=M.current)==null?void 0:fe.area)},[]);return d.jsx(Px,{scope:n,searchRef:P,onItemEnter:S.useCallback(q=>{F(q)&&q.preventDefault()},[F]),onItemLeave:S.useCallback(q=>{var K;F(q)||((K=E.current)==null||K.focus(),I(null))},[F]),onTriggerLeave:S.useCallback(q=>{F(q)&&q.preventDefault()},[F]),pointerGraceTimerRef:O,onPointerGraceIntentChange:S.useCallback(q=>{M.current=q},[]),children:d.jsx(W,{...H,children:d.jsx(id,{asChild:!0,trapped:r,onMountAutoFocus:Ie(s,q=>{var K;q.preventDefault(),(K=E.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(sd,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:f,onDismiss:l,children:d.jsx(Fd,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:b,onCurrentTabStopIdChange:I,onEntryFocus:Ie(c,q=>{y.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(yy,{role:"menu","aria-orientation":"vertical","data-state":vf(v.open),"data-radix-menu-content":"",dir:y.dir,..._,...g,ref:R,style:{outline:"none",...g.style},onKeyDown:Ie(g.onKeyDown,q=>{const re=q.target.closest("[data-radix-menu-content]")===q.currentTarget,fe=q.ctrlKey||q.altKey||q.metaKey,me=q.key.length===1;re&&(q.key==="Tab"&&q.preventDefault(),!fe&&me&&J(q.key));const ye=E.current;if(q.target!==ye||!yx.includes(q.key))return;q.preventDefault();const k=w().filter($=>!$.disabled).map($=>$.ref.current);Wd.includes(q.key)&&k.reverse(),Vx(k)}),onBlur:Ie(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(T.current),P.current="")}),onPointerMove:Ie(t.onPointerMove,vn(q=>{const K=q.target,re=D.current!==q.clientX;if(q.currentTarget.contains(K)&&re){const fe=q.clientX>D.current?"right":"left";z.current=fe,D.current=q.clientX}}))})})})})})})});ef.displayName=xt;var jx="MenuGroup",pi=S.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return d.jsx(We.div,{role:"group",...a,ref:e})});pi.displayName=jx;var Tx="MenuLabel",tf=S.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return d.jsx(We.div,{...a,ref:e})});tf.displayName=Tx;var aa="MenuItem",Ml="menu.itemSelect",Pa=S.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:a,...r}=t,s=S.useRef(null),i=Rn(aa,t.__scopeMenu),o=hi(aa,t.__scopeMenu),c=lt(e,s),u=S.useRef(!1),h=()=>{const m=s.current;if(!n&&m){const f=new CustomEvent(Ml,{bubbles:!0,cancelable:!0});m.addEventListener(Ml,l=>a==null?void 0:a(l),{once:!0}),Au(m,f),f.defaultPrevented?u.current=!1:i.onClose()}};return d.jsx(rf,{...r,ref:c,disabled:n,onClick:Ie(t.onClick,h),onPointerDown:m=>{var f;(f=t.onPointerDown)==null||f.call(t,m),u.current=!0},onPointerUp:Ie(t.onPointerUp,m=>{var f;u.current||(f=m.currentTarget)==null||f.click()}),onKeyDown:Ie(t.onKeyDown,m=>{const f=o.searchRef.current!=="";n||f&&m.key===" "||Po.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Pa.displayName=aa;var rf=S.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...s}=t,i=hi(aa,n),o=Qd(n),c=S.useRef(null),u=lt(e,c),[h,m]=S.useState(!1),[f,l]=S.useState("");return S.useEffect(()=>{const p=c.current;p&&l((p.textContent??"").trim())},[s.children]),d.jsx(gn.ItemSlot,{scope:n,disabled:a,textValue:r??f,children:d.jsx($d,{asChild:!0,...o,focusable:!a,children:d.jsx(We.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:u,onPointerMove:Ie(t.onPointerMove,vn(p=>{a?i.onItemLeave(p):(i.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(t.onPointerLeave,vn(p=>i.onItemLeave(p))),onFocus:Ie(t.onFocus,()=>m(!0)),onBlur:Ie(t.onBlur,()=>m(!1))})})})}),Ox="MenuCheckboxItem",nf=S.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:a,...r}=t;return d.jsx(cf,{scope:t.__scopeMenu,checked:n,children:d.jsx(Pa,{role:"menuitemcheckbox","aria-checked":sa(n)?"mixed":n,...r,ref:e,"data-state":vi(n),onSelect:Ie(r.onSelect,()=>a==null?void 0:a(sa(n)?!0:!n),{checkForDefaultPrevented:!1})})})});nf.displayName=Ox;var af="MenuRadioGroup",[kx,Mx]=Tr(af,{value:void 0,onValueChange:()=>{}}),sf=S.forwardRef((t,e)=>{const{value:n,onValueChange:a,...r}=t,s=er(a);return d.jsx(kx,{scope:t.__scopeMenu,value:n,onValueChange:s,children:d.jsx(pi,{...r,ref:e})})});sf.displayName=af;var of="MenuRadioItem",lf=S.forwardRef((t,e)=>{const{value:n,...a}=t,r=Mx(of,t.__scopeMenu),s=n===r.value;return d.jsx(cf,{scope:t.__scopeMenu,checked:s,children:d.jsx(Pa,{role:"menuitemradio","aria-checked":s,...a,ref:e,"data-state":vi(s),onSelect:Ie(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});lf.displayName=of;var gi="MenuItemIndicator",[cf,Dx]=Tr(gi,{checked:!1}),uf=S.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:a,...r}=t,s=Dx(gi,n);return d.jsx(jr,{present:a||sa(s.checked)||s.checked===!0,children:d.jsx(We.span,{...r,ref:e,"data-state":vi(s.checked)})})});uf.displayName=gi;var Fx="MenuSeparator",df=S.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return d.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...a,ref:e})});df.displayName=Fx;var $x="MenuArrow",ff=S.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t,r=Ea(n);return d.jsx(xy,{...r,...a,ref:e})});ff.displayName=$x;var Lx="MenuSub",[jb,hf]=Tr(Lx),sn="MenuSubTrigger",mf=S.forwardRef((t,e)=>{const n=Or(sn,t.__scopeMenu),a=Rn(sn,t.__scopeMenu),r=hf(sn,t.__scopeMenu),s=hi(sn,t.__scopeMenu),i=S.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=s,u={__scopeMenu:t.__scopeMenu},h=S.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return S.useEffect(()=>h,[h]),S.useEffect(()=>{const m=o.current;return()=>{window.clearTimeout(m),c(null)}},[o,c]),d.jsx(di,{asChild:!0,...u,children:d.jsx(rf,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":vf(n.open),...t,ref:ga(e,r.onTriggerChange),onClick:m=>{var f;(f=t.onClick)==null||f.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(t.onPointerMove,vn(m=>{s.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ie(t.onPointerLeave,vn(m=>{var l,p;h();const f=(l=n.content)==null?void 0:l.getBoundingClientRect();if(f){const g=(p=n.content)==null?void 0:p.dataset.side,v=g==="right",y=v?-5:5,_=f[v?"left":"right"],x=f[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:m.clientX+y,y:m.clientY},{x:_,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:_,y:f.bottom}],side:g}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(m),m.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(t.onKeyDown,m=>{var l;const f=s.searchRef.current!=="";t.disabled||f&&m.key===" "||xx[a.dir].includes(m.key)&&(n.onOpenChange(!0),(l=n.content)==null||l.focus(),m.preventDefault())})})})});mf.displayName=sn;var pf="MenuSubContent",gf=S.forwardRef((t,e)=>{const n=Xd(xt,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,s=Or(xt,t.__scopeMenu),i=Rn(xt,t.__scopeMenu),o=hf(pf,t.__scopeMenu),c=S.useRef(null),u=lt(e,c);return d.jsx(gn.Provider,{scope:t.__scopeMenu,children:d.jsx(jr,{present:a||s.open,children:d.jsx(gn.Slot,{scope:t.__scopeMenu,children:d.jsx(mi,{id:o.contentId,"aria-labelledby":o.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;i.isUsingKeyboardRef.current&&((m=c.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ie(t.onFocusOutside,h=>{h.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ie(t.onEscapeKeyDown,h=>{i.onClose(),h.preventDefault()}),onKeyDown:Ie(t.onKeyDown,h=>{var l;const m=h.currentTarget.contains(h.target),f=wx[i.dir].includes(h.key);m&&f&&(s.onOpenChange(!1),(l=o.trigger)==null||l.focus(),h.preventDefault())})})})})})});gf.displayName=pf;function vf(t){return t?"open":"closed"}function sa(t){return t==="indeterminate"}function vi(t){return sa(t)?"indeterminate":t?"checked":"unchecked"}function Vx(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function zx(t,e){return t.map((n,a)=>t[(e+a)%t.length])}function qx(t,e,n){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=zx(t,Math.max(s,0));r.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function Ux(t,e){const{x:n,y:a}=t;let r=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const o=e[s],c=e[i],u=o.x,h=o.y,m=c.x,f=c.y;h>a!=f>a&&n<(m-u)*(a-h)/(f-h)+u&&(r=!r)}return r}function Hx(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ux(n,e)}function vn(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Gx=Jd,Bx=di,Kx=Yd,Wx=ef,Zx=pi,Qx=tf,Jx=Pa,Xx=nf,Yx=sf,e0=lf,t0=uf,r0=df,n0=ff,a0=mf,s0=gf,Ia="DropdownMenu",[o0]=Nr(Ia,[Zd]),dt=Zd(),[i0,yf]=o0(Ia),xf=t=>{const{__scopeDropdownMenu:e,children:n,dir:a,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,c=dt(e),u=S.useRef(null),[h,m]=va({prop:r,defaultProp:s??!1,onChange:i,caller:Ia});return d.jsx(i0,{scope:e,triggerId:Yn(),triggerRef:u,contentId:Yn(),open:h,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(f=>!f),[m]),modal:o,children:d.jsx(Gx,{...c,open:h,onOpenChange:m,dir:a,modal:o,children:n})})};xf.displayName=Ia;var wf="DropdownMenuTrigger",_f=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=t,s=yf(wf,n),i=dt(n);return d.jsx(Bx,{asChild:!0,...i,children:d.jsx(We.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":a?"":void 0,disabled:a,...r,ref:ga(e,s.triggerRef),onPointerDown:Ie(t.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:Ie(t.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});_f.displayName=wf;var l0="DropdownMenuPortal",Sf=t=>{const{__scopeDropdownMenu:e,...n}=t,a=dt(e);return d.jsx(Kx,{...a,...n})};Sf.displayName=l0;var bf="DropdownMenuContent",Cf=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=yf(bf,n),s=dt(n),i=S.useRef(!1);return d.jsx(Wx,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...a,ref:e,onCloseAutoFocus:Ie(t.onCloseAutoFocus,o=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:Ie(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,h=c.button===2||u;(!r.modal||h)&&(i.current=!0)}),style:{...t.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)"}})});Cf.displayName=bf;var c0="DropdownMenuGroup",u0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(Zx,{...r,...a,ref:e})});u0.displayName=c0;var d0="DropdownMenuLabel",f0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(Qx,{...r,...a,ref:e})});f0.displayName=d0;var h0="DropdownMenuItem",m0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(Jx,{...r,...a,ref:e})});m0.displayName=h0;var p0="DropdownMenuCheckboxItem",Rf=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(Xx,{...r,...a,ref:e})});Rf.displayName=p0;var g0="DropdownMenuRadioGroup",v0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(Yx,{...r,...a,ref:e})});v0.displayName=g0;var y0="DropdownMenuRadioItem",x0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(e0,{...r,...a,ref:e})});x0.displayName=y0;var w0="DropdownMenuItemIndicator",Ef=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(t0,{...r,...a,ref:e})});Ef.displayName=w0;var _0="DropdownMenuSeparator",S0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(r0,{...r,...a,ref:e})});S0.displayName=_0;var b0="DropdownMenuArrow",C0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(n0,{...r,...a,ref:e})});C0.displayName=b0;var R0="DropdownMenuSubTrigger",E0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(a0,{...r,...a,ref:e})});E0.displayName=R0;var P0="DropdownMenuSubContent",I0=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=dt(n);return d.jsx(s0,{...r,...a,ref:e,style:{...t.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)"}})});I0.displayName=P0;var A0=xf,N0=_f,j0=Sf,T0=Cf,O0=Rf,k0=Ef;function M0({...t}){return d.jsx(A0,{"data-slot":"dropdown-menu",...t})}function D0({...t}){return d.jsx(N0,{"data-slot":"dropdown-menu-trigger",...t})}function F0({className:t,sideOffset:e=4,...n}){return d.jsx(j0,{children:d.jsx(T0,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Ve("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",t),...n})})}function $0({className:t,children:e,checked:n,...a}){return d.jsxs(O0,{"data-slot":"dropdown-menu-checkbox-item",className:Ve("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",t),checked:n,...a,children:[d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(k0,{children:d.jsx(Vu,{className:"size-4"})})}),e]})}function yi({className:t,...e}){return d.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:d.jsx("table",{"data-slot":"table",className:Ve("w-full caption-bottom text-sm",t),...e})})}function L0({className:t,...e}){return d.jsx("thead",{"data-slot":"table-header",className:Ve("[&_tr]:border-b",t),...e})}function xi({className:t,...e}){return d.jsx("tbody",{"data-slot":"table-body",className:Ve("[&_tr:last-child]:border-0",t),...e})}function at({className:t,...e}){return d.jsx("tr",{"data-slot":"table-row",className:Ve("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...e})}function V0({className:t,...e}){return d.jsx("th",{"data-slot":"table-head",className:Ve("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function ue({className:t,...e}){return d.jsx("td",{"data-slot":"table-cell",className:Ve("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function yn({columns:t,data:e,searchColumn:n,searchPlaceholder:a="Filter...",defaultColumnVisibility:r={},pageSize:s=25,defaultSorting:i=[]}){var v,y;const[o,c]=S.useState(i),[u,h]=S.useState([]),[m,f]=S.useState(r),[l,p]=S.useState({}),g=jg({data:e,columns:t,onSortingChange:c,onColumnFiltersChange:h,getCoreRowModel:wg(),getPaginationRowModel:Eg(),getSortedRowModel:Pg(),getFilteredRowModel:Rg(),onColumnVisibilityChange:f,onRowSelectionChange:p,initialState:{pagination:{pageSize:s}},state:{sorting:o,columnFilters:u,columnVisibility:m,rowSelection:l}});return d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center py-4",children:[n&&d.jsx(po,{placeholder:a,value:((v=g.getColumn(n))==null?void 0:v.getFilterValue())??"",onChange:_=>{var x;return(x=g.getColumn(n))==null?void 0:x.setFilterValue(_.target.value)},className:"max-w-sm"}),d.jsxs(M0,{children:[d.jsx(D0,{asChild:!0,children:d.jsxs(br,{variant:"outline",className:"ml-auto",children:["Columns ",d.jsx(zu,{className:"ml-2 h-4 w-4"})]})}),d.jsx(F0,{align:"end",children:g.getAllColumns().filter(_=>_.getCanHide()).map(_=>d.jsx($0,{className:"capitalize",checked:_.getIsVisible(),onCheckedChange:x=>_.toggleVisibility(!!x),children:_.id},_.id))})]})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(yi,{children:[d.jsx(L0,{children:g.getHeaderGroups().map(_=>d.jsx(at,{children:_.headers.map(x=>d.jsx(V0,{children:x.isPlaceholder?null:dl(x.column.columnDef.header,x.getContext())},x.id))},_.id))}),d.jsx(xi,{children:(y=g.getRowModel().rows)!=null&&y.length?g.getRowModel().rows.map(_=>d.jsx(at,{"data-state":_.getIsSelected()&&"selected",children:_.getVisibleCells().map(x=>d.jsx(ue,{children:dl(x.column.columnDef.cell,x.getContext())},x.id))},_.id)):d.jsx(at,{children:d.jsx(ue,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})})]})}),d.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[d.jsxs("div",{className:"text-muted-foreground flex-1 text-sm",children:[g.getFilteredRowModel().rows.length," row(s) total."]}),d.jsxs("div",{className:"space-x-2",children:[d.jsx(br,{variant:"outline",size:"sm",onClick:()=>g.previousPage(),disabled:!g.getCanPreviousPage(),children:"Previous"}),d.jsx(br,{variant:"outline",size:"sm",onClick:()=>g.nextPage(),disabled:!g.getCanNextPage(),children:"Next"})]})]})]})}function Te(t,e="left"){return({column:n})=>{const a=e==="right"?"justify-end":e==="center"?"justify-center":"justify-start",r=n.getIsSorted();return d.jsx("div",{className:`flex ${a}`,children:d.jsxs(br,{variant:"ghost",onClick:()=>n.toggleSorting(n.getIsSorted()==="asc"),className:`${e==="right"?"ml-auto":""} hover:bg-muted/50 h-auto p-0 font-medium text-sm`,children:[t,r==="asc"&&d.jsx(up,{className:"ml-1 h-3 w-3 text-muted-foreground"}),r==="desc"&&d.jsx(zu,{className:"ml-1 h-3 w-3 text-muted-foreground"})]})})}}const z0=300*1e3;function Pf(t){const[e,n]=S.useState(new Map),a=S.useRef();return S.useEffect(()=>{const s=new Date().toISOString(),i=new Set(t.map(o=>o.id));n(o=>{const c=new Map(o);return t.forEach(u=>{c.set(u.id,{...u,lastSeenAt:s,disconnectedAt:void 0})}),c.forEach((u,h)=>{!i.has(h)&&!u.disconnectedAt&&c.set(h,{...u,isConnected:!1,connectionStatus:"Disconnected",disconnectedAt:s,lastActivity:u.lastActivity||s})}),c})},[t]),S.useEffect(()=>{const s=()=>{const i=Date.now();n(o=>{const c=new Map(o);return c.forEach((u,h)=>{if(u.disconnectedAt){const m=new Date(u.disconnectedAt).getTime();i-m>z0&&c.delete(h)}}),c})};return s(),a.current=setInterval(s,3e4),()=>{a.current&&clearInterval(a.current)}},[]),Array.from(e.values()).sort((s,i)=>s.isConnected!==i.isConnected?s.isConnected?-1:1:new Date(i.lastActivity).getTime()-new Date(s.lastActivity).getTime())}function Dl(t){const e=new Date,n=new Date(t),a=e.getTime()-n.getTime(),r=Math.floor(a/1e3);if(r<60)return"just now";const s=Math.floor(r/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 q0(t){const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60);return e>0?`${e}d ${n}h ${a}m`:n>0?`${n}h ${a}m`:`${a}m`}function U0(t){return t.length<=12?t:`${t.slice(0,5)}...${t.slice(-5)}`}function H0(t){return t.length<=42?t:`${t.slice(0,35)}.....${t.slice(-5)}`}function G0({metrics:t}){const e=t.sessions||[],n=Pf(e),a=()=>[{accessorKey:"clientInfo",header:Te("Client"),cell:({row:r})=>{const s=r.original,i=s.clientInfo?`${H0(s.clientInfo.name)}@${s.clientInfo.version}`:"unknown";return d.jsx("div",{className:"font-mono text-sm",title:s.clientInfo?`${s.clientInfo.name}@${s.clientInfo.version}`:"unknown",children:i})}},{accessorKey:"id",header:Te("Session ID"),cell:({row:r})=>d.jsx("div",{className:"font-mono text-sm",title:r.getValue("id"),children:U0(r.getValue("id"))})},{accessorKey:"isConnected",header:Te("Status"),cell:({row:r})=>{const s=r.original;return d.jsxs(Kt,{variant:s.isConnected?"success":"secondary",className:"gap-1",children:[s.isConnected?d.jsx(Gu,{className:"h-3 w-3"}):d.jsx(Hu,{className:"h-3 w-3"}),s.isConnected?"Connected":"Disconnected"]})}},{accessorKey:"connectedAt",header:Te("Connected"),cell:({row:r})=>d.jsx("div",{className:"text-sm",children:Dl(r.getValue("connectedAt"))})},{accessorKey:"requestCount",header:Te("Requests","right"),cell:({row:r})=>d.jsx("div",{className:"text-right font-mono text-sm",children:r.getValue("requestCount")})},{accessorKey:"lastActivity",header:Te("Last Activity"),cell:({row:r})=>d.jsx("div",{className:"text-sm",children:Dl(r.getValue("lastActivity"))})}];return d.jsxs(Qt,{children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:"📊 Transport Metrics"}),d.jsx(Ar,{children:"Real-time connection and performance metrics for STDIO transport"})]}),d.jsxs(Yt,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),d.jsx("p",{className:"text-sm font-mono",children:"STDIO"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),d.jsx("p",{className:"text-sm font-mono",children:q0(t.uptimeSeconds)})]})]}),d.jsxs(d.Fragment,{children:[d.jsx(dr,{}),d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3",children:["Sessions (",n.filter(r=>r.isConnected).length," active,"," ",n.filter(r=>!r.isConnected).length," disconnected)"]}),d.jsx(yn,{columns:a(),data:n,searchColumn:"id",searchPlaceholder:"Filter sessions...",pageSize:10,defaultSorting:[{id:"lastActivity",desc:!0}]})]})]})]})]})}function Bn(t){const e=new Date,n=new Date(t),a=e.getTime()-n.getTime(),r=Math.floor(a/1e3);if(r<60)return"just now";const s=Math.floor(r/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 B0(t){const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60);return e>0?`${e}d ${n}h ${a}m`:n>0?`${n}h ${a}m`:`${a}m`}function Kn(t){return t<1e3?`${t}ms`:t<6e4?`${Math.round(t/1e3)}s`:`${Math.round(t/6e4)}m`}function K0(t){return t.length<=12?t:`${t.slice(0,5)}...${t.slice(-5)}`}function Fl(t){return t.length<=42?t:`${t.slice(0,35)}.....${t.slice(-5)}`}function W0(t){const e=new Date,n=new Date(t),a=e.getTime()-n.getTime();return Math.floor(a/6e4)<5}function Z0({metrics:t}){const e=t.sessions||[],n=Pf(e),a={sse:"Server-Sent Events",streamableHttp:"Streamable HTTP"},r=()=>[{accessorKey:"clientInfo",header:Te("Client"),cell:({row:o})=>{const c=o.original,u=c.clientInfo?`${Fl(c.clientInfo.name)}@${c.clientInfo.version}`:"unknown";return d.jsx("div",{className:"font-mono text-sm",title:c.clientInfo?`${c.clientInfo.name}@${c.clientInfo.version}`:"unknown",children:u})}},{accessorKey:"id",header:Te("Session ID"),cell:({row:o})=>d.jsx("div",{className:"font-mono text-sm",title:o.getValue("id"),children:K0(o.getValue("id"))})},{accessorKey:"connectionStatus",header:Te("Status"),cell:({row:o})=>{const c=o.original,u=c.connectionStatus||(c.isConnected?"Connected":"Disconnected");return u==="Connected"?d.jsxs(Kt,{variant:"success",className:"gap-1",children:[d.jsx(Gu,{className:"h-3 w-3"}),"Connected"]}):u==="Distressed"?d.jsxs(Kt,{variant:"destructive",className:"gap-1",children:[d.jsx(Uu,{className:"h-3 w-3"}),"Distressed ",c.pingFailures?`(${c.pingFailures} failed)`:""]}):d.jsxs(Kt,{variant:"secondary",className:"gap-1",children:[d.jsx(Hu,{className:"h-3 w-3"}),"Disconnected"]})}},{accessorKey:"connectedAt",header:Te("Connected"),cell:({row:o})=>d.jsx("div",{className:"text-sm",children:Bn(o.getValue("connectedAt"))})},{accessorKey:"requestCount",header:Te("Requests","right"),cell:({row:o})=>d.jsx("div",{className:"text-right font-mono text-sm",children:o.getValue("requestCount")})},{accessorKey:"lastActivity",header:Te("Last Activity"),cell:({row:o})=>d.jsx("div",{className:"text-sm",children:Bn(o.getValue("lastActivity"))})},{accessorKey:"ipAddress",header:Te("IP Address"),cell:({row:o})=>d.jsx("div",{className:"font-mono text-sm",title:o.getValue("ipAddress")||"Unknown",children:o.getValue("ipAddress")||"-"})}],s=()=>[{accessorKey:"name",header:Te("Client"),cell:({row:o})=>{const c=o.original,u=`${Fl(c.name)}@${c.version}`;return d.jsxs("div",{children:[d.jsx("p",{className:"font-medium font-mono text-sm",title:`${c.name}@${c.version}`,children:u}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["First seen ",Bn(c.firstSeen)]})]})}},{accessorKey:"requestCount",header:Te("Initializations","right"),cell:({row:o})=>d.jsx("div",{className:"text-right font-mono text-sm",children:o.getValue("requestCount")})},{accessorKey:"toolCallCount",header:Te("Tool Calls","right"),cell:({row:o})=>d.jsx("div",{className:"text-right font-mono text-sm",children:o.getValue("toolCallCount")})},{accessorKey:"newIpCount",header:Te("New IPs","right"),cell:({row:o})=>d.jsx("div",{className:"text-right font-mono text-sm",children:o.getValue("newIpCount")})},{accessorKey:"anonCount",header:Te("Anon/Auth","right"),cell:({row:o})=>{const c=o.original;return d.jsxs("div",{className:"text-right font-mono text-sm",children:[c.anonCount,"/",c.uniqueAuthCount]})}},{accessorKey:"isConnected",header:Te("Status"),cell:({row:o})=>{const c=o.original;return d.jsx("div",{children:W0(c.lastSeen)?d.jsxs(Kt,{variant:"success",className:"gap-1",children:[d.jsx(Lu,{className:"h-3 w-3"}),"Recent"]}):d.jsxs(Kt,{variant:"secondary",className:"gap-1",children:[d.jsx(qu,{className:"h-3 w-3"}),"Idle"]})})}},{accessorKey:"lastSeen",header:Te("Last Seen","right"),cell:({row:o})=>d.jsx("div",{className:"text-right text-sm",children:Bn(o.getValue("lastSeen"))})}],i=t.clients;return d.jsxs(Qt,{children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:"📊 Transport Metrics"}),d.jsxs(Ar,{children:["Real-time connection and performance metrics for"," ",a[t.transport]||t.transport," transport"]})]}),d.jsxs(Yt,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),d.jsx("p",{className:"text-sm font-mono",children:a[t.transport]||t.transport})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),d.jsx("p",{className:"text-sm font-mono",children:B0(t.uptimeSeconds)})]})]}),t.configuration&&d.jsx(d.Fragment,{children:d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Configuration"}),d.jsx("div",{className:"grid grid-cols-1 gap-2",children:t.pings&&d.jsx("div",{className:"text-xs text-muted-foreground bg-muted/30 p-2 rounded",children:t.pings.sent>0&&d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Ping Status:"})," ",t.pings.successful,"/",t.pings.sent," successful (",t.pings.sent>0?Math.round(t.pings.successful/t.pings.sent*100):0,"%)"]})})}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["SSE connections checked every ",Kn(t.configuration.heartbeatInterval||3e4),", sessions swept every ",Kn(t.configuration.staleCheckInterval),", removed after"," ",Kn(t.configuration.staleTimeout)," inactive",t.configuration.pingEnabled&&t.configuration.pingInterval&&`, pings sent every ${Kn(t.configuration.pingInterval)}`,t.configuration.pingEnabled&&`, marked distressed after ${t.configuration.pingFailureThreshold||1} failed ping${(t.configuration.pingFailureThreshold||1)!==1?"s":""}`]})]})}),d.jsx(dr,{}),d.jsx("div",{children:d.jsx(yi,{children:d.jsxs(xi,{children:[d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Active Connections"}),d.jsx(ue,{className:"text-sm font-mono",children:t.connections.active}),d.jsx(ue,{className:"font-medium text-sm",children:"Cleaned Sessions"}),d.jsx(ue,{className:"text-sm font-mono",children:t.connections.cleaned??0})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Total Connections"}),d.jsx(ue,{className:"text-sm font-mono",children:t.connections.total}),d.jsx(ue,{className:"font-medium text-sm",children:"Requests per Minute (tot/3hr/hr)"}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.requests.averagePerMinute,"/",t.requests.last3Hours,"/",t.requests.lastHour]})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Unique IPs"}),d.jsx(ue,{className:"text-sm font-mono",children:t.connections.uniqueIps??0}),d.jsx(ue,{className:"font-medium text-sm",children:"Client/Server Errors (4xx/5xx)"}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.errors.expected,"/",t.errors.unexpected]})]}),t.sessionLifecycle&&d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Sessions New/Res-fail/Del"}),d.jsxs(ue,{className:"text-sm font-mono",colSpan:3,children:[t.sessionLifecycle.created,"/",t.sessionLifecycle.resumedFailed,"/",t.sessionLifecycle.deleted]})]}),t.pings&&d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Pings Sent"}),d.jsx(ue,{className:"text-sm font-mono",children:t.pings.sent}),d.jsx(ue,{className:"font-medium text-sm",children:"Ping Success Rate"}),d.jsx(ue,{className:"text-sm font-mono",children:t.pings.sent>0?`${Math.round(t.pings.successful/t.pings.sent*100)}%`:"-"})]}),t.apiMetrics&&d.jsxs(d.Fragment,{children:[d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Anonymous Users"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.anonymous}),d.jsx(ue,{className:"font-medium text-sm",children:"Authenticated Users"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.authenticated})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"401 Unauthorized Users"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.unauthorized}),d.jsx(ue,{className:"font-medium text-sm",children:"403 Forbidden Users"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.forbidden})]})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Gradio Success/Fail"}),d.jsx(ue,{className:"text-sm font-mono",children:t.gradioMetrics?`${t.gradioMetrics.success}/${t.gradioMetrics.failure}`:"0/0"}),d.jsx(ue,{className:"font-medium text-sm",children:"-"}),d.jsx(ue,{className:"text-sm font-mono",children:"-"})]})]})})}),d.jsxs(d.Fragment,{children:[d.jsx(dr,{}),d.jsxs("div",{children:[d.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)"]}),d.jsx(yn,{columns:r(),data:n,searchColumn:"id",searchPlaceholder:"Filter sessions...",pageSize:10,defaultSorting:[{id:"lastActivity",desc:!0}]})]})]}),d.jsxs(d.Fragment,{children:[d.jsx(dr,{}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"Client Identities"}),d.jsx(yn,{columns:s(),data:i,searchColumn:"name",searchPlaceholder:"Filter clients...",pageSize:50,defaultSorting:[{id:"lastSeen",desc:!0}]})]})]})]})]})}function $l(t){const e=new Date,n=new Date(t),a=e.getTime()-n.getTime(),r=Math.floor(a/1e3);if(r<60)return"just now";const s=Math.floor(r/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 Q0(t){const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60);return e>0?`${e}d ${n}h ${a}m`:n>0?`${n}h ${a}m`:`${a}m`}function J0(t){const e=new Date,n=new Date(t),a=e.getTime()-n.getTime();return Math.floor(a/6e4)<5}function X0(t){return t.length<=42?t:`${t.slice(0,35)}.....${t.slice(-5)}`}function Y0({metrics:t}){const e=t.clients,n=()=>[{accessorKey:"name",header:Te("Client"),cell:({row:a})=>{const r=a.original,s=`${X0(r.name)}@${r.version}`;return d.jsxs("div",{children:[d.jsx("p",{className:"font-medium font-mono text-sm",title:`${r.name}@${r.version}`,children:s}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["First seen ",$l(r.firstSeen)]})]})}},{accessorKey:"requestCount",header:Te("Initializations","right"),cell:({row:a})=>d.jsx("div",{className:"text-right font-mono text-sm",children:a.getValue("requestCount")})},{accessorKey:"toolCallCount",header:Te("Tool Calls","right"),cell:({row:a})=>d.jsx("div",{className:"text-right font-mono text-sm",children:a.getValue("toolCallCount")})},{accessorKey:"newIpCount",header:Te("New IPs","right"),cell:({row:a})=>d.jsx("div",{className:"text-right font-mono text-sm",children:a.getValue("newIpCount")})},{accessorKey:"anonCount",header:Te("Anon/Auth","right"),cell:({row:a})=>{const r=a.original;return d.jsxs("div",{className:"text-right font-mono text-sm",children:[r.anonCount,"/",r.uniqueAuthCount]})}},{accessorKey:"isConnected",header:Te("Status"),cell:({row:a})=>{const r=a.original;return d.jsx("div",{children:J0(r.lastSeen)?d.jsxs(Kt,{variant:"success",className:"gap-1",children:[d.jsx(Lu,{className:"h-3 w-3"}),"Recent"]}):d.jsxs(Kt,{variant:"secondary",className:"gap-1",children:[d.jsx(qu,{className:"h-3 w-3"}),"Idle"]})})}},{accessorKey:"lastSeen",header:Te("Last Seen","right"),cell:({row:a})=>d.jsx("div",{className:"text-right text-sm",children:$l(a.getValue("lastSeen"))})}];return d.jsxs(Qt,{children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:"📊 Transport Metrics"}),d.jsx(Ar,{children:"Real-time connection and performance metrics for Stateless HTTP JSON transport"})]}),d.jsxs(Yt,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("p",{className:"text-sm font-mono",children:"Stateless HTTP JSON"}),d.jsx(Kt,{variant:"secondary",children:t.sessionLifecycle?"analytics":"stateless"})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),d.jsx("p",{className:"text-sm font-mono",children:Q0(t.uptimeSeconds)})]})]}),d.jsx(dr,{}),d.jsx("div",{children:d.jsx(yi,{children:d.jsxs(xi,{children:[d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Request Count (MCP)"}),d.jsx(ue,{className:"text-sm font-mono",children:t.connections.total}),d.jsx(ue,{className:"font-medium text-sm",children:"Requests per Minute (tot/3hr/hr)"}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.requests.averagePerMinute,"/",t.requests.last3Hours,"/",t.requests.lastHour]})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Unique IPs"}),d.jsx(ue,{className:"text-sm font-mono",children:t.connections.uniqueIps??0}),d.jsx(ue,{className:"font-medium text-sm",children:"Client/Server Errors (4xx/5xx)"}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.errors.expected,"/",t.errors.unexpected]})]}),(t.staticPageHits200!==void 0||t.staticPageHits405!==void 0)&&d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(pp,{className:"h-3 w-3"}),"hf.co/mcp (200/405)"]})}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.staticPageHits200||0,"/",t.staticPageHits405||0]}),d.jsx(ue,{className:"font-medium text-sm",children:d.jsx("div",{className:"flex items-center gap-1",children:"Auth Status (Anon/Auth/401)"})}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.connections.anonymous,"/",t.connections.authenticated,"/",t.connections.unauthorized||0]})]}),t.apiMetrics&&d.jsxs(d.Fragment,{children:[d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Tool API - Anonymous"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.anonymous}),d.jsx(ue,{className:"font-medium text-sm",children:"Tool API - Authenticated"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.authenticated})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Tool API - 401 Unauthorized"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.unauthorized}),d.jsx(ue,{className:"font-medium text-sm",children:"Tool API - 403 Forbidden"}),d.jsx(ue,{className:"text-sm font-mono",children:t.apiMetrics.forbidden})]})]}),d.jsxs(at,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Gradio Success/Fail"}),d.jsx(ue,{className:"text-sm font-mono",children:t.gradioMetrics?`${t.gradioMetrics.success}/${t.gradioMetrics.failure}`:"0/0"}),t.sessionLifecycle?d.jsxs(d.Fragment,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"Sessions New/Res-fail/Del"}),d.jsxs(ue,{className:"text-sm font-mono",children:[t.sessionLifecycle.created,"/",t.sessionLifecycle.resumedFailed,"/",t.sessionLifecycle.deleted]})]}):d.jsxs(d.Fragment,{children:[d.jsx(ue,{className:"font-medium text-sm",children:"-"}),d.jsx(ue,{className:"text-sm font-mono",children:"-"})]})]})]})})}),d.jsxs(d.Fragment,{children:[d.jsx(dr,{}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"Client Identities"}),d.jsx(yn,{columns:n(),data:e,searchColumn:"name",searchPlaceholder:"Filter clients...",pageSize:50,defaultSorting:[{id:"lastSeen",desc:!0}]})]})]})]})]})}const ew=t=>fetch(t).then(e=>{if(!e.ok)throw new Error(`Failed to fetch: ${e.status}`);return e.json()});function tw(){const{data:t,error:e}=cn("/api/transport-metrics",ew,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0});return e?d.jsxs(Qt,{children:[d.jsx(Jt,{children:d.jsx(Xt,{children:"📊 Transport Metrics"})}),d.jsx(Yt,{children:d.jsxs(Pp,{variant:"destructive",children:[d.jsx(Uu,{className:"h-4 w-4"}),d.jsx(Ip,{children:"Error Loading Metrics"}),d.jsxs(Ap,{children:["Failed to load transport metrics: ",e.message]})]})})]}):t?t.transport==="stdio"?d.jsx(G0,{metrics:t}):t.isStateless?d.jsx(Y0,{metrics:t}):d.jsx(Z0,{metrics:t}):d.jsxs(Qt,{children:[d.jsx(Jt,{children:d.jsx(Xt,{children:"📊 Transport Metrics"})}),d.jsx(Yt,{children:d.jsxs("div",{className:"animate-pulse space-y-2",children:[d.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),d.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"}),d.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3"})]})})]})}const rw=t=>fetch(t).then(e=>{if(!e.ok)throw new Error(`Failed to fetch: ${e.status}`);return e.json()});function nw(){const[t,e]=S.useState(!1),{data:n,error:a}=cn("/api/transport-metrics",rw,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0}),r=!n&&!a,s=(n==null?void 0:n.transport)==="stdio",i=((n==null?void 0:n.methods)||[]).map(f=>{let l=f.errors,p,g;if(f.method.startsWith("tools/call:")&&(n!=null&&n.gradioMetrics)){const _=f.method.replace("tools/call:",""),x=n.gradioMetrics.byTool;x[_]&&(p=x[_].success,g=x[_].failure,l+=g)}const v=f.count>0?l/f.count*100:0;return{method:f.method,count:f.count,errors:l,errorRate:v,averageResponseTime:f.averageResponseTime,lastCalled:f.lastCalled,gradioSuccess:p,gradioFailure:g}}),o=t?i.filter(f=>f.method.startsWith("tools/call")||f.method.startsWith("prompts/get")):i,c=i.reduce((f,l)=>f+l.count,0),u=i.filter(f=>f.method.startsWith("tools/call")).reduce((f,l)=>f+l.count,0),h=i.filter(f=>f.method.startsWith("prompts/get")).reduce((f,l)=>f+l.count,0),m=[{accessorKey:"method",header:Te("Method"),cell:({row:f})=>{const l=f.getValue("method");return d.jsx("div",{className:"font-mono text-sm",children:l==="tools/call"?d.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"tools/call"}):l.startsWith("tools/call:")?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"tools/call:"}),d.jsx("span",{className:"text-green-600 dark:text-green-400",children:l.replace("tools/call:","")})]}):l==="prompts/get"?d.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"prompts/get"}):l.startsWith("prompts/get:")?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"prompts/get:"}),d.jsx("span",{className:"text-orange-600 dark:text-orange-400",children:l.replace("prompts/get:","")})]}):l})}},{accessorKey:"count",header:Te("Calls","right"),cell:({row:f})=>d.jsx("div",{className:"text-right font-mono",children:f.getValue("count").toLocaleString()})},{accessorKey:"errors",header:Te("Errors","right"),cell:({row:f})=>{const l=f.getValue("errors");return d.jsx("div",{className:"text-right font-mono",children:l>0?d.jsx("span",{className:"text-red-600 dark:text-red-400",children:l}):"0"})}},{accessorKey:"gradioMetrics",header:Te("Success/Failure","right"),cell:({row:f})=>{const l=f.original;return l.gradioSuccess!==void 0&&l.gradioFailure!==void 0?d.jsxs("div",{className:"text-right font-mono text-sm",children:[d.jsx("span",{className:"text-green-600 dark:text-green-400",children:l.gradioSuccess}),d.jsx("span",{className:"text-muted-foreground",children:"/"}),d.jsx("span",{className:"text-red-600 dark:text-red-400",children:l.gradioFailure})]}):d.jsx("div",{className:"text-right text-muted-foreground",children:"—"})}},{accessorKey:"errorRate",header:Te("Error Rate","right"),cell:({row:f})=>{const l=f.getValue("errorRate");return d.jsx("div",{className:"text-right font-mono",children:l>0?d.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[l.toFixed(1),"%"]}):"0%"})}},{accessorKey:"averageResponseTime",header:Te("Avg Response","right"),cell:({row:f})=>{const l=f.getValue("averageResponseTime");return d.jsx("div",{className:"text-right font-mono",children:l?`${l.toFixed(0)}ms`:"—"})}},{accessorKey:"lastCalled",header:Te("Last Called","right"),cell:({row:f})=>d.jsx("div",{className:"text-right text-sm text-muted-foreground",children:new Date(f.getValue("lastCalled")).toLocaleTimeString()})}];return d.jsxs(Qt,{children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:"HTTP JSON Transport Statistics"}),d.jsxs(Ar,{children:["MCP method call statistics and performance metrics",s?" (Empty in STDIO mode)":n!=null&&n.isStateless?"":" (Response times not available in stateful modes)"]})]}),d.jsxs(Yt,{children:[r&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading metrics..."})}),a&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsxs("div",{className:"text-sm text-destructive",children:["Error loading metrics: ",a.message]})}),s&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.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&&d.jsxs("div",{className:"space-y-4",children:[i.length>0&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",o.length," method",o.length!==1?"s":""," tracked since"," ",new Date(n.startupTime).toLocaleString()]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"text-sm font-medium",children:["Total MCP Calls: ",d.jsx("span",{className:"font-mono",children:c.toLocaleString()})]}),d.jsxs("div",{className:"text-sm font-medium",children:["Tool Calls: ",d.jsx("span",{className:"font-mono",children:u.toLocaleString()})]}),d.jsxs("div",{className:"text-sm font-medium",children:["Prompt Calls: ",d.jsx("span",{className:"font-mono",children:h.toLocaleString()})]})]})]}),i.length>0&&d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(Qo,{id:"tool-prompt-calls-filter",checked:t,onCheckedChange:f=>e(!!f)}),d.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"})]}),o.length===0?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx("div",{className:"text-sm text-muted-foreground",children:t?"No tool or prompt calls recorded yet.":"No method calls recorded yet."})}):d.jsx(yn,{columns:m,data:o,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 Ll(t){return t.transport==="stdio"?t.defaultHfTokenSet&&t.hfTokenMasked?{text:t.hfTokenMasked,isWarning:!1}:{text:"Warning: No token set",isWarning:!0}:t.defaultHfTokenSet?{text:`⚠️ Using ${t.hfTokenMasked||"token"} as default`,isWarning:!0}:{text:"Using Authorization Headers",isWarning:!1}}function aw({isLoading:t,error:e,transportInfo:n}){const a=()=>{switch(n.transport){case"stdio":return"STDIO";case"sse":return"SSE";case"streamableHttp":case"streamableHttpJson":return"Streamable HTTP";default:return"Unknown"}},r=()=>{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()?d.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"?d.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"?d.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(t)return d.jsx("div",{className:"text-center text-xs text-muted-foreground py-2",children:"Loading connection information..."});if(e)return d.jsxs("div",{className:"text-center text-xs text-destructive py-2",children:["Error: ",e]});const o=n.port||3e3,c=n.transport!=="stdio";return d.jsx("div",{className:"fixed bottom-0 left-0 w-full bg-muted/50 border-t border-border py-2 px-4",children:d.jsxs("div",{className:"max-w-[700px] mx-auto flex justify-between items-center text-xs",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-muted-foreground",children:"Using"}),d.jsx("span",{className:"font-medium text-primary",children:a()}),n.transport==="stdio"&&d.jsxs("span",{className:"text-muted-foreground flex items-center",children:["Client Info :",n.stdioClient?d.jsx("span",{className:"ml-2 flex items-center",children:d.jsxs("span",{className:"ml-1 font-medium text-green-700",children:[n.stdioClient.name," ",n.stdioClient.version]})}):d.jsx("span",{className:"ml-2 text-muted-foreground",children:" (disconnected) "})]}),c&&d.jsxs("span",{className:"text-muted-foreground flex items-center",children:["on port ",d.jsx("span",{className:"font-mono mx-1",children:o}),"at ",d.jsx("span",{className:"font-mono mx-1",children:r()}),i()]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-muted-foreground",children:" Default HF Token:"}),d.jsx("span",{className:`font-mono ${Ll(n).isWarning?"text-red-500":""}`,children:Ll(n).text})]})]})})}var Aa="Tabs",[sw]=Nr(Aa,[Ca]),If=Ca(),[ow,wi]=sw(Aa),Af=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:o,activationMode:c="automatic",...u}=t,h=ri(o),[m,f]=va({prop:a,onChange:r,defaultProp:s??"",caller:Aa});return d.jsx(ow,{scope:n,baseId:Yn(),value:m,onValueChange:f,orientation:i,dir:h,activationMode:c,children:d.jsx(We.div,{dir:h,"data-orientation":i,...u,ref:e})})});Af.displayName=Aa;var Nf="TabsList",jf=S.forwardRef((t,e)=>{const{__scopeTabs:n,loop:a=!0,...r}=t,s=wi(Nf,n),i=If(n);return d.jsx(Fd,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:a,children:d.jsx(We.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});jf.displayName=Nf;var Tf="TabsTrigger",Of=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...s}=t,i=wi(Tf,n),o=If(n),c=Df(i.baseId,a),u=Ff(i.baseId,a),h=a===i.value;return d.jsx($d,{asChild:!0,...o,focusable:!r,active:h,children:d.jsx(We.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...s,ref:e,onMouseDown:Ie(t.onMouseDown,m=>{!r&&m.button===0&&m.ctrlKey===!1?i.onValueChange(a):m.preventDefault()}),onKeyDown:Ie(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&i.onValueChange(a)}),onFocus:Ie(t.onFocus,()=>{const m=i.activationMode!=="manual";!h&&!r&&m&&i.onValueChange(a)})})})});Of.displayName=Tf;var kf="TabsContent",Mf=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:a,forceMount:r,children:s,...i}=t,o=wi(kf,n),c=Df(o.baseId,a),u=Ff(o.baseId,a),h=a===o.value,m=S.useRef(h);return S.useEffect(()=>{const f=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(f)},[]),d.jsx(jr,{present:r||h,children:({present:f})=>d.jsx(We.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...i,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:f&&s})})});Mf.displayName=kf;function Df(t,e){return`${t}-trigger-${e}`}function Ff(t,e){return`${t}-content-${e}`}var iw=Af,lw=jf,cw=Of,uw=Mf;function dw({className:t,...e}){return d.jsx(iw,{"data-slot":"tabs",className:Ve("flex flex-col gap-2",t),...e})}function fw({className:t,...e}){return d.jsx(lw,{"data-slot":"tabs-list",className:Ve("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...e})}function Vr({className:t,...e}){return d.jsx(cw,{"data-slot":"tabs-trigger",className:Ve("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",t),...e})}function zr({className:t,...e}){return d.jsx(uw,{"data-slot":"tabs-content",className:Ve("flex-1 outline-none",t),...e})}const Vl="ALLOW_README_INCLUDE",zl="NO_GRADIO_IMAGE_CONTENT";var ke;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const s={};for(const i of r)s[i]=i;return s},t.getValidEnumValues=r=>{const s=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of s)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(s){return r[s]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&s.push(i);return s},t.find=(r,s)=>{for(const i of r)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function a(r,s=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=a,t.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(ke||(ke={}));var ql;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ql||(ql={}));const se=ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ir=t=>{switch(typeof t){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(t)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(t)?se.array:t===null?se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?se.promise:typeof Map<"u"&&t instanceof Map?se.map:typeof Set<"u"&&t instanceof Set?se.set:typeof Date<"u"&&t instanceof Date?se.date:se.object;default:return se.unknown}},Q=ke.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 nr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},a={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)a._errors.push(n(i));else{let o=a,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return r(this),a}static assert(e){if(!(e instanceof nr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ke.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];n[s]=n[s]||[],n[s].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}nr.create=t=>new nr(t);const Io=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ke.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${ke.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ke.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${ke.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ke.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,ke.assertNever(t)}return{message:n}};let hw=Io;function mw(){return hw}const pw=t=>{const{data:e,path:n,errorMaps:a,issueData:r}=t,s=[...n,...r.path||[]],i={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let o="";const c=a.filter(u=>!!u).slice().reverse();for(const u of c)o=u(i,{data:e,defaultError:o}).message;return{...r,path:s,message:o}};function Y(t,e){const n=mw(),a=pw({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Io?void 0:Io].filter(r=>!!r)});t.common.issues.push(a)}class ut{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const r of n){if(r.status==="aborted")return xe;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const r of n){const s=await r.key,i=await r.value;a.push({key:s,value:i})}return ut.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const r of n){const{key:s,value:i}=r;if(s.status==="aborted"||i.status==="aborted")return xe;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(a[s.value]=i.value)}return{status:e.value,value:a}}}const xe=Object.freeze({status:"aborted"}),on=t=>({status:"dirty",value:t}),wt=t=>({status:"valid",value:t}),Ul=t=>t.status==="aborted",Hl=t=>t.status==="dirty",Br=t=>t.status==="valid",oa=t=>typeof Promise<"u"&&t instanceof Promise;var le;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(le||(le={}));class $t{constructor(e,n,a,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,this._key=r}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 Gl=(t,e)=>{if(Br(e))return{success:!0,data:e.value};if(!t.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 nr(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:r}=t;if(e&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??a??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:r}}class Ne{get description(){return this._def.description}_getType(e){return ir(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ut,ctx:{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(oa(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){const a={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:e,parsedType:ir(e)},r=this._parseSync({data:e,path:a.path,parent:a});return Gl(a,r)}"~validate"(e){var a,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Br(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(r=(a=s==null?void 0:s.message)==null?void 0:a.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Br(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={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:e,parsedType:ir(e)},r=this._parse({data:e,path:a.path,parent:a}),s=await(oa(r)?r:Promise.resolve(r));return Gl(a,s)}refine(e,n){const a=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{const i=e(r),o=()=>s.addIssue({code:Q.custom,...a(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,n){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof n=="function"?n(a,r):n),!1))}_refinement(e){return new Pr({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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 Zt.create(this,this._def)}nullable(){return Ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this)}promise(){return fa.create(this,this._def)}or(e){return la.create([this,e],this._def)}and(e){return ca.create(this,e,this._def)}transform(e){return new Pr({...Ee(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ha({...Ee(this._def),innerType:this,defaultValue:n,typeName:we.ZodDefault})}brand(){return new zf({typeName:we.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ma({...Ee(this._def),innerType:this,catchValue:n,typeName:we.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Si.create(this,e)}readonly(){return pa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const gw=/^c[^\s-]{8,}$/i,vw=/^[0-9a-z]+$/,yw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xw=/^[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,ww=/^[a-z0-9_-]{21}$/i,_w=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Sw=/^[-+]?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)?)??$/,bw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cs;const Rw=/^(?:(?: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])$/,Ew=/^(?:(?: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])$/,Pw=/^(([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]))$/,Iw=/^(([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])$/,Aw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$f="((\\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])))",jw=new RegExp(`^${$f}$`);function Lf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Tw(t){return new RegExp(`^${Lf(t)}$`)}function Ow(t){let e=`${$f}T${Lf(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function kw(t,e){return!!((e==="v4"||!e)&&Rw.test(t)||(e==="v6"||!e)&&Pw.test(t))}function Mw(t,e){if(!_w.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Dw(t,e){return!!((e==="v4"||!e)&&Ew.test(t)||(e==="v6"||!e)&&Iw.test(t))}class Wt extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const s=this._getOrReturnCtx(e);return Y(s,{code:Q.invalid_type,expected:se.string,received:s.parsedType}),xe}const a=new ut;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?Y(r,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&Y(r,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")bw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"email",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")cs||(cs=new RegExp(Cw,"u")),cs.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"emoji",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")xw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"uuid",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")ww.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"nanoid",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")gw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"cuid",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")vw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"cuid2",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")yw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"ulid",code:Q.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Y(r,{validation:"url",code:Q.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"regex",code:Q.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?Ow(s).test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?jw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?Tw(s).test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?Sw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"duration",code:Q.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?kw(e.data,s.version)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"ip",code:Q.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?Mw(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"jwt",code:Q.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?Dw(e.data,s.version)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"cidr",code:Q.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?Aw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"base64",code:Q.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?Nw.test(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{validation:"base64url",code:Q.invalid_string,message:s.message}),a.dirty()):ke.assertNever(s);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(r=>e.test(r),{validation:n,code:Q.invalid_string,...le.errToObj(a)})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...le.errToObj(e)})}url(e){return this._addCheck({kind:"url",...le.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...le.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...le.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...le.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...le.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...le.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...le.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...le.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...le.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...le.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...le.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...le.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...le.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...le.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...le.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...le.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...le.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...le.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...le.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...le.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...le.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...le.errToObj(n)})}nonempty(e){return this.min(1,le.errToObj(e))}trim(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Wt.create=t=>new Wt({checks:[],typeName:we.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ee(t)});function Fw(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=n>a?n:a,s=Number.parseInt(t.toFixed(r).replace(".","")),i=Number.parseInt(e.toFixed(r).replace(".",""));return s%i/10**r}class Kr extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==se.number){const s=this._getOrReturnCtx(e);return Y(s,{code:Q.invalid_type,expected:se.number,received:s.parsedType}),xe}let a;const r=new ut;for(const s of this._def.checks)s.kind==="int"?ke.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?Fw(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.not_finite,message:s.message}),r.dirty()):ke.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,le.toString(n))}gt(e,n){return this.setLimit("min",e,!1,le.toString(n))}lte(e,n){return this.setLimit("max",e,!0,le.toString(n))}lt(e,n){return this.setLimit("max",e,!1,le.toString(n))}setLimit(e,n,a,r){return new Kr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:le.toString(r)}]})}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:le.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:le.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:le.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:le.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:le.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:le.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ke.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Kr.create=t=>new Kr({checks:[],typeName:we.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class xn extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==se.bigint)return this._getInvalidInput(e);let a;const r=new ut;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Y(a,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):ke.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Y(n,{code:Q.invalid_type,expected:se.bigint,received:n.parsedType}),xe}gte(e,n){return this.setLimit("min",e,!0,le.toString(n))}gt(e,n){return this.setLimit("min",e,!1,le.toString(n))}lte(e,n){return this.setLimit("max",e,!0,le.toString(n))}lt(e,n){return this.setLimit("max",e,!1,le.toString(n))}setLimit(e,n,a,r){return new xn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:le.toString(r)}]})}_addCheck(e){return new xn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:le.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:le.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}xn.create=t=>new xn({checks:[],typeName:we.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ee(t)});class Ao extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const a=this._getOrReturnCtx(e);return Y(a,{code:Q.invalid_type,expected:se.boolean,received:a.parsedType}),xe}return wt(e.data)}}Ao.create=t=>new Ao({typeName:we.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class ia extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const s=this._getOrReturnCtx(e);return Y(s,{code:Q.invalid_type,expected:se.date,received:s.parsedType}),xe}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Y(s,{code:Q.invalid_date}),xe}const a=new ut;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),Y(r,{code:Q.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):ke.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ia({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:le.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:le.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}ia.create=t=>new ia({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:we.ZodDate,...Ee(t)});class Bl extends Ne{_parse(e){if(this._getType(e)!==se.symbol){const a=this._getOrReturnCtx(e);return Y(a,{code:Q.invalid_type,expected:se.symbol,received:a.parsedType}),xe}return wt(e.data)}}Bl.create=t=>new Bl({typeName:we.ZodSymbol,...Ee(t)});class No extends Ne{_parse(e){if(this._getType(e)!==se.undefined){const a=this._getOrReturnCtx(e);return Y(a,{code:Q.invalid_type,expected:se.undefined,received:a.parsedType}),xe}return wt(e.data)}}No.create=t=>new No({typeName:we.ZodUndefined,...Ee(t)});class jo extends Ne{_parse(e){if(this._getType(e)!==se.null){const a=this._getOrReturnCtx(e);return Y(a,{code:Q.invalid_type,expected:se.null,received:a.parsedType}),xe}return wt(e.data)}}jo.create=t=>new jo({typeName:we.ZodNull,...Ee(t)});class To extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return wt(e.data)}}To.create=t=>new To({typeName:we.ZodAny,...Ee(t)});class Oo extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wt(e.data)}}Oo.create=t=>new Oo({typeName:we.ZodUnknown,...Ee(t)});class vr extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return Y(n,{code:Q.invalid_type,expected:se.never,received:n.parsedType}),xe}}vr.create=t=>new vr({typeName:we.ZodNever,...Ee(t)});class Kl extends Ne{_parse(e){if(this._getType(e)!==se.undefined){const a=this._getOrReturnCtx(e);return Y(a,{code:Q.invalid_type,expected:se.void,received:a.parsedType}),xe}return wt(e.data)}}Kl.create=t=>new Kl({typeName:we.ZodVoid,...Ee(t)});class Dt extends Ne{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),r=this._def;if(n.parsedType!==se.array)return Y(n,{code:Q.invalid_type,expected:se.array,received:n.parsedType}),xe;if(r.exactLength!==null){const i=n.data.length>r.exactLength.value,o=n.data.length<r.exactLength.value;(i||o)&&(Y(n,{code:i?Q.too_big:Q.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Y(n,{code:Q.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Y(n,{code:Q.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((i,o)=>r.type._parseAsync(new $t(n,i,n.path,o)))).then(i=>ut.mergeArray(a,i));const s=[...n.data].map((i,o)=>r.type._parseSync(new $t(n,i,n.path,o)));return ut.mergeArray(a,s)}get element(){return this._def.type}min(e,n){return new Dt({...this._def,minLength:{value:e,message:le.toString(n)}})}max(e,n){return new Dt({...this._def,maxLength:{value:e,message:le.toString(n)}})}length(e,n){return new Dt({...this._def,exactLength:{value:e,message:le.toString(n)}})}nonempty(e){return this.min(1,e)}}Dt.create=(t,e)=>new Dt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Ee(e)});function qr(t){if(t instanceof Xe){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=Zt.create(qr(a))}return new Xe({...t._def,shape:()=>e})}else return t instanceof Dt?new Dt({...t._def,type:qr(t.element)}):t instanceof Zt?Zt.create(qr(t.unwrap())):t instanceof Ir?Ir.create(qr(t.unwrap())):t instanceof Rr?Rr.create(t.items.map(e=>qr(e))):t}class Xe extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=ke.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==se.object){const u=this._getOrReturnCtx(e);return Y(u,{code:Q.invalid_type,expected:se.object,received:u.parsedType}),xe}const{status:a,ctx:r}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof vr&&this._def.unknownKeys==="strip"))for(const u in r.data)i.includes(u)||o.push(u);const c=[];for(const u of i){const h=s[u],m=r.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new $t(r,m,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof vr){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of o)c.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(u==="strict")o.length>0&&(Y(r,{code:Q.unrecognized_keys,keys:o}),a.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of o){const m=r.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new $t(r,m,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of c){const m=await h.key,f=await h.value;u.push({key:m,value:f,alwaysSet:h.alwaysSet})}return u}).then(u=>ut.mergeObjectSync(a,u)):ut.mergeObjectSync(a,c)}get shape(){return this._def.shape()}strict(e){return le.errToObj,new Xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var s,i;const r=((i=(s=this._def).errorMap)==null?void 0:i.call(s,n,a).message)??a.defaultError;return n.code==="unrecognized_keys"?{message:le.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Xe({...this._def,catchall:e})}pick(e){const n={};for(const a of ke.objectKeys(e))e[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new Xe({...this._def,shape:()=>n})}omit(e){const n={};for(const a of ke.objectKeys(this.shape))e[a]||(n[a]=this.shape[a]);return new Xe({...this._def,shape:()=>n})}deepPartial(){return qr(this)}partial(e){const n={};for(const a of ke.objectKeys(this.shape)){const r=this.shape[a];e&&!e[a]?n[a]=r:n[a]=r.optional()}return new Xe({...this._def,shape:()=>n})}required(e){const n={};for(const a of ke.objectKeys(this.shape))if(e&&!e[a])n[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof Zt;)s=s._def.innerType;n[a]=s}return new Xe({...this._def,shape:()=>n})}keyof(){return Vf(ke.objectKeys(this.shape))}}Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:vr.create(),typeName:we.ZodObject,...Ee(e)});Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:vr.create(),typeName:we.ZodObject,...Ee(e)});Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:vr.create(),typeName:we.ZodObject,...Ee(e)});class la extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function r(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new nr(o.ctx.common.issues));return Y(n,{code:Q.invalid_union,unionErrors:i}),xe}if(n.common.async)return Promise.all(a.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(r);{let s;const i=[];for(const c of a){const u={...n,common:{...n.common,issues:[]},parent:null},h=c._parseSync({data:n.data,path:n.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,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 o=i.map(c=>new nr(c));return Y(n,{code:Q.invalid_union,unionErrors:o}),xe}}get options(){return this._def.options}}la.create=(t,e)=>new la({options:t,typeName:we.ZodUnion,...Ee(e)});const Ht=t=>t instanceof Mo?Ht(t.schema):t instanceof Pr?Ht(t.innerType()):t instanceof da?[t.value]:t instanceof Er?t.options:t instanceof Do?ke.objectValues(t.enum):t instanceof ha?Ht(t._def.innerType):t instanceof No?[void 0]:t instanceof jo?[null]:t instanceof Zt?[void 0,...Ht(t.unwrap())]:t instanceof Ir?[null,...Ht(t.unwrap())]:t instanceof zf||t instanceof pa?Ht(t.unwrap()):t instanceof ma?Ht(t._def.innerType):[];class _i extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return Y(n,{code:Q.invalid_type,expected:se.object,received:n.parsedType}),xe;const a=this.discriminator,r=n.data[a],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Y(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,a){const r=new Map;for(const s of n){const i=Ht(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,s)}}return new _i({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...Ee(a)})}}function ko(t,e){const n=ir(t),a=ir(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&a===se.object){const r=ke.objectKeys(e),s=ke.objectKeys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(const o of s){const c=ko(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(n===se.array&&a===se.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<t.length;s++){const i=t[s],o=e[s],c=ko(i,o);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===se.date&&a===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ca extends Ne{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),r=(s,i)=>{if(Ul(s)||Ul(i))return xe;const o=ko(s.value,i.value);return o.valid?((Hl(s)||Hl(i))&&n.dirty(),{status:n.value,value:o.data}):(Y(a,{code:Q.invalid_intersection_types}),xe)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,i])=>r(s,i)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ca.create=(t,e,n)=>new ca({left:t,right:e,typeName:we.ZodIntersection,...Ee(n)});class Rr extends Ne{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==se.array)return Y(a,{code:Q.invalid_type,expected:se.array,received:a.parsedType}),xe;if(a.data.length<this._def.items.length)return Y(a,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&a.data.length>this._def.items.length&&(Y(a,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...a.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new $t(a,i,a.path,o)):null}).filter(i=>!!i);return a.common.async?Promise.all(s).then(i=>ut.mergeArray(n,i)):ut.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Rr({...this._def,rest:e})}}Rr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rr({items:t,typeName:we.ZodTuple,rest:null,...Ee(e)})};class ua extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==se.object)return Y(a,{code:Q.invalid_type,expected:se.object,received:a.parsedType}),xe;const r=[],s=this._def.keyType,i=this._def.valueType;for(const o in a.data)r.push({key:s._parse(new $t(a,o,a.path,o)),value:i._parse(new $t(a,a.data[o],a.path,o)),alwaysSet:o in a.data});return a.common.async?ut.mergeObjectAsync(n,r):ut.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,a){return n instanceof Ne?new ua({keyType:e,valueType:n,typeName:we.ZodRecord,...Ee(a)}):new ua({keyType:Wt.create(),valueType:e,typeName:we.ZodRecord,...Ee(n)})}}class Wl extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==se.map)return Y(a,{code:Q.invalid_type,expected:se.map,received:a.parsedType}),xe;const r=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map(([o,c],u)=>({key:r._parse(new $t(a,o,a.path,[u,"key"])),value:s._parse(new $t(a,c,a.path,[u,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,h=await c.value;if(u.status==="aborted"||h.status==="aborted")return xe;(u.status==="dirty"||h.status==="dirty")&&n.dirty(),o.set(u.value,h.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of i){const u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return xe;(u.status==="dirty"||h.status==="dirty")&&n.dirty(),o.set(u.value,h.value)}return{status:n.value,value:o}}}}Wl.create=(t,e,n)=>new Wl({valueType:e,keyType:t,typeName:we.ZodMap,...Ee(n)});class wn extends Ne{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==se.set)return Y(a,{code:Q.invalid_type,expected:se.set,received:a.parsedType}),xe;const r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(Y(a,{code:Q.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(Y(a,{code:Q.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const s=this._def.valueType;function i(c){const u=new Set;for(const h of c){if(h.status==="aborted")return xe;h.status==="dirty"&&n.dirty(),u.add(h.value)}return{status:n.value,value:u}}const o=[...a.data.values()].map((c,u)=>s._parse(new $t(a,c,a.path,u)));return a.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,n){return new wn({...this._def,minSize:{value:e,message:le.toString(n)}})}max(e,n){return new wn({...this._def,maxSize:{value:e,message:le.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}wn.create=(t,e)=>new wn({valueType:t,minSize:null,maxSize:null,typeName:we.ZodSet,...Ee(e)});class Mo extends Ne{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Mo.create=(t,e)=>new Mo({getter:t,typeName:we.ZodLazy,...Ee(e)});class da extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Y(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}da.create=(t,e)=>new da({value:t,typeName:we.ZodLiteral,...Ee(e)});function Vf(t,e){return new Er({values:t,typeName:we.ZodEnum,...Ee(e)})}class Er extends Ne{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return Y(n,{expected:ke.joinValues(a),received:n.parsedType,code:Q.invalid_type}),xe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return Y(n,{received:n.data,code:Q.invalid_enum_value,options:a}),xe}return wt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Er.create(e,{...this._def,...n})}exclude(e,n=this._def){return Er.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}Er.create=Vf;class Do extends Ne{_parse(e){const n=ke.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==se.string&&a.parsedType!==se.number){const r=ke.objectValues(n);return Y(a,{expected:ke.joinValues(r),received:a.parsedType,code:Q.invalid_type}),xe}if(this._cache||(this._cache=new Set(ke.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=ke.objectValues(n);return Y(a,{received:a.data,code:Q.invalid_enum_value,options:r}),xe}return wt(e.data)}get enum(){return this._def.values}}Do.create=(t,e)=>new Do({values:t,typeName:we.ZodNativeEnum,...Ee(e)});class fa extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.promise&&n.common.async===!1)return Y(n,{code:Q.invalid_type,expected:se.promise,received:n.parsedType}),xe;const a=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return wt(a.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fa.create=(t,e)=>new fa({type:t,typeName:we.ZodPromise,...Ee(e)});class Pr extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:a}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:i=>{Y(a,i),i.fatal?n.abort():n.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const i=r.transform(a.data,s);if(a.common.async)return Promise.resolve(i).then(async o=>{if(n.value==="aborted")return xe;const c=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return c.status==="aborted"?xe:c.status==="dirty"||n.value==="dirty"?on(c.value):c});{if(n.value==="aborted")return xe;const o=this._def.schema._parseSync({data:i,path:a.path,parent:a});return o.status==="aborted"?xe:o.status==="dirty"||n.value==="dirty"?on(o.value):o}}if(r.type==="refinement"){const i=o=>{const c=r.refinement(o,s);if(a.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?xe:(o.status==="dirty"&&n.dirty(),i(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?xe:(o.status==="dirty"&&n.dirty(),i(o.value).then(()=>({status:n.value,value:o.value}))))}if(r.type==="transform")if(a.common.async===!1){const i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Br(i))return xe;const o=r.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>Br(i)?Promise.resolve(r.transform(i.value,s)).then(o=>({status:n.value,value:o})):xe);ke.assertNever(r)}}Pr.create=(t,e,n)=>new Pr({schema:t,typeName:we.ZodEffects,effect:e,...Ee(n)});Pr.createWithPreprocess=(t,e,n)=>new Pr({schema:e,effect:{type:"preprocess",transform:t},typeName:we.ZodEffects,...Ee(n)});class Zt extends Ne{_parse(e){return this._getType(e)===se.undefined?wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zt.create=(t,e)=>new Zt({innerType:t,typeName:we.ZodOptional,...Ee(e)});class Ir extends Ne{_parse(e){return this._getType(e)===se.null?wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ir.create=(t,e)=>new Ir({innerType:t,typeName:we.ZodNullable,...Ee(e)});class ha extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===se.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ha.create=(t,e)=>new ha({innerType:t,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class ma extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return oa(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new nr(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new nr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ma.create=(t,e)=>new ma({innerType:t,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Zl extends Ne{_parse(e){if(this._getType(e)!==se.nan){const a=this._getOrReturnCtx(e);return Y(a,{code:Q.invalid_type,expected:se.nan,received:a.parsedType}),xe}return{status:"valid",value:e.data}}}Zl.create=t=>new Zl({typeName:we.ZodNaN,...Ee(t)});class zf extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class Si extends Ne{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?xe:s.status==="dirty"?(n.dirty(),on(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?xe:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,n){return new Si({in:e,out:n,typeName:we.ZodPipeline})}}class pa extends Ne{_parse(e){const n=this._def.innerType._parse(e),a=r=>(Br(r)&&(r.value=Object.freeze(r.value)),r);return oa(n)?n.then(r=>a(r)):a(n)}unwrap(){return this._def.innerType}}pa.create=(t,e)=>new pa({innerType:t,typeName:we.ZodReadonly,...Ee(e)});var we;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(we||(we={}));const j=Wt.create,He=Kr.create,De=Ao.create,qf=To.create,En=Oo.create;vr.create;const te=Dt.create,B=Xe.create,st=la.create,$w=_i.create;ca.create;Rr.create;const Lt=ua.create,Re=da.create,et=Er.create;fa.create;const G=Zt.create;Ir.create;const Lw=xe,Vw=10,Fo={name:"space_search",description:"Find Hugging Face Spaces using semantic search. IMPORTANT Only MCP Servers can be used with the dynamic_space toolInclude links to the Space when presenting the results.",schema:B({query:j().min(1,"Query is required").max(100,"Query too long").describe("Semantic Search Query"),limit:He().optional().default(Vw).describe("Number of results to return"),mcp:De().optional().default(!1).describe("Only return MCP Server enabled Spaces")}),annotations:{title:"Hugging Face Space Search"}},$o={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:B({query:j().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:j().optional().describe("Organization or user who created the model (e.g., 'google', 'meta-llama', 'microsoft')"),task:j().optional().describe("Model task type (e.g., 'text-generation', 'image-classification', 'translation')"),library:j().optional().describe("Framework the model uses (e.g., 'transformers', 'diffusers', 'timm')"),sort:et(["trendingScore","downloads","likes","createdAt","lastModified"]).optional().describe("Sort order: trendingScore, downloads , likes, createdAt, lastModified"),limit:He().min(1).max(100).optional().default(20).describe("Maximum number of results to return")}),annotations:{title:"Model Search"}};new Promise(t=>{});var us=65536;zw();function zw(){try{return new Uint32Array(us)}catch{const e=new Array(us);for(let n=0;n<us;n++)e[n]=0;return e}}const qw={name:"model_details",schema:B({model_id:j().min(1,"Model ID is required").describe("The Model ID in author/model format (e.g., microsoft/DialoGPT-large)")})};B({model_id:j().min(5,"Model ID is required").max(50).describe("The Model ID in author/model format (e.g. 'openai/gpt-oss-120b')")});const Lo={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:B({query:j().min(3,"Supply at least one search term").max(200,"Query too long").describe("Semantic Search query"),results_limit:He().optional().default(12).describe("Number of results to return"),concise_only:De().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"}},Vo={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:B({query:j().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:j().optional().describe("Organization or user who created the dataset (e.g., 'google', 'facebook', 'allenai')"),tags:te(j()).optional().describe("Tags to filter datasets (e.g., ['language:en', 'size_categories:1M<n<10M', 'task_categories:text-classification'])"),sort:et(["trendingScore","downloads","likes","createdAt","lastModified"]).optional().describe("Sort order: trendingScore, downloads, likes, createdAt, lastModified"),limit:He().min(1).max(100).optional().default(20).describe("Maximum number of results to return")}),annotations:{title:"Dataset Search"}},Uw={name:"dataset_details",schema:B({dataset_id:j().min(5,"Dataset ID is required").describe("The Dataset ID (e.g. Anthropic/hh-rlhf, squad)")})};B({dataset_id:j().min(3,"Dataset ID is required").max(100).describe("The Dataset ID (e.g. 'Anthropic/hh-rlhf', 'squad')")});const zo={name:"hub_repo_details",description:"Get details for one or more Hugging Face repos (model, dataset, or space). Auto-detects type unless specified.",schema:B({repo_ids:te(j().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:et(["model","dataset","space"]).optional().describe("Specify lookup type; otherwise auto-detects"),include_readme:De().default(!1).describe("Include README from the repo")}),annotations:{title:"Hub Repo Details"}},Uf={name:"duplicate_space",schema:B({sourceSpaceId:j().min(1).describe("Space ID to copy (e.g., 'username/space-name')"),newSpaceId:j().optional().describe("Name for the new space (optional, defaults to source space-name)"),hardware:et(["freecpu","zerogpu"]).optional().describe('Either "freecpu" or "zerogpu" (defaults based on source). Both options are in the free tier.'),private:De().optional().default(!0).describe("Check with User whether the new space should be public or private.")}),annotations:{title:"Duplicate Hugging Face Space"}};B({username:j().optional().describe("Username to get spaces for (defaults to authenticated user)")});const Hf={name:"space_files",schema:B({spaceName:j().optional().describe('Space identifier in format "username/spacename"'),fileType:et(["all","image","audio"]).optional().default("all").describe("Filter files by type: all (default), image, or audio files only")}),annotations:{title:"Space Files List"}};B({fileType:et(["all","image","audio","text"]).optional().default("all").describe("Filter by type")});B({});B({user_id:j().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")});B({paper_id:j().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 bi=typeof window<"u"?window:{};function Hw(){var t=bi.DOMParser,e=!1;try{new t().parseFromString("","text/html")&&(e=!0)}catch{}return e}function Gw(){var t=function(){};return Bw()?t.prototype.parseFromString=function(e){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(e),n.close(),n}:t.prototype.parseFromString=function(e){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(e),n.close(),n},t}function Bw(){var t=!1;try{document.implementation.createHTMLDocument("").open()}catch{bi.ActiveXObject&&(t=!0)}return t}Hw()?bi.DOMParser:Gw();const qo={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:B({doc_url:j().max(200,"Query too long").describe("Documentation URL (Hugging Face or Gradio)"),offset:He().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"}},Uo={name:"hf_doc_search",description:"Search and Discover Hugging Face Product and Library documentation. Send an empty query to discover structure and navigation instructions. You MUST consult this tool for the most up-to-date information when using Hugging Face libraries. Combine with the Product filter to focus results.",schema:B({query:j().max(200,"Query too long").superRefine((t,e)=>{const n=t.trim();n.length!==0&&n.length<3&&e.addIssue({code:Q.too_small,type:"string",minimum:3,inclusive:!0,message:"Supply at least one search term"})}).describe("Start with an empty query for structure, endpoint discovery and navigation tips. Use semantic queries for targetted searches."),product:j().optional().describe("Filter by Product. Supply when known for focused results")}),annotations:{title:"Hugging Face Documentation Search"}};B({space_id:j().min(1).describe("Space ID in 'username/repo' format")});var Wn={},ds,Ql;function Kw(){return Ql||(Ql=1,ds=function(e){return e.map(function(n){return n===""?"''":n&&typeof n=="object"?n.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}),ds}var fs,Jl;function Ww(){if(Jl)return fs;Jl=1;for(var t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",e=new RegExp("^"+t+"$"),n="|&;()<> \\t",a='"((\\\\"|[^"])*?)"',r="'((\\\\'|[^'])*?)'",s=/^#$/,i="'",o='"',c="$",u="",h=4294967296,m=0;m<4;m++)u+=(h*Math.random()).toString(16);var f=new RegExp("^"+u);function l(v,y){for(var _=y.lastIndex,x=[],w;w=y.exec(v);)x.push(w),y.lastIndex===w.index&&(y.lastIndex+=1);return y.lastIndex=_,x}function p(v,y,_){var x=typeof v=="function"?v(_):v[_];return typeof x>"u"&&_!=""?x="":typeof x>"u"&&(x="$"),typeof x=="object"?y+u+JSON.stringify(x)+u:y+x}function g(v,y,_){_||(_={});var x=_.escape||"\\",w="(\\"+x+`['"`+n+`]|[^\\s'"`+n+"])+",b=new RegExp(["("+t+")","("+w+"|"+a+"|"+r+")+"].join("|"),"g"),I=l(v,b);if(I.length===0)return[];y||(y={});var E=!1;return I.map(function(R){var T=R[0];if(!T||E)return;if(e.test(T))return{op:T};var P=!1,O=!1,M="",z=!1,D;function W(){D+=1;var F,q,K=T.charAt(D);if(K==="{"){if(D+=1,T.charAt(D)==="}")throw new Error("Bad substitution: "+T.slice(D-2,D+1));if(F=T.indexOf("}",D),F<0)throw new Error("Bad substitution: "+T.slice(D));q=T.slice(D,F),D=F}else if(/[*@#?$!_-]/.test(K))q=K,D+=1;else{var re=T.slice(D);F=re.match(/[^\w\d_]/),F?(q=re.slice(0,F.index),D+=F.index-1):(q=re,D=T.length)}return p(y,"",q)}for(D=0;D<T.length;D++){var H=T.charAt(D);if(z=z||!P&&(H==="*"||H==="?"),O)M+=H,O=!1;else if(P)H===P?P=!1:P==i?M+=H:H===x?(D+=1,H=T.charAt(D),H===o||H===x||H===c?M+=H:M+=x+H):H===c?M+=W():M+=H;else if(H===o||H===i)P=H;else{if(e.test(H))return{op:T};if(s.test(H)){E=!0;var J={comment:v.slice(R.index+D+1)};return M.length?[M,J]:[J]}else H===x?O=!0:H===c?M+=W():M+=H}}return z?{op:"glob",pattern:M}:M}).reduce(function(R,T){return typeof T>"u"?R:R.concat(T)},[])}return fs=function(y,_,x){var w=g(y,_,x);return typeof _!="function"?w:w.reduce(function(b,I){if(typeof I=="object")return b.concat(I);var E=I.split(RegExp("("+u+".*?"+u+")","g"));return E.length===1?b.concat(E[0]):b.concat(E.filter(Boolean).map(function(R){return f.test(R)?JSON.parse(R.split(u)[1]):R}))},[])},fs}var Xl;function Zw(){return Xl||(Xl=1,Wn.quote=Kw(),Wn.parse=Ww()),Wn}Zw();const Qw=1e4,Yl=Qw/1e3,Gf=["cpu-basic","cpu-upgrade","cpu-performance","cpu-xl"],Ci=["sprx8","zero-a10g","t4-small","t4-medium","l4x1","l4x4","l40sx1","l40sx4","l40sx8","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","h100","h100x8"],Ri=["inf2x6"],Ho=[...Gf,...Ci,...Ri],yr=B({namespace:j().optional().describe("Target namespace (username or organization). Defaults to current user.")}),Jw=yr.extend({image:j().describe('Docker image or HF Space URL (e.g., "python:3.12" or "hf.co/spaces/user/space")').optional().default("python:3.12"),command:st([j(),te(j())]).describe('Command to execute. Array format recommended (e.g., ["python", "script.py"]). String format is parsed with POSIX shell semantics (quotes, escaping). For multiline scripts, use array with newlines in arguments.'),flavor:et(Ho).optional().default("cpu-basic").describe(`Hardware flavor. Options: ${Ho.join(", ")}`),env:Lt(j()).optional().describe("Environment variables as key-value pairs"),secrets:Lt(j()).optional().describe("Secrets as key-value pairs. Use HF_TOKEN=$HF_TOKEN to include your token"),timeout:j().optional().describe('Max duration (e.g., "5m", "2h", "30s"). Default: 30m').default("30m"),detach:De().optional().default(!1).describe("If true, return immediately with job ID. If false (default), tail logs for up to 10 seconds.")}),Xw=yr.extend({script:j().describe("Python script: local file path, URL, or inline code. UV will handle dependencies automatically."),with_deps:te(j()).optional().describe("Additional package dependencies"),script_args:te(j()).optional().describe("Arguments to pass to the script"),python:j().optional().describe('Python interpreter version (e.g., "3.12")'),flavor:et(Ho).optional().default("cpu-basic").describe("Hardware flavor"),env:Lt(j()).optional().describe("Environment variables as key-value pairs"),secrets:Lt(j()).optional().describe("Secrets as key-value pairs. Use HF_TOKEN=$HF_TOKEN to include your token"),timeout:j().optional().default("30m").describe("Max duration"),detach:De().optional().default(!1).describe("If true, return immediately with job ID. If false (default), tail logs for up to 10 seconds.")});yr.extend({all:De().optional().default(!1).describe("Show all jobs (default: only running)"),status:j().optional().describe('Filter by status ("RUNNING", "COMPLETED", "CANCELED", "ERROR", "DELETED")')});yr.extend({job_id:j().describe("Job ID to fetch logs from"),tail:He().optional().default(20).describe("Number of lines to return (default: 20)")});yr.extend({job_id:st([j(),te(j())]).describe("Job ID(s) to inspect")});yr.extend({job_id:j().describe("Job ID to cancel")});Jw.extend({schedule:j().describe("Schedule: cron expression or shorthand (@hourly, @daily, @weekly, @monthly, @yearly)"),suspend:De().optional().default(!1).describe("Create in suspended state")});Xw.extend({schedule:j().describe("Schedule: cron expression or shorthand"),suspend:De().optional().default(!1).describe("Create in suspended state")});yr.extend({all:De().optional().default(!1).describe("Show all scheduled jobs (default: hide suspended)")});yr.extend({scheduled_job_id:j().describe("Scheduled job ID")});const ec=["run","uv","ps","logs","inspect","cancel","scheduled run","scheduled uv","scheduled ps","scheduled inspect","scheduled delete","scheduled suspend","scheduled resume"],Yw={run:`{
|
|
146
|
+
"operation": "run",
|
|
147
|
+
"args": {
|
|
148
|
+
"image": "python:3.12",
|
|
149
|
+
"command": ["python", "-c", "print('Hello from HF Jobs!')"],
|
|
150
|
+
"flavor": "cpu-basic"
|
|
151
|
+
}
|
|
152
|
+
}`,uv:`{
|
|
153
|
+
"operation": "uv",
|
|
154
|
+
"args": {
|
|
155
|
+
"script": "import random\\nprint(42 + random.randint(1, 5))"
|
|
156
|
+
}
|
|
157
|
+
}`,ps:'{"operation": "ps"}',logs:`{
|
|
158
|
+
"operation": "logs",
|
|
159
|
+
"args": {"job_id": "your-job-id"}
|
|
160
|
+
}`,inspect:`{
|
|
161
|
+
"operation": "inspect",
|
|
162
|
+
"args": {"job_id": "your-job-id"}
|
|
163
|
+
}`,cancel:`{
|
|
164
|
+
"operation": "cancel",
|
|
165
|
+
"args": {"job_id": "your-job-id"}
|
|
166
|
+
}`,"scheduled run":`{
|
|
167
|
+
"operation": "scheduled run",
|
|
168
|
+
"args": {
|
|
169
|
+
"schedule": "@hourly",
|
|
170
|
+
"image": "python:3.12",
|
|
171
|
+
"command": ["python", "backup.py"]
|
|
172
|
+
}
|
|
173
|
+
}`,"scheduled uv":`{
|
|
174
|
+
"operation": "scheduled uv",
|
|
175
|
+
"args": {
|
|
176
|
+
"schedule": "0 9 * * 1-5",
|
|
177
|
+
"script": "import datetime\\nprint('daily check', datetime.datetime.utcnow())"
|
|
178
|
+
}
|
|
179
|
+
}`,"scheduled ps":'{"operation": "scheduled ps"}',"scheduled inspect":`{
|
|
180
|
+
"operation": "scheduled inspect",
|
|
181
|
+
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
182
|
+
}`,"scheduled delete":`{
|
|
183
|
+
"operation": "scheduled delete",
|
|
184
|
+
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
185
|
+
}`,"scheduled suspend":`{
|
|
186
|
+
"operation": "scheduled suspend",
|
|
187
|
+
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
188
|
+
}`,"scheduled resume":`{
|
|
189
|
+
"operation": "scheduled resume",
|
|
190
|
+
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
191
|
+
}`},e_=Gf.join(", "),t_=Ci.join(", "),r_=Ri.join(", "),n_=[`**CPU:** ${e_}`,Ci.length?`**GPU:** ${t_}`:void 0,Ri.length?`**Specialized:** ${r_}`:void 0].filter(t=>!!t).join(`
|
|
192
|
+
`);function a_(t){const e=Yw[t];if(e)return`Call this tool with:
|
|
193
|
+
\`\`\`json
|
|
194
|
+
${e}
|
|
195
|
+
\`\`\``}function tc(t,e){const n=a_(e);return n?`### ${t}
|
|
196
|
+
${n}
|
|
197
|
+
`:""}`${tc("Run a simple job","run")}${tc("Run a Python script with UV","uv")}${n_}${Yl}${Yl}`;B({operation:et(ec).optional().describe(`Operation to execute. Valid values: ${ec.map(t=>`"${t}"`).join(", ")}`),args:Lt(qf()).optional().describe("Operation-specific arguments as a JSON object")});const s_=["discover","view_parameters","invoke"];B({operation:et(s_).optional().describe("Operation to execute."),space_name:j().optional().describe('The Hugging Face space ID (format: "username/space-name"). Required for view_parameters and invoke operations.'),parameters:j().optional().describe("For invoke operation: JSON object string of parameters"),search_query:j().optional().describe('For discover operation: Search query or task category (e.g. "Image Generation", "OCR", "FLUX image generation") to find MCP-enabled Spaces. Call with blank query to see task hints.'),limit:He().optional().describe("For discover operation: Maximum number of results to return (default: 10)")});const Na="2.0",Bf=st([j(),He().int()]),Kf=j(),o_=B({progressToken:G(Bf)}).passthrough(),_t=B({_meta:G(o_)}).passthrough(),ft=B({method:j(),params:G(_t)}),Pn=B({_meta:G(B({}).passthrough())}).passthrough(),zt=B({method:j(),params:G(Pn)}),St=B({_meta:G(B({}).passthrough())}).passthrough(),ja=st([j(),He().int()]),i_=B({jsonrpc:Re(Na),id:ja}).merge(ft).strict(),l_=B({jsonrpc:Re(Na)}).merge(zt).strict(),c_=B({jsonrpc:Re(Na),id:ja,result:St}).strict();var rc;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(rc||(rc={}));const u_=B({jsonrpc:Re(Na),id:ja,error:B({code:He().int(),message:j(),data:G(En())})}).strict();st([i_,l_,c_,u_]);const Wf=St.strict(),Zf=zt.extend({method:Re("notifications/cancelled"),params:Pn.extend({requestId:ja,reason:j().optional()})}),d_=B({src:j(),mimeType:G(j()),sizes:G(te(j()))}).passthrough(),In=B({icons:te(d_).optional()}).passthrough(),An=B({name:j(),title:G(j())}).passthrough(),Qf=An.extend({version:j(),websiteUrl:G(j())}).merge(In),f_=B({experimental:G(B({}).passthrough()),sampling:G(B({}).passthrough()),elicitation:G(B({}).passthrough()),roots:G(B({listChanged:G(De())}).passthrough())}).passthrough(),h_=ft.extend({method:Re("initialize"),params:_t.extend({protocolVersion:j(),capabilities:f_,clientInfo:Qf})}),m_=B({experimental:G(B({}).passthrough()),logging:G(B({}).passthrough()),completions:G(B({}).passthrough()),prompts:G(B({listChanged:G(De())}).passthrough()),resources:G(B({subscribe:G(De()),listChanged:G(De())}).passthrough()),tools:G(B({listChanged:G(De())}).passthrough())}).passthrough(),p_=St.extend({protocolVersion:j(),capabilities:m_,serverInfo:Qf,instructions:G(j())}),g_=zt.extend({method:Re("notifications/initialized")}),Jf=ft.extend({method:Re("ping")}),v_=B({progress:He(),total:G(He()),message:G(j())}).passthrough(),Xf=zt.extend({method:Re("notifications/progress"),params:Pn.merge(v_).extend({progressToken:Bf})}),Ta=ft.extend({params:_t.extend({cursor:G(Kf)}).optional()}),Oa=St.extend({nextCursor:G(Kf)}),Yf=B({uri:j(),mimeType:G(j()),_meta:G(B({}).passthrough())}).passthrough(),eh=Yf.extend({text:j()}),Ei=j().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),th=Yf.extend({blob:Ei}),rh=An.extend({uri:j(),description:G(j()),mimeType:G(j()),_meta:G(B({}).passthrough())}).merge(In),y_=An.extend({uriTemplate:j(),description:G(j()),mimeType:G(j()),_meta:G(B({}).passthrough())}).merge(In),x_=Ta.extend({method:Re("resources/list")}),w_=Oa.extend({resources:te(rh)}),__=Ta.extend({method:Re("resources/templates/list")}),S_=Oa.extend({resourceTemplates:te(y_)}),b_=ft.extend({method:Re("resources/read"),params:_t.extend({uri:j()})}),C_=St.extend({contents:te(st([eh,th]))}),R_=zt.extend({method:Re("notifications/resources/list_changed")}),E_=ft.extend({method:Re("resources/subscribe"),params:_t.extend({uri:j()})}),P_=ft.extend({method:Re("resources/unsubscribe"),params:_t.extend({uri:j()})}),I_=zt.extend({method:Re("notifications/resources/updated"),params:Pn.extend({uri:j()})}),A_=B({name:j(),description:G(j()),required:G(De())}).passthrough(),N_=An.extend({description:G(j()),arguments:G(te(A_)),_meta:G(B({}).passthrough())}).merge(In),j_=Ta.extend({method:Re("prompts/list")}),T_=Oa.extend({prompts:te(N_)}),O_=ft.extend({method:Re("prompts/get"),params:_t.extend({name:j(),arguments:G(Lt(j()))})}),Pi=B({type:Re("text"),text:j(),_meta:G(B({}).passthrough())}).passthrough(),Ii=B({type:Re("image"),data:Ei,mimeType:j(),_meta:G(B({}).passthrough())}).passthrough(),Ai=B({type:Re("audio"),data:Ei,mimeType:j(),_meta:G(B({}).passthrough())}).passthrough(),k_=B({type:Re("resource"),resource:st([eh,th]),_meta:G(B({}).passthrough())}).passthrough(),M_=rh.extend({type:Re("resource_link")}),nh=st([Pi,Ii,Ai,M_,k_]),D_=B({role:et(["user","assistant"]),content:nh}).passthrough(),F_=St.extend({description:G(j()),messages:te(D_)}),$_=zt.extend({method:Re("notifications/prompts/list_changed")}),L_=B({title:G(j()),readOnlyHint:G(De()),destructiveHint:G(De()),idempotentHint:G(De()),openWorldHint:G(De())}).passthrough(),V_=An.extend({description:G(j()),inputSchema:B({type:Re("object"),properties:G(B({}).passthrough()),required:G(te(j()))}).passthrough(),outputSchema:G(B({type:Re("object"),properties:G(B({}).passthrough()),required:G(te(j()))}).passthrough()),annotations:G(L_),_meta:G(B({}).passthrough())}).merge(In),z_=Ta.extend({method:Re("tools/list")}),q_=Oa.extend({tools:te(V_)}),ah=St.extend({content:te(nh).default([]),structuredContent:B({}).passthrough().optional(),isError:G(De())});ah.or(St.extend({toolResult:En()}));const U_=ft.extend({method:Re("tools/call"),params:_t.extend({name:j(),arguments:G(Lt(En()))})}),H_=zt.extend({method:Re("notifications/tools/list_changed")}),sh=et(["debug","info","notice","warning","error","critical","alert","emergency"]),G_=ft.extend({method:Re("logging/setLevel"),params:_t.extend({level:sh})}),B_=zt.extend({method:Re("notifications/message"),params:Pn.extend({level:sh,logger:G(j()),data:En()})}),K_=B({name:j().optional()}).passthrough(),W_=B({hints:G(te(K_)),costPriority:G(He().min(0).max(1)),speedPriority:G(He().min(0).max(1)),intelligencePriority:G(He().min(0).max(1))}).passthrough(),Z_=B({role:et(["user","assistant"]),content:st([Pi,Ii,Ai])}).passthrough(),Q_=ft.extend({method:Re("sampling/createMessage"),params:_t.extend({messages:te(Z_),systemPrompt:G(j()),includeContext:G(et(["none","thisServer","allServers"])),temperature:G(He()),maxTokens:He().int(),stopSequences:G(te(j())),metadata:G(B({}).passthrough()),modelPreferences:G(W_)})}),J_=St.extend({model:j(),stopReason:G(et(["endTurn","stopSequence","maxTokens"]).or(j())),role:et(["user","assistant"]),content:$w("type",[Pi,Ii,Ai])}),X_=B({type:Re("boolean"),title:G(j()),description:G(j()),default:G(De())}).passthrough(),Y_=B({type:Re("string"),title:G(j()),description:G(j()),minLength:G(He()),maxLength:G(He()),format:G(et(["email","uri","date","date-time"]))}).passthrough(),eS=B({type:et(["number","integer"]),title:G(j()),description:G(j()),minimum:G(He()),maximum:G(He())}).passthrough(),tS=B({type:Re("string"),title:G(j()),description:G(j()),enum:te(j()),enumNames:G(te(j()))}).passthrough(),rS=st([X_,Y_,eS,tS]),nS=ft.extend({method:Re("elicitation/create"),params:_t.extend({message:j(),requestedSchema:B({type:Re("object"),properties:Lt(j(),rS),required:G(te(j()))}).passthrough()})}),aS=St.extend({action:et(["accept","decline","cancel"]),content:G(Lt(j(),En()))}),sS=B({type:Re("ref/resource"),uri:j()}).passthrough(),oS=B({type:Re("ref/prompt"),name:j()}).passthrough(),iS=ft.extend({method:Re("completion/complete"),params:_t.extend({ref:st([oS,sS]),argument:B({name:j(),value:j()}).passthrough(),context:G(B({arguments:G(Lt(j(),j()))}))})}),lS=St.extend({completion:B({values:te(j()).max(100),total:G(He().int()),hasMore:G(De())}).passthrough()}),cS=B({uri:j().startsWith("file://"),name:G(j()),_meta:G(B({}).passthrough())}).passthrough(),uS=ft.extend({method:Re("roots/list")}),dS=St.extend({roots:te(cS)}),fS=zt.extend({method:Re("notifications/roots/list_changed")});st([Jf,h_,iS,G_,O_,j_,x_,__,b_,E_,P_,U_,z_]);st([Zf,Xf,g_,fS]);st([Wf,J_,aS,dS]);st([Jf,Q_,nS,uS]);st([Zf,Xf,B_,I_,R_,H_,$_]);st([Wf,p_,lS,F_,T_,w_,S_,C_,ah,q_]);var ln={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */var hS=ln.exports,nc;function mS(){return nc||(nc=1,(function(t,e){(function(n,a){a(e)})(hS,(function(n){function a(){for(var A=arguments.length,C=Array(A),N=0;N<A;N++)C[N]=arguments[N];if(C.length>1){C[0]=C[0].slice(0,-1);for(var V=C.length-1,L=1;L<V;++L)C[L]=C[L].slice(1,-1);return C[V]=C[V].slice(1),C.join("")}else return C[0]}function r(A){return"(?:"+A+")"}function s(A){return A===void 0?"undefined":A===null?"null":Object.prototype.toString.call(A).split(" ").pop().split("]").shift().toLowerCase()}function i(A){return A.toUpperCase()}function o(A){return A!=null?A instanceof Array?A:typeof A.length!="number"||A.split||A.setInterval||A.call?[A]:Array.prototype.slice.call(A):[]}function c(A,C){var N=A;if(C)for(var V in C)N[V]=C[V];return N}function u(A){var C="[A-Za-z]",N="[0-9]",V=a(N,"[A-Fa-f]"),L=r(r("%[EFef]"+V+"%"+V+V+"%"+V+V)+"|"+r("%[89A-Fa-f]"+V+"%"+V+V)+"|"+r("%"+V+V)),de="[\\:\\/\\?\\#\\[\\]\\@]",he="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",je=a(de,he),Ue=A?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",Ze=A?"[\\uE000-\\uF8FF]":"[]",Ae=a(C,N,"[\\-\\.\\_\\~]",Ue);r(C+a(C,N,"[\\+\\-\\.]")+"*"),r(r(L+"|"+a(Ae,he,"[\\:]"))+"*");var Le=r(r("25[0-5]")+"|"+r("2[0-4]"+N)+"|"+r("1"+N+N)+"|"+r("0?[1-9]"+N)+"|0?0?"+N),Qe=r(Le+"\\."+Le+"\\."+Le+"\\."+Le),Ce=r(V+"{1,4}"),Be=r(r(Ce+"\\:"+Ce)+"|"+Qe),Je=r(r(Ce+"\\:")+"{6}"+Be),Ke=r("\\:\\:"+r(Ce+"\\:")+"{5}"+Be),ar=r(r(Ce)+"?\\:\\:"+r(Ce+"\\:")+"{4}"+Be),It=r(r(r(Ce+"\\:")+"{0,1}"+Ce)+"?\\:\\:"+r(Ce+"\\:")+"{3}"+Be),At=r(r(r(Ce+"\\:")+"{0,2}"+Ce)+"?\\:\\:"+r(Ce+"\\:")+"{2}"+Be),Mr=r(r(r(Ce+"\\:")+"{0,3}"+Ce)+"?\\:\\:"+Ce+"\\:"+Be),wr=r(r(r(Ce+"\\:")+"{0,4}"+Ce)+"?\\:\\:"+Be),yt=r(r(r(Ce+"\\:")+"{0,5}"+Ce)+"?\\:\\:"+Ce),Nt=r(r(r(Ce+"\\:")+"{0,6}"+Ce)+"?\\:\\:"),_r=r([Je,Ke,ar,It,At,Mr,wr,yt,Nt].join("|")),qt=r(r(Ae+"|"+L)+"+");r("[vV]"+V+"+\\."+a(Ae,he,"[\\:]")+"+"),r(r(L+"|"+a(Ae,he))+"*");var tn=r(L+"|"+a(Ae,he,"[\\:\\@]"));return r(r(L+"|"+a(Ae,he,"[\\@]"))+"+"),r(r(tn+"|"+a("[\\/\\?]",Ze))+"*"),{NOT_SCHEME:new RegExp(a("[^]",C,N,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(a("[^\\%\\:]",Ae,he),"g"),NOT_HOST:new RegExp(a("[^\\%\\[\\]\\:]",Ae,he),"g"),NOT_PATH:new RegExp(a("[^\\%\\/\\:\\@]",Ae,he),"g"),NOT_PATH_NOSCHEME:new RegExp(a("[^\\%\\/\\@]",Ae,he),"g"),NOT_QUERY:new RegExp(a("[^\\%]",Ae,he,"[\\:\\@\\/\\?]",Ze),"g"),NOT_FRAGMENT:new RegExp(a("[^\\%]",Ae,he,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(a("[^]",Ae,he),"g"),UNRESERVED:new RegExp(Ae,"g"),OTHER_CHARS:new RegExp(a("[^\\%]",Ae,je),"g"),PCT_ENCODED:new RegExp(L,"g"),IPV4ADDRESS:new RegExp("^("+Qe+")$"),IPV6ADDRESS:new RegExp("^\\[?("+_r+")"+r(r("\\%25|\\%(?!"+V+"{2})")+"("+qt+")")+"?\\]?$")}}var h=u(!1),m=u(!0),f=(function(){function A(C,N){var V=[],L=!0,de=!1,he=void 0;try{for(var je=C[Symbol.iterator](),Ue;!(L=(Ue=je.next()).done)&&(V.push(Ue.value),!(N&&V.length===N));L=!0);}catch(Ze){de=!0,he=Ze}finally{try{!L&&je.return&&je.return()}finally{if(de)throw he}}return V}return function(C,N){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return A(C,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=function(A){if(Array.isArray(A)){for(var C=0,N=Array(A.length);C<A.length;C++)N[C]=A[C];return N}else return Array.from(A)},p=2147483647,g=36,v=1,y=26,_=38,x=700,w=72,b=128,I="-",E=/^xn--/,R=/[^\0-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=g-v,M=Math.floor,z=String.fromCharCode;function D(A){throw new RangeError(P[A])}function W(A,C){for(var N=[],V=A.length;V--;)N[V]=C(A[V]);return N}function H(A,C){var N=A.split("@"),V="";N.length>1&&(V=N[0]+"@",A=N[1]),A=A.replace(T,".");var L=A.split("."),de=W(L,C).join(".");return V+de}function J(A){for(var C=[],N=0,V=A.length;N<V;){var L=A.charCodeAt(N++);if(L>=55296&&L<=56319&&N<V){var de=A.charCodeAt(N++);(de&64512)==56320?C.push(((L&1023)<<10)+(de&1023)+65536):(C.push(L),N--)}else C.push(L)}return C}var F=function(C){return String.fromCodePoint.apply(String,l(C))},q=function(C){return C-48<10?C-22:C-65<26?C-65:C-97<26?C-97:g},K=function(C,N){return C+22+75*(C<26)-((N!=0)<<5)},re=function(C,N,V){var L=0;for(C=V?M(C/x):C>>1,C+=M(C/N);C>O*y>>1;L+=g)C=M(C/O);return M(L+(O+1)*C/(C+_))},fe=function(C){var N=[],V=C.length,L=0,de=b,he=w,je=C.lastIndexOf(I);je<0&&(je=0);for(var Ue=0;Ue<je;++Ue)C.charCodeAt(Ue)>=128&&D("not-basic"),N.push(C.charCodeAt(Ue));for(var Ze=je>0?je+1:0;Ze<V;){for(var Ae=L,Le=1,Qe=g;;Qe+=g){Ze>=V&&D("invalid-input");var Ce=q(C.charCodeAt(Ze++));(Ce>=g||Ce>M((p-L)/Le))&&D("overflow"),L+=Ce*Le;var Be=Qe<=he?v:Qe>=he+y?y:Qe-he;if(Ce<Be)break;var Je=g-Be;Le>M(p/Je)&&D("overflow"),Le*=Je}var Ke=N.length+1;he=re(L-Ae,Ke,Ae==0),M(L/Ke)>p-de&&D("overflow"),de+=M(L/Ke),L%=Ke,N.splice(L++,0,de)}return String.fromCodePoint.apply(String,N)},me=function(C){var N=[];C=J(C);var V=C.length,L=b,de=0,he=w,je=!0,Ue=!1,Ze=void 0;try{for(var Ae=C[Symbol.iterator](),Le;!(je=(Le=Ae.next()).done);je=!0){var Qe=Le.value;Qe<128&&N.push(z(Qe))}}catch(rn){Ue=!0,Ze=rn}finally{try{!je&&Ae.return&&Ae.return()}finally{if(Ue)throw Ze}}var Ce=N.length,Be=Ce;for(Ce&&N.push(I);Be<V;){var Je=p,Ke=!0,ar=!1,It=void 0;try{for(var At=C[Symbol.iterator](),Mr;!(Ke=(Mr=At.next()).done);Ke=!0){var wr=Mr.value;wr>=L&&wr<Je&&(Je=wr)}}catch(rn){ar=!0,It=rn}finally{try{!Ke&&At.return&&At.return()}finally{if(ar)throw It}}var yt=Be+1;Je-L>M((p-de)/yt)&&D("overflow"),de+=(Je-L)*yt,L=Je;var Nt=!0,_r=!1,qt=void 0;try{for(var tn=C[Symbol.iterator](),zi;!(Nt=(zi=tn.next()).done);Nt=!0){var qi=zi.value;if(qi<L&&++de>p&&D("overflow"),qi==L){for(var Nn=de,jn=g;;jn+=g){var Tn=jn<=he?v:jn>=he+y?y:jn-he;if(Nn<Tn)break;var Ui=Nn-Tn,Hi=g-Tn;N.push(z(K(Tn+Ui%Hi,0))),Nn=M(Ui/Hi)}N.push(z(K(Nn,0))),he=re(de,yt,Be==Ce),de=0,++Be}}}catch(rn){_r=!0,qt=rn}finally{try{!Nt&&tn.return&&tn.return()}finally{if(_r)throw qt}}++de,++L}return N.join("")},ye=function(C){return H(C,function(N){return E.test(N)?fe(N.slice(4).toLowerCase()):N})},Me=function(C){return H(C,function(N){return R.test(N)?"xn--"+me(N):N})},k={version:"2.1.0",ucs2:{decode:J,encode:F},decode:fe,encode:me,toASCII:Me,toUnicode:ye},$={};function X(A){var C=A.charCodeAt(0),N=void 0;return C<16?N="%0"+C.toString(16).toUpperCase():C<128?N="%"+C.toString(16).toUpperCase():C<2048?N="%"+(C>>6|192).toString(16).toUpperCase()+"%"+(C&63|128).toString(16).toUpperCase():N="%"+(C>>12|224).toString(16).toUpperCase()+"%"+(C>>6&63|128).toString(16).toUpperCase()+"%"+(C&63|128).toString(16).toUpperCase(),N}function ne(A){for(var C="",N=0,V=A.length;N<V;){var L=parseInt(A.substr(N+1,2),16);if(L<128)C+=String.fromCharCode(L),N+=3;else if(L>=194&&L<224){if(V-N>=6){var de=parseInt(A.substr(N+4,2),16);C+=String.fromCharCode((L&31)<<6|de&63)}else C+=A.substr(N,6);N+=6}else if(L>=224){if(V-N>=9){var he=parseInt(A.substr(N+4,2),16),je=parseInt(A.substr(N+7,2),16);C+=String.fromCharCode((L&15)<<12|(he&63)<<6|je&63)}else C+=A.substr(N,9);N+=9}else C+=A.substr(N,3),N+=3}return C}function U(A,C){function N(V){var L=ne(V);return L.match(C.UNRESERVED)?L:V}return A.scheme&&(A.scheme=String(A.scheme).replace(C.PCT_ENCODED,N).toLowerCase().replace(C.NOT_SCHEME,"")),A.userinfo!==void 0&&(A.userinfo=String(A.userinfo).replace(C.PCT_ENCODED,N).replace(C.NOT_USERINFO,X).replace(C.PCT_ENCODED,i)),A.host!==void 0&&(A.host=String(A.host).replace(C.PCT_ENCODED,N).toLowerCase().replace(C.NOT_HOST,X).replace(C.PCT_ENCODED,i)),A.path!==void 0&&(A.path=String(A.path).replace(C.PCT_ENCODED,N).replace(A.scheme?C.NOT_PATH:C.NOT_PATH_NOSCHEME,X).replace(C.PCT_ENCODED,i)),A.query!==void 0&&(A.query=String(A.query).replace(C.PCT_ENCODED,N).replace(C.NOT_QUERY,X).replace(C.PCT_ENCODED,i)),A.fragment!==void 0&&(A.fragment=String(A.fragment).replace(C.PCT_ENCODED,N).replace(C.NOT_FRAGMENT,X).replace(C.PCT_ENCODED,i)),A}function Z(A){return A.replace(/^0*(.*)/,"$1")||"0"}function pe(A,C){var N=A.match(C.IPV4ADDRESS)||[],V=f(N,2),L=V[1];return L?L.split(".").map(Z).join("."):A}function ee(A,C){var N=A.match(C.IPV6ADDRESS)||[],V=f(N,3),L=V[1],de=V[2];if(L){for(var he=L.toLowerCase().split("::").reverse(),je=f(he,2),Ue=je[0],Ze=je[1],Ae=Ze?Ze.split(":").map(Z):[],Le=Ue.split(":").map(Z),Qe=C.IPV4ADDRESS.test(Le[Le.length-1]),Ce=Qe?7:8,Be=Le.length-Ce,Je=Array(Ce),Ke=0;Ke<Ce;++Ke)Je[Ke]=Ae[Ke]||Le[Be+Ke]||"";Qe&&(Je[Ce-1]=pe(Je[Ce-1],C));var ar=Je.reduce(function(yt,Nt,_r){if(!Nt||Nt==="0"){var qt=yt[yt.length-1];qt&&qt.index+qt.length===_r?qt.length++:yt.push({index:_r,length:1})}return yt},[]),It=ar.sort(function(yt,Nt){return Nt.length-yt.length})[0],At=void 0;if(It&&It.length>1){var Mr=Je.slice(0,It.index),wr=Je.slice(It.index+It.length);At=Mr.join(":")+"::"+wr.join(":")}else At=Je.join(":");return de&&(At+="%"+de),At}else return A}var ae=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Se="".match(/(){0}/)[1]===void 0;function ce(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N={},V=C.iri!==!1?m:h;C.reference==="suffix"&&(A=(C.scheme?C.scheme+":":"")+"//"+A);var L=A.match(ae);if(L){Se?(N.scheme=L[1],N.userinfo=L[3],N.host=L[4],N.port=parseInt(L[5],10),N.path=L[6]||"",N.query=L[7],N.fragment=L[8],isNaN(N.port)&&(N.port=L[5])):(N.scheme=L[1]||void 0,N.userinfo=A.indexOf("@")!==-1?L[3]:void 0,N.host=A.indexOf("//")!==-1?L[4]:void 0,N.port=parseInt(L[5],10),N.path=L[6]||"",N.query=A.indexOf("?")!==-1?L[7]:void 0,N.fragment=A.indexOf("#")!==-1?L[8]:void 0,isNaN(N.port)&&(N.port=A.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?L[4]:void 0)),N.host&&(N.host=ee(pe(N.host,V),V)),N.scheme===void 0&&N.userinfo===void 0&&N.host===void 0&&N.port===void 0&&!N.path&&N.query===void 0?N.reference="same-document":N.scheme===void 0?N.reference="relative":N.fragment===void 0?N.reference="absolute":N.reference="uri",C.reference&&C.reference!=="suffix"&&C.reference!==N.reference&&(N.error=N.error||"URI is not a "+C.reference+" reference.");var de=$[(C.scheme||N.scheme||"").toLowerCase()];if(!C.unicodeSupport&&(!de||!de.unicodeSupport)){if(N.host&&(C.domainHost||de&&de.domainHost))try{N.host=k.toASCII(N.host.replace(V.PCT_ENCODED,ne).toLowerCase())}catch(he){N.error=N.error||"Host's domain name can not be converted to ASCII via punycode: "+he}U(N,h)}else U(N,V);de&&de.parse&&de.parse(N,C)}else N.error=N.error||"URI can not be parsed.";return N}function be(A,C){var N=C.iri!==!1?m:h,V=[];return A.userinfo!==void 0&&(V.push(A.userinfo),V.push("@")),A.host!==void 0&&V.push(ee(pe(String(A.host),N),N).replace(N.IPV6ADDRESS,function(L,de,he){return"["+de+(he?"%25"+he:"")+"]"})),(typeof A.port=="number"||typeof A.port=="string")&&(V.push(":"),V.push(String(A.port))),V.length?V.join(""):void 0}var $e=/^\.\.?\//,_e=/^\/\.(\/|$)/,Fe=/^\/\.\.(\/|$)/,ze=/^\/?(?:.|\n)*?(?=\/|$)/;function qe(A){for(var C=[];A.length;)if(A.match($e))A=A.replace($e,"");else if(A.match(_e))A=A.replace(_e,"/");else if(A.match(Fe))A=A.replace(Fe,"/"),C.pop();else if(A==="."||A==="..")A="";else{var N=A.match(ze);if(N){var V=N[0];A=A.slice(V.length),C.push(V)}else throw new Error("Unexpected dot segment condition")}return C.join("")}function Ge(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=C.iri?m:h,V=[],L=$[(C.scheme||A.scheme||"").toLowerCase()];if(L&&L.serialize&&L.serialize(A,C),A.host&&!N.IPV6ADDRESS.test(A.host)){if(C.domainHost||L&&L.domainHost)try{A.host=C.iri?k.toUnicode(A.host):k.toASCII(A.host.replace(N.PCT_ENCODED,ne).toLowerCase())}catch(je){A.error=A.error||"Host's domain name can not be converted to "+(C.iri?"Unicode":"ASCII")+" via punycode: "+je}}U(A,N),C.reference!=="suffix"&&A.scheme&&(V.push(A.scheme),V.push(":"));var de=be(A,C);if(de!==void 0&&(C.reference!=="suffix"&&V.push("//"),V.push(de),A.path&&A.path.charAt(0)!=="/"&&V.push("/")),A.path!==void 0){var he=A.path;!C.absolutePath&&(!L||!L.absolutePath)&&(he=qe(he)),de===void 0&&(he=he.replace(/^\/\//,"/%2F")),V.push(he)}return A.query!==void 0&&(V.push("?"),V.push(A.query)),A.fragment!==void 0&&(V.push("#"),V.push(A.fragment)),V.join("")}function rt(A,C){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},V=arguments[3],L={};return V||(A=ce(Ge(A,N),N),C=ce(Ge(C,N),N)),N=N||{},!N.tolerant&&C.scheme?(L.scheme=C.scheme,L.userinfo=C.userinfo,L.host=C.host,L.port=C.port,L.path=qe(C.path||""),L.query=C.query):(C.userinfo!==void 0||C.host!==void 0||C.port!==void 0?(L.userinfo=C.userinfo,L.host=C.host,L.port=C.port,L.path=qe(C.path||""),L.query=C.query):(C.path?(C.path.charAt(0)==="/"?L.path=qe(C.path):((A.userinfo!==void 0||A.host!==void 0||A.port!==void 0)&&!A.path?L.path="/"+C.path:A.path?L.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+C.path:L.path=C.path,L.path=qe(L.path)),L.query=C.query):(L.path=A.path,C.query!==void 0?L.query=C.query:L.query=A.query),L.userinfo=A.userinfo,L.host=A.host,L.port=A.port),L.scheme=A.scheme),L.fragment=C.fragment,L}function nt(A,C,N){var V=c({scheme:"null"},N);return Ge(rt(ce(A,V),ce(C,V),V,!0),V)}function ht(A,C){return typeof A=="string"?A=Ge(ce(A,C),C):s(A)==="object"&&(A=ce(Ge(A,C),C)),A}function xr(A,C,N){return typeof A=="string"?A=Ge(ce(A,N),N):s(A)==="object"&&(A=Ge(A,N)),typeof C=="string"?C=Ge(ce(C,N),N):s(C)==="object"&&(C=Ge(C,N)),A===C}function ka(A,C){return A&&A.toString().replace(!C||!C.iri?h.ESCAPE:m.ESCAPE,X)}function mt(A,C){return A&&A.toString().replace(!C||!C.iri?h.PCT_ENCODED:m.PCT_ENCODED,ne)}var Yr={scheme:"http",domainHost:!0,parse:function(C,N){return C.host||(C.error=C.error||"HTTP URIs must have a host."),C},serialize:function(C,N){var V=String(C.scheme).toLowerCase()==="https";return(C.port===(V?443:80)||C.port==="")&&(C.port=void 0),C.path||(C.path="/"),C}},Oi={scheme:"https",domainHost:Yr.domainHost,parse:Yr.parse,serialize:Yr.serialize};function ki(A){return typeof A.secure=="boolean"?A.secure:String(A.scheme).toLowerCase()==="wss"}var en={scheme:"ws",domainHost:!0,parse:function(C,N){var V=C;return V.secure=ki(V),V.resourceName=(V.path||"/")+(V.query?"?"+V.query:""),V.path=void 0,V.query=void 0,V},serialize:function(C,N){if((C.port===(ki(C)?443:80)||C.port==="")&&(C.port=void 0),typeof C.secure=="boolean"&&(C.scheme=C.secure?"wss":"ws",C.secure=void 0),C.resourceName){var V=C.resourceName.split("?"),L=f(V,2),de=L[0],he=L[1];C.path=de&&de!=="/"?de:void 0,C.query=he,C.resourceName=void 0}return C.fragment=void 0,C}},Mi={scheme:"wss",domainHost:en.domainHost,parse:en.parse,serialize:en.serialize},uh={},Di="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Pt="[0-9A-Fa-f]",dh=r(r("%[EFef]"+Pt+"%"+Pt+Pt+"%"+Pt+Pt)+"|"+r("%[89A-Fa-f]"+Pt+"%"+Pt+Pt)+"|"+r("%"+Pt+Pt)),fh="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",hh="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",mh=a(hh,'[\\"\\\\]'),ph="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",gh=new RegExp(Di,"g"),kr=new RegExp(dh,"g"),vh=new RegExp(a("[^]",fh,"[\\.]",'[\\"]',mh),"g"),Fi=new RegExp(a("[^]",Di,ph),"g"),yh=Fi;function Ma(A){var C=ne(A);return C.match(gh)?C:A}var $i={scheme:"mailto",parse:function(C,N){var V=C,L=V.to=V.path?V.path.split(","):[];if(V.path=void 0,V.query){for(var de=!1,he={},je=V.query.split("&"),Ue=0,Ze=je.length;Ue<Ze;++Ue){var Ae=je[Ue].split("=");switch(Ae[0]){case"to":for(var Le=Ae[1].split(","),Qe=0,Ce=Le.length;Qe<Ce;++Qe)L.push(Le[Qe]);break;case"subject":V.subject=mt(Ae[1],N);break;case"body":V.body=mt(Ae[1],N);break;default:de=!0,he[mt(Ae[0],N)]=mt(Ae[1],N);break}}de&&(V.headers=he)}V.query=void 0;for(var Be=0,Je=L.length;Be<Je;++Be){var Ke=L[Be].split("@");if(Ke[0]=mt(Ke[0]),N.unicodeSupport)Ke[1]=mt(Ke[1],N).toLowerCase();else try{Ke[1]=k.toASCII(mt(Ke[1],N).toLowerCase())}catch(ar){V.error=V.error||"Email address's domain name can not be converted to ASCII via punycode: "+ar}L[Be]=Ke.join("@")}return V},serialize:function(C,N){var V=C,L=o(C.to);if(L){for(var de=0,he=L.length;de<he;++de){var je=String(L[de]),Ue=je.lastIndexOf("@"),Ze=je.slice(0,Ue).replace(kr,Ma).replace(kr,i).replace(vh,X),Ae=je.slice(Ue+1);try{Ae=N.iri?k.toUnicode(Ae):k.toASCII(mt(Ae,N).toLowerCase())}catch(Be){V.error=V.error||"Email address's domain name can not be converted to "+(N.iri?"Unicode":"ASCII")+" via punycode: "+Be}L[de]=Ze+"@"+Ae}V.path=L.join(",")}var Le=C.headers=C.headers||{};C.subject&&(Le.subject=C.subject),C.body&&(Le.body=C.body);var Qe=[];for(var Ce in Le)Le[Ce]!==uh[Ce]&&Qe.push(Ce.replace(kr,Ma).replace(kr,i).replace(Fi,X)+"="+Le[Ce].replace(kr,Ma).replace(kr,i).replace(yh,X));return Qe.length&&(V.query=Qe.join("&")),V}},xh=/^([^\:]+)\:(.*)/,Li={scheme:"urn",parse:function(C,N){var V=C.path&&C.path.match(xh),L=C;if(V){var de=N.scheme||L.scheme||"urn",he=V[1].toLowerCase(),je=V[2],Ue=de+":"+(N.nid||he),Ze=$[Ue];L.nid=he,L.nss=je,L.path=void 0,Ze&&(L=Ze.parse(L,N))}else L.error=L.error||"URN can not be parsed.";return L},serialize:function(C,N){var V=N.scheme||C.scheme||"urn",L=C.nid,de=V+":"+(N.nid||L),he=$[de];he&&(C=he.serialize(C,N));var je=C,Ue=C.nss;return je.path=(L||N.nid)+":"+Ue,je}},wh=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Vi={scheme:"urn:uuid",parse:function(C,N){var V=C;return V.uuid=V.nss,V.nss=void 0,!N.tolerant&&(!V.uuid||!V.uuid.match(wh))&&(V.error=V.error||"UUID is not valid."),V},serialize:function(C,N){var V=C;return V.nss=(C.uuid||"").toLowerCase(),V}};$[Yr.scheme]=Yr,$[Oi.scheme]=Oi,$[en.scheme]=en,$[Mi.scheme]=Mi,$[$i.scheme]=$i,$[Li.scheme]=Li,$[Vi.scheme]=Vi,n.SCHEMES=$,n.pctEncChar=X,n.pctDecChars=ne,n.parse=ce,n.removeDotSegments=qe,n.serialize=Ge,n.resolveComponents=rt,n.resolve=nt,n.normalize=ht,n.equal=xr,n.escapeComponent=ka,n.unescapeComponent=mt,Object.defineProperty(n,"__esModule",{value:!0})}))})(ln,ln.exports)),ln.exports}var hs,ac;function Ni(){return ac||(ac=1,hs=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var a,r,s;if(Array.isArray(e)){if(a=e.length,a!=n.length)return!1;for(r=a;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),a=s.length,a!==Object.keys(n).length)return!1;for(r=a;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=a;r--!==0;){var i=s[r];if(!t(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}),hs}var ms,sc;function pS(){return sc||(sc=1,ms=function(e){for(var n=0,a=e.length,r=0,s;r<a;)n++,s=e.charCodeAt(r++),s>=55296&&s<=56319&&r<a&&(s=e.charCodeAt(r),(s&64512)==56320&&r++);return n}),ms}var ps,oc;function Xr(){if(oc)return ps;oc=1,ps={copy:t,checkDataType:e,checkDataTypes:n,coerceToTypes:r,toHash:s,getProperty:c,escapeQuotes:u,equal:Ni(),ucs2length:pS(),varOccurences:h,varReplace:m,schemaHasRules:f,schemaHasRulesExcept:l,schemaUnknownRules:p,toQuotedString:g,getPathExpr:v,getPath:y,getData:w,unescapeFragment:I,unescapeJsonPointer:T,escapeFragment:E,escapeJsonPointer:R};function t(P,O){O=O||{};for(var M in P)O[M]=P[M];return O}function e(P,O,M,z){var D=z?" !== ":" === ",W=z?" || ":" && ",H=z?"!":"",J=z?"":"!";switch(P){case"null":return O+D+"null";case"array":return H+"Array.isArray("+O+")";case"object":return"("+H+O+W+"typeof "+O+D+'"object"'+W+J+"Array.isArray("+O+"))";case"integer":return"(typeof "+O+D+'"number"'+W+J+"("+O+" % 1)"+W+O+D+O+(M?W+H+"isFinite("+O+")":"")+")";case"number":return"(typeof "+O+D+'"'+P+'"'+(M?W+H+"isFinite("+O+")":"")+")";default:return"typeof "+O+D+'"'+P+'"'}}function n(P,O,M){switch(P.length){case 1:return e(P[0],O,M,!0);default:var z="",D=s(P);D.array&&D.object&&(z=D.null?"(":"(!"+O+" || ",z+="typeof "+O+' !== "object")',delete D.null,delete D.array,delete D.object),D.number&&delete D.integer;for(var W in D)z+=(z?" && ":"")+e(W,O,M,!0);return z}}var a=s(["string","number","integer","boolean","null"]);function r(P,O){if(Array.isArray(O)){for(var M=[],z=0;z<O.length;z++){var D=O[z];(a[D]||P==="array"&&D==="array")&&(M[M.length]=D)}if(M.length)return M}else{if(a[O])return[O];if(P==="array"&&O==="array")return["array"]}}function s(P){for(var O={},M=0;M<P.length;M++)O[P[M]]=!0;return O}var i=/^[a-z$_][a-z$_0-9]*$/i,o=/'|\\/g;function c(P){return typeof P=="number"?"["+P+"]":i.test(P)?"."+P:"['"+u(P)+"']"}function u(P){return P.replace(o,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function h(P,O){O+="[^0-9]";var M=P.match(new RegExp(O,"g"));return M?M.length:0}function m(P,O,M){return O+="([^0-9])",M=M.replace(/\$/g,"$$$$"),P.replace(new RegExp(O,"g"),M+"$1")}function f(P,O){if(typeof P=="boolean")return!P;for(var M in P)if(O[M])return!0}function l(P,O,M){if(typeof P=="boolean")return!P&&M!="not";for(var z in P)if(z!=M&&O[z])return!0}function p(P,O){if(typeof P!="boolean"){for(var M in P)if(!O[M])return M}}function g(P){return"'"+u(P)+"'"}function v(P,O,M,z){var D=M?"'/' + "+O+(z?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):z?"'[' + "+O+" + ']'":"'[\\'' + "+O+" + '\\']'";return b(P,D)}function y(P,O,M){var z=g(M?"/"+R(O):c(O));return b(P,z)}var _=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function w(P,O,M){var z,D,W,H;if(P==="")return"rootData";if(P[0]=="/"){if(!_.test(P))throw new Error("Invalid JSON-pointer: "+P);D=P,W="rootData"}else{if(H=P.match(x),!H)throw new Error("Invalid JSON-pointer: "+P);if(z=+H[1],D=H[2],D=="#"){if(z>=O)throw new Error("Cannot access property/index "+z+" levels up, current level is "+O);return M[O-z]}if(z>O)throw new Error("Cannot access data "+z+" levels up, current level is "+O);if(W="data"+(O-z||""),!D)return W}for(var J=W,F=D.split("/"),q=0;q<F.length;q++){var K=F[q];K&&(W+=c(T(K)),J+=" && "+W)}return J}function b(P,O){return P=='""'?O:(P+" + "+O).replace(/([^\\])' \+ '/g,"$1")}function I(P){return T(decodeURIComponent(P))}function E(P){return encodeURIComponent(R(P))}function R(P){return P.replace(/~/g,"~0").replace(/\//g,"~1")}function T(P){return P.replace(/~1/g,"/").replace(/~0/g,"~")}return ps}var gs,ic;function oh(){if(ic)return gs;ic=1;var t=Xr();gs=e;function e(n){t.copy(n,this)}return gs}var vs={exports:{}},lc;function gS(){if(lc)return vs.exports;lc=1;var t=vs.exports=function(a,r,s){typeof r=="function"&&(s=r,r={}),s=r.cb||s;var i=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};e(r,i,o,a,"",a)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(a,r,s,i,o,c,u,h,m,f){if(i&&typeof i=="object"&&!Array.isArray(i)){r(i,o,c,u,h,m,f);for(var l in i){var p=i[l];if(Array.isArray(p)){if(l in t.arrayKeywords)for(var g=0;g<p.length;g++)e(a,r,s,p[g],o+"/"+l+"/"+g,c,o,l,i,g)}else if(l in t.propsKeywords){if(p&&typeof p=="object")for(var v in p)e(a,r,s,p[v],o+"/"+l+"/"+n(v),c,o,l,i,v)}else(l in t.keywords||a.allKeys&&!(l in t.skipKeywords))&&e(a,r,s,p,o+"/"+l,c,o,l,i)}s(i,o,c,u,h,m,f)}}function n(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}return vs.exports}var ys,cc;function ji(){if(cc)return ys;cc=1;var t=mS(),e=Ni(),n=Xr(),a=oh(),r=gS();ys=s,s.normalizeId=y,s.fullPath=p,s.url=_,s.ids=x,s.inlineRef=m,s.schema=i;function s(w,b,I){var E=this._refs[I];if(typeof E=="string")if(this._refs[E])E=this._refs[E];else return s.call(this,w,b,E);if(E=E||this._schemas[I],E instanceof a)return m(E.schema,this._opts.inlineRefs)?E.schema:E.validate||this._compile(E);var R=i.call(this,b,I),T,P,O;return R&&(T=R.schema,b=R.root,O=R.baseId),T instanceof a?P=T.validate||w.call(this,T.schema,b,void 0,O):T!==void 0&&(P=m(T,this._opts.inlineRefs)?T:w.call(this,T,b,void 0,O)),P}function i(w,b){var I=t.parse(b),E=g(I),R=p(this._getId(w.schema));if(Object.keys(w.schema).length===0||E!==R){var T=y(E),P=this._refs[T];if(typeof P=="string")return o.call(this,w,P,I);if(P instanceof a)P.validate||this._compile(P),w=P;else if(P=this._schemas[T],P instanceof a){if(P.validate||this._compile(P),T==y(b))return{schema:P,root:w,baseId:R};w=P}else return;if(!w.schema)return;R=p(this._getId(w.schema))}return u.call(this,I,R,w.schema,w)}function o(w,b,I){var E=i.call(this,w,b);if(E){var R=E.schema,T=E.baseId;w=E.root;var P=this._getId(R);return P&&(T=_(T,P)),u.call(this,I,T,R,w)}}var c=n.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function u(w,b,I,E){if(w.fragment=w.fragment||"",w.fragment.slice(0,1)=="/"){for(var R=w.fragment.split("/"),T=1;T<R.length;T++){var P=R[T];if(P){if(P=n.unescapeFragment(P),I=I[P],I===void 0)break;var O;if(!c[P]&&(O=this._getId(I),O&&(b=_(b,O)),I.$ref)){var M=_(b,I.$ref),z=i.call(this,E,M);z&&(I=z.schema,E=z.root,b=z.baseId)}}}if(I!==void 0&&I!==E.schema)return{schema:I,root:E,baseId:b}}}var h=n.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function m(w,b){if(b===!1)return!1;if(b===void 0||b===!0)return f(w);if(b)return l(w)<=b}function f(w){var b;if(Array.isArray(w)){for(var I=0;I<w.length;I++)if(b=w[I],typeof b=="object"&&!f(b))return!1}else for(var E in w)if(E=="$ref"||(b=w[E],typeof b=="object"&&!f(b)))return!1;return!0}function l(w){var b=0,I;if(Array.isArray(w)){for(var E=0;E<w.length;E++)if(I=w[E],typeof I=="object"&&(b+=l(I)),b==1/0)return 1/0}else for(var R in w){if(R=="$ref")return 1/0;if(h[R])b++;else if(I=w[R],typeof I=="object"&&(b+=l(I)+1),b==1/0)return 1/0}return b}function p(w,b){b!==!1&&(w=y(w));var I=t.parse(w);return g(I)}function g(w){return t.serialize(w).split("#")[0]+"#"}var v=/#\/?$/;function y(w){return w?w.replace(v,""):""}function _(w,b){return b=y(b),t.resolve(w,b)}function x(w){var b=y(this._getId(w)),I={"":b},E={"":p(b,!1)},R={},T=this;return r(w,{allKeys:!0},function(P,O,M,z,D,W,H){if(O!==""){var J=T._getId(P),F=I[z],q=E[z]+"/"+D;if(H!==void 0&&(q+="/"+(typeof H=="number"?H:n.escapeFragment(H))),typeof J=="string"){J=F=y(F?t.resolve(F,J):J);var K=T._refs[J];if(typeof K=="string"&&(K=T._refs[K]),K&&K.schema){if(!e(P,K.schema))throw new Error('id "'+J+'" resolves to more than one schema')}else if(J!=y(q))if(J[0]=="#"){if(R[J]&&!e(P,R[J]))throw new Error('id "'+J+'" resolves to more than one schema');R[J]=P}else T._refs[J]=q}I[O]=F,E[O]=q}}),R}return ys}var xs,uc;function Ti(){if(uc)return xs;uc=1;var t=ji();xs={Validation:a(e),MissingRef:a(n)};function e(r){this.message="validation failed",this.errors=r,this.ajv=this.validation=!0}n.message=function(r,s){return"can't resolve reference "+s+" from id "+r};function n(r,s,i){this.message=i||n.message(r,s),this.missingRef=t.url(r,s),this.missingSchema=t.normalizeId(t.fullPath(this.missingRef))}function a(r){return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}return xs}var ws,dc;function ih(){return dc||(dc=1,ws=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var n=typeof e.cycles=="boolean"?e.cycles:!1,a=e.cmp&&(function(s){return function(i){return function(o,c){var u={key:o,value:i[o]},h={key:c,value:i[c]};return s(u,h)}}})(e.cmp),r=[];return(function s(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i!==void 0){if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);var o,c;if(Array.isArray(i)){for(c="[",o=0;o<i.length;o++)o&&(c+=","),c+=s(i[o])||"null";return c+"]"}if(i===null)return"null";if(r.indexOf(i)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=r.push(i)-1,h=Object.keys(i).sort(a&&a(i));for(c="",o=0;o<h.length;o++){var m=h[o],f=s(i[m]);f&&(c&&(c+=","),c+=JSON.stringify(m)+":"+f)}return r.splice(u,1),"{"+c+"}"}})(t)}),ws}var _s,fc;function lh(){return fc||(fc=1,_s=function(e,n,a){var r="",s=e.schema.$async===!0,i=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var u="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(r+=" var validate = ",s&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" "+("/*# sourceURL="+o+" */")+" ")),typeof e.schema=="boolean"||!(i||e.schema.$ref)){var n="false schema",h=e.level,m=e.dataLevel,f=e.schema[n],l=e.schemaPath+e.util.getProperty(n),p=e.errSchemaPath+"/"+n,b=!e.opts.allErrors,R,g="data"+(m||""),w="valid"+h;if(e.schema===!1){e.isTop?b=!0:r+=" var "+w+" = false; ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(R||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?s?r+=" return data; ":r+=" validate.errors = null; return true; ":r+=" var "+w+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var _=e.isTop,h=e.level=0,m=e.dataLevel=0,g="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var x="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var h=e.level,m=e.dataLevel,g="data"+(m||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),s&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+h+" = errors;"}var w="valid"+h,b=!e.opts.allErrors,I="",E="",R,T=e.schema.type,P=Array.isArray(T);if(T&&e.opts.nullable&&e.schema.nullable===!0&&(P?T.indexOf("null")==-1&&(T=T.concat("null")):T!="null"&&(T=[T,"null"],P=!0)),P&&T.length==1&&(T=T[0],P=!1),e.schema.$ref&&i){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(i=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),T){if(e.opts.coerceTypes)var O=e.util.coerceToTypes(e.opts.coerceTypes,T);var M=e.RULES.types[T];if(O||P||M===!0||M&&!_e(M)){var l=e.schemaPath+".type",p=e.errSchemaPath+"/type",l=e.schemaPath+".type",p=e.errSchemaPath+"/type",z=P?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[z](T,g,e.opts.strictNumbers,!0)+") { ",O){var D="dataType"+h,W="coerced"+h;r+=" var "+D+" = typeof "+g+"; var "+W+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+D+" == 'object' && Array.isArray("+g+") && "+g+".length == 1) { "+g+" = "+g+"[0]; "+D+" = typeof "+g+"; if ("+e.util.checkDataType(e.schema.type,g,e.opts.strictNumbers)+") "+W+" = "+g+"; } "),r+=" if ("+W+" !== undefined) ; ";var H=O;if(H)for(var J,F=-1,q=H.length-1;F<q;)J=H[F+=1],J=="string"?r+=" else if ("+D+" == 'number' || "+D+" == 'boolean') "+W+" = '' + "+g+"; else if ("+g+" === null) "+W+" = ''; ":J=="number"||J=="integer"?(r+=" else if ("+D+" == 'boolean' || "+g+" === null || ("+D+" == 'string' && "+g+" && "+g+" == +"+g+" ",J=="integer"&&(r+=" && !("+g+" % 1)"),r+=")) "+W+" = +"+g+"; "):J=="boolean"?r+=" else if ("+g+" === 'false' || "+g+" === 0 || "+g+" === null) "+W+" = false; else if ("+g+" === 'true' || "+g+" === 1) "+W+" = true; ":J=="null"?r+=" else if ("+g+" === '' || "+g+" === 0 || "+g+" === false) "+W+" = null; ":e.opts.coerceTypes=="array"&&J=="array"&&(r+=" else if ("+D+" == 'string' || "+D+" == 'number' || "+D+" == 'boolean' || "+g+" == null) "+W+" = ["+g+"]; ");r+=" else { ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(R||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",P?r+=""+T.join(","):r+=""+T,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",P?r+=""+T.join(","):r+=""+T,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+W+" !== undefined) { ";var K=m?"data"+(m-1||""):"parentData",re=m?e.dataPathArr[m]:"parentDataProperty";r+=" "+g+" = "+W+"; ",m||(r+="if ("+K+" !== undefined)"),r+=" "+K+"["+re+"] = "+W+"; } "}else{var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(R||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",P?r+=""+T.join(","):r+=""+T,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",P?r+=""+T.join(","):r+=""+T,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!i)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",b&&(r+=" } if (errors === ",_?r+="0":r+="errs_"+h,r+=") { ",E+="}");else{var fe=e.RULES;if(fe){for(var M,me=-1,ye=fe.length-1;me<ye;)if(M=fe[me+=1],_e(M)){if(M.type&&(r+=" if ("+e.util.checkDataType(M.type,g,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(M.type=="object"&&e.schema.properties){var f=e.schema.properties,Me=Object.keys(f),k=Me;if(k)for(var $,X=-1,ne=k.length-1;X<ne;){$=k[X+=1];var U=f[$];if(U.default!==void 0){var Z=g+e.util.getProperty($);if(e.compositeRule){if(e.opts.strictDefaults){var x="default is ignored for: "+Z;if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}}else r+=" if ("+Z+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+Z+" === null || "+Z+" === '' "),r+=" ) "+Z+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(U.default)+" ":r+=" "+JSON.stringify(U.default)+" ",r+="; "}}}else if(M.type=="array"&&Array.isArray(e.schema.items)){var pe=e.schema.items;if(pe){for(var U,F=-1,ee=pe.length-1;F<ee;)if(U=pe[F+=1],U.default!==void 0){var Z=g+"["+F+"]";if(e.compositeRule){if(e.opts.strictDefaults){var x="default is ignored for: "+Z;if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}}else r+=" if ("+Z+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+Z+" === null || "+Z+" === '' "),r+=" ) "+Z+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(U.default)+" ":r+=" "+JSON.stringify(U.default)+" ",r+="; "}}}}var ae=M.rules;if(ae){for(var Se,ce=-1,be=ae.length-1;ce<be;)if(Se=ae[ce+=1],Fe(Se)){var $e=Se.code(e,Se.keyword,M.type);$e&&(r+=" "+$e+" ",b&&(I+="}"))}}if(b&&(r+=" "+I+" ",I=""),M.type&&(r+=" } ",T&&T===M.type&&!O)){r+=" else { ";var l=e.schemaPath+".type",p=e.errSchemaPath+"/type",v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(R||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",P?r+=""+T.join(","):r+=""+T,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",P?r+=""+T.join(","):r+=""+T,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}b&&(r+=" if (errors === ",_?r+="0":r+="errs_"+h,r+=") { ",E+="}")}}}b&&(r+=" "+E+" "),_?(s?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+w+" = errors === errs_"+h+";";function _e(qe){for(var Ge=qe.rules,rt=0;rt<Ge.length;rt++)if(Fe(Ge[rt]))return!0}function Fe(qe){return e.schema[qe.keyword]!==void 0||qe.implements&&ze(qe)}function ze(qe){for(var Ge=qe.implements,rt=0;rt<Ge.length;rt++)if(e.schema[Ge[rt]]!==void 0)return!0}return r}),_s}var Ss,hc;function vS(){if(hc)return Ss;hc=1;var t=ji(),e=Xr(),n=Ti(),a=ih(),r=lh(),s=e.ucs2length,i=Ni(),o=n.Validation;Ss=c;function c(y,_,x,w){var b=this,I=this._opts,E=[void 0],R={},T=[],P={},O=[],M={},z=[];_=_||{schema:y,refVal:E,refs:R};var D=u.call(this,y,_,w),W=this._compilations[D.index];if(D.compiling)return W.callValidate=K;var H=this._formats,J=this.RULES;try{var F=re(y,_,x,w);W.validate=F;var q=W.callValidate;return q&&(q.schema=F.schema,q.errors=null,q.refs=F.refs,q.refVal=F.refVal,q.root=F.root,q.$async=F.$async,I.sourceCode&&(q.source=F.source)),F}finally{h.call(this,y,_,w)}function K(){var U=W.validate,Z=U.apply(this,arguments);return K.errors=U.errors,Z}function re(U,Z,pe,ee){var ae=!Z||Z&&Z.schema==U;if(Z.schema!=_.schema)return c.call(b,U,Z,pe,ee);var Se=U.$async===!0,ce=r({isTop:!0,schema:U,isRoot:ae,baseId:ee,root:Z,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:n.MissingRef,RULES:J,validate:r,util:e,resolve:t,resolveRef:fe,usePattern:$,useDefault:X,useCustomRule:ne,opts:I,formats:H,logger:b.logger,self:b});ce=v(E,p)+v(T,f)+v(O,l)+v(z,g)+ce,I.processCode&&(ce=I.processCode(ce,U));var be;try{var $e=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",ce);be=$e(b,J,H,_,E,O,z,i,s,o),E[0]=be}catch(_e){throw b.logger.error("Error compiling schema, function code:",ce),_e}return be.schema=U,be.errors=null,be.refs=R,be.refVal=E,be.root=ae?be:Z,Se&&(be.$async=!0),I.sourceCode===!0&&(be.source={code:ce,patterns:T,defaults:O}),be}function fe(U,Z,pe){Z=t.url(U,Z);var ee=R[Z],ae,Se;if(ee!==void 0)return ae=E[ee],Se="refVal["+ee+"]",k(ae,Se);if(!pe&&_.refs){var ce=_.refs[Z];if(ce!==void 0)return ae=_.refVal[ce],Se=me(Z,ae),k(ae,Se)}Se=me(Z);var be=t.call(b,re,_,Z);if(be===void 0){var $e=x&&x[Z];$e&&(be=t.inlineRef($e,I.inlineRefs)?$e:c.call(b,$e,_,x,U))}if(be===void 0)ye(Z);else return Me(Z,be),k(be,Se)}function me(U,Z){var pe=E.length;return E[pe]=Z,R[U]=pe,"refVal"+pe}function ye(U){delete R[U]}function Me(U,Z){var pe=R[U];E[pe]=Z}function k(U,Z){return typeof U=="object"||typeof U=="boolean"?{code:Z,schema:U,inline:!0}:{code:Z,$async:U&&!!U.$async}}function $(U){var Z=P[U];return Z===void 0&&(Z=P[U]=T.length,T[Z]=U),"pattern"+Z}function X(U){switch(typeof U){case"boolean":case"number":return""+U;case"string":return e.toQuotedString(U);case"object":if(U===null)return"null";var Z=a(U),pe=M[Z];return pe===void 0&&(pe=M[Z]=O.length,O[pe]=U),"default"+pe}}function ne(U,Z,pe,ee){if(b._opts.validateSchema!==!1){var ae=U.definition.dependencies;if(ae&&!ae.every(function(Ge){return Object.prototype.hasOwnProperty.call(pe,Ge)}))throw new Error("parent schema must have all required keywords: "+ae.join(","));var Se=U.definition.validateSchema;if(Se){var ce=Se(Z);if(!ce){var be="keyword schema is invalid: "+b.errorsText(Se.errors);if(b._opts.validateSchema=="log")b.logger.error(be);else throw new Error(be)}}}var $e=U.definition.compile,_e=U.definition.inline,Fe=U.definition.macro,ze;if($e)ze=$e.call(b,Z,pe,ee);else if(Fe)ze=Fe.call(b,Z,pe,ee),I.validateSchema!==!1&&b.validateSchema(ze,!0);else if(_e)ze=_e.call(b,ee,U.keyword,Z,pe);else if(ze=U.definition.validate,!ze)return;if(ze===void 0)throw new Error('custom keyword "'+U.keyword+'"failed to compile');var qe=z.length;return z[qe]=ze,{code:"customRule"+qe,validate:ze}}}function u(y,_,x){var w=m.call(this,y,_,x);return w>=0?{index:w,compiling:!0}:(w=this._compilations.length,this._compilations[w]={schema:y,root:_,baseId:x},{index:w,compiling:!1})}function h(y,_,x){var w=m.call(this,y,_,x);w>=0&&this._compilations.splice(w,1)}function m(y,_,x){for(var w=0;w<this._compilations.length;w++){var b=this._compilations[w];if(b.schema==y&&b.root==_&&b.baseId==x)return w}return-1}function f(y,_){return"var pattern"+y+" = new RegExp("+e.toQuotedString(_[y])+");"}function l(y){return"var default"+y+" = defaults["+y+"];"}function p(y,_){return _[y]===void 0?"":"var refVal"+y+" = refVal["+y+"];"}function g(y){return"var customRule"+y+" = customRules["+y+"];"}function v(y,_){if(!y.length)return"";for(var x="",w=0;w<y.length;w++)x+=_(w,y);return x}return Ss}var bs={exports:{}},mc;function yS(){if(mc)return bs.exports;mc=1;var t=bs.exports=function(){this._cache={}};return t.prototype.put=function(n,a){this._cache[n]=a},t.prototype.get=function(n){return this._cache[n]},t.prototype.del=function(n){delete this._cache[n]},t.prototype.clear=function(){this._cache={}},bs.exports}var Cs,pc;function xS(){if(pc)return Cs;pc=1;var t=Xr(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,r=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,s=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,i=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,o=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,u=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,m=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Cs=l;function l(E){return E=E=="full"?"full":"fast",t.copy(l[E])}l.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":o,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:r,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:u,"json-pointer":h,"json-pointer-uri-fragment":m,"relative-json-pointer":f},l.full={date:g,time:v,"date-time":_,uri:w,"uri-reference":i,"uri-template":o,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:r,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:u,"json-pointer":h,"json-pointer-uri-fragment":m,"relative-json-pointer":f};function p(E){return E%4===0&&(E%100!==0||E%400===0)}function g(E){var R=E.match(e);if(!R)return!1;var T=+R[1],P=+R[2],O=+R[3];return P>=1&&P<=12&&O>=1&&O<=(P==2&&p(T)?29:n[P])}function v(E,R){var T=E.match(a);if(!T)return!1;var P=T[1],O=T[2],M=T[3],z=T[5];return(P<=23&&O<=59&&M<=59||P==23&&O==59&&M==60)&&(!R||z)}var y=/t|\s/i;function _(E){var R=E.split(y);return R.length==2&&g(R[0])&&v(R[1],!0)}var x=/\/|:/;function w(E){return x.test(E)&&s.test(E)}var b=/[^\\]\\Z/;function I(E){if(b.test(E))return!1;try{return new RegExp(E),!0}catch{return!1}}return Cs}var Rs,gc;function wS(){return gc||(gc=1,Rs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.errSchemaPath+"/"+n,u=!e.opts.allErrors,h="data"+(i||""),m="valid"+s,f,l;if(o=="#"||o=="#/")e.isRoot?(f=e.async,l="validate"):(f=e.root.schema.$async===!0,l="root.refVal[0]");else{var p=e.resolveRef(e.baseId,o,e.isRoot);if(p===void 0){var g=e.MissingRefError.message(e.baseId,o);if(e.opts.missingRefs=="fail"){e.logger.error(g);var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(o)+"' } ",e.opts.messages!==!1&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(o)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(o)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(g),u&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,o,g)}else if(p.inline){var _=e.util.copy(e);_.level++;var x="valid"+_.level;_.schema=p.schema,_.schemaPath="",_.errSchemaPath=o;var w=e.validate(_).replace(/validate\.schema/g,p.code);r+=" "+w+" ",u&&(r+=" if ("+x+") { ")}else f=p.$async===!0||e.async&&p.$async!==!1,l=p.code}if(l){var v=v||[];v.push(r),r="",e.opts.passContext?r+=" "+l+".call(this, ":r+=" "+l+"( ",r+=" "+h+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var b=i?"data"+(i-1||""):"parentData",I=i?e.dataPathArr[i]:"parentDataProperty";r+=" , "+b+" , "+I+", rootData) ";var E=r;if(r=v.pop(),f){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(r+=" var "+m+"; "),r+=" try { await "+E+"; ",u&&(r+=" "+m+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(r+=" "+m+" = false; "),r+=" } ",u&&(r+=" if ("+m+") { ")}else r+=" if (!"+E+") { if (vErrors === null) vErrors = "+l+".errors; else vErrors = vErrors.concat("+l+".errors); errors = vErrors.length; } ",u&&(r+=" else { ")}return r}),Rs}var Es,vc;function _S(){return vc||(vc=1,Es=function(e,n,a){var r=" ",s=e.schema[n],i=e.schemaPath+e.util.getProperty(n),o=e.errSchemaPath+"/"+n,c=!e.opts.allErrors,u=e.util.copy(e),h="";u.level++;var m="valid"+u.level,f=u.baseId,l=!0,p=s;if(p)for(var g,v=-1,y=p.length-1;v<y;)g=p[v+=1],(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:e.util.schemaHasRules(g,e.RULES.all))&&(l=!1,u.schema=g,u.schemaPath=i+"["+v+"]",u.errSchemaPath=o+"/"+v,r+=" "+e.validate(u)+" ",u.baseId=f,c&&(r+=" if ("+m+") { ",h+="}"));return c&&(l?r+=" if (true) { ":r+=" "+h.slice(0,-1)+" "),r}),Es}var Ps,yc;function SS(){return yc||(yc=1,Ps=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l="errs__"+s,p=e.util.copy(e),g="";p.level++;var v="valid"+p.level,y=o.every(function(R){return e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all)});if(y){var _=p.baseId;r+=" var "+l+" = errors; var "+f+" = false; ";var x=e.compositeRule;e.compositeRule=p.compositeRule=!0;var w=o;if(w)for(var b,I=-1,E=w.length-1;I<E;)b=w[I+=1],p.schema=b,p.schemaPath=c+"["+I+"]",p.errSchemaPath=u+"/"+I,r+=" "+e.validate(p)+" ",p.baseId=_,r+=" "+f+" = "+f+" || "+v+"; if (!"+f+") { ",g+="}";e.compositeRule=p.compositeRule=x,r+=" "+g+" if (!"+f+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else h&&(r+=" if (true) { ");return r}),Ps}var Is,xc;function bS(){return xc||(xc=1,Is=function(e,n,a){var r=" ",s=e.schema[n],i=e.errSchemaPath+"/"+n;e.opts.allErrors;var o=e.util.toQuotedString(s);return e.opts.$comment===!0?r+=" console.log("+o+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+o+", "+e.util.toQuotedString(i)+", validate.root.schema);"),r}),Is}var As,wc;function CS(){return wc||(wc=1,As=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l=e.opts.$data&&o&&o.$data;l&&(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; "),l||(r+=" var schema"+s+" = validate.schema"+c+";"),r+="var "+f+" = equal("+m+", schema"+s+"); if (!"+f+") { ";var p=p||[];p.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+s+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var g=r;return r=p.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",h&&(r+=" else { "),r}),As}var Ns,_c;function RS(){return _c||(_c=1,Ns=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l="errs__"+s,p=e.util.copy(e),g="";p.level++;var v="valid"+p.level,y="i"+s,_=p.dataLevel=e.dataLevel+1,x="data"+_,w=e.baseId,b=e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all);if(r+="var "+l+" = errors;var "+f+";",b){var I=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=o,p.schemaPath=c,p.errSchemaPath=u,r+=" var "+v+" = false; for (var "+y+" = 0; "+y+" < "+m+".length; "+y+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var E=m+"["+y+"]";p.dataPathArr[_]=y;var R=e.validate(p);p.baseId=w,e.util.varOccurences(R,x)<2?r+=" "+e.util.varReplace(R,x,E)+" ":r+=" var "+x+" = "+E+"; "+R+" ",r+=" if ("+v+") break; } ",e.compositeRule=p.compositeRule=I,r+=" "+g+" if (!"+v+") {"}else r+=" if ("+m+".length == 0) {";var T=T||[];T.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var P=r;return r=T.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",b&&(r+=" errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}),Ns}var js,Sc;function ES(){return Sc||(Sc=1,js=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="errs__"+s,l=e.util.copy(e),p="";l.level++;var g="valid"+l.level,v={},y={},_=e.opts.ownProperties;for(I in o)if(I!="__proto__"){var x=o[I],w=Array.isArray(x)?y:v;w[I]=x}r+="var "+f+" = errors;";var b=e.errorPath;r+="var missing"+s+";";for(var I in y)if(w=y[I],w.length){if(r+=" if ( "+m+e.util.getProperty(I)+" !== undefined ",_&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(I)+"') "),h){r+=" && ( ";var E=w;if(E)for(var R,T=-1,P=E.length-1;T<P;){R=E[T+=1],T&&(r+=" || ");var O=e.util.getProperty(R),M=m+O;r+=" ( ( "+M+" === undefined ",_&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(R)+"') "),r+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?R:O)+") ) "}r+=")) { ";var z="missing"+s,D="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,z,!0):b+" + "+z);var W=W||[];W.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+D+"', depsCount: "+w.length+", deps: '"+e.util.escapeQuotes(w.length==1?w[0]:w.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",w.length==1?r+="property "+e.util.escapeQuotes(w[0]):r+="properties "+e.util.escapeQuotes(w.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var H=r;r=W.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+H+"]); ":r+=" validate.errors = ["+H+"]; return false; ":r+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var J=w;if(J)for(var R,F=-1,q=J.length-1;F<q;){R=J[F+=1];var O=e.util.getProperty(R),D=e.util.escapeQuotes(R),M=m+O;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,R,e.opts.jsonPointers)),r+=" if ( "+M+" === undefined ",_&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(R)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+D+"', depsCount: "+w.length+", deps: '"+e.util.escapeQuotes(w.length==1?w[0]:w.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",w.length==1?r+="property "+e.util.escapeQuotes(w[0]):r+="properties "+e.util.escapeQuotes(w.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",h&&(p+="}",r+=" else { ")}e.errorPath=b;var K=l.baseId;for(var I in v){var x=v[I];(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all))&&(r+=" "+g+" = true; if ( "+m+e.util.getProperty(I)+" !== undefined ",_&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(I)+"') "),r+=") { ",l.schema=x,l.schemaPath=c+e.util.getProperty(I),l.errSchemaPath=u+"/"+e.util.escapeFragment(I),r+=" "+e.validate(l)+" ",l.baseId=K,r+=" } ",h&&(r+=" if ("+g+") { ",p+="}"))}return h&&(r+=" "+p+" if ("+f+" == errors) {"),r}),js}var Ts,bc;function PS(){return bc||(bc=1,Ts=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l=e.opts.$data&&o&&o.$data;l&&(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var p="i"+s,g="schema"+s;l||(r+=" var "+g+" = validate.schema"+c+";"),r+="var "+f+";",l&&(r+=" if (schema"+s+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+s+")) "+f+" = false; else {"),r+=""+f+" = false;for (var "+p+"=0; "+p+"<"+g+".length; "+p+"++) if (equal("+m+", "+g+"["+p+"])) { "+f+" = true; break; }",l&&(r+=" } "),r+=" if (!"+f+") { ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+s+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",h&&(r+=" else { "),r}),Ts}var Os,Cc;function IS(){return Cc||(Cc=1,Os=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||"");if(e.opts.format===!1)return h&&(r+=" if (true) { "),r;var f=e.opts.$data&&o&&o.$data,l;f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o;var p=e.opts.unknownFormats,g=Array.isArray(p);if(f){var v="format"+s,y="isObject"+s,_="formatType"+s;r+=" var "+v+" = formats["+l+"]; var "+y+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+_+" = "+y+" && "+v+".type || 'string'; if ("+y+") { ",e.async&&(r+=" var async"+s+" = "+v+".async; "),r+=" "+v+" = "+v+".validate; } if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'string') || "),r+=" (",p!="ignore"&&(r+=" ("+l+" && !"+v+" ",g&&(r+=" && self._opts.unknownFormats.indexOf("+l+") == -1 "),r+=") || "),r+=" ("+v+" && "+_+" == '"+a+"' && !(typeof "+v+" == 'function' ? ",e.async?r+=" (async"+s+" ? await "+v+"("+m+") : "+v+"("+m+")) ":r+=" "+v+"("+m+") ",r+=" : "+v+".test("+m+"))))) {"}else{var v=e.formats[o];if(!v){if(p=="ignore")return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),h&&(r+=" if (true) { "),r;if(g&&p.indexOf(o)>=0)return h&&(r+=" if (true) { "),r;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var y=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,_=y&&v.type||"string";if(y){var x=v.async===!0;v=v.validate}if(_!=a)return h&&(r+=" if (true) { "),r;if(x){if(!e.async)throw new Error("async format in sync schema");var w="formats"+e.util.getProperty(o)+".validate";r+=" if (!(await "+w+"("+m+"))) { "}else{r+=" if (! ";var w="formats"+e.util.getProperty(o);y&&(w+=".validate"),typeof v=="function"?r+=" "+w+"("+m+") ":r+=" "+w+".test("+m+") ",r+=") { "}}var b=b||[];b.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",f?r+=""+l:r+=""+e.util.toQuotedString(o),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,f?r+="' + "+l+" + '":r+=""+e.util.escapeQuotes(o),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+e.util.toQuotedString(o),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var I=r;return r=b.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+I+"]); ":r+=" validate.errors = ["+I+"]; return false; ":r+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { "),r}),Os}var ks,Rc;function AS(){return Rc||(Rc=1,ks=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l="errs__"+s,p=e.util.copy(e);p.level++;var g="valid"+p.level,v=e.schema.then,y=e.schema.else,_=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),x=y!==void 0&&(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:e.util.schemaHasRules(y,e.RULES.all)),w=p.baseId;if(_||x){var b;p.createErrors=!1,p.schema=o,p.schemaPath=c,p.errSchemaPath=u,r+=" var "+l+" = errors; var "+f+" = true; ";var I=e.compositeRule;e.compositeRule=p.compositeRule=!0,r+=" "+e.validate(p)+" ",p.baseId=w,p.createErrors=!0,r+=" errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=I,_?(r+=" if ("+g+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(p)+" ",p.baseId=w,r+=" "+f+" = "+g+"; ",_&&x?(b="ifClause"+s,r+=" var "+b+" = 'then'; "):b="'then'",r+=" } ",x&&(r+=" else { ")):r+=" if (!"+g+") { ",x&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(p)+" ",p.baseId=w,r+=" "+f+" = "+g+"; ",_&&x?(b="ifClause"+s,r+=" var "+b+" = 'else'; "):b="'else'",r+=" } "),r+=" if (!"+f+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+b+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+b+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",h&&(r+=" else { ")}else h&&(r+=" if (true) { ");return r}),ks}var Ms,Ec;function NS(){return Ec||(Ec=1,Ms=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l="errs__"+s,p=e.util.copy(e),g="";p.level++;var v="valid"+p.level,y="i"+s,_=p.dataLevel=e.dataLevel+1,x="data"+_,w=e.baseId;if(r+="var "+l+" = errors;var "+f+";",Array.isArray(o)){var b=e.schema.additionalItems;if(b===!1){r+=" "+f+" = "+m+".length <= "+o.length+"; ";var I=u;u=e.errSchemaPath+"/additionalItems",r+=" if (!"+f+") { ";var E=E||[];E.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+o.length+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var R=r;r=E.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+R+"]); ":r+=" validate.errors = ["+R+"]; return false; ":r+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",u=I,h&&(g+="}",r+=" else { ")}var T=o;if(T){for(var P,O=-1,M=T.length-1;O<M;)if(P=T[O+=1],e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all)){r+=" "+v+" = true; if ("+m+".length > "+O+") { ";var z=m+"["+O+"]";p.schema=P,p.schemaPath=c+"["+O+"]",p.errSchemaPath=u+"/"+O,p.errorPath=e.util.getPathExpr(e.errorPath,O,e.opts.jsonPointers,!0),p.dataPathArr[_]=O;var D=e.validate(p);p.baseId=w,e.util.varOccurences(D,x)<2?r+=" "+e.util.varReplace(D,x,z)+" ":r+=" var "+x+" = "+z+"; "+D+" ",r+=" } ",h&&(r+=" if ("+v+") { ",g+="}")}}if(typeof b=="object"&&(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:e.util.schemaHasRules(b,e.RULES.all))){p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+v+" = true; if ("+m+".length > "+o.length+") { for (var "+y+" = "+o.length+"; "+y+" < "+m+".length; "+y+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var z=m+"["+y+"]";p.dataPathArr[_]=y;var D=e.validate(p);p.baseId=w,e.util.varOccurences(D,x)<2?r+=" "+e.util.varReplace(D,x,z)+" ":r+=" var "+x+" = "+z+"; "+D+" ",h&&(r+=" if (!"+v+") break; "),r+=" } } ",h&&(r+=" if ("+v+") { ",g+="}")}}else if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){p.schema=o,p.schemaPath=c,p.errSchemaPath=u,r+=" for (var "+y+" = 0; "+y+" < "+m+".length; "+y+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var z=m+"["+y+"]";p.dataPathArr[_]=y;var D=e.validate(p);p.baseId=w,e.util.varOccurences(D,x)<2?r+=" "+e.util.varReplace(D,x,z)+" ":r+=" var "+x+" = "+z+"; "+D+" ",h&&(r+=" if (!"+v+") break; "),r+=" }"}return h&&(r+=" "+g+" if ("+l+" == errors) {"),r}),Ms}var Ds,Pc;function Ic(){return Pc||(Pc=1,Ds=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,w,m="data"+(i||""),f=e.opts.$data&&o&&o.$data,l;f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o;var p=n=="maximum",g=p?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[g],y=e.opts.$data&&v&&v.$data,_=p?"<":">",x=p?">":"<",w=void 0;if(!(f||typeof o=="number"||o===void 0))throw new Error(n+" must be number");if(!(y||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(g+" must be number or boolean");if(y){var b=e.util.getData(v.$data,i,e.dataPathArr),I="exclusive"+s,E="exclType"+s,R="exclIsNumber"+s,T="op"+s,P="' + "+T+" + '";r+=" var schemaExcl"+s+" = "+b+"; ",b="schemaExcl"+s,r+=" var "+I+"; var "+E+" = typeof "+b+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var w=g,O=O||[];O.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(w||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+g+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var M=r;r=O.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'number') || "),r+=" "+E+" == 'number' ? ( ("+I+" = "+l+" === undefined || "+b+" "+_+"= "+l+") ? "+m+" "+x+"= "+b+" : "+m+" "+x+" "+l+" ) : ( ("+I+" = "+b+" === true) ? "+m+" "+x+"= "+l+" : "+m+" "+x+" "+l+" ) || "+m+" !== "+m+") { var op"+s+" = "+I+" ? '"+_+"' : '"+_+"='; ",o===void 0&&(w=g,u=e.errSchemaPath+"/"+g,l=b,f=y)}else{var R=typeof v=="number",P=_;if(R&&f){var T="'"+P+"'";r+=" if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'number') || "),r+=" ( "+l+" === undefined || "+v+" "+_+"= "+l+" ? "+m+" "+x+"= "+v+" : "+m+" "+x+" "+l+" ) || "+m+" !== "+m+") { "}else{R&&o===void 0?(I=!0,w=g,u=e.errSchemaPath+"/"+g,l=v,x+="="):(R&&(l=Math[p?"min":"max"](v,o)),v===(R?l:!0)?(I=!0,w=g,u=e.errSchemaPath+"/"+g,x+="="):(I=!1,P+="="));var T="'"+P+"'";r+=" if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'number') || "),r+=" "+m+" "+x+" "+l+" || "+m+" !== "+m+") { "}}w=w||n;var O=O||[];O.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(w||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+l+", exclusive: "+I+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+P+" ",f?r+="' + "+l:r+=""+l+"'"),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var M=r;return r=O.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { "),r}),Ds}var Fs,Ac;function Nc(){return Ac||(Ac=1,Fs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,g,m="data"+(i||""),f=e.opts.$data&&o&&o.$data,l;if(f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o,!(f||typeof o=="number"))throw new Error(n+" must be number");var p=n=="maxItems"?">":"<";r+="if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'number') || "),r+=" "+m+".length "+p+" "+l+") { ";var g=n,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(g||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+l+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",n=="maxItems"?r+="more":r+="fewer",r+=" than ",f?r+="' + "+l+" + '":r+=""+o,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}),Fs}var $s,jc;function Tc(){return jc||(jc=1,$s=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,g,m="data"+(i||""),f=e.opts.$data&&o&&o.$data,l;if(f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o,!(f||typeof o=="number"))throw new Error(n+" must be number");var p=n=="maxLength"?">":"<";r+="if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'number') || "),e.opts.unicode===!1?r+=" "+m+".length ":r+=" ucs2length("+m+") ",r+=" "+p+" "+l+") { ";var g=n,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(g||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+l+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",n=="maxLength"?r+="longer":r+="shorter",r+=" than ",f?r+="' + "+l+" + '":r+=""+o,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}),$s}var Ls,Oc;function kc(){return Oc||(Oc=1,Ls=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,g,m="data"+(i||""),f=e.opts.$data&&o&&o.$data,l;if(f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o,!(f||typeof o=="number"))throw new Error(n+" must be number");var p=n=="maxProperties"?">":"<";r+="if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'number') || "),r+=" Object.keys("+m+").length "+p+" "+l+") { ";var g=n,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(g||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+l+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",n=="maxProperties"?r+="more":r+="fewer",r+=" than ",f?r+="' + "+l+" + '":r+=""+o,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}),Ls}var Vs,Mc;function jS(){return Mc||(Mc=1,Vs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f=e.opts.$data&&o&&o.$data,l;if(f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o,!(f||typeof o=="number"))throw new Error(n+" must be number");r+="var division"+s+";if (",f&&(r+=" "+l+" !== undefined && ( typeof "+l+" != 'number' || "),r+=" (division"+s+" = "+m+" / "+l+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+s+" !== parseInt(division"+s+") ",r+=" ) ",f&&(r+=" ) "),r+=" ) { ";var p=p||[];p.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+l+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",f?r+="' + "+l:r+=""+l+"'"),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var g=r;return r=p.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}),Vs}var zs,Dc;function TS(){return Dc||(Dc=1,zs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="errs__"+s,l=e.util.copy(e);l.level++;var p="valid"+l.level;if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=c,l.errSchemaPath=u,r+=" var "+f+" = errors; ";var g=e.compositeRule;e.compositeRule=l.compositeRule=!0,l.createErrors=!1;var v;l.opts.allErrors&&(v=l.opts.allErrors,l.opts.allErrors=!1),r+=" "+e.validate(l)+" ",l.createErrors=!0,v&&(l.opts.allErrors=v),e.compositeRule=l.compositeRule=g,r+=" if ("+p+") { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var _=r;r=y.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ");return r}),zs}var qs,Fc;function OS(){return Fc||(Fc=1,qs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l="errs__"+s,p=e.util.copy(e),g="";p.level++;var v="valid"+p.level,y=p.baseId,_="prevValid"+s,x="passingSchemas"+s;r+="var "+l+" = errors , "+_+" = false , "+f+" = false , "+x+" = null; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=o;if(b)for(var I,E=-1,R=b.length-1;E<R;)I=b[E+=1],(e.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:e.util.schemaHasRules(I,e.RULES.all))?(p.schema=I,p.schemaPath=c+"["+E+"]",p.errSchemaPath=u+"/"+E,r+=" "+e.validate(p)+" ",p.baseId=y):r+=" var "+v+" = true; ",E&&(r+=" if ("+v+" && "+_+") { "+f+" = false; "+x+" = ["+x+", "+E+"]; } else { ",g+="}"),r+=" if ("+v+") { "+f+" = "+_+" = true; "+x+" = "+E+"; }";return e.compositeRule=p.compositeRule=w,r+=""+g+"if (!"+f+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+x+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}),qs}var Us,$c;function kS(){return $c||($c=1,Us=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f=e.opts.$data&&o&&o.$data,l;f?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=o;var p=f?"(new RegExp("+l+"))":e.usePattern(o);r+="if ( ",f&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'string') || "),r+=" !"+p+".test("+m+") ) { ";var g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",f?r+=""+l:r+=""+e.util.toQuotedString(o),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,f?r+="' + "+l+" + '":r+=""+e.util.escapeQuotes(o),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",f?r+="validate.schema"+c:r+=""+e.util.toQuotedString(o),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var v=r;return r=g.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}),Us}var Hs,Lc;function MS(){return Lc||(Lc=1,Hs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="errs__"+s,l=e.util.copy(e),p="";l.level++;var g="valid"+l.level,v="key"+s,y="idx"+s,_=l.dataLevel=e.dataLevel+1,x="data"+_,w="dataProperties"+s,b=Object.keys(o||{}).filter(F),I=e.schema.patternProperties||{},E=Object.keys(I).filter(F),R=e.schema.additionalProperties,T=b.length||E.length,P=R===!1,O=typeof R=="object"&&Object.keys(R).length,M=e.opts.removeAdditional,z=P||O||M,D=e.opts.ownProperties,W=e.baseId,H=e.schema.required;if(H&&!(e.opts.$data&&H.$data)&&H.length<e.opts.loopRequired)var J=e.util.toHash(H);function F(xr){return xr!=="__proto__"}if(r+="var "+f+" = errors;var "+g+" = true;",D&&(r+=" var "+w+" = undefined;"),z){if(D?r+=" "+w+" = "+w+" || Object.keys("+m+"); for (var "+y+"=0; "+y+"<"+w+".length; "+y+"++) { var "+v+" = "+w+"["+y+"]; ":r+=" for (var "+v+" in "+m+") { ",T){if(r+=" var isAdditional"+s+" = !(false ",b.length)if(b.length>8)r+=" || validate.schema"+c+".hasOwnProperty("+v+") ";else{var q=b;if(q)for(var K,re=-1,fe=q.length-1;re<fe;)K=q[re+=1],r+=" || "+v+" == "+e.util.toQuotedString(K)+" "}if(E.length){var me=E;if(me)for(var ye,Me=-1,k=me.length-1;Me<k;)ye=me[Me+=1],r+=" || "+e.usePattern(ye)+".test("+v+") "}r+=" ); if (isAdditional"+s+") { "}if(M=="all")r+=" delete "+m+"["+v+"]; ";else{var $=e.errorPath,X="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),P)if(M)r+=" delete "+m+"["+v+"]; ";else{r+=" "+g+" = false; ";var ne=u;u=e.errSchemaPath+"/additionalProperties";var U=U||[];U.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+X+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var Z=r;r=U.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+Z+"]); ":r+=" validate.errors = ["+Z+"]; return false; ":r+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=ne,h&&(r+=" break; ")}else if(O)if(M=="failing"){r+=" var "+f+" = errors; ";var pe=e.compositeRule;e.compositeRule=l.compositeRule=!0,l.schema=R,l.schemaPath=e.schemaPath+".additionalProperties",l.errSchemaPath=e.errSchemaPath+"/additionalProperties",l.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var ee=m+"["+v+"]";l.dataPathArr[_]=v;var ae=e.validate(l);l.baseId=W,e.util.varOccurences(ae,x)<2?r+=" "+e.util.varReplace(ae,x,ee)+" ":r+=" var "+x+" = "+ee+"; "+ae+" ",r+=" if (!"+g+") { errors = "+f+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+m+"["+v+"]; } ",e.compositeRule=l.compositeRule=pe}else{l.schema=R,l.schemaPath=e.schemaPath+".additionalProperties",l.errSchemaPath=e.errSchemaPath+"/additionalProperties",l.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var ee=m+"["+v+"]";l.dataPathArr[_]=v;var ae=e.validate(l);l.baseId=W,e.util.varOccurences(ae,x)<2?r+=" "+e.util.varReplace(ae,x,ee)+" ":r+=" var "+x+" = "+ee+"; "+ae+" ",h&&(r+=" if (!"+g+") break; ")}e.errorPath=$}T&&(r+=" } "),r+=" } ",h&&(r+=" if ("+g+") { ",p+="}")}var Se=e.opts.useDefaults&&!e.compositeRule;if(b.length){var ce=b;if(ce)for(var K,be=-1,$e=ce.length-1;be<$e;){K=ce[be+=1];var _e=o[K];if(e.opts.strictKeywords?typeof _e=="object"&&Object.keys(_e).length>0||_e===!1:e.util.schemaHasRules(_e,e.RULES.all)){var Fe=e.util.getProperty(K),ee=m+Fe,ze=Se&&_e.default!==void 0;l.schema=_e,l.schemaPath=c+Fe,l.errSchemaPath=u+"/"+e.util.escapeFragment(K),l.errorPath=e.util.getPath(e.errorPath,K,e.opts.jsonPointers),l.dataPathArr[_]=e.util.toQuotedString(K);var ae=e.validate(l);if(l.baseId=W,e.util.varOccurences(ae,x)<2){ae=e.util.varReplace(ae,x,ee);var qe=ee}else{var qe=x;r+=" var "+x+" = "+ee+"; "}if(ze)r+=" "+ae+" ";else{if(J&&J[K]){r+=" if ( "+qe+" === undefined ",D&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(K)+"') "),r+=") { "+g+" = false; ";var $=e.errorPath,ne=u,Ge=e.util.escapeQuotes(K);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath($,K,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var U=U||[];U.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+Ge+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+Ge+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var Z=r;r=U.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+Z+"]); ":r+=" validate.errors = ["+Z+"]; return false; ":r+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=ne,e.errorPath=$,r+=" } else { "}else h?(r+=" if ( "+qe+" === undefined ",D&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(K)+"') "),r+=") { "+g+" = true; } else { "):(r+=" if ("+qe+" !== undefined ",D&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(K)+"') "),r+=" ) { ");r+=" "+ae+" } "}}h&&(r+=" if ("+g+") { ",p+="}")}}if(E.length){var rt=E;if(rt)for(var ye,nt=-1,ht=rt.length-1;nt<ht;){ye=rt[nt+=1];var _e=I[ye];if(e.opts.strictKeywords?typeof _e=="object"&&Object.keys(_e).length>0||_e===!1:e.util.schemaHasRules(_e,e.RULES.all)){l.schema=_e,l.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ye),l.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ye),D?r+=" "+w+" = "+w+" || Object.keys("+m+"); for (var "+y+"=0; "+y+"<"+w+".length; "+y+"++) { var "+v+" = "+w+"["+y+"]; ":r+=" for (var "+v+" in "+m+") { ",r+=" if ("+e.usePattern(ye)+".test("+v+")) { ",l.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var ee=m+"["+v+"]";l.dataPathArr[_]=v;var ae=e.validate(l);l.baseId=W,e.util.varOccurences(ae,x)<2?r+=" "+e.util.varReplace(ae,x,ee)+" ":r+=" var "+x+" = "+ee+"; "+ae+" ",h&&(r+=" if (!"+g+") break; "),r+=" } ",h&&(r+=" else "+g+" = true; "),r+=" } ",h&&(r+=" if ("+g+") { ",p+="}")}}}return h&&(r+=" "+p+" if ("+f+" == errors) {"),r}),Hs}var Gs,Vc;function DS(){return Vc||(Vc=1,Gs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="errs__"+s,l=e.util.copy(e),p="";l.level++;var g="valid"+l.level;if(r+="var "+f+" = errors;",e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=c,l.errSchemaPath=u;var v="key"+s,y="idx"+s,_="i"+s,x="' + "+v+" + '",w=l.dataLevel=e.dataLevel+1,b="data"+w,I="dataProperties"+s,E=e.opts.ownProperties,R=e.baseId;E&&(r+=" var "+I+" = undefined; "),E?r+=" "+I+" = "+I+" || Object.keys("+m+"); for (var "+y+"=0; "+y+"<"+I+".length; "+y+"++) { var "+v+" = "+I+"["+y+"]; ":r+=" for (var "+v+" in "+m+") { ",r+=" var startErrs"+s+" = errors; ";var T=v,P=e.compositeRule;e.compositeRule=l.compositeRule=!0;var O=e.validate(l);l.baseId=R,e.util.varOccurences(O,b)<2?r+=" "+e.util.varReplace(O,b,T)+" ":r+=" var "+b+" = "+T+"; "+O+" ",e.compositeRule=l.compositeRule=P,r+=" if (!"+g+") { for (var "+_+"=startErrs"+s+"; "+_+"<errors; "+_+"++) { vErrors["+_+"].propertyName = "+v+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+x+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+x+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),h&&(r+=" break; "),r+=" } }"}return h&&(r+=" "+p+" if ("+f+" == errors) {"),r}),Gs}var Bs,zc;function FS(){return zc||(zc=1,Bs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l=e.opts.$data&&o&&o.$data;l&&(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var p="schema"+s;if(!l)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var g=[],v=o;if(v)for(var y,_=-1,x=v.length-1;_<x;){y=v[_+=1];var w=e.schema.properties[y];w&&(e.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:e.util.schemaHasRules(w,e.RULES.all))||(g[g.length]=y)}}else var g=o;if(l||g.length){var b=e.errorPath,I=l||g.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(h)if(r+=" var missing"+s+"; ",I){l||(r+=" var "+p+" = validate.schema"+c+"; ");var R="i"+s,T="schema"+s+"["+R+"]",P="' + "+T+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,T,e.opts.jsonPointers)),r+=" var "+f+" = true; ",l&&(r+=" if (schema"+s+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+s+")) "+f+" = false; else {"),r+=" for (var "+R+" = 0; "+R+" < "+p+".length; "+R+"++) { "+f+" = "+m+"["+p+"["+R+"]] !== undefined ",E&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", "+p+"["+R+"]) "),r+="; if (!"+f+") break; } ",l&&(r+=" } "),r+=" if (!"+f+") { ";var O=O||[];O.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+P+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var M=r;r=O.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var z=g;if(z)for(var D,R=-1,W=z.length-1;R<W;){D=z[R+=1],R&&(r+=" || ");var H=e.util.getProperty(D),J=m+H;r+=" ( ( "+J+" === undefined ",E&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(D)+"') "),r+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:H)+") ) "}r+=") { ";var T="missing"+s,P="' + "+T+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,T,!0):b+" + "+T);var O=O||[];O.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+P+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var M=r;r=O.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(I){l||(r+=" var "+p+" = validate.schema"+c+"; ");var R="i"+s,T="schema"+s+"["+R+"]",P="' + "+T+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,T,e.opts.jsonPointers)),l&&(r+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+P+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),r+=" for (var "+R+" = 0; "+R+" < "+p+".length; "+R+"++) { if ("+m+"["+p+"["+R+"]] === undefined ",E&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", "+p+"["+R+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+P+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",l&&(r+=" } ")}else{var F=g;if(F)for(var D,q=-1,K=F.length-1;q<K;){D=F[q+=1];var H=e.util.getProperty(D),P=e.util.escapeQuotes(D),J=m+H;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,D,e.opts.jsonPointers)),r+=" if ( "+J+" === undefined ",E&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(D)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+P+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else h&&(r+=" if (true) {");return r}),Bs}var Ks,qc;function $S(){return qc||(qc=1,Ks=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m="data"+(i||""),f="valid"+s,l=e.opts.$data&&o&&o.$data,p;if(l?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",p="schema"+s):p=o,(o||l)&&e.opts.uniqueItems!==!1){l&&(r+=" var "+f+"; if ("+p+" === false || "+p+" === undefined) "+f+" = true; else if (typeof "+p+" != 'boolean') "+f+" = false; else { "),r+=" var i = "+m+".length , "+f+" = true , j; if (i > 1) { ";var g=e.schema.items&&e.schema.items.type,v=Array.isArray(g);if(!g||g=="object"||g=="array"||v&&(g.indexOf("object")>=0||g.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+m+"[i], "+m+"[j])) { "+f+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+m+"[i]; ";var y="checkDataType"+(v?"s":"");r+=" if ("+e.util[y](g,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",l&&(r+=" } "),r+=" if (!"+f+") { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",l?r+="validate.schema"+c:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=_.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { ")}else h&&(r+=" if (true) { ");return r}),Ks}var Ws,Uc;function LS(){return Uc||(Uc=1,Ws={$ref:wS(),allOf:_S(),anyOf:SS(),$comment:bS(),const:CS(),contains:RS(),dependencies:ES(),enum:PS(),format:IS(),if:AS(),items:NS(),maximum:Ic(),minimum:Ic(),maxItems:Nc(),minItems:Nc(),maxLength:Tc(),minLength:Tc(),maxProperties:kc(),minProperties:kc(),multipleOf:jS(),not:TS(),oneOf:OS(),pattern:kS(),properties:MS(),propertyNames:DS(),required:FS(),uniqueItems:$S(),validate:lh()}),Ws}var Zs,Hc;function VS(){if(Hc)return Zs;Hc=1;var t=LS(),e=Xr().toHash;return Zs=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],i=["number","integer","string","array","object","boolean","null"];return a.all=e(r),a.types=e(i),a.forEach(function(o){o.rules=o.rules.map(function(c){var u;if(typeof c=="object"){var h=Object.keys(c)[0];u=c[h],c=h,u.forEach(function(f){r.push(f),a.all[f]=!0})}r.push(c);var m=a.all[c]={keyword:c,code:t[c],implements:u};return m}),a.all.$comment={keyword:"$comment",code:t.$comment},o.type&&(a.types[o.type]=o)}),a.keywords=e(r.concat(s)),a.custom={},a},Zs}var Qs,Gc;function zS(){if(Gc)return Qs;Gc=1;var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return Qs=function(e,n){for(var a=0;a<n.length;a++){e=JSON.parse(JSON.stringify(e));var r=n[a].split("/"),s=e,i;for(i=1;i<r.length;i++)s=s[r[i]];for(i=0;i<t.length;i++){var o=t[i],c=s[o];c&&(s[o]={anyOf:[c,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},Qs}var Js,Bc;function qS(){if(Bc)return Js;Bc=1;var t=Ti().MissingRef;Js=e;function e(n,a,r){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof a=="function"&&(r=a,a=void 0);var i=o(n).then(function(){var u=s._addSchema(n,void 0,a);return u.validate||c(u)});return r&&i.then(function(u){r(null,u)},r),i;function o(u){var h=u.$schema;return h&&!s.getSchema(h)?e.call(s,{$ref:h},!0):Promise.resolve()}function c(u){try{return s._compile(u)}catch(m){if(m instanceof t)return h(m);throw m}function h(m){var f=m.missingSchema;if(g(f))throw new Error("Schema "+f+" is loaded but "+m.missingRef+" cannot be resolved");var l=s._loadingSchemas[f];return l||(l=s._loadingSchemas[f]=s._opts.loadSchema(f),l.then(p,p)),l.then(function(v){if(!g(f))return o(v).then(function(){g(f)||s.addSchema(v,f,void 0,a)})}).then(function(){return c(u)});function p(){delete s._loadingSchemas[f]}function g(v){return s._refs[v]||s._schemas[v]}}}}return Js}var Xs,Kc;function US(){return Kc||(Kc=1,Xs=function(e,n,a){var r=" ",s=e.level,i=e.dataLevel,o=e.schema[n],c=e.schemaPath+e.util.getProperty(n),u=e.errSchemaPath+"/"+n,h=!e.opts.allErrors,m,f="data"+(i||""),l="valid"+s,p="errs__"+s,g=e.opts.$data&&o&&o.$data,v;g?(r+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",v="schema"+s):v=o;var y=this,_="definition"+s,x=y.definition,w="",b,I,E,R,T;if(g&&x.$data){T="keywordValidate"+s;var P=x.validateSchema;r+=" var "+_+" = RULES.custom['"+n+"'].definition; var "+T+" = "+_+".validate;"}else{if(R=e.useCustomRule(y,o,e.schema,e),!R)return;v="validate.schema"+c,T=R.code,b=x.compile,I=x.inline,E=x.macro}var O=T+".errors",M="i"+s,z="ruleErr"+s,D=x.async;if(D&&!e.async)throw new Error("async keyword in sync schema");if(I||E||(r+=""+O+" = null;"),r+="var "+p+" = errors;var "+l+";",g&&x.$data&&(w+="}",r+=" if ("+v+" === undefined) { "+l+" = true; } else { ",P&&(w+="}",r+=" "+l+" = "+_+".validateSchema("+v+"); if ("+l+") { ")),I)x.statements?r+=" "+R.validate+" ":r+=" "+l+" = "+R.validate+"; ";else if(E){var W=e.util.copy(e),w="";W.level++;var H="valid"+W.level;W.schema=R.validate,W.schemaPath="";var J=e.compositeRule;e.compositeRule=W.compositeRule=!0;var F=e.validate(W).replace(/validate\.schema/g,T);e.compositeRule=W.compositeRule=J,r+=" "+F}else{var q=q||[];q.push(r),r="",r+=" "+T+".call( ",e.opts.passContext?r+="this":r+="self",b||x.schema===!1?r+=" , "+f+" ":r+=" , "+v+" , "+f+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var K=i?"data"+(i-1||""):"parentData",re=i?e.dataPathArr[i]:"parentDataProperty";r+=" , "+K+" , "+re+" , rootData ) ";var fe=r;r=q.pop(),x.errors===!1?(r+=" "+l+" = ",D&&(r+="await "),r+=""+fe+"; "):D?(O="customErrors"+s,r+=" var "+O+" = null; try { "+l+" = await "+fe+"; } catch (e) { "+l+" = false; if (e instanceof ValidationError) "+O+" = e.errors; else throw e; } "):r+=" "+O+" = null; "+l+" = "+fe+"; "}if(x.modifying&&(r+=" if ("+K+") "+f+" = "+K+"["+re+"];"),r+=""+w,x.valid)h&&(r+=" if (true) { ");else{r+=" if ( ",x.valid===void 0?(r+=" !",E?r+=""+H:r+=""+l):r+=" "+!x.valid+" ",r+=") { ",m=y.keyword;var q=q||[];q.push(r),r="";var q=q||[];q.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var me=r;r=q.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+me+"]); ":r+=" validate.errors = ["+me+"]; return false; ":r+=" var err = "+me+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var ye=r;r=q.pop(),I?x.errors?x.errors!="full"&&(r+=" for (var "+M+"="+p+"; "+M+"<errors; "+M+"++) { var "+z+" = vErrors["+M+"]; if ("+z+".dataPath === undefined) "+z+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+z+".schemaPath === undefined) { "+z+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(r+=" "+z+".schema = "+v+"; "+z+".data = "+f+"; "),r+=" } "):x.errors===!1?r+=" "+ye+" ":(r+=" if ("+p+" == errors) { "+ye+" } else { for (var "+M+"="+p+"; "+M+"<errors; "+M+"++) { var "+z+" = vErrors["+M+"]; if ("+z+".dataPath === undefined) "+z+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+z+".schemaPath === undefined) { "+z+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(r+=" "+z+".schema = "+v+"; "+z+".data = "+f+"; "),r+=" } } "):E?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):x.errors===!1?r+=" "+ye+" ":(r+=" if (Array.isArray("+O+")) { if (vErrors === null) vErrors = "+O+"; else vErrors = vErrors.concat("+O+"); errors = vErrors.length; for (var "+M+"="+p+"; "+M+"<errors; "+M+"++) { var "+z+" = vErrors["+M+"]; if ("+z+".dataPath === undefined) "+z+".dataPath = (dataPath || '') + "+e.errorPath+"; "+z+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(r+=" "+z+".schema = "+v+"; "+z+".data = "+f+"; "),r+=" } } else { "+ye+" } "),r+=" } ",h&&(r+=" else { ")}return r}),Xs}const HS="http://json-schema.org/draft-07/schema#",GS="http://json-schema.org/draft-07/schema#",BS="Core schema meta-schema",KS={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},WS=["object","boolean"],ZS={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},ch={$schema:HS,$id:GS,title:BS,definitions:KS,type:WS,properties:ZS,default:!0};var Ys,Wc;function QS(){if(Wc)return Ys;Wc=1;var t=ch;return Ys={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:t.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:t.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},Ys}var eo,Zc;function JS(){if(Zc)return eo;Zc=1;var t=/^[a-z_$][a-z0-9_$-]*$/i,e=US(),n=QS();eo={add:a,get:r,remove:s,validate:i};function a(o,c){var u=this.RULES;if(u.keywords[o])throw new Error("Keyword "+o+" is already defined");if(!t.test(o))throw new Error("Keyword "+o+" is not a valid identifier");if(c){this.validateKeyword(c,!0);var h=c.type;if(Array.isArray(h))for(var m=0;m<h.length;m++)l(o,h[m],c);else l(o,h,c);var f=c.metaSchema;f&&(c.$data&&this._opts.$data&&(f={anyOf:[f,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),c.validateSchema=this.compile(f,!0))}u.keywords[o]=u.all[o]=!0;function l(p,g,v){for(var y,_=0;_<u.length;_++){var x=u[_];if(x.type==g){y=x;break}}y||(y={type:g,rules:[]},u.push(y));var w={keyword:p,definition:v,custom:!0,code:e,implements:v.implements};y.rules.push(w),u.custom[p]=w}return this}function r(o){var c=this.RULES.custom[o];return c?c.definition:this.RULES.keywords[o]||!1}function s(o){var c=this.RULES;delete c.keywords[o],delete c.all[o],delete c.custom[o];for(var u=0;u<c.length;u++)for(var h=c[u].rules,m=0;m<h.length;m++)if(h[m].keyword==o){h.splice(m,1);break}return this}function i(o,c){i.errors=null;var u=this._validateKeyword=this._validateKeyword||this.compile(n,!0);if(u(o))return!0;if(i.errors=u.errors,c)throw new Error("custom keyword definition is invalid: "+this.errorsText(u.errors));return!1}return eo}const XS="http://json-schema.org/draft-07/schema#",YS="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",eb="Meta-schema for $data reference (JSON Schema extension proposal)",tb="object",rb=["$data"],nb={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ab=!1,sb={$schema:XS,$id:YS,description:eb,type:tb,required:rb,properties:nb,additionalProperties:ab};var to,Qc;function ob(){if(Qc)return to;Qc=1;var t=vS(),e=ji(),n=yS(),a=oh(),r=ih(),s=xS(),i=VS(),o=zS(),c=Xr();to=p,p.prototype.validate=g,p.prototype.compile=v,p.prototype.addSchema=y,p.prototype.addMetaSchema=_,p.prototype.validateSchema=x,p.prototype.getSchema=b,p.prototype.removeSchema=R,p.prototype.addFormat=J,p.prototype.errorsText=H,p.prototype._addSchema=P,p.prototype._compile=O,p.prototype.compileAsync=qS();var u=JS();p.prototype.addKeyword=u.add,p.prototype.getKeyword=u.get,p.prototype.removeKeyword=u.remove,p.prototype.validateKeyword=u.validate;var h=Ti();p.ValidationError=h.Validation,p.MissingRefError=h.MissingRef,p.$dataMetaSchema=o;var m="http://json-schema.org/draft-07/schema",f=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],l=["/properties"];function p(k){if(!(this instanceof p))return new p(k);k=this._opts=c.copy(k)||{},ye(this),this._schemas={},this._refs={},this._fragments={},this._formats=s(k.format),this._cache=k.cache||new n,this._loadingSchemas={},this._compilations=[],this.RULES=i(),this._getId=M(k),k.loopRequired=k.loopRequired||1/0,k.errorDataPath=="property"&&(k._errorDataPathProperty=!0),k.serialize===void 0&&(k.serialize=r),this._metaOpts=me(this),k.formats&&K(this),k.keywords&&re(this),F(this),typeof k.meta=="object"&&this.addMetaSchema(k.meta),k.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),q(this)}function g(k,$){var X;if(typeof k=="string"){if(X=this.getSchema(k),!X)throw new Error('no schema with key or ref "'+k+'"')}else{var ne=this._addSchema(k);X=ne.validate||this._compile(ne)}var U=X($);return X.$async!==!0&&(this.errors=X.errors),U}function v(k,$){var X=this._addSchema(k,void 0,$);return X.validate||this._compile(X)}function y(k,$,X,ne){if(Array.isArray(k)){for(var U=0;U<k.length;U++)this.addSchema(k[U],void 0,X,ne);return this}var Z=this._getId(k);if(Z!==void 0&&typeof Z!="string")throw new Error("schema id must be string");return $=e.normalizeId($||Z),fe(this,$),this._schemas[$]=this._addSchema(k,X,ne,!0),this}function _(k,$,X){return this.addSchema(k,$,X,!0),this}function x(k,$){var X=k.$schema;if(X!==void 0&&typeof X!="string")throw new Error("$schema must be a string");if(X=X||this._opts.defaultMeta||w(this),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var ne=this.validate(X,k);if(!ne&&$){var U="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(U);else throw new Error(U)}return ne}function w(k){var $=k._opts.meta;return k._opts.defaultMeta=typeof $=="object"?k._getId($)||$:k.getSchema(m)?m:void 0,k._opts.defaultMeta}function b(k){var $=E(this,k);switch(typeof $){case"object":return $.validate||this._compile($);case"string":return this.getSchema($);case"undefined":return I(this,k)}}function I(k,$){var X=e.schema.call(k,{schema:{}},$);if(X){var ne=X.schema,U=X.root,Z=X.baseId,pe=t.call(k,ne,U,void 0,Z);return k._fragments[$]=new a({ref:$,fragment:!0,schema:ne,root:U,baseId:Z,validate:pe}),pe}}function E(k,$){return $=e.normalizeId($),k._schemas[$]||k._refs[$]||k._fragments[$]}function R(k){if(k instanceof RegExp)return T(this,this._schemas,k),T(this,this._refs,k),this;switch(typeof k){case"undefined":return T(this,this._schemas),T(this,this._refs),this._cache.clear(),this;case"string":var $=E(this,k);return $&&this._cache.del($.cacheKey),delete this._schemas[k],delete this._refs[k],this;case"object":var X=this._opts.serialize,ne=X?X(k):k;this._cache.del(ne);var U=this._getId(k);U&&(U=e.normalizeId(U),delete this._schemas[U],delete this._refs[U])}return this}function T(k,$,X){for(var ne in $){var U=$[ne];!U.meta&&(!X||X.test(ne))&&(k._cache.del(U.cacheKey),delete $[ne])}}function P(k,$,X,ne){if(typeof k!="object"&&typeof k!="boolean")throw new Error("schema should be object or boolean");var U=this._opts.serialize,Z=U?U(k):k,pe=this._cache.get(Z);if(pe)return pe;ne=ne||this._opts.addUsedSchema!==!1;var ee=e.normalizeId(this._getId(k));ee&&ne&&fe(this,ee);var ae=this._opts.validateSchema!==!1&&!$,Se;ae&&!(Se=ee&&ee==e.normalizeId(k.$schema))&&this.validateSchema(k,!0);var ce=e.ids.call(this,k),be=new a({id:ee,schema:k,localRefs:ce,cacheKey:Z,meta:X});return ee[0]!="#"&&ne&&(this._refs[ee]=be),this._cache.put(Z,be),ae&&Se&&this.validateSchema(k,!0),be}function O(k,$){if(k.compiling)return k.validate=U,U.schema=k.schema,U.errors=null,U.root=$||U,k.schema.$async===!0&&(U.$async=!0),U;k.compiling=!0;var X;k.meta&&(X=this._opts,this._opts=this._metaOpts);var ne;try{ne=t.call(this,k.schema,$,k.localRefs)}catch(Z){throw delete k.validate,Z}finally{k.compiling=!1,k.meta&&(this._opts=X)}return k.validate=ne,k.refs=ne.refs,k.refVal=ne.refVal,k.root=ne.root,ne;function U(){var Z=k.validate,pe=Z.apply(this,arguments);return U.errors=Z.errors,pe}}function M(k){switch(k.schemaId){case"auto":return W;case"id":return z;default:return D}}function z(k){return k.$id&&this.logger.warn("schema $id ignored",k.$id),k.id}function D(k){return k.id&&this.logger.warn("schema id ignored",k.id),k.$id}function W(k){if(k.$id&&k.id&&k.$id!=k.id)throw new Error("schema $id is different from id");return k.$id||k.id}function H(k,$){if(k=k||this.errors,!k)return"No errors";$=$||{};for(var X=$.separator===void 0?", ":$.separator,ne=$.dataVar===void 0?"data":$.dataVar,U="",Z=0;Z<k.length;Z++){var pe=k[Z];pe&&(U+=ne+pe.dataPath+" "+pe.message+X)}return U.slice(0,-X.length)}function J(k,$){return typeof $=="string"&&($=new RegExp($)),this._formats[k]=$,this}function F(k){var $;if(k._opts.$data&&($=sb,k.addMetaSchema($,$.$id,!0)),k._opts.meta!==!1){var X=ch;k._opts.$data&&(X=o(X,l)),k.addMetaSchema(X,m,!0),k._refs["http://json-schema.org/schema"]=m}}function q(k){var $=k._opts.schemas;if($)if(Array.isArray($))k.addSchema($);else for(var X in $)k.addSchema($[X],X)}function K(k){for(var $ in k._opts.formats){var X=k._opts.formats[$];k.addFormat($,X)}}function re(k){for(var $ in k._opts.keywords){var X=k._opts.keywords[$];k.addKeyword($,X)}}function fe(k,$){if(k._schemas[$]||k._refs[$])throw new Error('schema with key or id "'+$+'" already exists')}function me(k){for(var $=c.copy(k._opts),X=0;X<f.length;X++)delete $[f[X]];return $}function ye(k){var $=k._opts.logger;if($===!1)k.logger={log:Me,warn:Me,error:Me};else{if($===void 0&&($=console),!(typeof $=="object"&&$.log&&$.warn&&$.error))throw new Error("logger must implement log, warn and error methods");k.logger=$}}function Me(){}return to}ob();const tt=j().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:Q.custom,message:"URL must be parseable",fatal:!0}),Lw}).refine(t=>{const e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"});B({resource:j().url(),authorization_servers:te(tt).optional(),jwks_uri:j().url().optional(),scopes_supported:te(j()).optional(),bearer_methods_supported:te(j()).optional(),resource_signing_alg_values_supported:te(j()).optional(),resource_name:j().optional(),resource_documentation:j().optional(),resource_policy_uri:j().url().optional(),resource_tos_uri:j().url().optional(),tls_client_certificate_bound_access_tokens:De().optional(),authorization_details_types_supported:te(j()).optional(),dpop_signing_alg_values_supported:te(j()).optional(),dpop_bound_access_tokens_required:De().optional()}).passthrough();const ib=B({issuer:j(),authorization_endpoint:tt,token_endpoint:tt,registration_endpoint:tt.optional(),scopes_supported:te(j()).optional(),response_types_supported:te(j()),response_modes_supported:te(j()).optional(),grant_types_supported:te(j()).optional(),token_endpoint_auth_methods_supported:te(j()).optional(),token_endpoint_auth_signing_alg_values_supported:te(j()).optional(),service_documentation:tt.optional(),revocation_endpoint:tt.optional(),revocation_endpoint_auth_methods_supported:te(j()).optional(),revocation_endpoint_auth_signing_alg_values_supported:te(j()).optional(),introspection_endpoint:j().optional(),introspection_endpoint_auth_methods_supported:te(j()).optional(),introspection_endpoint_auth_signing_alg_values_supported:te(j()).optional(),code_challenge_methods_supported:te(j()).optional()}).passthrough(),lb=B({issuer:j(),authorization_endpoint:tt,token_endpoint:tt,userinfo_endpoint:tt.optional(),jwks_uri:tt,registration_endpoint:tt.optional(),scopes_supported:te(j()).optional(),response_types_supported:te(j()),response_modes_supported:te(j()).optional(),grant_types_supported:te(j()).optional(),acr_values_supported:te(j()).optional(),subject_types_supported:te(j()),id_token_signing_alg_values_supported:te(j()),id_token_encryption_alg_values_supported:te(j()).optional(),id_token_encryption_enc_values_supported:te(j()).optional(),userinfo_signing_alg_values_supported:te(j()).optional(),userinfo_encryption_alg_values_supported:te(j()).optional(),userinfo_encryption_enc_values_supported:te(j()).optional(),request_object_signing_alg_values_supported:te(j()).optional(),request_object_encryption_alg_values_supported:te(j()).optional(),request_object_encryption_enc_values_supported:te(j()).optional(),token_endpoint_auth_methods_supported:te(j()).optional(),token_endpoint_auth_signing_alg_values_supported:te(j()).optional(),display_values_supported:te(j()).optional(),claim_types_supported:te(j()).optional(),claims_supported:te(j()).optional(),service_documentation:j().optional(),claims_locales_supported:te(j()).optional(),ui_locales_supported:te(j()).optional(),claims_parameter_supported:De().optional(),request_parameter_supported:De().optional(),request_uri_parameter_supported:De().optional(),require_request_uri_registration:De().optional(),op_policy_uri:tt.optional(),op_tos_uri:tt.optional()}).passthrough();lb.merge(ib.pick({code_challenge_methods_supported:!0}));B({access_token:j(),id_token:j().optional(),token_type:j(),expires_in:He().optional(),scope:j().optional(),refresh_token:j().optional()}).strip();B({error:j(),error_description:j().optional(),error_uri:j().optional()});const cb=B({redirect_uris:te(tt),token_endpoint_auth_method:j().optional(),grant_types:te(j()).optional(),response_types:te(j()).optional(),client_name:j().optional(),client_uri:tt.optional(),logo_uri:tt.optional(),scope:j().optional(),contacts:te(j()).optional(),tos_uri:tt.optional(),policy_uri:j().optional(),jwks_uri:tt.optional(),jwks:qf().optional(),software_id:j().optional(),software_version:j().optional(),software_statement:j().optional()}).strip(),ub=B({client_id:j(),client_secret:j().optional(),client_id_issued_at:He().optional(),client_secret_expires_at:He().optional()}).strip();cb.merge(ub);B({error:j(),error_description:j().optional()}).strip();B({token:j(),token_type_hint:j().optional()}).strip();class ct extends Error{constructor(e,n){super(e),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class db extends ct{}db.errorCode="invalid_request";class fb extends ct{}fb.errorCode="invalid_client";class hb extends ct{}hb.errorCode="invalid_grant";class mb extends ct{}mb.errorCode="unauthorized_client";class pb extends ct{}pb.errorCode="unsupported_grant_type";class gb extends ct{}gb.errorCode="invalid_scope";class vb extends ct{}vb.errorCode="access_denied";class yb extends ct{}yb.errorCode="server_error";class xb extends ct{}xb.errorCode="temporarily_unavailable";class wb extends ct{}wb.errorCode="unsupported_response_type";class _b extends ct{}_b.errorCode="unsupported_token_type";class Sb extends ct{}Sb.errorCode="invalid_token";class bb extends ct{}bb.errorCode="method_not_allowed";class Cb extends ct{}Cb.errorCode="too_many_requests";class Rb extends ct{}Rb.errorCode="invalid_client_metadata";class Eb extends ct{}Eb.errorCode="insufficient_scope";const Jc=Fo.name,Xc=$o.name,Pb=qw.name,Yc=Lo.name,eu=Vo.name,Ib=Uw.name,dn=zo.name,tu=Uf.name,ru=Hf.name,nu=Uo.name,au=qo.name;function su(t){const e=new Set,n=[];let a=!1;for(const r of t){if(r===Pb||r===Ib){a=!0;continue}e.has(r)||(e.add(r),n.push(r))}return a&&!e.has(dn)&&(e.add(dn),n.push(dn)),n}const ro=t=>fetch(t).then(e=>{if(!e.ok)throw new Error(`Failed to fetch: ${e.status}`);return e.json()});function Ab(){var R,T,P,O,M,z,D,W,H,J,F;const{data:t,error:e}=cn("/api/transport",ro,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0});cn("/api/sessions",ro,{refreshInterval:3e3,revalidateOnFocus:!0});const{data:n}=cn("/api/settings",ro),a=((R=n==null?void 0:n.builtInTools)==null?void 0:R.includes(Vl))??!1,r=((T=n==null?void 0:n.builtInTools)==null?void 0:T.includes(zl))??!1,[s,i]=S.useState(["","",""]),[o,c]=S.useState(["","",""]),[u,h]=S.useState([!1,!1,!1]),[m,f]=S.useState(!1);S.useEffect(()=>{if(n!=null&&n.spaceTools&&!m){const q=["","",""],K=["","",""],re=[!1,!1,!1];n.spaceTools.forEach((fe,me)=>{me<3&&(q[me]=fe.name,K[me]=fe.subdomain,re[me]=!0)}),i(q),c(K),h(re),f(!0)}},[n,m]);const l=!t&&!e,p=e?e.message:null,g=async(q,K)=>{try{const re=n||{builtInTools:[]},fe=su(re.builtInTools),me=K?[...fe.filter($=>$!==q),q]:fe.filter($=>$!==q),ye=su(me),Me={...re,builtInTools:ye};Zn("/api/settings",Me,!1);const k=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({builtInTools:ye})});if(!k.ok)throw new Error(`Failed to update tool settings: ${k.status}`);Zn("/api/settings"),console.log(`${q} is now ${K?"enabled":"disabled"}`)}catch(re){console.error("Error updating tool settings:",re),alert(`Error updating ${q}: ${re instanceof Error?re.message:"Unknown error"}`),Zn("/api/settings")}},v=async(q,K)=>{const re=[...u];re[q]=K,h(re),await x(re)},y=async(q,K)=>{const re=[...s];re[q]=K,i(re),u[q]&&await x(u)},_=async(q,K)=>{const re=[...o];re[q]=K,c(re),u[q]&&await x(u)},x=async q=>{try{const K=[];for(let fe=0;fe<3;fe++)q[fe]&&s[fe]&&o[fe]&&K.push({_id:`space-${fe}`,name:s[fe],subdomain:o[fe],emoji:"🔧"});const re=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({spaceTools:K})});if(!re.ok)throw new Error(`Failed to update space tools: ${re.status}`)}catch(K){console.error("Error updating space tools:",K)}},w=async()=>{const q="https://huggingface.co/mcp";try{await navigator.clipboard.writeText(q)}catch(K){console.error("Failed to copy URL:",K)}},b=()=>{window.open("https://huggingface.co/settings/mcp","_blank")},I={paper_search:{id:Yc,label:Lo.annotations.title,description:Lo.description,settings:{enabled:((P=n==null?void 0:n.builtInTools)==null?void 0:P.includes(Yc))??!0}},space_search:{id:Jc,label:Fo.annotations.title,description:Fo.description,settings:{enabled:((O=n==null?void 0:n.builtInTools)==null?void 0:O.includes(Jc))??!0}},model_search:{id:Xc,label:$o.annotations.title,description:$o.description,settings:{enabled:((M=n==null?void 0:n.builtInTools)==null?void 0:M.includes(Xc))??!0}},dataset_search:{id:eu,label:Vo.annotations.title,description:Vo.description,settings:{enabled:((z=n==null?void 0:n.builtInTools)==null?void 0:z.includes(eu))??!0}},hub_repo_details:{id:dn,label:zo.annotations.title,description:zo.description,settings:{enabled:((D=n==null?void 0:n.builtInTools)==null?void 0:D.includes(dn))??!0}},include_readme:{id:Vl,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:a}},doc_semantic_search:{id:nu,label:Uo.annotations.title,description:Uo.description,settings:{enabled:((W=n==null?void 0:n.builtInTools)==null?void 0:W.includes(nu))??!0}},doc_fetch:{id:au,label:qo.annotations.title,description:qo.description,settings:{enabled:((H=n==null?void 0:n.builtInTools)==null?void 0:H.includes(au))??!0}}},E={duplicate_space:{id:tu,label:Uf.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(tu))??!0}},space_files:{id:ru,label:Hf.annotations.title,description:"List all files in a static Hugging Face Space with download URLs.",settings:{enabled:((F=n==null?void 0:n.builtInTools)==null?void 0:F.includes(ru))??!0}},no_gradio_images:{id:zl,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:r}}};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"min-h-screen p-4 sm:p-8 pb-20",children:d.jsx("div",{className:"max-w-4xl mx-auto",children:d.jsxs(dw,{defaultValue:"metrics",className:"w-full",children:[d.jsxs(fw,{className:"mb-6 w-full overflow-x-auto flex-nowrap",children:[d.jsx(Vr,{value:"metrics",className:"whitespace-nowrap",children:"📊 Metrics"}),d.jsx(Vr,{value:"mcp",className:"whitespace-nowrap",children:"🔧 MCP"}),!(t!=null&&t.externalApiMode)&&d.jsx(Vr,{value:"search",className:"whitespace-nowrap",children:"🔍 Search"}),!(t!=null&&t.externalApiMode)&&d.jsx(Vr,{value:"spaces",className:"whitespace-nowrap",children:"🚀 Spaces"}),!(t!=null&&t.externalApiMode)&&d.jsx(Vr,{value:"gradio",className:"whitespace-nowrap",children:"🚀 Gradio"}),d.jsx(Vr,{value:"home",className:"whitespace-nowrap",children:"🏠 Home"})]}),d.jsx(zr,{value:"metrics",className:"mt-0",children:d.jsx(tw,{})}),d.jsx(zr,{value:"mcp",className:"mt-0",children:d.jsx(nw,{})}),!(t!=null&&t.externalApiMode)&&d.jsx(zr,{value:"search",className:"mt-0",children:d.jsx(sl,{title:"🤗 Hugging Face Search Tools (MCP)",description:"Find and use Hugging Face and Community content.",tools:I,onToolToggle:g})}),!(t!=null&&t.externalApiMode)&&d.jsx(zr,{value:"spaces",className:"mt-0",children:d.jsx(sl,{title:"🤗 Hugging Face Space Tools (MCP)",description:"Manage and duplicate Hugging Face Spaces.",tools:E,onToolToggle:g})}),!(t!=null&&t.externalApiMode)&&d.jsx(zr,{value:"gradio",className:"mt-0",children:d.jsx(Rp,{spaceNames:s,spaceSubdomains:o,enabledSpaces:u,onSpaceToolToggle:v,onSpaceToolNameChange:y,onSpaceToolSubdomainChange:_})}),d.jsx(zr,{value:"home",className:"mt-0",children:d.jsxs(Qt,{children:[d.jsxs(Jt,{children:[d.jsx(Xt,{children:"🤗 HF MCP Server"}),d.jsx(Ar,{children:"Connect with AI assistants through the Model Context Protocol"})]}),d.jsxs(Yt,{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"What's MCP?"}),d.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."})]}),d.jsx(dr,{}),d.jsx("div",{className:"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:d.jsxs("div",{className:"flex items-start space-x-3",children:[d.jsx("div",{className:"flex-shrink-0 mt-0.5",children:d.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"Tool Management Scope"}),((t==null?void 0:t.externalApiMode)||(t==null?void 0:t.transport)!=="stdio"&&!(t!=null&&t.externalApiMode))&&d.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300 leading-relaxed",children:t!=null&&t.externalApiMode?d.jsxs(d.Fragment,{children:[d.jsx("strong",{children:"External API Mode:"})," Tools are managed by an external API. Tool Selection Tabs are not available."]}):d.jsxs(d.Fragment,{children:[d.jsx("strong",{children:"Shared Mode:"})," Tool toggles in this interface affect"," ",d.jsx("strong",{children:"all connected MCP server instances"})," and control tool availability for all connected Hosts."]})})]})]})}),d.jsx(dr,{}),d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs(br,{size:"xl",onClick:w,className:"w-full transition-all duration-200 active:bg-green-500 active:border-green-500 touch-manipulation",children:[d.jsx(hp,{className:"mr-2 h-5 w-5"}),"Copy MCP URL"]}),d.jsxs(br,{size:"xl",variant:"outline",onClick:b,className:"w-full touch-manipulation",children:[d.jsx(vp,{className:"mr-2 h-5 w-5"}),"Go to Settings"]})]})]})]})})]})})}),d.jsx(aw,{isLoading:l,error:p,transportInfo:t||{transport:"unknown"}})]})}Ch.createRoot(document.getElementById("root")).render(d.jsx(S.StrictMode,{children:d.jsx(Ab,{})}));
|