diff --git a/chatui/src/app/auth.tsx b/chatui/src/app/auth.tsx index 993d75ec..97bf09c3 100644 --- a/chatui/src/app/auth.tsx +++ b/chatui/src/app/auth.tsx @@ -1,13 +1,15 @@ import { PropsWithChildren } from 'react'; +import { useLocation, useNavigate } from 'react-router-dom'; import { useAuthStoreActions, useAuthStoreState } from './libs/auth/auth.store'; -import { useAuthQuery } from './libs/auth/use-auth.query'; const Auth = (props: PropsWithChildren) => { - const result = useAuthQuery(); - const { uuid } = useAuthStoreState(); - const { setAsAuthenticated } = useAuthStoreActions(); - if (result.isSuccess && uuid !== result.data.uuid) { - setAsAuthenticated(result.data.uuid); + const { loggedIn } = useAuthStoreState(); + const { logout } = useAuthStoreActions(); + const location = useLocation(); + const navigate = useNavigate(); + if (!loggedIn && location.pathname !== '/login') { + logout(); + navigate('/login'); } return props.children; }; diff --git a/chatui/src/app/libs/agents/agent.ts b/chatui/src/app/libs/agents/agent.ts index b106ebfe..5b7bcd29 100644 --- a/chatui/src/app/libs/agents/agent.ts +++ b/chatui/src/app/libs/agents/agent.ts @@ -6,6 +6,16 @@ export const AgentSchema = z.object({ human: z.string(), persona: z.string(), created_at: z.string(), + // TODO: Remove optional once API response returns necessary data + memories: z.number().optional(), + data_sources: z.number().optional(), + last_run: z.string().optional(), + tools: z + .object({ + core: z.number(), + user_defined: z.number(), + }) + .optional(), }); export type Agent = z.infer; diff --git a/chatui/src/app/libs/agents/use-agent-memory.mutation.ts b/chatui/src/app/libs/agents/use-agent-memory.mutation.ts index 40b11ef5..45bd9e18 100644 --- a/chatui/src/app/libs/agents/use-agent-memory.mutation.ts +++ b/chatui/src/app/libs/agents/use-agent-memory.mutation.ts @@ -1,17 +1,20 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { AgentMemoryUpdate } from './agent-memory-update'; export const useAgentMemoryUpdateMutation = (userId: string | null | undefined) => { const queryClient = useQueryClient(); + const bearerToken = useAuthBearerToken(); + return useMutation({ mutationFn: async (params: AgentMemoryUpdate) => await fetch(API_BASE_URL + `/agents/memory?${userId}`, { method: 'POST', - headers: { 'Content-Type': ' application/json' }, + headers: { 'Content-Type': ' application/json', Authorization: bearerToken }, body: JSON.stringify(params), }).then((res) => res.json()), - onSuccess: (res, { agent_id }) => + onSuccess: (_, { agent_id }) => queryClient.invalidateQueries({ queryKey: [userId, 'agents', 'entry', agent_id, 'memory'] }), }); }; diff --git a/chatui/src/app/libs/agents/use-agent-memory.query.ts b/chatui/src/app/libs/agents/use-agent-memory.query.ts index a6258f12..af1c775f 100644 --- a/chatui/src/app/libs/agents/use-agent-memory.query.ts +++ b/chatui/src/app/libs/agents/use-agent-memory.query.ts @@ -1,13 +1,18 @@ import { useQuery } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { AgentMemory } from './agent-memory'; -export const useAgentMemoryQuery = (userId: string | null | undefined, agentId: string | null | undefined) => - useQuery({ +export const useAgentMemoryQuery = (userId: string | null | undefined, agentId: string | null | undefined) => { + const bearerToken = useAuthBearerToken(); + return useQuery({ queryKey: [userId, 'agents', 'entry', agentId, 'memory'], queryFn: async () => - (await fetch(API_BASE_URL + `/agents/memory?agent_id=${agentId}&user_id=${userId}`).then((res) => - res.json() - )) as Promise, + (await fetch(API_BASE_URL + `/agents/memory?agent_id=${agentId}&user_id=${userId}`, { + headers: { + Authorization: bearerToken, + }, + }).then((res) => res.json())) as Promise, enabled: !!userId && !!agentId, }); +}; diff --git a/chatui/src/app/libs/agents/use-agents.mutation.ts b/chatui/src/app/libs/agents/use-agents.mutation.ts index f37b45e1..59011432 100644 --- a/chatui/src/app/libs/agents/use-agents.mutation.ts +++ b/chatui/src/app/libs/agents/use-agents.mutation.ts @@ -1,14 +1,16 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { Agent } from './agent'; export const useAgentsCreateMutation = (userId: string | null | undefined) => { const queryClient = useQueryClient(); + const bearerToken = useAuthBearerToken(); return useMutation({ - mutationFn: async (params: { name: string; human: string; persona: string; model: string }) => { + mutationFn: async (params: { name: string; human: string; persona: string; model: string }): Promise => { const response = await fetch(API_BASE_URL + '/agents', { method: 'POST', - headers: { 'Content-Type': ' application/json' }, + headers: { 'Content-Type': ' application/json', Authorization: bearerToken }, body: JSON.stringify({ config: params, user_id: userId }), }); @@ -18,7 +20,7 @@ export const useAgentsCreateMutation = (userId: string | null | undefined) => { throw new Error(errorBody || 'Error creating agent'); } - return response.json() as Promise; + return await response.json(); }, onSuccess: () => queryClient.invalidateQueries({ queryKey: [userId, 'agents', 'list'] }), }); diff --git a/chatui/src/app/libs/agents/use-agents.query.ts b/chatui/src/app/libs/agents/use-agents.query.ts index 26a90680..c30a96db 100644 --- a/chatui/src/app/libs/agents/use-agents.query.ts +++ b/chatui/src/app/libs/agents/use-agents.query.ts @@ -1,14 +1,21 @@ import { useQuery } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { Agent } from './agent'; -export const useAgentsQuery = (userId: string | null | undefined) => - useQuery({ +export const useAgentsQuery = (userId: string | null | undefined) => { + const bearerToken = useAuthBearerToken(); + return useQuery({ queryKey: [userId, 'agents', 'list'], enabled: !!userId, queryFn: async () => - (await fetch(API_BASE_URL + `/agents?user_id=${userId}`).then((res) => res.json())) as Promise<{ + (await fetch(API_BASE_URL + `/agents?user_id=${userId}`, { + headers: { + Authorization: bearerToken, + }, + }).then((res) => res.json())) as Promise<{ num_agents: number; agents: Agent[]; }>, }); +}; diff --git a/chatui/src/app/libs/auth/auth.store.ts b/chatui/src/app/libs/auth/auth.store.ts index 676e4eb1..a3564030 100644 --- a/chatui/src/app/libs/auth/auth.store.ts +++ b/chatui/src/app/libs/auth/auth.store.ts @@ -3,19 +3,44 @@ import { createJSONStorage, persist } from 'zustand/middleware'; export type AuthState = { uuid: string | null; + token: string | null; + loggedIn: boolean; +}; +export type AuthActions = { + setAsAuthenticated: (uuid: string, token?: string) => void; + setToken: (token: string) => void; + logout: () => void; }; -export type AuthActions = { setAsAuthenticated: (uuid: string) => void }; const useAuthStore = create( persist<{ auth: AuthState; actions: AuthActions }>( (set, get) => ({ - auth: { uuid: null }, + auth: { uuid: null, token: null, loggedIn: false }, actions: { - setAsAuthenticated: (uuid: string) => + setToken: (token: string) => set((prev) => ({ ...prev, auth: { + ...prev.auth, + token, + }, + })), + setAsAuthenticated: (uuid: string, token?: string) => + set((prev) => ({ + ...prev, + auth: { + token: token ?? prev.auth.token, uuid, + loggedIn: true, + }, + })), + logout: () => + set((prev) => ({ + ...prev, + auth: { + token: null, + uuid: null, + loggedIn: false, }, })), }, @@ -30,3 +55,7 @@ const useAuthStore = create( export const useAuthStoreState = () => useAuthStore().auth; export const useAuthStoreActions = () => useAuthStore().actions; +export const useAuthBearerToken = () => { + const { auth } = useAuthStore(); + return auth.token ? `Bearer ${auth.token}` : ''; +}; diff --git a/chatui/src/app/libs/auth/use-auth.mutation.ts b/chatui/src/app/libs/auth/use-auth.mutation.ts new file mode 100644 index 00000000..19006107 --- /dev/null +++ b/chatui/src/app/libs/auth/use-auth.mutation.ts @@ -0,0 +1,23 @@ +import { useMutation } from '@tanstack/react-query'; +import { API_BASE_URL } from '../constants'; +import { useAuthStoreActions } from './auth.store'; + +export type AuthResponse = { uuid: string }; +export const useAuthMutation = () => { + const { setAsAuthenticated } = useAuthStoreActions(); + return useMutation({ + mutationKey: ['auth'], + mutationFn: (password: string) => + fetch(API_BASE_URL + `/auth`, { + method: 'POST', + headers: { 'Content-Type': ' application/json' }, + body: JSON.stringify({ password }), + }).then((res) => { + if (!res.ok) { + throw new Error('Network response was not ok'); + } + return res.json(); + }) as Promise, + onSuccess: (data, password) => setAsAuthenticated(data.uuid, password), + }); +}; diff --git a/chatui/src/app/libs/humans/use-humans.mutation.ts b/chatui/src/app/libs/humans/use-humans.mutation.ts new file mode 100644 index 00000000..e3d3d210 --- /dev/null +++ b/chatui/src/app/libs/humans/use-humans.mutation.ts @@ -0,0 +1,27 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; +import { API_BASE_URL } from '../constants'; +import { Human } from './human'; + +export const useHumansCreateMutation = (userId: string | null | undefined) => { + const queryClient = useQueryClient(); + const bearerToken = useAuthBearerToken(); + return useMutation({ + mutationFn: async (params: { name: string; text: string }): Promise => { + const response = await fetch(API_BASE_URL + '/agents', { + method: 'POST', + headers: { 'Content-Type': ' application/json', Authorization: bearerToken }, + body: JSON.stringify({ config: params, user_id: userId }), + }); + + if (!response.ok) { + // Throw an error if the response is not OK + const errorBody = await response.text(); + throw new Error(errorBody || 'Error creating human'); + } + + return await response.json(); + }, + onSuccess: () => queryClient.invalidateQueries({ queryKey: [userId, 'humans', 'list'] }), + }); +}; diff --git a/chatui/src/app/libs/humans/use-humans.query.ts b/chatui/src/app/libs/humans/use-humans.query.ts index 67542989..0269e9ad 100644 --- a/chatui/src/app/libs/humans/use-humans.query.ts +++ b/chatui/src/app/libs/humans/use-humans.query.ts @@ -1,13 +1,19 @@ import { useQuery } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { Human } from './human'; -export const useHumansQuery = (userId: string | null | undefined) => - useQuery({ +export const useHumansQuery = (userId: string | null | undefined) => { + const bearerToken = useAuthBearerToken(); + return useQuery({ queryKey: [userId, 'humans', 'list'], enabled: !!userId, queryFn: async () => { - const response = await fetch(`${API_BASE_URL}/humans?user_id=${encodeURIComponent(userId || '')}`); + const response = await fetch(`${API_BASE_URL}/humans?user_id=${encodeURIComponent(userId || '')}`, { + headers: { + Authorization: bearerToken, + }, + }); if (!response.ok) { throw new Error('Network response was not ok for fetching humans'); } @@ -16,3 +22,4 @@ export const useHumansQuery = (userId: string | null | undefined) => }>; }, }); +}; diff --git a/chatui/src/app/libs/messages/message-history.store.ts b/chatui/src/app/libs/messages/message-history.store.ts index 19565763..0e9e5a69 100644 --- a/chatui/src/app/libs/messages/message-history.store.ts +++ b/chatui/src/app/libs/messages/message-history.store.ts @@ -13,7 +13,7 @@ export type MessageHistory = { const useMessageHistoryStore = create( persist<{ history: MessageHistory; actions: { addMessage: (key: string, message: Message) => void } }>( - (set, get) => ({ + (set) => ({ history: {}, actions: { addMessage: (key: string, message: Message) => diff --git a/chatui/src/app/libs/messages/message-stream.store.ts b/chatui/src/app/libs/messages/message-stream.store.ts index eb516699..0a7f5466 100644 --- a/chatui/src/app/libs/messages/message-stream.store.ts +++ b/chatui/src/app/libs/messages/message-stream.store.ts @@ -18,7 +18,7 @@ const useMessageStreamStore = create( { socket: null as EventSource | null, socketURL: null as string | null, - readyState: ReadyState.IDLE, + readyState: ReadyState.IDLE as ReadyState, abortController: null as AbortController | null, onMessageCallback: ((message: Message) => console.warn('No message callback set up. Simply logging message', message)) as (message: Message) => void, @@ -30,10 +30,12 @@ const useMessageStreamStore = create( agentId, message, role, + bearerToken, }: { userId: string; agentId: string; message: string; + bearerToken: string; role?: 'user' | 'system'; }) => { const abortController = new AbortController(); @@ -49,7 +51,7 @@ const useMessageStreamStore = create( }); void fetchEventSource(ENDPOINT_URL, { method: 'POST', - headers: { 'Content-Type': 'application/json', Accept: 'text/event-stream' }, + headers: { 'Content-Type': 'application/json', Accept: 'text/event-stream', Authorization: bearerToken }, body: JSON.stringify({ user_id: userId, agent_id: agentId, diff --git a/chatui/src/app/libs/messages/use-messages.query.ts b/chatui/src/app/libs/messages/use-messages.query.ts index 9fcb1c0e..ec6c2c0a 100644 --- a/chatui/src/app/libs/messages/use-messages.query.ts +++ b/chatui/src/app/libs/messages/use-messages.query.ts @@ -1,4 +1,5 @@ import { useQuery } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; export const useMessagesQuery = ( @@ -6,14 +7,21 @@ export const useMessagesQuery = ( agentId: string | null | undefined, start = 0, count = 10 -) => - useQuery({ +) => { + const bearerToken = useAuthBearerToken(); + return useQuery({ queryKey: [userId, 'agents', 'item', agentId, 'messages', 'list', start, count], queryFn: async () => (await fetch( - API_BASE_URL + `/agents/message?agent_id=${agentId}&user_id=${userId}&start=${start}&count=${count}` + API_BASE_URL + `/agents/message?agent_id=${agentId}&user_id=${userId}&start=${start}&count=${count}`, + { + headers: { + Authorization: bearerToken, + }, + } ).then((res) => res.json())) as Promise<{ messages: { role: string; name: string; content: string }[]; }>, enabled: !!userId && !!agentId, }); +}; diff --git a/chatui/src/app/libs/models/use-models.query.ts b/chatui/src/app/libs/models/use-models.query.ts index 45416333..b6531ee0 100644 --- a/chatui/src/app/libs/models/use-models.query.ts +++ b/chatui/src/app/libs/models/use-models.query.ts @@ -1,13 +1,19 @@ import { useQuery } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { Model } from './model'; -export const useModelsQuery = (userId: string | null | undefined) => - useQuery({ +export const useModelsQuery = (userId: string | null | undefined) => { + const bearerToken = useAuthBearerToken(); + return useQuery({ queryKey: [userId, 'models', 'list'], enabled: !!userId, queryFn: async () => { - const response = await fetch(`${API_BASE_URL}/models?user_id=${encodeURIComponent(userId || '')}`); + const response = await fetch(`${API_BASE_URL}/models?user_id=${encodeURIComponent(userId || '')}`, { + headers: { + Authorization: bearerToken, + }, + }); if (!response.ok) { throw new Error('Network response was not ok for fetching models'); } @@ -16,3 +22,4 @@ export const useModelsQuery = (userId: string | null | undefined) => }>; }, }); +}; diff --git a/chatui/src/app/libs/personas/use-personas.mutation.ts b/chatui/src/app/libs/personas/use-personas.mutation.ts new file mode 100644 index 00000000..43244881 --- /dev/null +++ b/chatui/src/app/libs/personas/use-personas.mutation.ts @@ -0,0 +1,27 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; +import { API_BASE_URL } from '../constants'; +import { Persona } from './persona'; + +export const usePersonasCreateMutation = (userId: string | null | undefined) => { + const queryClient = useQueryClient(); + const bearerToken = useAuthBearerToken(); + return useMutation({ + mutationFn: async (params: { name: string; text: string }): Promise => { + const response = await fetch(API_BASE_URL + '/agents', { + method: 'POST', + headers: { 'Content-Type': ' application/json', Authorization: bearerToken }, + body: JSON.stringify({ config: params, user_id: userId }), + }); + + if (!response.ok) { + // Throw an error if the response is not OK + const errorBody = await response.text(); + throw new Error(errorBody || 'Error creating persona'); + } + + return await response.json(); + }, + onSuccess: () => queryClient.invalidateQueries({ queryKey: [userId, 'personas', 'list'] }), + }); +}; diff --git a/chatui/src/app/libs/personas/use-personas.query.ts b/chatui/src/app/libs/personas/use-personas.query.ts index 4acf5366..43ed77a2 100644 --- a/chatui/src/app/libs/personas/use-personas.query.ts +++ b/chatui/src/app/libs/personas/use-personas.query.ts @@ -1,13 +1,19 @@ import { useQuery } from '@tanstack/react-query'; +import { useAuthBearerToken } from '../auth/auth.store'; import { API_BASE_URL } from '../constants'; import { Persona } from './persona'; -export const usePersonasQuery = (userId: string | null | undefined) => - useQuery({ +export const usePersonasQuery = (userId: string | null | undefined) => { + const bearerToken = useAuthBearerToken(); + return useQuery({ queryKey: [userId, 'personas', 'list'], enabled: !!userId, // The query will not execute unless userId is truthy queryFn: async () => { - const response = await fetch(`${API_BASE_URL}/personas?user_id=${encodeURIComponent(userId || '')}`); + const response = await fetch(`${API_BASE_URL}/personas?user_id=${encodeURIComponent(userId || '')}`, { + headers: { + Authorization: bearerToken, + }, + }); if (!response.ok) { throw new Error('Network response was not ok'); } @@ -16,3 +22,4 @@ export const usePersonasQuery = (userId: string | null | undefined) => }>; }, }); +}; diff --git a/chatui/src/app/modules/chat/chat.tsx b/chatui/src/app/modules/chat/chat.tsx index c8b7d53f..71b7c1a8 100644 --- a/chatui/src/app/modules/chat/chat.tsx +++ b/chatui/src/app/modules/chat/chat.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef } from 'react'; import { useAgentActions, useCurrentAgent, useLastAgentInitMessage } from '../../libs/agents/agent.store'; -import { useAuthStoreState } from '../../libs/auth/auth.store'; +import { useAuthBearerToken, useAuthStoreState } from '../../libs/auth/auth.store'; import { useMessageHistoryActions, useMessagesForKey } from '../../libs/messages/message-history.store'; import { ReadyState, @@ -21,12 +21,13 @@ const Chat = () => { const { sendMessage } = useMessageSocketActions(); const { addMessage } = useMessageHistoryActions(); const { setLastAgentInitMessage } = useAgentActions(); + const bearerToken = useAuthBearerToken(); const sendMessageAndAddToHistory = useCallback( (message: string, role: 'user' | 'system' = 'user') => { if (!currentAgent || !auth.uuid) return; const date = new Date(); - sendMessage({ userId: auth.uuid, agentId: currentAgent.id, message, role }); + sendMessage({ userId: auth.uuid, agentId: currentAgent.id, message, role, bearerToken }); addMessage(currentAgent.id, { type: role === 'user' ? 'user_message' : 'system_message', message_type: 'user_message', diff --git a/chatui/src/app/modules/public/login/login.page.tsx b/chatui/src/app/modules/public/login/login.page.tsx new file mode 100644 index 00000000..1a0298f0 --- /dev/null +++ b/chatui/src/app/modules/public/login/login.page.tsx @@ -0,0 +1,71 @@ +import { Avatar, AvatarFallback, AvatarImage } from '@memgpt/components/avatar'; +import { Button } from '@memgpt/components/button'; +import { Input } from '@memgpt/components/input'; +import { Label } from '@memgpt/components/label'; +import { cnH3, cnMuted } from '@memgpt/components/typography'; +import { Loader2 } from 'lucide-react'; +import { useNavigate } from 'react-router-dom'; +import { useAuthMutation } from '../../../libs/auth/use-auth.mutation'; + +const year = new Date().getFullYear(); +const LoginPage = () => { + const mutation = useAuthMutation(); + const navigate = useNavigate(); + return ( +
+
+ + + MG + +

Welcome to MemGPT

+

Sign in below to start chatting with your agent

+
{ + e.preventDefault(); + const password = new FormData(e.currentTarget).get('password') as string; + if (!password || password.length === 0) return; + mutation.mutate(password, { + onSuccess: ({ uuid }, password) => setTimeout(() => navigate('/'), 600), + }); + }} + > + + + +
+

+ By clicking continue, you agree to our Terms of Service and Privacy Policy. +

+
+

© {year} MemGPT

+
+ ); +}; + +export default LoginPage; diff --git a/chatui/src/app/modules/public/login/login.routes.tsx b/chatui/src/app/modules/public/login/login.routes.tsx new file mode 100644 index 00000000..bfa3469d --- /dev/null +++ b/chatui/src/app/modules/public/login/login.routes.tsx @@ -0,0 +1,7 @@ +import { RouteObject } from 'react-router-dom'; +import LoginPage from './login.page'; + +export const loginRoutes: RouteObject = { + path: 'login', + element: , +}; diff --git a/chatui/src/app/router.tsx b/chatui/src/app/router.tsx index 66e2c2b8..bad4580c 100644 --- a/chatui/src/app/router.tsx +++ b/chatui/src/app/router.tsx @@ -2,6 +2,7 @@ import { createBrowserRouter, Outlet } from 'react-router-dom'; import Auth from './auth'; import { chatRoute } from './modules/chat/chat.routes'; import Home from './modules/home/home'; +import { loginRoutes } from './modules/public/login/login.routes'; import { settingsRoute } from './modules/settings/settings.routes'; import Footer from './shared/layout/footer'; import Header from './shared/layout/header'; @@ -30,4 +31,5 @@ export const router = createBrowserRouter([ settingsRoute, ], }, + loginRoutes, ]); diff --git a/chatui/src/app/shared/layout/header.tsx b/chatui/src/app/shared/layout/header.tsx index 3bc0f2d9..292a5f0a 100644 --- a/chatui/src/app/shared/layout/header.tsx +++ b/chatui/src/app/shared/layout/header.tsx @@ -1,12 +1,14 @@ import { Avatar, AvatarFallback, AvatarImage } from '@memgpt/components/avatar'; import { Button } from '@memgpt/components/button'; -import { MoonStar, Sun } from 'lucide-react'; +import { LucideLogOut, MoonStar, Sun } from 'lucide-react'; import { NavLink } from 'react-router-dom'; +import { useAuthStoreActions } from '../../libs/auth/auth.store'; import { useTheme } from '../theme'; const twNavLink = '[&.active]:opacity-100 opacity-60'; const Header = () => { const { theme, toggleTheme } = useTheme(); + const { logout } = useAuthStoreActions(); return (
@@ -29,7 +31,6 @@ const Header = () => { +
); diff --git a/memgpt/server/static_files/assets/index-273ebfe0.js b/memgpt/server/static_files/assets/index-273ebfe0.js deleted file mode 100644 index 612bd817..00000000 --- a/memgpt/server/static_files/assets/index-273ebfe0.js +++ /dev/null @@ -1,129 +0,0 @@ -var Rd=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var k=(e,t,n)=>(Rd(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Y=(e,t,n,r)=>(Rd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Bl=(e,t,n,r)=>({set _(o){Y(e,t,o,n)},get _(){return k(e,t,r)}}),ye=(e,t,n)=>(Rd(e,t,"access private method"),n);function Fy(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function cp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uy={exports:{}},Fc={},zy={exports:{}},Te={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var kl=Symbol.for("react.element"),IS=Symbol.for("react.portal"),jS=Symbol.for("react.fragment"),LS=Symbol.for("react.strict_mode"),FS=Symbol.for("react.profiler"),US=Symbol.for("react.provider"),zS=Symbol.for("react.context"),VS=Symbol.for("react.forward_ref"),WS=Symbol.for("react.suspense"),BS=Symbol.for("react.memo"),HS=Symbol.for("react.lazy"),tv=Symbol.iterator;function ZS(e){return e===null||typeof e!="object"?null:(e=tv&&e[tv]||e["@@iterator"],typeof e=="function"?e:null)}var Vy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wy=Object.assign,By={};function js(e,t,n){this.props=e,this.context=t,this.refs=By,this.updater=n||Vy}js.prototype.isReactComponent={};js.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};js.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hy(){}Hy.prototype=js.prototype;function dp(e,t,n){this.props=e,this.context=t,this.refs=By,this.updater=n||Vy}var fp=dp.prototype=new Hy;fp.constructor=dp;Wy(fp,js.prototype);fp.isPureReactComponent=!0;var nv=Array.isArray,Zy=Object.prototype.hasOwnProperty,hp={current:null},Ky={key:!0,ref:!0,__self:!0,__source:!0};function Qy(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Zy.call(t,r)&&!Ky.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,ve=L[he];if(0>>1;heo(ht,re))zeo(ue,ht)?(L[he]=ue,L[ze]=re,he=ze):(L[he]=ht,L[Ie]=re,he=Ie);else if(zeo(ue,re))L[he]=ue,L[ze]=re,he=ze;else break e}}return K}function o(L,K){var re=L.sortIndex-K.sortIndex;return re!==0?re:L.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,f=null,p=3,y=!1,v=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=L)r(u),K.sortIndex=K.expirationTime,t(l,K);else break;K=n(u)}}function x(L){if(g=!1,w(L),!v)if(n(l)!==null)v=!0,H(_);else{var K=n(u);K!==null&&oe(x,K.startTime-L)}}function _(L,K){v=!1,g&&(g=!1,m(T),T=-1),y=!0;var re=p;try{for(w(K),f=n(l);f!==null&&(!(f.expirationTime>K)||L&&!V());){var he=f.callback;if(typeof he=="function"){f.callback=null,p=f.priorityLevel;var ve=he(f.expirationTime<=K);K=e.unstable_now(),typeof ve=="function"?f.callback=ve:f===n(l)&&r(l),w(K)}else r(l);f=n(l)}if(f!==null)var Ue=!0;else{var Ie=n(u);Ie!==null&&oe(x,Ie.startTime-K),Ue=!1}return Ue}finally{f=null,p=re,y=!1}}var C=!1,E=null,T=-1,O=5,I=-1;function V(){return!(e.unstable_now()-IL||125he?(L.sortIndex=re,t(u,L),n(l)===null&&L===n(u)&&(g?(m(T),T=-1):g=!0,oe(x,re-he))):(L.sortIndex=ve,t(l,L),v||y||(v=!0,H(_))),L},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(L){var K=p;return function(){var re=p;p=K;try{return L.apply(this,arguments)}finally{p=re}}}})(Jy);Xy.exports=Jy;var r_=Xy.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var e0=c,un=r_;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Df=Object.prototype.hasOwnProperty,o_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ov={},iv={};function i_(e){return Df.call(iv,e)?!0:Df.call(ov,e)?!1:o_.test(e)?iv[e]=!0:(ov[e]=!0,!1)}function s_(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function a_(e,t,n,r){if(t===null||typeof t>"u"||s_(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ht(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){kt[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var mp=/[\-:]([a-z])/g;function vp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mp,vp);kt[t]=new Ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mp,vp);kt[t]=new Ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mp,vp);kt[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function gp(e,t,n,r){var o=kt.hasOwnProperty(t)?kt[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Od=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ma(e):""}function l_(e){switch(e.tag){case 5:return ma(e.type);case 16:return ma("Lazy");case 13:return ma("Suspense");case 19:return ma("SuspenseList");case 0:case 2:case 15:return e=Ad(e.type,!1),e;case 11:return e=Ad(e.type.render,!1),e;case 1:return e=Ad(e.type,!0),e;default:return""}}function Lf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Mi:return"Fragment";case Di:return"Portal";case Mf:return"Profiler";case yp:return"StrictMode";case If:return"Suspense";case jf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case r0:return(e.displayName||"Context")+".Consumer";case n0:return(e._context.displayName||"Context")+".Provider";case wp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xp:return t=e.displayName||null,t!==null?t:Lf(e.type)||"Memo";case Qr:t=e._payload,e=e._init;try{return Lf(e(t))}catch{}}return null}function u_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lf(t);case 8:return t===yp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function So(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c_(e){var t=i0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kl(e){e._valueTracker||(e._valueTracker=c_(e))}function s0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=i0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Uu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ff(e,t){var n=t.checked;return ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function av(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=So(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function a0(e,t){t=t.checked,t!=null&&gp(e,"checked",t,!1)}function Uf(e,t){a0(e,t);var n=So(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zf(e,t.type,n):t.hasOwnProperty("defaultValue")&&zf(e,t.type,So(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lv(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zf(e,t,n){(t!=="number"||Uu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var va=Array.isArray;function qi(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ql.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Aa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},d_=["Webkit","ms","Moz","O"];Object.keys(xa).forEach(function(e){d_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xa[t]=xa[e]})});function d0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xa.hasOwnProperty(e)&&xa[e]?(""+t).trim():t+"px"}function f0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=d0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var f_=ot({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bf(e,t){if(t){if(f_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function Hf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Zf=null;function bp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kf=null,Gi=null,Xi=null;function dv(e){if(e=Rl(e)){if(typeof Kf!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Bc(t),Kf(e.stateNode,e.type,t))}}function h0(e){Gi?Xi?Xi.push(e):Xi=[e]:Gi=e}function p0(){if(Gi){var e=Gi,t=Xi;if(Xi=Gi=null,dv(e),t)for(e=0;e>>=0,e===0?32:31-(__(e)/E_|0)|0}var Yl=64,ql=4194304;function ga(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=ga(a):(i&=s,i!==0&&(r=ga(i)))}else s=n&~o,s!==0?r=ga(s):i!==0&&(r=ga(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Tl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function $_(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Sa),xv=String.fromCharCode(32),bv=!1;function D0(e,t){switch(e){case"keyup":return nE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ii=!1;function oE(e,t){switch(e){case"compositionend":return M0(t);case"keypress":return t.which!==32?null:(bv=!0,xv);case"textInput":return e=t.data,e===xv&&bv?null:e;default:return null}}function iE(e,t){if(Ii)return e==="compositionend"||!Rp&&D0(e,t)?(e=O0(),bu=kp=ao=null,Ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cv(n)}}function F0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U0(){for(var e=window,t=Uu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Uu(e.document)}return t}function Pp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function pE(e){var t=U0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&F0(n.ownerDocument.documentElement,n)){if(r!==null&&Pp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=kv(n,i);var s=kv(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ji=null,Jf=null,Ea=null,eh=!1;function Tv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;eh||ji==null||ji!==Uu(r)||(r=ji,"selectionStart"in r&&Pp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ea&&Fa(Ea,r)||(Ea=r,r=Ku(Jf,"onSelect"),0Ui||(e.current=sh[Ui],sh[Ui]=null,Ui--)}function Ze(e,t){Ui++,sh[Ui]=e.current,e.current=t}var _o={},At=Do(_o),qt=Do(!1),ai=_o;function _s(e,t){var n=e.type.contextTypes;if(!n)return _o;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Gt(e){return e=e.childContextTypes,e!=null}function Yu(){Ge(qt),Ge(At)}function Dv(e,t,n){if(At.current!==_o)throw Error(z(168));Ze(At,t),Ze(qt,n)}function Y0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,u_(e)||"Unknown",o));return ot({},n,r)}function qu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_o,ai=At.current,Ze(At,e),Ze(qt,qt.current),!0}function Mv(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=Y0(e,t,ai),r.__reactInternalMemoizedMergedChildContext=e,Ge(qt),Ge(At),Ze(At,e)):Ge(qt),Ze(qt,n)}var vr=null,Hc=!1,Kd=!1;function q0(e){vr===null?vr=[e]:vr.push(e)}function kE(e){Hc=!0,q0(e)}function Mo(){if(!Kd&&vr!==null){Kd=!0;var e=0,t=Fe;try{var n=vr;for(Fe=1;e>=s,o-=s,yr=1<<32-Fn(t)+o|n<T?(O=E,E=null):O=E.sibling;var I=p(m,E,w[T],x);if(I===null){E===null&&(E=O);break}e&&E&&I.alternate===null&&t(m,E),h=i(I,h,T),C===null?_=I:C.sibling=I,C=I,E=O}if(T===w.length)return n(m,E),Je&&Uo(m,T),_;if(E===null){for(;TT?(O=E,E=null):O=E.sibling;var V=p(m,E,I.value,x);if(V===null){E===null&&(E=O);break}e&&E&&V.alternate===null&&t(m,E),h=i(V,h,T),C===null?_=V:C.sibling=V,C=V,E=O}if(I.done)return n(m,E),Je&&Uo(m,T),_;if(E===null){for(;!I.done;T++,I=w.next())I=f(m,I.value,x),I!==null&&(h=i(I,h,T),C===null?_=I:C.sibling=I,C=I);return Je&&Uo(m,T),_}for(E=r(m,E);!I.done;T++,I=w.next())I=y(E,m,T,I.value,x),I!==null&&(e&&I.alternate!==null&&E.delete(I.key===null?T:I.key),h=i(I,h,T),C===null?_=I:C.sibling=I,C=I);return e&&E.forEach(function(D){return t(m,D)}),Je&&Uo(m,T),_}function b(m,h,w,x){if(typeof w=="object"&&w!==null&&w.type===Mi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Zl:e:{for(var _=w.key,C=h;C!==null;){if(C.key===_){if(_=w.type,_===Mi){if(C.tag===7){n(m,C.sibling),h=o(C,w.props.children),h.return=m,m=h;break e}}else if(C.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Qr&&Vv(_)===C.type){n(m,C.sibling),h=o(C,w.props),h.ref=ea(m,C,w),h.return=m,m=h;break e}n(m,C);break}else t(m,C);C=C.sibling}w.type===Mi?(h=ii(w.props.children,m.mode,x,w.key),h.return=m,m=h):(x=Ru(w.type,w.key,w.props,null,m.mode,x),x.ref=ea(m,h,w),x.return=m,m=x)}return s(m);case Di:e:{for(C=w.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===w.containerInfo&&h.stateNode.implementation===w.implementation){n(m,h.sibling),h=o(h,w.children||[]),h.return=m,m=h;break e}else{n(m,h);break}else t(m,h);h=h.sibling}h=tf(w,m.mode,x),h.return=m,m=h}return s(m);case Qr:return C=w._init,b(m,h,C(w._payload),x)}if(va(w))return v(m,h,w,x);if(Ys(w))return g(m,h,w,x);ru(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,h!==null&&h.tag===6?(n(m,h.sibling),h=o(h,w),h.return=m,m=h):(n(m,h),h=ef(w,m.mode,x),h.return=m,m=h),s(m)):n(m,h)}return b}var Cs=ow(!0),iw=ow(!1),Pl={},ir=Do(Pl),Wa=Do(Pl),Ba=Do(Pl);function Ho(e){if(e===Pl)throw Error(z(174));return e}function Fp(e,t){switch(Ze(Ba,t),Ze(Wa,e),Ze(ir,Pl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wf(t,e)}Ge(ir),Ze(ir,t)}function ks(){Ge(ir),Ge(Wa),Ge(Ba)}function sw(e){Ho(Ba.current);var t=Ho(ir.current),n=Wf(t,e.type);t!==n&&(Ze(Wa,e),Ze(ir,n))}function Up(e){Wa.current===e&&(Ge(ir),Ge(Wa))}var nt=Do(0);function nc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qd=[];function zp(){for(var e=0;en?n:4,e(!0);var r=Yd.transition;Yd.transition={};try{e(!1),t()}finally{Fe=n,Yd.transition=r}}function Sw(){return Tn().memoizedState}function PE(e,t,n){var r=xo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_w(e))Ew(t,n);else if(n=ew(e,t,n,r),n!==null){var o=zt();Un(n,e,r,o),Cw(n,t,r)}}function NE(e,t,n){var r=xo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_w(e))Ew(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Wn(a,s)){var l=t.interleaved;l===null?(o.next=o,jp(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=ew(e,t,o,r),n!==null&&(o=zt(),Un(n,e,r,o),Cw(n,t,r))}}function _w(e){var t=e.alternate;return e===rt||t!==null&&t===rt}function Ew(e,t){Ca=rc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_p(e,n)}}var oc={readContext:kn,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useInsertionEffect:$t,useLayoutEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useMutableSource:$t,useSyncExternalStore:$t,useId:$t,unstable_isNewReconciler:!1},OE={readContext:kn,useCallback:function(e,t){return Qn().memoizedState=[e,t===void 0?null:t],e},useContext:kn,useEffect:Bv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Cu(4194308,4,gw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cu(4,2,e,t)},useMemo:function(e,t){var n=Qn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=PE.bind(null,rt,e),[r.memoizedState,e]},useRef:function(e){var t=Qn();return e={current:e},t.memoizedState=e},useState:Wv,useDebugValue:Zp,useDeferredValue:function(e){return Qn().memoizedState=e},useTransition:function(){var e=Wv(!1),t=e[0];return e=RE.bind(null,e[1]),Qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rt,o=Qn();if(Je){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),St===null)throw Error(z(349));ui&30||uw(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Bv(dw.bind(null,r,i,e),[e]),r.flags|=2048,Ka(9,cw.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Qn(),t=St.identifierPrefix;if(Je){var n=wr,r=yr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ha++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Jn]=t,e[Va]=r,Dw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Hf(n,r),n){case"dialog":Ye("cancel",e),Ye("close",e),o=r;break;case"iframe":case"object":case"embed":Ye("load",e),o=r;break;case"video":case"audio":for(o=0;o$s&&(t.flags|=128,r=!0,ta(i,!1),t.lanes=4194304)}else{if(!r)if(e=nc(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ta(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Je)return Rt(t),null}else 2*ct()-i.renderingStartTime>$s&&n!==1073741824&&(t.flags|=128,r=!0,ta(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ct(),t.sibling=null,n=nt.current,Ze(nt,r?n&1|2:n&1),t):(Rt(t),null);case 22:case 23:return Xp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tn&1073741824&&(Rt(t),t.subtreeFlags&6&&(t.flags|=8192)):Rt(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function UE(e,t){switch(Op(t),t.tag){case 1:return Gt(t.type)&&Yu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ks(),Ge(qt),Ge(At),zp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Up(t),null;case 13:if(Ge(nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(nt),null;case 4:return ks(),null;case 10:return Ip(t.type._context),null;case 22:case 23:return Xp(),null;case 24:return null;default:return null}}var iu=!1,Ot=!1,zE=typeof WeakSet=="function"?WeakSet:Set,J=null;function Bi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){st(e,t,r)}else n.current=null}function yh(e,t,n){try{n()}catch(r){st(e,t,r)}}var Jv=!1;function VE(e,t){if(th=Hu,e=U0(),Pp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var y;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(y=f.firstChild)!==null;)p=f,f=y;for(;;){if(f===e)break t;if(p===n&&++u===o&&(a=s),p===i&&++d===r&&(l=s),(y=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(nh={focusedElem:e,selectionRange:n},Hu=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,b=v.memoizedState,m=t.stateNode,h=m.getSnapshotBeforeUpdate(t.elementType===t.type?g:On(t.type,g),b);m.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(x){st(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return v=Jv,Jv=!1,v}function ka(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&yh(t,n,i)}o=o.next}while(o!==r)}}function Qc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function jw(e){var t=e.alternate;t!==null&&(e.alternate=null,jw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[Va],delete t[ih],delete t[EE],delete t[CE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lw(e){return e.tag===5||e.tag===3||e.tag===4}function eg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qu));else if(r!==4&&(e=e.child,e!==null))for(xh(e,t,n),e=e.sibling;e!==null;)xh(e,t,n),e=e.sibling}function bh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(bh(e,t,n),e=e.sibling;e!==null;)bh(e,t,n),e=e.sibling}var Et=null,Dn=!1;function Ur(e,t,n){for(n=n.child;n!==null;)Fw(e,t,n),n=n.sibling}function Fw(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Uc,n)}catch{}switch(n.tag){case 5:Ot||Bi(n,t);case 6:var r=Et,o=Dn;Et=null,Ur(e,t,n),Et=r,Dn=o,Et!==null&&(Dn?(e=Et,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Et.removeChild(n.stateNode));break;case 18:Et!==null&&(Dn?(e=Et,n=n.stateNode,e.nodeType===8?Zd(e.parentNode,n):e.nodeType===1&&Zd(e,n),ja(e)):Zd(Et,n.stateNode));break;case 4:r=Et,o=Dn,Et=n.stateNode.containerInfo,Dn=!0,Ur(e,t,n),Et=r,Dn=o;break;case 0:case 11:case 14:case 15:if(!Ot&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&yh(n,t,s),o=o.next}while(o!==r)}Ur(e,t,n);break;case 1:if(!Ot&&(Bi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){st(n,t,a)}Ur(e,t,n);break;case 21:Ur(e,t,n);break;case 22:n.mode&1?(Ot=(r=Ot)||n.memoizedState!==null,Ur(e,t,n),Ot=r):Ur(e,t,n);break;default:Ur(e,t,n)}}function tg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zE),t.forEach(function(r){var o=GE.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Pn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BE(r/1960))-r,10e?16:e,lo===null)var r=!1;else{if(e=lo,lo=null,ac=0,Ae&6)throw Error(z(331));var o=Ae;for(Ae|=4,J=e.current;J!==null;){var i=J,s=i.child;if(J.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lct()-qp?oi(e,0):Yp|=n),Xt(e,t)}function Kw(e,t){t===0&&(e.mode&1?(t=ql,ql<<=1,!(ql&130023424)&&(ql=4194304)):t=1);var n=zt();e=$r(e,t),e!==null&&(Tl(e,t,n),Xt(e,n))}function qE(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Kw(e,n)}function GE(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Kw(e,n)}var Qw;Qw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qt.current)Yt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Yt=!1,LE(e,t,n);Yt=!!(e.flags&131072)}else Yt=!1,Je&&t.flags&1048576&&G0(t,Xu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ku(e,t),e=t.pendingProps;var o=_s(t,At.current);es(t,n),o=Wp(null,t,r,e,o,n);var i=Bp();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gt(r)?(i=!0,qu(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Lp(t),o.updater=Zc,t.stateNode=o,o._reactInternals=t,dh(t,r,e,n),t=ph(null,t,r,!0,i,n)):(t.tag=0,Je&&i&&Np(t),Lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ku(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=JE(r),e=On(r,e),o){case 0:t=hh(null,t,r,e,n);break e;case 1:t=qv(null,t,r,e,n);break e;case 11:t=Qv(null,t,r,e,n);break e;case 14:t=Yv(null,t,r,On(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),hh(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),qv(e,t,r,o,n);case 3:e:{if(Nw(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,tw(e,t),tc(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ts(Error(z(423)),t),t=Gv(e,t,r,n,o);break e}else if(r!==o){o=Ts(Error(z(424)),t),t=Gv(e,t,r,n,o);break e}else for(on=go(t.stateNode.containerInfo.firstChild),an=t,Je=!0,In=null,n=iw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Es(),r===o){t=Rr(e,t,n);break e}Lt(e,t,r,n)}t=t.child}return t;case 5:return sw(t),e===null&&lh(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,rh(r,o)?s=null:i!==null&&rh(r,i)&&(t.flags|=32),Pw(e,t),Lt(e,t,s,n),t.child;case 6:return e===null&&lh(t),null;case 13:return Ow(e,t,n);case 4:return Fp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Cs(t,null,r,n):Lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),Qv(e,t,r,o,n);case 7:return Lt(e,t,t.pendingProps,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ze(Ju,r._currentValue),r._currentValue=s,i!==null)if(Wn(i.value,s)){if(i.children===o.children&&!qt.current){t=Rr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=_r(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),uh(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),uh(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,es(t,n),o=kn(o),r=r(o),t.flags|=1,Lt(e,t,r,n),t.child;case 14:return r=t.type,o=On(r,t.pendingProps),o=On(r.type,o),Yv(e,t,r,o,n);case 15:return $w(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),ku(e,t),t.tag=1,Gt(r)?(e=!0,qu(t)):e=!1,es(t,n),rw(t,r,o),dh(t,r,o,n),ph(null,t,r,!0,e,n);case 19:return Aw(e,t,n);case 22:return Rw(e,t,n)}throw Error(z(156,t.tag))};function Yw(e,t){return b0(e,t)}function XE(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,n,r){return new XE(e,t,n,r)}function em(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JE(e){if(typeof e=="function")return em(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wp)return 11;if(e===xp)return 14}return 2}function bo(e,t){var n=e.alternate;return n===null?(n=En(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ru(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")em(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Mi:return ii(n.children,o,i,t);case yp:s=8,o|=8;break;case Mf:return e=En(12,n,t,o|2),e.elementType=Mf,e.lanes=i,e;case If:return e=En(13,n,t,o),e.elementType=If,e.lanes=i,e;case jf:return e=En(19,n,t,o),e.elementType=jf,e.lanes=i,e;case o0:return qc(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case n0:s=10;break e;case r0:s=9;break e;case wp:s=11;break e;case xp:s=14;break e;case Qr:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=En(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ii(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function qc(e,t,n,r){return e=En(22,e,r,t),e.elementType=o0,e.lanes=n,e.stateNode={isHidden:!1},e}function ef(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function tf(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function eC(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Md(0),this.expirationTimes=Md(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Md(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function tm(e,t,n,r,o,i,s,a,l){return e=new eC(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=En(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lp(i),e}function tC(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jw)}catch(e){console.error(e)}}Jw(),Gy.exports=cn;var Mr=Gy.exports;const ex=cp(Mr),sC=Fy({__proto__:null,default:ex},[Mr]);var tx,ug=Mr;tx=ug.createRoot,ug.hydrateRoot;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>aC(n,t))}function it(...e){return c.useCallback(nx(...e),e)}function Ir(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),l=n.length;n=[...n,s];function u(f){const{scope:p,children:y,...v}=f,g=(p==null?void 0:p[e][l])||a,b=c.useMemo(()=>v,Object.values(v));return c.createElement(g.Provider,{value:b},y)}function d(f,p){const y=(p==null?void 0:p[e][l])||a,v=c.useContext(y);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,lC(o,...t)]}function lC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...a,...f}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Eo=c.forwardRef((e,t)=>{const{children:n,...r}=e,o=c.Children.toArray(n),i=o.find(cC);if(i){const s=i.props.children,a=o.map(l=>l===i?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:l);return c.createElement(kh,ne({},r,{ref:t}),c.isValidElement(s)?c.cloneElement(s,void 0,a):null)}return c.createElement(kh,ne({},r,{ref:t}),n)});Eo.displayName="Slot";const kh=c.forwardRef((e,t)=>{const{children:n,...r}=e;return c.isValidElement(n)?c.cloneElement(n,{...dC(r,n.props),ref:t?nx(t,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});kh.displayName="SlotClone";const uC=({children:e})=>c.createElement(c.Fragment,null,e);function cC(e){return c.isValidElement(e)&&e.type===uC}function dC(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function im(e){const t=e+"CollectionProvider",[n,r]=Ir(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:v,children:g}=y,b=de.useRef(null),m=de.useRef(new Map).current;return de.createElement(o,{scope:v,itemMap:m,collectionRef:b},g)},a=e+"CollectionSlot",l=de.forwardRef((y,v)=>{const{scope:g,children:b}=y,m=i(a,g),h=it(v,m.collectionRef);return de.createElement(Eo,{ref:h},b)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",f=de.forwardRef((y,v)=>{const{scope:g,children:b,...m}=y,h=de.useRef(null),w=it(v,h),x=i(u,g);return de.useEffect(()=>(x.itemMap.set(h,{ref:h,...m}),()=>void x.itemMap.delete(h))),de.createElement(Eo,{[d]:"",ref:w},b)});function p(y){const v=i(e+"CollectionConsumer",y);return de.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const m=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((x,_)=>m.indexOf(x.ref.current)-m.indexOf(_.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const fC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=fC.reduce((e,t)=>{const n=c.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Eo:t;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(a,ne({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function rx(e,t){e&&Mr.flushSync(()=>e.dispatchEvent(t))}function Vt(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function hC(e,t=globalThis==null?void 0:globalThis.document){const n=Vt(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Th="dismissableLayer.update",pC="dismissableLayer.pointerDownOutside",mC="dismissableLayer.focusOutside";let cg;const ox=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sm=c.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...u}=e,d=c.useContext(ox),[f,p]=c.useState(null),y=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=c.useState({}),g=it(t,T=>p(T)),b=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),h=b.indexOf(m),w=f?b.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,_=w>=h,C=gC(T=>{const O=T.target,I=[...d.branches].some(V=>V.contains(O));!_||I||(i==null||i(T),a==null||a(T),T.defaultPrevented||l==null||l())},y),E=yC(T=>{const O=T.target;[...d.branches].some(V=>V.contains(O))||(s==null||s(T),a==null||a(T),T.defaultPrevented||l==null||l())},y);return hC(T=>{w===d.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},y),c.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(cg=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),dg(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=cg)}},[f,y,r,d]),c.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),dg())},[f,d]),c.useEffect(()=>{const T=()=>v({});return document.addEventListener(Th,T),()=>document.removeEventListener(Th,T)},[]),c.createElement(ke.div,ne({},u,{ref:g,style:{pointerEvents:x?_?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,C.onPointerDownCapture)}))}),vC=c.forwardRef((e,t)=>{const n=c.useContext(ox),r=c.useRef(null),o=it(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.createElement(ke.div,ne({},e,{ref:o}))});function gC(e,t=globalThis==null?void 0:globalThis.document){const n=Vt(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let d=function(){ix(pC,n,u,{discrete:!0})};var l=d;const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yC(e,t=globalThis==null?void 0:globalThis.document){const n=Vt(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ix(mC,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dg(){const e=new CustomEvent(Th);document.dispatchEvent(e)}function ix(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?rx(o,i):o.dispatchEvent(i)}const wC=sm,xC=vC,am=c.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?ex.createPortal(c.createElement(ke.div,ne({},o,{ref:t})),r):null}),Jt=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function bC(e,t){return c.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Us=e=>{const{present:t,children:n}=e,r=SC(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=it(r.ref,o.ref);return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};Us.displayName="Presence";function SC(e){const[t,n]=c.useState(),r=c.useRef({}),o=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=bC(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=lu(r.current);i.current=a==="mounted"?u:"none"},[a]),Jt(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,y=lu(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Jt(()=>{if(t){const u=f=>{const y=lu(r.current).includes(f.animationName);f.target===t&&y&&Mr.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(i.current=lu(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function lu(e){return(e==null?void 0:e.animationName)||"none"}function Rs({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_C({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Vt(n),l=c.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else o(u)},[i,e,o,a]);return[s,l]}function _C({defaultProp:e,onChange:t}){const n=c.useState(e),[r]=n,o=c.useRef(r),i=Vt(t);return c.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const lm=c.forwardRef((e,t)=>c.createElement(ke.span,ne({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),sx="ToastProvider",[um,EC,CC]=im("Toast"),[ax,yM]=Ir("Toast",[CC]),[kC,td]=ax(sx),lx=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=c.useState(null),[u,d]=c.useState(0),f=c.useRef(!1),p=c.useRef(!1);return c.createElement(um.Provider,{scope:t},c.createElement(kC,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:c.useCallback(()=>d(y=>y+1),[]),onToastRemove:c.useCallback(()=>d(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p},s))};lx.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${sx}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const TC="ToastViewport",$C=["F8"],$h="toast.viewportPause",Rh="toast.viewportResume",RC=c.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=$C,label:o="Notifications ({hotkey})",...i}=e,s=td(TC,n),a=EC(n),l=c.useRef(null),u=c.useRef(null),d=c.useRef(null),f=c.useRef(null),p=it(t,f,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=s.toastCount>0;c.useEffect(()=>{const b=m=>{var h;r.every(x=>m[x]||m.code===x)&&((h=f.current)===null||h===void 0||h.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),c.useEffect(()=>{const b=l.current,m=f.current;if(v&&b&&m){const h=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent($h);m.dispatchEvent(C),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(Rh);m.dispatchEvent(C),s.isClosePausedRef.current=!1}},x=C=>{!b.contains(C.relatedTarget)&&w()},_=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",h),b.addEventListener("focusout",x),b.addEventListener("pointermove",h),b.addEventListener("pointerleave",_),window.addEventListener("blur",h),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",h),b.removeEventListener("focusout",x),b.removeEventListener("pointermove",h),b.removeEventListener("pointerleave",_),window.removeEventListener("blur",h),window.removeEventListener("focus",w)}}},[v,s.isClosePausedRef]);const g=c.useCallback(({tabbingDirection:b})=>{const h=a().map(w=>{const x=w.ref.current,_=[x,...HC(x)];return b==="forwards"?_:_.reverse()});return(b==="forwards"?h.reverse():h).flat()},[a]);return c.useEffect(()=>{const b=f.current;if(b){const m=h=>{const w=h.altKey||h.ctrlKey||h.metaKey;if(h.key==="Tab"&&!w){const T=document.activeElement,O=h.shiftKey;if(h.target===b&&O){var _;(_=u.current)===null||_===void 0||_.focus();return}const D=g({tabbingDirection:O?"backwards":"forwards"}),B=D.findIndex(M=>M===T);if(nf(D.slice(B+1)))h.preventDefault();else{var C,E;O?(C=u.current)===null||C===void 0||C.focus():(E=d.current)===null||E===void 0||E.focus()}}};return b.addEventListener("keydown",m),()=>b.removeEventListener("keydown",m)}},[a,g]),c.createElement(xC,{ref:l,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:v?void 0:"none"}},v&&c.createElement(fg,{ref:u,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});nf(b)}}),c.createElement(um.Slot,{scope:n},c.createElement(ke.ol,ne({tabIndex:-1},i,{ref:p}))),v&&c.createElement(fg,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});nf(b)}}))}),PC="ToastFocusProxy",fg=c.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=td(PC,n);return c.createElement(lm,ne({"aria-hidden":!0,tabIndex:0},o,{ref:t,style:{position:"fixed"},onFocus:s=>{var a;const l=s.relatedTarget;!((a=i.viewport)!==null&&a!==void 0&&a.contains(l))&&r()}}))}),nd="Toast",NC="toast.swipeStart",OC="toast.swipeMove",AC="toast.swipeCancel",DC="toast.swipeEnd",MC=c.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a=!0,l]=Rs({prop:r,defaultProp:o,onChange:i});return c.createElement(Us,{present:n||a},c.createElement(ux,ne({open:a},s,{ref:t,onClose:()=>l(!1),onPause:Vt(e.onPause),onResume:Vt(e.onResume),onSwipeStart:Ee(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Ee(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ee(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[IC,jC]=ax(nd,{onClose(){}}),ux=c.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:y,...v}=e,g=td(nd,n),[b,m]=c.useState(null),h=it(t,M=>m(M)),w=c.useRef(null),x=c.useRef(null),_=o||g.duration,C=c.useRef(0),E=c.useRef(_),T=c.useRef(0),{onToastAdd:O,onToastRemove:I}=g,V=Vt(()=>{var M;(b==null?void 0:b.contains(document.activeElement))&&((M=g.viewport)===null||M===void 0||M.focus()),s()}),D=c.useCallback(M=>{!M||M===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(V,M))},[V]);c.useEffect(()=>{const M=g.viewport;if(M){const F=()=>{D(E.current),u==null||u()},H=()=>{const oe=new Date().getTime()-C.current;E.current=E.current-oe,window.clearTimeout(T.current),l==null||l()};return M.addEventListener($h,H),M.addEventListener(Rh,F),()=>{M.removeEventListener($h,H),M.removeEventListener(Rh,F)}}},[g.viewport,_,l,u,D]),c.useEffect(()=>{i&&!g.isClosePausedRef.current&&D(_)},[i,_,g.isClosePausedRef,D]),c.useEffect(()=>(O(),()=>I()),[O,I]);const B=c.useMemo(()=>b?hx(b):null,[b]);return g.viewport?c.createElement(c.Fragment,null,B&&c.createElement(LC,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0},B),c.createElement(IC,{scope:n,onClose:V},Mr.createPortal(c.createElement(um.ItemSlot,{scope:n},c.createElement(wC,{asChild:!0,onEscapeKeyDown:Ee(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||V(),g.isFocusedToastEscapeKeyDownRef.current=!1})},c.createElement(ke.li,ne({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection},v,{ref:h,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ee(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:Ee(e.onPointerDown,M=>{M.button===0&&(w.current={x:M.clientX,y:M.clientY})}),onPointerMove:Ee(e.onPointerMove,M=>{if(!w.current)return;const F=M.clientX-w.current.x,H=M.clientY-w.current.y,oe=!!x.current,L=["left","right"].includes(g.swipeDirection),K=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,re=L?K(0,F):0,he=L?0:K(0,H),ve=M.pointerType==="touch"?10:2,Ue={x:re,y:he},Ie={originalEvent:M,delta:Ue};oe?(x.current=Ue,uu(OC,f,Ie,{discrete:!1})):hg(Ue,g.swipeDirection,ve)?(x.current=Ue,uu(NC,d,Ie,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(F)>ve||Math.abs(H)>ve)&&(w.current=null)}),onPointerUp:Ee(e.onPointerUp,M=>{const F=x.current,H=M.target;if(H.hasPointerCapture(M.pointerId)&&H.releasePointerCapture(M.pointerId),x.current=null,w.current=null,F){const oe=M.currentTarget,L={originalEvent:M,delta:F};hg(F,g.swipeDirection,g.swipeThreshold)?uu(DC,y,L,{discrete:!0}):uu(AC,p,L,{discrete:!0}),oe.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})))),g.viewport))):null});ux.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${nd}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const LC=e=>{const{__scopeToast:t,children:n,...r}=e,o=td(nd,t),[i,s]=c.useState(!1),[a,l]=c.useState(!1);return WC(()=>s(!0)),c.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.createElement(am,{asChild:!0},c.createElement(lm,r,i&&c.createElement(c.Fragment,null,o.label," ",n)))},FC=c.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.createElement(ke.div,ne({},r,{ref:t}))}),UC=c.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.createElement(ke.div,ne({},r,{ref:t}))}),zC="ToastAction",cx=c.forwardRef((e,t)=>{const{altText:n,...r}=e;return n?c.createElement(fx,{altText:n,asChild:!0},c.createElement(dx,ne({},r,{ref:t}))):null});cx.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${zC}\``)}};const VC="ToastClose",dx=c.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=jC(VC,n);return c.createElement(fx,{asChild:!0},c.createElement(ke.button,ne({type:"button"},r,{ref:t,onClick:Ee(e.onClick,o.onClose)})))}),fx=c.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return c.createElement(ke.div,ne({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0},o,{ref:t}))});function hx(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),BC(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...hx(r))}}),t}function uu(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?rx(o,i):o.dispatchEvent(i)}const hg=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function WC(e=()=>{}){const t=Vt(e);Jt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function BC(e){return e.nodeType===e.ELEMENT_NODE}function HC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nf(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}const ZC=lx,px=RC,mx=MC,vx=FC,gx=UC,yx=cx,wx=dx;function xx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,mg=bx,Nl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const p=pg(d)||pg(f);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...y}=d;return Object.entries(y).every(v=>{let[g,b]=v;return Array.isArray(b)?b.includes({...i,...a}[g]):{...i,...a}[g]===b})?[...u,f,p]:u},[]);return mg(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};var KC={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"};const QC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fn=(e,t)=>{const n=c.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:a,...l},u)=>c.createElement("svg",{ref:u,...KC,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${QC(e)}`,...l},[...t.map(([d,f])=>c.createElement(d,f)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${e}`,n},YC=fn("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),qC=fn("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),GC=fn("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),XC=fn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),JC=fn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ek=fn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Sx=fn("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),tk=fn("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}],["path",{d:"M19 3v4",key:"vgv24u"}],["path",{d:"M21 5h-4",key:"1wcg1f"}]]),nk=fn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),rk=fn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),ok=fn("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),ik=fn("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),_x=fn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),cm="-";function sk(e){const t=lk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(cm);return a[0]===""&&a.length!==1&&a.shift(),Ex(a,t)||ak(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Ex(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ex(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(cm);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const vg=/^\[(.+)\]$/;function ak(e){if(vg.test(e)){const t=vg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function lk(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ck(Object.entries(e.classGroups),n).forEach(([i,s])=>{Ph(s,r,i,t)}),r}function Ph(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:gg(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(uk(o)){Ph(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Ph(s,gg(t,i),n,r)})})}function gg(e,t){let n=e;return t.split(cm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function uk(e){return e.isThemeGetter}function ck(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function dk(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const Cx="!";function fk(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,u=0,d;for(let g=0;gu?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}}}function hk(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function pk(e){return{cache:dk(e.cacheSize),splitModifiers:fk(e),...sk(e)}}const mk=/\s+/;function vk(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(mk).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(s);let f=r(d?u.substring(0,d):u),p=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(u),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}const y=hk(a).join(":");return{isTailwindClass:!0,modifierId:l?y+Cx:y,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:u}=s,d=a+l;return i.has(d)?!1:(i.add(d),o(l,u).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function gk(){let e=0,t,n,r="";for(;ef(d),e());return n=pk(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=vk(l,n);return o(l,d),d}return function(){return i(gk.apply(null,arguments))}}function Qe(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Tx=/^\[(?:([a-z-]+):)?(.+)\]$/i,wk=/^\d+\/\d+$/,xk=new Set(["px","full","screen"]),bk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sk=/\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$/,_k=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ek=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Nn(e){return Zo(e)||xk.has(e)||wk.test(e)}function zr(e){return zs(e,"length",Ok)}function Zo(e){return!!e&&!Number.isNaN(Number(e))}function cu(e){return zs(e,"number",Zo)}function ra(e){return!!e&&Number.isInteger(Number(e))}function Ck(e){return e.endsWith("%")&&Zo(e.slice(0,-1))}function xe(e){return Tx.test(e)}function Vr(e){return bk.test(e)}const kk=new Set(["length","size","percentage"]);function Tk(e){return zs(e,kk,$x)}function $k(e){return zs(e,"position",$x)}const Rk=new Set(["image","url"]);function Pk(e){return zs(e,Rk,Dk)}function Nk(e){return zs(e,"",Ak)}function oa(){return!0}function zs(e,t,n){const r=Tx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Ok(e){return Sk.test(e)}function $x(){return!1}function Ak(e){return _k.test(e)}function Dk(e){return Ek.test(e)}function Mk(){const e=Qe("colors"),t=Qe("spacing"),n=Qe("blur"),r=Qe("brightness"),o=Qe("borderColor"),i=Qe("borderRadius"),s=Qe("borderSpacing"),a=Qe("borderWidth"),l=Qe("contrast"),u=Qe("grayscale"),d=Qe("hueRotate"),f=Qe("invert"),p=Qe("gap"),y=Qe("gradientColorStops"),v=Qe("gradientColorStopPositions"),g=Qe("inset"),b=Qe("margin"),m=Qe("opacity"),h=Qe("padding"),w=Qe("saturate"),x=Qe("scale"),_=Qe("sepia"),C=Qe("skew"),E=Qe("space"),T=Qe("translate"),O=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",xe,t],D=()=>[xe,t],B=()=>["",Nn,zr],M=()=>["auto",Zo,xe],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],L=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",xe],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],he=()=>[Zo,cu],ve=()=>[Zo,xe];return{cacheSize:500,separator:":",theme:{colors:[oa],spacing:[Nn,zr],blur:["none","",Vr,xe],brightness:he(),borderColor:[e],borderRadius:["none","","full",Vr,xe],borderSpacing:D(),borderWidth:B(),contrast:he(),grayscale:K(),hueRotate:ve(),invert:K(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Ck,zr],inset:V(),margin:V(),opacity:he(),padding:D(),saturate:he(),scale:he(),sepia:K(),skew:ve(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",xe]}],container:["container"],columns:[{columns:[Vr]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"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"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),xe]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ra,xe]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xe]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",ra,xe]}],"grid-cols":[{"grid-cols":[oa]}],"col-start-end":[{col:["auto",{span:["full",ra,xe]},xe]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[oa]}],"row-start-end":[{row:["auto",{span:[ra,xe]},xe]}],"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":["auto","min","max","fr",xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",xe,t]}],"min-w":[{"min-w":["min","max","fit",xe,Nn]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Vr]},Vr,xe]}],h:[{h:[xe,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Nn,xe]}],"max-h":[{"max-h":[xe,t,"min","max","fit"]}],"font-size":[{text:["base",Vr,zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cu]}],"font-family":[{font:[oa]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xe]}],"line-clamp":[{"line-clamp":["none",Zo,cu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nn,xe]}],"list-image":[{"list-image":["none",xe]}],"list-style-type":[{list:["none","disc","decimal",xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Nn,zr]}],"underline-offset":[{"underline-offset":["auto",Nn,xe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),$k]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Pk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Nn,xe]}],"outline-w":[{outline:[Nn,zr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Nn,zr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Vr,Nk]}],"shadow-color":[{shadow:[oa]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":oe()}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Vr,xe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xe]}],duration:[{duration:ve()}],ease:[{ease:["linear","in","out","in-out",xe]}],delay:[{delay:ve()}],animate:[{animate:["none","spin","ping","pulse","bounce",xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[ra,xe]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xe]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],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",xe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",xe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nn,zr,cu]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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"],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-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-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"],"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"]}}}const Ik=yk(Mk);function le(...e){return Ik(bx(e))}const jk=ZC,Rx=c.forwardRef(({className:e,...t},n)=>S.jsx(px,{ref:n,className:le("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Rx.displayName=px.displayName;const Lk=Nl("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Px=c.forwardRef(({className:e,variant:t,...n},r)=>S.jsx(mx,{ref:r,className:le(Lk({variant:t}),e),...n}));Px.displayName=mx.displayName;const Fk=c.forwardRef(({className:e,...t},n)=>S.jsx(yx,{ref:n,className:le("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Fk.displayName=yx.displayName;const Nx=c.forwardRef(({className:e,...t},n)=>S.jsx(wx,{ref:n,className:le("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:S.jsx(_x,{className:"h-4 w-4"})}));Nx.displayName=wx.displayName;const Ox=c.forwardRef(({className:e,...t},n)=>S.jsx(vx,{ref:n,className:le("text-sm font-semibold",e),...t}));Ox.displayName=vx.displayName;const Ax=c.forwardRef(({className:e,...t},n)=>S.jsx(gx,{ref:n,className:le("text-sm opacity-90",e),...t}));Ax.displayName=gx.displayName;const Uk=1,zk=1e6;let rf=0;function Vk(){return rf=(rf+1)%Number.MAX_VALUE,rf.toString()}const of=new Map,yg=e=>{if(of.has(e))return;const t=setTimeout(()=>{of.delete(e),Ra({type:"REMOVE_TOAST",toastId:e})},zk);of.set(e,t)},Wk=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Uk)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?yg(n):e.toasts.forEach(r=>{yg(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Pu=[];let Nu={toasts:[]};function Ra(e){Nu=Wk(Nu,e),Pu.forEach(t=>{t(Nu)})}function dm({...e}){const t=Vk(),n=o=>Ra({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Ra({type:"DISMISS_TOAST",toastId:t});return Ra({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Bk(){const[e,t]=c.useState(Nu);return c.useEffect(()=>(Pu.push(t),()=>{const n=Pu.indexOf(t);n>-1&&Pu.splice(n,1)}),[e]),{...e,toast:dm,dismiss:n=>Ra({type:"DISMISS_TOAST",toastId:n})}}function Hk(){const{toasts:e}=Bk();return S.jsxs(jk,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return S.jsxs(Px,{...i,children:[S.jsxs("div",{className:"grid gap-1",children:[n&&S.jsx(Ox,{children:n}),r&&S.jsx(Ax,{children:r})]}),o,S.jsx(Nx,{})]},t)}),S.jsx(Rx,{})]})}var Vs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ps=typeof window>"u"||"Deno"in window;function wn(){}function Zk(e,t){return typeof e=="function"?e(t):e}function Nh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wg(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==fm(s,t.options))return!1}else if(!qa(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function xg(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Ya(t.options.mutationKey)!==Ya(i))return!1}else if(!qa(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function fm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ya)(e)}function Ya(e){return JSON.stringify(e,(t,n)=>Oh(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function qa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!qa(e[n],t[n])):!1}function Mx(e,t){if(e===t)return e;const n=bg(e)&&bg(t);if(n||Oh(e)&&Oh(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,s=n?[]:{};let a=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!Sg(n)||!n.hasOwnProperty("isPrototypeOf"))}function Sg(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ix(e){return new Promise(t=>{setTimeout(t,e)})}function _g(e){Ix(0).then(e)}function Ah(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Mx(e,t):t}function Kk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Qk(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Yo,Jr,ss,Ry,Yk=(Ry=class extends Vs{constructor(){super();te(this,Yo,void 0);te(this,Jr,void 0);te(this,ss,void 0);Y(this,ss,t=>{if(!Ps&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Jr)||this.setEventListener(k(this,ss))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Jr))==null||t.call(this),Y(this,Jr,void 0))}setEventListener(t){var n;Y(this,ss,t),(n=k(this,Jr))==null||n.call(this),Y(this,Jr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,Yo)!==t&&(Y(this,Yo,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof k(this,Yo)=="boolean"?k(this,Yo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yo=new WeakMap,Jr=new WeakMap,ss=new WeakMap,Ry),dc=new Yk,as,eo,ls,Py,qk=(Py=class extends Vs{constructor(){super();te(this,as,!0);te(this,eo,void 0);te(this,ls,void 0);Y(this,ls,t=>{if(!Ps&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,eo)||this.setEventListener(k(this,ls))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,eo))==null||t.call(this),Y(this,eo,void 0))}setEventListener(t){var n;Y(this,ls,t),(n=k(this,eo))==null||n.call(this),Y(this,eo,t(this.setOnline.bind(this)))}setOnline(t){k(this,as)!==t&&(Y(this,as,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,as)}},as=new WeakMap,eo=new WeakMap,ls=new WeakMap,Py),fc=new qk;function Gk(e){return Math.min(1e3*2**e,3e4)}function rd(e){return(e??"online")==="online"?fc.isOnline():!0}var jx=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function sf(e){return e instanceof jx}function Lx(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((b,m)=>{i=b,s=m}),l=b=>{var m;r||(y(new jx(b)),(m=e.abort)==null||m.call(e))},u=()=>{t=!0},d=()=>{t=!1},f=()=>!dc.isFocused()||e.networkMode!=="always"&&!fc.isOnline(),p=b=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,b),o==null||o(),i(b))},y=b=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,b),o==null||o(),s(b))},v=()=>new Promise(b=>{var m;o=h=>{const w=r||!f();return w&&b(h),w},(m=e.onPause)==null||m.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),g=()=>{if(r)return;let b;try{b=e.fn()}catch(m){b=Promise.reject(m)}Promise.resolve(b).then(p).catch(m=>{var C;if(r)return;const h=e.retry??(Ps?0:3),w=e.retryDelay??Gk,x=typeof w=="function"?w(n,m):w,_=h===!0||typeof h=="number"&&n{if(f())return v()}).then(()=>{t?y(m):g()})})};return rd(e.networkMode)?g():v().then(g),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function Xk(){let e=[],t=0,n=d=>{d()},r=d=>{d()};const o=d=>{let f;t++;try{f=d()}finally{t--,t||a()}return f},i=d=>{t?e.push(d):_g(()=>{n(d)})},s=d=>(...f)=>{i(()=>{d(...f)})},a=()=>{const d=e;e=[],d.length&&_g(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:o,batchCalls:s,schedule:i,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d}}}var vt=Xk(),qo,Ny,Fx=(Ny=class{constructor(){te(this,qo,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nh(this.gcTime)&&Y(this,qo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ps?1/0:5*60*1e3))}clearGcTimeout(){k(this,qo)&&(clearTimeout(k(this,qo)),Y(this,qo,void 0))}},qo=new WeakMap,Ny),us,cs,mn,to,vn,xt,pl,Go,ds,Ou,An,hr,Oy,Jk=(Oy=class extends Fx{constructor(t){super();te(this,ds);te(this,An);te(this,us,void 0);te(this,cs,void 0);te(this,mn,void 0);te(this,to,void 0);te(this,vn,void 0);te(this,xt,void 0);te(this,pl,void 0);te(this,Go,void 0);Y(this,Go,!1),Y(this,pl,t.defaultOptions),ye(this,ds,Ou).call(this,t.options),Y(this,xt,[]),Y(this,mn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,us,t.state||eT(this.options)),this.state=k(this,us),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!k(this,xt).length&&this.state.fetchStatus==="idle"&&k(this,mn).remove(this)}setData(t,n){const r=Ah(this.state.data,t,this.options);return ye(this,An,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ye(this,An,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=k(this,to);return(r=k(this,vn))==null||r.cancel(t),n?n.then(wn).catch(wn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,us))}isActive(){return k(this,xt).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||k(this,xt).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Dx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=k(this,xt).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,vn))==null||n.continue()}onOnline(){var n;const t=k(this,xt).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,vn))==null||n.continue()}addObserver(t){k(this,xt).includes(t)||(k(this,xt).push(t),this.clearGcTimeout(),k(this,mn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){k(this,xt).includes(t)&&(Y(this,xt,k(this,xt).filter(n=>n!==t)),k(this,xt).length||(k(this,vn)&&(k(this,Go)?k(this,vn).cancel({revert:!0}):k(this,vn).cancelRetry()),this.scheduleGc()),k(this,mn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return k(this,xt).length}invalidate(){this.state.isInvalidated||ye(this,An,hr).call(this,{type:"invalidate"})}fetch(t,n){var u,d,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,to))return(u=k(this,vn))==null||u.continueRetry(),k(this,to)}if(t&&ye(this,ds,Ou).call(this,t),!this.options.queryFn){const y=k(this,xt).find(v=>v.options.queryFn);y&&ye(this,ds,Ou).call(this,y.options)}const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(Y(this,Go,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Y(this,Go,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(d=this.options.behavior)==null||d.onFetch(a,this),Y(this,cs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&ye(this,An,hr).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=y=>{var v,g,b,m;sf(y)&&y.silent||ye(this,An,hr).call(this,{type:"error",error:y}),sf(y)||((g=(v=k(this,mn).config).onError)==null||g.call(v,y,this),(m=(b=k(this,mn).config).onSettled)==null||m.call(b,this.state.data,y,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Y(this,vn,Lx({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:y=>{var v,g,b,m;if(typeof y>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(y),(g=(v=k(this,mn).config).onSuccess)==null||g.call(v,y,this),(m=(b=k(this,mn).config).onSettled)==null||m.call(b,y,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(y,v)=>{ye(this,An,hr).call(this,{type:"failed",failureCount:y,error:v})},onPause:()=>{ye(this,An,hr).call(this,{type:"pause"})},onContinue:()=>{ye(this,An,hr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Y(this,to,k(this,vn).promise),k(this,to)}},us=new WeakMap,cs=new WeakMap,mn=new WeakMap,to=new WeakMap,vn=new WeakMap,xt=new WeakMap,pl=new WeakMap,Go=new WeakMap,ds=new WeakSet,Ou=function(t){this.options={...k(this,pl),...t},this.updateGcTime(this.options.gcTime)},An=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:rd(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return sf(o)&&o.revert&&k(this,cs)?{...k(this,cs),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vt.batch(()=>{k(this,xt).forEach(r=>{r.onQueryUpdate()}),k(this,mn).notify({query:this,type:"updated",action:t})})},Oy);function eT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Yn,Ay,tT=(Ay=class extends Vs{constructor(t={}){super();te(this,Yn,void 0);this.config=t,Y(this,Yn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??fm(o,n);let s=this.get(i);return s||(s=new Jk({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){k(this,Yn).has(t.queryHash)||(k(this,Yn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,Yn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,Yn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,Yn).get(t)}getAll(){return[...k(this,Yn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>wg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>wg(t,r)):n}notify(t){vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yn=new WeakMap,Ay),qn,ml,en,fs,Gn,Hr,Dy,nT=(Dy=class extends Fx{constructor(t){super();te(this,Gn);te(this,qn,void 0);te(this,ml,void 0);te(this,en,void 0);te(this,fs,void 0);this.mutationId=t.mutationId,Y(this,ml,t.defaultOptions),Y(this,en,t.mutationCache),Y(this,qn,[]),this.state=t.state||Ux(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...k(this,ml),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,qn).includes(t)||(k(this,qn).push(t),this.clearGcTimeout(),k(this,en).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,qn,k(this,qn).filter(n=>n!==t)),this.scheduleGc(),k(this,en).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,qn).length||(this.state.status==="pending"?this.scheduleGc():k(this,en).remove(this))}continue(){var t;return((t=k(this,fs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,f,p,y,v,g,b,m,h,w,x,_,C,E;const n=()=>(Y(this,fs,Lx({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,O)=>{ye(this,Gn,Hr).call(this,{type:"failed",failureCount:T,error:O})},onPause:()=>{ye(this,Gn,Hr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Gn,Hr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),k(this,fs).promise),r=this.state.status==="pending";try{if(!r){ye(this,Gn,Hr).call(this,{type:"pending",variables:t}),await((i=(o=k(this,en).config).onMutate)==null?void 0:i.call(o,t,this));const O=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));O!==this.state.context&&ye(this,Gn,Hr).call(this,{type:"pending",context:O,variables:t})}const T=await n();return await((u=(l=k(this,en).config).onSuccess)==null?void 0:u.call(l,T,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,T,t,this.state.context)),await((y=(p=k(this,en).config).onSettled)==null?void 0:y.call(p,T,null,this.state.variables,this.state.context,this)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,T,null,t,this.state.context)),ye(this,Gn,Hr).call(this,{type:"success",data:T}),T}catch(T){try{throw await((m=(b=k(this,en).config).onError)==null?void 0:m.call(b,T,t,this.state.context,this)),await((w=(h=this.options).onError)==null?void 0:w.call(h,T,t,this.state.context)),await((_=(x=k(this,en).config).onSettled)==null?void 0:_.call(x,void 0,T,this.state.variables,this.state.context,this)),await((E=(C=this.options).onSettled)==null?void 0:E.call(C,void 0,T,t,this.state.context)),T}finally{ye(this,Gn,Hr).call(this,{type:"error",error:T})}}}},qn=new WeakMap,ml=new WeakMap,en=new WeakMap,fs=new WeakMap,Gn=new WeakSet,Hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!rd(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vt.batch(()=>{k(this,qn).forEach(r=>{r.onMutationUpdate(t)}),k(this,en).notify({mutation:this,type:"updated",action:t})})},Dy);function Ux(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gn,vl,Xo,My,rT=(My=class extends Vs{constructor(t={}){super();te(this,gn,void 0);te(this,vl,void 0);te(this,Xo,void 0);this.config=t,Y(this,gn,[]),Y(this,vl,0)}build(t,n,r){const o=new nT({mutationCache:this,mutationId:++Bl(this,vl)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){k(this,gn).push(t),this.notify({type:"added",mutation:t})}remove(t){Y(this,gn,k(this,gn).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){vt.batch(()=>{k(this,gn).forEach(t=>{this.remove(t)})})}getAll(){return k(this,gn)}find(t){const n={exact:!0,...t};return k(this,gn).find(r=>xg(n,r))}findAll(t={}){return k(this,gn).filter(n=>xg(t,n))}notify(t){vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Y(this,Xo,(k(this,Xo)??Promise.resolve()).then(()=>{const t=k(this,gn).filter(n=>n.state.isPaused);return vt.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(wn)),Promise.resolve()))}).then(()=>{Y(this,Xo,void 0)})),k(this,Xo)}},gn=new WeakMap,vl=new WeakMap,Xo=new WeakMap,My);function oT(e){return{onFetch:(t,n)=>{const r=async()=>{var v,g,b,m,h;const o=t.options,i=(b=(g=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((h=t.state.data)==null?void 0:h.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(w,x,_)=>{if(u)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:x,direction:_?"backward":"forward",meta:t.options.meta};d(C);const E=await f(C),{maxPages:T}=t.options,O=_?Qk:Kk;return{pages:O(w.pages,E,T),pageParams:O(w.pageParams,x,T)}};let y;if(i&&s.length){const w=i==="backward",x=w?iT:Eg,_={pages:s,pageParams:a},C=x(o,_);y=await p(_,C,w)}else{y=await p(l,a[0]??o.initialPageParam);const w=e??s.length;for(let x=1;x{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function Eg(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function iT(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var pt,no,ro,hs,ps,oo,ms,vs,Iy,sT=(Iy=class{constructor(e={}){te(this,pt,void 0);te(this,no,void 0);te(this,ro,void 0);te(this,hs,void 0);te(this,ps,void 0);te(this,oo,void 0);te(this,ms,void 0);te(this,vs,void 0);Y(this,pt,e.queryCache||new tT),Y(this,no,e.mutationCache||new rT),Y(this,ro,e.defaultOptions||{}),Y(this,hs,new Map),Y(this,ps,new Map),Y(this,oo,0)}mount(){Bl(this,oo)._++,k(this,oo)===1&&(Y(this,ms,dc.subscribe(()=>{dc.isFocused()&&(this.resumePausedMutations(),k(this,pt).onFocus())})),Y(this,vs,fc.subscribe(()=>{fc.isOnline()&&(this.resumePausedMutations(),k(this,pt).onOnline())})))}unmount(){var e,t;Bl(this,oo)._--,k(this,oo)===0&&((e=k(this,ms))==null||e.call(this),Y(this,ms,void 0),(t=k(this,vs))==null||t.call(this),Y(this,vs,void 0))}isFetching(e){return k(this,pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,no).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=k(this,pt).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=k(this,pt).find({queryKey:e}),o=r==null?void 0:r.state.data,i=Zk(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return k(this,pt).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=k(this,pt).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=k(this,pt);vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,pt),r={type:"active",...e};return vt.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=vt.batch(()=>k(this,pt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(wn).catch(wn)}invalidateQueries(e={},t={}){return vt.batch(()=>{if(k(this,pt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=vt.batch(()=>k(this,pt).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(wn)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(wn)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=k(this,pt).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(wn).catch(wn)}fetchInfiniteQuery(e){return e.behavior=oT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(wn).catch(wn)}resumePausedMutations(){return k(this,no).resumePausedMutations()}getQueryCache(){return k(this,pt)}getMutationCache(){return k(this,no)}getDefaultOptions(){return k(this,ro)}setDefaultOptions(e){Y(this,ro,e)}setQueryDefaults(e,t){k(this,hs).set(Ya(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,hs).values()];let n={};return t.forEach(r=>{qa(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){k(this,ps).set(Ya(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,ps).values()];let n={};return t.forEach(r=>{qa(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...k(this,ro).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,ro).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,pt).clear(),k(this,no).clear()}},pt=new WeakMap,no=new WeakMap,ro=new WeakMap,hs=new WeakMap,ps=new WeakMap,oo=new WeakMap,ms=new WeakMap,vs=new WeakMap,Iy),Zt,He,gs,Pt,Jo,ys,Xn,gl,ws,xs,ei,ti,io,ni,ri,wa,yl,Dh,wl,Mh,xl,Ih,bl,jh,Sl,Lh,_l,Fh,El,Uh,Lc,zx,jy,aT=(jy=class extends Vs{constructor(t,n){super();te(this,ri);te(this,yl);te(this,wl);te(this,xl);te(this,bl);te(this,Sl);te(this,_l);te(this,El);te(this,Lc);te(this,Zt,void 0);te(this,He,void 0);te(this,gs,void 0);te(this,Pt,void 0);te(this,Jo,void 0);te(this,ys,void 0);te(this,Xn,void 0);te(this,gl,void 0);te(this,ws,void 0);te(this,xs,void 0);te(this,ei,void 0);te(this,ti,void 0);te(this,io,void 0);te(this,ni,void 0);Y(this,He,void 0),Y(this,gs,void 0),Y(this,Pt,void 0),Y(this,ni,new Set),Y(this,Zt,t),this.options=n,Y(this,Xn,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,He).addObserver(this),Cg(k(this,He),this.options)?ye(this,ri,wa).call(this):this.updateResult(),ye(this,bl,jh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zh(k(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zh(k(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Sl,Lh).call(this),ye(this,_l,Fh).call(this),k(this,He).removeObserver(this)}setOptions(t,n){const r=this.options,o=k(this,He);if(this.options=k(this,Zt).defaultQueryOptions(t),cc(r,this.options)||k(this,Zt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,He),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ye(this,El,Uh).call(this);const i=this.hasListeners();i&&kg(k(this,He),o,this.options,r)&&ye(this,ri,wa).call(this),this.updateResult(n),i&&(k(this,He)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ye(this,yl,Dh).call(this);const s=ye(this,wl,Mh).call(this);i&&(k(this,He)!==o||this.options.enabled!==r.enabled||s!==k(this,io))&&ye(this,xl,Ih).call(this,s)}getOptimisticResult(t){const n=k(this,Zt).getQueryCache().build(k(this,Zt),t),r=this.createResult(n,t);return uT(this,r)&&(Y(this,Pt,r),Y(this,ys,this.options),Y(this,Jo,k(this,He).state)),r}getCurrentResult(){return k(this,Pt)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(k(this,ni).add(r),t[r])})}),n}getCurrentQuery(){return k(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,Zt).defaultQueryOptions(t),r=k(this,Zt).getQueryCache().build(k(this,Zt),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ye(this,ri,wa).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Pt)))}createResult(t,n){var C;const r=k(this,He),o=this.options,i=k(this,Pt),s=k(this,Jo),a=k(this,ys),u=t!==r?t.state:k(this,gs),{state:d}=t;let{error:f,errorUpdatedAt:p,fetchStatus:y,status:v}=d,g=!1,b;if(n._optimisticResults){const E=this.hasListeners(),T=!E&&Cg(t,n),O=E&&kg(t,r,n,o);(T||O)&&(y=rd(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(y="idle")}if(n.select&&typeof d.data<"u")if(i&&d.data===(s==null?void 0:s.data)&&n.select===k(this,gl))b=k(this,ws);else try{Y(this,gl,n.select),b=n.select(d.data),b=Ah(i==null?void 0:i.data,b,n),Y(this,ws,b),Y(this,Xn,null)}catch(E){Y(this,Xn,E)}else b=d.data;if(typeof n.placeholderData<"u"&&typeof b>"u"&&v==="pending"){let E;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))E=i.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((C=k(this,xs))==null?void 0:C.state.data,k(this,xs)):n.placeholderData,n.select&&typeof E<"u")try{E=n.select(E),Y(this,Xn,null)}catch(T){Y(this,Xn,T)}typeof E<"u"&&(v="success",b=Ah(i==null?void 0:i.data,E,n),g=!0)}k(this,Xn)&&(f=k(this,Xn),b=k(this,ws),p=Date.now(),v="error");const m=y==="fetching",h=v==="pending",w=v==="error",x=h&&m;return{status:v,fetchStatus:y,isPending:h,isSuccess:v==="success",isError:w,isInitialLoading:x,isLoading:x,data:b,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!h,isLoadingError:w&&d.dataUpdatedAt===0,isPaused:y==="paused",isPlaceholderData:g,isRefetchError:w&&d.dataUpdatedAt!==0,isStale:hm(t,n),refetch:this.refetch}}updateResult(t){const n=k(this,Pt),r=this.createResult(k(this,He),this.options);if(Y(this,Jo,k(this,He).state),Y(this,ys,this.options),cc(r,n))return;k(this,Jo).data!==void 0&&Y(this,xs,k(this,He)),Y(this,Pt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!k(this,ni).size)return!0;const l=new Set(a??k(this,ni));return this.options.throwOnError&&l.add("error"),Object.keys(k(this,Pt)).some(u=>{const d=u;return k(this,Pt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ye(this,Lc,zx).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,bl,jh).call(this)}},Zt=new WeakMap,He=new WeakMap,gs=new WeakMap,Pt=new WeakMap,Jo=new WeakMap,ys=new WeakMap,Xn=new WeakMap,gl=new WeakMap,ws=new WeakMap,xs=new WeakMap,ei=new WeakMap,ti=new WeakMap,io=new WeakMap,ni=new WeakMap,ri=new WeakSet,wa=function(t){ye(this,El,Uh).call(this);let n=k(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(wn)),n},yl=new WeakSet,Dh=function(){if(ye(this,Sl,Lh).call(this),Ps||k(this,Pt).isStale||!Nh(this.options.staleTime))return;const n=Dx(k(this,Pt).dataUpdatedAt,this.options.staleTime)+1;Y(this,ei,setTimeout(()=>{k(this,Pt).isStale||this.updateResult()},n))},wl=new WeakSet,Mh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,He)):this.options.refetchInterval)??!1},xl=new WeakSet,Ih=function(t){ye(this,_l,Fh).call(this),Y(this,io,t),!(Ps||this.options.enabled===!1||!Nh(k(this,io))||k(this,io)===0)&&Y(this,ti,setInterval(()=>{(this.options.refetchIntervalInBackground||dc.isFocused())&&ye(this,ri,wa).call(this)},k(this,io)))},bl=new WeakSet,jh=function(){ye(this,yl,Dh).call(this),ye(this,xl,Ih).call(this,ye(this,wl,Mh).call(this))},Sl=new WeakSet,Lh=function(){k(this,ei)&&(clearTimeout(k(this,ei)),Y(this,ei,void 0))},_l=new WeakSet,Fh=function(){k(this,ti)&&(clearInterval(k(this,ti)),Y(this,ti,void 0))},El=new WeakSet,Uh=function(){const t=k(this,Zt).getQueryCache().build(k(this,Zt),this.options);if(t===k(this,He))return;const n=k(this,He);Y(this,He,t),Y(this,gs,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lc=new WeakSet,zx=function(t){vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,Pt))}),k(this,Zt).getQueryCache().notify({query:k(this,He),type:"observerResultsUpdated"})})},jy);function lT(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Cg(e,t){return lT(e,t)||e.state.dataUpdatedAt>0&&zh(e,t,t.refetchOnMount)}function zh(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&hm(e,t)}return!1}function kg(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&hm(e,n)}function hm(e,t){return e.isStaleByTime(t.staleTime)}function uT(e,t){return!cc(e.getCurrentResult(),t)}var so,jt,yn,gr,bs,Au,Cl,Vh,Ly,cT=(Ly=class extends Vs{constructor(n,r){super();te(this,bs);te(this,Cl);te(this,so,void 0);te(this,jt,void 0);te(this,yn,void 0);te(this,gr,void 0);Y(this,jt,void 0),Y(this,so,n),this.setOptions(r),this.bindMethods(),ye(this,bs,Au).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=k(this,so).defaultMutationOptions(n),cc(r,this.options)||k(this,so).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,yn),observer:this}),(o=k(this,yn))==null||o.setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=k(this,yn))==null||n.removeObserver(this)}onMutationUpdate(n){ye(this,bs,Au).call(this),ye(this,Cl,Vh).call(this,n)}getCurrentResult(){return k(this,jt)}reset(){Y(this,yn,void 0),ye(this,bs,Au).call(this),ye(this,Cl,Vh).call(this)}mutate(n,r){var o;return Y(this,gr,r),(o=k(this,yn))==null||o.removeObserver(this),Y(this,yn,k(this,so).getMutationCache().build(k(this,so),this.options)),k(this,yn).addObserver(this),k(this,yn).execute(n)}},so=new WeakMap,jt=new WeakMap,yn=new WeakMap,gr=new WeakMap,bs=new WeakSet,Au=function(){var r;const n=((r=k(this,yn))==null?void 0:r.state)??Ux();Y(this,jt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Cl=new WeakSet,Vh=function(n){vt.batch(()=>{var r,o,i,s,a,l,u,d;k(this,gr)&&this.hasListeners()&&((n==null?void 0:n.type)==="success"?((o=(r=k(this,gr)).onSuccess)==null||o.call(r,n.data,k(this,jt).variables,k(this,jt).context),(s=(i=k(this,gr)).onSettled)==null||s.call(i,n.data,null,k(this,jt).variables,k(this,jt).context)):(n==null?void 0:n.type)==="error"&&((l=(a=k(this,gr)).onError)==null||l.call(a,n.error,k(this,jt).variables,k(this,jt).context),(d=(u=k(this,gr)).onSettled)==null||d.call(u,void 0,n.error,k(this,jt).variables,k(this,jt).context))),this.listeners.forEach(f=>{f(k(this,jt))})})},Ly),Vx=c.createContext(void 0),od=e=>{const t=c.useContext(Vx);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dT=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.createElement(Vx.Provider,{value:e},t)),Wx=c.createContext(!1),fT=()=>c.useContext(Wx);Wx.Provider;function hT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pT=c.createContext(hT()),mT=()=>c.useContext(pT);function Bx(e,t){return typeof e=="function"?e(...t):!!e}var vT=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},gT=e=>{c.useEffect(()=>{e.clearReset()},[e])},yT=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&Bx(n,[e.error,r]),wT=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},xT=(e,t)=>e.isLoading&&e.isFetching&&!t,bT=(e,t,n)=>(e==null?void 0:e.suspense)&&xT(t,n),ST=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _T(e,t,n){const r=od(n),o=fT(),i=mT(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",wT(s),vT(s,i),gT(i);const[a]=c.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(c.useSyncExternalStore(c.useCallback(u=>{const d=o?()=>{}:a.subscribe(vt.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),bT(s,l,o))throw ST(s,a,i);if(yT({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:a.getCurrentQuery()}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function pm(e,t){return _T(e,aT,t)}function Hx(e,t){const n=od(t),[r]=c.useState(()=>new cT(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);const o=c.useSyncExternalStore(c.useCallback(s=>r.subscribe(vt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=c.useCallback((s,a)=>{r.mutate(s,a).catch(ET)},[r]);if(o.error&&Bx(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function ET(){}var CT=function(){return null};/** - * @remix-run/router v1.12.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function fi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TT(){return Math.random().toString(36).substr(2,8)}function $g(e,t){return{usr:e.state,key:e.key,idx:t}}function Ga(e,t,n,r){return n===void 0&&(n=null),at({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?jr(t):t,{state:n,key:t&&t.key||r||TT()})}function hi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function jr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function $T(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=lt.Pop,l=null,u=d();u==null&&(u=0,s.replaceState(at({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){a=lt.Pop;let b=d(),m=b==null?null:b-u;u=b,l&&l({action:a,location:g.location,delta:m})}function p(b,m){a=lt.Push;let h=Ga(g.location,b,m);n&&n(h,b),u=d()+1;let w=$g(h,u),x=g.createHref(h);try{s.pushState(w,"",x)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;o.location.assign(x)}i&&l&&l({action:a,location:g.location,delta:1})}function y(b,m){a=lt.Replace;let h=Ga(g.location,b,m);n&&n(h,b),u=d();let w=$g(h,u),x=g.createHref(h);s.replaceState(w,"",x),i&&l&&l({action:a,location:g.location,delta:0})}function v(b){let m=o.location.origin!=="null"?o.location.origin:o.location.href,h=typeof b=="string"?b:hi(b);return Se(m,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,m)}let g={get action(){return a},get location(){return e(o,s)},listen(b){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Tg,f),l=b,()=>{o.removeEventListener(Tg,f),l=null}},createHref(b){return t(o,b)},createURL:v,encodeLocation(b){let m=v(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:y,go(b){return s.go(b)}};return g}var ut;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ut||(ut={}));const RT=new Set(["lazy","caseSensitive","path","id","index","children"]);function PT(e){return e.index===!0}function Wh(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,i],a=typeof o.id=="string"?o.id:s.join("-");if(Se(o.index!==!0||!o.children,"Cannot specify children on an index route"),Se(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),PT(o)){let l=at({},o,t(o),{id:a});return r[a]=l,l}else{let l=at({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=Wh(o.children,t,s,r)),l}})}function Zi(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?jr(t):t,o=Co(r.pathname||"/",n);if(o==null)return null;let i=Zx(e);OT(i);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(Se(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Er([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(Se(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Zx(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:FT(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of Kx(i.path))o(i,s,l)}),t}function Kx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=Kx(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function OT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:UT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const AT=/^:\w+$/,DT=3,MT=2,IT=1,jT=10,LT=-2,Rg=e=>e==="*";function FT(e,t){let n=e.split("/"),r=n.length;return n.some(Rg)&&(r+=LT),t&&(r+=MT),n.filter(o=>!Rg(o)).reduce((o,i)=>o+(AT.test(i)?DT:i===""?IT:jT),r)}function UT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function zT(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s{let{paramName:p,isOptional:y}=d;if(p==="*"){let g=a[f]||"";s=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const v=a[f];return y&&!v?u[p]=void 0:u[p]=BT(v||"",p),u},{}),pathname:i,pathnameBase:s,pattern:e}}function VT(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),fi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function WT(e){try{return decodeURI(e)}catch(t){return fi(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function BT(e,t){try{return decodeURIComponent(e)}catch(n){return fi(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Co(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function HT(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?jr(e):e;return{pathname:n?n.startsWith("/")?n:ZT(n,t):t,search:QT(r),hash:YT(o)}}function ZT(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function af(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function id(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function mm(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=jr(e):(o=at({},e),Se(!o.pathname||!o.pathname.includes("?"),af("?","pathname","search",o)),Se(!o.pathname||!o.pathname.includes("#"),af("#","pathname","hash",o)),Se(!o.search||!o.search.includes("#"),af("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else if(r){let f=t[t.length-1].replace(/^\//,"").split("/");if(s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),f.pop();o.pathname=p.join("/")}a="/"+f.join("/")}else{let f=t.length-1;if(s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),f-=1;o.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=HT(o,a),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Er=e=>e.join("/").replace(/\/\/+/g,"/"),KT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,YT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class vm{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Qx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Yx=["post","put","patch","delete"],qT=new Set(Yx),GT=["get",...Yx],XT=new Set(GT),JT=new Set([301,302,303,307,308]),e$=new Set([307,308]),lf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},t$={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ia={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,n$=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Gx="remix-router-transitions";function r$(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Se(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let R=e.detectErrorBoundary;o=P=>({hasErrorBoundary:R(P)})}else o=n$;let i={},s=Wh(e.routes,o,void 0,i),a,l=e.basename||"/",u=at({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),d=null,f=new Set,p=null,y=null,v=null,g=e.hydrationData!=null,b=Zi(s,e.history.location,l),m=null;if(b==null){let R=xn(404,{pathname:e.history.location.pathname}),{matches:P,route:j}=jg(s);b=P,m={[j.id]:R}}let h=!b.some(R=>R.route.lazy)&&(!b.some(R=>R.route.loader)||e.hydrationData!=null),w,x={historyAction:e.history.action,location:e.history.location,matches:b,initialized:h,navigation:lf,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},_=lt.Pop,C=!1,E,T=!1,O=new Map,I=null,V=!1,D=!1,B=[],M=[],F=new Map,H=0,oe=-1,L=new Map,K=new Set,re=new Map,he=new Map,ve=new Set,Ue=new Map,Ie=new Map,ht=!1;function ze(){if(d=e.history.listen(R=>{let{action:P,location:j,delta:q}=R;if(ht){ht=!1;return}fi(Ie.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ie=Gm({currentLocation:x.location,nextLocation:j,historyAction:P});if(ie&&q!=null){ht=!0,e.history.go(q*-1),Lo(ie,{state:"blocked",location:j,proceed(){Lo(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),e.history.go(q)},reset(){let _e=new Map(x.blockers);_e.set(ie,ia),$e({blockers:_e})}});return}return Xe(P,j)}),n){p$(t,O);let R=()=>m$(t,O);t.addEventListener("pagehide",R),I=()=>t.removeEventListener("pagehide",R)}return x.initialized||Xe(lt.Pop,x.location),w}function ue(){d&&d(),I&&I(),f.clear(),E&&E.abort(),x.fetchers.forEach((R,P)=>Ve(P)),x.blockers.forEach((R,P)=>Vl(P))}function Me(R){return f.add(R),()=>f.delete(R)}function $e(R,P){P===void 0&&(P={}),x=at({},x,R);let j=[],q=[];u.v7_fetcherPersist&&x.fetchers.forEach((ie,_e)=>{ie.state==="idle"&&(ve.has(_e)?q.push(_e):j.push(_e))}),[...f].forEach(ie=>ie(x,{deletedFetchers:q,unstable_viewTransitionOpts:P.viewTransitionOpts,unstable_flushSync:P.flushSync===!0})),u.v7_fetcherPersist&&(j.forEach(ie=>x.fetchers.delete(ie)),q.forEach(ie=>Ve(ie)))}function Re(R,P,j){var q,ie;let{flushSync:_e}=j===void 0?{}:j,me=x.actionData!=null&&x.navigation.formMethod!=null&&Mn(x.navigation.formMethod)&&x.navigation.state==="loading"&&((q=R.state)==null?void 0:q._isRedirect)!==!0,pe;P.actionData?Object.keys(P.actionData).length>0?pe=P.actionData:pe=null:me?pe=x.actionData:pe=null;let ae=P.loaderData?Ig(x.loaderData,P.loaderData,P.matches||[],P.errors):x.loaderData,Pe=x.blockers;Pe.size>0&&(Pe=new Map(Pe),Pe.forEach((We,et)=>Pe.set(et,ia)));let _t=C===!0||x.navigation.formMethod!=null&&Mn(x.navigation.formMethod)&&((ie=R.state)==null?void 0:ie._isRedirect)!==!0;a&&(s=a,a=void 0),V||_===lt.Pop||(_===lt.Push?e.history.push(R,R.state):_===lt.Replace&&e.history.replace(R,R.state));let Ce;if(_===lt.Pop){let We=O.get(x.location.pathname);We&&We.has(R.pathname)?Ce={currentLocation:x.location,nextLocation:R}:O.has(R.pathname)&&(Ce={currentLocation:R,nextLocation:x.location})}else if(T){let We=O.get(x.location.pathname);We?We.add(R.pathname):(We=new Set([R.pathname]),O.set(x.location.pathname,We)),Ce={currentLocation:x.location,nextLocation:R}}$e(at({},P,{actionData:pe,loaderData:ae,historyAction:_,location:R,initialized:!0,navigation:lf,revalidation:"idle",restoreScrollPosition:Jm(R,P.matches||x.matches),preventScrollReset:_t,blockers:Pe}),{viewTransitionOpts:Ce,flushSync:_e===!0}),_=lt.Pop,C=!1,T=!1,V=!1,D=!1,B=[],M=[]}async function Ne(R,P){if(typeof R=="number"){e.history.go(R);return}let j=Hh(x.location,x.matches,l,u.v7_prependBasename,R,P==null?void 0:P.fromRouteId,P==null?void 0:P.relative),{path:q,submission:ie,error:_e}=Pg(u.v7_normalizeFormMethod,!1,j,P),me=x.location,pe=Ga(x.location,q,P&&P.state);pe=at({},pe,e.history.encodeLocation(pe));let ae=P&&P.replace!=null?P.replace:void 0,Pe=lt.Push;ae===!0?Pe=lt.Replace:ae===!1||ie!=null&&Mn(ie.formMethod)&&ie.formAction===x.location.pathname+x.location.search&&(Pe=lt.Replace);let _t=P&&"preventScrollReset"in P?P.preventScrollReset===!0:void 0,Ce=(P&&P.unstable_flushSync)===!0,We=Gm({currentLocation:me,nextLocation:pe,historyAction:Pe});if(We){Lo(We,{state:"blocked",location:pe,proceed(){Lo(We,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),Ne(R,P)},reset(){let et=new Map(x.blockers);et.set(We,ia),$e({blockers:et})}});return}return await Xe(Pe,pe,{submission:ie,pendingError:_e,preventScrollReset:_t,replace:P&&P.replace,enableViewTransition:P&&P.unstable_viewTransition,flushSync:Ce})}function Oe(){if(Z(),$e({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){Xe(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}Xe(_||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation})}}async function Xe(R,P,j){E&&E.abort(),E=null,_=R,V=(j&&j.startUninterruptedRevalidation)===!0,AS(x.location,x.matches),C=(j&&j.preventScrollReset)===!0,T=(j&&j.enableViewTransition)===!0;let q=a||s,ie=j&&j.overrideNavigation,_e=Zi(q,P,l),me=(j&&j.flushSync)===!0;if(!_e){let et=xn(404,{pathname:P.pathname}),{matches:It,route:Zn}=jg(q);Ed(),Re(P,{matches:It,loaderData:{},errors:{[Zn.id]:et}},{flushSync:me});return}if(x.initialized&&!D&&l$(x.location,P)&&!(j&&j.submission&&Mn(j.submission.formMethod))){Re(P,{matches:_e},{flushSync:me});return}E=new AbortController;let pe=aa(e.history,P,E.signal,j&&j.submission),ae,Pe;if(j&&j.pendingError)Pe={[Pa(_e).route.id]:j.pendingError};else if(j&&j.submission&&Mn(j.submission.formMethod)){let et=await Tt(pe,P,j.submission,_e,{replace:j.replace,flushSync:me});if(et.shortCircuited)return;ae=et.pendingActionData,Pe=et.pendingActionError,ie=uf(P,j.submission),me=!1,pe=new Request(pe.url,{signal:pe.signal})}let{shortCircuited:_t,loaderData:Ce,errors:We}=await hn(pe,P,_e,ie,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,me,ae,Pe);_t||(E=null,Re(P,at({matches:_e},ae?{actionData:ae}:{},{loaderData:Ce,errors:We})))}async function Tt(R,P,j,q,ie){ie===void 0&&(ie={}),Z();let _e=f$(P,j);$e({navigation:_e},{flushSync:ie.flushSync===!0});let me,pe=Kh(q,P);if(!pe.route.action&&!pe.route.lazy)me={type:ut.error,error:xn(405,{method:R.method,pathname:P.pathname,routeId:pe.route.id})};else if(me=await sa("action",R,pe,q,i,o,l),R.signal.aborted)return{shortCircuited:!0};if(ns(me)){let ae;return ie&&ie.replace!=null?ae=ie.replace:ae=me.location===x.location.pathname+x.location.search,await A(x,me,{submission:j,replace:ae}),{shortCircuited:!0}}if(Na(me)){let ae=Pa(q,pe.route.id);return(ie&&ie.replace)!==!0&&(_=lt.Push),{pendingActionData:{},pendingActionError:{[ae.route.id]:me.error}}}if(Ko(me))throw xn(400,{type:"defer-action"});return{pendingActionData:{[pe.route.id]:me.data}}}async function hn(R,P,j,q,ie,_e,me,pe,ae,Pe){let _t=q||uf(P,ie),Ce=ie||_e||Ug(_t),We=a||s,[et,It]=Ng(e.history,x,j,Ce,P,D,B,M,re,K,We,l,ae,Pe);if(Ed(Be=>!(j&&j.some(pn=>pn.route.id===Be))||et&&et.some(pn=>pn.route.id===Be)),oe=++H,et.length===0&&It.length===0){let Be=Ei();return Re(P,at({matches:j,loaderData:{},errors:Pe||null},ae?{actionData:ae}:{},Be?{fetchers:new Map(x.fetchers)}:{}),{flushSync:pe}),{shortCircuited:!0}}if(!V){It.forEach(pn=>{let dt=x.fetchers.get(pn.key),Fo=la(void 0,dt?dt.data:void 0);x.fetchers.set(pn.key,Fo)});let Be=ae||x.actionData;$e(at({navigation:_t},Be?Object.keys(Be).length===0?{actionData:null}:{actionData:Be}:{},It.length>0?{fetchers:new Map(x.fetchers)}:{}),{flushSync:pe})}It.forEach(Be=>{F.has(Be.key)&&Hn(Be.key),Be.controller&&F.set(Be.key,Be.controller)});let Zn=()=>It.forEach(Be=>Hn(Be.key));E&&E.signal.addEventListener("abort",Zn);let{results:Qs,loaderResults:Cd,fetcherResults:Ci}=await ee(x.matches,j,et,It,R);if(R.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",Zn),It.forEach(Be=>F.delete(Be.key));let Rn=Lg(Qs);if(Rn){if(Rn.idx>=et.length){let Be=It[Rn.idx-et.length].key;K.add(Be)}return await A(x,Rn.result,{replace:me}),{shortCircuited:!0}}let{loaderData:Wl,errors:kd}=Mg(x,j,et,Cd,Pe,It,Ci,Ue);Ue.forEach((Be,pn)=>{Be.subscribe(dt=>{(dt||Be.done)&&Ue.delete(pn)})});let Td=Ei(),$d=Ul(oe),ki=Td||$d||It.length>0;return at({loaderData:Wl,errors:kd},ki?{fetchers:new Map(x.fetchers)}:{})}function dr(R,P,j,q){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");F.has(R)&&Hn(R);let ie=(q&&q.unstable_flushSync)===!0,_e=a||s,me=Hh(x.location,x.matches,l,u.v7_prependBasename,j,P,q==null?void 0:q.relative),pe=Zi(_e,me,l);if(!pe){se(R,P,xn(404,{pathname:me}),{flushSync:ie});return}let{path:ae,submission:Pe,error:_t}=Pg(u.v7_normalizeFormMethod,!0,me,q);if(_t){se(R,P,_t,{flushSync:ie});return}let Ce=Kh(pe,ae);if(C=(q&&q.preventScrollReset)===!0,Pe&&Mn(Pe.formMethod)){$(R,P,ae,Ce,pe,ie,Pe);return}re.set(R,{routeId:P,path:ae}),N(R,P,ae,Ce,pe,ie,Pe)}async function $(R,P,j,q,ie,_e,me){if(Z(),re.delete(R),!q.route.action&&!q.route.lazy){let dt=xn(405,{method:me.formMethod,pathname:j,routeId:P});se(R,P,dt,{flushSync:_e});return}let pe=x.fetchers.get(R);U(R,h$(me,pe),{flushSync:_e});let ae=new AbortController,Pe=aa(e.history,j,ae.signal,me);F.set(R,ae);let _t=H,Ce=await sa("action",Pe,q,ie,i,o,l);if(Pe.signal.aborted){F.get(R)===ae&&F.delete(R);return}if(ve.has(R)){U(R,Zr(void 0));return}if(ns(Ce))if(F.delete(R),oe>_t){U(R,Zr(void 0));return}else return K.add(R),U(R,la(me)),A(x,Ce,{fetcherSubmission:me});if(Na(Ce)){se(R,P,Ce.error);return}if(Ko(Ce))throw xn(400,{type:"defer-action"});let We=x.navigation.location||x.location,et=aa(e.history,We,ae.signal),It=a||s,Zn=x.navigation.state!=="idle"?Zi(It,x.navigation.location,l):x.matches;Se(Zn,"Didn't find any matches after fetcher action");let Qs=++H;L.set(R,Qs);let Cd=la(me,Ce.data);x.fetchers.set(R,Cd);let[Ci,Rn]=Ng(e.history,x,Zn,me,We,D,B,M,re,K,It,l,{[q.route.id]:Ce.data},void 0);Rn.filter(dt=>dt.key!==R).forEach(dt=>{let Fo=dt.key,ev=x.fetchers.get(Fo),MS=la(void 0,ev?ev.data:void 0);x.fetchers.set(Fo,MS),F.has(Fo)&&Hn(Fo),dt.controller&&F.set(Fo,dt.controller)}),$e({fetchers:new Map(x.fetchers)});let Wl=()=>Rn.forEach(dt=>Hn(dt.key));ae.signal.addEventListener("abort",Wl);let{results:kd,loaderResults:Td,fetcherResults:$d}=await ee(x.matches,Zn,Ci,Rn,et);if(ae.signal.aborted)return;ae.signal.removeEventListener("abort",Wl),L.delete(R),F.delete(R),Rn.forEach(dt=>F.delete(dt.key));let ki=Lg(kd);if(ki){if(ki.idx>=Ci.length){let dt=Rn[ki.idx-Ci.length].key;K.add(dt)}return A(x,ki.result)}let{loaderData:Be,errors:pn}=Mg(x,x.matches,Ci,Td,void 0,Rn,$d,Ue);if(x.fetchers.has(R)){let dt=Zr(Ce.data);x.fetchers.set(R,dt)}Ul(Qs),x.navigation.state==="loading"&&Qs>oe?(Se(_,"Expected pending action"),E&&E.abort(),Re(x.navigation.location,{matches:Zn,loaderData:Be,errors:pn,fetchers:new Map(x.fetchers)})):($e({errors:pn,loaderData:Ig(x.loaderData,Be,Zn,pn),fetchers:new Map(x.fetchers)}),D=!1)}async function N(R,P,j,q,ie,_e,me){let pe=x.fetchers.get(R);U(R,la(me,pe?pe.data:void 0),{flushSync:_e});let ae=new AbortController,Pe=aa(e.history,j,ae.signal);F.set(R,ae);let _t=H,Ce=await sa("loader",Pe,q,ie,i,o,l);if(Ko(Ce)&&(Ce=await eb(Ce,Pe.signal,!0)||Ce),F.get(R)===ae&&F.delete(R),!Pe.signal.aborted){if(ve.has(R)){U(R,Zr(void 0));return}if(ns(Ce))if(oe>_t){U(R,Zr(void 0));return}else{K.add(R),await A(x,Ce);return}if(Na(Ce)){se(R,P,Ce.error);return}Se(!Ko(Ce),"Unhandled fetcher deferred data"),U(R,Zr(Ce.data))}}async function A(R,P,j){let{submission:q,fetcherSubmission:ie,replace:_e}=j===void 0?{}:j;P.revalidate&&(D=!0);let me=Ga(R.location,P.location,{_isRedirect:!0});if(Se(me,"Expected a location on the redirect navigation"),n){let We=!1;if(P.reloadDocument)We=!0;else if(qx.test(P.location)){const et=e.history.createURL(P.location);We=et.origin!==t.location.origin||Co(et.pathname,l)==null}if(We){_e?t.location.replace(P.location):t.location.assign(P.location);return}}E=null;let pe=_e===!0?lt.Replace:lt.Push,{formMethod:ae,formAction:Pe,formEncType:_t}=R.navigation;!q&&!ie&&ae&&Pe&&_t&&(q=Ug(R.navigation));let Ce=q||ie;if(e$.has(P.status)&&Ce&&Mn(Ce.formMethod))await Xe(pe,me,{submission:at({},Ce,{formAction:P.location}),preventScrollReset:C});else{let We=uf(me,q);await Xe(pe,me,{overrideNavigation:We,fetcherSubmission:ie,preventScrollReset:C})}}async function ee(R,P,j,q,ie){let _e=await Promise.all([...j.map(ae=>sa("loader",ie,ae,P,i,o,l)),...q.map(ae=>ae.matches&&ae.match&&ae.controller?sa("loader",aa(e.history,ae.path,ae.controller.signal),ae.match,ae.matches,i,o,l):{type:ut.error,error:xn(404,{pathname:ae.path})})]),me=_e.slice(0,j.length),pe=_e.slice(j.length);return await Promise.all([Fg(R,j,me,me.map(()=>ie.signal),!1,x.loaderData),Fg(R,q.map(ae=>ae.match),pe,q.map(ae=>ae.controller?ae.controller.signal:null),!0)]),{results:_e,loaderResults:me,fetcherResults:pe}}function Z(){D=!0,B.push(...Ed()),re.forEach((R,P)=>{F.has(P)&&(M.push(P),Hn(P))})}function U(R,P,j){j===void 0&&(j={}),x.fetchers.set(R,P),$e({fetchers:new Map(x.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function se(R,P,j,q){q===void 0&&(q={});let ie=Pa(x.matches,P);Ve(R),$e({errors:{[ie.route.id]:j},fetchers:new Map(x.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Ke(R){return u.v7_fetcherPersist&&(he.set(R,(he.get(R)||0)+1),ve.has(R)&&ve.delete(R)),x.fetchers.get(R)||t$}function Ve(R){let P=x.fetchers.get(R);F.has(R)&&!(P&&P.state==="loading"&&L.has(R))&&Hn(R),re.delete(R),L.delete(R),K.delete(R),ve.delete(R),x.fetchers.delete(R)}function Fr(R){if(u.v7_fetcherPersist){let P=(he.get(R)||0)-1;P<=0?(he.delete(R),ve.add(R)):he.set(R,P)}else Ve(R);$e({fetchers:new Map(x.fetchers)})}function Hn(R){let P=F.get(R);Se(P,"Expected fetch controller: "+R),P.abort(),F.delete(R)}function _i(R){for(let P of R){let j=Ke(P),q=Zr(j.data);x.fetchers.set(P,q)}}function Ei(){let R=[],P=!1;for(let j of K){let q=x.fetchers.get(j);Se(q,"Expected fetcher: "+j),q.state==="loading"&&(K.delete(j),R.push(j),P=!0)}return _i(R),P}function Ul(R){let P=[];for(let[j,q]of L)if(q0}function zl(R,P){let j=x.blockers.get(R)||ia;return Ie.get(R)!==P&&Ie.set(R,P),j}function Vl(R){x.blockers.delete(R),Ie.delete(R)}function Lo(R,P){let j=x.blockers.get(R)||ia;Se(j.state==="unblocked"&&P.state==="blocked"||j.state==="blocked"&&P.state==="blocked"||j.state==="blocked"&&P.state==="proceeding"||j.state==="blocked"&&P.state==="unblocked"||j.state==="proceeding"&&P.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+P.state);let q=new Map(x.blockers);q.set(R,P),$e({blockers:q})}function Gm(R){let{currentLocation:P,nextLocation:j,historyAction:q}=R;if(Ie.size===0)return;Ie.size>1&&fi(!1,"A router only supports one blocker at a time");let ie=Array.from(Ie.entries()),[_e,me]=ie[ie.length-1],pe=x.blockers.get(_e);if(!(pe&&pe.state==="proceeding")&&me({currentLocation:P,nextLocation:j,historyAction:q}))return _e}function Ed(R){let P=[];return Ue.forEach((j,q)=>{(!R||R(q))&&(j.cancel(),P.push(q),Ue.delete(q))}),P}function OS(R,P,j){if(p=R,v=P,y=j||null,!g&&x.navigation===lf){g=!0;let q=Jm(x.location,x.matches);q!=null&&$e({restoreScrollPosition:q})}return()=>{p=null,v=null,y=null}}function Xm(R,P){return y&&y(R,P.map(q=>NT(q,x.loaderData)))||R.key}function AS(R,P){if(p&&v){let j=Xm(R,P);p[j]=v()}}function Jm(R,P){if(p){let j=Xm(R,P),q=p[j];if(typeof q=="number")return q}return null}function DS(R){i={},a=Wh(R,o,void 0,i)}return w={get basename(){return l},get state(){return x},get routes(){return s},get window(){return t},initialize:ze,subscribe:Me,enableScrollRestoration:OS,navigate:Ne,fetch:dr,revalidate:Oe,createHref:R=>e.history.createHref(R),encodeLocation:R=>e.history.encodeLocation(R),getFetcher:Ke,deleteFetcher:Fr,dispose:ue,getBlocker:zl,deleteBlocker:Vl,_internalFetchControllers:F,_internalActiveDeferreds:Ue,_internalSetRoutes:DS},w}function o$(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Hh(e,t,n,r,o,i,s){let a,l;if(i){a=[];for(let d of t)if(a.push(d),d.route.id===i){l=d;break}}else a=t,l=t[t.length-1];let u=mm(o||".",id(a).map(d=>d.pathnameBase),Co(e.pathname,n)||e.pathname,s==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&l&&l.route.index&&!gm(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Er([n,u.pathname])),hi(u)}function Pg(e,t,n,r){if(!r||!o$(r))return{path:n};if(r.formMethod&&!d$(r.formMethod))return{path:n,error:xn(405,{method:r.formMethod})};let o=()=>({path:n,error:xn(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),a=Jx(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Mn(s))return o();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((y,v)=>{let[g,b]=v;return""+y+g+"="+b+` -`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!Mn(s))return o();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return o()}}}Se(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=Zh(r.formData),u=r.formData;else if(r.body instanceof FormData)l=Zh(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Dg(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Dg(l)}catch{return o()}let d={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Mn(d.formMethod))return{path:n,submission:d};let f=jr(n);return t&&f.search&&gm(f.search)&&l.append("index",""),f.search="?"+l,{path:hi(f),submission:d}}function i$(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Ng(e,t,n,r,o,i,s,a,l,u,d,f,p,y){let v=y?Object.values(y)[0]:p?Object.values(p)[0]:void 0,g=e.createURL(t.location),b=e.createURL(o),m=y?Object.keys(y)[0]:void 0,w=i$(n,m).filter((_,C)=>{if(_.route.lazy)return!0;if(_.route.loader==null)return!1;if(s$(t.loaderData,t.matches[C],_)||s.some(O=>O===_.route.id))return!0;let E=t.matches[C],T=_;return Og(_,at({currentUrl:g,currentParams:E.params,nextUrl:b,nextParams:T.params},r,{actionResult:v,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||Xx(E,T)}))}),x=[];return l.forEach((_,C)=>{if(!n.some(V=>V.route.id===_.routeId))return;let E=Zi(d,_.path,f);if(!E){x.push({key:C,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let T=t.fetchers.get(C),O=Kh(E,_.path),I=!1;u.has(C)?I=!1:a.includes(C)?I=!0:T&&T.state!=="idle"&&T.data===void 0?I=i:I=Og(O,at({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:v,defaultShouldRevalidate:i})),I&&x.push({key:C,routeId:_.routeId,path:_.path,matches:E,match:O,controller:new AbortController})}),[w,x]}function s$(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function Xx(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Og(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Ag(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Se(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";fi(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!RT.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,at({},t(o),{lazy:void 0}))}async function sa(e,t,n,r,o,i,s,a){a===void 0&&(a={});let l,u,d,f=v=>{let g,b=new Promise((m,h)=>g=h);return d=()=>g(),t.signal.addEventListener("abort",d),Promise.race([v({request:t,params:n.params,context:a.requestContext}),b])};try{let v=n.route[e];if(n.route.lazy)if(v){let g,b=await Promise.all([f(v).catch(m=>{g=m}),Ag(n.route,i,o)]);if(g)throw g;u=b[0]}else if(await Ag(n.route,i,o),v=n.route[e],v)u=await f(v);else if(e==="action"){let g=new URL(t.url),b=g.pathname+g.search;throw xn(405,{method:t.method,pathname:b,routeId:n.route.id})}else return{type:ut.data,data:void 0};else if(v)u=await f(v);else{let g=new URL(t.url),b=g.pathname+g.search;throw xn(404,{pathname:b})}Se(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(v){l=ut.error,u=v}finally{d&&t.signal.removeEventListener("abort",d)}if(c$(u)){let v=u.status;if(JT.has(v)){let m=u.headers.get("Location");if(Se(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!qx.test(m))m=Hh(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,m);else if(!a.isStaticRequest){let h=new URL(t.url),w=m.startsWith("//")?new URL(h.protocol+m):new URL(m),x=Co(w.pathname,s)!=null;w.origin===h.origin&&x&&(m=w.pathname+w.search+w.hash)}if(a.isStaticRequest)throw u.headers.set("Location",m),u;return{type:ut.redirect,status:v,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:l===ut.error?ut.error:ut.data,response:u};let g,b=u.headers.get("Content-Type");return b&&/\bapplication\/json\b/.test(b)?g=await u.json():g=await u.text(),l===ut.error?{type:l,error:new vm(v,u.statusText,g),headers:u.headers}:{type:ut.data,data:g,statusCode:u.status,headers:u.headers}}if(l===ut.error)return{type:l,error:u};if(u$(u)){var p,y;return{type:ut.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((y=u.init)==null?void 0:y.headers)&&new Headers(u.init.headers)}}return{type:ut.data,data:u}}function aa(e,t,n,r){let o=e.createURL(Jx(t)).toString(),i={signal:n};if(r&&Mn(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=Zh(r.formData):i.body=r.formData}return new Request(o,i)}function Zh(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Dg(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function a$(e,t,n,r,o){let i={},s=null,a,l=!1,u={};return n.forEach((d,f)=>{let p=t[f].route.id;if(Se(!ns(d),"Cannot handle redirect results in processLoaderData"),Na(d)){let y=Pa(e,p),v=d.error;r&&(v=Object.values(r)[0],r=void 0),s=s||{},s[y.route.id]==null&&(s[y.route.id]=v),i[p]=void 0,l||(l=!0,a=Qx(d.error)?d.error.status:500),d.headers&&(u[p]=d.headers)}else Ko(d)?(o.set(p,d.deferredData),i[p]=d.deferredData.data):i[p]=d.data,d.statusCode!=null&&d.statusCode!==200&&!l&&(a=d.statusCode),d.headers&&(u[p]=d.headers)}),r&&(s=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}function Mg(e,t,n,r,o,i,s,a){let{loaderData:l,errors:u}=a$(t,n,r,o,a);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function jg(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xn(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,s="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(s="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(s="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",a='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new vm(e||500,s,new Error(a),!0)}function Lg(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ns(n))return{result:n,idx:t}}}function Jx(e){let t=typeof e=="string"?jr(e):e;return hi(at({},t,{hash:""}))}function l$(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ko(e){return e.type===ut.deferred}function Na(e){return e.type===ut.error}function ns(e){return(e&&e.type)===ut.redirect}function u$(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function c$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function d$(e){return XT.has(e.toLowerCase())}function Mn(e){return qT.has(e.toLowerCase())}async function Fg(e,t,n,r,o,i){for(let s=0;sf.route.id===l.route.id),d=u!=null&&!Xx(u,l)&&(i&&i[l.route.id])!==void 0;if(Ko(a)&&(o||d)){let f=r[s];Se(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await eb(a,f,o).then(p=>{p&&(n[s]=p||n[s])})}}}async function eb(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:ut.data,data:e.deferredData.unwrappedData}}catch(o){return{type:ut.error,error:o}}return{type:ut.data,data:e.deferredData.data}}}function gm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Kh(e,t){let n=typeof t=="string"?jr(t).search:t.search;if(e[e.length-1].route.index&&gm(n||""))return e[e.length-1];let r=id(e);return r[r.length-1]}function Ug(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function uf(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function f$(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function la(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function h$(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Zr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function p$(e,t){try{let n=e.sessionStorage.getItem(Gx);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function m$(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(Gx,JSON.stringify(n))}catch(r){fi(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.19.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function hc(){return hc=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),s=c.useRef(!1);return nb(()=>{s.current=!0}),c.useCallback(function(l,u){if(u===void 0&&(u={}),!s.current)return;if(typeof l=="number"){n.go(l);return}let d=mm(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Er([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,i,o,e])}const w$=c.createContext(null);function x$(e){let t=c.useContext(Io).outlet;return t&&c.createElement(w$.Provider,{value:e},t)}function ad(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=c.useContext(Io),{pathname:o}=Dl(),i=JSON.stringify(id(r).map((s,a)=>a===r.length-1?s.pathname:s.pathnameBase));return c.useMemo(()=>mm(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function b$(e,t,n){Al()||Se(!1);let{navigator:r}=c.useContext(bi),{matches:o}=c.useContext(Io),i=o[o.length-1],s=i?i.params:{};i&&i.pathname;let a=i?i.pathnameBase:"/";i&&i.route;let l=Dl(),u;if(t){var d;let g=typeof t=="string"?jr(t):t;a==="/"||(d=g.pathname)!=null&&d.startsWith(a)||Se(!1),u=g}else u=l;let f=u.pathname||"/",p=a==="/"?f:f.slice(a.length)||"/",y=Zi(e,{pathname:p}),v=k$(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:Er([a,r.encodeLocation?r.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?a:Er([a,r.encodeLocation?r.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n);return t&&v?c.createElement(sd.Provider,{value:{location:hc({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:lt.Pop}},v):v}function S$(){let e=P$(),t=Qx(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),n?c.createElement("pre",{style:o},n):null,i)}const _$=c.createElement(S$,null);class E$ extends c.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?c.createElement(Io.Provider,{value:this.props.routeContext},c.createElement(tb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function C$(e){let{routeContext:t,match:n,children:r}=e,o=c.useContext(Ol);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),c.createElement(Io.Provider,{value:t},r)}function k$(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let a=i.findIndex(l=>l.route.id&&(s==null?void 0:s[l.route.id]));a>=0||Se(!1),i=i.slice(0,Math.min(i.length,a+1))}return i.reduceRight((a,l,u)=>{let d=l.route.id?s==null?void 0:s[l.route.id]:null,f=null;n&&(f=l.route.errorElement||_$);let p=t.concat(i.slice(0,u+1)),y=()=>{let v;return d?v=f:l.route.Component?v=c.createElement(l.route.Component,null):l.route.element?v=l.route.element:v=a,c.createElement(C$,{match:l,routeContext:{outlet:a,matches:p,isDataRoute:n!=null},children:v})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?c.createElement(E$,{location:n.location,revalidation:n.revalidation,component:f,error:d,children:y(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):y()},null)}var rb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rb||{}),pc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(pc||{});function T$(e){let t=c.useContext(Ol);return t||Se(!1),t}function $$(e){let t=c.useContext(ym);return t||Se(!1),t}function R$(e){let t=c.useContext(Io);return t||Se(!1),t}function ob(e){let t=R$(),n=t.matches[t.matches.length-1];return n.route.id||Se(!1),n.route.id}function P$(){var e;let t=c.useContext(tb),n=$$(pc.UseRouteError),r=ob(pc.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function N$(){let{router:e}=T$(rb.UseNavigateStable),t=ob(pc.UseNavigateStable),n=c.useRef(!1);return nb(()=>{n.current=!0}),c.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,hc({fromRouteId:t},i)))},[e,t])}function ib(e){return x$(e.context)}function O$(e){let{basename:t="/",children:n=null,location:r,navigationType:o=lt.Pop,navigator:i,static:s=!1}=e;Al()&&Se(!1);let a=t.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:a,navigator:i,static:s}),[a,i,s]);typeof r=="string"&&(r=jr(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:y="default"}=r,v=c.useMemo(()=>{let g=Co(u,a);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:y},navigationType:o}},[a,u,d,f,p,y,o]);return v==null?null:c.createElement(bi.Provider,{value:l},c.createElement(sd.Provider,{children:n,value:v}))}new Promise(()=>{});function A$(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:c.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:c.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.19.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function D$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function M$(e,t){return e.button===0&&(!t||t==="_self")&&!D$(e)}const I$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],j$=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];function L$(e,t){return r$({basename:t==null?void 0:t.basename,future:Ns({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:kT({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||F$(),routes:e,mapRouteProperties:A$,window:t==null?void 0:t.window}).initialize()}function F$(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ns({},t,{errors:U$(t.errors)})),t}function U$(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new vm(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const ab=c.createContext({isTransitioning:!1}),z$=c.createContext(new Map),V$="startTransition",zg=Yy[V$],W$="flushSync",Vg=sC[W$];function B$(e){zg?zg(e):e()}function ua(e){Vg?Vg(e):e()}class H${constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Z$(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=c.useState(n.state),[s,a]=c.useState(),[l,u]=c.useState({isTransitioning:!1}),[d,f]=c.useState(),[p,y]=c.useState(),[v,g]=c.useState(),b=c.useRef(new Map),{v7_startTransition:m}=r||{},h=c.useCallback(E=>{m?B$(E):E()},[m]),w=c.useCallback((E,T)=>{let{deletedFetchers:O,unstable_flushSync:I,unstable_viewTransitionOpts:V}=T;O.forEach(B=>b.current.delete(B)),E.fetchers.forEach((B,M)=>{B.data!==void 0&&b.current.set(M,B.data)});let D=n.window==null||typeof n.window.document.startViewTransition!="function";if(!V||D){I?ua(()=>i(E)):h(()=>i(E));return}if(I){ua(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let B=n.window.document.startViewTransition(()=>{ua(()=>i(E))});B.finished.finally(()=>{ua(()=>{f(void 0),y(void 0),a(void 0),u({isTransitioning:!1})})}),ua(()=>y(B));return}p?(d&&d.resolve(),p.skipTransition(),g({state:E,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(a(E),u({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[n.window,p,d,b,h]);c.useLayoutEffect(()=>n.subscribe(w),[n,w]),c.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new H$)},[l]),c.useEffect(()=>{if(d&&s&&n.window){let E=s,T=d.promise,O=n.window.document.startViewTransition(async()=>{h(()=>i(E)),await T});O.finished.finally(()=>{f(void 0),y(void 0),a(void 0),u({isTransitioning:!1})}),y(O)}},[h,s,d,n.window]),c.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,p,o.location,s]),c.useEffect(()=>{!l.isTransitioning&&v&&(a(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),g(void 0))},[l.isTransitioning,v]);let x=c.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,T,O)=>n.navigate(E,{state:T,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(E,T,O)=>n.navigate(E,{replace:!0,state:T,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),_=n.basename||"/",C=c.useMemo(()=>({router:n,navigator:x,static:!1,basename:_}),[n,x,_]);return c.createElement(c.Fragment,null,c.createElement(Ol.Provider,{value:C},c.createElement(ym.Provider,{value:o},c.createElement(z$.Provider,{value:b.current},c.createElement(ab.Provider,{value:l},c.createElement(O$,{basename:_,location:o.location,navigationType:o.historyAction,navigator:x},o.initialized?c.createElement(K$,{routes:n.routes,state:o}):t))))),null)}function K$(e){let{routes:t,state:n}=e;return b$(t,void 0,n)}const Q$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Y$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lb=c.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,p=sb(t,I$),{basename:y}=c.useContext(bi),v,g=!1;if(typeof u=="string"&&Y$.test(u)&&(v=u,Q$))try{let w=new URL(window.location.href),x=u.startsWith("//")?new URL(w.protocol+u):new URL(u),_=Co(x.pathname,y);x.origin===w.origin&&_!=null?u=_+x.search+x.hash:g=!0}catch{}let b=v$(u,{relative:o}),m=G$(u,{replace:s,state:a,target:l,preventScrollReset:d,relative:o,unstable_viewTransition:f});function h(w){r&&r(w),w.defaultPrevented||m(w)}return c.createElement("a",Ns({},p,{href:v||b,onClick:g||i?r:h,ref:n,target:l}))}),Ki=c.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,unstable_viewTransition:u,children:d}=t,f=sb(t,j$),p=ad(l,{relative:f.relative}),y=Dl(),v=c.useContext(ym),{navigator:g}=c.useContext(bi),b=v!=null&&X$(p)&&u===!0,m=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,h=y.pathname,w=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;o||(h=h.toLowerCase(),w=w?w.toLowerCase():null,m=m.toLowerCase());const x=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=h===m||!s&&h.startsWith(m)&&h.charAt(x)==="/",C=w!=null&&(w===m||!s&&w.startsWith(m)&&w.charAt(m.length)==="/"),E={isActive:_,isPending:C,isTransitioning:b},T=_?r:void 0,O;typeof i=="function"?O=i(E):O=[i,_?"active":null,C?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let I=typeof a=="function"?a(E):a;return c.createElement(lb,Ns({},f,{"aria-current":T,className:O,ref:n,style:I,to:l,unstable_viewTransition:u}),typeof d=="function"?d(E):d)});var Qh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Qh||(Qh={}));var Wg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wg||(Wg={}));function q$(e){let t=c.useContext(Ol);return t||Se(!1),t}function G$(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,l=g$(),u=Dl(),d=ad(e,{relative:s});return c.useCallback(f=>{if(M$(f,n)){f.preventDefault();let p=r!==void 0?r:hi(u)===hi(d);l(e,{replace:p,state:o,preventScrollReset:i,relative:s,unstable_viewTransition:a})}},[u,l,d,r,o,n,e,i,s,a])}function X$(e,t){t===void 0&&(t={});let n=c.useContext(ab);n==null&&Se(!1);let{basename:r}=q$(Qh.useViewTransitionState),o=ad(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Co(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Co(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Bh(o.pathname,s)!=null||Bh(o.pathname,i)!=null}const Bg=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??typeof d!="object"?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},J$=e=>e?Bg(e):Bg;var ub={exports:{}},cb={},db={exports:{}},fb={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Os=c;function eR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tR=typeof Object.is=="function"?Object.is:eR,nR=Os.useState,rR=Os.useEffect,oR=Os.useLayoutEffect,iR=Os.useDebugValue;function sR(e,t){var n=t(),r=nR({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return oR(function(){o.value=n,o.getSnapshot=t,cf(o)&&i({inst:o})},[e,n,t]),rR(function(){return cf(o)&&i({inst:o}),e(function(){cf(o)&&i({inst:o})})},[e]),iR(n),n}function cf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tR(e,n)}catch{return!0}}function aR(e,t){return t()}var lR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aR:sR;fb.useSyncExternalStore=Os.useSyncExternalStore!==void 0?Os.useSyncExternalStore:lR;db.exports=fb;var uR=db.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ld=c,cR=uR;function dR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fR=typeof Object.is=="function"?Object.is:dR,hR=cR.useSyncExternalStore,pR=ld.useRef,mR=ld.useEffect,vR=ld.useMemo,gR=ld.useDebugValue;cb.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=pR(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=vR(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),o!==void 0&&s.hasValue){var v=s.value;if(o(v,y))return f=v}return f=y}if(v=f,fR(d,y))return v;var g=r(y);return o!==void 0&&o(v,g)?v:(d=y,f=g)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,o]);var a=hR(e,i[0],i[1]);return mR(function(){s.hasValue=!0,s.value=a},[a]),gR(a),a};ub.exports=cb;var yR=ub.exports;const wR=cp(yR),{useDebugValue:xR}=de,{useSyncExternalStoreWithSelector:bR}=wR;function SR(e,t=e.getState,n){const r=bR(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return xR(r),r}const Hg=e=>{const t=typeof e=="function"?J$(e):e,n=(r,o)=>SR(t,r,o);return Object.assign(n,t),n},ud=e=>e?Hg(e):Hg,_R=(e,t)=>(...n)=>Object.assign({},e,t(...n));function wm(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(i=n.getItem(o))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const Xa=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Xa(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Xa(r)(n)}}}},ER=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:b=>b,version:0,merge:(b,m)=>({...m,...b}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...b)},r,o);const d=Xa(i.serialize),f=()=>{const b=i.partialize({...r()});let m;const h=d({state:b,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{m=w});if(m)throw m;return h},p=o.setState;o.setState=(b,m)=>{p(b,m),f()};const y=e((...b)=>{n(...b),f()},r,o);let v;const g=()=>{var b;if(!u)return;s=!1,a.forEach(h=>h(r()));const m=((b=i.onRehydrateStorage)==null?void 0:b.call(i,r()))||void 0;return Xa(u.getItem.bind(u))(i.name).then(h=>{if(h)return i.deserialize(h)}).then(h=>{if(h)if(typeof h.version=="number"&&h.version!==i.version){if(i.migrate)return i.migrate(h.state,h.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return h.state}).then(h=>{var w;return v=i.merge(h,(w=r())!=null?w:y),n(v,!0),f()}).then(()=>{m==null||m(v,void 0),s=!0,l.forEach(h=>h(v))}).catch(h=>{m==null||m(void 0,h)})};return o.persist={setOptions:b=>{i={...i,...b},b.getStorage&&(u=b.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(l.add(b),()=>{l.delete(b)})},g(),v||y},CR=(e,t)=>(n,r,o)=>{let i={storage:wm(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...t},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...g)},r,o);const d=()=>{const g=i.partialize({...r()});return u.setItem(i.name,{state:g,version:i.version})},f=o.setState;o.setState=(g,b)=>{f(g,b),d()};const p=e((...g)=>{n(...g),d()},r,o);let y;const v=()=>{var g,b;if(!u)return;s=!1,a.forEach(h=>{var w;return h((w=r())!=null?w:p)});const m=((b=i.onRehydrateStorage)==null?void 0:b.call(i,(g=r())!=null?g:p))||void 0;return Xa(u.getItem.bind(u))(i.name).then(h=>{if(h)if(typeof h.version=="number"&&h.version!==i.version){if(i.migrate)return i.migrate(h.state,h.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return h.state}).then(h=>{var w;return y=i.merge(h,(w=r())!=null?w:p),n(y,!0),d()}).then(()=>{m==null||m(y,void 0),y=r(),s=!0,l.forEach(h=>h(y))}).catch(h=>{m==null||m(void 0,h)})};return o.persist={setOptions:g=>{i={...i,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},i.skipHydration||v(),y||p},kR=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?ER(e,t):CR(e,t),xm=kR,bm=ud(xm((e,t)=>({currentAgent:null,lastAgentInitMessage:null,actions:{setAgent:n=>e({currentAgent:n}),setLastAgentInitMessage:n=>e(r=>({...r,lastAgentInitMessage:n})),removeAgent:()=>e(n=>({...n,currentAgent:null}))}}),{name:"agent-storage",partialize:({actions:e,...t})=>t})),Ml=()=>bm(e=>e.currentAgent),TR=()=>bm(e=>e.lastAgentInitMessage),cd=()=>bm(e=>e.actions);function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function ko(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Mt(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function ur(e){Mt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||mc(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function $R(e,t){Mt(2,arguments);var n=ur(e).getTime(),r=ko(t);return new Date(n+r)}var RR={};function dd(){return RR}function PR(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var hb=6e4,pb=36e5;function NR(e){return Mt(1,arguments),e instanceof Date||mc(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function OR(e){if(Mt(1,arguments),!NR(e)&&typeof e!="number")return!1;var t=ur(e);return!isNaN(Number(t))}function AR(e,t){Mt(2,arguments);var n=ko(t);return $R(e,-n)}var DR=864e5;function MR(e){Mt(1,arguments);var t=ur(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/DR)+1}function vc(e){Mt(1,arguments);var t=1,n=ur(e),r=n.getUTCDay(),o=(r=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function IR(e){Mt(1,arguments);var t=mb(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=vc(n);return r}var jR=6048e5;function LR(e){Mt(1,arguments);var t=ur(e),n=vc(t).getTime()-IR(t).getTime();return Math.round(n/jR)+1}function gc(e,t){var n,r,o,i,s,a,l,u;Mt(1,arguments);var d=dd(),f=ko((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ur(e),y=p.getUTCDay(),v=(y=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(f+1,0,y),v.setUTCHours(0,0,0,0);var g=gc(v,t),b=new Date(0);b.setUTCFullYear(f,0,y),b.setUTCHours(0,0,0,0);var m=gc(b,t);return d.getTime()>=g.getTime()?f+1:d.getTime()>=m.getTime()?f:f-1}function FR(e,t){var n,r,o,i,s,a,l,u;Mt(1,arguments);var d=dd(),f=ko((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),p=vb(e,t),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var v=gc(y,t);return v}var UR=6048e5;function zR(e,t){Mt(1,arguments);var n=ur(e),r=gc(n,t).getTime()-FR(n,t).getTime();return Math.round(r/UR)+1}function Le(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return Le(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Le(r+1,2)},d:function(t,n){return Le(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Le(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Le(t.getUTCHours(),n.length)},m:function(t,n){return Le(t.getUTCMinutes(),n.length)},s:function(t,n){return Le(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return Le(i,n.length)}};const Wr=VR;var $i={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},WR={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Wr.y(t,n)},Y:function(t,n,r,o){var i=vb(t,o),s=i>0?i:1-i;if(n==="YY"){var a=s%100;return Le(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):Le(s,n.length)},R:function(t,n){var r=mb(t);return Le(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Le(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Le(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Le(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return Wr.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return Le(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=zR(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Le(i,n.length)},I:function(t,n,r){var o=LR(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):Le(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Wr.d(t,n)},D:function(t,n,r){var o=MR(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):Le(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Le(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Le(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return Le(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=$i.noon:o===0?i=$i.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=$i.evening:o>=12?i=$i.afternoon:o>=4?i=$i.morning:i=$i.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Wr.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Wr.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Wr.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Wr.s(t,n)},S:function(t,n){return Wr.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return Kg(s);case"XXXX":case"XX":return Vo(s);case"XXXXX":case"XXX":default:return Vo(s,":")}},x:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"x":return Kg(s);case"xxxx":case"xx":return Vo(s);case"xxxxx":case"xxx":default:return Vo(s,":")}},O:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Zg(s,":");case"OOOO":default:return"GMT"+Vo(s,":")}},z:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Zg(s,":");case"zzzz":default:return"GMT"+Vo(s,":")}},t:function(t,n,r,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return Le(s,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,s=i.getTime();return Le(s,n.length)}};function Zg(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=t||"";return n+String(o)+s+Le(i,2)}function Kg(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Le(Math.abs(e)/60,2)}return Vo(e,t)}function Vo(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=Le(Math.floor(o/60),2),s=Le(o%60,2);return r+i+n+s}const BR=WR;var Qg=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},gb=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},HR=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return Qg(t,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Qg(o,n)).replace("{{time}}",gb(i,n))},ZR={p:gb,P:HR};const KR=ZR;var QR=["D","DD"],YR=["YY","YYYY"];function qR(e){return QR.indexOf(e)!==-1}function GR(e){return YR.indexOf(e)!==-1}function Yg(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var XR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},JR=function(t,n,r){var o,i=XR[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const eP=JR;function df(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var tP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oP={date:df({formats:tP,defaultWidth:"full"}),time:df({formats:nP,defaultWidth:"full"}),dateTime:df({formats:rP,defaultWidth:"full"})};const iP=oP;var sP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},aP=function(t,n,r,o){return sP[t]};const lP=aP;function ca(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[l]||e.values[a]}var u=e.argumentCallback?e.argumentCallback(t):t;return o[u]}}var uP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mP=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},vP={ordinalNumber:mP,era:ca({values:uP,defaultWidth:"wide"}),quarter:ca({values:cP,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ca({values:dP,defaultWidth:"wide"}),day:ca({values:fP,defaultWidth:"wide"}),dayPeriod:ca({values:hP,defaultWidth:"wide",formattingValues:pP,defaultFormattingWidth:"wide"})};const gP=vP;function da(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?wP(a,function(f){return f.test(s)}):yP(a,function(f){return f.test(s)}),u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;var d=t.slice(s.length);return{value:u,rest:d}}}function yP(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function wP(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var a=t.slice(o.length);return{value:s,rest:a}}}var bP=/^(\d+)(th|st|nd|rd)?/i,SP=/\d+/i,_P={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},EP={any:[/^b/i,/^(a|c)/i]},CP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},kP={any:[/1/i,/2/i,/3/i,/4/i]},TP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},$P={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},PP={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},NP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},OP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},AP={ordinalNumber:xP({matchPattern:bP,parsePattern:SP,valueCallback:function(t){return parseInt(t,10)}}),era:da({matchPatterns:_P,defaultMatchWidth:"wide",parsePatterns:EP,defaultParseWidth:"any"}),quarter:da({matchPatterns:CP,defaultMatchWidth:"wide",parsePatterns:kP,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:da({matchPatterns:TP,defaultMatchWidth:"wide",parsePatterns:$P,defaultParseWidth:"any"}),day:da({matchPatterns:RP,defaultMatchWidth:"wide",parsePatterns:PP,defaultParseWidth:"any"}),dayPeriod:da({matchPatterns:NP,defaultMatchWidth:"any",parsePatterns:OP,defaultParseWidth:"any"})};const DP=AP;var MP={code:"en-US",formatDistance:eP,formatLong:iP,formatRelative:lP,localize:gP,match:DP,options:{weekStartsOn:0,firstWeekContainsDate:1}};const IP=MP;var jP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,LP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FP=/^'([^]*?)'?$/,UP=/''/g,zP=/[a-zA-Z]/;function VP(e,t,n){var r,o,i,s,a,l,u,d,f,p,y,v,g,b,m,h,w,x;Mt(2,arguments);var _=String(t),C=dd(),E=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:C.locale)!==null&&r!==void 0?r:IP,T=ko((i=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(u=n.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:C.firstWeekContainsDate)!==null&&s!==void 0?s:(f=C.locale)===null||f===void 0||(p=f.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=ko((y=(v=(g=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(m=n.locale)===null||m===void 0||(h=m.options)===null||h===void 0?void 0:h.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&v!==void 0?v:(w=C.locale)===null||w===void 0||(x=w.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&y!==void 0?y:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var I=ur(e);if(!OR(I))throw new RangeError("Invalid time value");var V=PR(I),D=AR(I,V),B={firstWeekContainsDate:T,weekStartsOn:O,locale:E,_originalDate:I},M=_.match(LP).map(function(F){var H=F[0];if(H==="p"||H==="P"){var oe=KR[H];return oe(F,E.formatLong)}return F}).join("").match(jP).map(function(F){if(F==="''")return"'";var H=F[0];if(H==="'")return WP(F);var oe=BR[H];if(oe)return!(n!=null&&n.useAdditionalWeekYearTokens)&&GR(F)&&Yg(F,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&qR(F)&&Yg(F,t,String(e)),oe(D,F,E.localize,B);if(H.match(zP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return F}).join("");return M}function WP(e){var t=e.match(FP);return t?t[1].replace(UP,"'"):e}function BP(e,t){var n;Mt(1,arguments);var r=ko((n=t==null?void 0:t.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=QP(e),i;if(o.date){var s=YP(o.date,r);i=qP(s.restDateString,s.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var a=i.getTime(),l=0,u;if(o.time&&(l=GP(o.time),isNaN(l)))return new Date(NaN);if(o.timezone){if(u=XP(o.timezone),isNaN(u))return new Date(NaN)}else{var d=new Date(a+l),f=new Date(0);return f.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),f.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),f}return new Date(a+l+u)}var du={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},HP=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ZP=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,KP=/^([+-])(\d{2})(?::?(\d{2}))?$/;function QP(e){var t={},n=e.split(du.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],du.timeZoneDelimiter.test(t.date)&&(t.date=e.split(du.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var o=du.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function YP(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function qP(e,t){if(t===null)return new Date(NaN);var n=e.match(HP);if(!n)return new Date(NaN);var r=!!n[4],o=fa(n[1]),i=fa(n[2])-1,s=fa(n[3]),a=fa(n[4]),l=fa(n[5])-1;if(r)return rN(t,a,l)?JP(t,a,l):new Date(NaN);var u=new Date(0);return!tN(t,i,s)||!nN(t,o)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(o,s)),u)}function fa(e){return e?parseInt(e):1}function GP(e){var t=e.match(ZP);if(!t)return NaN;var n=ff(t[1]),r=ff(t[2]),o=ff(t[3]);return oN(n,r,o)?n*pb+r*hb+o*1e3:NaN}function ff(e){return e&&parseFloat(e.replace(",","."))||0}function XP(e){if(e==="Z")return 0;var t=e.match(KP);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return iN(r,o)?n*(r*pb+o*hb):NaN}function JP(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var eN=[31,null,31,30,31,30,31,31,30,31,30,31];function yb(e){return e%400===0||e%4===0&&e%100!==0}function tN(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(eN[t]||(yb(e)?29:28))}function nN(e,t){return t>=1&&t<=(yb(e)?366:365)}function rN(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function oN(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function iN(e,t){return t>=0&&t<=59}const sN=(e,t)=>e==="date"?BP(t):t,wb=ud(xm((e,t)=>({history:{},actions:{addMessage:(n,r)=>e(o=>({...o,history:{...o.history,[n]:[...o.history[n]??[],r]}}))}}),{name:"message-history-storage",storage:wm(()=>localStorage,{reviver:sN}),partialize:({actions:e,...t})=>t})),aN=e=>wb(t=>t.history[e]??[]),xb=()=>wb(e=>e.actions);async function lN(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function uN(e){let t,n,r,o=!1;return function(s){t===void 0?(t=s,n=0,r=-1):t=dN(t,s);const a=t.length;let l=0;for(;n0){const l=o.decode(s.subarray(0,a)),u=a+(s[a+1]===32?2:1),d=o.decode(s.subarray(u));switch(l){case"data":r.data=r.data?r.data+` -`+d:d;break;case"event":r.event=d;break;case"id":e(r.id=d);break;case"retry":const f=parseInt(d,10);isNaN(f)||t(r.retry=f);break}}}}function dN(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function qg(){return{data:"",event:"",id:"",retry:void 0}}var fN=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const y=Object.assign({},r);y.accept||(y.accept=Yh);let v;function g(){v.abort(),document.hidden||_()}l||document.addEventListener("visibilitychange",g);let b=hN,m=0;function h(){document.removeEventListener("visibilitychange",g),window.clearTimeout(m),v.abort()}n==null||n.addEventListener("abort",()=>{h(),f()});const w=u??window.fetch,x=o??mN;async function _(){var C;v=new AbortController;try{const E=await w(e,Object.assign(Object.assign({},d),{headers:y,signal:v.signal}));await x(E),await lN(E.body,uN(cN(T=>{T?y[Gg]=T:delete y[Gg]},T=>{b=T},i))),s==null||s(),h(),f()}catch(E){if(!v.signal.aborted)try{const T=(C=a==null?void 0:a(E))!==null&&C!==void 0?C:b;window.clearTimeout(m),m=window.setTimeout(_,T)}catch(T){h(),p(T)}}}_()})}function mN(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(Yh)))throw new Error(`Expected content-type to be ${Yh}, Actual: ${t}`)}var De;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(const s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(De||(De={}));var qh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(qh||(qh={}));const G=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xr=e=>{switch(typeof e){case"undefined":return G.undefined;case"string":return G.string;case"number":return isNaN(e)?G.nan:G.number;case"boolean":return G.boolean;case"function":return G.function;case"bigint":return G.bigint;case"symbol":return G.symbol;case"object":return Array.isArray(e)?G.array:e===null?G.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?G.promise:typeof Map<"u"&&e instanceof Map?G.map:typeof Set<"u"&&e instanceof Set?G.set:typeof Date<"u"&&e instanceof Date?G.date:G.object;default:return G.unknown}},W=De.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"]),vN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class zn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zn.create=e=>new zn(e);const Ja=(e,t)=>{let n;switch(e.code){case W.invalid_type:e.received===G.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case W.invalid_union:n="Invalid input";break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:n="Invalid function arguments";break;case W.invalid_return_type:n="Invalid function return type";break;case W.invalid_date:n="Invalid date";break;case W.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case W.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case W.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case W.custom:n="Invalid input";break;case W.invalid_intersection_types:n="Intersection results could not be merged";break;case W.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:n="Number must be finite";break;default:n=t.defaultError,De.assertNever(e)}return{message:n}};let bb=Ja;function gN(e){bb=e}function yc(){return bb}const wc=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:o.message||a}},yN=[];function X(e,t){const n=wc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,yc(),Ja].filter(r=>!!r)});e.common.issues.push(n)}class Dt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return ge;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return Dt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return ge;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}}const ge=Object.freeze({status:"aborted"}),Sb=e=>({status:"dirty",value:e}),Wt=e=>({status:"valid",value:e}),Gh=e=>e.status==="aborted",Xh=e=>e.status==="dirty",el=e=>e.status==="valid",xc=e=>typeof Promise<"u"&&e instanceof Promise;var ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ce||(ce={}));class sr{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xg=(e,t)=>{if(el(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zn(e.common.issues);return this._error=n,this._error}}};function we(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:o}}class be{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Xr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Xr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:Xr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(xc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xr(t)},i=this._parseSync({data:t,path:o.path,parent:o});return Xg(o,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xr(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(xc(o)?o:Promise.resolve(o));return Xg(r,i)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=t(o),a=()=>i.addIssue({code:W.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Bn({schema:this,typeName:fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Cr.create(this,this._def)}nullable(){return vi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this,this._def)}promise(){return Ds.create(this,this._def)}or(t){return ol.create([this,t],this._def)}and(t){return il.create(this,t,this._def)}transform(t){return new Bn({...we(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new cl({...we(this._def),innerType:this,defaultValue:n,typeName:fe.ZodDefault})}brand(){return new Eb({typeName:fe.ZodBranded,type:this,...we(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Ec({...we(this._def),innerType:this,catchValue:n,typeName:fe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Il.create(this,t)}readonly(){return kc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wN=/^c[^\s-]{8,}$/i,xN=/^[a-z][a-z0-9]*$/,bN=/^[0-9A-HJKMNP-TV-Z]{26}$/,SN=/^[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,_N=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,EN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let hf;const CN=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,kN=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,TN=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function $N(e,t){return!!((t==="v4"||!t)&&CN.test(e)||(t==="v6"||!t)&&kN.test(e))}class Ln extends be{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==G.string){const i=this._getOrReturnCtx(t);return X(i,{code:W.invalid_type,expected:G.string,received:i.parsedType}),ge}const r=new Dt;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(o=this._getOrReturnCtx(t,o),X(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,a=t.data.lengtht.test(o),{validation:n,code:W.invalid_string,...ce.errToObj(r)})}_addCheck(t){return new Ln({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ce.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...ce.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ce.errToObj(n)})}nonempty(t){return this.min(1,ce.errToObj(t))}trim(){return new Ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ln({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ln({checks:[],typeName:fe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};function RN(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class To extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==G.number){const i=this._getOrReturnCtx(t);return X(i,{code:W.invalid_type,expected:G.number,received:i.parsedType}),ge}let r;const o=new Dt;for(const i of this._def.checks)i.kind==="int"?De.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:W.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),X(r,{code:W.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?RN(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),X(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:W.not_finite,message:i.message}),o.dirty()):De.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ce.toString(n))}setLimit(t,n,r,o){return new To({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ce.toString(o)}]})}_addCheck(t){return new To({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew To({checks:[],typeName:fe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class $o extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==G.bigint){const i=this._getOrReturnCtx(t);return X(i,{code:W.invalid_type,expected:G.bigint,received:i.parsedType}),ge}let r;const o=new Dt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),X(r,{code:W.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),X(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):De.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ce.toString(n))}setLimit(t,n,r,o){return new $o({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ce.toString(o)}]})}_addCheck(t){return new $o({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new $o({checks:[],typeName:fe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};class tl extends be{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==G.boolean){const r=this._getOrReturnCtx(t);return X(r,{code:W.invalid_type,expected:G.boolean,received:r.parsedType}),ge}return Wt(t.data)}}tl.create=e=>new tl({typeName:fe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class pi extends be{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==G.date){const i=this._getOrReturnCtx(t);return X(i,{code:W.invalid_type,expected:G.date,received:i.parsedType}),ge}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return X(i,{code:W.invalid_date}),ge}const r=new Dt;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(o=this._getOrReturnCtx(t,o),X(o,{code:W.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):De.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ce.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew pi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:fe.ZodDate,...we(e)});class bc extends be{_parse(t){if(this._getType(t)!==G.symbol){const r=this._getOrReturnCtx(t);return X(r,{code:W.invalid_type,expected:G.symbol,received:r.parsedType}),ge}return Wt(t.data)}}bc.create=e=>new bc({typeName:fe.ZodSymbol,...we(e)});class nl extends be{_parse(t){if(this._getType(t)!==G.undefined){const r=this._getOrReturnCtx(t);return X(r,{code:W.invalid_type,expected:G.undefined,received:r.parsedType}),ge}return Wt(t.data)}}nl.create=e=>new nl({typeName:fe.ZodUndefined,...we(e)});class rl extends be{_parse(t){if(this._getType(t)!==G.null){const r=this._getOrReturnCtx(t);return X(r,{code:W.invalid_type,expected:G.null,received:r.parsedType}),ge}return Wt(t.data)}}rl.create=e=>new rl({typeName:fe.ZodNull,...we(e)});class As extends be{constructor(){super(...arguments),this._any=!0}_parse(t){return Wt(t.data)}}As.create=e=>new As({typeName:fe.ZodAny,...we(e)});class si extends be{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Wt(t.data)}}si.create=e=>new si({typeName:fe.ZodUnknown,...we(e)});class Pr extends be{_parse(t){const n=this._getOrReturnCtx(t);return X(n,{code:W.invalid_type,expected:G.never,received:n.parsedType}),ge}}Pr.create=e=>new Pr({typeName:fe.ZodNever,...we(e)});class Sc extends be{_parse(t){if(this._getType(t)!==G.undefined){const r=this._getOrReturnCtx(t);return X(r,{code:W.invalid_type,expected:G.void,received:r.parsedType}),ge}return Wt(t.data)}}Sc.create=e=>new Sc({typeName:fe.ZodVoid,...we(e)});class Vn extends be{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==G.array)return X(n,{code:W.invalid_type,expected:G.array,received:n.parsedType}),ge;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.lengtho.maxLength.value&&(X(n,{code:W.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new sr(n,s,n.path,a)))).then(s=>Dt.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new sr(n,s,n.path,a)));return Dt.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Vn({...this._def,minLength:{value:t,message:ce.toString(n)}})}max(t,n){return new Vn({...this._def,maxLength:{value:t,message:ce.toString(n)}})}length(t,n){return new Vn({...this._def,exactLength:{value:t,message:ce.toString(n)}})}nonempty(t){return this.min(1,t)}}Vn.create=(e,t)=>new Vn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,...we(t)});function Ai(e){if(e instanceof tt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cr.create(Ai(r))}return new tt({...e._def,shape:()=>t})}else return e instanceof Vn?new Vn({...e._def,type:Ai(e.element)}):e instanceof Cr?Cr.create(Ai(e.unwrap())):e instanceof vi?vi.create(Ai(e.unwrap())):e instanceof ar?ar.create(e.items.map(t=>Ai(t))):e}class tt extends be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=De.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==G.object){const u=this._getOrReturnCtx(t);return X(u,{code:W.invalid_type,expected:G.object,received:u.parsedType}),ge}const{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Pr&&this._def.unknownKeys==="strip"))for(const u in o.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const d=i[u],f=o.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new sr(o,f,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Pr){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(X(o,{code:W.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=o.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new sr(o,f,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key;u.push({key:f,value:await d.value,alwaysSet:d.alwaysSet})}return u}).then(u=>Dt.mergeObjectSync(r,u)):Dt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ce.errToObj,new tt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,a;const l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:fe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new tt({...this._def,catchall:t})}pick(t){const n={};return De.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new tt({...this._def,shape:()=>n})}omit(t){const n={};return De.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new tt({...this._def,shape:()=>n})}deepPartial(){return Ai(this)}partial(t){const n={};return De.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new tt({...this._def,shape:()=>n})}required(t){const n={};return De.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Cr;)i=i._def.innerType;n[r]=i}}),new tt({...this._def,shape:()=>n})}keyof(){return _b(De.objectKeys(this.shape))}}tt.create=(e,t)=>new tt({shape:()=>e,unknownKeys:"strip",catchall:Pr.create(),typeName:fe.ZodObject,...we(t)});tt.strictCreate=(e,t)=>new tt({shape:()=>e,unknownKeys:"strict",catchall:Pr.create(),typeName:fe.ZodObject,...we(t)});tt.lazycreate=(e,t)=>new tt({shape:e,unknownKeys:"strip",catchall:Pr.create(),typeName:fe.ZodObject,...we(t)});class ol extends be{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new zn(a.ctx.common.issues));return X(n,{code:W.invalid_union,unionErrors:s}),ge}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new zn(l));return X(n,{code:W.invalid_union,unionErrors:a}),ge}}get options(){return this._def.options}}ol.create=(e,t)=>new ol({options:e,typeName:fe.ZodUnion,...we(t)});const Du=e=>e instanceof al?Du(e.schema):e instanceof Bn?Du(e.innerType()):e instanceof ll?[e.value]:e instanceof Ro?e.options:e instanceof ul?Object.keys(e.enum):e instanceof cl?Du(e._def.innerType):e instanceof nl?[void 0]:e instanceof rl?[null]:null;class fd extends be{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==G.object)return X(n,{code:W.invalid_type,expected:G.object,received:n.parsedType}),ge;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(X(n,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ge)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const i of n){const s=Du(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new fd({typeName:fe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...we(r)})}}function Jh(e,t){const n=Xr(e),r=Xr(t);if(e===t)return{valid:!0,data:e};if(n===G.object&&r===G.object){const o=De.objectKeys(t),i=De.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of i){const l=Jh(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===G.array&&r===G.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i{if(Gh(i)||Gh(s))return ge;const a=Jh(i.value,s.value);return a.valid?((Xh(i)||Xh(s))&&n.dirty(),{status:n.value,value:a.data}):(X(r,{code:W.invalid_intersection_types}),ge)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}il.create=(e,t,n)=>new il({left:e,right:t,typeName:fe.ZodIntersection,...we(n)});class ar extends be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.array)return X(r,{code:W.invalid_type,expected:G.array,received:r.parsedType}),ge;if(r.data.lengththis._def.items.length&&(X(r,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new sr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Dt.mergeArray(n,s)):Dt.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ar({...this._def,rest:t})}}ar.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ar({items:e,typeName:fe.ZodTuple,rest:null,...we(t)})};class sl extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.object)return X(r,{code:W.invalid_type,expected:G.object,received:r.parsedType}),ge;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new sr(r,a,r.path,a)),value:s._parse(new sr(r,r.data[a],r.path,a))});return r.common.async?Dt.mergeObjectAsync(n,o):Dt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof be?new sl({keyType:t,valueType:n,typeName:fe.ZodRecord,...we(r)}):new sl({keyType:Ln.create(),valueType:t,typeName:fe.ZodRecord,...we(n)})}}class _c extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.map)return X(r,{code:W.invalid_type,expected:G.map,received:r.parsedType}),ge;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new sr(r,a,r.path,[u,"key"])),value:i._parse(new sr(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return ge;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return ge;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}_c.create=(e,t,n)=>new _c({valueType:t,keyType:e,typeName:fe.ZodMap,...we(n)});class mi extends be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.set)return X(r,{code:W.invalid_type,expected:G.set,received:r.parsedType}),ge;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(X(r,{code:W.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const u=new Set;for(const d of l){if(d.status==="aborted")return ge;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new sr(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new mi({...this._def,minSize:{value:t,message:ce.toString(n)}})}max(t,n){return new mi({...this._def,maxSize:{value:t,message:ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}mi.create=(e,t)=>new mi({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,...we(t)});class rs extends be{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==G.function)return X(n,{code:W.invalid_type,expected:G.function,received:n.parsedType}),ge;function r(a,l){return wc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yc(),Ja].filter(u=>!!u),issueData:{code:W.invalid_arguments,argumentsError:l}})}function o(a,l){return wc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yc(),Ja].filter(u=>!!u),issueData:{code:W.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Ds){const a=this;return Wt(async function(...l){const u=new zn([]),d=await a._def.args.parseAsync(l,i).catch(y=>{throw u.addIssue(r(l,y)),u}),f=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(f,i).catch(y=>{throw u.addIssue(o(f,y)),u})})}else{const a=this;return Wt(function(...l){const u=a._def.args.safeParse(l,i);if(!u.success)throw new zn([r(l,u.error)]);const d=Reflect.apply(s,this,u.data),f=a._def.returns.safeParse(d,i);if(!f.success)throw new zn([o(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rs({...this._def,args:ar.create(t).rest(si.create())})}returns(t){return new rs({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new rs({args:t||ar.create([]).rest(si.create()),returns:n||si.create(),typeName:fe.ZodFunction,...we(r)})}}class al extends be{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}al.create=(e,t)=>new al({getter:e,typeName:fe.ZodLazy,...we(t)});class ll extends be{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return X(n,{received:n.data,code:W.invalid_literal,expected:this._def.value}),ge}return{status:"valid",value:t.data}}get value(){return this._def.value}}ll.create=(e,t)=>new ll({value:e,typeName:fe.ZodLiteral,...we(t)});function _b(e,t){return new Ro({values:e,typeName:fe.ZodEnum,...we(t)})}class Ro extends be{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return X(n,{expected:De.joinValues(r),received:n.parsedType,code:W.invalid_type}),ge}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return X(n,{received:n.data,code:W.invalid_enum_value,options:r}),ge}return Wt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Ro.create(t)}exclude(t){return Ro.create(this.options.filter(n=>!t.includes(n)))}}Ro.create=_b;class ul extends be{_parse(t){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==G.string&&r.parsedType!==G.number){const o=De.objectValues(n);return X(r,{expected:De.joinValues(o),received:r.parsedType,code:W.invalid_type}),ge}if(n.indexOf(t.data)===-1){const o=De.objectValues(n);return X(r,{received:r.data,code:W.invalid_enum_value,options:o}),ge}return Wt(t.data)}get enum(){return this._def.values}}ul.create=(e,t)=>new ul({values:e,typeName:fe.ZodNativeEnum,...we(t)});class Ds extends be{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==G.promise&&n.common.async===!1)return X(n,{code:W.invalid_type,expected:G.promise,received:n.parsedType}),ge;const r=n.parsedType===G.promise?n.data:Promise.resolve(n.data);return Wt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ds.create=(e,t)=>new Ds({type:e,typeName:fe.ZodPromise,...we(t)});class Bn extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{X(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ge:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?ge:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!el(s))return s;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>el(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):s);De.assertNever(o)}}Bn.create=(e,t,n)=>new Bn({schema:e,typeName:fe.ZodEffects,effect:t,...we(n)});Bn.createWithPreprocess=(e,t,n)=>new Bn({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,...we(n)});class Cr extends be{_parse(t){return this._getType(t)===G.undefined?Wt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:fe.ZodOptional,...we(t)});class vi extends be{_parse(t){return this._getType(t)===G.null?Wt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vi.create=(e,t)=>new vi({innerType:e,typeName:fe.ZodNullable,...we(t)});class cl extends be{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===G.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}cl.create=(e,t)=>new cl({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...we(t)});class Ec extends be{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return xc(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ec.create=(e,t)=>new Ec({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...we(t)});class Cc extends be{_parse(t){if(this._getType(t)!==G.nan){const r=this._getOrReturnCtx(t);return X(r,{code:W.invalid_type,expected:G.nan,received:r.parsedType}),ge}return{status:"valid",value:t.data}}}Cc.create=e=>new Cc({typeName:fe.ZodNaN,...we(e)});const PN=Symbol("zod_brand");class Eb extends be{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Il extends be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ge:i.status==="dirty"?(n.dirty(),Sb(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ge:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Il({in:t,out:n,typeName:fe.ZodPipeline})}}class kc extends be{_parse(t){const n=this._def.innerType._parse(t);return el(n)&&(n.value=Object.freeze(n.value)),n}}kc.create=(e,t)=>new kc({innerType:e,typeName:fe.ZodReadonly,...we(t)});const Cb=(e,t={},n)=>e?As.create().superRefine((r,o)=>{var i,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:l})}}):As.create(),NN={object:tt.lazycreate};var fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));const ON=(e,t={message:`Input not instance of ${e.name}`})=>Cb(n=>n instanceof e,t),Qt=Ln.create,kb=To.create,AN=Cc.create,DN=$o.create,Tb=tl.create,MN=pi.create,IN=bc.create,jN=nl.create,LN=rl.create,FN=As.create,UN=si.create,zN=Pr.create,VN=Sc.create,$b=Vn.create,jn=tt.create,WN=tt.strictCreate,BN=ol.create,HN=fd.create,ZN=il.create,KN=ar.create,QN=sl.create,YN=_c.create,qN=mi.create,GN=rs.create,XN=al.create,JN=ll.create,eO=Ro.create,tO=ul.create,nO=Ds.create,Jg=Bn.create,rO=Cr.create,oO=vi.create,iO=Bn.createWithPreprocess,sO=Il.create,aO=()=>Qt().optional(),lO=()=>kb().optional(),uO=()=>Tb().optional(),cO={string:e=>Ln.create({...e,coerce:!0}),number:e=>To.create({...e,coerce:!0}),boolean:e=>tl.create({...e,coerce:!0}),bigint:e=>$o.create({...e,coerce:!0}),date:e=>pi.create({...e,coerce:!0})},dO=ge;var ha=Object.freeze({__proto__:null,defaultErrorMap:Ja,setErrorMap:gN,getErrorMap:yc,makeIssue:wc,EMPTY_PATH:yN,addIssueToContext:X,ParseStatus:Dt,INVALID:ge,DIRTY:Sb,OK:Wt,isAborted:Gh,isDirty:Xh,isValid:el,isAsync:xc,get util(){return De},get objectUtil(){return qh},ZodParsedType:G,getParsedType:Xr,ZodType:be,ZodString:Ln,ZodNumber:To,ZodBigInt:$o,ZodBoolean:tl,ZodDate:pi,ZodSymbol:bc,ZodUndefined:nl,ZodNull:rl,ZodAny:As,ZodUnknown:si,ZodNever:Pr,ZodVoid:Sc,ZodArray:Vn,ZodObject:tt,ZodUnion:ol,ZodDiscriminatedUnion:fd,ZodIntersection:il,ZodTuple:ar,ZodRecord:sl,ZodMap:_c,ZodSet:mi,ZodFunction:rs,ZodLazy:al,ZodLiteral:ll,ZodEnum:Ro,ZodNativeEnum:ul,ZodPromise:Ds,ZodEffects:Bn,ZodTransformer:Bn,ZodOptional:Cr,ZodNullable:vi,ZodDefault:cl,ZodCatch:Ec,ZodNaN:Cc,BRAND:PN,ZodBranded:Eb,ZodPipeline:Il,ZodReadonly:kc,custom:Cb,Schema:be,ZodSchema:be,late:NN,get ZodFirstPartyTypeKind(){return fe},coerce:cO,any:FN,array:$b,bigint:DN,boolean:Tb,date:MN,discriminatedUnion:HN,effect:Jg,enum:eO,function:GN,instanceof:ON,intersection:ZN,lazy:XN,literal:JN,map:YN,nan:AN,nativeEnum:tO,never:zN,null:LN,nullable:oO,number:kb,object:jn,oboolean:uO,onumber:lO,optional:rO,ostring:aO,pipeline:sO,preprocess:iO,promise:nO,record:QN,set:qN,strictObject:WN,string:Qt,symbol:IN,transformer:Jg,tuple:KN,undefined:jN,union:BN,unknown:UN,void:VN,NEVER:dO,ZodIssueCode:W,quotelessJson:vN,ZodError:zn});const Ws="/api";var Sm=(e=>(e[e.IDLE=0]="IDLE",e[e.LOADING=1]="LOADING",e[e.ERROR=2]="ERROR",e))(Sm||{});const fO=Ws+"/agents/message",Rb=ud(_R({socket:null,socketURL:null,readyState:0,abortController:null,onMessageCallback:e=>console.warn("No message callback set up. Simply logging message",e)},(e,t)=>({actions:{sendMessage:({userId:n,agentId:r,message:o,role:i})=>{const s=new AbortController;e(p=>({...p,abortController:s,readyState:1}));const a=t().onMessageCallback,l=()=>e(p=>({...p,readyState:0})),u=()=>e(p=>({...p,readyState:0})),d=()=>e(p=>({...p,readyState:1})),f=()=>e(p=>(s.abort(),{...p,abortController:null,readyState:2}));pN(fO,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({user_id:n,agent_id:r,message:o,role:i??"user",stream:!0}),signal:s.signal,onopen:async p=>{p.ok&&p.status===200?(console.log("Connection made ",p),d()):p.status>=400&&p.status<500&&p.status!==429&&(console.log("Client-side error ",p),f())},onmessage:async p=>{const y=JSON.parse(p.data);console.log("raw data returned in streamed response",y);const v=jn({internal_monologue:Qt().nullable()}).or(jn({assistant_message:Qt()})).or(jn({function_call:Qt()})).or(jn({function_return:Qt()})).or(jn({internal_error:Qt()})).and(jn({date:Qt().optional().transform(g=>g?new Date(g):new Date)})).parse(y);"internal_monologue"in v?a({type:"agent_response",message_type:"internal_monologue",message:v.internal_monologue??"None",date:v.date}):"assistant_message"in v?(a({type:"agent_response",message_type:"assistant_message",message:v.assistant_message,date:v.date}),u()):"function_call"in v?a({type:"agent_response",message_type:"function_call",message:v.function_call,date:v.date}):"function_return"in v?a({type:"agent_response",message_type:"function_return",message:v.function_return,date:v.date}):"internal_error"in v&&(a({type:"agent_response",message_type:"internal_error",message:v.internal_error,date:v.date}),f())},onclose(){console.log("Connection closed by the server"),l()},onerror(p){console.log("There was an error from server",p),f()}})},registerOnMessageCallback:n=>e(r=>({...r,onMessageCallback:n})),abortStream:()=>{var n;(n=t().abortController)==null||n.abort(),e({...e,abortController:null,readyState:0})}}}))),hO=()=>Rb(e=>e.readyState),Pb=()=>Rb(e=>e.actions),Nb=ud(xm((e,t)=>({auth:{uuid:null},actions:{setAsAuthenticated:n=>e(r=>({...r,auth:{uuid:n}}))}}),{name:"auth-storage",storage:wm(()=>localStorage),partialize:({actions:e,...t})=>t})),jo=()=>Nb().auth,pO=()=>Nb().actions,mO=()=>pm({queryKey:["auth"],queryFn:async()=>await fetch(Ws+"/auth").then(e=>e.json())}),vO=e=>{const t=mO(),{uuid:n}=jo(),{setAsAuthenticated:r}=pO();return t.isSuccess&&n!==t.data.uuid&&r(t.data.uuid),e.children},gO=Nl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ob({className:e,variant:t,...n}){return S.jsx("div",{className:le(gO({variant:t}),e),...n})}const ey=({children:e})=>S.jsx("div",{className:"relative mt-4 h-[70svh] overflow-y-auto rounded-md border bg-muted/50",children:e}),yO=(...e)=>le("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),wO=(...e)=>le("scroll-m-20 text-2xl font-semibold tracking-tight",e),xO=(...e)=>le("scroll-m-20 text-xl font-semibold tracking-tight",e),bO=(...e)=>le("rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),SO=(...e)=>le("text-xl text-muted-foreground",e),gi=(...e)=>le("text-sm text-muted-foreground",e),_O=Nl("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ab=c.forwardRef(({className:e,variant:t,...n},r)=>S.jsx("div",{ref:r,role:"alert",className:le(_O({variant:t}),e),...n}));Ab.displayName="Alert";const Db=c.forwardRef(({className:e,...t},n)=>S.jsx("h5",{ref:n,className:le("mb-1 font-medium leading-none tracking-tight",e),...t}));Db.displayName="AlertTitle";const Mb=c.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:le("text-sm [&_p]:leading-relaxed",e),...t}));Mb.displayName="AlertDescription";const EO=e=>S.jsxs(Ab,{className:"w-fit max-w-md p-2 text-xs [&>svg]:left-2.5 [&>svg]:top-2.5",variant:"destructive",children:[S.jsx(YC,{className:"h-4 w-4"}),S.jsx(Db,{children:"Something went wrong..."}),S.jsx(Mb,{className:"text-xs",children:e.message})]}),Ib="Avatar",[CO,xM]=Ir(Ib),[kO,jb]=CO(Ib),TO=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=c.useState("idle");return c.createElement(kO,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i},c.createElement(ke.span,ne({},r,{ref:t})))}),$O="AvatarImage",RO=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=jb($O,n),a=OO(r),l=Vt(u=>{o(u),s.onImageLoadingStatusChange(u)});return Jt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?c.createElement(ke.img,ne({},i,{ref:t,src:r})):null}),PO="AvatarFallback",NO=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=jb(PO,n),[s,a]=c.useState(r===void 0);return c.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?c.createElement(ke.span,ne({},o,{ref:t})):null});function OO(e){const[t,n]=c.useState("idle");return Jt(()=>{if(!e){n("error");return}let r=!0;const o=new window.Image,i=s=>()=>{r&&n(s)};return n("loading"),o.onload=i("loaded"),o.onerror=i("error"),o.src=e,()=>{r=!1}},[e]),t}const Lb=TO,Fb=RO,Ub=NO,_m=c.forwardRef(({className:e,...t},n)=>S.jsx(Lb,{ref:n,className:le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));_m.displayName=Lb.displayName;const Em=c.forwardRef(({className:e,...t},n)=>S.jsx(Fb,{ref:n,className:le("aspect-square h-full w-full",e),...t}));Em.displayName=Fb.displayName;const Cm=c.forwardRef(({className:e,...t},n)=>S.jsx(Ub,{ref:n,className:le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Cm.displayName=Ub.displayName;const zb=e=>S.jsxs("div",{className:`flex items-end ${e.dir==="ltr"?"justify-start":"justify-end"}`,children:[S.jsxs("div",{className:"order-2 mx-2 flex max-w-xs flex-col items-start space-y-1 text-xs",children:[S.jsx("div",{children:S.jsx("span",{className:`inline-block rounded-lg px-4 py-2 ${e.dir==="ltr"?"rounded-bl-none":"rounded-br-none"} ${e.bg} ${e.fg}`,children:e.message})}),S.jsx("span",{className:"text-muted-foreground",children:VP(e.date,"M/d/yy, h:mm a")})]}),S.jsxs(_m,{className:e.dir==="ltr"?"order-1":"order-2",children:[S.jsx(Em,{alt:e.initials,src:"/placeholder.svg?height=32&width=32"}),S.jsx(Cm,{className:"border",children:e.initials})]})]}),AO=e=>S.jsx(zb,{message:e.message,date:e.date,dir:"ltr",bg:"bg-blue-600",fg:"text-white",initials:"AI"}),DO=e=>S.jsx(zb,{message:e.message,date:e.date,dir:"rtl",bg:"bg-muted-foreground/40 dark:bg-muted-foreground/20",fg:"text-black dark:text-white",initials:"U"}),MO=({type:e,message_type:t,message:n,date:r},o)=>{if(e==="user_message")return S.jsx(DO,{date:r,message:n??""},o);if(e==="agent_response"&&t==="internal_error")return S.jsx(EO,{date:r,message:n??""},o);if(e==="agent_response"&&t==="assistant_message")return S.jsx(AO,{date:r,message:n??""},o);if(e==="agent_response"&&t==="function_call"&&!(n!=null&&n.includes("send_message"))||e==="agent_response"&&t==="function_return"&&n!=="None")return S.jsx("p",{className:bO("mb-2 w-fit max-w-xl overflow-x-scroll whitespace-nowrap rounded border bg-black p-2 text-xs text-white"),children:n},o);if(e==="agent_response"&&t==="internal_monologue")return S.jsx("p",{className:gi("mb-2 w-fit max-w-xs rounded border p-2 text-xs"),children:n},o)},Vb=Nl("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ut=c.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Eo:"button";return S.jsx(s,{className:le(Vb({variant:t,size:n,className:e})),ref:i,...o})});Ut.displayName="Button";const km=c.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));km.displayName="Card";const Tm=c.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:le("flex flex-col space-y-1.5 p-6",e),...t}));Tm.displayName="CardHeader";const $m=c.forwardRef(({className:e,...t},n)=>S.jsx("h3",{ref:n,className:le("text-2xl font-semibold leading-none tracking-tight",e),...t}));$m.displayName="CardTitle";const Rm=c.forwardRef(({className:e,...t},n)=>S.jsx("p",{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Rm.displayName="CardDescription";const Wb=c.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:le("p-6 pt-0",e),...t}));Wb.displayName="CardContent";const Pm=c.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:le("flex items-center p-6 pt-0",e),...t}));Pm.displayName="CardFooter";const Nm=e=>pm({queryKey:[e,"agents","list"],enabled:!!e,queryFn:async()=>await fetch(Ws+`/agents?user_id=${e}`).then(t=>t.json())}),IO=()=>{const{uuid:e}=jo(),{data:t}=Nm(e),[n,r]=c.useState(null),{setAgent:o}=cd();return S.jsxs(km,{className:"my-10 mx-4 w-fit bg-background animate-in slide-in-from-top slide-out-to-top duration-700 sm:mx-auto ",children:[S.jsxs(Tm,{className:"pb-3",children:[S.jsx($m,{children:"Choose Agent"}),S.jsx(Rm,{children:"Pick an agent to start a conversation..."})]}),S.jsx(Wb,{className:"grid gap-1",children:((t==null?void 0:t.agents)??[]).map((i,s)=>S.jsxs("button",{onClick:()=>r(i),className:le("-mx-2 flex items-start space-x-4 rounded-md p-2 text-left transition-all",(n==null?void 0:n.name)===i.name?"bg-accent text-accent-foreground":"hover:bg-accent hover:text-accent-foreground"),children:[S.jsx(ok,{className:"mt-px h-5 w-5"}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("p",{className:"text-sm font-medium leading-none",children:i.name}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.human," | ",i.persona," | ",i.created_at]})]})]},s))}),S.jsx(Pm,{children:S.jsx(Ut,{onClick:()=>n&&o(n),className:"w-full",children:"Start Chat"})})]})},jO=({className:e})=>S.jsxs("div",{className:e,children:[S.jsxs("span",{className:"relative flex h-4 w-4",children:[S.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-400 opacity-75"}),S.jsx("span",{className:"relative inline-flex h-4 w-4 rounded-full bg-blue-600"})]}),S.jsx("span",{className:gi("ml-4"),children:"Thinking..."})]}),LO=({currentAgent:e,messages:t,readyState:n,previousMessages:r})=>{const o=c.useRef(null);return c.useEffect(()=>{var i;return(i=o.current)==null?void 0:i.scrollIntoView(!1)},[t]),e?S.jsxs(ey,{children:[S.jsx(Ob,{className:"sticky left-1/2 top-2 z-10 mx-auto origin-center -translate-x-1/2 bg-background py-1 px-4",variant:"outline",children:S.jsx("span",{children:e.name})}),S.jsxs("div",{className:"flex flex-1 flex-col space-y-4 px-4 py-6",ref:o,children:[r.map(i=>{var s;return S.jsxs("p",{children:[i.name," | ",i.role," | ",i.content," | ",(s=i.function_call)==null?void 0:s.arguments]})}),t.map((i,s)=>MO(i,s)),n===Sm.LOADING?S.jsx(jO,{className:"flex items-center py-3 px-3"}):void 0]})]}):S.jsx(ey,{children:S.jsx(IO,{})})},xr=c.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));xr.displayName="Input";var jl=e=>e.type==="checkbox",Qi=e=>e instanceof Date,Ft=e=>e==null;const Bb=e=>typeof e=="object";var yt=e=>!Ft(e)&&!Array.isArray(e)&&Bb(e)&&!Qi(e),Hb=e=>yt(e)&&e.target?jl(e.target)?e.target.checked:e.target.value:e,FO=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Zb=(e,t)=>e.has(FO(t)),UO=e=>{const t=e.constructor&&e.constructor.prototype;return yt(t)&&t.hasOwnProperty("isPrototypeOf")},Om=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Nt(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Om&&(e instanceof Blob||e instanceof FileList))&&(n||yt(e)))if(t=n?[]:{},!n&&!UO(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Nt(e[r]));else return e;return t}var Bs=e=>Array.isArray(e)?e.filter(Boolean):[],qe=e=>e===void 0,Q=(e,t,n)=>{if(!t||!yt(e))return n;const r=Bs(t.split(/[,[\].]+?/)).reduce((o,i)=>Ft(o)?o:o[i],e);return qe(r)||r===e?qe(e[t])?n:e[t]:r},uo=e=>typeof e=="boolean";const Tc={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},_n={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Kb=de.createContext(null),Ll=()=>de.useContext(Kb),zO=e=>{const{children:t,...n}=e;return de.createElement(Kb.Provider,{value:n},t)};var Qb=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==_n.all&&(t._proxyFormState[s]=!r||_n.all),n&&(n[s]=!0),e[s]}});return o},nn=e=>yt(e)&&!Object.keys(e).length,Yb=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return nn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||_n.all))},sn=e=>Array.isArray(e)?e:[e],qb=(e,t,n)=>!e||!t||e===t||sn(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function hd(e){const t=de.useRef(e);t.current=e,de.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function VO(e){const t=Ll(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,a]=de.useState(n._formState),l=de.useRef(!0),u=de.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=de.useRef(o);return d.current=o,hd({disabled:r,next:f=>l.current&&qb(d.current,f.name,i)&&Yb(f,u.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),de.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),Qb(s,n,u.current,!1)}var tr=e=>typeof e=="string",Gb=(e,t,n,r,o)=>tr(e)?(r&&t.watch.add(e),Q(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Q(n,i))):(r&&(t.watchAll=!0),n);function WO(e){const t=Ll(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s}=e||{},a=de.useRef(r);a.current=r,hd({disabled:i,subject:n._subjects.values,next:d=>{qb(a.current,d.name,s)&&u(Nt(Gb(a.current,n._names,d.values||n._formValues,!1,o)))}});const[l,u]=de.useState(n._getWatch(r,o));return de.useEffect(()=>n._removeUnmounted()),l}var Am=e=>/^\w*$/.test(e),Xb=e=>Bs(e.replace(/["|']|\]/g,"").split(/\.|\[/));function je(e,t,n){let r=-1;const o=Am(t)?[t]:Xb(t),i=o.length,s=i-1;for(;++r{const d=o._options.shouldUnregister||i,f=(p,y)=>{const v=Q(o._fields,p);v&&(v._f.mount=y)};if(f(n,!0),d){const p=Nt(Q(o._options.defaultValues,n));je(o._defaultValues,n,p),qe(Q(o._formValues,n))&&je(o._formValues,n,p)}return()=>{(s?d&&!o._state.action:d)?o.unregister(n):f(n,!1)}},[n,o,s,i]),de.useEffect(()=>{Q(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),{field:{name:n,value:a,...uo(r)?{disabled:r}:{},onChange:de.useCallback(d=>u.current.onChange({target:{value:Hb(d),name:n},type:Tc.CHANGE}),[n]),onBlur:de.useCallback(()=>u.current.onBlur({target:{value:Q(o._formValues,n),name:n},type:Tc.BLUR}),[n,o]),ref:d=>{const f=Q(o._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:p=>d.setCustomValidity(p),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Q(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Q(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Q(l.touchedFields,n)},error:{enumerable:!0,get:()=>Q(l.errors,n)}})}}const HO=e=>e.render(BO(e));var Jb=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const $c=(e,t,n)=>{for(const r of n||Object.keys(e)){const o=Q(e,r);if(o){const{_f:i,...s}=o;if(i&&t(i.name)){if(i.ref.focus){i.ref.focus();break}else if(i.refs&&i.refs[0].focus){i.refs[0].focus();break}}else yt(s)&&$c(s,t)}}};var Br=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},pf=(e,t,n={})=>n.shouldFocus||qe(n.shouldFocus)?n.focusName||`${e}.${qe(n.focusIndex)?t:n.focusIndex}.`:"",ep=e=>({isOnSubmit:!e||e===_n.onSubmit,isOnBlur:e===_n.onBlur,isOnChange:e===_n.onChange,isOnAll:e===_n.all,isOnTouch:e===_n.onTouched}),tp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),e1=(e,t,n)=>{const r=Bs(Q(e,n));return je(r,"root",t[n]),je(e,n,r),e},Dm=e=>e.type==="file",co=e=>typeof e=="function",Rc=e=>{if(!Om)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Mu=e=>tr(e),Mm=e=>e.type==="radio",Pc=e=>e instanceof RegExp;const ty={value:!1,isValid:!1},ny={value:!0,isValid:!0};var t1=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!qe(e[0].attributes.value)?qe(e[0].value)||e[0].value===""?ny:{value:e[0].value,isValid:!0}:ny:ty}return ty};const ry={isValid:!1,value:null};var n1=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ry):ry;function oy(e,t,n="validate"){if(Mu(e)||Array.isArray(e)&&e.every(Mu)||uo(e)&&!e)return{type:n,message:Mu(e)?e:"",ref:t}}var Ri=e=>yt(e)&&!Pc(e)?e:{value:e,message:""},np=async(e,t,n,r,o)=>{const{ref:i,refs:s,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:y,name:v,valueAsNumber:g,mount:b,disabled:m}=e._f,h=Q(t,v);if(!b||m)return{};const w=s?s[0]:i,x=D=>{r&&w.reportValidity&&(w.setCustomValidity(uo(D)?"":D||""),w.reportValidity())},_={},C=Mm(i),E=jl(i),T=C||E,O=(g||Dm(i))&&qe(i.value)&&qe(h)||Rc(i)&&i.value===""||h===""||Array.isArray(h)&&!h.length,I=Jb.bind(null,v,n,_),V=(D,B,M,F=fr.maxLength,H=fr.minLength)=>{const oe=D?B:M;_[v]={type:D?F:H,message:oe,ref:i,...I(D?F:H,oe)}};if(o?!Array.isArray(h)||!h.length:a&&(!T&&(O||Ft(h))||uo(h)&&!h||E&&!t1(s).isValid||C&&!n1(s).isValid)){const{value:D,message:B}=Mu(a)?{value:!!a,message:a}:Ri(a);if(D&&(_[v]={type:fr.required,message:B,ref:w,...I(fr.required,B)},!n))return x(B),_}if(!O&&(!Ft(d)||!Ft(f))){let D,B;const M=Ri(f),F=Ri(d);if(!Ft(h)&&!isNaN(h)){const H=i.valueAsNumber||h&&+h;Ft(M.value)||(D=H>M.value),Ft(F.value)||(B=Hnew Date(new Date().toDateString()+" "+re),L=i.type=="time",K=i.type=="week";tr(M.value)&&h&&(D=L?oe(h)>oe(M.value):K?h>M.value:H>new Date(M.value)),tr(F.value)&&h&&(B=L?oe(h)+D.value,F=!Ft(B.value)&&h.length<+B.value;if((M||F)&&(V(M,D.message,B.message),!n))return x(_[v].message),_}if(p&&!O&&tr(h)){const{value:D,message:B}=Ri(p);if(Pc(D)&&!h.match(D)&&(_[v]={type:fr.pattern,message:B,ref:i,...I(fr.pattern,B)},!n))return x(B),_}if(y){if(co(y)){const D=await y(h,t),B=oy(D,w);if(B&&(_[v]={...B,...I(fr.validate,B.message)},!n))return x(B.message),_}else if(yt(y)){let D={};for(const B in y){if(!nn(D)&&!n)break;const M=oy(await y[B](h,t),w,B);M&&(D={...M,...I(B,M.message)},x(M.message),n&&(_[v]=D))}if(!nn(D)&&(_[v]={ref:w,...D},!n))return _}}return x(!0),_};function mf(e,t){return[...e,...sn(t)]}var vf=e=>Array.isArray(e)?e.map(()=>{}):void 0;function gf(e,t,n){return[...e.slice(0,t),...sn(n),...e.slice(t)]}var yf=(e,t,n)=>Array.isArray(e)?(qe(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[];function wf(e,t){return[...sn(t),...sn(e)]}function ZO(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return Bs(r).length?r:[]}var xf=(e,t)=>qe(t)?[]:ZO(e,sn(t).sort((n,r)=>n-r)),bf=(e,t,n)=>{e[t]=[e[n],e[n]=e[t]][0]};function KO(e,t){const n=t.slice(0,-1).length;let r=0;for(;r(e[t]=n,e);function YO(e){const t=Ll(),{control:n=t.control,name:r,keyName:o="id",shouldUnregister:i}=e,[s,a]=de.useState(n._getFieldArray(r)),l=de.useRef(n._getFieldArray(r).map(Br)),u=de.useRef(s),d=de.useRef(r),f=de.useRef(!1);d.current=r,u.current=s,n._names.array.add(r),e.rules&&n.register(r,e.rules),hd({next:({values:_,name:C})=>{if(C===d.current||!C){const E=Q(_,d.current);Array.isArray(E)&&(a(E),l.current=E.map(Br))}},subject:n._subjects.array});const p=de.useCallback(_=>{f.current=!0,n._updateFieldArray(r,_)},[n,r]),y=(_,C)=>{const E=sn(Nt(_)),T=mf(n._getFieldArray(r),E);n._names.focus=pf(r,T.length-1,C),l.current=mf(l.current,E.map(Br)),p(T),a(T),n._updateFieldArray(r,T,mf,{argA:vf(_)})},v=(_,C)=>{const E=sn(Nt(_)),T=wf(n._getFieldArray(r),E);n._names.focus=pf(r,0,C),l.current=wf(l.current,E.map(Br)),p(T),a(T),n._updateFieldArray(r,T,wf,{argA:vf(_)})},g=_=>{const C=xf(n._getFieldArray(r),_);l.current=xf(l.current,_),p(C),a(C),n._updateFieldArray(r,C,xf,{argA:_})},b=(_,C,E)=>{const T=sn(Nt(C)),O=gf(n._getFieldArray(r),_,T);n._names.focus=pf(r,_,E),l.current=gf(l.current,_,T.map(Br)),p(O),a(O),n._updateFieldArray(r,O,gf,{argA:_,argB:vf(C)})},m=(_,C)=>{const E=n._getFieldArray(r);bf(E,_,C),bf(l.current,_,C),p(E),a(E),n._updateFieldArray(r,E,bf,{argA:_,argB:C},!1)},h=(_,C)=>{const E=n._getFieldArray(r);yf(E,_,C),yf(l.current,_,C),p(E),a(E),n._updateFieldArray(r,E,yf,{argA:_,argB:C},!1)},w=(_,C)=>{const E=Nt(C),T=iy(n._getFieldArray(r),_,E);l.current=[...T].map((O,I)=>!O||I===_?Br():l.current[I]),p(T),a([...T]),n._updateFieldArray(r,T,iy,{argA:_,argB:E},!0,!1)},x=_=>{const C=sn(Nt(_));l.current=C.map(Br),p([...C]),a([...C]),n._updateFieldArray(r,[...C],E=>E,{},!0,!1)};return de.useEffect(()=>{if(n._state.action=!1,tp(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!ep(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(_=>{const C=Q(_.errors,r),E=Q(n._formState.errors,r);(E?!C&&E.type||C&&(E.type!==C.type||E.message!==C.message):C&&C.type)&&(C?je(n._formState.errors,r,C):wt(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const _=Q(n._fields,r);_&&_._f&&np(_,n._formValues,n._options.criteriaMode===_n.all,n._options.shouldUseNativeValidation,!0).then(C=>!nn(C)&&n._subjects.state.next({errors:e1(n._formState.errors,C,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&$c(n._fields,_=>!!_&&_.startsWith(n._names.focus||"")),n._names.focus="",n._updateValid(),f.current=!1},[s,r,n]),de.useEffect(()=>(!Q(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,o,i]),{swap:de.useCallback(m,[p,r,n]),move:de.useCallback(h,[p,r,n]),prepend:de.useCallback(v,[p,r,n]),append:de.useCallback(y,[p,r,n]),remove:de.useCallback(g,[p,r,n]),insert:de.useCallback(b,[p,r,n]),update:de.useCallback(w,[p,r,n]),replace:de.useCallback(x,[p,r,n]),fields:de.useMemo(()=>s.map((_,C)=>({..._,[o]:l.current[C]||Br()})),[s,o])}}function Sf(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Nc=e=>Ft(e)||!Bb(e);function Qo(e,t){if(Nc(e)||Nc(t))return e===t;if(Qi(e)&&Qi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(Qi(i)&&Qi(s)||yt(i)&&yt(s)||Array.isArray(i)&&Array.isArray(s)?!Qo(i,s):i!==s)return!1}}return!0}var r1=e=>e.type==="select-multiple",qO=e=>Mm(e)||jl(e),_f=e=>Rc(e)&&e.isConnected,o1=e=>{for(const t in e)if(co(e[t]))return!0;return!1};function Oc(e,t={}){const n=Array.isArray(e);if(yt(e)||n)for(const r in e)Array.isArray(e[r])||yt(e[r])&&!o1(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Oc(e[r],t[r])):Ft(e[r])||(t[r]=!0);return t}function i1(e,t,n){const r=Array.isArray(e);if(yt(e)||r)for(const o in e)Array.isArray(e[o])||yt(e[o])&&!o1(e[o])?qe(t)||Nc(n[o])?n[o]=Array.isArray(e[o])?Oc(e[o],[]):{...Oc(e[o])}:i1(e[o],Ft(t)?{}:t[o],n[o]):n[o]=!Qo(e[o],t[o]);return n}var Ef=(e,t)=>i1(e,t,Oc(t)),s1=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>qe(e)?e:t?e===""?NaN:e&&+e:n&&tr(e)?new Date(e):r?r(e):e;function Cf(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Dm(t)?t.files:Mm(t)?n1(e.refs).value:r1(t)?[...t.selectedOptions].map(({value:n})=>n):jl(t)?t1(e.refs).value:s1(qe(t.value)?e.ref.value:t.value,e)}var GO=(e,t,n,r)=>{const o={};for(const i of e){const s=Q(t,i);s&&je(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},pa=e=>qe(e)?e:Pc(e)?e.source:yt(e)?Pc(e.value)?e.value.source:e.value:e,XO=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sy(e,t,n){const r=Q(e,n);if(r||Am(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=Q(t,i),a=Q(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};o.pop()}return{name:n}}var JO=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,e2=(e,t)=>!Bs(Q(e,t)).length&&wt(e,t);const t2={mode:_n.onSubmit,reValidateMode:_n.onChange,shouldFocusError:!0};function n2(e={},t){let n={...t2,...e},r={submitCount:0,isDirty:!1,isLoading:co(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},i=yt(n.defaultValues)||yt(n.values)?Nt(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:Nt(i),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:Sf(),array:Sf(),state:Sf()},y=e.resetOptions&&e.resetOptions.keepDirtyValues,v=ep(n.mode),g=ep(n.reValidateMode),b=n.criteriaMode===_n.all,m=$=>N=>{clearTimeout(d),d=setTimeout($,N)},h=async $=>{if(f.isValid||$){const N=n.resolver?nn((await O()).errors):await V(o,!0);N!==r.isValid&&p.state.next({isValid:N})}},w=$=>f.isValidating&&p.state.next({isValidating:$}),x=($,N=[],A,ee,Z=!0,U=!0)=>{if(ee&&A){if(a.action=!0,U&&Array.isArray(Q(o,$))){const se=A(Q(o,$),ee.argA,ee.argB);Z&&je(o,$,se)}if(U&&Array.isArray(Q(r.errors,$))){const se=A(Q(r.errors,$),ee.argA,ee.argB);Z&&je(r.errors,$,se),e2(r.errors,$)}if(f.touchedFields&&U&&Array.isArray(Q(r.touchedFields,$))){const se=A(Q(r.touchedFields,$),ee.argA,ee.argB);Z&&je(r.touchedFields,$,se)}f.dirtyFields&&(r.dirtyFields=Ef(i,s)),p.state.next({name:$,isDirty:B($,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else je(s,$,N)},_=($,N)=>{je(r.errors,$,N),p.state.next({errors:r.errors})},C=($,N,A,ee)=>{const Z=Q(o,$);if(Z){const U=Q(s,$,qe(A)?Q(i,$):A);qe(U)||ee&&ee.defaultChecked||N?je(s,$,N?U:Cf(Z._f)):H($,U),a.mount&&h()}},E=($,N,A,ee,Z)=>{let U=!1,se=!1;const Ke={name:$};if(!A||ee){f.isDirty&&(se=r.isDirty,r.isDirty=Ke.isDirty=B(),U=se!==Ke.isDirty);const Ve=Qo(Q(i,$),N);se=Q(r.dirtyFields,$),Ve?wt(r.dirtyFields,$):je(r.dirtyFields,$,!0),Ke.dirtyFields=r.dirtyFields,U=U||f.dirtyFields&&se!==!Ve}if(A){const Ve=Q(r.touchedFields,$);Ve||(je(r.touchedFields,$,A),Ke.touchedFields=r.touchedFields,U=U||f.touchedFields&&Ve!==A)}return U&&Z&&p.state.next(Ke),U?Ke:{}},T=($,N,A,ee)=>{const Z=Q(r.errors,$),U=f.isValid&&uo(N)&&r.isValid!==N;if(e.delayError&&A?(u=m(()=>_($,A)),u(e.delayError)):(clearTimeout(d),u=null,A?je(r.errors,$,A):wt(r.errors,$)),(A?!Qo(Z,A):Z)||!nn(ee)||U){const se={...ee,...U&&uo(N)?{isValid:N}:{},errors:r.errors,name:$};r={...r,...se},p.state.next(se)}w(!1)},O=async $=>n.resolver(s,n.context,GO($||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),I=async $=>{const{errors:N}=await O($);if($)for(const A of $){const ee=Q(N,A);ee?je(r.errors,A,ee):wt(r.errors,A)}else r.errors=N;return N},V=async($,N,A={valid:!0})=>{for(const ee in $){const Z=$[ee];if(Z){const{_f:U,...se}=Z;if(U){const Ke=l.array.has(U.name),Ve=await np(Z,s,b,n.shouldUseNativeValidation&&!N,Ke);if(Ve[U.name]&&(A.valid=!1,N))break;!N&&(Q(Ve,U.name)?Ke?e1(r.errors,Ve,U.name):je(r.errors,U.name,Ve[U.name]):wt(r.errors,U.name))}se&&await V(se,N,A)}}return A.valid},D=()=>{for(const $ of l.unMount){const N=Q(o,$);N&&(N._f.refs?N._f.refs.every(A=>!_f(A)):!_f(N._f.ref))&&ze($)}l.unMount=new Set},B=($,N)=>($&&N&&je(s,$,N),!Qo(he(),i)),M=($,N,A)=>Gb($,l,{...a.mount?s:qe(N)?i:tr($)?{[$]:N}:N},A,N),F=$=>Bs(Q(a.mount?s:i,$,e.shouldUnregister?Q(i,$,[]):[])),H=($,N,A={})=>{const ee=Q(o,$);let Z=N;if(ee){const U=ee._f;U&&(!U.disabled&&je(s,$,s1(N,U)),Z=Rc(U.ref)&&Ft(N)?"":N,r1(U.ref)?[...U.ref.options].forEach(se=>se.selected=Z.includes(se.value)):U.refs?jl(U.ref)?U.refs.length>1?U.refs.forEach(se=>(!se.defaultChecked||!se.disabled)&&(se.checked=Array.isArray(Z)?!!Z.find(Ke=>Ke===se.value):Z===se.value)):U.refs[0]&&(U.refs[0].checked=!!Z):U.refs.forEach(se=>se.checked=se.value===Z):Dm(U.ref)?U.ref.value="":(U.ref.value=Z,U.ref.type||p.values.next({name:$,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&E($,Z,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&re($)},oe=($,N,A)=>{for(const ee in N){const Z=N[ee],U=`${$}.${ee}`,se=Q(o,U);(l.array.has($)||!Nc(Z)||se&&!se._f)&&!Qi(Z)?oe(U,Z,A):H(U,Z,A)}},L=($,N,A={})=>{const ee=Q(o,$),Z=l.array.has($),U=Nt(N);je(s,$,U),Z?(p.array.next({name:$,values:{...s}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&p.state.next({name:$,dirtyFields:Ef(i,s),isDirty:B($,U)})):ee&&!ee._f&&!Ft(U)?oe($,U,A):H($,U,A),tp($,l)&&p.state.next({...r}),p.values.next({name:$,values:{...s}}),!a.mount&&t()},K=async $=>{const N=$.target;let A=N.name,ee=!0;const Z=Q(o,A),U=()=>N.type?Cf(Z._f):Hb($);if(Z){let se,Ke;const Ve=U(),Fr=$.type===Tc.BLUR||$.type===Tc.FOCUS_OUT,Hn=!XO(Z._f)&&!n.resolver&&!Q(r.errors,A)&&!Z._f.deps||JO(Fr,Q(r.touchedFields,A),r.isSubmitted,g,v),_i=tp(A,l,Fr);je(s,A,Ve),Fr?(Z._f.onBlur&&Z._f.onBlur($),u&&u(0)):Z._f.onChange&&Z._f.onChange($);const Ei=E(A,Ve,Fr,!1),Ul=!nn(Ei)||_i;if(!Fr&&p.values.next({name:A,type:$.type,values:{...s}}),Hn)return f.isValid&&h(),Ul&&p.state.next({name:A,..._i?{}:Ei});if(!Fr&&_i&&p.state.next({...r}),w(!0),n.resolver){const{errors:zl}=await O([A]),Vl=sy(r.errors,o,A),Lo=sy(zl,o,Vl.name||A);se=Lo.error,A=Lo.name,Ke=nn(zl)}else se=(await np(Z,s,b,n.shouldUseNativeValidation))[A],ee=Number.isNaN(Ve)||Ve===Q(s,A,Ve),ee&&(se?Ke=!1:f.isValid&&(Ke=await V(o,!0)));ee&&(Z._f.deps&&re(Z._f.deps),T(A,Ke,se,Ei))}},re=async($,N={})=>{let A,ee;const Z=sn($);if(w(!0),n.resolver){const U=await I(qe($)?$:Z);A=nn(U),ee=$?!Z.some(se=>Q(U,se)):A}else $?(ee=(await Promise.all(Z.map(async U=>{const se=Q(o,U);return await V(se&&se._f?{[U]:se}:se)}))).every(Boolean),!(!ee&&!r.isValid)&&h()):ee=A=await V(o);return p.state.next({...!tr($)||f.isValid&&A!==r.isValid?{}:{name:$},...n.resolver||!$?{isValid:A}:{},errors:r.errors,isValidating:!1}),N.shouldFocus&&!ee&&$c(o,U=>U&&Q(r.errors,U),$?Z:l.mount),ee},he=$=>{const N={...i,...a.mount?s:{}};return qe($)?N:tr($)?Q(N,$):$.map(A=>Q(N,A))},ve=($,N)=>({invalid:!!Q((N||r).errors,$),isDirty:!!Q((N||r).dirtyFields,$),isTouched:!!Q((N||r).touchedFields,$),error:Q((N||r).errors,$)}),Ue=$=>{$&&sn($).forEach(N=>wt(r.errors,N)),p.state.next({errors:$?r.errors:{}})},Ie=($,N,A)=>{const ee=(Q(o,$,{_f:{}})._f||{}).ref;je(r.errors,$,{...N,ref:ee}),p.state.next({name:$,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&ee&&ee.focus&&ee.focus()},ht=($,N)=>co($)?p.values.subscribe({next:A=>$(M(void 0,N),A)}):M($,N,!0),ze=($,N={})=>{for(const A of $?sn($):l.mount)l.mount.delete(A),l.array.delete(A),N.keepValue||(wt(o,A),wt(s,A)),!N.keepError&&wt(r.errors,A),!N.keepDirty&&wt(r.dirtyFields,A),!N.keepTouched&&wt(r.touchedFields,A),!n.shouldUnregister&&!N.keepDefaultValue&&wt(i,A);p.values.next({values:{...s}}),p.state.next({...r,...N.keepDirty?{isDirty:B()}:{}}),!N.keepIsValid&&h()},ue=({disabled:$,name:N,field:A,fields:ee})=>{if(uo($)){const Z=$?void 0:Q(s,N,Cf(A?A._f:Q(ee,N)._f));je(s,N,Z),E(N,Z,!1,!1,!0)}},Me=($,N={})=>{let A=Q(o,$);const ee=uo(N.disabled);return je(o,$,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:$}},name:$,mount:!0,...N}}),l.mount.add($),A?ue({field:A,disabled:N.disabled,name:$}):C($,!0,N.value),{...ee?{disabled:N.disabled}:{},...n.progressive?{required:!!N.required,min:pa(N.min),max:pa(N.max),minLength:pa(N.minLength),maxLength:pa(N.maxLength),pattern:pa(N.pattern)}:{},name:$,onChange:K,onBlur:K,ref:Z=>{if(Z){Me($,N),A=Q(o,$);const U=qe(Z.value)&&Z.querySelectorAll&&Z.querySelectorAll("input,select,textarea")[0]||Z,se=qO(U),Ke=A._f.refs||[];if(se?Ke.find(Ve=>Ve===U):U===A._f.ref)return;je(o,$,{_f:{...A._f,...se?{refs:[...Ke.filter(_f),U,...Array.isArray(Q(i,$))?[{}]:[]],ref:{type:U.type,name:$}}:{ref:U}}}),C($,!1,void 0,U)}else A=Q(o,$,{}),A._f&&(A._f.mount=!1),(n.shouldUnregister||N.shouldUnregister)&&!(Zb(l.array,$)&&a.action)&&l.unMount.add($)}}},$e=()=>n.shouldFocusError&&$c(o,$=>$&&Q(r.errors,$),l.mount),Re=($,N)=>async A=>{A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let ee=Nt(s);if(p.state.next({isSubmitting:!0}),n.resolver){const{errors:Z,values:U}=await O();r.errors=Z,ee=U}else await V(o);wt(r.errors,"root"),nn(r.errors)?(p.state.next({errors:{}}),await $(ee,A)):(N&&await N({...r.errors},A),$e(),setTimeout($e)),p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nn(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Ne=($,N={})=>{Q(o,$)&&(qe(N.defaultValue)?L($,Q(i,$)):(L($,N.defaultValue),je(i,$,N.defaultValue)),N.keepTouched||wt(r.touchedFields,$),N.keepDirty||(wt(r.dirtyFields,$),r.isDirty=N.defaultValue?B($,Q(i,$)):B()),N.keepError||(wt(r.errors,$),f.isValid&&h()),p.state.next({...r}))},Oe=($,N={})=>{const A=$?Nt($):i,ee=Nt(A),Z=$&&!nn($)?ee:i;if(N.keepDefaultValues||(i=A),!N.keepValues){if(N.keepDirtyValues||y)for(const U of l.mount)Q(r.dirtyFields,U)?je(Z,U,Q(s,U)):L(U,Q(Z,U));else{if(Om&&qe($))for(const U of l.mount){const se=Q(o,U);if(se&&se._f){const Ke=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(Rc(Ke)){const Ve=Ke.closest("form");if(Ve){Ve.reset();break}}}}o={}}s=e.shouldUnregister?N.keepDefaultValues?Nt(i):{}:Nt(Z),p.array.next({values:{...Z}}),p.values.next({values:{...Z}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&t(),a.mount=!f.isValid||!!N.keepIsValid,a.watch=!!e.shouldUnregister,p.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Qo($,i)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:N.keepDirtyValues?r.dirtyFields:N.keepDefaultValues&&$?Ef(i,$):{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Xe=($,N)=>Oe(co($)?$(s):$,N);return{control:{register:Me,unregister:ze,getFieldState:ve,handleSubmit:Re,setError:Ie,_executeSchema:O,_getWatch:M,_getDirty:B,_updateValid:h,_removeUnmounted:D,_updateFieldArray:x,_updateDisabledField:ue,_getFieldArray:F,_reset:Oe,_resetDefaultValues:()=>co(n.defaultValues)&&n.defaultValues().then($=>{Xe($,n.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:$=>{r={...r,...$}},_subjects:p,_proxyFormState:f,get _fields(){return o},get _formValues(){return s},get _state(){return a},set _state($){a=$},get _defaultValues(){return i},get _names(){return l},set _names($){l=$},get _formState(){return r},set _formState($){r=$},get _options(){return n},set _options($){n={...n,...$}}},trigger:re,register:Me,handleSubmit:Re,watch:ht,setValue:L,getValues:he,reset:Xe,resetField:Ne,clearErrors:Ue,unregister:ze,setError:Ie,setFocus:($,N={})=>{const A=Q(o,$),ee=A&&A._f;if(ee){const Z=ee.refs?ee.refs[0]:ee.ref;Z.focus&&(Z.focus(),N.shouldSelect&&Z.select())}},getFieldState:ve}}function pd(e={}){const t=de.useRef(),n=de.useRef(),[r,o]=de.useState({isDirty:!1,isValidating:!1,isLoading:co(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:co(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...n2(e,()=>o(s=>({...s}))),formState:r});const i=t.current.control;return i._options=e,hd({subject:i._subjects.state,next:s=>{Yb(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),de.useEffect(()=>{e.values&&!Qo(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values):i._resetDefaultValues()},[e.values,i]),de.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Qb(r,i),t.current}var ay=function(e,t,n){if(e&&"reportValidity"in e){var r=Q(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},a1=function(e,t){var n=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?ay(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return ay(s,o,e)})};for(var r in t.fields)n(r)},r2=function(e,t){t.shouldUseNativeValidation&&a1(e,t);var n={};for(var r in e){var o=Q(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(i2(t.names||Object.keys(e),r)){var s=Object.assign({},o2(Q(n,r)));je(s,"root",i),je(n,r,s)}else je(n,r,i)}return n},o2=function(e){return Array.isArray(e)?e.filter(Boolean):[]},i2=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},s2=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=n[s].types,u=l&&l[r.code];n[s]=Jb(s,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n},md=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return i.shouldUseNativeValidation&&a1({},i),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(s){if(function(a){return a.errors!=null}(s))return{values:{},errors:r2(s2(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}};const a2=c.forwardRef((e,t)=>c.createElement(ke.label,ne({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),l1=a2,l2=Nl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Yi=c.forwardRef(({className:e,...t},n)=>S.jsx(l1,{ref:n,className:le(l2(),e),...t}));Yi.displayName=l1.displayName;const vd=zO,u1=c.createContext({}),fo=({...e})=>S.jsx(u1.Provider,{value:{name:e.name},children:S.jsx(HO,{...e})}),gd=()=>{const e=c.useContext(u1),t=c.useContext(c1),{getFieldState:n,formState:r}=Ll(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},c1=c.createContext({}),nr=c.forwardRef(({className:e,...t},n)=>{const r=c.useId();return S.jsx(c1.Provider,{value:{id:r},children:S.jsx("div",{ref:n,className:le("space-y-2",e),...t})})});nr.displayName="FormItem";const rr=c.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=gd();return S.jsx(Yi,{ref:n,className:le(r&&"text-destructive",e),htmlFor:o,...t})});rr.displayName="FormLabel";const br=c.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=gd();return S.jsx(Eo,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});br.displayName="FormControl";const ho=c.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=gd();return S.jsx("p",{ref:n,id:r,className:le("text-sm text-muted-foreground",e),...t})});ho.displayName="FormDescription";const Sr=c.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=gd(),s=o?String(o==null?void 0:o.message):t;return s?S.jsx("p",{ref:r,id:i,className:le("text-sm font-medium text-destructive",e),...n,children:s}):null});Sr.displayName="FormMessage";const u2=Yy["useId".toString()]||(()=>{});let c2=0;function os(e){const[t,n]=c.useState(u2());return Jt(()=>{e||n(r=>r??String(c2++))},[e]),e||(t?`radix-${t}`:"")}const kf="focusScope.autoFocusOnMount",Tf="focusScope.autoFocusOnUnmount",ly={bubbles:!1,cancelable:!0},d1=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=Vt(o),d=Vt(i),f=c.useRef(null),p=it(t,g=>l(g)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let h=function(C){if(y.paused||!a)return;const E=C.target;a.contains(E)?f.current=E:Kr(f.current,{select:!0})},w=function(C){if(y.paused||!a)return;const E=C.relatedTarget;E!==null&&(a.contains(E)||Kr(f.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&Kr(a)};var g=h,b=w,m=x;document.addEventListener("focusin",h),document.addEventListener("focusout",w);const _=new MutationObserver(x);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){cy.add(y);const g=document.activeElement;if(!a.contains(g)){const m=new CustomEvent(kf,ly);a.addEventListener(kf,u),a.dispatchEvent(m),m.defaultPrevented||(d2(v2(f1(a)),{select:!0}),document.activeElement===g&&Kr(a))}return()=>{a.removeEventListener(kf,u),setTimeout(()=>{const m=new CustomEvent(Tf,ly);a.addEventListener(Tf,d),a.dispatchEvent(m),m.defaultPrevented||Kr(g??document.body,{select:!0}),a.removeEventListener(Tf,d),cy.remove(y)},0)}}},[a,u,d,y]);const v=c.useCallback(g=>{if(!n&&!r||y.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,m=document.activeElement;if(b&&m){const h=g.currentTarget,[w,x]=f2(h);w&&x?!g.shiftKey&&m===x?(g.preventDefault(),n&&Kr(w,{select:!0})):g.shiftKey&&m===w&&(g.preventDefault(),n&&Kr(x,{select:!0})):m===h&&g.preventDefault()}},[n,r,y.paused]);return c.createElement(ke.div,ne({tabIndex:-1},s,{ref:p,onKeyDown:v}))});function d2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Kr(r,{select:t}),document.activeElement!==n)return}function f2(e){const t=f1(e),n=uy(t,e),r=uy(t.reverse(),e);return[n,r]}function f1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function uy(e,t){for(const n of e)if(!h2(n,{upTo:t}))return n}function h2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function p2(e){return e instanceof HTMLInputElement&&"select"in e}function Kr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&p2(e)&&t&&e.select()}}const cy=m2();function m2(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dy(e,t),e.unshift(t)},remove(t){var n;e=dy(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function dy(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function v2(e){return e.filter(t=>t.tagName!=="A")}let $f=0;function h1(){c.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:fy()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:fy()),$f++,()=>{$f===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),$f--}},[])}function fy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var er=function(){return er=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return A2;var t=D2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},I2=g1(),j2=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(y2,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Iu,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(ju,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Iu," .").concat(Iu,` { - right: 0 `).concat(r,`; - } - - .`).concat(ju," .").concat(ju,` { - margin-right: 0 `).concat(r,`; - } - - body { - `).concat(w2,": ").concat(a,`px; - } -`)},L2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=c.useMemo(function(){return M2(o)},[o]);return c.createElement(I2,{styles:j2(i,!t,o,n?"":"!important")})},rp=!1;if(typeof window<"u")try{var fu=Object.defineProperty({},"passive",{get:function(){return rp=!0,!0}});window.addEventListener("test",fu,fu),window.removeEventListener("test",fu,fu)}catch{rp=!1}var Pi=rp?{passive:!1}:!1,F2=function(e){return e.tagName==="TEXTAREA"},y1=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!F2(e)&&n[t]==="visible")},U2=function(e){return y1(e,"overflowY")},z2=function(e){return y1(e,"overflowX")},py=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=w1(e,n);if(r){var o=x1(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},V2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},W2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},w1=function(e,t){return e==="v"?U2(t):z2(t)},x1=function(e,t){return e==="v"?V2(t):W2(t)},B2=function(e,t){return e==="h"&&t==="rtl"?-1:1},H2=function(e,t,n,r,o){var i=B2(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,f=0,p=0;do{var y=x1(e,a),v=y[0],g=y[1],b=y[2],m=g-b-i*v;(v||m)&&w1(e,a)&&(f+=m,p+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(o&&f===0||!o&&s>f)||!d&&(o&&p===0||!o&&-s>p))&&(u=!0),u},hu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},my=function(e){return[e.deltaX,e.deltaY]},vy=function(e){return e&&"current"in e?e.current:e},Z2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},K2=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Q2=0,Ni=[];function Y2(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Q2++)[0],i=c.useState(function(){return g1()})[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=g2([e.lockRef.current],(e.shards||[]).map(vy),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(g,b){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var m=hu(g),h=n.current,w="deltaX"in g?g.deltaX:h[0]-m[0],x="deltaY"in g?g.deltaY:h[1]-m[1],_,C=g.target,E=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in g&&E==="h"&&C.type==="range")return!1;var T=py(E,C);if(!T)return!0;if(T?_=E:(_=E==="v"?"h":"v",T=py(E,C)),!T)return!1;if(!r.current&&"changedTouches"in g&&(w||x)&&(r.current=_),!_)return!0;var O=r.current||_;return H2(O,b,g,O==="h"?w:x,!0)},[]),l=c.useCallback(function(g){var b=g;if(!(!Ni.length||Ni[Ni.length-1]!==i)){var m="deltaY"in b?my(b):hu(b),h=t.current.filter(function(_){return _.name===b.type&&_.target===b.target&&Z2(_.delta,m)})[0];if(h&&h.should){b.cancelable&&b.preventDefault();return}if(!h){var w=(s.current.shards||[]).map(vy).filter(Boolean).filter(function(_){return _.contains(b.target)}),x=w.length>0?a(b,w[0]):!s.current.noIsolation;x&&b.cancelable&&b.preventDefault()}}},[]),u=c.useCallback(function(g,b,m,h){var w={name:g,delta:b,target:m,should:h};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(x){return x!==w})},1)},[]),d=c.useCallback(function(g){n.current=hu(g),r.current=void 0},[]),f=c.useCallback(function(g){u(g.type,my(g),g.target,a(g,e.lockRef.current))},[]),p=c.useCallback(function(g){u(g.type,hu(g),g.target,a(g,e.lockRef.current))},[]);c.useEffect(function(){return Ni.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Pi),document.addEventListener("touchmove",l,Pi),document.addEventListener("touchstart",d,Pi),function(){Ni=Ni.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Pi),document.removeEventListener("touchmove",l,Pi),document.removeEventListener("touchstart",d,Pi)}},[]);var y=e.removeScrollBar,v=e.inert;return c.createElement(c.Fragment,null,v?c.createElement(i,{styles:K2(o)}):null,y?c.createElement(L2,{gapMode:"margin"}):null)}const q2=k2(v1,Y2);var b1=c.forwardRef(function(e,t){return c.createElement(yd,er({},e,{ref:t,sideCar:q2}))});b1.classNames=yd.classNames;const S1=b1;var G2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oi=new WeakMap,pu=new WeakMap,mu={},Nf=0,_1=function(e){return e&&(e.host||_1(e.parentNode))},X2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_1(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},J2=function(e,t,n,r){var o=X2(t,Array.isArray(e)?e:[e]);mu[n]||(mu[n]=new WeakMap);var i=mu[n],s=[],a=new Set,l=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else{var y=p.getAttribute(r),v=y!==null&&y!=="false",g=(Oi.get(p)||0)+1,b=(i.get(p)||0)+1;Oi.set(p,g),i.set(p,b),s.push(p),g===1&&v&&pu.set(p,!0),b===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}})};return d(t),a.clear(),Nf++,function(){s.forEach(function(f){var p=Oi.get(f)-1,y=i.get(f)-1;Oi.set(f,p),i.set(f,y),p||(pu.has(f)||f.removeAttribute(r),pu.delete(f)),y||f.removeAttribute(n)}),Nf--,Nf||(Oi=new WeakMap,Oi=new WeakMap,pu=new WeakMap,mu={})}},E1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||G2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),J2(r,o,n,"aria-hidden")):function(){return null}};const C1="Dialog",[k1,bM]=Ir(C1),[eA,cr]=k1(C1),tA=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=c.useRef(null),l=c.useRef(null),[u=!1,d]=Rs({prop:r,defaultProp:o,onChange:i});return c.createElement(eA,{scope:t,triggerRef:a,contentRef:l,contentId:os(),titleId:os(),descriptionId:os(),open:u,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(f=>!f),[d]),modal:s},n)},T1="DialogPortal",[nA,$1]=k1(T1,{forceMount:void 0}),rA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=cr(T1,t);return c.createElement(nA,{scope:t,forceMount:n},c.Children.map(r,s=>c.createElement(Us,{present:n||i.open},c.createElement(am,{asChild:!0,container:o},s))))},op="DialogOverlay",oA=c.forwardRef((e,t)=>{const n=$1(op,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=cr(op,e.__scopeDialog);return i.modal?c.createElement(Us,{present:r||i.open},c.createElement(iA,ne({},o,{ref:t}))):null}),iA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(op,n);return c.createElement(S1,{as:Eo,allowPinchZoom:!0,shards:[o.contentRef]},c.createElement(ke.div,ne({"data-state":P1(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),dl="DialogContent",sA=c.forwardRef((e,t)=>{const n=$1(dl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=cr(dl,e.__scopeDialog);return c.createElement(Us,{present:r||i.open},i.modal?c.createElement(aA,ne({},o,{ref:t})):c.createElement(lA,ne({},o,{ref:t})))}),aA=c.forwardRef((e,t)=>{const n=cr(dl,e.__scopeDialog),r=c.useRef(null),o=it(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return E1(i)},[]),c.createElement(R1,ne({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault())}))}),lA=c.forwardRef((e,t)=>{const n=cr(dl,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return c.createElement(R1,ne({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),R1=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=cr(dl,n),l=c.useRef(null),u=it(t,l);return h1(),c.createElement(c.Fragment,null,c.createElement(d1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},c.createElement(sm,ne({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":P1(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),uA="DialogTitle",cA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(uA,n);return c.createElement(ke.h2,ne({id:o.titleId},r,{ref:t}))}),dA="DialogDescription",fA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(dA,n);return c.createElement(ke.p,ne({id:o.descriptionId},r,{ref:t}))}),hA="DialogClose",pA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(hA,n);return c.createElement(ke.button,ne({type:"button"},r,{ref:t,onClick:Ee(e.onClick,()=>o.onOpenChange(!1))}))});function P1(e){return e?"open":"closed"}const mA=tA,vA=rA,N1=oA,O1=sA,A1=cA,D1=fA,gA=pA,M1=mA,yA=vA,I1=c.forwardRef(({className:e,...t},n)=>S.jsx(N1,{ref:n,className:le("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));I1.displayName=N1.displayName;const Im=c.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(yA,{children:[S.jsx(I1,{}),S.jsxs(O1,{ref:r,className:le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...n,children:[t,S.jsxs(gA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[S.jsx(_x,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Im.displayName=O1.displayName;const jm=({className:e,...t})=>S.jsx("div",{className:le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});jm.displayName="DialogHeader";const j1=({className:e,...t})=>S.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});j1.displayName="DialogFooter";const Lm=c.forwardRef(({className:e,...t},n)=>S.jsx(A1,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",e),...t}));Lm.displayName=A1.displayName;const Fm=c.forwardRef(({className:e,...t},n)=>S.jsx(D1,{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Fm.displayName=D1.displayName;const wA=(e,t)=>pm({queryKey:[e,"agents","entry",t,"memory"],queryFn:async()=>await fetch(Ws+`/agents/memory?agent_id=${t}&user_id=${e}`).then(n=>n.json()),enabled:!!e&&!!t}),Ac=c.forwardRef(({className:e,...t},n)=>S.jsx("textarea",{className:le("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ac.displayName="Textarea";const xA=ha.object({persona:ha.string(),human:ha.string(),user_id:ha.string(),agent_id:ha.string()}),bA=e=>{const t=od();return Hx({mutationFn:async n=>await fetch(Ws+`/agents/memory?${e}`,{method:"POST",headers:{"Content-Type":" application/json"},body:JSON.stringify(n)}).then(r=>r.json()),onSuccess:(n,{agent_id:r})=>t.invalidateQueries({queryKey:[e,"agents","entry",r,"memory"]})})};function SA({className:e,data:t,agentId:n}){var a,l;const r=jo(),o=bA(r.uuid),i=pd({resolver:md(xA),defaultValues:{persona:(a=t==null?void 0:t.core_memory)==null?void 0:a.persona,human:(l=t==null?void 0:t.core_memory)==null?void 0:l.human,user_id:r.uuid??void 0,agent_id:n}});function s(u){o.mutate(u)}return S.jsx(vd,{...i,children:S.jsxs("form",{onSubmit:i.handleSubmit(s),className:le("flex flex-col gap-8",e),children:[S.jsx(fo,{control:i.control,name:"persona",render:({field:u})=>S.jsxs(nr,{children:[S.jsx(rr,{children:"Persona"}),S.jsx(br,{children:S.jsx(Ac,{className:"min-h-[20rem] resize-none",...u})}),S.jsx(ho,{children:"This is the agents core memory. It is immediately available without querying any other resources."}),S.jsx(Sr,{})]})}),S.jsx(fo,{control:i.control,name:"human",render:({field:u})=>S.jsxs(nr,{children:[S.jsx(rr,{children:"Human"}),S.jsx(br,{children:S.jsx(Ac,{className:"min-h-[20rem] resize-none",...u})}),S.jsx(ho,{children:"This is what the agent knows about you so far!"}),S.jsx(Sr,{})]})}),S.jsxs("div",{className:"mt-4 flex items-center justify-end",children:[o.isPending&&S.jsxs("span",{className:gi("mr-6 flex items-center animate-in slide-in-from-bottom"),children:[S.jsx(Sx,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving Memory..."]}),o.isSuccess&&S.jsxs("span",{className:gi("mr-6 flex items-center text-emerald-600 animate-in slide-in-from-bottom"),children:[S.jsx(GC,{className:"mr-2 h-4 w-4"}),"New Memory Saved"]}),S.jsx(Ut,{type:"submit",disabled:o.isPending,children:"Save Memory"})]})]})})}const _A=({open:e,onOpenChange:t})=>{const n=jo(),r=Ml(),{data:o,isLoading:i}=wA(n.uuid,r==null?void 0:r.id);return S.jsx(M1,{open:e,onOpenChange:t,children:S.jsxs(Im,{className:"sm:max-w-2xl",children:[S.jsxs(jm,{children:[S.jsx(Lm,{children:"Edit Memory"}),S.jsx(Fm,{children:"This is your agents current memory. Make changes and click save to edit it."})]}),i||!o||!r?S.jsx("p",{children:"loading.."}):S.jsx(SA,{className:"max-h-[80vh] overflow-auto px-1 py-4",data:o,agentId:r.id})]})})},EA=jn({message:Qt().min(1,"Message cannot be empty...")}),CA=e=>{const[t,n]=c.useState(!1),r=pd({resolver:md(EA),defaultValues:{message:""}});function o(i){e.onSend(i.message),r.reset()}return S.jsxs(vd,{...r,children:[S.jsxs("form",{onSubmit:r.handleSubmit(o),className:"mb-8 mt-4 flex items-start justify-between gap-2",children:[S.jsx(fo,{control:r.control,name:"message",render:({field:i})=>S.jsxs(nr,{className:"w-full",children:[S.jsx(rr,{children:"What's on your mind"}),S.jsx(br,{className:"w-full",children:S.jsx(xr,{className:"w-full",placeholder:"Type something...",...i})}),S.jsx(Sr,{})]})}),S.jsxs("div",{className:"mt-8 flex gap-2",children:[S.jsx(Ut,{disabled:!e.enabled,type:"submit",children:"Send"}),S.jsx(Ut,{onClick:()=>n(!0),className:"ml-1",type:"button",size:"icon",variant:"outline",children:S.jsx(qC,{className:"h-4 w-4"})})]})]}),S.jsx(_A,{open:t,onOpenChange:i=>n(i)})]})},kA=()=>{const e=c.useRef(!1),t=jo(),n=Ml(),r=TR(),o=aN((n==null?void 0:n.id)??""),i=hO(),{sendMessage:s}=Pb(),{addMessage:a}=xb(),{setLastAgentInitMessage:l}=cd(),u=c.useCallback((d,f="user")=>{if(!n||!t.uuid)return;const p=new Date;s({userId:t.uuid,agentId:n.id,message:d,role:f}),a(n.id,{type:f==="user"?"user_message":"system_message",message_type:"user_message",message:d,date:p})},[n,t.uuid,s,a]);return c.useEffect(()=>(e.current||(e.current=!0,setTimeout(()=>{if(!n)return null;(o.length===0||(r==null?void 0:r.agentId)!==n.id)&&(l({date:new Date,agentId:n.id}),u("The user is back! Lets pick up the conversation! Reflect on the previous conversation and use your function calling to send him a friendly message.","system"))},300)),()=>{e.current=!0}),[n,r==null?void 0:r.agentId,o.length,u,l]),S.jsxs("div",{className:"mx-auto max-w-screen-xl p-4",children:[S.jsx(LO,{currentAgent:n,readyState:i,previousMessages:[],messages:o}),S.jsx(CA,{enabled:i!==Sm.LOADING,onSend:u})]})},TA={path:"chat",element:S.jsx(kA,{})};function $A({className:e,...t}){return S.jsx("div",{className:le("animate-pulse rounded-md bg-muted",e),...t})}function RA(e,t,n){var r=this,o=c.useRef(null),i=c.useRef(0),s=c.useRef(null),a=c.useRef([]),l=c.useRef(),u=c.useRef(),d=c.useRef(e),f=c.useRef(!0);d.current=e;var p=typeof window<"u",y=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,g=!("trailing"in n)||!!n.trailing,b="maxWait"in n,m="debounceOnServer"in n&&!!n.debounceOnServer,h=b?Math.max(+n.maxWait||0,t):null;c.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var w=c.useMemo(function(){var x=function(I){var V=a.current,D=l.current;return a.current=l.current=null,i.current=I,u.current=d.current.apply(D,V)},_=function(I,V){y&&cancelAnimationFrame(s.current),s.current=y?requestAnimationFrame(I):setTimeout(I,V)},C=function(I){if(!f.current)return!1;var V=I-o.current;return!o.current||V>=t||V<0||b&&I-i.current>=h},E=function(I){return s.current=null,g&&a.current?x(I):(a.current=l.current=null,u.current)},T=function I(){var V=Date.now();if(C(V))return E(V);if(f.current){var D=t-(V-o.current),B=b?Math.min(D,h-(V-i.current)):D;_(I,B)}},O=function(){if(p||m){var I=Date.now(),V=C(I);if(a.current=[].slice.call(arguments),l.current=r,o.current=I,V){if(!s.current&&f.current)return i.current=o.current,_(T,t),v?x(o.current):u.current;if(b)return _(T,t),x(o.current)}return s.current||_(T,t),u.current}};return O.cancel=function(){s.current&&(y?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,a.current=o.current=l.current=s.current=null},O.isPending=function(){return!!s.current},O.flush=function(){return s.current?E(Date.now()):u.current},O},[v,b,t,h,g,y,p,m]);return w}function PA(e,t){return e===t}function NA(e,t){return t}function OA(e,t,n){var r=n&&n.equalityFn||PA,o=c.useReducer(NA,e),i=o[0],s=o[1],a=RA(c.useCallback(function(u){return s(u)},[s]),t,n),l=c.useRef(e);return r(l.current,e)||(a(e),l.current=e),[i,a]}const AA=({name:e,persona:t,human:n,created_at:r,className:o,onBtnClick:i,isCurrentAgent:s})=>S.jsxs(km,{className:o,children:[S.jsxs(Tm,{children:[S.jsxs($m,{className:"flex items-center justify-between",children:[S.jsx("span",{children:e}),s&&S.jsx(Ob,{className:"whitespace-nowrap",children:"Current Agent"})]}),S.jsx(Rm,{children:t})]}),S.jsx(Pm,{children:S.jsx(Ut,{variant:"secondary",onClick:i,asChild:!0,children:S.jsx(Ki,{to:"/chat",children:"Start Chat"})})})]}),DA=e=>{const t=od();return Hx({mutationFn:async n=>await fetch(Ws+"/agents",{method:"POST",headers:{"Content-Type":" application/json"},body:JSON.stringify({config:n,user_id:e})}).then(r=>r.json()),onSuccess:()=>t.invalidateQueries({queryKey:[e,"agents","list"]})})},MA=e=>{const t=jo(),n=DA(t.uuid);return S.jsx(M1,{open:e.open,onOpenChange:e.onOpenChange,children:S.jsx(Im,{className:"sm:max-w-[425px]",children:S.jsxs("form",{onSubmit:r=>{if(r.preventDefault(),!t.uuid)return;const o=new FormData(r.currentTarget);n.mutate({name:`${o.get("name")}`,human:`${o.get("human")}`,persona:`${o.get("persona")}`,model:`${o.get("model")}`},{onSuccess:()=>e.onOpenChange(!1)})},children:[S.jsxs(jm,{children:[S.jsx(Lm,{children:"Create Agent"}),S.jsx(Fm,{children:"Add a new agent here. Click create when you're done."})]}),S.jsxs("div",{className:"grid gap-4 py-4",children:[S.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[S.jsx(Yi,{htmlFor:"name",className:"text-right",children:"Name"}),S.jsx(xr,{id:"name",name:"name",defaultValue:"James Bond",className:"col-span-3"})]}),S.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[S.jsx(Yi,{htmlFor:"human",className:"text-right",children:"Human"}),S.jsx(xr,{id:"human",name:"human",defaultValue:"cs_phd",className:"col-span-3"})]}),S.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[S.jsx(Yi,{htmlFor:"persona",className:"text-right",children:"Persona"}),S.jsx(xr,{id:"persona",name:"persona",defaultValue:"sam_pov",className:"col-span-3"})]}),S.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[S.jsx(Yi,{htmlFor:"model",className:"text-right",children:"Model"}),S.jsx(xr,{id:"model",name:"model",defaultValue:"gpt-4",className:"col-span-3"})]})]}),S.jsx(j1,{children:S.jsxs(Ut,{type:"submit",disabled:n.isPending,children:[n.isPending?S.jsx(Sx,{className:"mr-2 h-4 w-4 animate-spin"}):void 0,n.isPending?"Creating Agent":"Create Agent"]})})]})})})},IA=()=>{const{uuid:e}=jo(),{data:t,isSuccess:n,isLoading:r}=Nm(e),{setAgent:o}=cd(),i=Ml(),[s,a]=c.useState(!1),[l,u]=c.useState(""),[d]=OA(l,300),f=((t==null?void 0:t.agents)??[]).filter(v=>v.name.includes(d)),p=r?[1,2,3,4,5,6,7,8].map((v,g)=>S.jsx($A,{className:"h-52 w-full flex-none opacity-30 sm:w-96"},g)):f.map(v=>S.jsx(AA,{className:"flex h-52 w-full flex-none flex-col justify-between shadow-md sm:w-96",name:v.name,human:v.human,persona:v.persona,created_at:v.created_at,onBtnClick:()=>o(v),isCurrentAgent:!!i&&(i==null?void 0:i.id)===v.id},v.name)),y=c.useRef(null);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex h-full flex-col items-center overflow-y-scroll",children:[S.jsxs("div",{className:"p-2 pt-40 pb-12",children:[S.jsx("h1",{className:yO(),children:"Welcome to MemGPT"}),S.jsx("p",{className:SO("mt-2 mb-4"),children:"Select or create an agent to start your conversation..."})]}),S.jsxs("div",{className:"mx-auto mb-12 flex w-full max-w-screen-lg justify-between",children:[S.jsxs("div",{className:"relative",children:[S.jsx(xr,{value:l,onChange:v=>u(v.target.value),ref:y,placeholder:"Search for Agent",className:"w-full pl-12 sm:w-80"}),S.jsx(rk,{onClick:()=>{var v;return(v=y.current)==null?void 0:v.focus()},className:"absolute top-1/2 left-3 z-0 h-5 w-5 -translate-y-1/2"})]}),S.jsxs(Ut,{onClick:()=>a(!0),children:[S.jsx(nk,{className:"h-5 w-5"}),S.jsx("span",{className:"ml-2",children:"Add New"})]})]}),S.jsxs("div",{className:"mx-auto flex w-full max-w-screen-2xl flex-wrap gap-12 px-8 pb-20",children:[p,n&&(t==null?void 0:t.num_agents)===0?S.jsxs("div",{className:"flex w-full flex-col items-center justify-center p-20",children:[S.jsx("h3",{className:wO(),children:"No Agents exist"}),S.jsx("p",{className:gi("mt-4"),children:"Create your first agent and start chatting by clicking the Add New button."})]}):void 0]})]}),S.jsx(MA,{open:s,onOpenChange:v=>a(v)})]})},jA=c.createContext(void 0);function Um(e){const t=c.useContext(jA);return e||t||"ltr"}const Of="rovingFocusGroup.onEntryFocus",LA={bubbles:!1,cancelable:!0},zm="RovingFocusGroup",[ip,L1,FA]=im(zm),[UA,F1]=Ir(zm,[FA]),[zA,VA]=UA(zm),WA=c.forwardRef((e,t)=>c.createElement(ip.Provider,{scope:e.__scopeRovingFocusGroup},c.createElement(ip.Slot,{scope:e.__scopeRovingFocusGroup},c.createElement(BA,ne({},e,{ref:t}))))),BA=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,f=c.useRef(null),p=it(t,f),y=Um(i),[v=null,g]=Rs({prop:s,defaultProp:a,onChange:l}),[b,m]=c.useState(!1),h=Vt(u),w=L1(n),x=c.useRef(!1),[_,C]=c.useState(0);return c.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Of,h),()=>E.removeEventListener(Of,h)},[h]),c.createElement(zA,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:c.useCallback(E=>g(E),[g]),onItemShiftTab:c.useCallback(()=>m(!0),[]),onFocusableItemAdd:c.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:c.useCallback(()=>C(E=>E-1),[])},c.createElement(ke.div,ne({tabIndex:b||_===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{x.current=!0}),onFocus:Ee(e.onFocus,E=>{const T=!x.current;if(E.target===E.currentTarget&&T&&!b){const O=new CustomEvent(Of,LA);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const I=w().filter(F=>F.focusable),V=I.find(F=>F.active),D=I.find(F=>F.id===v),M=[V,D,...I].filter(Boolean).map(F=>F.ref.current);U1(M)}}x.current=!1}),onBlur:Ee(e.onBlur,()=>m(!1))})))}),HA="RovingFocusGroupItem",ZA=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=os(),l=i||a,u=VA(HA,n),d=u.currentTabStopId===l,f=L1(n),{onFocusableItemAdd:p,onFocusableItemRemove:y}=u;return c.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),c.createElement(ip.ItemSlot,{scope:n,id:l,focusable:r,active:o},c.createElement(ke.span,ne({tabIndex:d?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:Ee(e.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:Ee(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ee(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const g=YA(v,u.orientation,u.dir);if(g!==void 0){v.preventDefault();let m=f().filter(h=>h.focusable).map(h=>h.ref.current);if(g==="last")m.reverse();else if(g==="prev"||g==="next"){g==="prev"&&m.reverse();const h=m.indexOf(v.currentTarget);m=u.loop?qA(m,h+1):m.slice(h+1)}setTimeout(()=>U1(m))}})})))}),KA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function QA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YA(e,t,n){const r=QA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return KA[r]}function U1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const GA=WA,XA=ZA;function z1(e){const[t,n]=c.useState(void 0);return Jt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function V1(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const W1="Radio",[JA,B1]=Ir(W1),[eD,tD]=JA(W1),nD=c.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...u}=e,[d,f]=c.useState(null),p=it(t,g=>f(g)),y=c.useRef(!1),v=d?!!d.closest("form"):!0;return c.createElement(eD,{scope:n,checked:o,disabled:s},c.createElement(ke.button,ne({type:"button",role:"radio","aria-checked":o,"data-state":H1(o),"data-disabled":s?"":void 0,disabled:s,value:a},u,{ref:p,onClick:Ee(e.onClick,g=>{o||l==null||l(),v&&(y.current=g.isPropagationStopped(),y.current||g.stopPropagation())})})),v&&c.createElement(iD,{control:d,bubbles:!y.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),rD="RadioIndicator",oD=c.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=tD(rD,n);return c.createElement(Us,{present:r||i.checked},c.createElement(ke.span,ne({"data-state":H1(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),iD=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=c.useRef(null),s=V1(n),a=z1(t);return c.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),c.createElement("input",ne({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function H1(e){return e?"checked":"unchecked"}const sD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Z1="RadioGroup",[aD,SM]=Ir(Z1,[F1,B1]),K1=F1(),Q1=B1(),[lD,uD]=aD(Z1),cD=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,y=K1(n),v=Um(u),[g,b]=Rs({prop:i,defaultProp:o,onChange:f});return c.createElement(lD,{scope:n,name:r,required:s,disabled:a,value:g,onValueChange:b},c.createElement(GA,ne({asChild:!0},y,{orientation:l,dir:v,loop:d}),c.createElement(ke.div,ne({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},p,{ref:t}))))}),dD="RadioGroupItem",fD=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=uD(dD,n),s=i.disabled||r,a=K1(n),l=Q1(n),u=c.useRef(null),d=it(t,u),f=i.value===o.value,p=c.useRef(!1);return c.useEffect(()=>{const y=g=>{sD.includes(g.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",v)}},[]),c.createElement(XA,ne({asChild:!0},a,{focusable:!s,active:f}),c.createElement(nD,ne({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:Ee(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:Ee(o.onFocus,()=>{var y;p.current&&((y=u.current)===null||y===void 0||y.click())})})))}),hD=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Q1(n);return c.createElement(oD,ne({},o,r,{ref:t}))}),Y1=cD,q1=fD,pD=hD,G1=c.forwardRef(({className:e,...t},n)=>S.jsx(Y1,{className:le("grid gap-2",e),...t,ref:n}));G1.displayName=Y1.displayName;const X1=c.forwardRef(({className:e,children:t,...n},r)=>S.jsx(q1,{ref:r,className:le("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:S.jsx(pD,{className:"flex items-center justify-center",children:S.jsx(ek,{className:"h-2.5 w-2.5 fill-current text-current"})})}));X1.displayName=q1.displayName;const sp="horizontal",mD=["horizontal","vertical"],J1=c.forwardRef((e,t)=>{const{decorative:n,orientation:r=sp,...o}=e,i=eS(r)?r:sp,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.createElement(ke.div,ne({"data-orientation":i},a,o,{ref:t}))});J1.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!eS(r)?new Error(vD(o,n)):null}};function vD(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of: - - horizontal - - vertical - -Defaulting to \`${sp}\`.`}function eS(e){return mD.includes(e)}const tS=J1,Vm=c.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>S.jsx(tS,{ref:o,decorative:n,orientation:t,className:le("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Vm.displayName=tS.displayName;const nS=({children:e,title:t,description:n})=>S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{children:[S.jsx("h3",{className:"text-lg font-medium",children:t}),S.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),S.jsx(Vm,{}),e]}),gD=jn({currentAgentId:Qt({required_error:"Please select an agent."})}),yD=e=>({currentAgentId:e??""});function wD(){const e=jo(),{data:t,isLoading:n}=Nm(e.uuid),r=Ml(),{setAgent:o}=cd(),i=pd({resolver:md(gD),defaultValues:yD(r==null?void 0:r.id)});function s(a){const l=((t==null?void 0:t.agents)??[]).find(u=>u.id===a.currentAgentId);l&&(o(l),dm({title:"Agent updated successfully!",description:"You can now continue your conversation with them!"}))}return S.jsx(nS,{title:"Agents",description:"Manage the agents you chat with...",children:S.jsx(vd,{...i,children:S.jsxs("form",{onSubmit:i.handleSubmit(s),className:"space-y-8",children:[S.jsx(fo,{control:i.control,name:"currentAgentId",render:({field:a})=>{var l;return S.jsxs(nr,{className:"space-y-1",children:[S.jsx(rr,{children:"Current Agent"}),S.jsx(ho,{children:"Agent you are currently chatting with..."}),S.jsx(Sr,{}),S.jsx(G1,{onValueChange:a.onChange,defaultValue:a.value,className:"flex flex-wrap gap-8 pt-2",children:(l=t==null?void 0:t.agents)==null?void 0:l.map((u,d)=>S.jsx(nr,{children:S.jsxs(rr,{className:"[&:has([data-state=checked])>div]:border-primary",children:[S.jsx(br,{children:S.jsx(X1,{value:u.id,className:"sr-only"})}),S.jsx("div",{className:"items-center rounded-md border-2 border-muted p-1 hover:border-accent",children:S.jsxs("div",{className:"space-y-2 rounded-sm bg-[#ecedef] p-2",children:[S.jsxs("div",{className:"space-y-2 rounded-md bg-white p-2 shadow-sm",children:[S.jsx("div",{className:"h-2 w-[80px] rounded-lg bg-[#ecedef]"}),S.jsx("div",{className:"h-2 w-[100px] rounded-lg bg-[#ecedef]"})]}),S.jsxs("div",{className:"flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm",children:[S.jsx("div",{className:"h-4 w-4 rounded-full bg-[#ecedef]"}),S.jsx("div",{className:"h-2 w-[100px] rounded-lg bg-[#ecedef]"})]}),S.jsxs("div",{className:"flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm",children:[S.jsx("div",{className:"h-4 w-4 rounded-full bg-[#ecedef]"}),S.jsx("div",{className:"h-2 w-[100px] rounded-lg bg-[#ecedef]"})]})]})}),S.jsx("span",{className:"block w-full p-2 text-center font-normal",children:u.name})]})},d))})]})}}),S.jsx(Ut,{type:"submit",children:"Update agent"})]})})})}function gy(e,[t,n]){return Math.min(n,Math.max(t,e))}const xD=["top","right","bottom","left"],Po=Math.min,rn=Math.max,Dc=Math.round,vu=Math.floor,No=e=>({x:e,y:e}),bD={left:"right",right:"left",bottom:"top",top:"bottom"},SD={start:"end",end:"start"};function ap(e,t,n){return rn(e,Po(t,n))}function Nr(e,t){return typeof e=="function"?e(t):e}function Or(e){return e.split("-")[0]}function Hs(e){return e.split("-")[1]}function Wm(e){return e==="x"?"y":"x"}function Bm(e){return e==="y"?"height":"width"}function Zs(e){return["top","bottom"].includes(Or(e))?"y":"x"}function Hm(e){return Wm(Zs(e))}function _D(e,t,n){n===void 0&&(n=!1);const r=Hs(e),o=Hm(e),i=Bm(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Mc(s)),[s,Mc(s)]}function ED(e){const t=Mc(e);return[lp(e),t,lp(t)]}function lp(e){return e.replace(/start|end/g,t=>SD[t])}function CD(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function kD(e,t,n,r){const o=Hs(e);let i=CD(Or(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(lp)))),i}function Mc(e){return e.replace(/left|right|bottom|top/g,t=>bD[t])}function TD(e){return{top:0,right:0,bottom:0,left:0,...e}}function rS(e){return typeof e!="number"?TD(e):{top:e,right:e,bottom:e,left:e}}function Ic(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function yy(e,t,n){let{reference:r,floating:o}=e;const i=Zs(t),s=Hm(t),a=Bm(s),l=Or(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let y;switch(l){case"top":y={x:d,y:r.y-o.height};break;case"bottom":y={x:d,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:f};break;case"left":y={x:r.x-o.width,y:f};break;default:y={x:r.x,y:r.y}}switch(Hs(t)){case"start":y[s]-=p*(n&&u?-1:1);break;case"end":y[s]+=p*(n&&u?-1:1);break}return y}const $D=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yy(u,r,l),p=r,y={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=Nr(e,t)||{};if(u==null)return{};const f=rS(d),p={x:n,y:r},y=Hm(o),v=Bm(y),g=await s.getDimensions(u),b=y==="y",m=b?"top":"left",h=b?"bottom":"right",w=b?"clientHeight":"clientWidth",x=i.reference[v]+i.reference[y]-p[y]-i.floating[v],_=p[y]-i.reference[y],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let E=C?C[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(C)))&&(E=a.floating[w]||i.floating[v]);const T=x/2-_/2,O=E/2-g[v]/2-1,I=Po(f[m],O),V=Po(f[h],O),D=I,B=E-g[v]-V,M=E/2-g[v]/2+T,F=ap(D,M,B),H=!l.arrow&&Hs(o)!=null&&M!=F&&i.reference[v]/2-(MD<=0)){var O,I;const D=(((O=i.flip)==null?void 0:O.index)||0)+1,B=_[D];if(B)return{data:{index:D,overflows:T},reset:{placement:B}};let M=(I=T.filter(F=>F.overflows[0]<=0).sort((F,H)=>F.overflows[1]-H.overflows[1])[0])==null?void 0:I.placement;if(!M)switch(y){case"bestFit":{var V;const F=(V=T.map(H=>[H.placement,H.overflows.filter(oe=>oe>0).reduce((oe,L)=>oe+L,0)]).sort((H,oe)=>H[1]-oe[1])[0])==null?void 0:V[0];F&&(M=F);break}case"initialPlacement":M=a;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function xy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function by(e){return xD.some(t=>e[t]>=0)}const PD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Nr(e,t);switch(r){case"referenceHidden":{const i=await fl(t,{...o,elementContext:"reference"}),s=xy(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:by(s)}}}case"escaped":{const i=await fl(t,{...o,altBoundary:!0}),s=xy(i,n.floating);return{data:{escapedOffsets:s,escaped:by(s)}}}default:return{}}}}};async function ND(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Or(n),a=Hs(n),l=Zs(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,f=Nr(t,e);let{mainAxis:p,crossAxis:y,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(y=a==="end"?v*-1:v),l?{x:y*d,y:p*u}:{x:p*u,y:y*d}}const OD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await ND(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},AD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:b=>{let{x:m,y:h}=b;return{x:m,y:h}}},...l}=Nr(e,t),u={x:n,y:r},d=await fl(t,l),f=Zs(Or(o)),p=Wm(f);let y=u[p],v=u[f];if(i){const b=p==="y"?"top":"left",m=p==="y"?"bottom":"right",h=y+d[b],w=y-d[m];y=ap(h,y,w)}if(s){const b=f==="y"?"top":"left",m=f==="y"?"bottom":"right",h=v+d[b],w=v-d[m];v=ap(h,v,w)}const g=a.fn({...t,[p]:y,[f]:v});return{...g,data:{x:g.x-n,y:g.y-r}}}}},DD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Nr(e,t),d={x:n,y:r},f=Zs(o),p=Wm(f);let y=d[p],v=d[f];const g=Nr(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=p==="y"?"height":"width",x=i.reference[p]-i.floating[w]+b.mainAxis,_=i.reference[p]+i.reference[w]-b.mainAxis;y_&&(y=_)}if(u){var m,h;const w=p==="y"?"width":"height",x=["top","left"].includes(Or(o)),_=i.reference[f]-i.floating[w]+(x&&((m=s.offset)==null?void 0:m[f])||0)+(x?0:b.crossAxis),C=i.reference[f]+i.reference[w]+(x?0:((h=s.offset)==null?void 0:h[f])||0)-(x?b.crossAxis:0);v<_?v=_:v>C&&(v=C)}return{[p]:y,[f]:v}}}},MD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Nr(e,t),l=await fl(t,a),u=Or(n),d=Hs(n),f=Zs(n)==="y",{width:p,height:y}=r.floating;let v,g;u==="top"||u==="bottom"?(v=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=u,v=d==="end"?"top":"bottom");const b=y-l[v],m=p-l[g],h=!t.middlewareData.shift;let w=b,x=m;if(f){const C=p-l.left-l.right;x=d||h?Po(m,C):C}else{const C=y-l.top-l.bottom;w=d||h?Po(b,C):C}if(h&&!d){const C=rn(l.left,0),E=rn(l.right,0),T=rn(l.top,0),O=rn(l.bottom,0);f?x=p-2*(C!==0||E!==0?C+E:rn(l.left,l.right)):w=y-2*(T!==0||O!==0?T+O:rn(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:w});const _=await o.getDimensions(i.floating);return p!==_.width||y!==_.height?{reset:{rects:!0}}:{}}}};function Oo(e){return oS(e)?(e.nodeName||"").toLowerCase():"#document"}function ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lr(e){var t;return(t=(oS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oS(e){return e instanceof Node||e instanceof ln(e).Node}function Ar(e){return e instanceof Element||e instanceof ln(e).Element}function lr(e){return e instanceof HTMLElement||e instanceof ln(e).HTMLElement}function Sy(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ln(e).ShadowRoot}function Fl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ID(e){return["table","td","th"].includes(Oo(e))}function Zm(e){const t=Km(),n=$n(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function jD(e){let t=Ms(e);for(;lr(t)&&!wd(t);){if(Zm(t))return t;t=Ms(t)}return null}function Km(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wd(e){return["html","body","#document"].includes(Oo(e))}function $n(e){return ln(e).getComputedStyle(e)}function xd(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ms(e){if(Oo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sy(e)&&e.host||Lr(e);return Sy(t)?t.host:t}function iS(e){const t=Ms(e);return wd(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&Fl(t)?t:iS(t)}function hl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=iS(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ln(o);return i?t.concat(s,s.visualViewport||[],Fl(o)?o:[],s.frameElement&&n?hl(s.frameElement):[]):t.concat(o,hl(o,[],n))}function sS(e){const t=$n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lr(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Dc(n)!==i||Dc(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Qm(e){return Ar(e)?e:e.contextElement}function is(e){const t=Qm(e);if(!lr(t))return No(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=sS(t);let s=(i?Dc(n.width):n.width)/r,a=(i?Dc(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const LD=No(0);function aS(e){const t=ln(e);return!Km()||!t.visualViewport?LD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ln(e)?!1:t}function yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qm(e);let s=No(1);t&&(r?Ar(r)&&(s=is(r)):s=is(e));const a=FD(i,n,r)?aS(i):No(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const p=ln(i),y=r&&Ar(r)?ln(r):r;let v=p.frameElement;for(;v&&r&&y!==p;){const g=is(v),b=v.getBoundingClientRect(),m=$n(v),h=b.left+(v.clientLeft+parseFloat(m.paddingLeft))*g.x,w=b.top+(v.clientTop+parseFloat(m.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,f*=g.y,l+=h,u+=w,v=ln(v).frameElement}}return Ic({width:d,height:f,x:l,y:u})}function UD(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=lr(n),i=Lr(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=No(1);const l=No(0);if((o||!o&&r!=="fixed")&&((Oo(n)!=="body"||Fl(i))&&(s=xd(n)),lr(n))){const u=yi(n);a=is(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function zD(e){return Array.from(e.getClientRects())}function lS(e){return yi(Lr(e)).left+xd(e).scrollLeft}function VD(e){const t=Lr(e),n=xd(e),r=e.ownerDocument.body,o=rn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+lS(e);const a=-n.scrollTop;return $n(r).direction==="rtl"&&(s+=rn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function WD(e,t){const n=ln(e),r=Lr(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=Km();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function BD(e,t){const n=yi(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=lr(e)?is(e):No(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function _y(e,t,n){let r;if(t==="viewport")r=WD(e,n);else if(t==="document")r=VD(Lr(e));else if(Ar(t))r=BD(t,n);else{const o=aS(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Ic(r)}function uS(e,t){const n=Ms(e);return n===t||!Ar(n)||wd(n)?!1:$n(n).position==="fixed"||uS(n,t)}function HD(e,t){const n=t.get(e);if(n)return n;let r=hl(e,[],!1).filter(a=>Ar(a)&&Oo(a)!=="body"),o=null;const i=$n(e).position==="fixed";let s=i?Ms(e):e;for(;Ar(s)&&!wd(s);){const a=$n(s),l=Zm(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Fl(s)&&!l&&uS(e,s))?r=r.filter(d=>d!==s):o=a,s=Ms(s)}return t.set(e,r),r}function ZD(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?HD(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const f=_y(t,d,o);return u.top=rn(f.top,u.top),u.right=Po(f.right,u.right),u.bottom=Po(f.bottom,u.bottom),u.left=rn(f.left,u.left),u},_y(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function KD(e){return sS(e)}function QD(e,t,n){const r=lr(t),o=Lr(t),i=n==="fixed",s=yi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=No(0);if(r||!r&&!i)if((Oo(t)!=="body"||Fl(o))&&(a=xd(t)),r){const u=yi(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&(l.x=lS(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ey(e,t){return!lr(e)||$n(e).position==="fixed"?null:t?t(e):e.offsetParent}function cS(e,t){const n=ln(e);if(!lr(e))return n;let r=Ey(e,t);for(;r&&ID(r)&&$n(r).position==="static";)r=Ey(r,t);return r&&(Oo(r)==="html"||Oo(r)==="body"&&$n(r).position==="static"&&!Zm(r))?n:r||jD(e)||n}const YD=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||cS,i=this.getDimensions;return{reference:QD(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function qD(e){return $n(e).direction==="rtl"}const GD={convertOffsetParentRelativeRectToViewportRelativeRect:UD,getDocumentElement:Lr,getClippingRect:ZD,getOffsetParent:cS,getElementRects:YD,getClientRects:zD,getDimensions:KD,getScale:is,isElement:Ar,isRTL:qD};function XD(e,t){let n=null,r;const o=Lr(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const y=vu(d),v=vu(o.clientWidth-(u+f)),g=vu(o.clientHeight-(d+p)),b=vu(u),h={rootMargin:-y+"px "+-v+"px "+-g+"px "+-b+"px",threshold:rn(0,Po(1,l))||1};let w=!0;function x(_){const C=_[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(x,{...h,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,h)}n.observe(e)}return s(!0),i}function JD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Qm(e),d=o||i?[...u?hl(u):[],...hl(t)]:[];d.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const f=u&&a?XD(u,n):null;let p=-1,y=null;s&&(y=new ResizeObserver(m=>{let[h]=m;h&&h.target===u&&y&&(y.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),u&&!l&&y.observe(u),y.observe(t));let v,g=l?yi(e):null;l&&b();function b(){const m=yi(e);g&&(m.x!==g.x||m.y!==g.y||m.width!==g.width||m.height!==g.height)&&n(),g=m,v=requestAnimationFrame(b)}return n(),()=>{d.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),f&&f(),y&&y.disconnect(),y=null,l&&cancelAnimationFrame(v)}}const e4=(e,t,n)=>{const r=new Map,o={platform:GD,...n},i={...o.platform,_c:r};return $D(e,t,{...o,platform:i})},t4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?wy({element:r.current,padding:o}).fn(n):{}:r?wy({element:r,padding:o}).fn(n):{}}}};var Lu=typeof document<"u"?c.useLayoutEffect:c.useEffect;function jc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!jc(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!jc(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function dS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cy(e,t){const n=dS(e);return Math.round(t*n)/n}function ky(e){const t=c.useRef(e);return Lu(()=>{t.current=e}),t}function n4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=c.useState(r);jc(p,r)||y(r);const[v,g]=c.useState(null),[b,m]=c.useState(null),h=c.useCallback(H=>{H!=C.current&&(C.current=H,g(H))},[g]),w=c.useCallback(H=>{H!==E.current&&(E.current=H,m(H))},[m]),x=i||v,_=s||b,C=c.useRef(null),E=c.useRef(null),T=c.useRef(d),O=ky(l),I=ky(o),V=c.useCallback(()=>{if(!C.current||!E.current)return;const H={placement:t,strategy:n,middleware:p};I.current&&(H.platform=I.current),e4(C.current,E.current,H).then(oe=>{const L={...oe,isPositioned:!0};D.current&&!jc(T.current,L)&&(T.current=L,Mr.flushSync(()=>{f(L)}))})},[p,t,n,I]);Lu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[u]);const D=c.useRef(!1);Lu(()=>(D.current=!0,()=>{D.current=!1}),[]),Lu(()=>{if(x&&(C.current=x),_&&(E.current=_),x&&_){if(O.current)return O.current(x,_,V);V()}},[x,_,V,O]);const B=c.useMemo(()=>({reference:C,floating:E,setReference:h,setFloating:w}),[h,w]),M=c.useMemo(()=>({reference:x,floating:_}),[x,_]),F=c.useMemo(()=>{const H={position:n,left:0,top:0};if(!M.floating)return H;const oe=Cy(M.floating,d.x),L=Cy(M.floating,d.y);return a?{...H,transform:"translate("+oe+"px, "+L+"px)",...dS(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:L}},[n,a,M.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:V,refs:B,elements:M,floatingStyles:F}),[d,V,B,M,F])}const fS="Popper",[hS,pS]=Ir(fS),[r4,mS]=hS(fS),o4=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return c.createElement(r4,{scope:t,anchor:r,onAnchorChange:o},n)},i4="PopperAnchor",s4=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=mS(i4,n),s=c.useRef(null),a=it(t,s);return c.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:c.createElement(ke.div,ne({},o,{ref:a}))}),vS="PopperContent",[a4,_M]=hS(vS),l4=c.forwardRef((e,t)=>{var n,r,o,i,s,a,l,u;const{__scopePopper:d,side:f="bottom",sideOffset:p=0,align:y="center",alignOffset:v=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:w="partial",hideWhenDetached:x=!1,updatePositionStrategy:_="optimized",onPlaced:C,...E}=e,T=mS(vS,d),[O,I]=c.useState(null),V=it(t,hn=>I(hn)),[D,B]=c.useState(null),M=z1(D),F=(n=M==null?void 0:M.width)!==null&&n!==void 0?n:0,H=(r=M==null?void 0:M.height)!==null&&r!==void 0?r:0,oe=f+(y!=="center"?"-"+y:""),L=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},K=Array.isArray(m)?m:[m],re=K.length>0,he={padding:L,boundary:K.filter(u4),altBoundary:re},{refs:ve,floatingStyles:Ue,placement:Ie,isPositioned:ht,middlewareData:ze}=n4({strategy:"fixed",placement:oe,whileElementsMounted:(...hn)=>JD(...hn,{animationFrame:_==="always"}),elements:{reference:T.anchor},middleware:[OD({mainAxis:p+H,alignmentAxis:v}),b&&AD({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?DD():void 0,...he}),b&&RD({...he}),MD({...he,apply:({elements:hn,rects:dr,availableWidth:$,availableHeight:N})=>{const{width:A,height:ee}=dr.reference,Z=hn.floating.style;Z.setProperty("--radix-popper-available-width",`${$}px`),Z.setProperty("--radix-popper-available-height",`${N}px`),Z.setProperty("--radix-popper-anchor-width",`${A}px`),Z.setProperty("--radix-popper-anchor-height",`${ee}px`)}}),D&&t4({element:D,padding:g}),c4({arrowWidth:F,arrowHeight:H}),x&&PD({strategy:"referenceHidden",...he})]}),[ue,Me]=gS(Ie),$e=Vt(C);Jt(()=>{ht&&($e==null||$e())},[ht,$e]);const Re=(o=ze.arrow)===null||o===void 0?void 0:o.x,Ne=(i=ze.arrow)===null||i===void 0?void 0:i.y,Oe=((s=ze.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Xe,Tt]=c.useState();return Jt(()=>{O&&Tt(window.getComputedStyle(O).zIndex)},[O]),c.createElement("div",{ref:ve.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ue,transform:ht?Ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Xe,["--radix-popper-transform-origin"]:[(a=ze.transformOrigin)===null||a===void 0?void 0:a.x,(l=ze.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},c.createElement(a4,{scope:d,placedSide:ue,onArrowChange:B,arrowX:Re,arrowY:Ne,shouldHideArrow:Oe},c.createElement(ke.div,ne({"data-side":ue,"data-align":Me},E,{ref:V,style:{...E.style,animation:ht?void 0:"none",opacity:(u=ze.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function u4(e){return e!==null}const c4=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:u}=t,f=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,y=f?0:e.arrowHeight,[v,g]=gS(a),b={start:"0%",center:"50%",end:"100%"}[g],m=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,h=((i=(s=u.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+y/2;let w="",x="";return v==="bottom"?(w=f?b:`${m}px`,x=`${-y}px`):v==="top"?(w=f?b:`${m}px`,x=`${l.floating.height+y}px`):v==="right"?(w=`${-y}px`,x=f?b:`${h}px`):v==="left"&&(w=`${l.floating.width+y}px`,x=f?b:`${h}px`),{data:{x:w,y:x}}}});function gS(e){const[t,n="center"]=e.split("-");return[t,n]}const d4=o4,f4=s4,h4=l4,p4=[" ","Enter","ArrowUp","ArrowDown"],m4=[" ","Enter"],bd="Select",[Sd,Ym,v4]=im(bd),[Ks,EM]=Ir(bd,[v4,pS]),qm=pS(),[g4,Si]=Ks(bd),[y4,w4]=Ks(bd),x4=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:y}=e,v=qm(t),[g,b]=c.useState(null),[m,h]=c.useState(null),[w,x]=c.useState(!1),_=Um(u),[C=!1,E]=Rs({prop:r,defaultProp:o,onChange:i}),[T,O]=Rs({prop:s,defaultProp:a,onChange:l}),I=c.useRef(null),V=g?!!g.closest("form"):!0,[D,B]=c.useState(new Set),M=Array.from(D).map(F=>F.props.value).join(";");return c.createElement(d4,v,c.createElement(g4,{required:y,scope:t,trigger:g,onTriggerChange:b,valueNode:m,onValueNodeChange:h,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:os(),value:T,onValueChange:O,open:C,onOpenChange:E,dir:_,triggerPointerDownPosRef:I,disabled:p},c.createElement(Sd.Provider,{scope:t},c.createElement(y4,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(F=>{B(H=>new Set(H).add(F))},[]),onNativeOptionRemove:c.useCallback(F=>{B(H=>{const oe=new Set(H);return oe.delete(F),oe})},[])},n)),V?c.createElement(bS,{key:M,"aria-hidden":!0,required:y,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:F=>O(F.target.value),disabled:p},T===void 0?c.createElement("option",{value:""}):null,Array.from(D)):null))},b4="SelectTrigger",S4=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=qm(n),s=Si(b4,n),a=s.disabled||r,l=it(t,s.onTriggerChange),u=Ym(n),[d,f,p]=SS(v=>{const g=u().filter(h=>!h.disabled),b=g.find(h=>h.value===s.value),m=_S(g,v,b);m!==void 0&&s.onValueChange(m.value)}),y=()=>{a||(s.onOpenChange(!0),p())};return c.createElement(f4,ne({asChild:!0},i),c.createElement(ke.button,ne({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":xS(s.value)?"":void 0},o,{ref:l,onClick:Ee(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ee(o.onPointerDown,v=>{const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(y(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ee(o.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&p4.includes(v.key)&&(y(),v.preventDefault())})})))}),_4="SelectValue",E4=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Si(_4,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=it(t,l.onValueNodeChange);return Jt(()=>{u(d)},[u,d]),c.createElement(ke.span,ne({},a,{ref:f,style:{pointerEvents:"none"}}),xS(l.value)?c.createElement(c.Fragment,null,s):i)}),C4=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.createElement(ke.span,ne({"aria-hidden":!0},o,{ref:t}),r||"▼")}),k4=e=>c.createElement(am,ne({asChild:!0},e)),Is="SelectContent",T4=c.forwardRef((e,t)=>{const n=Si(Is,e.__scopeSelect),[r,o]=c.useState();if(Jt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Mr.createPortal(c.createElement(yS,{scope:e.__scopeSelect},c.createElement(Sd.Slot,{scope:e.__scopeSelect},c.createElement("div",null,e.children))),i):null}return c.createElement($4,ne({},e,{ref:t}))}),mr=10,[yS,_d]=Ks(Is),$4=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:y,sticky:v,hideWhenDetached:g,avoidCollisions:b,...m}=e,h=Si(Is,n),[w,x]=c.useState(null),[_,C]=c.useState(null),E=it(t,ue=>x(ue)),[T,O]=c.useState(null),[I,V]=c.useState(null),D=Ym(n),[B,M]=c.useState(!1),F=c.useRef(!1);c.useEffect(()=>{if(w)return E1(w)},[w]),h1();const H=c.useCallback(ue=>{const[Me,...$e]=D().map(Oe=>Oe.ref.current),[Re]=$e.slice(-1),Ne=document.activeElement;for(const Oe of ue)if(Oe===Ne||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===Me&&_&&(_.scrollTop=0),Oe===Re&&_&&(_.scrollTop=_.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ne))return},[D,_]),oe=c.useCallback(()=>H([T,w]),[H,T,w]);c.useEffect(()=>{B&&oe()},[B,oe]);const{onOpenChange:L,triggerPointerDownPosRef:K}=h;c.useEffect(()=>{if(w){let ue={x:0,y:0};const Me=Re=>{var Ne,Oe,Xe,Tt;ue={x:Math.abs(Math.round(Re.pageX)-((Ne=(Oe=K.current)===null||Oe===void 0?void 0:Oe.x)!==null&&Ne!==void 0?Ne:0)),y:Math.abs(Math.round(Re.pageY)-((Xe=(Tt=K.current)===null||Tt===void 0?void 0:Tt.y)!==null&&Xe!==void 0?Xe:0))}},$e=Re=>{ue.x<=10&&ue.y<=10?Re.preventDefault():w.contains(Re.target)||L(!1),document.removeEventListener("pointermove",Me),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",Me),document.addEventListener("pointerup",$e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Me),document.removeEventListener("pointerup",$e,{capture:!0})}}},[w,L,K]),c.useEffect(()=>{const ue=()=>L(!1);return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[L]);const[re,he]=SS(ue=>{const Me=D().filter(Ne=>!Ne.disabled),$e=Me.find(Ne=>Ne.ref.current===document.activeElement),Re=_S(Me,ue,$e);Re&&setTimeout(()=>Re.ref.current.focus())}),ve=c.useCallback((ue,Me,$e)=>{const Re=!F.current&&!$e;(h.value!==void 0&&h.value===Me||Re)&&(O(ue),Re&&(F.current=!0))},[h.value]),Ue=c.useCallback(()=>w==null?void 0:w.focus(),[w]),Ie=c.useCallback((ue,Me,$e)=>{const Re=!F.current&&!$e;(h.value!==void 0&&h.value===Me||Re)&&V(ue)},[h.value]),ht=r==="popper"?Ty:R4,ze=ht===Ty?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:y,sticky:v,hideWhenDetached:g,avoidCollisions:b}:{};return c.createElement(yS,{scope:n,content:w,viewport:_,onViewportChange:C,itemRefCallback:ve,selectedItem:T,onItemLeave:Ue,itemTextRefCallback:Ie,focusSelectedItem:oe,selectedItemText:I,position:r,isPositioned:B,searchRef:re},c.createElement(S1,{as:Eo,allowPinchZoom:!0},c.createElement(d1,{asChild:!0,trapped:h.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Ee(o,ue=>{var Me;(Me=h.trigger)===null||Me===void 0||Me.focus({preventScroll:!0}),ue.preventDefault()})},c.createElement(sm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>h.onOpenChange(!1)},c.createElement(ht,ne({role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:ue=>ue.preventDefault()},m,ze,{onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Ee(m.onKeyDown,ue=>{const Me=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!Me&&ue.key.length===1&&he(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let Re=D().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const Ne=ue.target,Oe=Re.indexOf(Ne);Re=Re.slice(Oe+1)}setTimeout(()=>H(Re)),ue.preventDefault()}})}))))))}),R4=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Si(Is,n),s=_d(Is,n),[a,l]=c.useState(null),[u,d]=c.useState(null),f=it(t,E=>d(E)),p=Ym(n),y=c.useRef(!1),v=c.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:m,focusSelectedItem:h}=s,w=c.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&g&&b&&m){const E=i.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),I=m.getBoundingClientRect();if(i.dir!=="rtl"){const Ne=I.left-T.left,Oe=O.left-Ne,Xe=E.left-Oe,Tt=E.width+Xe,hn=Math.max(Tt,T.width),dr=window.innerWidth-mr,$=gy(Oe,[mr,dr-hn]);a.style.minWidth=Tt+"px",a.style.left=$+"px"}else{const Ne=T.right-I.right,Oe=window.innerWidth-O.right-Ne,Xe=window.innerWidth-E.right-Oe,Tt=E.width+Xe,hn=Math.max(Tt,T.width),dr=window.innerWidth-mr,$=gy(Oe,[mr,dr-hn]);a.style.minWidth=Tt+"px",a.style.right=$+"px"}const V=p(),D=window.innerHeight-mr*2,B=g.scrollHeight,M=window.getComputedStyle(u),F=parseInt(M.borderTopWidth,10),H=parseInt(M.paddingTop,10),oe=parseInt(M.borderBottomWidth,10),L=parseInt(M.paddingBottom,10),K=F+H+B+L+oe,re=Math.min(b.offsetHeight*5,K),he=window.getComputedStyle(g),ve=parseInt(he.paddingTop,10),Ue=parseInt(he.paddingBottom,10),Ie=E.top+E.height/2-mr,ht=D-Ie,ze=b.offsetHeight/2,ue=b.offsetTop+ze,Me=F+H+ue,$e=K-Me;if(Me<=Ie){const Ne=b===V[V.length-1].ref.current;a.style.bottom="0px";const Oe=u.clientHeight-g.offsetTop-g.offsetHeight,Xe=Math.max(ht,ze+(Ne?Ue:0)+Oe+oe),Tt=Me+Xe;a.style.height=Tt+"px"}else{const Ne=b===V[0].ref.current;a.style.top="0px";const Xe=Math.max(Ie,F+g.offsetTop+(Ne?ve:0)+ze)+$e;a.style.height=Xe+"px",g.scrollTop=Me-Ie+g.offsetTop}a.style.margin=`${mr}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[p,i.trigger,i.valueNode,a,u,g,b,m,i.dir,r]);Jt(()=>w(),[w]);const[x,_]=c.useState();Jt(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const C=c.useCallback(E=>{E&&v.current===!0&&(w(),h==null||h(),v.current=!1)},[w,h]);return c.createElement(P4,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:y,onScrollButtonChange:C},c.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x}},c.createElement(ke.div,ne({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),Ty=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mr,...i}=e,s=qm(n);return c.createElement(h4,ne({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[P4,N4]=Ks(Is,{}),$y="SelectViewport",O4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_d($y,n),i=N4($y,n),s=it(t,o.onViewportChange),a=c.useRef(0);return c.createElement(c.Fragment,null,c.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),c.createElement(Sd.Slot,{scope:n},c.createElement(ke.div,ne({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Ee(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const p=Math.abs(a.current-u.scrollTop);if(p>0){const y=window.innerHeight-mr*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),b=Math.max(v,g);if(b0?w:0,d.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),A4="SelectGroup",[CM,D4]=Ks(A4),M4="SelectLabel",I4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=D4(M4,n);return c.createElement(ke.div,ne({id:o.id},r,{ref:t}))}),up="SelectItem",[j4,wS]=Ks(up),L4=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Si(up,n),l=_d(up,n),u=a.value===r,[d,f]=c.useState(i??""),[p,y]=c.useState(!1),v=it(t,m=>{var h;return(h=l.itemRefCallback)===null||h===void 0?void 0:h.call(l,m,r,o)}),g=os(),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.createElement(j4,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:c.useCallback(m=>{f(h=>{var w;return h||((w=m==null?void 0:m.textContent)!==null&&w!==void 0?w:"").trim()})},[])},c.createElement(Sd.ItemSlot,{scope:n,value:r,disabled:o,textValue:d},c.createElement(ke.div,ne({role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Ee(s.onFocus,()=>y(!0)),onBlur:Ee(s.onBlur,()=>y(!1)),onPointerUp:Ee(s.onPointerUp,b),onPointerMove:Ee(s.onPointerMove,m=>{if(o){var h;(h=l.onItemLeave)===null||h===void 0||h.call(l)}else m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(s.onPointerLeave,m=>{if(m.currentTarget===document.activeElement){var h;(h=l.onItemLeave)===null||h===void 0||h.call(l)}}),onKeyDown:Ee(s.onKeyDown,m=>{var h;((h=l.searchRef)===null||h===void 0?void 0:h.current)!==""&&m.key===" "||(m4.includes(m.key)&&b(),m.key===" "&&m.preventDefault())})}))))}),gu="SelectItemText",F4=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Si(gu,n),a=_d(gu,n),l=wS(gu,n),u=w4(gu,n),[d,f]=c.useState(null),p=it(t,m=>f(m),l.onItemTextChange,m=>{var h;return(h=a.itemTextRefCallback)===null||h===void 0?void 0:h.call(a,m,l.value,l.disabled)}),y=d==null?void 0:d.textContent,v=c.useMemo(()=>c.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},y),[l.disabled,l.value,y]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=u;return Jt(()=>(g(v),()=>b(v)),[g,b,v]),c.createElement(c.Fragment,null,c.createElement(ke.span,ne({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Mr.createPortal(i.children,s.valueNode):null)}),U4="SelectItemIndicator",z4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return wS(U4,n).isSelected?c.createElement(ke.span,ne({"aria-hidden":!0},r,{ref:t})):null}),V4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.createElement(ke.div,ne({"aria-hidden":!0},r,{ref:t}))});function xS(e){return e===""||e===void 0}const bS=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=c.useRef(null),i=it(t,o),s=V1(n);return c.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),c.createElement(lm,{asChild:!0},c.createElement("select",ne({},r,{ref:i,defaultValue:n})))});bS.displayName="BubbleSelect";function SS(e){const t=Vt(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(s=>{const a=n.current+s;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function _S(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=W4(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function W4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const B4=x4,ES=S4,H4=E4,Z4=C4,K4=k4,CS=T4,Q4=O4,kS=I4,TS=L4,Y4=F4,q4=z4,$S=V4,G4=B4,X4=H4,RS=c.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(ES,{ref:r,className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,S.jsx(Z4,{asChild:!0,children:S.jsx(JC,{className:"h-4 w-4 opacity-50"})})]}));RS.displayName=ES.displayName;const PS=c.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>S.jsx(K4,{children:S.jsx(CS,{ref:o,className:le("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:S.jsx(Q4,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));PS.displayName=CS.displayName;const J4=c.forwardRef(({className:e,...t},n)=>S.jsx(kS,{ref:n,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));J4.displayName=kS.displayName;const Fu=c.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(TS,{ref:r,className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(q4,{children:S.jsx(XC,{className:"h-4 w-4"})})}),S.jsx(Y4,{children:t})]}));Fu.displayName=TS.displayName;const eM=c.forwardRef(({className:e,...t},n)=>S.jsx($S,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));eM.displayName=$S.displayName;const tM=jn({username:Qt().min(2,{message:"Username must be at least 2 characters."}).max(30,{message:"Username must not be longer than 30 characters."}),email:Qt({required_error:"Please select an email to display."}).email(),bio:Qt().max(160).min(4),urls:$b(jn({value:Qt().url({message:"Please enter a valid URL."})})).optional()}),nM={bio:"I own a computer.",urls:[{value:"https://shadcn.com"},{value:"http://twitter.com/shadcn"}]};function rM(){const e=pd({resolver:md(tM),defaultValues:nM,mode:"onChange"}),{fields:t,append:n}=YO({name:"urls",control:e.control});function r(o){dm({title:"You submitted the following values:",description:S.jsx("pre",{className:"bg-slate-950 mt-2 w-[340px] rounded-md p-4",children:S.jsx("code",{className:"text-white",children:JSON.stringify(o,null,2)})})})}return S.jsx(nS,{title:"Profile",description:"This is how others will see you in the MemGPT community.",children:S.jsx(vd,{...e,children:S.jsxs("form",{onSubmit:e.handleSubmit(r),className:"space-y-8",children:[S.jsx(fo,{control:e.control,name:"username",render:({field:o})=>S.jsxs(nr,{children:[S.jsx(rr,{children:"Username"}),S.jsx(br,{children:S.jsx(xr,{placeholder:"shadcn",...o})}),S.jsx(ho,{children:"This is your public display name. It can be your real name or a pseudonym. You can only change this once every 30 days."}),S.jsx(Sr,{})]})}),S.jsx(fo,{control:e.control,name:"email",render:({field:o})=>S.jsxs(nr,{children:[S.jsx(rr,{children:"Email"}),S.jsxs(G4,{onValueChange:o.onChange,defaultValue:o.value,children:[S.jsx(br,{children:S.jsx(RS,{children:S.jsx(X4,{placeholder:"Select a verified email to display"})})}),S.jsxs(PS,{children:[S.jsx(Fu,{value:"m@example.com",children:"m@example.com"}),S.jsx(Fu,{value:"m@google.com",children:"m@google.com"}),S.jsx(Fu,{value:"m@support.com",children:"m@support.com"})]})]}),S.jsxs(ho,{children:["You can manage verified email addresses in your ",S.jsx(lb,{to:"/examples/forms",children:"email settings"}),"."]}),S.jsx(Sr,{})]})}),S.jsx(fo,{control:e.control,name:"bio",render:({field:o})=>S.jsxs(nr,{children:[S.jsx(rr,{children:"Bio"}),S.jsx(br,{children:S.jsx(Ac,{placeholder:"Tell us a little bit about yourself",className:"resize-none",...o})}),S.jsxs(ho,{children:["You can ",S.jsx("span",{children:"@mention"})," other users and organizations to link to them."]}),S.jsx(Sr,{})]})}),S.jsxs("div",{children:[t.map((o,i)=>S.jsx(fo,{control:e.control,name:`urls.${i}.value`,render:({field:s})=>S.jsxs(nr,{children:[S.jsx(rr,{className:le(i!==0&&"sr-only"),children:"URLs"}),S.jsx(ho,{className:le(i!==0&&"sr-only"),children:"Add links to your website, blog, or social media profiles."}),S.jsx(br,{children:S.jsx(xr,{...s})}),S.jsx(Sr,{})]})},o.id)),S.jsx(Ut,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>n({value:""}),children:"Add URL"})]}),S.jsx(Ut,{type:"submit",children:"Update profile"})]})})})}function oM({className:e,items:t,...n}){return S.jsx("nav",{className:le("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",e),...n,children:t.map((r,o)=>S.jsx(Ki,{relative:"path",to:r.to,className:le(Vb({variant:"ghost"}),"hover:bg-transparent hover:underline","[&.active]:bg-muted [&.active]:hover:bg-muted [&.active]:hover:no-underline","justify-start"),children:r.title},o))})}const iM=[{title:"Agents",to:"./agents"}];function sM(){return S.jsxs("div",{className:"space-y-6 p-10 pb-16",children:[S.jsxs("div",{className:"space-y-0.5",children:[S.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),S.jsx("p",{className:"text-muted-foreground",children:"Manage your MemGPT settings, like agents, prompts, and history."})]}),S.jsx(Vm,{className:"my-6"}),S.jsxs("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0",children:[S.jsx("aside",{className:"-mx-4 lg:w-1/5",children:S.jsx(oM,{items:iM})}),S.jsx("div",{className:"flex-1 lg:max-w-4xl",children:S.jsx(ib,{})})]})]})}const aM={path:"settings",element:S.jsx(sM,{}),children:[{path:"agents",element:S.jsx(wD,{})},{path:"profile",element:S.jsx(rM,{})}]};function lM(){const e=new Date().getFullYear();return S.jsxs("div",{className:"flex items-end justify-between border-t p-8",children:[S.jsxs("div",{children:[S.jsx("p",{className:xO(),children:"MemGPT"}),S.jsx("p",{className:gi(),children:"Towards LLMs as Operating Systems"})]}),S.jsxs("p",{className:gi(),children:["© ",e," MemGPT"]})]})}const NS=c.createContext({setTheme(e){},toggleTheme(){},theme:localStorage.getItem("theme")==="dark"?"dark":"light"});function uM({children:e}){const[t,n]=c.useState(localStorage.getItem("theme")==="dark"?"dark":"light"),r=c.useCallback(()=>n(i=>i==="light"?"dark":"light"),[n]),o=c.useMemo(()=>({theme:t,setTheme:n,toggleTheme:r}),[t,n,r]);return c.useEffect(()=>{t==="light"?(document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light")):(document.documentElement.classList.remove("light"),document.documentElement.classList.add("dark")),localStorage.setItem("theme",t)},[t]),S.jsx(NS.Provider,{value:o,children:e})}const cM=()=>c.useContext(NS),Af="[&.active]:opacity-100 opacity-60",dM=()=>{const{theme:e,toggleTheme:t}=cM();return S.jsxs("div",{className:"flex items-start justify-between border-b py-2 sm:px-8",children:[S.jsxs(Ki,{to:"/",children:[S.jsx("span",{className:"sr-only",children:"Home"}),S.jsxs(_m,{className:"border bg-white",children:[S.jsx(Em,{alt:"MemGPT logo.",src:"/memgpt_logo_transparent.png"}),S.jsx(Cm,{className:"border",children:"MG"})]})]}),S.jsxs("nav",{className:"flex space-x-4",children:[S.jsx(Ut,{size:"sm",asChild:!0,variant:"link",children:S.jsx(Ki,{className:Af,to:"/",children:"Home"})}),S.jsx(Ut,{size:"sm",asChild:!0,variant:"link",children:S.jsx(Ki,{className:Af,to:"/chat",children:"Chat"})}),S.jsx(Ut,{size:"sm",asChild:!0,variant:"link",children:S.jsx(Ki,{className:Af,to:"/settings/agents",children:"Settings"})}),S.jsx(Ut,{size:"icon",variant:"ghost",onClick:t,children:e==="light"?S.jsx(tk,{className:"h-4 w-4"}):S.jsx(ik,{className:"w-4 w-4"})})]})]})},fM=()=>S.jsxs(vO,{children:[S.jsx(dM,{}),S.jsx("div",{className:"h-full",children:S.jsx(ib,{})}),S.jsx(lM,{})]}),hM=L$([{path:"/",element:fM(),children:[{path:"",element:S.jsx(IA,{})},TA,aM]}]),pM=new sT;function mM(){const{registerOnMessageCallback:e,abortStream:t}=Pb(),{addMessage:n}=xb(),r=Ml();return c.useEffect(()=>{r&&t()},[t,r]),c.useEffect(()=>e(o=>{r&&(console.log("adding message",o,r.id),n(r.id,o))}),[t,e,r,n]),S.jsxs(dT,{client:pM,children:[S.jsxs(uM,{children:[S.jsx(Z$,{router:hM}),S.jsx(Hk,{})]}),S.jsx(CT,{initialIsOpen:!1})]})}const vM=tx(document.getElementById("root"));vM.render(S.jsx(c.StrictMode,{children:S.jsx(mM,{})})); diff --git a/memgpt/server/static_files/assets/index-57df4f6c.css b/memgpt/server/static_files/assets/index-57df4f6c.css new file mode 100644 index 00000000..18954fd4 --- /dev/null +++ b/memgpt/server/static_files/assets/index-57df4f6c.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 224 71.4% 4.1%;--card: 0 0% 100%;--card-foreground: 224 71.4% 4.1%;--popover: 0 0% 100%;--popover-foreground: 224 71.4% 4.1%;--primary: 220.9 39.3% 11%;--primary-foreground: 210 20% 98%;--secondary: 220 14.3% 95.9%;--secondary-foreground: 220.9 39.3% 11%;--muted: 220 14.3% 95.9%;--muted-foreground: 220 8.9% 46.1%;--accent: 220 14.3% 95.9%;--accent-foreground: 220.9 39.3% 11%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 20% 98%;--border: 220 13% 91%;--input: 220 13% 91%;--ring: 224 71.4% 4.1%;--radius: .5rem}.dark{--background: 224 71.4% 4.1%;--foreground: 210 20% 98%;--card: 224 71.4% 4.1%;--card-foreground: 210 20% 98%;--popover: 224 71.4% 4.1%;--popover-foreground: 210 20% 98%;--primary: 210 20% 98%;--primary-foreground: 220.9 39.3% 11%;--secondary: 215 27.9% 16.9%;--secondary-foreground: 210 20% 98%;--muted: 215 27.9% 16.9%;--muted-foreground: 217.9 10.6% 64.9%;--accent: 215 27.9% 16.9%;--accent-foreground: 210 20% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 20% 98%;--border: 215 27.9% 16.9%;--input: 215 27.9% 16.9%;--ring: 216 12.2% 83.9%}*{border-color:hsl(var(--border))}html{height:100%}body{height:100%;width:100%;background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0px;right:0px;bottom:0px;left:0px}.inset-x-0{left:0px;right:0px}.bottom-3{bottom:.75rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0px}.top-1\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-0{z-index:0}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-3{grid-column:span 3 / span 3}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-mt-40{margin-top:-10rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.aspect-square{aspect-ratio:1 / 1}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-52{height:13rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[70svh\]{height:70svh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\[80vh\]{max-height:80vh}.max-h-screen{max-height:100vh}.min-h-\[20rem\]{min-height:20rem}.min-h-\[80px\]{min-height:80px}.w-10{width:2.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-\[340px\]{width:340px}.w-\[80px\]{width:80px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-screen-2xl{max-width:1536px}.max-w-screen-lg{max-width:1024px}.max-w-screen-xl{max-width:1280px}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.origin-center{transform-origin:center}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.scroll-m-20{scroll-margin:5rem}.list-disc{list-style-type:disc}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-primary{border-color:hsl(var(--primary))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-\[\#ecedef\]{--tw-bg-opacity: 1;background-color:rgb(236 237 239 / var(--tw-bg-opacity))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/40{background-color:hsl(var(--muted-foreground) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-20{padding:5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[0\.3rem\]{padding-left:.3rem;padding-right:.3rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\[0\.2rem\]{padding-top:.2rem;padding-bottom:.2rem}.pb-12{padding-bottom:3rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pl-12{padding-left:3rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-40{padding-top:10rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-700{transition-duration:.7s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.slide-in-from-bottom{--tw-enter-translate-y: 100%}.slide-in-from-bottom-2{--tw-enter-translate-y: .5rem}.slide-in-from-top{--tw-enter-translate-y: -100%}.slide-out-to-top{--tw-exit-translate-y: -100%}.duration-200{animation-duration:.2s}.duration-700{animation-duration:.7s}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\:mt-0:first-child{margin-top:0}.hover\:border-accent:hover{border-color:hsl(var(--accent))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.dark .dark\:border-destructive{border-color:hsl(var(--destructive))}.dark .dark\:bg-muted-foreground\/20{background-color:hsl(var(--muted-foreground) / .2)}.dark .dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:bottom-0{bottom:0px}.sm\:right-0{right:0px}.sm\:top-auto{top:auto}.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:w-80{width:20rem}.sm\:w-96{width:24rem}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[425px\]{max-width:425px}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:w-full{width:100%}.md\:max-w-\[420px\]{max-width:420px}}@media (min-width: 1024px){.lg\:w-1\/5{width:20%}.lg\:max-w-4xl{max-width:56rem}.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.lg\:text-5xl{font-size:3rem;line-height:1}}.\[\&\.active\]\:bg-muted.active{background-color:hsl(var(--muted))}.\[\&\.active\]\:opacity-100.active{opacity:1}.\[\&\.active\]\:hover\:bg-muted:hover.active{background-color:hsl(var(--muted))}.\[\&\.active\]\:hover\:no-underline:hover.active{text-decoration-line:none}.\[\&\:has\(\[data-state\=checked\]\)\>div\]\:border-primary:has([data-state=checked])>div{border-color:hsl(var(--primary))}.\[\&\:not\(\:first-child\)\]\:mt-6:not(:first-child){margin-top:1.5rem}.\[\&\>li\]\:mt-2>li{margin-top:.5rem}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-2\.5>svg{left:.625rem}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-2\.5>svg{top:.625rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625} diff --git a/memgpt/server/static_files/assets/index-9ace7bf7.css b/memgpt/server/static_files/assets/index-9ace7bf7.css deleted file mode 100644 index cf7d9e3e..00000000 --- a/memgpt/server/static_files/assets/index-9ace7bf7.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 224 71.4% 4.1%;--card: 0 0% 100%;--card-foreground: 224 71.4% 4.1%;--popover: 0 0% 100%;--popover-foreground: 224 71.4% 4.1%;--primary: 220.9 39.3% 11%;--primary-foreground: 210 20% 98%;--secondary: 220 14.3% 95.9%;--secondary-foreground: 220.9 39.3% 11%;--muted: 220 14.3% 95.9%;--muted-foreground: 220 8.9% 46.1%;--accent: 220 14.3% 95.9%;--accent-foreground: 220.9 39.3% 11%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 20% 98%;--border: 220 13% 91%;--input: 220 13% 91%;--ring: 224 71.4% 4.1%;--radius: .5rem}.dark{--background: 224 71.4% 4.1%;--foreground: 210 20% 98%;--card: 224 71.4% 4.1%;--card-foreground: 210 20% 98%;--popover: 224 71.4% 4.1%;--popover-foreground: 210 20% 98%;--primary: 210 20% 98%;--primary-foreground: 220.9 39.3% 11%;--secondary: 215 27.9% 16.9%;--secondary-foreground: 210 20% 98%;--muted: 215 27.9% 16.9%;--muted-foreground: 217.9 10.6% 64.9%;--accent: 215 27.9% 16.9%;--accent-foreground: 210 20% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 20% 98%;--border: 215 27.9% 16.9%;--input: 215 27.9% 16.9%;--ring: 216 12.2% 83.9%}*{border-color:hsl(var(--border))}html{height:100%}body{height:100%;width:100%;background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0px;right:0px;bottom:0px;left:0px}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0px}.top-1\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-0{z-index:0}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-3{grid-column:span 3 / span 3}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.aspect-square{aspect-ratio:1 / 1}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-52{height:13rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[70svh\]{height:70svh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\[80vh\]{max-height:80vh}.max-h-screen{max-height:100vh}.min-h-\[20rem\]{min-height:20rem}.min-h-\[80px\]{min-height:80px}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-\[340px\]{width:340px}.w-\[80px\]{width:80px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-screen-2xl{max-width:1536px}.max-w-screen-lg{max-width:1024px}.max-w-screen-xl{max-width:1280px}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.origin-center{transform-origin:center}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.scroll-m-20{scroll-margin:5rem}.list-disc{list-style-type:disc}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.bg-\[\#ecedef\]{--tw-bg-opacity: 1;background-color:rgb(236 237 239 / var(--tw-bg-opacity))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/40{background-color:hsl(var(--muted-foreground) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-20{padding:5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[0\.3rem\]{padding-left:.3rem;padding-right:.3rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\[0\.2rem\]{padding-top:.2rem;padding-bottom:.2rem}.pb-12{padding-bottom:3rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pl-12{padding-left:3rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-40{padding-top:10rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-700{transition-duration:.7s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.slide-in-from-bottom{--tw-enter-translate-y: 100%}.slide-in-from-top{--tw-enter-translate-y: -100%}.slide-out-to-top{--tw-exit-translate-y: -100%}.duration-200{animation-duration:.2s}.duration-700{animation-duration:.7s}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\:mt-0:first-child{margin-top:0}.hover\:border-accent:hover{border-color:hsl(var(--accent))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.dark .dark\:border-destructive{border-color:hsl(var(--destructive))}.dark .dark\:bg-muted-foreground\/20{background-color:hsl(var(--muted-foreground) / .2)}.dark .dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:bottom-0{bottom:0px}.sm\:right-0{right:0px}.sm\:top-auto{top:auto}.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:w-80{width:20rem}.sm\:w-96{width:24rem}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[425px\]{max-width:425px}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:w-full{width:100%}.md\:max-w-\[420px\]{max-width:420px}}@media (min-width: 1024px){.lg\:w-1\/5{width:20%}.lg\:max-w-4xl{max-width:56rem}.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.lg\:text-5xl{font-size:3rem;line-height:1}}.\[\&\.active\]\:bg-muted.active{background-color:hsl(var(--muted))}.\[\&\.active\]\:opacity-100.active{opacity:1}.\[\&\.active\]\:hover\:bg-muted:hover.active{background-color:hsl(var(--muted))}.\[\&\.active\]\:hover\:no-underline:hover.active{text-decoration-line:none}.\[\&\:has\(\[data-state\=checked\]\)\>div\]\:border-primary:has([data-state=checked])>div{border-color:hsl(var(--primary))}.\[\&\:not\(\:first-child\)\]\:mt-6:not(:first-child){margin-top:1.5rem}.\[\&\>li\]\:mt-2>li{margin-top:.5rem}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-2\.5>svg{left:.625rem}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-2\.5>svg{top:.625rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625} diff --git a/memgpt/server/static_files/assets/index-f6a3d52a.js b/memgpt/server/static_files/assets/index-f6a3d52a.js new file mode 100644 index 00000000..c29ab1cc --- /dev/null +++ b/memgpt/server/static_files/assets/index-f6a3d52a.js @@ -0,0 +1,129 @@ +var Fd=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var k=(e,t,n)=>(Fd(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Y=(e,t,n,r)=>(Fd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ql=(e,t,n,r)=>({set _(o){Y(e,t,o,n)},get _(){return k(e,t,r)}}),ye=(e,t,n)=>(Fd(e,t,"access private method"),n);function qy(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gy={exports:{}},Kc={},Xy={exports:{}},Te={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Nl=Symbol.for("react.element"),WS=Symbol.for("react.portal"),HS=Symbol.for("react.fragment"),ZS=Symbol.for("react.strict_mode"),KS=Symbol.for("react.profiler"),QS=Symbol.for("react.provider"),YS=Symbol.for("react.context"),qS=Symbol.for("react.forward_ref"),GS=Symbol.for("react.suspense"),XS=Symbol.for("react.memo"),JS=Symbol.for("react.lazy"),fv=Symbol.iterator;function e_(e){return e===null||typeof e!="object"?null:(e=fv&&e[fv]||e["@@iterator"],typeof e=="function"?e:null)}var Jy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e0=Object.assign,t0={};function Us(e,t,n){this.props=e,this.context=t,this.refs=t0,this.updater=n||Jy}Us.prototype.isReactComponent={};Us.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Us.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function n0(){}n0.prototype=Us.prototype;function bp(e,t,n){this.props=e,this.context=t,this.refs=t0,this.updater=n||Jy}var Sp=bp.prototype=new n0;Sp.constructor=bp;e0(Sp,Us.prototype);Sp.isPureReactComponent=!0;var hv=Array.isArray,r0=Object.prototype.hasOwnProperty,_p={current:null},o0={key:!0,ref:!0,__self:!0,__source:!0};function i0(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)r0.call(t,r)&&!o0.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,ve=L[he];if(0>>1;heo(ht,re))zeo(ue,ht)?(L[he]=ue,L[ze]=re,he=ze):(L[he]=ht,L[je]=re,he=je);else if(zeo(ue,re))L[he]=ue,L[ze]=re,he=ze;else break e}}return K}function o(L,K){var re=L.sortIndex-K.sortIndex;return re!==0?re:L.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,h=null,p=3,g=!1,y=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=L)r(u),K.sortIndex=K.expirationTime,t(l,K);else break;K=n(u)}}function S(L){if(v=!1,w(L),!y)if(n(l)!==null)y=!0,H(_);else{var K=n(u);K!==null&&oe(S,K.startTime-L)}}function _(L,K){y=!1,v&&(v=!1,m(T),T=-1),g=!0;var re=p;try{for(w(K),h=n(l);h!==null&&(!(h.expirationTime>K)||L&&!V());){var he=h.callback;if(typeof he=="function"){h.callback=null,p=h.priorityLevel;var ve=he(h.expirationTime<=K);K=e.unstable_now(),typeof ve=="function"?h.callback=ve:h===n(l)&&r(l),w(K)}else r(l);h=n(l)}if(h!==null)var Ue=!0;else{var je=n(u);je!==null&&oe(S,je.startTime-K),Ue=!1}return Ue}finally{h=null,p=re,g=!1}}var C=!1,E=null,T=-1,O=5,j=-1;function V(){return!(e.unstable_now()-jL||125he?(L.sortIndex=re,t(u,L),n(l)===null&&L===n(u)&&(v?(m(T),T=-1):v=!0,oe(S,re-he))):(L.sortIndex=ve,t(l,L),y||g||(y=!0,H(_))),L},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(L){var K=p;return function(){var re=p;p=K;try{return L.apply(this,arguments)}finally{p=re}}}})(c0);u0.exports=c0;var d_=u0.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var d0=c,cn=d_;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wf=Object.prototype.hasOwnProperty,f_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mv={},vv={};function h_(e){return Wf.call(vv,e)?!0:Wf.call(mv,e)?!1:f_.test(e)?vv[e]=!0:(mv[e]=!0,!1)}function p_(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function m_(e,t,n,r){if(t===null||typeof t>"u"||p_(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ht(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new Ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new Ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Tt[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cp=/[\-:]([a-z])/g;function kp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cp,kp);Tt[t]=new Ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Cp,kp);Tt[t]=new Ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Cp,kp);Tt[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tp(e,t,n,r){var o=Tt.hasOwnProperty(t)?Tt[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Vd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ya(e):""}function v_(e){switch(e.tag){case 5:return ya(e.type);case 16:return ya("Lazy");case 13:return ya("Suspense");case 19:return ya("SuspenseList");case 0:case 2:case 15:return e=Bd(e.type,!1),e;case 11:return e=Bd(e.type.render,!1),e;case 1:return e=Bd(e.type,!0),e;default:return""}}function Qf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fi:return"Fragment";case Li:return"Portal";case Hf:return"Profiler";case $p:return"StrictMode";case Zf:return"Suspense";case Kf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p0:return(e.displayName||"Context")+".Consumer";case h0:return(e._context.displayName||"Context")+".Provider";case Rp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pp:return t=e.displayName||null,t!==null?t:Qf(e.type)||"Memo";case Qr:t=e._payload,e=e._init;try{return Qf(e(t))}catch{}}return null}function g_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qf(t);case 8:return t===$p?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function So(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function v0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y_(e){var t=v0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jl(e){e._valueTracker||(e._valueTracker=y_(e))}function g0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=v0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yf(e,t){var n=t.checked;return ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=So(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function y0(e,t){t=t.checked,t!=null&&Tp(e,"checked",t,!1)}function qf(e,t){y0(e,t);var n=So(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Gf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gf(e,t.type,So(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wv(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Gf(e,t,n){(t!=="number"||Qu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wa=Array.isArray;function Ji(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=eu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function La(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _a={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},w_=["Webkit","ms","Moz","O"];Object.keys(_a).forEach(function(e){w_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_a[t]=_a[e]})});function S0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_a.hasOwnProperty(e)&&_a[e]?(""+t).trim():t+"px"}function _0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=S0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var x_=ot({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function eh(e,t){if(t){if(x_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function th(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nh=null;function Np(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rh=null,es=null,ts=null;function Sv(e){if(e=Dl(e)){if(typeof rh!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Xc(t),rh(e.stateNode,e.type,t))}}function E0(e){es?ts?ts.push(e):ts=[e]:es=e}function C0(){if(es){var e=es,t=ts;if(ts=es=null,Sv(e),t)for(e=0;e>>=0,e===0?32:31-(N_(e)/O_|0)|0}var tu=64,nu=4194304;function xa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Xu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=xa(a):(i&=s,i!==0&&(r=xa(i)))}else s=n&~o,s!==0?r=xa(s):i!==0&&(r=xa(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ol(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function j_(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Ca),Nv=String.fromCharCode(32),Ov=!1;function H0(e,t){switch(e){case"keyup":return cE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ui=!1;function fE(e,t){switch(e){case"compositionend":return Z0(t);case"keypress":return t.which!==32?null:(Ov=!0,Nv);case"textInput":return e=t.data,e===Nv&&Ov?null:e;default:return null}}function hE(e,t){if(Ui)return e==="compositionend"||!Fp&&H0(e,t)?(e=B0(),Tu=jp=ao=null,Ui=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jv(n)}}function q0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?q0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G0(){for(var e=window,t=Qu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qu(e.document)}return t}function Up(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function SE(e){var t=G0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&q0(n.ownerDocument.documentElement,n)){if(r!==null&&Up(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Iv(n,i);var s=Iv(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,zi=null,uh=null,Ta=null,ch=!1;function Lv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ch||zi==null||zi!==Qu(r)||(r=zi,"selectionStart"in r&&Up(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ta&&Wa(Ta,r)||(Ta=r,r=tc(uh,"onSelect"),0Wi||(e.current=vh[Wi],vh[Wi]=null,Wi--)}function Ze(e,t){Wi++,vh[Wi]=e.current,e.current=t}var _o={},Dt=Mo(_o),qt=Mo(!1),di=_o;function ks(e,t){var n=e.type.contextTypes;if(!n)return _o;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Gt(e){return e=e.childContextTypes,e!=null}function rc(){Ge(qt),Ge(Dt)}function Hv(e,t,n){if(Dt.current!==_o)throw Error(z(168));Ze(Dt,t),Ze(qt,n)}function sw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,g_(e)||"Unknown",o));return ot({},n,r)}function oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_o,di=Dt.current,Ze(Dt,e),Ze(qt,qt.current),!0}function Zv(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=sw(e,t,di),r.__reactInternalMemoizedMergedChildContext=e,Ge(qt),Ge(Dt),Ze(Dt,e)):Ge(qt),Ze(qt,n)}var vr=null,Jc=!1,rf=!1;function aw(e){vr===null?vr=[e]:vr.push(e)}function DE(e){Jc=!0,aw(e)}function jo(){if(!rf&&vr!==null){rf=!0;var e=0,t=Fe;try{var n=vr;for(Fe=1;e>=s,o-=s,yr=1<<32-Fn(t)+o|n<T?(O=E,E=null):O=E.sibling;var j=p(m,E,w[T],S);if(j===null){E===null&&(E=O);break}e&&E&&j.alternate===null&&t(m,E),f=i(j,f,T),C===null?_=j:C.sibling=j,C=j,E=O}if(T===w.length)return n(m,E),Je&&Vo(m,T),_;if(E===null){for(;TT?(O=E,E=null):O=E.sibling;var V=p(m,E,j.value,S);if(V===null){E===null&&(E=O);break}e&&E&&V.alternate===null&&t(m,E),f=i(V,f,T),C===null?_=V:C.sibling=V,C=V,E=O}if(j.done)return n(m,E),Je&&Vo(m,T),_;if(E===null){for(;!j.done;T++,j=w.next())j=h(m,j.value,S),j!==null&&(f=i(j,f,T),C===null?_=j:C.sibling=j,C=j);return Je&&Vo(m,T),_}for(E=r(m,E);!j.done;T++,j=w.next())j=g(E,m,T,j.value,S),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?T:j.key),f=i(j,f,T),C===null?_=j:C.sibling=j,C=j);return e&&E.forEach(function(D){return t(m,D)}),Je&&Vo(m,T),_}function b(m,f,w,S){if(typeof w=="object"&&w!==null&&w.type===Fi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Xl:e:{for(var _=w.key,C=f;C!==null;){if(C.key===_){if(_=w.type,_===Fi){if(C.tag===7){n(m,C.sibling),f=o(C,w.props.children),f.return=m,m=f;break e}}else if(C.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Qr&&Jv(_)===C.type){n(m,C.sibling),f=o(C,w.props),f.ref=ra(m,C,w),f.return=m,m=f;break e}n(m,C);break}else t(m,C);C=C.sibling}w.type===Fi?(f=li(w.props.children,m.mode,S,w.key),f.return=m,m=f):(S=Mu(w.type,w.key,w.props,null,m.mode,S),S.ref=ra(m,f,w),S.return=m,m=S)}return s(m);case Li:e:{for(C=w.key;f!==null;){if(f.key===C)if(f.tag===4&&f.stateNode.containerInfo===w.containerInfo&&f.stateNode.implementation===w.implementation){n(m,f.sibling),f=o(f,w.children||[]),f.return=m,m=f;break e}else{n(m,f);break}else t(m,f);f=f.sibling}f=ff(w,m.mode,S),f.return=m,m=f}return s(m);case Qr:return C=w._init,b(m,f,C(w._payload),S)}if(wa(w))return y(m,f,w,S);if(Xs(w))return v(m,f,w,S);uu(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,f!==null&&f.tag===6?(n(m,f.sibling),f=o(f,w),f.return=m,m=f):(n(m,f),f=df(w,m.mode,S),f.return=m,m=f),s(m)):n(m,f)}return b}var $s=mw(!0),vw=mw(!1),Ml={},ir=Mo(Ml),Qa=Mo(Ml),Ya=Mo(Ml);function Ko(e){if(e===Ml)throw Error(z(174));return e}function Yp(e,t){switch(Ze(Ya,t),Ze(Qa,e),Ze(ir,Ml),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jf(t,e)}Ge(ir),Ze(ir,t)}function Rs(){Ge(ir),Ge(Qa),Ge(Ya)}function gw(e){Ko(Ya.current);var t=Ko(ir.current),n=Jf(t,e.type);t!==n&&(Ze(Qa,e),Ze(ir,n))}function qp(e){Qa.current===e&&(Ge(ir),Ge(Qa))}var nt=Mo(0);function cc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var of=[];function Gp(){for(var e=0;en?n:4,e(!0);var r=sf.transition;sf.transition={};try{e(!1),t()}finally{Fe=n,sf.transition=r}}function Aw(){return Tn().memoizedState}function LE(e,t,n){var r=xo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dw(e))Mw(t,n);else if(n=dw(e,t,n,r),n!==null){var o=zt();Un(n,e,r,o),jw(n,t,r)}}function FE(e,t,n){var r=xo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dw(e))Mw(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Bn(a,s)){var l=t.interleaved;l===null?(o.next=o,Kp(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=dw(e,t,o,r),n!==null&&(o=zt(),Un(n,e,r,o),jw(n,t,r))}}function Dw(e){var t=e.alternate;return e===rt||t!==null&&t===rt}function Mw(e,t){$a=dc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ap(e,n)}}var fc={readContext:kn,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useInsertionEffect:Rt,useLayoutEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useMutableSource:Rt,useSyncExternalStore:Rt,useId:Rt,unstable_isNewReconciler:!1},UE={readContext:kn,useCallback:function(e,t){return Qn().memoizedState=[e,t===void 0?null:t],e},useContext:kn,useEffect:tg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nu(4194308,4,$w.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nu(4,2,e,t)},useMemo:function(e,t){var n=Qn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=LE.bind(null,rt,e),[r.memoizedState,e]},useRef:function(e){var t=Qn();return e={current:e},t.memoizedState=e},useState:eg,useDebugValue:nm,useDeferredValue:function(e){return Qn().memoizedState=e},useTransition:function(){var e=eg(!1),t=e[0];return e=IE.bind(null,e[1]),Qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rt,o=Qn();if(Je){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),St===null)throw Error(z(349));hi&30||xw(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,tg(Sw.bind(null,r,i,e),[e]),r.flags|=2048,Xa(9,bw.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Qn(),t=St.identifierPrefix;if(Je){var n=wr,r=yr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qa++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Jn]=t,e[Ka]=r,Hw(e,t,!1,!1),t.stateNode=e;e:{switch(s=th(n,r),n){case"dialog":Ye("cancel",e),Ye("close",e),o=r;break;case"iframe":case"object":case"embed":Ye("load",e),o=r;break;case"video":case"audio":for(o=0;oNs&&(t.flags|=128,r=!0,oa(i,!1),t.lanes=4194304)}else{if(!r)if(e=cc(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Je)return Pt(t),null}else 2*ct()-i.renderingStartTime>Ns&&n!==1073741824&&(t.flags|=128,r=!0,oa(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ct(),t.sibling=null,n=nt.current,Ze(nt,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return lm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nn&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function QE(e,t){switch(Vp(t),t.tag){case 1:return Gt(t.type)&&rc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rs(),Ge(qt),Ge(Dt),Gp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qp(t),null;case 13:if(Ge(nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(nt),null;case 4:return Rs(),null;case 10:return Zp(t.type._context),null;case 22:case 23:return lm(),null;case 24:return null;default:return null}}var du=!1,At=!1,YE=typeof WeakSet=="function"?WeakSet:Set,J=null;function Qi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){st(e,t,r)}else n.current=null}function $h(e,t,n){try{n()}catch(r){st(e,t,r)}}var cg=!1;function qE(e,t){if(dh=Ju,e=G0(),Up(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var g;h!==n||o!==0&&h.nodeType!==3||(a=s+o),h!==i||r!==0&&h.nodeType!==3||(l=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===e)break t;if(p===n&&++u===o&&(a=s),p===i&&++d===r&&(l=s),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(fh={focusedElem:e,selectionRange:n},Ju=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,b=y.memoizedState,m=t.stateNode,f=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:On(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(S){st(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return y=cg,cg=!1,y}function Ra(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&$h(t,n,i)}o=o.next}while(o!==r)}}function nd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Rh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Qw(e){var t=e.alternate;t!==null&&(e.alternate=null,Qw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[Ka],delete t[mh],delete t[OE],delete t[AE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yw(e){return e.tag===5||e.tag===3||e.tag===4}function dg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ph(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nc));else if(r!==4&&(e=e.child,e!==null))for(Ph(e,t,n),e=e.sibling;e!==null;)Ph(e,t,n),e=e.sibling}function Nh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Nh(e,t,n),e=e.sibling;e!==null;)Nh(e,t,n),e=e.sibling}var Et=null,Dn=!1;function Ur(e,t,n){for(n=n.child;n!==null;)qw(e,t,n),n=n.sibling}function qw(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Qc,n)}catch{}switch(n.tag){case 5:At||Qi(n,t);case 6:var r=Et,o=Dn;Et=null,Ur(e,t,n),Et=r,Dn=o,Et!==null&&(Dn?(e=Et,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Et.removeChild(n.stateNode));break;case 18:Et!==null&&(Dn?(e=Et,n=n.stateNode,e.nodeType===8?nf(e.parentNode,n):e.nodeType===1&&nf(e,n),Va(e)):nf(Et,n.stateNode));break;case 4:r=Et,o=Dn,Et=n.stateNode.containerInfo,Dn=!0,Ur(e,t,n),Et=r,Dn=o;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&$h(n,t,s),o=o.next}while(o!==r)}Ur(e,t,n);break;case 1:if(!At&&(Qi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){st(n,t,a)}Ur(e,t,n);break;case 21:Ur(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,Ur(e,t,n),At=r):Ur(e,t,n);break;default:Ur(e,t,n)}}function fg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YE),t.forEach(function(r){var o=iC.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Pn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*XE(r/1960))-r,10e?16:e,lo===null)var r=!1;else{if(e=lo,lo=null,mc=0,Ae&6)throw Error(z(331));var o=Ae;for(Ae|=4,J=e.current;J!==null;){var i=J,s=i.child;if(J.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lct()-sm?ai(e,0):im|=n),Xt(e,t)}function ox(e,t){t===0&&(e.mode&1?(t=nu,nu<<=1,!(nu&130023424)&&(nu=4194304)):t=1);var n=zt();e=Tr(e,t),e!==null&&(Ol(e,t,n),Xt(e,n))}function oC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ox(e,n)}function iC(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),ox(e,n)}var ix;ix=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qt.current)Yt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Yt=!1,ZE(e,t,n);Yt=!!(e.flags&131072)}else Yt=!1,Je&&t.flags&1048576&&lw(t,sc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ou(e,t),e=t.pendingProps;var o=ks(t,Dt.current);rs(t,n),o=Jp(null,t,r,e,o,n);var i=em();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gt(r)?(i=!0,oc(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Qp(t),o.updater=ed,t.stateNode=o,o._reactInternals=t,bh(t,r,e,n),t=Eh(null,t,r,!0,i,n)):(t.tag=0,Je&&i&&zp(t),Ft(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ou(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=aC(r),e=On(r,e),o){case 0:t=_h(null,t,r,e,n);break e;case 1:t=ag(null,t,r,e,n);break e;case 11:t=ig(null,t,r,e,n);break e;case 14:t=sg(null,t,r,On(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),_h(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),ag(e,t,r,o,n);case 3:e:{if(Vw(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,fw(e,t),uc(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ps(Error(z(423)),t),t=lg(e,t,r,n,o);break e}else if(r!==o){o=Ps(Error(z(424)),t),t=lg(e,t,r,n,o);break e}else for(sn=go(t.stateNode.containerInfo.firstChild),ln=t,Je=!0,jn=null,n=vw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ts(),r===o){t=$r(e,t,n);break e}Ft(e,t,r,n)}t=t.child}return t;case 5:return gw(t),e===null&&yh(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,hh(r,o)?s=null:i!==null&&hh(r,i)&&(t.flags|=32),zw(e,t),Ft(e,t,s,n),t.child;case 6:return e===null&&yh(t),null;case 13:return Bw(e,t,n);case 4:return Yp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$s(t,null,r,n):Ft(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),ig(e,t,r,o,n);case 7:return Ft(e,t,t.pendingProps,n),t.child;case 8:return Ft(e,t,t.pendingProps.children,n),t.child;case 12:return Ft(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ze(ac,r._currentValue),r._currentValue=s,i!==null)if(Bn(i.value,s)){if(i.children===o.children&&!qt.current){t=$r(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Sr(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),wh(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),wh(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ft(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,rs(t,n),o=kn(o),r=r(o),t.flags|=1,Ft(e,t,r,n),t.child;case 14:return r=t.type,o=On(r,t.pendingProps),o=On(r.type,o),sg(e,t,r,o,n);case 15:return Fw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:On(r,o),Ou(e,t),t.tag=1,Gt(r)?(e=!0,oc(t)):e=!1,rs(t,n),pw(t,r,o),bh(t,r,o,n),Eh(null,t,r,!0,e,n);case 19:return Ww(e,t,n);case 22:return Uw(e,t,n)}throw Error(z(156,t.tag))};function sx(e,t){return O0(e,t)}function sC(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,n,r){return new sC(e,t,n,r)}function cm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aC(e){if(typeof e=="function")return cm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rp)return 11;if(e===Pp)return 14}return 2}function bo(e,t){var n=e.alternate;return n===null?(n=En(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")cm(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Fi:return li(n.children,o,i,t);case $p:s=8,o|=8;break;case Hf:return e=En(12,n,t,o|2),e.elementType=Hf,e.lanes=i,e;case Zf:return e=En(13,n,t,o),e.elementType=Zf,e.lanes=i,e;case Kf:return e=En(19,n,t,o),e.elementType=Kf,e.lanes=i,e;case m0:return od(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h0:s=10;break e;case p0:s=9;break e;case Rp:s=11;break e;case Pp:s=14;break e;case Qr:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=En(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function li(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function od(e,t,n,r){return e=En(22,e,r,t),e.elementType=m0,e.lanes=n,e.stateNode={isHidden:!1},e}function df(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function ff(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lC(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hd(0),this.expirationTimes=Hd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hd(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function dm(e,t,n,r,o,i,s,a,l){return e=new lC(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=En(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qp(i),e}function uC(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cx)}catch(e){console.error(e)}}cx(),l0.exports=dn;var Dr=l0.exports;const dx=xp(Dr),pC=qy({__proto__:null,default:dx},[Dr]);var fx,xg=Dr;fx=xg.createRoot,xg.hydrateRoot;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>mC(n,t))}function it(...e){return c.useCallback(hx(...e),e)}function Mr(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),l=n.length;n=[...n,s];function u(h){const{scope:p,children:g,...y}=h,v=(p==null?void 0:p[e][l])||a,b=c.useMemo(()=>y,Object.values(y));return c.createElement(v.Provider,{value:b},g)}function d(h,p){const g=(p==null?void 0:p[e][l])||a,y=c.useContext(g);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,vC(o,...t)]}function vC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Eo=c.forwardRef((e,t)=>{const{children:n,...r}=e,o=c.Children.toArray(n),i=o.find(yC);if(i){const s=i.props.children,a=o.map(l=>l===i?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:l);return c.createElement(jh,ne({},r,{ref:t}),c.isValidElement(s)?c.cloneElement(s,void 0,a):null)}return c.createElement(jh,ne({},r,{ref:t}),n)});Eo.displayName="Slot";const jh=c.forwardRef((e,t)=>{const{children:n,...r}=e;return c.isValidElement(n)?c.cloneElement(n,{...wC(r,n.props),ref:t?hx(t,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});jh.displayName="SlotClone";const gC=({children:e})=>c.createElement(c.Fragment,null,e);function yC(e){return c.isValidElement(e)&&e.type===gC}function wC(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function mm(e){const t=e+"CollectionProvider",[n,r]=Mr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:y,children:v}=g,b=de.useRef(null),m=de.useRef(new Map).current;return de.createElement(o,{scope:y,itemMap:m,collectionRef:b},v)},a=e+"CollectionSlot",l=de.forwardRef((g,y)=>{const{scope:v,children:b}=g,m=i(a,v),f=it(y,m.collectionRef);return de.createElement(Eo,{ref:f},b)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=de.forwardRef((g,y)=>{const{scope:v,children:b,...m}=g,f=de.useRef(null),w=it(y,f),S=i(u,v);return de.useEffect(()=>(S.itemMap.set(f,{ref:f,...m}),()=>void S.itemMap.delete(f))),de.createElement(Eo,{[d]:"",ref:w},b)});function p(g){const y=i(e+"CollectionConsumer",g);return de.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const m=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,_)=>m.indexOf(S.ref.current)-m.indexOf(_.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},p,r]}const xC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=xC.reduce((e,t)=>{const n=c.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Eo:t;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(a,ne({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function px(e,t){e&&Dr.flushSync(()=>e.dispatchEvent(t))}function Vt(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function bC(e,t=globalThis==null?void 0:globalThis.document){const n=Vt(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Ih="dismissableLayer.update",SC="dismissableLayer.pointerDownOutside",_C="dismissableLayer.focusOutside";let bg;const mx=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vm=c.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...u}=e,d=c.useContext(mx),[h,p]=c.useState(null),g=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,y]=c.useState({}),v=it(t,T=>p(T)),b=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),f=b.indexOf(m),w=h?b.indexOf(h):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,_=w>=f,C=CC(T=>{const O=T.target,j=[...d.branches].some(V=>V.contains(O));!_||j||(i==null||i(T),a==null||a(T),T.defaultPrevented||l==null||l())},g),E=kC(T=>{const O=T.target;[...d.branches].some(V=>V.contains(O))||(s==null||s(T),a==null||a(T),T.defaultPrevented||l==null||l())},g);return bC(T=>{w===d.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),c.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(bg=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Sg(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=bg)}},[h,g,r,d]),c.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Sg())},[h,d]),c.useEffect(()=>{const T=()=>y({});return document.addEventListener(Ih,T),()=>document.removeEventListener(Ih,T)},[]),c.createElement(ke.div,ne({},u,{ref:v,style:{pointerEvents:S?_?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,C.onPointerDownCapture)}))}),EC=c.forwardRef((e,t)=>{const n=c.useContext(mx),r=c.useRef(null),o=it(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.createElement(ke.div,ne({},e,{ref:o}))});function CC(e,t=globalThis==null?void 0:globalThis.document){const n=Vt(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let d=function(){vx(SC,n,u,{discrete:!0})};var l=d;const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kC(e,t=globalThis==null?void 0:globalThis.document){const n=Vt(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&vx(_C,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sg(){const e=new CustomEvent(Ih);document.dispatchEvent(e)}function vx(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?px(o,i):o.dispatchEvent(i)}const TC=vm,$C=EC,gm=c.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?dx.createPortal(c.createElement(ke.div,ne({},o,{ref:t})),r):null}),Jt=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function RC(e,t){return c.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Bs=e=>{const{present:t,children:n}=e,r=PC(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=it(r.ref,o.ref);return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};Bs.displayName="Presence";function PC(e){const[t,n]=c.useState(),r=c.useRef({}),o=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=RC(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=pu(r.current);i.current=a==="mounted"?u:"none"},[a]),Jt(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,g=pu(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Jt(()=>{if(t){const u=h=>{const g=pu(r.current).includes(h.animationName);h.target===t&&g&&Dr.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(i.current=pu(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function pu(e){return(e==null?void 0:e.animationName)||"none"}function Os({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=NC({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Vt(n),l=c.useCallback(u=>{if(i){const h=typeof u=="function"?u(e):u;h!==e&&a(h)}else o(u)},[i,e,o,a]);return[s,l]}function NC({defaultProp:e,onChange:t}){const n=c.useState(e),[r]=n,o=c.useRef(r),i=Vt(t);return c.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const ym=c.forwardRef((e,t)=>c.createElement(ke.span,ne({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),gx="ToastProvider",[wm,OC,AC]=mm("Toast"),[yx,kM]=Mr("Toast",[AC]),[DC,ud]=yx(gx),wx=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=c.useState(null),[u,d]=c.useState(0),h=c.useRef(!1),p=c.useRef(!1);return c.createElement(wm.Provider,{scope:t},c.createElement(DC,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:c.useCallback(()=>d(g=>g+1),[]),onToastRemove:c.useCallback(()=>d(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p},s))};wx.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${gx}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const MC="ToastViewport",jC=["F8"],Lh="toast.viewportPause",Fh="toast.viewportResume",IC=c.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=jC,label:o="Notifications ({hotkey})",...i}=e,s=ud(MC,n),a=OC(n),l=c.useRef(null),u=c.useRef(null),d=c.useRef(null),h=c.useRef(null),p=it(t,h,s.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;c.useEffect(()=>{const b=m=>{var f;r.every(S=>m[S]||m.code===S)&&((f=h.current)===null||f===void 0||f.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),c.useEffect(()=>{const b=l.current,m=h.current;if(y&&b&&m){const f=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent(Lh);m.dispatchEvent(C),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(Fh);m.dispatchEvent(C),s.isClosePausedRef.current=!1}},S=C=>{!b.contains(C.relatedTarget)&&w()},_=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",f),b.addEventListener("focusout",S),b.addEventListener("pointermove",f),b.addEventListener("pointerleave",_),window.addEventListener("blur",f),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",f),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",f),b.removeEventListener("pointerleave",_),window.removeEventListener("blur",f),window.removeEventListener("focus",w)}}},[y,s.isClosePausedRef]);const v=c.useCallback(({tabbingDirection:b})=>{const f=a().map(w=>{const S=w.ref.current,_=[S,...JC(S)];return b==="forwards"?_:_.reverse()});return(b==="forwards"?f.reverse():f).flat()},[a]);return c.useEffect(()=>{const b=h.current;if(b){const m=f=>{const w=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!w){const T=document.activeElement,O=f.shiftKey;if(f.target===b&&O){var _;(_=u.current)===null||_===void 0||_.focus();return}const D=v({tabbingDirection:O?"backwards":"forwards"}),W=D.findIndex(M=>M===T);if(hf(D.slice(W+1)))f.preventDefault();else{var C,E;O?(C=u.current)===null||C===void 0||C.focus():(E=d.current)===null||E===void 0||E.focus()}}};return b.addEventListener("keydown",m),()=>b.removeEventListener("keydown",m)}},[a,v]),c.createElement($C,{ref:l,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"}},y&&c.createElement(_g,{ref:u,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"forwards"});hf(b)}}),c.createElement(wm.Slot,{scope:n},c.createElement(ke.ol,ne({tabIndex:-1},i,{ref:p}))),y&&c.createElement(_g,{ref:d,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"backwards"});hf(b)}}))}),LC="ToastFocusProxy",_g=c.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=ud(LC,n);return c.createElement(ym,ne({"aria-hidden":!0,tabIndex:0},o,{ref:t,style:{position:"fixed"},onFocus:s=>{var a;const l=s.relatedTarget;!((a=i.viewport)!==null&&a!==void 0&&a.contains(l))&&r()}}))}),cd="Toast",FC="toast.swipeStart",UC="toast.swipeMove",zC="toast.swipeCancel",VC="toast.swipeEnd",BC=c.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a=!0,l]=Os({prop:r,defaultProp:o,onChange:i});return c.createElement(Bs,{present:n||a},c.createElement(xx,ne({open:a},s,{ref:t,onClose:()=>l(!1),onPause:Vt(e.onPause),onResume:Vt(e.onResume),onSwipeStart:Ee(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Ee(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ee(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})))}),[WC,HC]=yx(cd,{onClose(){}}),xx=c.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:g,...y}=e,v=ud(cd,n),[b,m]=c.useState(null),f=it(t,M=>m(M)),w=c.useRef(null),S=c.useRef(null),_=o||v.duration,C=c.useRef(0),E=c.useRef(_),T=c.useRef(0),{onToastAdd:O,onToastRemove:j}=v,V=Vt(()=>{var M;(b==null?void 0:b.contains(document.activeElement))&&((M=v.viewport)===null||M===void 0||M.focus()),s()}),D=c.useCallback(M=>{!M||M===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(V,M))},[V]);c.useEffect(()=>{const M=v.viewport;if(M){const F=()=>{D(E.current),u==null||u()},H=()=>{const oe=new Date().getTime()-C.current;E.current=E.current-oe,window.clearTimeout(T.current),l==null||l()};return M.addEventListener(Lh,H),M.addEventListener(Fh,F),()=>{M.removeEventListener(Lh,H),M.removeEventListener(Fh,F)}}},[v.viewport,_,l,u,D]),c.useEffect(()=>{i&&!v.isClosePausedRef.current&&D(_)},[i,_,v.isClosePausedRef,D]),c.useEffect(()=>(O(),()=>j()),[O,j]);const W=c.useMemo(()=>b?Ex(b):null,[b]);return v.viewport?c.createElement(c.Fragment,null,W&&c.createElement(ZC,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0},W),c.createElement(WC,{scope:n,onClose:V},Dr.createPortal(c.createElement(wm.ItemSlot,{scope:n},c.createElement(TC,{asChild:!0,onEscapeKeyDown:Ee(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||V(),v.isFocusedToastEscapeKeyDownRef.current=!1})},c.createElement(ke.li,ne({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection},y,{ref:f,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ee(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:Ee(e.onPointerDown,M=>{M.button===0&&(w.current={x:M.clientX,y:M.clientY})}),onPointerMove:Ee(e.onPointerMove,M=>{if(!w.current)return;const F=M.clientX-w.current.x,H=M.clientY-w.current.y,oe=!!S.current,L=["left","right"].includes(v.swipeDirection),K=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,re=L?K(0,F):0,he=L?0:K(0,H),ve=M.pointerType==="touch"?10:2,Ue={x:re,y:he},je={originalEvent:M,delta:Ue};oe?(S.current=Ue,mu(UC,h,je,{discrete:!1})):Eg(Ue,v.swipeDirection,ve)?(S.current=Ue,mu(FC,d,je,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(F)>ve||Math.abs(H)>ve)&&(w.current=null)}),onPointerUp:Ee(e.onPointerUp,M=>{const F=S.current,H=M.target;if(H.hasPointerCapture(M.pointerId)&&H.releasePointerCapture(M.pointerId),S.current=null,w.current=null,F){const oe=M.currentTarget,L={originalEvent:M,delta:F};Eg(F,v.swipeDirection,v.swipeThreshold)?mu(VC,g,L,{discrete:!0}):mu(zC,p,L,{discrete:!0}),oe.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})))),v.viewport))):null});xx.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${cd}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const ZC=e=>{const{__scopeToast:t,children:n,...r}=e,o=ud(cd,t),[i,s]=c.useState(!1),[a,l]=c.useState(!1);return GC(()=>s(!0)),c.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.createElement(gm,{asChild:!0},c.createElement(ym,r,i&&c.createElement(c.Fragment,null,o.label," ",n)))},KC=c.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.createElement(ke.div,ne({},r,{ref:t}))}),QC=c.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.createElement(ke.div,ne({},r,{ref:t}))}),YC="ToastAction",bx=c.forwardRef((e,t)=>{const{altText:n,...r}=e;return n?c.createElement(_x,{altText:n,asChild:!0},c.createElement(Sx,ne({},r,{ref:t}))):null});bx.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${YC}\``)}};const qC="ToastClose",Sx=c.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=HC(qC,n);return c.createElement(_x,{asChild:!0},c.createElement(ke.button,ne({type:"button"},r,{ref:t,onClick:Ee(e.onClick,o.onClose)})))}),_x=c.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return c.createElement(ke.div,ne({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0},o,{ref:t}))});function Ex(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),XC(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Ex(r))}}),t}function mu(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?px(o,i):o.dispatchEvent(i)}const Eg=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function GC(e=()=>{}){const t=Vt(e);Jt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function XC(e){return e.nodeType===e.ELEMENT_NODE}function JC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function hf(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}const ek=wx,Cx=IC,kx=BC,Tx=KC,$x=QC,Rx=bx,Px=Sx;function Nx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,kg=Ox,jl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return kg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const p=Cg(d)||Cg(h);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;return p===void 0||(u[h]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:p,...g}=d;return Object.entries(g).every(y=>{let[v,b]=y;return Array.isArray(b)?b.includes({...i,...a}[v]):{...i,...a}[v]===b})?[...u,h,p]:u},[]);return kg(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};var tk={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"};const nk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),en=(e,t)=>{const n=c.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:a,...l},u)=>c.createElement("svg",{ref:u,...tk,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${nk(e)}`,...l},[...t.map(([d,h])=>c.createElement(d,h)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${e}`,n},rk=en("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ok=en("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),ik=en("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),sk=en("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),ak=en("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),lk=en("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),xm=en("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),uk=en("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),ck=en("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}],["path",{d:"M19 3v4",key:"vgv24u"}],["path",{d:"M21 5h-4",key:"1wcg1f"}]]),dk=en("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),fk=en("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),hk=en("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),pk=en("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),Ax=en("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bm="-";function mk(e){const t=gk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(bm);return a[0]===""&&a.length!==1&&a.shift(),Dx(a,t)||vk(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Dx(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Dx(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(bm);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const Tg=/^\[(.+)\]$/;function vk(e){if(Tg.test(e)){const t=Tg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function gk(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return wk(Object.entries(e.classGroups),n).forEach(([i,s])=>{Uh(s,r,i,t)}),r}function Uh(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:$g(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(yk(o)){Uh(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Uh(s,$g(t,i),n,r)})})}function $g(e,t){let n=e;return t.split(bm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function yk(e){return e.isThemeGetter}function wk(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function xk(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const Mx="!";function bk(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,u=0,d;for(let v=0;vu?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}}}function Sk(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function _k(e){return{cache:xk(e.cacheSize),splitModifiers:bk(e),...mk(e)}}const Ek=/\s+/;function Ck(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(Ek).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(s);let h=r(d?u.substring(0,d):u),p=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:s};if(h=r(u),!h)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=Sk(a).join(":");return{isTailwindClass:!0,modifierId:l?g+Mx:g,classGroupId:h,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:u}=s,d=a+l;return i.has(d)?!1:(i.add(d),o(l,u).forEach(h=>i.add(a+h)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function kk(){let e=0,t,n,r="";for(;eh(d),e());return n=_k(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=Ck(l,n);return o(l,d),d}return function(){return i(kk.apply(null,arguments))}}function Qe(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Ix=/^\[(?:([a-z-]+):)?(.+)\]$/i,$k=/^\d+\/\d+$/,Rk=new Set(["px","full","screen"]),Pk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nk=/\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$/,Ok=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ak=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Nn(e){return Qo(e)||Rk.has(e)||$k.test(e)}function zr(e){return Ws(e,"length",zk)}function Qo(e){return!!e&&!Number.isNaN(Number(e))}function vu(e){return Ws(e,"number",Qo)}function sa(e){return!!e&&Number.isInteger(Number(e))}function Dk(e){return e.endsWith("%")&&Qo(e.slice(0,-1))}function xe(e){return Ix.test(e)}function Vr(e){return Pk.test(e)}const Mk=new Set(["length","size","percentage"]);function jk(e){return Ws(e,Mk,Lx)}function Ik(e){return Ws(e,"position",Lx)}const Lk=new Set(["image","url"]);function Fk(e){return Ws(e,Lk,Bk)}function Uk(e){return Ws(e,"",Vk)}function aa(){return!0}function Ws(e,t,n){const r=Ix.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function zk(e){return Nk.test(e)}function Lx(){return!1}function Vk(e){return Ok.test(e)}function Bk(e){return Ak.test(e)}function Wk(){const e=Qe("colors"),t=Qe("spacing"),n=Qe("blur"),r=Qe("brightness"),o=Qe("borderColor"),i=Qe("borderRadius"),s=Qe("borderSpacing"),a=Qe("borderWidth"),l=Qe("contrast"),u=Qe("grayscale"),d=Qe("hueRotate"),h=Qe("invert"),p=Qe("gap"),g=Qe("gradientColorStops"),y=Qe("gradientColorStopPositions"),v=Qe("inset"),b=Qe("margin"),m=Qe("opacity"),f=Qe("padding"),w=Qe("saturate"),S=Qe("scale"),_=Qe("sepia"),C=Qe("skew"),E=Qe("space"),T=Qe("translate"),O=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",xe,t],D=()=>[xe,t],W=()=>["",Nn,zr],M=()=>["auto",Qo,xe],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],L=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",xe],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],he=()=>[Qo,vu],ve=()=>[Qo,xe];return{cacheSize:500,separator:":",theme:{colors:[aa],spacing:[Nn,zr],blur:["none","",Vr,xe],brightness:he(),borderColor:[e],borderRadius:["none","","full",Vr,xe],borderSpacing:D(),borderWidth:W(),contrast:he(),grayscale:K(),hueRotate:ve(),invert:K(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Dk,zr],inset:V(),margin:V(),opacity:he(),padding:D(),saturate:he(),scale:he(),sepia:K(),skew:ve(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",xe]}],container:["container"],columns:[{columns:[Vr]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"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"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),xe]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sa,xe]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xe]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",sa,xe]}],"grid-cols":[{"grid-cols":[aa]}],"col-start-end":[{col:["auto",{span:["full",sa,xe]},xe]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[aa]}],"row-start-end":[{row:["auto",{span:[sa,xe]},xe]}],"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":["auto","min","max","fr",xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",xe,t]}],"min-w":[{"min-w":["min","max","fit",xe,Nn]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Vr]},Vr,xe]}],h:[{h:[xe,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Nn,xe]}],"max-h":[{"max-h":[xe,t,"min","max","fit"]}],"font-size":[{text:["base",Vr,zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vu]}],"font-family":[{font:[aa]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xe]}],"line-clamp":[{"line-clamp":["none",Qo,vu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nn,xe]}],"list-image":[{"list-image":["none",xe]}],"list-style-type":[{list:["none","disc","decimal",xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Nn,zr]}],"underline-offset":[{"underline-offset":["auto",Nn,xe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),Ik]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Fk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Nn,xe]}],"outline-w":[{outline:[Nn,zr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Nn,zr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Vr,Uk]}],"shadow-color":[{shadow:[aa]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":oe()}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Vr,xe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xe]}],duration:[{duration:ve()}],ease:[{ease:["linear","in","out","in-out",xe]}],delay:[{delay:ve()}],animate:[{animate:["none","spin","ping","pulse","bounce",xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[sa,xe]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xe]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],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",xe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",xe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nn,zr,vu]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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"],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-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-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"],"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"]}}}const Hk=Tk(Wk);function le(...e){return Hk(Ox(e))}const Zk=ek,Fx=c.forwardRef(({className:e,...t},n)=>x.jsx(Cx,{ref:n,className:le("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Fx.displayName=Cx.displayName;const Kk=jl("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ux=c.forwardRef(({className:e,variant:t,...n},r)=>x.jsx(kx,{ref:r,className:le(Kk({variant:t}),e),...n}));Ux.displayName=kx.displayName;const Qk=c.forwardRef(({className:e,...t},n)=>x.jsx(Rx,{ref:n,className:le("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Qk.displayName=Rx.displayName;const zx=c.forwardRef(({className:e,...t},n)=>x.jsx(Px,{ref:n,className:le("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:x.jsx(Ax,{className:"h-4 w-4"})}));zx.displayName=Px.displayName;const Vx=c.forwardRef(({className:e,...t},n)=>x.jsx(Tx,{ref:n,className:le("text-sm font-semibold",e),...t}));Vx.displayName=Tx.displayName;const Bx=c.forwardRef(({className:e,...t},n)=>x.jsx($x,{ref:n,className:le("text-sm opacity-90",e),...t}));Bx.displayName=$x.displayName;const Yk=1,qk=1e6;let pf=0;function Gk(){return pf=(pf+1)%Number.MAX_VALUE,pf.toString()}const mf=new Map,Rg=e=>{if(mf.has(e))return;const t=setTimeout(()=>{mf.delete(e),Oa({type:"REMOVE_TOAST",toastId:e})},qk);mf.set(e,t)},Xk=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Yk)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Rg(n):e.toasts.forEach(r=>{Rg(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ju=[];let Iu={toasts:[]};function Oa(e){Iu=Xk(Iu,e),ju.forEach(t=>{t(Iu)})}function Sm({...e}){const t=Gk(),n=o=>Oa({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Oa({type:"DISMISS_TOAST",toastId:t});return Oa({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Wx(){const[e,t]=c.useState(Iu);return c.useEffect(()=>(ju.push(t),()=>{const n=ju.indexOf(t);n>-1&&ju.splice(n,1)}),[e]),{...e,toast:Sm,dismiss:n=>Oa({type:"DISMISS_TOAST",toastId:n})}}function Jk(){const{toasts:e}=Wx();return x.jsxs(Zk,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return x.jsxs(Ux,{...i,children:[x.jsxs("div",{className:"grid gap-1",children:[n&&x.jsx(Vx,{children:n}),r&&x.jsx(Bx,{children:r})]}),o,x.jsx(zx,{})]},t)}),x.jsx(Fx,{})]})}var Hs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},As=typeof window>"u"||"Deno"in window;function wn(){}function eT(e,t){return typeof e=="function"?e(t):e}function zh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pg(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==_m(s,t.options))return!1}else if(!tl(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function Ng(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(el(t.options.mutationKey)!==el(i))return!1}else if(!tl(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function _m(e,t){return((t==null?void 0:t.queryKeyHashFn)||el)(e)}function el(e){return JSON.stringify(e,(t,n)=>Vh(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function tl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!tl(e[n],t[n])):!1}function Zx(e,t){if(e===t)return e;const n=Og(e)&&Og(t);if(n||Vh(e)&&Vh(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,s=n?[]:{};let a=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!Ag(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ag(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kx(e){return new Promise(t=>{setTimeout(t,e)})}function Dg(e){Kx(0).then(e)}function Bh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zx(e,t):t}function tT(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nT(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xo,Jr,us,Uy,rT=(Uy=class extends Hs{constructor(){super();te(this,Xo,void 0);te(this,Jr,void 0);te(this,us,void 0);Y(this,us,t=>{if(!As&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Jr)||this.setEventListener(k(this,us))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Jr))==null||t.call(this),Y(this,Jr,void 0))}setEventListener(t){var n;Y(this,us,t),(n=k(this,Jr))==null||n.call(this),Y(this,Jr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,Xo)!==t&&(Y(this,Xo,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof k(this,Xo)=="boolean"?k(this,Xo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Xo=new WeakMap,Jr=new WeakMap,us=new WeakMap,Uy),wc=new rT,cs,eo,ds,zy,oT=(zy=class extends Hs{constructor(){super();te(this,cs,!0);te(this,eo,void 0);te(this,ds,void 0);Y(this,ds,t=>{if(!As&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,eo)||this.setEventListener(k(this,ds))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,eo))==null||t.call(this),Y(this,eo,void 0))}setEventListener(t){var n;Y(this,ds,t),(n=k(this,eo))==null||n.call(this),Y(this,eo,t(this.setOnline.bind(this)))}setOnline(t){k(this,cs)!==t&&(Y(this,cs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,cs)}},cs=new WeakMap,eo=new WeakMap,ds=new WeakMap,zy),xc=new oT;function iT(e){return Math.min(1e3*2**e,3e4)}function dd(e){return(e??"online")==="online"?xc.isOnline():!0}var Qx=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vf(e){return e instanceof Qx}function Yx(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((b,m)=>{i=b,s=m}),l=b=>{var m;r||(g(new Qx(b)),(m=e.abort)==null||m.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>!wc.isFocused()||e.networkMode!=="always"&&!xc.isOnline(),p=b=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,b),o==null||o(),i(b))},g=b=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,b),o==null||o(),s(b))},y=()=>new Promise(b=>{var m;o=f=>{const w=r||!h();return w&&b(f),w},(m=e.onPause)==null||m.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),v=()=>{if(r)return;let b;try{b=e.fn()}catch(m){b=Promise.reject(m)}Promise.resolve(b).then(p).catch(m=>{var C;if(r)return;const f=e.retry??(As?0:3),w=e.retryDelay??iT,S=typeof w=="function"?w(n,m):w,_=f===!0||typeof f=="number"&&n{if(h())return y()}).then(()=>{t?g(m):v()})})};return dd(e.networkMode)?v():y().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function sT(){let e=[],t=0,n=d=>{d()},r=d=>{d()};const o=d=>{let h;t++;try{h=d()}finally{t--,t||a()}return h},i=d=>{t?e.push(d):Dg(()=>{n(d)})},s=d=>(...h)=>{i(()=>{d(...h)})},a=()=>{const d=e;e=[],d.length&&Dg(()=>{r(()=>{d.forEach(h=>{n(h)})})})};return{batch:o,batchCalls:s,schedule:i,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d}}}var vt=sT(),Jo,Vy,qx=(Vy=class{constructor(){te(this,Jo,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zh(this.gcTime)&&Y(this,Jo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(As?1/0:5*60*1e3))}clearGcTimeout(){k(this,Jo)&&(clearTimeout(k(this,Jo)),Y(this,Jo,void 0))}},Jo=new WeakMap,Vy),fs,hs,mn,to,vn,xt,wl,ei,ps,Lu,An,hr,By,aT=(By=class extends qx{constructor(t){super();te(this,ps);te(this,An);te(this,fs,void 0);te(this,hs,void 0);te(this,mn,void 0);te(this,to,void 0);te(this,vn,void 0);te(this,xt,void 0);te(this,wl,void 0);te(this,ei,void 0);Y(this,ei,!1),Y(this,wl,t.defaultOptions),ye(this,ps,Lu).call(this,t.options),Y(this,xt,[]),Y(this,mn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,fs,t.state||lT(this.options)),this.state=k(this,fs),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!k(this,xt).length&&this.state.fetchStatus==="idle"&&k(this,mn).remove(this)}setData(t,n){const r=Bh(this.state.data,t,this.options);return ye(this,An,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ye(this,An,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=k(this,to);return(r=k(this,vn))==null||r.cancel(t),n?n.then(wn).catch(wn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,fs))}isActive(){return k(this,xt).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||k(this,xt).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Hx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=k(this,xt).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,vn))==null||n.continue()}onOnline(){var n;const t=k(this,xt).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,vn))==null||n.continue()}addObserver(t){k(this,xt).includes(t)||(k(this,xt).push(t),this.clearGcTimeout(),k(this,mn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){k(this,xt).includes(t)&&(Y(this,xt,k(this,xt).filter(n=>n!==t)),k(this,xt).length||(k(this,vn)&&(k(this,ei)?k(this,vn).cancel({revert:!0}):k(this,vn).cancelRetry()),this.scheduleGc()),k(this,mn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return k(this,xt).length}invalidate(){this.state.isInvalidated||ye(this,An,hr).call(this,{type:"invalidate"})}fetch(t,n){var u,d,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,to))return(u=k(this,vn))==null||u.continueRetry(),k(this,to)}if(t&&ye(this,ps,Lu).call(this,t),!this.options.queryFn){const g=k(this,xt).find(y=>y.options.queryFn);g&&ye(this,ps,Lu).call(this,g.options)}const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Y(this,ei,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Y(this,ei,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(d=this.options.behavior)==null||d.onFetch(a,this),Y(this,hs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&ye(this,An,hr).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var y,v,b,m;vf(g)&&g.silent||ye(this,An,hr).call(this,{type:"error",error:g}),vf(g)||((v=(y=k(this,mn).config).onError)==null||v.call(y,g,this),(m=(b=k(this,mn).config).onSettled)==null||m.call(b,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Y(this,vn,Yx({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,v,b,m;if(typeof g>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(v=(y=k(this,mn).config).onSuccess)==null||v.call(y,g,this),(m=(b=k(this,mn).config).onSettled)==null||m.call(b,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,y)=>{ye(this,An,hr).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{ye(this,An,hr).call(this,{type:"pause"})},onContinue:()=>{ye(this,An,hr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Y(this,to,k(this,vn).promise),k(this,to)}},fs=new WeakMap,hs=new WeakMap,mn=new WeakMap,to=new WeakMap,vn=new WeakMap,xt=new WeakMap,wl=new WeakMap,ei=new WeakMap,ps=new WeakSet,Lu=function(t){this.options={...k(this,wl),...t},this.updateGcTime(this.options.gcTime)},An=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:dd(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return vf(o)&&o.revert&&k(this,hs)?{...k(this,hs),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vt.batch(()=>{k(this,xt).forEach(r=>{r.onQueryUpdate()}),k(this,mn).notify({query:this,type:"updated",action:t})})},By);function lT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Yn,Wy,uT=(Wy=class extends Hs{constructor(t={}){super();te(this,Yn,void 0);this.config=t,Y(this,Yn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??_m(o,n);let s=this.get(i);return s||(s=new aT({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){k(this,Yn).has(t.queryHash)||(k(this,Yn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,Yn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,Yn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,Yn).get(t)}getAll(){return[...k(this,Yn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Pg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Pg(t,r)):n}notify(t){vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yn=new WeakMap,Wy),qn,xl,tn,ms,Gn,Hr,Hy,cT=(Hy=class extends qx{constructor(t){super();te(this,Gn);te(this,qn,void 0);te(this,xl,void 0);te(this,tn,void 0);te(this,ms,void 0);this.mutationId=t.mutationId,Y(this,xl,t.defaultOptions),Y(this,tn,t.mutationCache),Y(this,qn,[]),this.state=t.state||Gx(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...k(this,xl),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,qn).includes(t)||(k(this,qn).push(t),this.clearGcTimeout(),k(this,tn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,qn,k(this,qn).filter(n=>n!==t)),this.scheduleGc(),k(this,tn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,qn).length||(this.state.status==="pending"?this.scheduleGc():k(this,tn).remove(this))}continue(){var t;return((t=k(this,ms))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,h,p,g,y,v,b,m,f,w,S,_,C,E;const n=()=>(Y(this,ms,Yx({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,O)=>{ye(this,Gn,Hr).call(this,{type:"failed",failureCount:T,error:O})},onPause:()=>{ye(this,Gn,Hr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Gn,Hr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),k(this,ms).promise),r=this.state.status==="pending";try{if(!r){ye(this,Gn,Hr).call(this,{type:"pending",variables:t}),await((i=(o=k(this,tn).config).onMutate)==null?void 0:i.call(o,t,this));const O=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));O!==this.state.context&&ye(this,Gn,Hr).call(this,{type:"pending",context:O,variables:t})}const T=await n();return await((u=(l=k(this,tn).config).onSuccess)==null?void 0:u.call(l,T,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,T,t,this.state.context)),await((g=(p=k(this,tn).config).onSettled)==null?void 0:g.call(p,T,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,T,null,t,this.state.context)),ye(this,Gn,Hr).call(this,{type:"success",data:T}),T}catch(T){try{throw await((m=(b=k(this,tn).config).onError)==null?void 0:m.call(b,T,t,this.state.context,this)),await((w=(f=this.options).onError)==null?void 0:w.call(f,T,t,this.state.context)),await((_=(S=k(this,tn).config).onSettled)==null?void 0:_.call(S,void 0,T,this.state.variables,this.state.context,this)),await((E=(C=this.options).onSettled)==null?void 0:E.call(C,void 0,T,t,this.state.context)),T}finally{ye(this,Gn,Hr).call(this,{type:"error",error:T})}}}},qn=new WeakMap,xl=new WeakMap,tn=new WeakMap,ms=new WeakMap,Gn=new WeakSet,Hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!dd(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vt.batch(()=>{k(this,qn).forEach(r=>{r.onMutationUpdate(t)}),k(this,tn).notify({mutation:this,type:"updated",action:t})})},Hy);function Gx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gn,bl,ti,Zy,dT=(Zy=class extends Hs{constructor(t={}){super();te(this,gn,void 0);te(this,bl,void 0);te(this,ti,void 0);this.config=t,Y(this,gn,[]),Y(this,bl,0)}build(t,n,r){const o=new cT({mutationCache:this,mutationId:++ql(this,bl)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){k(this,gn).push(t),this.notify({type:"added",mutation:t})}remove(t){Y(this,gn,k(this,gn).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){vt.batch(()=>{k(this,gn).forEach(t=>{this.remove(t)})})}getAll(){return k(this,gn)}find(t){const n={exact:!0,...t};return k(this,gn).find(r=>Ng(n,r))}findAll(t={}){return k(this,gn).filter(n=>Ng(t,n))}notify(t){vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Y(this,ti,(k(this,ti)??Promise.resolve()).then(()=>{const t=k(this,gn).filter(n=>n.state.isPaused);return vt.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(wn)),Promise.resolve()))}).then(()=>{Y(this,ti,void 0)})),k(this,ti)}},gn=new WeakMap,bl=new WeakMap,ti=new WeakMap,Zy);function fT(e){return{onFetch:(t,n)=>{const r=async()=>{var y,v,b,m,f;const o=t.options,i=(b=(v=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:v.fetchMore)==null?void 0:b.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((f=t.state.data)==null?void 0:f.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(w,S,_)=>{if(u)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};d(C);const E=await h(C),{maxPages:T}=t.options,O=_?nT:tT;return{pages:O(w.pages,E,T),pageParams:O(w.pageParams,S,T)}};let g;if(i&&s.length){const w=i==="backward",S=w?hT:Mg,_={pages:s,pageParams:a},C=S(o,_);g=await p(_,C,w)}else{g=await p(l,a[0]??o.initialPageParam);const w=e??s.length;for(let S=1;S{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function Mg(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function hT(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var pt,no,ro,vs,gs,oo,ys,ws,Ky,pT=(Ky=class{constructor(e={}){te(this,pt,void 0);te(this,no,void 0);te(this,ro,void 0);te(this,vs,void 0);te(this,gs,void 0);te(this,oo,void 0);te(this,ys,void 0);te(this,ws,void 0);Y(this,pt,e.queryCache||new uT),Y(this,no,e.mutationCache||new dT),Y(this,ro,e.defaultOptions||{}),Y(this,vs,new Map),Y(this,gs,new Map),Y(this,oo,0)}mount(){ql(this,oo)._++,k(this,oo)===1&&(Y(this,ys,wc.subscribe(()=>{wc.isFocused()&&(this.resumePausedMutations(),k(this,pt).onFocus())})),Y(this,ws,xc.subscribe(()=>{xc.isOnline()&&(this.resumePausedMutations(),k(this,pt).onOnline())})))}unmount(){var e,t;ql(this,oo)._--,k(this,oo)===0&&((e=k(this,ys))==null||e.call(this),Y(this,ys,void 0),(t=k(this,ws))==null||t.call(this),Y(this,ws,void 0))}isFetching(e){return k(this,pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,no).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=k(this,pt).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=k(this,pt).find({queryKey:e}),o=r==null?void 0:r.state.data,i=eT(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return k(this,pt).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=k(this,pt).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=k(this,pt);vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,pt),r={type:"active",...e};return vt.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=vt.batch(()=>k(this,pt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(wn).catch(wn)}invalidateQueries(e={},t={}){return vt.batch(()=>{if(k(this,pt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=vt.batch(()=>k(this,pt).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(wn)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(wn)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=k(this,pt).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(wn).catch(wn)}fetchInfiniteQuery(e){return e.behavior=fT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(wn).catch(wn)}resumePausedMutations(){return k(this,no).resumePausedMutations()}getQueryCache(){return k(this,pt)}getMutationCache(){return k(this,no)}getDefaultOptions(){return k(this,ro)}setDefaultOptions(e){Y(this,ro,e)}setQueryDefaults(e,t){k(this,vs).set(el(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,vs).values()];let n={};return t.forEach(r=>{tl(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){k(this,gs).set(el(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,gs).values()];let n={};return t.forEach(r=>{tl(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...k(this,ro).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_m(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,ro).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,pt).clear(),k(this,no).clear()}},pt=new WeakMap,no=new WeakMap,ro=new WeakMap,vs=new WeakMap,gs=new WeakMap,oo=new WeakMap,ys=new WeakMap,ws=new WeakMap,Ky),Zt,He,xs,Nt,ni,bs,Xn,Sl,Ss,_s,ri,oi,io,ii,si,Sa,_l,Wh,El,Hh,Cl,Zh,kl,Kh,Tl,Qh,$l,Yh,Rl,qh,Zc,Xx,Qy,mT=(Qy=class extends Hs{constructor(t,n){super();te(this,si);te(this,_l);te(this,El);te(this,Cl);te(this,kl);te(this,Tl);te(this,$l);te(this,Rl);te(this,Zc);te(this,Zt,void 0);te(this,He,void 0);te(this,xs,void 0);te(this,Nt,void 0);te(this,ni,void 0);te(this,bs,void 0);te(this,Xn,void 0);te(this,Sl,void 0);te(this,Ss,void 0);te(this,_s,void 0);te(this,ri,void 0);te(this,oi,void 0);te(this,io,void 0);te(this,ii,void 0);Y(this,He,void 0),Y(this,xs,void 0),Y(this,Nt,void 0),Y(this,ii,new Set),Y(this,Zt,t),this.options=n,Y(this,Xn,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,He).addObserver(this),jg(k(this,He),this.options)?ye(this,si,Sa).call(this):this.updateResult(),ye(this,kl,Kh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gh(k(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gh(k(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Tl,Qh).call(this),ye(this,$l,Yh).call(this),k(this,He).removeObserver(this)}setOptions(t,n){const r=this.options,o=k(this,He);if(this.options=k(this,Zt).defaultQueryOptions(t),yc(r,this.options)||k(this,Zt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,He),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ye(this,Rl,qh).call(this);const i=this.hasListeners();i&&Ig(k(this,He),o,this.options,r)&&ye(this,si,Sa).call(this),this.updateResult(n),i&&(k(this,He)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ye(this,_l,Wh).call(this);const s=ye(this,El,Hh).call(this);i&&(k(this,He)!==o||this.options.enabled!==r.enabled||s!==k(this,io))&&ye(this,Cl,Zh).call(this,s)}getOptimisticResult(t){const n=k(this,Zt).getQueryCache().build(k(this,Zt),t),r=this.createResult(n,t);return gT(this,r)&&(Y(this,Nt,r),Y(this,bs,this.options),Y(this,ni,k(this,He).state)),r}getCurrentResult(){return k(this,Nt)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(k(this,ii).add(r),t[r])})}),n}getCurrentQuery(){return k(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,Zt).defaultQueryOptions(t),r=k(this,Zt).getQueryCache().build(k(this,Zt),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ye(this,si,Sa).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Nt)))}createResult(t,n){var C;const r=k(this,He),o=this.options,i=k(this,Nt),s=k(this,ni),a=k(this,bs),u=t!==r?t.state:k(this,xs),{state:d}=t;let{error:h,errorUpdatedAt:p,fetchStatus:g,status:y}=d,v=!1,b;if(n._optimisticResults){const E=this.hasListeners(),T=!E&&jg(t,n),O=E&&Ig(t,r,n,o);(T||O)&&(g=dd(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(y="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof d.data<"u")if(i&&d.data===(s==null?void 0:s.data)&&n.select===k(this,Sl))b=k(this,Ss);else try{Y(this,Sl,n.select),b=n.select(d.data),b=Bh(i==null?void 0:i.data,b,n),Y(this,Ss,b),Y(this,Xn,null)}catch(E){Y(this,Xn,E)}else b=d.data;if(typeof n.placeholderData<"u"&&typeof b>"u"&&y==="pending"){let E;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))E=i.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((C=k(this,_s))==null?void 0:C.state.data,k(this,_s)):n.placeholderData,n.select&&typeof E<"u")try{E=n.select(E),Y(this,Xn,null)}catch(T){Y(this,Xn,T)}typeof E<"u"&&(y="success",b=Bh(i==null?void 0:i.data,E,n),v=!0)}k(this,Xn)&&(h=k(this,Xn),b=k(this,Ss),p=Date.now(),y="error");const m=g==="fetching",f=y==="pending",w=y==="error",S=f&&m;return{status:y,fetchStatus:g,isPending:f,isSuccess:y==="success",isError:w,isInitialLoading:S,isLoading:S,data:b,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!f,isLoadingError:w&&d.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:v,isRefetchError:w&&d.dataUpdatedAt!==0,isStale:Em(t,n),refetch:this.refetch}}updateResult(t){const n=k(this,Nt),r=this.createResult(k(this,He),this.options);if(Y(this,ni,k(this,He).state),Y(this,bs,this.options),yc(r,n))return;k(this,ni).data!==void 0&&Y(this,_s,k(this,He)),Y(this,Nt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!k(this,ii).size)return!0;const l=new Set(a??k(this,ii));return this.options.throwOnError&&l.add("error"),Object.keys(k(this,Nt)).some(u=>{const d=u;return k(this,Nt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ye(this,Zc,Xx).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,kl,Kh).call(this)}},Zt=new WeakMap,He=new WeakMap,xs=new WeakMap,Nt=new WeakMap,ni=new WeakMap,bs=new WeakMap,Xn=new WeakMap,Sl=new WeakMap,Ss=new WeakMap,_s=new WeakMap,ri=new WeakMap,oi=new WeakMap,io=new WeakMap,ii=new WeakMap,si=new WeakSet,Sa=function(t){ye(this,Rl,qh).call(this);let n=k(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(wn)),n},_l=new WeakSet,Wh=function(){if(ye(this,Tl,Qh).call(this),As||k(this,Nt).isStale||!zh(this.options.staleTime))return;const n=Hx(k(this,Nt).dataUpdatedAt,this.options.staleTime)+1;Y(this,ri,setTimeout(()=>{k(this,Nt).isStale||this.updateResult()},n))},El=new WeakSet,Hh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,He)):this.options.refetchInterval)??!1},Cl=new WeakSet,Zh=function(t){ye(this,$l,Yh).call(this),Y(this,io,t),!(As||this.options.enabled===!1||!zh(k(this,io))||k(this,io)===0)&&Y(this,oi,setInterval(()=>{(this.options.refetchIntervalInBackground||wc.isFocused())&&ye(this,si,Sa).call(this)},k(this,io)))},kl=new WeakSet,Kh=function(){ye(this,_l,Wh).call(this),ye(this,Cl,Zh).call(this,ye(this,El,Hh).call(this))},Tl=new WeakSet,Qh=function(){k(this,ri)&&(clearTimeout(k(this,ri)),Y(this,ri,void 0))},$l=new WeakSet,Yh=function(){k(this,oi)&&(clearInterval(k(this,oi)),Y(this,oi,void 0))},Rl=new WeakSet,qh=function(){const t=k(this,Zt).getQueryCache().build(k(this,Zt),this.options);if(t===k(this,He))return;const n=k(this,He);Y(this,He,t),Y(this,xs,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Zc=new WeakSet,Xx=function(t){vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,Nt))}),k(this,Zt).getQueryCache().notify({query:k(this,He),type:"observerResultsUpdated"})})},Qy);function vT(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function jg(e,t){return vT(e,t)||e.state.dataUpdatedAt>0&&Gh(e,t,t.refetchOnMount)}function Gh(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Em(e,t)}return!1}function Ig(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Em(e,n)}function Em(e,t){return e.isStaleByTime(t.staleTime)}function gT(e,t){return!yc(e.getCurrentResult(),t)}var so,Lt,yn,gr,Es,Fu,Pl,Xh,Yy,yT=(Yy=class extends Hs{constructor(n,r){super();te(this,Es);te(this,Pl);te(this,so,void 0);te(this,Lt,void 0);te(this,yn,void 0);te(this,gr,void 0);Y(this,Lt,void 0),Y(this,so,n),this.setOptions(r),this.bindMethods(),ye(this,Es,Fu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=k(this,so).defaultMutationOptions(n),yc(r,this.options)||k(this,so).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,yn),observer:this}),(o=k(this,yn))==null||o.setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=k(this,yn))==null||n.removeObserver(this)}onMutationUpdate(n){ye(this,Es,Fu).call(this),ye(this,Pl,Xh).call(this,n)}getCurrentResult(){return k(this,Lt)}reset(){Y(this,yn,void 0),ye(this,Es,Fu).call(this),ye(this,Pl,Xh).call(this)}mutate(n,r){var o;return Y(this,gr,r),(o=k(this,yn))==null||o.removeObserver(this),Y(this,yn,k(this,so).getMutationCache().build(k(this,so),this.options)),k(this,yn).addObserver(this),k(this,yn).execute(n)}},so=new WeakMap,Lt=new WeakMap,yn=new WeakMap,gr=new WeakMap,Es=new WeakSet,Fu=function(){var r;const n=((r=k(this,yn))==null?void 0:r.state)??Gx();Y(this,Lt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Pl=new WeakSet,Xh=function(n){vt.batch(()=>{var r,o,i,s,a,l,u,d;k(this,gr)&&this.hasListeners()&&((n==null?void 0:n.type)==="success"?((o=(r=k(this,gr)).onSuccess)==null||o.call(r,n.data,k(this,Lt).variables,k(this,Lt).context),(s=(i=k(this,gr)).onSettled)==null||s.call(i,n.data,null,k(this,Lt).variables,k(this,Lt).context)):(n==null?void 0:n.type)==="error"&&((l=(a=k(this,gr)).onError)==null||l.call(a,n.error,k(this,Lt).variables,k(this,Lt).context),(d=(u=k(this,gr)).onSettled)==null||d.call(u,void 0,n.error,k(this,Lt).variables,k(this,Lt).context))),this.listeners.forEach(h=>{h(k(this,Lt))})})},Yy),Jx=c.createContext(void 0),fd=e=>{const t=c.useContext(Jx);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wT=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.createElement(Jx.Provider,{value:e},t)),eb=c.createContext(!1),xT=()=>c.useContext(eb);eb.Provider;function bT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ST=c.createContext(bT()),_T=()=>c.useContext(ST);function tb(e,t){return typeof e=="function"?e(...t):!!e}var ET=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},CT=e=>{c.useEffect(()=>{e.clearReset()},[e])},kT=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&tb(n,[e.error,r]),TT=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},$T=(e,t)=>e.isLoading&&e.isFetching&&!t,RT=(e,t,n)=>(e==null?void 0:e.suspense)&&$T(t,n),PT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function NT(e,t,n){const r=fd(n),o=xT(),i=_T(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",TT(s),ET(s,i),CT(i);const[a]=c.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(c.useSyncExternalStore(c.useCallback(u=>{const d=o?()=>{}:a.subscribe(vt.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),RT(s,l,o))throw PT(s,a,i);if(kT({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:a.getCurrentQuery()}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Il(e,t){return NT(e,mT,t)}function Cm(e,t){const n=fd(t),[r]=c.useState(()=>new yT(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);const o=c.useSyncExternalStore(c.useCallback(s=>r.subscribe(vt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=c.useCallback((s,a)=>{r.mutate(s,a).catch(OT)},[r]);if(o.error&&tb(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function OT(){}var AT=function(){return null};/** + * @remix-run/router v1.12.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function vi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MT(){return Math.random().toString(36).substr(2,8)}function Fg(e,t){return{usr:e.state,key:e.key,idx:t}}function nl(e,t,n,r){return n===void 0&&(n=null),at({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?jr(t):t,{state:n,key:t&&t.key||r||MT()})}function gi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function jr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function jT(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=lt.Pop,l=null,u=d();u==null&&(u=0,s.replaceState(at({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function h(){a=lt.Pop;let b=d(),m=b==null?null:b-u;u=b,l&&l({action:a,location:v.location,delta:m})}function p(b,m){a=lt.Push;let f=nl(v.location,b,m);n&&n(f,b),u=d()+1;let w=Fg(f,u),S=v.createHref(f);try{s.pushState(w,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;o.location.assign(S)}i&&l&&l({action:a,location:v.location,delta:1})}function g(b,m){a=lt.Replace;let f=nl(v.location,b,m);n&&n(f,b),u=d();let w=Fg(f,u),S=v.createHref(f);s.replaceState(w,"",S),i&&l&&l({action:a,location:v.location,delta:0})}function y(b){let m=o.location.origin!=="null"?o.location.origin:o.location.href,f=typeof b=="string"?b:gi(b);return Se(m,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,m)}let v={get action(){return a},get location(){return e(o,s)},listen(b){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Lg,h),l=b,()=>{o.removeEventListener(Lg,h),l=null}},createHref(b){return t(o,b)},createURL:y,encodeLocation(b){let m=y(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:g,go(b){return s.go(b)}};return v}var ut;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ut||(ut={}));const IT=new Set(["lazy","caseSensitive","path","id","index","children"]);function LT(e){return e.index===!0}function Jh(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,i],a=typeof o.id=="string"?o.id:s.join("-");if(Se(o.index!==!0||!o.children,"Cannot specify children on an index route"),Se(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),LT(o)){let l=at({},o,t(o),{id:a});return r[a]=l,l}else{let l=at({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=Jh(o.children,t,s,r)),l}})}function qi(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?jr(t):t,o=Co(r.pathname||"/",n);if(o==null)return null;let i=nb(e);UT(i);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(Se(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=_r([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(Se(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),nb(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:KT(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of rb(i.path))o(i,s,l)}),t}function rb(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=rb(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function UT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:QT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const zT=/^:\w+$/,VT=3,BT=2,WT=1,HT=10,ZT=-2,Ug=e=>e==="*";function KT(e,t){let n=e.split("/"),r=n.length;return n.some(Ug)&&(r+=ZT),t&&(r+=BT),n.filter(o=>!Ug(o)).reduce((o,i)=>o+(zT.test(i)?VT:i===""?WT:HT),r)}function QT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function YT(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s{let{paramName:p,isOptional:g}=d;if(p==="*"){let v=a[h]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const y=a[h];return g&&!y?u[p]=void 0:u[p]=XT(y||"",p),u},{}),pathname:i,pathnameBase:s,pattern:e}}function qT(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),vi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function GT(e){try{return decodeURI(e)}catch(t){return vi(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function XT(e,t){try{return decodeURIComponent(e)}catch(n){return vi(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Co(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function JT(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?jr(e):e;return{pathname:n?n.startsWith("/")?n:e$(n,t):t,search:n$(r),hash:r$(o)}}function e$(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function gf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function hd(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function km(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=jr(e):(o=at({},e),Se(!o.pathname||!o.pathname.includes("?"),gf("?","pathname","search",o)),Se(!o.pathname||!o.pathname.includes("#"),gf("#","pathname","hash",o)),Se(!o.search||!o.search.includes("#"),gf("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else if(r){let h=t[t.length-1].replace(/^\//,"").split("/");if(s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),h.pop();o.pathname=p.join("/")}a="/"+h.join("/")}else{let h=t.length-1;if(s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),h-=1;o.pathname=p.join("/")}a=h>=0?t[h]:"/"}let l=JT(o,a),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const _r=e=>e.join("/").replace(/\/\/+/g,"/"),t$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),n$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,r$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Tm{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ob(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ib=["post","put","patch","delete"],o$=new Set(ib),i$=["get",...ib],s$=new Set(i$),a$=new Set([301,302,303,307,308]),l$=new Set([307,308]),yf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},u$={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},la={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},sb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,c$=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ab="remix-router-transitions";function d$(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Se(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let R=e.detectErrorBoundary;o=P=>({hasErrorBoundary:R(P)})}else o=c$;let i={},s=Jh(e.routes,o,void 0,i),a,l=e.basename||"/",u=at({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),d=null,h=new Set,p=null,g=null,y=null,v=e.hydrationData!=null,b=qi(s,e.history.location,l),m=null;if(b==null){let R=xn(404,{pathname:e.history.location.pathname}),{matches:P,route:I}=Qg(s);b=P,m={[I.id]:R}}let f=!b.some(R=>R.route.lazy)&&(!b.some(R=>R.route.loader)||e.hydrationData!=null),w,S={historyAction:e.history.action,location:e.history.location,matches:b,initialized:f,navigation:yf,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},_=lt.Pop,C=!1,E,T=!1,O=new Map,j=null,V=!1,D=!1,W=[],M=[],F=new Map,H=0,oe=-1,L=new Map,K=new Set,re=new Map,he=new Map,ve=new Set,Ue=new Map,je=new Map,ht=!1;function ze(){if(d=e.history.listen(R=>{let{action:P,location:I,delta:q}=R;if(ht){ht=!1;return}vi(je.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ie=lv({currentLocation:S.location,nextLocation:I,historyAction:P});if(ie&&q!=null){ht=!0,e.history.go(q*-1),Uo(ie,{state:"blocked",location:I,proceed(){Uo(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:I}),e.history.go(q)},reset(){let _e=new Map(S.blockers);_e.set(ie,la),$e({blockers:_e})}});return}return Xe(P,I)}),n){S$(t,O);let R=()=>_$(t,O);t.addEventListener("pagehide",R),j=()=>t.removeEventListener("pagehide",R)}return S.initialized||Xe(lt.Pop,S.location),w}function ue(){d&&d(),j&&j(),h.clear(),E&&E.abort(),S.fetchers.forEach((R,P)=>Ve(P)),S.blockers.forEach((R,P)=>Ql(P))}function Me(R){return h.add(R),()=>h.delete(R)}function $e(R,P){P===void 0&&(P={}),S=at({},S,R);let I=[],q=[];u.v7_fetcherPersist&&S.fetchers.forEach((ie,_e)=>{ie.state==="idle"&&(ve.has(_e)?q.push(_e):I.push(_e))}),[...h].forEach(ie=>ie(S,{deletedFetchers:q,unstable_viewTransitionOpts:P.viewTransitionOpts,unstable_flushSync:P.flushSync===!0})),u.v7_fetcherPersist&&(I.forEach(ie=>S.fetchers.delete(ie)),q.forEach(ie=>Ve(ie)))}function Re(R,P,I){var q,ie;let{flushSync:_e}=I===void 0?{}:I,me=S.actionData!=null&&S.navigation.formMethod!=null&&Mn(S.navigation.formMethod)&&S.navigation.state==="loading"&&((q=R.state)==null?void 0:q._isRedirect)!==!0,pe;P.actionData?Object.keys(P.actionData).length>0?pe=P.actionData:pe=null:me?pe=S.actionData:pe=null;let ae=P.loaderData?Kg(S.loaderData,P.loaderData,P.matches||[],P.errors):S.loaderData,Pe=S.blockers;Pe.size>0&&(Pe=new Map(Pe),Pe.forEach((Be,et)=>Pe.set(et,la)));let _t=C===!0||S.navigation.formMethod!=null&&Mn(S.navigation.formMethod)&&((ie=R.state)==null?void 0:ie._isRedirect)!==!0;a&&(s=a,a=void 0),V||_===lt.Pop||(_===lt.Push?e.history.push(R,R.state):_===lt.Replace&&e.history.replace(R,R.state));let Ce;if(_===lt.Pop){let Be=O.get(S.location.pathname);Be&&Be.has(R.pathname)?Ce={currentLocation:S.location,nextLocation:R}:O.has(R.pathname)&&(Ce={currentLocation:R,nextLocation:S.location})}else if(T){let Be=O.get(S.location.pathname);Be?Be.add(R.pathname):(Be=new Set([R.pathname]),O.set(S.location.pathname,Be)),Ce={currentLocation:S.location,nextLocation:R}}$e(at({},P,{actionData:pe,loaderData:ae,historyAction:_,location:R,initialized:!0,navigation:yf,revalidation:"idle",restoreScrollPosition:cv(R,P.matches||S.matches),preventScrollReset:_t,blockers:Pe}),{viewTransitionOpts:Ce,flushSync:_e===!0}),_=lt.Pop,C=!1,T=!1,V=!1,D=!1,W=[],M=[]}async function Ne(R,P){if(typeof R=="number"){e.history.go(R);return}let I=tp(S.location,S.matches,l,u.v7_prependBasename,R,P==null?void 0:P.fromRouteId,P==null?void 0:P.relative),{path:q,submission:ie,error:_e}=zg(u.v7_normalizeFormMethod,!1,I,P),me=S.location,pe=nl(S.location,q,P&&P.state);pe=at({},pe,e.history.encodeLocation(pe));let ae=P&&P.replace!=null?P.replace:void 0,Pe=lt.Push;ae===!0?Pe=lt.Replace:ae===!1||ie!=null&&Mn(ie.formMethod)&&ie.formAction===S.location.pathname+S.location.search&&(Pe=lt.Replace);let _t=P&&"preventScrollReset"in P?P.preventScrollReset===!0:void 0,Ce=(P&&P.unstable_flushSync)===!0,Be=lv({currentLocation:me,nextLocation:pe,historyAction:Pe});if(Be){Uo(Be,{state:"blocked",location:pe,proceed(){Uo(Be,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),Ne(R,P)},reset(){let et=new Map(S.blockers);et.set(Be,la),$e({blockers:et})}});return}return await Xe(Pe,pe,{submission:ie,pendingError:_e,preventScrollReset:_t,replace:P&&P.replace,enableViewTransition:P&&P.unstable_viewTransition,flushSync:Ce})}function Oe(){if(Z(),$e({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){Xe(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}Xe(_||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation})}}async function Xe(R,P,I){E&&E.abort(),E=null,_=R,V=(I&&I.startUninterruptedRevalidation)===!0,zS(S.location,S.matches),C=(I&&I.preventScrollReset)===!0,T=(I&&I.enableViewTransition)===!0;let q=a||s,ie=I&&I.overrideNavigation,_e=qi(q,P,l),me=(I&&I.flushSync)===!0;if(!_e){let et=xn(404,{pathname:P.pathname}),{matches:It,route:Zn}=Qg(q);Dd(),Re(P,{matches:It,loaderData:{},errors:{[Zn.id]:et}},{flushSync:me});return}if(S.initialized&&!D&&v$(S.location,P)&&!(I&&I.submission&&Mn(I.submission.formMethod))){Re(P,{matches:_e},{flushSync:me});return}E=new AbortController;let pe=ca(e.history,P,E.signal,I&&I.submission),ae,Pe;if(I&&I.pendingError)Pe={[Aa(_e).route.id]:I.pendingError};else if(I&&I.submission&&Mn(I.submission.formMethod)){let et=await $t(pe,P,I.submission,_e,{replace:I.replace,flushSync:me});if(et.shortCircuited)return;ae=et.pendingActionData,Pe=et.pendingActionError,ie=wf(P,I.submission),me=!1,pe=new Request(pe.url,{signal:pe.signal})}let{shortCircuited:_t,loaderData:Ce,errors:Be}=await hn(pe,P,_e,ie,I&&I.submission,I&&I.fetcherSubmission,I&&I.replace,me,ae,Pe);_t||(E=null,Re(P,at({matches:_e},ae?{actionData:ae}:{},{loaderData:Ce,errors:Be})))}async function $t(R,P,I,q,ie){ie===void 0&&(ie={}),Z();let _e=x$(P,I);$e({navigation:_e},{flushSync:ie.flushSync===!0});let me,pe=rp(q,P);if(!pe.route.action&&!pe.route.lazy)me={type:ut.error,error:xn(405,{method:R.method,pathname:P.pathname,routeId:pe.route.id})};else if(me=await ua("action",R,pe,q,i,o,l),R.signal.aborted)return{shortCircuited:!0};if(is(me)){let ae;return ie&&ie.replace!=null?ae=ie.replace:ae=me.location===S.location.pathname+S.location.search,await A(S,me,{submission:I,replace:ae}),{shortCircuited:!0}}if(Da(me)){let ae=Aa(q,pe.route.id);return(ie&&ie.replace)!==!0&&(_=lt.Push),{pendingActionData:{},pendingActionError:{[ae.route.id]:me.error}}}if(Yo(me))throw xn(400,{type:"defer-action"});return{pendingActionData:{[pe.route.id]:me.data}}}async function hn(R,P,I,q,ie,_e,me,pe,ae,Pe){let _t=q||wf(P,ie),Ce=ie||_e||Gg(_t),Be=a||s,[et,It]=Vg(e.history,S,I,Ce,P,D,W,M,re,K,Be,l,ae,Pe);if(Dd(We=>!(I&&I.some(pn=>pn.route.id===We))||et&&et.some(pn=>pn.route.id===We)),oe=++H,et.length===0&&It.length===0){let We=$i();return Re(P,at({matches:I,loaderData:{},errors:Pe||null},ae?{actionData:ae}:{},We?{fetchers:new Map(S.fetchers)}:{}),{flushSync:pe}),{shortCircuited:!0}}if(!V){It.forEach(pn=>{let dt=S.fetchers.get(pn.key),zo=da(void 0,dt?dt.data:void 0);S.fetchers.set(pn.key,zo)});let We=ae||S.actionData;$e(at({navigation:_t},We?Object.keys(We).length===0?{actionData:null}:{actionData:We}:{},It.length>0?{fetchers:new Map(S.fetchers)}:{}),{flushSync:pe})}It.forEach(We=>{F.has(We.key)&&Hn(We.key),We.controller&&F.set(We.key,We.controller)});let Zn=()=>It.forEach(We=>Hn(We.key));E&&E.signal.addEventListener("abort",Zn);let{results:Gs,loaderResults:Md,fetcherResults:Ri}=await ee(S.matches,I,et,It,R);if(R.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",Zn),It.forEach(We=>F.delete(We.key));let Rn=Yg(Gs);if(Rn){if(Rn.idx>=et.length){let We=It[Rn.idx-et.length].key;K.add(We)}return await A(S,Rn.result,{replace:me}),{shortCircuited:!0}}let{loaderData:Yl,errors:jd}=Zg(S,I,et,Md,Pe,It,Ri,Ue);Ue.forEach((We,pn)=>{We.subscribe(dt=>{(dt||We.done)&&Ue.delete(pn)})});let Id=$i(),Ld=Zl(oe),Pi=Id||Ld||It.length>0;return at({loaderData:Yl,errors:jd},Pi?{fetchers:new Map(S.fetchers)}:{})}function dr(R,P,I,q){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");F.has(R)&&Hn(R);let ie=(q&&q.unstable_flushSync)===!0,_e=a||s,me=tp(S.location,S.matches,l,u.v7_prependBasename,I,P,q==null?void 0:q.relative),pe=qi(_e,me,l);if(!pe){se(R,P,xn(404,{pathname:me}),{flushSync:ie});return}let{path:ae,submission:Pe,error:_t}=zg(u.v7_normalizeFormMethod,!0,me,q);if(_t){se(R,P,_t,{flushSync:ie});return}let Ce=rp(pe,ae);if(C=(q&&q.preventScrollReset)===!0,Pe&&Mn(Pe.formMethod)){$(R,P,ae,Ce,pe,ie,Pe);return}re.set(R,{routeId:P,path:ae}),N(R,P,ae,Ce,pe,ie,Pe)}async function $(R,P,I,q,ie,_e,me){if(Z(),re.delete(R),!q.route.action&&!q.route.lazy){let dt=xn(405,{method:me.formMethod,pathname:I,routeId:P});se(R,P,dt,{flushSync:_e});return}let pe=S.fetchers.get(R);U(R,b$(me,pe),{flushSync:_e});let ae=new AbortController,Pe=ca(e.history,I,ae.signal,me);F.set(R,ae);let _t=H,Ce=await ua("action",Pe,q,ie,i,o,l);if(Pe.signal.aborted){F.get(R)===ae&&F.delete(R);return}if(ve.has(R)){U(R,Zr(void 0));return}if(is(Ce))if(F.delete(R),oe>_t){U(R,Zr(void 0));return}else return K.add(R),U(R,da(me)),A(S,Ce,{fetcherSubmission:me});if(Da(Ce)){se(R,P,Ce.error);return}if(Yo(Ce))throw xn(400,{type:"defer-action"});let Be=S.navigation.location||S.location,et=ca(e.history,Be,ae.signal),It=a||s,Zn=S.navigation.state!=="idle"?qi(It,S.navigation.location,l):S.matches;Se(Zn,"Didn't find any matches after fetcher action");let Gs=++H;L.set(R,Gs);let Md=da(me,Ce.data);S.fetchers.set(R,Md);let[Ri,Rn]=Vg(e.history,S,Zn,me,Be,D,W,M,re,K,It,l,{[q.route.id]:Ce.data},void 0);Rn.filter(dt=>dt.key!==R).forEach(dt=>{let zo=dt.key,dv=S.fetchers.get(zo),BS=da(void 0,dv?dv.data:void 0);S.fetchers.set(zo,BS),F.has(zo)&&Hn(zo),dt.controller&&F.set(zo,dt.controller)}),$e({fetchers:new Map(S.fetchers)});let Yl=()=>Rn.forEach(dt=>Hn(dt.key));ae.signal.addEventListener("abort",Yl);let{results:jd,loaderResults:Id,fetcherResults:Ld}=await ee(S.matches,Zn,Ri,Rn,et);if(ae.signal.aborted)return;ae.signal.removeEventListener("abort",Yl),L.delete(R),F.delete(R),Rn.forEach(dt=>F.delete(dt.key));let Pi=Yg(jd);if(Pi){if(Pi.idx>=Ri.length){let dt=Rn[Pi.idx-Ri.length].key;K.add(dt)}return A(S,Pi.result)}let{loaderData:We,errors:pn}=Zg(S,S.matches,Ri,Id,void 0,Rn,Ld,Ue);if(S.fetchers.has(R)){let dt=Zr(Ce.data);S.fetchers.set(R,dt)}Zl(Gs),S.navigation.state==="loading"&&Gs>oe?(Se(_,"Expected pending action"),E&&E.abort(),Re(S.navigation.location,{matches:Zn,loaderData:We,errors:pn,fetchers:new Map(S.fetchers)})):($e({errors:pn,loaderData:Kg(S.loaderData,We,Zn,pn),fetchers:new Map(S.fetchers)}),D=!1)}async function N(R,P,I,q,ie,_e,me){let pe=S.fetchers.get(R);U(R,da(me,pe?pe.data:void 0),{flushSync:_e});let ae=new AbortController,Pe=ca(e.history,I,ae.signal);F.set(R,ae);let _t=H,Ce=await ua("loader",Pe,q,ie,i,o,l);if(Yo(Ce)&&(Ce=await cb(Ce,Pe.signal,!0)||Ce),F.get(R)===ae&&F.delete(R),!Pe.signal.aborted){if(ve.has(R)){U(R,Zr(void 0));return}if(is(Ce))if(oe>_t){U(R,Zr(void 0));return}else{K.add(R),await A(S,Ce);return}if(Da(Ce)){se(R,P,Ce.error);return}Se(!Yo(Ce),"Unhandled fetcher deferred data"),U(R,Zr(Ce.data))}}async function A(R,P,I){let{submission:q,fetcherSubmission:ie,replace:_e}=I===void 0?{}:I;P.revalidate&&(D=!0);let me=nl(R.location,P.location,{_isRedirect:!0});if(Se(me,"Expected a location on the redirect navigation"),n){let Be=!1;if(P.reloadDocument)Be=!0;else if(sb.test(P.location)){const et=e.history.createURL(P.location);Be=et.origin!==t.location.origin||Co(et.pathname,l)==null}if(Be){_e?t.location.replace(P.location):t.location.assign(P.location);return}}E=null;let pe=_e===!0?lt.Replace:lt.Push,{formMethod:ae,formAction:Pe,formEncType:_t}=R.navigation;!q&&!ie&&ae&&Pe&&_t&&(q=Gg(R.navigation));let Ce=q||ie;if(l$.has(P.status)&&Ce&&Mn(Ce.formMethod))await Xe(pe,me,{submission:at({},Ce,{formAction:P.location}),preventScrollReset:C});else{let Be=wf(me,q);await Xe(pe,me,{overrideNavigation:Be,fetcherSubmission:ie,preventScrollReset:C})}}async function ee(R,P,I,q,ie){let _e=await Promise.all([...I.map(ae=>ua("loader",ie,ae,P,i,o,l)),...q.map(ae=>ae.matches&&ae.match&&ae.controller?ua("loader",ca(e.history,ae.path,ae.controller.signal),ae.match,ae.matches,i,o,l):{type:ut.error,error:xn(404,{pathname:ae.path})})]),me=_e.slice(0,I.length),pe=_e.slice(I.length);return await Promise.all([qg(R,I,me,me.map(()=>ie.signal),!1,S.loaderData),qg(R,q.map(ae=>ae.match),pe,q.map(ae=>ae.controller?ae.controller.signal:null),!0)]),{results:_e,loaderResults:me,fetcherResults:pe}}function Z(){D=!0,W.push(...Dd()),re.forEach((R,P)=>{F.has(P)&&(M.push(P),Hn(P))})}function U(R,P,I){I===void 0&&(I={}),S.fetchers.set(R,P),$e({fetchers:new Map(S.fetchers)},{flushSync:(I&&I.flushSync)===!0})}function se(R,P,I,q){q===void 0&&(q={});let ie=Aa(S.matches,P);Ve(R),$e({errors:{[ie.route.id]:I},fetchers:new Map(S.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Ke(R){return u.v7_fetcherPersist&&(he.set(R,(he.get(R)||0)+1),ve.has(R)&&ve.delete(R)),S.fetchers.get(R)||u$}function Ve(R){let P=S.fetchers.get(R);F.has(R)&&!(P&&P.state==="loading"&&L.has(R))&&Hn(R),re.delete(R),L.delete(R),K.delete(R),ve.delete(R),S.fetchers.delete(R)}function Fr(R){if(u.v7_fetcherPersist){let P=(he.get(R)||0)-1;P<=0?(he.delete(R),ve.add(R)):he.set(R,P)}else Ve(R);$e({fetchers:new Map(S.fetchers)})}function Hn(R){let P=F.get(R);Se(P,"Expected fetch controller: "+R),P.abort(),F.delete(R)}function Ti(R){for(let P of R){let I=Ke(P),q=Zr(I.data);S.fetchers.set(P,q)}}function $i(){let R=[],P=!1;for(let I of K){let q=S.fetchers.get(I);Se(q,"Expected fetcher: "+I),q.state==="loading"&&(K.delete(I),R.push(I),P=!0)}return Ti(R),P}function Zl(R){let P=[];for(let[I,q]of L)if(q0}function Kl(R,P){let I=S.blockers.get(R)||la;return je.get(R)!==P&&je.set(R,P),I}function Ql(R){S.blockers.delete(R),je.delete(R)}function Uo(R,P){let I=S.blockers.get(R)||la;Se(I.state==="unblocked"&&P.state==="blocked"||I.state==="blocked"&&P.state==="blocked"||I.state==="blocked"&&P.state==="proceeding"||I.state==="blocked"&&P.state==="unblocked"||I.state==="proceeding"&&P.state==="unblocked","Invalid blocker state transition: "+I.state+" -> "+P.state);let q=new Map(S.blockers);q.set(R,P),$e({blockers:q})}function lv(R){let{currentLocation:P,nextLocation:I,historyAction:q}=R;if(je.size===0)return;je.size>1&&vi(!1,"A router only supports one blocker at a time");let ie=Array.from(je.entries()),[_e,me]=ie[ie.length-1],pe=S.blockers.get(_e);if(!(pe&&pe.state==="proceeding")&&me({currentLocation:P,nextLocation:I,historyAction:q}))return _e}function Dd(R){let P=[];return Ue.forEach((I,q)=>{(!R||R(q))&&(I.cancel(),P.push(q),Ue.delete(q))}),P}function US(R,P,I){if(p=R,y=P,g=I||null,!v&&S.navigation===yf){v=!0;let q=cv(S.location,S.matches);q!=null&&$e({restoreScrollPosition:q})}return()=>{p=null,y=null,g=null}}function uv(R,P){return g&&g(R,P.map(q=>FT(q,S.loaderData)))||R.key}function zS(R,P){if(p&&y){let I=uv(R,P);p[I]=y()}}function cv(R,P){if(p){let I=uv(R,P),q=p[I];if(typeof q=="number")return q}return null}function VS(R){i={},a=Jh(R,o,void 0,i)}return w={get basename(){return l},get state(){return S},get routes(){return s},get window(){return t},initialize:ze,subscribe:Me,enableScrollRestoration:US,navigate:Ne,fetch:dr,revalidate:Oe,createHref:R=>e.history.createHref(R),encodeLocation:R=>e.history.encodeLocation(R),getFetcher:Ke,deleteFetcher:Fr,dispose:ue,getBlocker:Kl,deleteBlocker:Ql,_internalFetchControllers:F,_internalActiveDeferreds:Ue,_internalSetRoutes:VS},w}function f$(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function tp(e,t,n,r,o,i,s){let a,l;if(i){a=[];for(let d of t)if(a.push(d),d.route.id===i){l=d;break}}else a=t,l=t[t.length-1];let u=km(o||".",hd(a).map(d=>d.pathnameBase),Co(e.pathname,n)||e.pathname,s==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&l&&l.route.index&&!$m(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:_r([n,u.pathname])),gi(u)}function zg(e,t,n,r){if(!r||!f$(r))return{path:n};if(r.formMethod&&!w$(r.formMethod))return{path:n,error:xn(405,{method:r.formMethod})};let o=()=>({path:n,error:xn(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),a=ub(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Mn(s))return o();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[v,b]=y;return""+g+v+"="+b+` +`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!Mn(s))return o();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return o()}}}Se(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=np(r.formData),u=r.formData;else if(r.body instanceof FormData)l=np(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Hg(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Hg(l)}catch{return o()}let d={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Mn(d.formMethod))return{path:n,submission:d};let h=jr(n);return t&&h.search&&$m(h.search)&&l.append("index",""),h.search="?"+l,{path:gi(h),submission:d}}function h$(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Vg(e,t,n,r,o,i,s,a,l,u,d,h,p,g){let y=g?Object.values(g)[0]:p?Object.values(p)[0]:void 0,v=e.createURL(t.location),b=e.createURL(o),m=g?Object.keys(g)[0]:void 0,w=h$(n,m).filter((_,C)=>{if(_.route.lazy)return!0;if(_.route.loader==null)return!1;if(p$(t.loaderData,t.matches[C],_)||s.some(O=>O===_.route.id))return!0;let E=t.matches[C],T=_;return Bg(_,at({currentUrl:v,currentParams:E.params,nextUrl:b,nextParams:T.params},r,{actionResult:y,defaultShouldRevalidate:i||v.pathname+v.search===b.pathname+b.search||v.search!==b.search||lb(E,T)}))}),S=[];return l.forEach((_,C)=>{if(!n.some(V=>V.route.id===_.routeId))return;let E=qi(d,_.path,h);if(!E){S.push({key:C,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let T=t.fetchers.get(C),O=rp(E,_.path),j=!1;u.has(C)?j=!1:a.includes(C)?j=!0:T&&T.state!=="idle"&&T.data===void 0?j=i:j=Bg(O,at({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:i})),j&&S.push({key:C,routeId:_.routeId,path:_.path,matches:E,match:O,controller:new AbortController})}),[w,S]}function p$(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function lb(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Bg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Wg(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Se(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";vi(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!IT.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,at({},t(o),{lazy:void 0}))}async function ua(e,t,n,r,o,i,s,a){a===void 0&&(a={});let l,u,d,h=y=>{let v,b=new Promise((m,f)=>v=f);return d=()=>v(),t.signal.addEventListener("abort",d),Promise.race([y({request:t,params:n.params,context:a.requestContext}),b])};try{let y=n.route[e];if(n.route.lazy)if(y){let v,b=await Promise.all([h(y).catch(m=>{v=m}),Wg(n.route,i,o)]);if(v)throw v;u=b[0]}else if(await Wg(n.route,i,o),y=n.route[e],y)u=await h(y);else if(e==="action"){let v=new URL(t.url),b=v.pathname+v.search;throw xn(405,{method:t.method,pathname:b,routeId:n.route.id})}else return{type:ut.data,data:void 0};else if(y)u=await h(y);else{let v=new URL(t.url),b=v.pathname+v.search;throw xn(404,{pathname:b})}Se(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){l=ut.error,u=y}finally{d&&t.signal.removeEventListener("abort",d)}if(y$(u)){let y=u.status;if(a$.has(y)){let m=u.headers.get("Location");if(Se(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!sb.test(m))m=tp(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,m);else if(!a.isStaticRequest){let f=new URL(t.url),w=m.startsWith("//")?new URL(f.protocol+m):new URL(m),S=Co(w.pathname,s)!=null;w.origin===f.origin&&S&&(m=w.pathname+w.search+w.hash)}if(a.isStaticRequest)throw u.headers.set("Location",m),u;return{type:ut.redirect,status:y,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:l===ut.error?ut.error:ut.data,response:u};let v,b=u.headers.get("Content-Type");return b&&/\bapplication\/json\b/.test(b)?v=await u.json():v=await u.text(),l===ut.error?{type:l,error:new Tm(y,u.statusText,v),headers:u.headers}:{type:ut.data,data:v,statusCode:u.status,headers:u.headers}}if(l===ut.error)return{type:l,error:u};if(g$(u)){var p,g;return{type:ut.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:ut.data,data:u}}function ca(e,t,n,r){let o=e.createURL(ub(t)).toString(),i={signal:n};if(r&&Mn(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=np(r.formData):i.body=r.formData}return new Request(o,i)}function np(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Hg(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function m$(e,t,n,r,o){let i={},s=null,a,l=!1,u={};return n.forEach((d,h)=>{let p=t[h].route.id;if(Se(!is(d),"Cannot handle redirect results in processLoaderData"),Da(d)){let g=Aa(e,p),y=d.error;r&&(y=Object.values(r)[0],r=void 0),s=s||{},s[g.route.id]==null&&(s[g.route.id]=y),i[p]=void 0,l||(l=!0,a=ob(d.error)?d.error.status:500),d.headers&&(u[p]=d.headers)}else Yo(d)?(o.set(p,d.deferredData),i[p]=d.deferredData.data):i[p]=d.data,d.statusCode!=null&&d.statusCode!==200&&!l&&(a=d.statusCode),d.headers&&(u[p]=d.headers)}),r&&(s=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}function Zg(e,t,n,r,o,i,s,a){let{loaderData:l,errors:u}=m$(t,n,r,o,a);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Qg(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xn(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,s="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(s="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(s="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",a='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new Tm(e||500,s,new Error(a),!0)}function Yg(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(is(n))return{result:n,idx:t}}}function ub(e){let t=typeof e=="string"?jr(e):e;return gi(at({},t,{hash:""}))}function v$(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Yo(e){return e.type===ut.deferred}function Da(e){return e.type===ut.error}function is(e){return(e&&e.type)===ut.redirect}function g$(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function y$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function w$(e){return s$.has(e.toLowerCase())}function Mn(e){return o$.has(e.toLowerCase())}async function qg(e,t,n,r,o,i){for(let s=0;sh.route.id===l.route.id),d=u!=null&&!lb(u,l)&&(i&&i[l.route.id])!==void 0;if(Yo(a)&&(o||d)){let h=r[s];Se(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await cb(a,h,o).then(p=>{p&&(n[s]=p||n[s])})}}}async function cb(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:ut.data,data:e.deferredData.unwrappedData}}catch(o){return{type:ut.error,error:o}}return{type:ut.data,data:e.deferredData.data}}}function $m(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function rp(e,t){let n=typeof t=="string"?jr(t).search:t.search;if(e[e.length-1].route.index&&$m(n||""))return e[e.length-1];let r=hd(e);return r[r.length-1]}function Gg(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function wf(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function x$(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function da(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function b$(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Zr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function S$(e,t){try{let n=e.sessionStorage.getItem(ab);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function _$(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(ab,JSON.stringify(n))}catch(r){vi(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.19.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function bc(){return bc=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),s=c.useRef(!1);return fb(()=>{s.current=!0}),c.useCallback(function(l,u){if(u===void 0&&(u={}),!s.current)return;if(typeof l=="number"){n.go(l);return}let d=km(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:_r([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,i,o,e])}const k$=c.createContext(null);function T$(e){let t=c.useContext(Io).outlet;return t&&c.createElement(k$.Provider,{value:e},t)}function md(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=c.useContext(Io),{pathname:o}=Zs(),i=JSON.stringify(hd(r).map((s,a)=>a===r.length-1?s.pathname:s.pathnameBase));return c.useMemo(()=>km(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function $$(e,t,n){Fl()||Se(!1);let{navigator:r}=c.useContext(Ci),{matches:o}=c.useContext(Io),i=o[o.length-1],s=i?i.params:{};i&&i.pathname;let a=i?i.pathnameBase:"/";i&&i.route;let l=Zs(),u;if(t){var d;let v=typeof t=="string"?jr(t):t;a==="/"||(d=v.pathname)!=null&&d.startsWith(a)||Se(!1),u=v}else u=l;let h=u.pathname||"/",p=a==="/"?h:h.slice(a.length)||"/",g=qi(e,{pathname:p}),y=A$(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:_r([a,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?a:_r([a,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n);return t&&y?c.createElement(pd.Provider,{value:{location:bc({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:lt.Pop}},y):y}function R$(){let e=I$(),t=ob(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),n?c.createElement("pre",{style:o},n):null,i)}const P$=c.createElement(R$,null);class N$ extends c.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?c.createElement(Io.Provider,{value:this.props.routeContext},c.createElement(db.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function O$(e){let{routeContext:t,match:n,children:r}=e,o=c.useContext(Ll);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),c.createElement(Io.Provider,{value:t},r)}function A$(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let a=i.findIndex(l=>l.route.id&&(s==null?void 0:s[l.route.id]));a>=0||Se(!1),i=i.slice(0,Math.min(i.length,a+1))}return i.reduceRight((a,l,u)=>{let d=l.route.id?s==null?void 0:s[l.route.id]:null,h=null;n&&(h=l.route.errorElement||P$);let p=t.concat(i.slice(0,u+1)),g=()=>{let y;return d?y=h:l.route.Component?y=c.createElement(l.route.Component,null):l.route.element?y=l.route.element:y=a,c.createElement(O$,{match:l,routeContext:{outlet:a,matches:p,isDataRoute:n!=null},children:y})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?c.createElement(N$,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:g(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):g()},null)}var hb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hb||{}),Sc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Sc||{});function D$(e){let t=c.useContext(Ll);return t||Se(!1),t}function M$(e){let t=c.useContext(Rm);return t||Se(!1),t}function j$(e){let t=c.useContext(Io);return t||Se(!1),t}function pb(e){let t=j$(),n=t.matches[t.matches.length-1];return n.route.id||Se(!1),n.route.id}function I$(){var e;let t=c.useContext(db),n=M$(Sc.UseRouteError),r=pb(Sc.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function L$(){let{router:e}=D$(hb.UseNavigateStable),t=pb(Sc.UseNavigateStable),n=c.useRef(!1);return fb(()=>{n.current=!0}),c.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,bc({fromRouteId:t},i)))},[e,t])}function mb(e){return T$(e.context)}function F$(e){let{basename:t="/",children:n=null,location:r,navigationType:o=lt.Pop,navigator:i,static:s=!1}=e;Fl()&&Se(!1);let a=t.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:a,navigator:i,static:s}),[a,i,s]);typeof r=="string"&&(r=jr(r));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:g="default"}=r,y=c.useMemo(()=>{let v=Co(u,a);return v==null?null:{location:{pathname:v,search:d,hash:h,state:p,key:g},navigationType:o}},[a,u,d,h,p,g,o]);return y==null?null:c.createElement(Ci.Provider,{value:l},c.createElement(pd.Provider,{children:n,value:y}))}new Promise(()=>{});function U$(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:c.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:c.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.19.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ds(){return Ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function z$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function V$(e,t){return e.button===0&&(!t||t==="_self")&&!z$(e)}const B$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],W$=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];function H$(e,t){return d$({basename:t==null?void 0:t.basename,future:Ds({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:DT({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Z$(),routes:e,mapRouteProperties:U$,window:t==null?void 0:t.window}).initialize()}function Z$(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ds({},t,{errors:K$(t.errors)})),t}function K$(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Tm(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const gb=c.createContext({isTransitioning:!1}),Q$=c.createContext(new Map),Y$="startTransition",Xg=s0[Y$],q$="flushSync",Jg=pC[q$];function G$(e){Xg?Xg(e):e()}function fa(e){Jg?Jg(e):e()}class X${constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function J$(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=c.useState(n.state),[s,a]=c.useState(),[l,u]=c.useState({isTransitioning:!1}),[d,h]=c.useState(),[p,g]=c.useState(),[y,v]=c.useState(),b=c.useRef(new Map),{v7_startTransition:m}=r||{},f=c.useCallback(E=>{m?G$(E):E()},[m]),w=c.useCallback((E,T)=>{let{deletedFetchers:O,unstable_flushSync:j,unstable_viewTransitionOpts:V}=T;O.forEach(W=>b.current.delete(W)),E.fetchers.forEach((W,M)=>{W.data!==void 0&&b.current.set(M,W.data)});let D=n.window==null||typeof n.window.document.startViewTransition!="function";if(!V||D){j?fa(()=>i(E)):f(()=>i(E));return}if(j){fa(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let W=n.window.document.startViewTransition(()=>{fa(()=>i(E))});W.finished.finally(()=>{fa(()=>{h(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),fa(()=>g(W));return}p?(d&&d.resolve(),p.skipTransition(),v({state:E,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(a(E),u({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[n.window,p,d,b,f]);c.useLayoutEffect(()=>n.subscribe(w),[n,w]),c.useEffect(()=>{l.isTransitioning&&!l.flushSync&&h(new X$)},[l]),c.useEffect(()=>{if(d&&s&&n.window){let E=s,T=d.promise,O=n.window.document.startViewTransition(async()=>{f(()=>i(E)),await T});O.finished.finally(()=>{h(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(O)}},[f,s,d,n.window]),c.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,p,o.location,s]),c.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),v(void 0))},[l.isTransitioning,y]);let S=c.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,T,O)=>n.navigate(E,{state:T,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(E,T,O)=>n.navigate(E,{replace:!0,state:T,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),_=n.basename||"/",C=c.useMemo(()=>({router:n,navigator:S,static:!1,basename:_}),[n,S,_]);return c.createElement(c.Fragment,null,c.createElement(Ll.Provider,{value:C},c.createElement(Rm.Provider,{value:o},c.createElement(Q$.Provider,{value:b.current},c.createElement(gb.Provider,{value:l},c.createElement(F$,{basename:_,location:o.location,navigationType:o.historyAction,navigator:S},o.initialized?c.createElement(eR,{routes:n.routes,state:o}):t))))),null)}function eR(e){let{routes:t,state:n}=e;return $$(t,void 0,n)}const tR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yb=c.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:d,unstable_viewTransition:h}=t,p=vb(t,B$),{basename:g}=c.useContext(Ci),y,v=!1;if(typeof u=="string"&&nR.test(u)&&(y=u,tR))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),_=Co(S.pathname,g);S.origin===w.origin&&_!=null?u=_+S.search+S.hash:v=!0}catch{}let b=E$(u,{relative:o}),m=oR(u,{replace:s,state:a,target:l,preventScrollReset:d,relative:o,unstable_viewTransition:h});function f(w){r&&r(w),w.defaultPrevented||m(w)}return c.createElement("a",Ds({},p,{href:y||b,onClick:v||i?r:f,ref:n,target:l}))}),Gi=c.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,unstable_viewTransition:u,children:d}=t,h=vb(t,W$),p=md(l,{relative:h.relative}),g=Zs(),y=c.useContext(Rm),{navigator:v}=c.useContext(Ci),b=y!=null&&iR(p)&&u===!0,m=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,f=g.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;o||(f=f.toLowerCase(),w=w?w.toLowerCase():null,m=m.toLowerCase());const S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=f===m||!s&&f.startsWith(m)&&f.charAt(S)==="/",C=w!=null&&(w===m||!s&&w.startsWith(m)&&w.charAt(m.length)==="/"),E={isActive:_,isPending:C,isTransitioning:b},T=_?r:void 0,O;typeof i=="function"?O=i(E):O=[i,_?"active":null,C?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let j=typeof a=="function"?a(E):a;return c.createElement(yb,Ds({},h,{"aria-current":T,className:O,ref:n,style:j,to:l,unstable_viewTransition:u}),typeof d=="function"?d(E):d)});var op;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(op||(op={}));var ey;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ey||(ey={}));function rR(e){let t=c.useContext(Ll);return t||Se(!1),t}function oR(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,l=Pm(),u=Zs(),d=md(e,{relative:s});return c.useCallback(h=>{if(V$(h,n)){h.preventDefault();let p=r!==void 0?r:gi(u)===gi(d);l(e,{replace:p,state:o,preventScrollReset:i,relative:s,unstable_viewTransition:a})}},[u,l,d,r,o,n,e,i,s,a])}function iR(e,t){t===void 0&&(t={});let n=c.useContext(gb);n==null&&Se(!1);let{basename:r}=rR(op.useViewTransitionState),o=md(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Co(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Co(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ep(o.pathname,s)!=null||ep(o.pathname,i)!=null}const ty=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=u??typeof d!="object"?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},sR=e=>e?ty(e):ty;var wb={exports:{}},xb={},bb={exports:{}},Sb={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ms=c;function aR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lR=typeof Object.is=="function"?Object.is:aR,uR=Ms.useState,cR=Ms.useEffect,dR=Ms.useLayoutEffect,fR=Ms.useDebugValue;function hR(e,t){var n=t(),r=uR({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return dR(function(){o.value=n,o.getSnapshot=t,xf(o)&&i({inst:o})},[e,n,t]),cR(function(){return xf(o)&&i({inst:o}),e(function(){xf(o)&&i({inst:o})})},[e]),fR(n),n}function xf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lR(e,n)}catch{return!0}}function pR(e,t){return t()}var mR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pR:hR;Sb.useSyncExternalStore=Ms.useSyncExternalStore!==void 0?Ms.useSyncExternalStore:mR;bb.exports=Sb;var vR=bb.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vd=c,gR=vR;function yR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wR=typeof Object.is=="function"?Object.is:yR,xR=gR.useSyncExternalStore,bR=vd.useRef,SR=vd.useEffect,_R=vd.useMemo,ER=vd.useDebugValue;xb.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=bR(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=_R(function(){function l(g){if(!u){if(u=!0,d=g,g=r(g),o!==void 0&&s.hasValue){var y=s.value;if(o(y,g))return h=y}return h=g}if(y=h,wR(d,g))return y;var v=r(g);return o!==void 0&&o(y,v)?y:(d=g,h=v)}var u=!1,d,h,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,o]);var a=xR(e,i[0],i[1]);return SR(function(){s.hasValue=!0,s.value=a},[a]),ER(a),a};wb.exports=xb;var CR=wb.exports;const kR=xp(CR),{useDebugValue:TR}=de,{useSyncExternalStoreWithSelector:$R}=kR;function RR(e,t=e.getState,n){const r=$R(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return TR(r),r}const ny=e=>{const t=typeof e=="function"?sR(e):e,n=(r,o)=>RR(t,r,o);return Object.assign(n,t),n},gd=e=>e?ny(e):ny,PR=(e,t)=>(...n)=>Object.assign({},e,t(...n));function Nm(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(i=n.getItem(o))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const rl=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return rl(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return rl(r)(n)}}}},NR=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:b=>b,version:0,merge:(b,m)=>({...m,...b}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...b)},r,o);const d=rl(i.serialize),h=()=>{const b=i.partialize({...r()});let m;const f=d({state:b,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{m=w});if(m)throw m;return f},p=o.setState;o.setState=(b,m)=>{p(b,m),h()};const g=e((...b)=>{n(...b),h()},r,o);let y;const v=()=>{var b;if(!u)return;s=!1,a.forEach(f=>f(r()));const m=((b=i.onRehydrateStorage)==null?void 0:b.call(i,r()))||void 0;return rl(u.getItem.bind(u))(i.name).then(f=>{if(f)return i.deserialize(f)}).then(f=>{if(f)if(typeof f.version=="number"&&f.version!==i.version){if(i.migrate)return i.migrate(f.state,f.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return f.state}).then(f=>{var w;return y=i.merge(f,(w=r())!=null?w:g),n(y,!0),h()}).then(()=>{m==null||m(y,void 0),s=!0,l.forEach(f=>f(y))}).catch(f=>{m==null||m(void 0,f)})};return o.persist={setOptions:b=>{i={...i,...b},b.getStorage&&(u=b.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(l.add(b),()=>{l.delete(b)})},v(),y||g},OR=(e,t)=>(n,r,o)=>{let i={storage:Nm(()=>localStorage),partialize:v=>v,version:0,merge:(v,b)=>({...b,...v}),...t},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const d=()=>{const v=i.partialize({...r()});return u.setItem(i.name,{state:v,version:i.version})},h=o.setState;o.setState=(v,b)=>{h(v,b),d()};const p=e((...v)=>{n(...v),d()},r,o);let g;const y=()=>{var v,b;if(!u)return;s=!1,a.forEach(f=>{var w;return f((w=r())!=null?w:p)});const m=((b=i.onRehydrateStorage)==null?void 0:b.call(i,(v=r())!=null?v:p))||void 0;return rl(u.getItem.bind(u))(i.name).then(f=>{if(f)if(typeof f.version=="number"&&f.version!==i.version){if(i.migrate)return i.migrate(f.state,f.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return f.state}).then(f=>{var w;return g=i.merge(f,(w=r())!=null?w:p),n(g,!0),d()}).then(()=>{m==null||m(g,void 0),g=r(),s=!0,l.forEach(f=>f(g))}).catch(f=>{m==null||m(void 0,f)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},i.skipHydration||y(),g||p},AR=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?NR(e,t):OR(e,t),Om=AR,Am=gd(Om((e,t)=>({currentAgent:null,lastAgentInitMessage:null,actions:{setAgent:n=>e({currentAgent:n}),setLastAgentInitMessage:n=>e(r=>({...r,lastAgentInitMessage:n})),removeAgent:()=>e(n=>({...n,currentAgent:null}))}}),{name:"agent-storage",partialize:({actions:e,...t})=>t})),Ul=()=>Am(e=>e.currentAgent),DR=()=>Am(e=>e.lastAgentInitMessage),yd=()=>Am(e=>e.actions);function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}function ko(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function jt(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function ur(e){jt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||_c(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function MR(e,t){jt(2,arguments);var n=ur(e).getTime(),r=ko(t);return new Date(n+r)}var jR={};function wd(){return jR}function IR(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var _b=6e4,Eb=36e5;function LR(e){return jt(1,arguments),e instanceof Date||_c(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function FR(e){if(jt(1,arguments),!LR(e)&&typeof e!="number")return!1;var t=ur(e);return!isNaN(Number(t))}function UR(e,t){jt(2,arguments);var n=ko(t);return MR(e,-n)}var zR=864e5;function VR(e){jt(1,arguments);var t=ur(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/zR)+1}function Ec(e){jt(1,arguments);var t=1,n=ur(e),r=n.getUTCDay(),o=(r=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function BR(e){jt(1,arguments);var t=Cb(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Ec(n);return r}var WR=6048e5;function HR(e){jt(1,arguments);var t=ur(e),n=Ec(t).getTime()-BR(t).getTime();return Math.round(n/WR)+1}function Cc(e,t){var n,r,o,i,s,a,l,u;jt(1,arguments);var d=wd(),h=ko((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ur(e),g=p.getUTCDay(),y=(g=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(h+1,0,g),y.setUTCHours(0,0,0,0);var v=Cc(y,t),b=new Date(0);b.setUTCFullYear(h,0,g),b.setUTCHours(0,0,0,0);var m=Cc(b,t);return d.getTime()>=v.getTime()?h+1:d.getTime()>=m.getTime()?h:h-1}function ZR(e,t){var n,r,o,i,s,a,l,u;jt(1,arguments);var d=wd(),h=ko((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),p=kb(e,t),g=new Date(0);g.setUTCFullYear(p,0,h),g.setUTCHours(0,0,0,0);var y=Cc(g,t);return y}var KR=6048e5;function QR(e,t){jt(1,arguments);var n=ur(e),r=Cc(n,t).getTime()-ZR(n,t).getTime();return Math.round(r/KR)+1}function Le(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return Le(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Le(r+1,2)},d:function(t,n){return Le(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Le(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Le(t.getUTCHours(),n.length)},m:function(t,n){return Le(t.getUTCMinutes(),n.length)},s:function(t,n){return Le(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return Le(i,n.length)}};const Br=YR;var Oi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qR={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Br.y(t,n)},Y:function(t,n,r,o){var i=kb(t,o),s=i>0?i:1-i;if(n==="YY"){var a=s%100;return Le(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):Le(s,n.length)},R:function(t,n){var r=Cb(t);return Le(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Le(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Le(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Le(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return Br.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return Le(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=QR(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Le(i,n.length)},I:function(t,n,r){var o=HR(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):Le(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Br.d(t,n)},D:function(t,n,r){var o=VR(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):Le(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Le(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Le(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return Le(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=Oi.noon:o===0?i=Oi.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=Oi.evening:o>=12?i=Oi.afternoon:o>=4?i=Oi.morning:i=Oi.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Br.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Br.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Br.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Br.s(t,n)},S:function(t,n){return Br.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return oy(s);case"XXXX":case"XX":return Wo(s);case"XXXXX":case"XXX":default:return Wo(s,":")}},x:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"x":return oy(s);case"xxxx":case"xx":return Wo(s);case"xxxxx":case"xxx":default:return Wo(s,":")}},O:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+ry(s,":");case"OOOO":default:return"GMT"+Wo(s,":")}},z:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+ry(s,":");case"zzzz":default:return"GMT"+Wo(s,":")}},t:function(t,n,r,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return Le(s,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,s=i.getTime();return Le(s,n.length)}};function ry(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=t||"";return n+String(o)+s+Le(i,2)}function oy(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Le(Math.abs(e)/60,2)}return Wo(e,t)}function Wo(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=Le(Math.floor(o/60),2),s=Le(o%60,2);return r+i+n+s}const GR=qR;var iy=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Tb=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},XR=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return iy(t,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",iy(o,n)).replace("{{time}}",Tb(i,n))},JR={p:Tb,P:XR};const eP=JR;var tP=["D","DD"],nP=["YY","YYYY"];function rP(e){return tP.indexOf(e)!==-1}function oP(e){return nP.indexOf(e)!==-1}function sy(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var iP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},sP=function(t,n,r){var o,i=iP[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const aP=sP;function bf(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var lP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dP={date:bf({formats:lP,defaultWidth:"full"}),time:bf({formats:uP,defaultWidth:"full"}),dateTime:bf({formats:cP,defaultWidth:"full"})};const fP=dP;var hP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pP=function(t,n,r,o){return hP[t]};const mP=pP;function ha(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[l]||e.values[a]}var u=e.argumentCallback?e.argumentCallback(t):t;return o[u]}}var vP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},wP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},bP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},SP=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},_P={ordinalNumber:SP,era:ha({values:vP,defaultWidth:"wide"}),quarter:ha({values:gP,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ha({values:yP,defaultWidth:"wide"}),day:ha({values:wP,defaultWidth:"wide"}),dayPeriod:ha({values:xP,defaultWidth:"wide",formattingValues:bP,defaultFormattingWidth:"wide"})};const EP=_P;function pa(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?kP(a,function(h){return h.test(s)}):CP(a,function(h){return h.test(s)}),u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;var d=t.slice(s.length);return{value:u,rest:d}}}function CP(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function kP(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var a=t.slice(o.length);return{value:s,rest:a}}}var $P=/^(\d+)(th|st|nd|rd)?/i,RP=/\d+/i,PP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},NP={any:[/^b/i,/^(a|c)/i]},OP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},AP={any:[/1/i,/2/i,/3/i,/4/i]},DP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},MP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},IP={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},LP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},FP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},UP={ordinalNumber:TP({matchPattern:$P,parsePattern:RP,valueCallback:function(t){return parseInt(t,10)}}),era:pa({matchPatterns:PP,defaultMatchWidth:"wide",parsePatterns:NP,defaultParseWidth:"any"}),quarter:pa({matchPatterns:OP,defaultMatchWidth:"wide",parsePatterns:AP,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:pa({matchPatterns:DP,defaultMatchWidth:"wide",parsePatterns:MP,defaultParseWidth:"any"}),day:pa({matchPatterns:jP,defaultMatchWidth:"wide",parsePatterns:IP,defaultParseWidth:"any"}),dayPeriod:pa({matchPatterns:LP,defaultMatchWidth:"any",parsePatterns:FP,defaultParseWidth:"any"})};const zP=UP;var VP={code:"en-US",formatDistance:aP,formatLong:fP,formatRelative:mP,localize:EP,match:zP,options:{weekStartsOn:0,firstWeekContainsDate:1}};const BP=VP;var WP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZP=/^'([^]*?)'?$/,KP=/''/g,QP=/[a-zA-Z]/;function YP(e,t,n){var r,o,i,s,a,l,u,d,h,p,g,y,v,b,m,f,w,S;jt(2,arguments);var _=String(t),C=wd(),E=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:C.locale)!==null&&r!==void 0?r:BP,T=ko((i=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(u=n.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:C.firstWeekContainsDate)!==null&&s!==void 0?s:(h=C.locale)===null||h===void 0||(p=h.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=ko((g=(y=(v=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(m=n.locale)===null||m===void 0||(f=m.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&v!==void 0?v:C.weekStartsOn)!==null&&y!==void 0?y:(w=C.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&g!==void 0?g:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var j=ur(e);if(!FR(j))throw new RangeError("Invalid time value");var V=IR(j),D=UR(j,V),W={firstWeekContainsDate:T,weekStartsOn:O,locale:E,_originalDate:j},M=_.match(HP).map(function(F){var H=F[0];if(H==="p"||H==="P"){var oe=eP[H];return oe(F,E.formatLong)}return F}).join("").match(WP).map(function(F){if(F==="''")return"'";var H=F[0];if(H==="'")return qP(F);var oe=GR[H];if(oe)return!(n!=null&&n.useAdditionalWeekYearTokens)&&oP(F)&&sy(F,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&rP(F)&&sy(F,t,String(e)),oe(D,F,E.localize,W);if(H.match(QP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return F}).join("");return M}function qP(e){var t=e.match(ZP);return t?t[1].replace(KP,"'"):e}function GP(e,t){var n;jt(1,arguments);var r=ko((n=t==null?void 0:t.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=tN(e),i;if(o.date){var s=nN(o.date,r);i=rN(s.restDateString,s.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var a=i.getTime(),l=0,u;if(o.time&&(l=oN(o.time),isNaN(l)))return new Date(NaN);if(o.timezone){if(u=iN(o.timezone),isNaN(u))return new Date(NaN)}else{var d=new Date(a+l),h=new Date(0);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return new Date(a+l+u)}var gu={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},XP=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,JP=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,eN=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tN(e){var t={},n=e.split(gu.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],gu.timeZoneDelimiter.test(t.date)&&(t.date=e.split(gu.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var o=gu.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function nN(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function rN(e,t){if(t===null)return new Date(NaN);var n=e.match(XP);if(!n)return new Date(NaN);var r=!!n[4],o=ma(n[1]),i=ma(n[2])-1,s=ma(n[3]),a=ma(n[4]),l=ma(n[5])-1;if(r)return cN(t,a,l)?sN(t,a,l):new Date(NaN);var u=new Date(0);return!lN(t,i,s)||!uN(t,o)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(o,s)),u)}function ma(e){return e?parseInt(e):1}function oN(e){var t=e.match(JP);if(!t)return NaN;var n=Sf(t[1]),r=Sf(t[2]),o=Sf(t[3]);return dN(n,r,o)?n*Eb+r*_b+o*1e3:NaN}function Sf(e){return e&&parseFloat(e.replace(",","."))||0}function iN(e){if(e==="Z")return 0;var t=e.match(eN);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return fN(r,o)?n*(r*Eb+o*_b):NaN}function sN(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var aN=[31,null,31,30,31,30,31,31,30,31,30,31];function $b(e){return e%400===0||e%4===0&&e%100!==0}function lN(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(aN[t]||($b(e)?29:28))}function uN(e,t){return t>=1&&t<=($b(e)?366:365)}function cN(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function dN(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function fN(e,t){return t>=0&&t<=59}const hN=(e,t)=>e==="date"?GP(t):t,Rb=gd(Om(e=>({history:{},actions:{addMessage:(t,n)=>e(r=>({...r,history:{...r.history,[t]:[...r.history[t]??[],n]}}))}}),{name:"message-history-storage",storage:Nm(()=>localStorage,{reviver:hN}),partialize:({actions:e,...t})=>t})),pN=e=>Rb(t=>t.history[e]??[]),Pb=()=>Rb(e=>e.actions);async function mN(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function vN(e){let t,n,r,o=!1;return function(s){t===void 0?(t=s,n=0,r=-1):t=yN(t,s);const a=t.length;let l=0;for(;n0){const l=o.decode(s.subarray(0,a)),u=a+(s[a+1]===32?2:1),d=o.decode(s.subarray(u));switch(l){case"data":r.data=r.data?r.data+` +`+d:d;break;case"event":r.event=d;break;case"id":e(r.id=d);break;case"retry":const h=parseInt(d,10);isNaN(h)||t(r.retry=h);break}}}}function yN(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function ay(){return{data:"",event:"",id:"",retry:void 0}}var wN=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const g=Object.assign({},r);g.accept||(g.accept=ip);let y;function v(){y.abort(),document.hidden||_()}l||document.addEventListener("visibilitychange",v);let b=xN,m=0;function f(){document.removeEventListener("visibilitychange",v),window.clearTimeout(m),y.abort()}n==null||n.addEventListener("abort",()=>{f(),h()});const w=u??window.fetch,S=o??SN;async function _(){var C;y=new AbortController;try{const E=await w(e,Object.assign(Object.assign({},d),{headers:g,signal:y.signal}));await S(E),await mN(E.body,vN(gN(T=>{T?g[ly]=T:delete g[ly]},T=>{b=T},i))),s==null||s(),f(),h()}catch(E){if(!y.signal.aborted)try{const T=(C=a==null?void 0:a(E))!==null&&C!==void 0?C:b;window.clearTimeout(m),m=window.setTimeout(_,T)}catch(T){f(),p(T)}}}_()})}function SN(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(ip)))throw new Error(`Expected content-type to be ${ip}, Actual: ${t}`)}var De;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(const s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(De||(De={}));var sp;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(sp||(sp={}));const G=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xr=e=>{switch(typeof e){case"undefined":return G.undefined;case"string":return G.string;case"number":return isNaN(e)?G.nan:G.number;case"boolean":return G.boolean;case"function":return G.function;case"bigint":return G.bigint;case"symbol":return G.symbol;case"object":return Array.isArray(e)?G.array:e===null?G.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?G.promise:typeof Map<"u"&&e instanceof Map?G.map:typeof Set<"u"&&e instanceof Set?G.set:typeof Date<"u"&&e instanceof Date?G.date:G.object;default:return G.unknown}},B=De.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"]),_N=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class zn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zn.create=e=>new zn(e);const ol=(e,t)=>{let n;switch(e.code){case B.invalid_type:e.received===G.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case B.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case B.invalid_union:n="Invalid input";break;case B.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case B.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case B.invalid_arguments:n="Invalid function arguments";break;case B.invalid_return_type:n="Invalid function return type";break;case B.invalid_date:n="Invalid date";break;case B.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case B.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case B.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case B.custom:n="Invalid input";break;case B.invalid_intersection_types:n="Intersection results could not be merged";break;case B.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case B.not_finite:n="Number must be finite";break;default:n=t.defaultError,De.assertNever(e)}return{message:n}};let Nb=ol;function EN(e){Nb=e}function kc(){return Nb}const Tc=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:o.message||a}},CN=[];function X(e,t){const n=Tc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,kc(),ol].filter(r=>!!r)});e.common.issues.push(n)}class Mt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return ge;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return Mt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return ge;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}}const ge=Object.freeze({status:"aborted"}),Ob=e=>({status:"dirty",value:e}),Bt=e=>({status:"valid",value:e}),ap=e=>e.status==="aborted",lp=e=>e.status==="dirty",il=e=>e.status==="valid",$c=e=>typeof Promise<"u"&&e instanceof Promise;var ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ce||(ce={}));class sr{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const uy=(e,t)=>{if(il(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zn(e.common.issues);return this._error=n,this._error}}};function we(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:o}}class be{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Xr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Xr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mt,ctx:{common:t.parent.common,data:t.data,parsedType:Xr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($c(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xr(t)},i=this._parseSync({data:t,path:o.path,parent:o});return uy(o,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xr(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await($c(o)?o:Promise.resolve(o));return uy(r,i)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=t(o),a=()=>i.addIssue({code:B.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Wn({schema:this,typeName:fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Er.create(this,this._def)}nullable(){return xi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this,this._def)}promise(){return Is.create(this,this._def)}or(t){return ul.create([this,t],this._def)}and(t){return cl.create(this,t,this._def)}transform(t){return new Wn({...we(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ml({...we(this._def),innerType:this,defaultValue:n,typeName:fe.ZodDefault})}brand(){return new Db({typeName:fe.ZodBranded,type:this,...we(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Oc({...we(this._def),innerType:this,catchValue:n,typeName:fe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return zl.create(this,t)}readonly(){return Dc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kN=/^c[^\s-]{8,}$/i,TN=/^[a-z][a-z0-9]*$/,$N=/^[0-9A-HJKMNP-TV-Z]{26}$/,RN=/^[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,PN=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,NN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _f;const ON=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,AN=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,DN=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function MN(e,t){return!!((t==="v4"||!t)&&ON.test(e)||(t==="v6"||!t)&&AN.test(e))}class Ln extends be{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==G.string){const i=this._getOrReturnCtx(t);return X(i,{code:B.invalid_type,expected:G.string,received:i.parsedType}),ge}const r=new Mt;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(o=this._getOrReturnCtx(t,o),X(o,{code:B.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,a=t.data.lengtht.test(o),{validation:n,code:B.invalid_string,...ce.errToObj(r)})}_addCheck(t){return new Ln({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ce.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...ce.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ce.errToObj(n)})}nonempty(t){return this.min(1,ce.errToObj(t))}trim(){return new Ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ln({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ln({checks:[],typeName:fe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};function jN(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class To extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==G.number){const i=this._getOrReturnCtx(t);return X(i,{code:B.invalid_type,expected:G.number,received:i.parsedType}),ge}let r;const o=new Mt;for(const i of this._def.checks)i.kind==="int"?De.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:B.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),X(r,{code:B.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?jN(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),X(r,{code:B.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:B.not_finite,message:i.message}),o.dirty()):De.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ce.toString(n))}setLimit(t,n,r,o){return new To({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ce.toString(o)}]})}_addCheck(t){return new To({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew To({checks:[],typeName:fe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class $o extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==G.bigint){const i=this._getOrReturnCtx(t);return X(i,{code:B.invalid_type,expected:G.bigint,received:i.parsedType}),ge}let r;const o=new Mt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),X(r,{code:B.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),X(r,{code:B.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):De.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ce.toString(n))}setLimit(t,n,r,o){return new $o({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ce.toString(o)}]})}_addCheck(t){return new $o({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new $o({checks:[],typeName:fe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};class sl extends be{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==G.boolean){const r=this._getOrReturnCtx(t);return X(r,{code:B.invalid_type,expected:G.boolean,received:r.parsedType}),ge}return Bt(t.data)}}sl.create=e=>new sl({typeName:fe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class yi extends be{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==G.date){const i=this._getOrReturnCtx(t);return X(i,{code:B.invalid_type,expected:G.date,received:i.parsedType}),ge}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return X(i,{code:B.invalid_date}),ge}const r=new Mt;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(o=this._getOrReturnCtx(t,o),X(o,{code:B.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):De.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new yi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ce.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew yi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:fe.ZodDate,...we(e)});class Rc extends be{_parse(t){if(this._getType(t)!==G.symbol){const r=this._getOrReturnCtx(t);return X(r,{code:B.invalid_type,expected:G.symbol,received:r.parsedType}),ge}return Bt(t.data)}}Rc.create=e=>new Rc({typeName:fe.ZodSymbol,...we(e)});class al extends be{_parse(t){if(this._getType(t)!==G.undefined){const r=this._getOrReturnCtx(t);return X(r,{code:B.invalid_type,expected:G.undefined,received:r.parsedType}),ge}return Bt(t.data)}}al.create=e=>new al({typeName:fe.ZodUndefined,...we(e)});class ll extends be{_parse(t){if(this._getType(t)!==G.null){const r=this._getOrReturnCtx(t);return X(r,{code:B.invalid_type,expected:G.null,received:r.parsedType}),ge}return Bt(t.data)}}ll.create=e=>new ll({typeName:fe.ZodNull,...we(e)});class js extends be{constructor(){super(...arguments),this._any=!0}_parse(t){return Bt(t.data)}}js.create=e=>new js({typeName:fe.ZodAny,...we(e)});class ui extends be{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Bt(t.data)}}ui.create=e=>new ui({typeName:fe.ZodUnknown,...we(e)});class Rr extends be{_parse(t){const n=this._getOrReturnCtx(t);return X(n,{code:B.invalid_type,expected:G.never,received:n.parsedType}),ge}}Rr.create=e=>new Rr({typeName:fe.ZodNever,...we(e)});class Pc extends be{_parse(t){if(this._getType(t)!==G.undefined){const r=this._getOrReturnCtx(t);return X(r,{code:B.invalid_type,expected:G.void,received:r.parsedType}),ge}return Bt(t.data)}}Pc.create=e=>new Pc({typeName:fe.ZodVoid,...we(e)});class Vn extends be{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==G.array)return X(n,{code:B.invalid_type,expected:G.array,received:n.parsedType}),ge;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.lengtho.maxLength.value&&(X(n,{code:B.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new sr(n,s,n.path,a)))).then(s=>Mt.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new sr(n,s,n.path,a)));return Mt.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Vn({...this._def,minLength:{value:t,message:ce.toString(n)}})}max(t,n){return new Vn({...this._def,maxLength:{value:t,message:ce.toString(n)}})}length(t,n){return new Vn({...this._def,exactLength:{value:t,message:ce.toString(n)}})}nonempty(t){return this.min(1,t)}}Vn.create=(e,t)=>new Vn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,...we(t)});function Ii(e){if(e instanceof tt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Er.create(Ii(r))}return new tt({...e._def,shape:()=>t})}else return e instanceof Vn?new Vn({...e._def,type:Ii(e.element)}):e instanceof Er?Er.create(Ii(e.unwrap())):e instanceof xi?xi.create(Ii(e.unwrap())):e instanceof ar?ar.create(e.items.map(t=>Ii(t))):e}class tt extends be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=De.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==G.object){const u=this._getOrReturnCtx(t);return X(u,{code:B.invalid_type,expected:G.object,received:u.parsedType}),ge}const{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Rr&&this._def.unknownKeys==="strip"))for(const u in o.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const d=i[u],h=o.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new sr(o,h,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Rr){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(X(o,{code:B.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const h=o.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new sr(o,h,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const h=await d.key;u.push({key:h,value:await d.value,alwaysSet:d.alwaysSet})}return u}).then(u=>Mt.mergeObjectSync(r,u)):Mt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ce.errToObj,new tt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,a;const l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:fe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new tt({...this._def,catchall:t})}pick(t){const n={};return De.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new tt({...this._def,shape:()=>n})}omit(t){const n={};return De.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new tt({...this._def,shape:()=>n})}deepPartial(){return Ii(this)}partial(t){const n={};return De.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new tt({...this._def,shape:()=>n})}required(t){const n={};return De.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Er;)i=i._def.innerType;n[r]=i}}),new tt({...this._def,shape:()=>n})}keyof(){return Ab(De.objectKeys(this.shape))}}tt.create=(e,t)=>new tt({shape:()=>e,unknownKeys:"strip",catchall:Rr.create(),typeName:fe.ZodObject,...we(t)});tt.strictCreate=(e,t)=>new tt({shape:()=>e,unknownKeys:"strict",catchall:Rr.create(),typeName:fe.ZodObject,...we(t)});tt.lazycreate=(e,t)=>new tt({shape:e,unknownKeys:"strip",catchall:Rr.create(),typeName:fe.ZodObject,...we(t)});class ul extends be{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new zn(a.ctx.common.issues));return X(n,{code:B.invalid_union,unionErrors:s}),ge}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new zn(l));return X(n,{code:B.invalid_union,unionErrors:a}),ge}}get options(){return this._def.options}}ul.create=(e,t)=>new ul({options:e,typeName:fe.ZodUnion,...we(t)});const Uu=e=>e instanceof fl?Uu(e.schema):e instanceof Wn?Uu(e.innerType()):e instanceof hl?[e.value]:e instanceof Ro?e.options:e instanceof pl?Object.keys(e.enum):e instanceof ml?Uu(e._def.innerType):e instanceof al?[void 0]:e instanceof ll?[null]:null;class xd extends be{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==G.object)return X(n,{code:B.invalid_type,expected:G.object,received:n.parsedType}),ge;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(X(n,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ge)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const i of n){const s=Uu(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new xd({typeName:fe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...we(r)})}}function up(e,t){const n=Xr(e),r=Xr(t);if(e===t)return{valid:!0,data:e};if(n===G.object&&r===G.object){const o=De.objectKeys(t),i=De.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of i){const l=up(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===G.array&&r===G.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i{if(ap(i)||ap(s))return ge;const a=up(i.value,s.value);return a.valid?((lp(i)||lp(s))&&n.dirty(),{status:n.value,value:a.data}):(X(r,{code:B.invalid_intersection_types}),ge)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}cl.create=(e,t,n)=>new cl({left:e,right:t,typeName:fe.ZodIntersection,...we(n)});class ar extends be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.array)return X(r,{code:B.invalid_type,expected:G.array,received:r.parsedType}),ge;if(r.data.lengththis._def.items.length&&(X(r,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new sr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Mt.mergeArray(n,s)):Mt.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ar({...this._def,rest:t})}}ar.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ar({items:e,typeName:fe.ZodTuple,rest:null,...we(t)})};class dl extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.object)return X(r,{code:B.invalid_type,expected:G.object,received:r.parsedType}),ge;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new sr(r,a,r.path,a)),value:s._parse(new sr(r,r.data[a],r.path,a))});return r.common.async?Mt.mergeObjectAsync(n,o):Mt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof be?new dl({keyType:t,valueType:n,typeName:fe.ZodRecord,...we(r)}):new dl({keyType:Ln.create(),valueType:t,typeName:fe.ZodRecord,...we(n)})}}class Nc extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.map)return X(r,{code:B.invalid_type,expected:G.map,received:r.parsedType}),ge;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new sr(r,a,r.path,[u,"key"])),value:i._parse(new sr(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return ge;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return ge;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}Nc.create=(e,t,n)=>new Nc({valueType:t,keyType:e,typeName:fe.ZodMap,...we(n)});class wi extends be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==G.set)return X(r,{code:B.invalid_type,expected:G.set,received:r.parsedType}),ge;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(X(r,{code:B.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const u=new Set;for(const d of l){if(d.status==="aborted")return ge;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new sr(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new wi({...this._def,minSize:{value:t,message:ce.toString(n)}})}max(t,n){return new wi({...this._def,maxSize:{value:t,message:ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}wi.create=(e,t)=>new wi({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,...we(t)});class ss extends be{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==G.function)return X(n,{code:B.invalid_type,expected:G.function,received:n.parsedType}),ge;function r(a,l){return Tc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,kc(),ol].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function o(a,l){return Tc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,kc(),ol].filter(u=>!!u),issueData:{code:B.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Is){const a=this;return Bt(async function(...l){const u=new zn([]),d=await a._def.args.parseAsync(l,i).catch(g=>{throw u.addIssue(r(l,g)),u}),h=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(h,i).catch(g=>{throw u.addIssue(o(h,g)),u})})}else{const a=this;return Bt(function(...l){const u=a._def.args.safeParse(l,i);if(!u.success)throw new zn([r(l,u.error)]);const d=Reflect.apply(s,this,u.data),h=a._def.returns.safeParse(d,i);if(!h.success)throw new zn([o(d,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ss({...this._def,args:ar.create(t).rest(ui.create())})}returns(t){return new ss({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ss({args:t||ar.create([]).rest(ui.create()),returns:n||ui.create(),typeName:fe.ZodFunction,...we(r)})}}class fl extends be{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}fl.create=(e,t)=>new fl({getter:e,typeName:fe.ZodLazy,...we(t)});class hl extends be{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return X(n,{received:n.data,code:B.invalid_literal,expected:this._def.value}),ge}return{status:"valid",value:t.data}}get value(){return this._def.value}}hl.create=(e,t)=>new hl({value:e,typeName:fe.ZodLiteral,...we(t)});function Ab(e,t){return new Ro({values:e,typeName:fe.ZodEnum,...we(t)})}class Ro extends be{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return X(n,{expected:De.joinValues(r),received:n.parsedType,code:B.invalid_type}),ge}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return X(n,{received:n.data,code:B.invalid_enum_value,options:r}),ge}return Bt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Ro.create(t)}exclude(t){return Ro.create(this.options.filter(n=>!t.includes(n)))}}Ro.create=Ab;class pl extends be{_parse(t){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==G.string&&r.parsedType!==G.number){const o=De.objectValues(n);return X(r,{expected:De.joinValues(o),received:r.parsedType,code:B.invalid_type}),ge}if(n.indexOf(t.data)===-1){const o=De.objectValues(n);return X(r,{received:r.data,code:B.invalid_enum_value,options:o}),ge}return Bt(t.data)}get enum(){return this._def.values}}pl.create=(e,t)=>new pl({values:e,typeName:fe.ZodNativeEnum,...we(t)});class Is extends be{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==G.promise&&n.common.async===!1)return X(n,{code:B.invalid_type,expected:G.promise,received:n.parsedType}),ge;const r=n.parsedType===G.promise?n.data:Promise.resolve(n.data);return Bt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Is.create=(e,t)=>new Is({type:e,typeName:fe.ZodPromise,...we(t)});class Wn extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{X(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ge:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?ge:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!il(s))return s;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>il(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):s);De.assertNever(o)}}Wn.create=(e,t,n)=>new Wn({schema:e,typeName:fe.ZodEffects,effect:t,...we(n)});Wn.createWithPreprocess=(e,t,n)=>new Wn({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,...we(n)});class Er extends be{_parse(t){return this._getType(t)===G.undefined?Bt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Er.create=(e,t)=>new Er({innerType:e,typeName:fe.ZodOptional,...we(t)});class xi extends be{_parse(t){return this._getType(t)===G.null?Bt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}xi.create=(e,t)=>new xi({innerType:e,typeName:fe.ZodNullable,...we(t)});class ml extends be{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===G.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ml.create=(e,t)=>new ml({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...we(t)});class Oc extends be{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $c(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oc.create=(e,t)=>new Oc({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...we(t)});class Ac extends be{_parse(t){if(this._getType(t)!==G.nan){const r=this._getOrReturnCtx(t);return X(r,{code:B.invalid_type,expected:G.nan,received:r.parsedType}),ge}return{status:"valid",value:t.data}}}Ac.create=e=>new Ac({typeName:fe.ZodNaN,...we(e)});const IN=Symbol("zod_brand");class Db extends be{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class zl extends be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ge:i.status==="dirty"?(n.dirty(),Ob(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ge:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new zl({in:t,out:n,typeName:fe.ZodPipeline})}}class Dc extends be{_parse(t){const n=this._def.innerType._parse(t);return il(n)&&(n.value=Object.freeze(n.value)),n}}Dc.create=(e,t)=>new Dc({innerType:e,typeName:fe.ZodReadonly,...we(t)});const Mb=(e,t={},n)=>e?js.create().superRefine((r,o)=>{var i,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:l})}}):js.create(),LN={object:tt.lazycreate};var fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));const FN=(e,t={message:`Input not instance of ${e.name}`})=>Mb(n=>n instanceof e,t),Qt=Ln.create,jb=To.create,UN=Ac.create,zN=$o.create,Ib=sl.create,VN=yi.create,BN=Rc.create,WN=al.create,HN=ll.create,ZN=js.create,KN=ui.create,QN=Rr.create,YN=Pc.create,Lb=Vn.create,In=tt.create,qN=tt.strictCreate,GN=ul.create,XN=xd.create,JN=cl.create,e2=ar.create,t2=dl.create,n2=Nc.create,r2=wi.create,o2=ss.create,i2=fl.create,s2=hl.create,a2=Ro.create,l2=pl.create,u2=Is.create,cy=Wn.create,c2=Er.create,d2=xi.create,f2=Wn.createWithPreprocess,h2=zl.create,p2=()=>Qt().optional(),m2=()=>jb().optional(),v2=()=>Ib().optional(),g2={string:e=>Ln.create({...e,coerce:!0}),number:e=>To.create({...e,coerce:!0}),boolean:e=>sl.create({...e,coerce:!0}),bigint:e=>$o.create({...e,coerce:!0}),date:e=>yi.create({...e,coerce:!0})},y2=ge;var va=Object.freeze({__proto__:null,defaultErrorMap:ol,setErrorMap:EN,getErrorMap:kc,makeIssue:Tc,EMPTY_PATH:CN,addIssueToContext:X,ParseStatus:Mt,INVALID:ge,DIRTY:Ob,OK:Bt,isAborted:ap,isDirty:lp,isValid:il,isAsync:$c,get util(){return De},get objectUtil(){return sp},ZodParsedType:G,getParsedType:Xr,ZodType:be,ZodString:Ln,ZodNumber:To,ZodBigInt:$o,ZodBoolean:sl,ZodDate:yi,ZodSymbol:Rc,ZodUndefined:al,ZodNull:ll,ZodAny:js,ZodUnknown:ui,ZodNever:Rr,ZodVoid:Pc,ZodArray:Vn,ZodObject:tt,ZodUnion:ul,ZodDiscriminatedUnion:xd,ZodIntersection:cl,ZodTuple:ar,ZodRecord:dl,ZodMap:Nc,ZodSet:wi,ZodFunction:ss,ZodLazy:fl,ZodLiteral:hl,ZodEnum:Ro,ZodNativeEnum:pl,ZodPromise:Is,ZodEffects:Wn,ZodTransformer:Wn,ZodOptional:Er,ZodNullable:xi,ZodDefault:ml,ZodCatch:Oc,ZodNaN:Ac,BRAND:IN,ZodBranded:Db,ZodPipeline:zl,ZodReadonly:Dc,custom:Mb,Schema:be,ZodSchema:be,late:LN,get ZodFirstPartyTypeKind(){return fe},coerce:g2,any:ZN,array:Lb,bigint:zN,boolean:Ib,date:VN,discriminatedUnion:XN,effect:cy,enum:a2,function:o2,instanceof:FN,intersection:JN,lazy:i2,literal:s2,map:n2,nan:UN,nativeEnum:l2,never:QN,null:HN,nullable:d2,number:jb,object:In,oboolean:v2,onumber:m2,optional:c2,ostring:p2,pipeline:h2,preprocess:f2,promise:u2,record:t2,set:r2,strictObject:qN,string:Qt,symbol:BN,transformer:cy,tuple:e2,undefined:WN,union:GN,unknown:KN,void:YN,NEVER:y2,ZodIssueCode:B,quotelessJson:_N,ZodError:zn});const Ir="/api";var Dm=(e=>(e[e.IDLE=0]="IDLE",e[e.LOADING=1]="LOADING",e[e.ERROR=2]="ERROR",e))(Dm||{});const w2=Ir+"/agents/message",Fb=gd(PR({socket:null,socketURL:null,readyState:0,abortController:null,onMessageCallback:e=>console.warn("No message callback set up. Simply logging message",e)},(e,t)=>({actions:{sendMessage:({userId:n,agentId:r,message:o,role:i,bearerToken:s})=>{const a=new AbortController;e(g=>({...g,abortController:a,readyState:1}));const l=t().onMessageCallback,u=()=>e(g=>({...g,readyState:0})),d=()=>e(g=>({...g,readyState:0})),h=()=>e(g=>({...g,readyState:1})),p=()=>e(g=>(a.abort(),{...g,abortController:null,readyState:2}));bN(w2,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:s},body:JSON.stringify({user_id:n,agent_id:r,message:o,role:i??"user",stream:!0}),signal:a.signal,onopen:async g=>{g.ok&&g.status===200?(console.log("Connection made ",g),h()):g.status>=400&&g.status<500&&g.status!==429&&(console.log("Client-side error ",g),p())},onmessage:async g=>{const y=JSON.parse(g.data);console.log("raw data returned in streamed response",y);const v=In({internal_monologue:Qt().nullable()}).or(In({assistant_message:Qt()})).or(In({function_call:Qt()})).or(In({function_return:Qt()})).or(In({internal_error:Qt()})).and(In({date:Qt().optional().transform(b=>b?new Date(b):new Date)})).parse(y);"internal_monologue"in v?l({type:"agent_response",message_type:"internal_monologue",message:v.internal_monologue??"None",date:v.date}):"assistant_message"in v?(l({type:"agent_response",message_type:"assistant_message",message:v.assistant_message,date:v.date}),d()):"function_call"in v?l({type:"agent_response",message_type:"function_call",message:v.function_call,date:v.date}):"function_return"in v?l({type:"agent_response",message_type:"function_return",message:v.function_return,date:v.date}):"internal_error"in v&&(l({type:"agent_response",message_type:"internal_error",message:v.internal_error,date:v.date}),p())},onclose(){console.log("Connection closed by the server"),u()},onerror(g){console.log("There was an error from server",g),p()}})},registerOnMessageCallback:n=>e(r=>({...r,onMessageCallback:n})),abortStream:()=>{var n;(n=t().abortController)==null||n.abort(),e({...e,abortController:null,readyState:0})}}}))),x2=()=>Fb(e=>e.readyState),Ub=()=>Fb(e=>e.actions),Mm=gd(Om((e,t)=>({auth:{uuid:null,token:null,loggedIn:!1},actions:{setToken:n=>e(r=>({...r,auth:{...r.auth,token:n}})),setAsAuthenticated:(n,r)=>e(o=>({...o,auth:{token:r??o.auth.token,uuid:n,loggedIn:!0}})),logout:()=>e(n=>({...n,auth:{token:null,uuid:null,loggedIn:!1}}))}}),{name:"auth-storage",storage:Nm(()=>localStorage),partialize:({actions:e,...t})=>t})),Lo=()=>Mm().auth,jm=()=>Mm().actions,Fo=()=>{const{auth:e}=Mm();return e.token?`Bearer ${e.token}`:""},b2=e=>{const{loggedIn:t}=Lo(),{logout:n}=jm(),r=Zs(),o=Pm();return!t&&r.pathname!=="/login"&&(n(),o("/login")),e.children},S2=jl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function zb({className:e,variant:t,...n}){return x.jsx("div",{className:le(S2({variant:t}),e),...n})}const dy=({children:e})=>x.jsx("div",{className:"relative mt-4 h-[70svh] overflow-y-auto rounded-md border bg-muted/50",children:e}),_2=(...e)=>le("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),Vb=(...e)=>le("scroll-m-20 text-2xl font-semibold tracking-tight",e),E2=(...e)=>le("scroll-m-20 text-xl font-semibold tracking-tight",e),C2=(...e)=>le("rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),k2=(...e)=>le("text-xl text-muted-foreground",e),Po=(...e)=>le("text-sm text-muted-foreground",e),T2=jl("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Bb=c.forwardRef(({className:e,variant:t,...n},r)=>x.jsx("div",{ref:r,role:"alert",className:le(T2({variant:t}),e),...n}));Bb.displayName="Alert";const Wb=c.forwardRef(({className:e,...t},n)=>x.jsx("h5",{ref:n,className:le("mb-1 font-medium leading-none tracking-tight",e),...t}));Wb.displayName="AlertTitle";const Hb=c.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:le("text-sm [&_p]:leading-relaxed",e),...t}));Hb.displayName="AlertDescription";const $2=e=>x.jsxs(Bb,{className:"w-fit max-w-md p-2 text-xs [&>svg]:left-2.5 [&>svg]:top-2.5",variant:"destructive",children:[x.jsx(rk,{className:"h-4 w-4"}),x.jsx(Wb,{children:"Something went wrong..."}),x.jsx(Hb,{className:"text-xs",children:e.message})]}),Zb="Avatar",[R2,$M]=Mr(Zb),[P2,Kb]=R2(Zb),N2=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=c.useState("idle");return c.createElement(P2,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i},c.createElement(ke.span,ne({},r,{ref:t})))}),O2="AvatarImage",A2=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=Kb(O2,n),a=j2(r),l=Vt(u=>{o(u),s.onImageLoadingStatusChange(u)});return Jt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?c.createElement(ke.img,ne({},i,{ref:t,src:r})):null}),D2="AvatarFallback",M2=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=Kb(D2,n),[s,a]=c.useState(r===void 0);return c.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?c.createElement(ke.span,ne({},o,{ref:t})):null});function j2(e){const[t,n]=c.useState("idle");return Jt(()=>{if(!e){n("error");return}let r=!0;const o=new window.Image,i=s=>()=>{r&&n(s)};return n("loading"),o.onload=i("loaded"),o.onerror=i("error"),o.src=e,()=>{r=!1}},[e]),t}const Qb=N2,Yb=A2,qb=M2,bd=c.forwardRef(({className:e,...t},n)=>x.jsx(Qb,{ref:n,className:le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));bd.displayName=Qb.displayName;const Sd=c.forwardRef(({className:e,...t},n)=>x.jsx(Yb,{ref:n,className:le("aspect-square h-full w-full",e),...t}));Sd.displayName=Yb.displayName;const _d=c.forwardRef(({className:e,...t},n)=>x.jsx(qb,{ref:n,className:le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));_d.displayName=qb.displayName;const Gb=e=>x.jsxs("div",{className:`flex items-end ${e.dir==="ltr"?"justify-start":"justify-end"}`,children:[x.jsxs("div",{className:"order-2 mx-2 flex max-w-xs flex-col items-start space-y-1 text-xs",children:[x.jsx("div",{children:x.jsx("span",{className:`inline-block rounded-lg px-4 py-2 ${e.dir==="ltr"?"rounded-bl-none":"rounded-br-none"} ${e.bg} ${e.fg}`,children:e.message})}),x.jsx("span",{className:"text-muted-foreground",children:YP(e.date,"M/d/yy, h:mm a")})]}),x.jsxs(bd,{className:e.dir==="ltr"?"order-1":"order-2",children:[x.jsx(Sd,{alt:e.initials,src:"/placeholder.svg?height=32&width=32"}),x.jsx(_d,{className:"border",children:e.initials})]})]}),I2=e=>x.jsx(Gb,{message:e.message,date:e.date,dir:"ltr",bg:"bg-blue-600",fg:"text-white",initials:"AI"}),L2=e=>x.jsx(Gb,{message:e.message,date:e.date,dir:"rtl",bg:"bg-muted-foreground/40 dark:bg-muted-foreground/20",fg:"text-black dark:text-white",initials:"U"}),F2=({type:e,message_type:t,message:n,date:r},o)=>{if(e==="user_message")return x.jsx(L2,{date:r,message:n??""},o);if(e==="agent_response"&&t==="internal_error")return x.jsx($2,{date:r,message:n??""},o);if(e==="agent_response"&&t==="assistant_message")return x.jsx(I2,{date:r,message:n??""},o);if(e==="agent_response"&&t==="function_call"&&!(n!=null&&n.includes("send_message"))||e==="agent_response"&&t==="function_return"&&n!=="None")return x.jsx("p",{className:C2("mb-2 w-fit max-w-xl overflow-x-scroll whitespace-nowrap rounded border bg-black p-2 text-xs text-white"),children:n},o);if(e==="agent_response"&&t==="internal_monologue")return x.jsx("p",{className:Po("mb-2 w-fit max-w-xs rounded border p-2 text-xs"),children:n},o)},Xb=jl("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ct=c.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Eo:"button";return x.jsx(s,{className:le(Xb({variant:t,size:n,className:e})),ref:i,...o})});Ct.displayName="Button";const Im=c.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Im.displayName="Card";const Lm=c.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:le("flex flex-col space-y-1.5 p-6",e),...t}));Lm.displayName="CardHeader";const Fm=c.forwardRef(({className:e,...t},n)=>x.jsx("h3",{ref:n,className:le("text-2xl font-semibold leading-none tracking-tight",e),...t}));Fm.displayName="CardTitle";const Um=c.forwardRef(({className:e,...t},n)=>x.jsx("p",{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Um.displayName="CardDescription";const Jb=c.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:le("p-6 pt-0",e),...t}));Jb.displayName="CardContent";const zm=c.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:le("flex items-center p-6 pt-0",e),...t}));zm.displayName="CardFooter";const Vm=e=>{const t=Fo();return Il({queryKey:[e,"agents","list"],enabled:!!e,queryFn:async()=>await fetch(Ir+`/agents?user_id=${e}`,{headers:{Authorization:t}}).then(n=>n.json())})},U2=()=>{const{uuid:e}=Lo(),{data:t}=Vm(e),[n,r]=c.useState(null),{setAgent:o}=yd();return x.jsxs(Im,{className:"my-10 mx-4 w-fit bg-background animate-in slide-in-from-top slide-out-to-top duration-700 sm:mx-auto ",children:[x.jsxs(Lm,{className:"pb-3",children:[x.jsx(Fm,{children:"Choose Agent"}),x.jsx(Um,{children:"Pick an agent to start a conversation..."})]}),x.jsx(Jb,{className:"grid gap-1",children:((t==null?void 0:t.agents)??[]).map((i,s)=>x.jsxs("button",{onClick:()=>r(i),className:le("-mx-2 flex items-start space-x-4 rounded-md p-2 text-left transition-all",(n==null?void 0:n.name)===i.name?"bg-accent text-accent-foreground":"hover:bg-accent hover:text-accent-foreground"),children:[x.jsx(hk,{className:"mt-px h-5 w-5"}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("p",{className:"text-sm font-medium leading-none",children:i.name}),x.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.human," | ",i.persona," | ",i.created_at]})]})]},s))}),x.jsx(zm,{children:x.jsx(Ct,{onClick:()=>n&&o(n),className:"w-full",children:"Start Chat"})})]})},z2=({className:e})=>x.jsxs("div",{className:e,children:[x.jsxs("span",{className:"relative flex h-4 w-4",children:[x.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-400 opacity-75"}),x.jsx("span",{className:"relative inline-flex h-4 w-4 rounded-full bg-blue-600"})]}),x.jsx("span",{className:Po("ml-4"),children:"Thinking..."})]}),V2=({currentAgent:e,messages:t,readyState:n,previousMessages:r})=>{const o=c.useRef(null);return c.useEffect(()=>{var i;return(i=o.current)==null?void 0:i.scrollIntoView(!1)},[t]),e?x.jsxs(dy,{children:[x.jsx(zb,{className:"sticky left-1/2 top-2 z-10 mx-auto origin-center -translate-x-1/2 bg-background py-1 px-4",variant:"outline",children:x.jsx("span",{children:e.name})}),x.jsxs("div",{className:"flex flex-1 flex-col space-y-4 px-4 py-6",ref:o,children:[r.map(i=>{var s;return x.jsxs("p",{children:[i.name," | ",i.role," | ",i.content," | ",(s=i.function_call)==null?void 0:s.arguments]})}),t.map((i,s)=>F2(i,s)),n===Dm.LOADING?x.jsx(z2,{className:"flex items-center py-3 px-3"}):void 0]})]}):x.jsx(dy,{children:x.jsx(U2,{})})},bi=c.forwardRef(({className:e,type:t,...n},r)=>x.jsx("input",{type:t,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));bi.displayName="Input";var Vl=e=>e.type==="checkbox",Xi=e=>e instanceof Date,Ut=e=>e==null;const e1=e=>typeof e=="object";var yt=e=>!Ut(e)&&!Array.isArray(e)&&e1(e)&&!Xi(e),t1=e=>yt(e)&&e.target?Vl(e.target)?e.target.checked:e.target.value:e,B2=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,n1=(e,t)=>e.has(B2(t)),W2=e=>{const t=e.constructor&&e.constructor.prototype;return yt(t)&&t.hasOwnProperty("isPrototypeOf")},Bm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ot(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Bm&&(e instanceof Blob||e instanceof FileList))&&(n||yt(e)))if(t=n?[]:{},!n&&!W2(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ot(e[r]));else return e;return t}var Ks=e=>Array.isArray(e)?e.filter(Boolean):[],qe=e=>e===void 0,Q=(e,t,n)=>{if(!t||!yt(e))return n;const r=Ks(t.split(/[,[\].]+?/)).reduce((o,i)=>Ut(o)?o:o[i],e);return qe(r)||r===e?qe(e[t])?n:e[t]:r},uo=e=>typeof e=="boolean";const Mc={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},_n={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},r1=de.createContext(null),Bl=()=>de.useContext(r1),H2=e=>{const{children:t,...n}=e;return de.createElement(r1.Provider,{value:n},t)};var o1=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==_n.all&&(t._proxyFormState[s]=!r||_n.all),n&&(n[s]=!0),e[s]}});return o},rn=e=>yt(e)&&!Object.keys(e).length,i1=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return rn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||_n.all))},an=e=>Array.isArray(e)?e:[e],s1=(e,t,n)=>!e||!t||e===t||an(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Ed(e){const t=de.useRef(e);t.current=e,de.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function Z2(e){const t=Bl(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,a]=de.useState(n._formState),l=de.useRef(!0),u=de.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=de.useRef(o);return d.current=o,Ed({disabled:r,next:h=>l.current&&s1(d.current,h.name,i)&&i1(h,u.current,n._updateFormState)&&a({...n._formState,...h}),subject:n._subjects.state}),de.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),o1(s,n,u.current,!1)}var tr=e=>typeof e=="string",a1=(e,t,n,r,o)=>tr(e)?(r&&t.watch.add(e),Q(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Q(n,i))):(r&&(t.watchAll=!0),n);function K2(e){const t=Bl(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s}=e||{},a=de.useRef(r);a.current=r,Ed({disabled:i,subject:n._subjects.values,next:d=>{s1(a.current,d.name,s)&&u(Ot(a1(a.current,n._names,d.values||n._formValues,!1,o)))}});const[l,u]=de.useState(n._getWatch(r,o));return de.useEffect(()=>n._removeUnmounted()),l}var Wm=e=>/^\w*$/.test(e),l1=e=>Ks(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Ie(e,t,n){let r=-1;const o=Wm(t)?[t]:l1(t),i=o.length,s=i-1;for(;++r{const d=o._options.shouldUnregister||i,h=(p,g)=>{const y=Q(o._fields,p);y&&(y._f.mount=g)};if(h(n,!0),d){const p=Ot(Q(o._options.defaultValues,n));Ie(o._defaultValues,n,p),qe(Q(o._formValues,n))&&Ie(o._formValues,n,p)}return()=>{(s?d&&!o._state.action:d)?o.unregister(n):h(n,!1)}},[n,o,s,i]),de.useEffect(()=>{Q(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),{field:{name:n,value:a,...uo(r)?{disabled:r}:{},onChange:de.useCallback(d=>u.current.onChange({target:{value:t1(d),name:n},type:Mc.CHANGE}),[n]),onBlur:de.useCallback(()=>u.current.onBlur({target:{value:Q(o._formValues,n),name:n},type:Mc.BLUR}),[n,o]),ref:d=>{const h=Q(o._fields,n);h&&d&&(h._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:p=>d.setCustomValidity(p),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Q(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Q(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Q(l.touchedFields,n)},error:{enumerable:!0,get:()=>Q(l.errors,n)}})}}const zu=e=>e.render(Q2(e));var u1=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const jc=(e,t,n)=>{for(const r of n||Object.keys(e)){const o=Q(e,r);if(o){const{_f:i,...s}=o;if(i&&t(i.name)){if(i.ref.focus){i.ref.focus();break}else if(i.refs&&i.refs[0].focus){i.refs[0].focus();break}}else yt(s)&&jc(s,t)}}};var Wr=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Ef=(e,t,n={})=>n.shouldFocus||qe(n.shouldFocus)?n.focusName||`${e}.${qe(n.focusIndex)?t:n.focusIndex}.`:"",cp=e=>({isOnSubmit:!e||e===_n.onSubmit,isOnBlur:e===_n.onBlur,isOnChange:e===_n.onChange,isOnAll:e===_n.all,isOnTouch:e===_n.onTouched}),dp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),c1=(e,t,n)=>{const r=Ks(Q(e,n));return Ie(r,"root",t[n]),Ie(e,n,r),e},Hm=e=>e.type==="file",co=e=>typeof e=="function",Ic=e=>{if(!Bm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Vu=e=>tr(e),Zm=e=>e.type==="radio",Lc=e=>e instanceof RegExp;const fy={value:!1,isValid:!1},hy={value:!0,isValid:!0};var d1=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!qe(e[0].attributes.value)?qe(e[0].value)||e[0].value===""?hy:{value:e[0].value,isValid:!0}:hy:fy}return fy};const py={isValid:!1,value:null};var f1=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,py):py;function my(e,t,n="validate"){if(Vu(e)||Array.isArray(e)&&e.every(Vu)||uo(e)&&!e)return{type:n,message:Vu(e)?e:"",ref:t}}var Ai=e=>yt(e)&&!Lc(e)?e:{value:e,message:""},fp=async(e,t,n,r,o)=>{const{ref:i,refs:s,required:a,maxLength:l,minLength:u,min:d,max:h,pattern:p,validate:g,name:y,valueAsNumber:v,mount:b,disabled:m}=e._f,f=Q(t,y);if(!b||m)return{};const w=s?s[0]:i,S=D=>{r&&w.reportValidity&&(w.setCustomValidity(uo(D)?"":D||""),w.reportValidity())},_={},C=Zm(i),E=Vl(i),T=C||E,O=(v||Hm(i))&&qe(i.value)&&qe(f)||Ic(i)&&i.value===""||f===""||Array.isArray(f)&&!f.length,j=u1.bind(null,y,n,_),V=(D,W,M,F=fr.maxLength,H=fr.minLength)=>{const oe=D?W:M;_[y]={type:D?F:H,message:oe,ref:i,...j(D?F:H,oe)}};if(o?!Array.isArray(f)||!f.length:a&&(!T&&(O||Ut(f))||uo(f)&&!f||E&&!d1(s).isValid||C&&!f1(s).isValid)){const{value:D,message:W}=Vu(a)?{value:!!a,message:a}:Ai(a);if(D&&(_[y]={type:fr.required,message:W,ref:w,...j(fr.required,W)},!n))return S(W),_}if(!O&&(!Ut(d)||!Ut(h))){let D,W;const M=Ai(h),F=Ai(d);if(!Ut(f)&&!isNaN(f)){const H=i.valueAsNumber||f&&+f;Ut(M.value)||(D=H>M.value),Ut(F.value)||(W=Hnew Date(new Date().toDateString()+" "+re),L=i.type=="time",K=i.type=="week";tr(M.value)&&f&&(D=L?oe(f)>oe(M.value):K?f>M.value:H>new Date(M.value)),tr(F.value)&&f&&(W=L?oe(f)+D.value,F=!Ut(W.value)&&f.length<+W.value;if((M||F)&&(V(M,D.message,W.message),!n))return S(_[y].message),_}if(p&&!O&&tr(f)){const{value:D,message:W}=Ai(p);if(Lc(D)&&!f.match(D)&&(_[y]={type:fr.pattern,message:W,ref:i,...j(fr.pattern,W)},!n))return S(W),_}if(g){if(co(g)){const D=await g(f,t),W=my(D,w);if(W&&(_[y]={...W,...j(fr.validate,W.message)},!n))return S(W.message),_}else if(yt(g)){let D={};for(const W in g){if(!rn(D)&&!n)break;const M=my(await g[W](f,t),w,W);M&&(D={...M,...j(W,M.message)},S(M.message),n&&(_[y]=D))}if(!rn(D)&&(_[y]={ref:w,...D},!n))return _}}return S(!0),_};function Cf(e,t){return[...e,...an(t)]}var kf=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Tf(e,t,n){return[...e.slice(0,t),...an(n),...e.slice(t)]}var $f=(e,t,n)=>Array.isArray(e)?(qe(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[];function Rf(e,t){return[...an(t),...an(e)]}function Y2(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return Ks(r).length?r:[]}var Pf=(e,t)=>qe(t)?[]:Y2(e,an(t).sort((n,r)=>n-r)),Nf=(e,t,n)=>{e[t]=[e[n],e[n]=e[t]][0]};function q2(e,t){const n=t.slice(0,-1).length;let r=0;for(;r(e[t]=n,e);function X2(e){const t=Bl(),{control:n=t.control,name:r,keyName:o="id",shouldUnregister:i}=e,[s,a]=de.useState(n._getFieldArray(r)),l=de.useRef(n._getFieldArray(r).map(Wr)),u=de.useRef(s),d=de.useRef(r),h=de.useRef(!1);d.current=r,u.current=s,n._names.array.add(r),e.rules&&n.register(r,e.rules),Ed({next:({values:_,name:C})=>{if(C===d.current||!C){const E=Q(_,d.current);Array.isArray(E)&&(a(E),l.current=E.map(Wr))}},subject:n._subjects.array});const p=de.useCallback(_=>{h.current=!0,n._updateFieldArray(r,_)},[n,r]),g=(_,C)=>{const E=an(Ot(_)),T=Cf(n._getFieldArray(r),E);n._names.focus=Ef(r,T.length-1,C),l.current=Cf(l.current,E.map(Wr)),p(T),a(T),n._updateFieldArray(r,T,Cf,{argA:kf(_)})},y=(_,C)=>{const E=an(Ot(_)),T=Rf(n._getFieldArray(r),E);n._names.focus=Ef(r,0,C),l.current=Rf(l.current,E.map(Wr)),p(T),a(T),n._updateFieldArray(r,T,Rf,{argA:kf(_)})},v=_=>{const C=Pf(n._getFieldArray(r),_);l.current=Pf(l.current,_),p(C),a(C),n._updateFieldArray(r,C,Pf,{argA:_})},b=(_,C,E)=>{const T=an(Ot(C)),O=Tf(n._getFieldArray(r),_,T);n._names.focus=Ef(r,_,E),l.current=Tf(l.current,_,T.map(Wr)),p(O),a(O),n._updateFieldArray(r,O,Tf,{argA:_,argB:kf(C)})},m=(_,C)=>{const E=n._getFieldArray(r);Nf(E,_,C),Nf(l.current,_,C),p(E),a(E),n._updateFieldArray(r,E,Nf,{argA:_,argB:C},!1)},f=(_,C)=>{const E=n._getFieldArray(r);$f(E,_,C),$f(l.current,_,C),p(E),a(E),n._updateFieldArray(r,E,$f,{argA:_,argB:C},!1)},w=(_,C)=>{const E=Ot(C),T=vy(n._getFieldArray(r),_,E);l.current=[...T].map((O,j)=>!O||j===_?Wr():l.current[j]),p(T),a([...T]),n._updateFieldArray(r,T,vy,{argA:_,argB:E},!0,!1)},S=_=>{const C=an(Ot(_));l.current=C.map(Wr),p([...C]),a([...C]),n._updateFieldArray(r,[...C],E=>E,{},!0,!1)};return de.useEffect(()=>{if(n._state.action=!1,dp(r,n._names)&&n._subjects.state.next({...n._formState}),h.current&&(!cp(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(_=>{const C=Q(_.errors,r),E=Q(n._formState.errors,r);(E?!C&&E.type||C&&(E.type!==C.type||E.message!==C.message):C&&C.type)&&(C?Ie(n._formState.errors,r,C):wt(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const _=Q(n._fields,r);_&&_._f&&fp(_,n._formValues,n._options.criteriaMode===_n.all,n._options.shouldUseNativeValidation,!0).then(C=>!rn(C)&&n._subjects.state.next({errors:c1(n._formState.errors,C,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&jc(n._fields,_=>!!_&&_.startsWith(n._names.focus||"")),n._names.focus="",n._updateValid(),h.current=!1},[s,r,n]),de.useEffect(()=>(!Q(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,o,i]),{swap:de.useCallback(m,[p,r,n]),move:de.useCallback(f,[p,r,n]),prepend:de.useCallback(y,[p,r,n]),append:de.useCallback(g,[p,r,n]),remove:de.useCallback(v,[p,r,n]),insert:de.useCallback(b,[p,r,n]),update:de.useCallback(w,[p,r,n]),replace:de.useCallback(S,[p,r,n]),fields:de.useMemo(()=>s.map((_,C)=>({..._,[o]:l.current[C]||Wr()})),[s,o])}}function Of(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Fc=e=>Ut(e)||!e1(e);function qo(e,t){if(Fc(e)||Fc(t))return e===t;if(Xi(e)&&Xi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(Xi(i)&&Xi(s)||yt(i)&&yt(s)||Array.isArray(i)&&Array.isArray(s)?!qo(i,s):i!==s)return!1}}return!0}var h1=e=>e.type==="select-multiple",J2=e=>Zm(e)||Vl(e),Af=e=>Ic(e)&&e.isConnected,p1=e=>{for(const t in e)if(co(e[t]))return!0;return!1};function Uc(e,t={}){const n=Array.isArray(e);if(yt(e)||n)for(const r in e)Array.isArray(e[r])||yt(e[r])&&!p1(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Uc(e[r],t[r])):Ut(e[r])||(t[r]=!0);return t}function m1(e,t,n){const r=Array.isArray(e);if(yt(e)||r)for(const o in e)Array.isArray(e[o])||yt(e[o])&&!p1(e[o])?qe(t)||Fc(n[o])?n[o]=Array.isArray(e[o])?Uc(e[o],[]):{...Uc(e[o])}:m1(e[o],Ut(t)?{}:t[o],n[o]):n[o]=!qo(e[o],t[o]);return n}var Df=(e,t)=>m1(e,t,Uc(t)),v1=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>qe(e)?e:t?e===""?NaN:e&&+e:n&&tr(e)?new Date(e):r?r(e):e;function Mf(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Hm(t)?t.files:Zm(t)?f1(e.refs).value:h1(t)?[...t.selectedOptions].map(({value:n})=>n):Vl(t)?d1(e.refs).value:v1(qe(t.value)?e.ref.value:t.value,e)}var eO=(e,t,n,r)=>{const o={};for(const i of e){const s=Q(t,i);s&&Ie(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},ga=e=>qe(e)?e:Lc(e)?e.source:yt(e)?Lc(e.value)?e.value.source:e.value:e,tO=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function gy(e,t,n){const r=Q(e,n);if(r||Wm(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=Q(t,i),a=Q(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};o.pop()}return{name:n}}var nO=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,rO=(e,t)=>!Ks(Q(e,t)).length&&wt(e,t);const oO={mode:_n.onSubmit,reValidateMode:_n.onChange,shouldFocusError:!0};function iO(e={},t){let n={...oO,...e},r={submitCount:0,isDirty:!1,isLoading:co(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},i=yt(n.defaultValues)||yt(n.values)?Ot(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:Ot(i),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const h={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:Of(),array:Of(),state:Of()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,y=cp(n.mode),v=cp(n.reValidateMode),b=n.criteriaMode===_n.all,m=$=>N=>{clearTimeout(d),d=setTimeout($,N)},f=async $=>{if(h.isValid||$){const N=n.resolver?rn((await O()).errors):await V(o,!0);N!==r.isValid&&p.state.next({isValid:N})}},w=$=>h.isValidating&&p.state.next({isValidating:$}),S=($,N=[],A,ee,Z=!0,U=!0)=>{if(ee&&A){if(a.action=!0,U&&Array.isArray(Q(o,$))){const se=A(Q(o,$),ee.argA,ee.argB);Z&&Ie(o,$,se)}if(U&&Array.isArray(Q(r.errors,$))){const se=A(Q(r.errors,$),ee.argA,ee.argB);Z&&Ie(r.errors,$,se),rO(r.errors,$)}if(h.touchedFields&&U&&Array.isArray(Q(r.touchedFields,$))){const se=A(Q(r.touchedFields,$),ee.argA,ee.argB);Z&&Ie(r.touchedFields,$,se)}h.dirtyFields&&(r.dirtyFields=Df(i,s)),p.state.next({name:$,isDirty:W($,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ie(s,$,N)},_=($,N)=>{Ie(r.errors,$,N),p.state.next({errors:r.errors})},C=($,N,A,ee)=>{const Z=Q(o,$);if(Z){const U=Q(s,$,qe(A)?Q(i,$):A);qe(U)||ee&&ee.defaultChecked||N?Ie(s,$,N?U:Mf(Z._f)):H($,U),a.mount&&f()}},E=($,N,A,ee,Z)=>{let U=!1,se=!1;const Ke={name:$};if(!A||ee){h.isDirty&&(se=r.isDirty,r.isDirty=Ke.isDirty=W(),U=se!==Ke.isDirty);const Ve=qo(Q(i,$),N);se=Q(r.dirtyFields,$),Ve?wt(r.dirtyFields,$):Ie(r.dirtyFields,$,!0),Ke.dirtyFields=r.dirtyFields,U=U||h.dirtyFields&&se!==!Ve}if(A){const Ve=Q(r.touchedFields,$);Ve||(Ie(r.touchedFields,$,A),Ke.touchedFields=r.touchedFields,U=U||h.touchedFields&&Ve!==A)}return U&&Z&&p.state.next(Ke),U?Ke:{}},T=($,N,A,ee)=>{const Z=Q(r.errors,$),U=h.isValid&&uo(N)&&r.isValid!==N;if(e.delayError&&A?(u=m(()=>_($,A)),u(e.delayError)):(clearTimeout(d),u=null,A?Ie(r.errors,$,A):wt(r.errors,$)),(A?!qo(Z,A):Z)||!rn(ee)||U){const se={...ee,...U&&uo(N)?{isValid:N}:{},errors:r.errors,name:$};r={...r,...se},p.state.next(se)}w(!1)},O=async $=>n.resolver(s,n.context,eO($||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),j=async $=>{const{errors:N}=await O($);if($)for(const A of $){const ee=Q(N,A);ee?Ie(r.errors,A,ee):wt(r.errors,A)}else r.errors=N;return N},V=async($,N,A={valid:!0})=>{for(const ee in $){const Z=$[ee];if(Z){const{_f:U,...se}=Z;if(U){const Ke=l.array.has(U.name),Ve=await fp(Z,s,b,n.shouldUseNativeValidation&&!N,Ke);if(Ve[U.name]&&(A.valid=!1,N))break;!N&&(Q(Ve,U.name)?Ke?c1(r.errors,Ve,U.name):Ie(r.errors,U.name,Ve[U.name]):wt(r.errors,U.name))}se&&await V(se,N,A)}}return A.valid},D=()=>{for(const $ of l.unMount){const N=Q(o,$);N&&(N._f.refs?N._f.refs.every(A=>!Af(A)):!Af(N._f.ref))&&ze($)}l.unMount=new Set},W=($,N)=>($&&N&&Ie(s,$,N),!qo(he(),i)),M=($,N,A)=>a1($,l,{...a.mount?s:qe(N)?i:tr($)?{[$]:N}:N},A,N),F=$=>Ks(Q(a.mount?s:i,$,e.shouldUnregister?Q(i,$,[]):[])),H=($,N,A={})=>{const ee=Q(o,$);let Z=N;if(ee){const U=ee._f;U&&(!U.disabled&&Ie(s,$,v1(N,U)),Z=Ic(U.ref)&&Ut(N)?"":N,h1(U.ref)?[...U.ref.options].forEach(se=>se.selected=Z.includes(se.value)):U.refs?Vl(U.ref)?U.refs.length>1?U.refs.forEach(se=>(!se.defaultChecked||!se.disabled)&&(se.checked=Array.isArray(Z)?!!Z.find(Ke=>Ke===se.value):Z===se.value)):U.refs[0]&&(U.refs[0].checked=!!Z):U.refs.forEach(se=>se.checked=se.value===Z):Hm(U.ref)?U.ref.value="":(U.ref.value=Z,U.ref.type||p.values.next({name:$,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&E($,Z,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&re($)},oe=($,N,A)=>{for(const ee in N){const Z=N[ee],U=`${$}.${ee}`,se=Q(o,U);(l.array.has($)||!Fc(Z)||se&&!se._f)&&!Xi(Z)?oe(U,Z,A):H(U,Z,A)}},L=($,N,A={})=>{const ee=Q(o,$),Z=l.array.has($),U=Ot(N);Ie(s,$,U),Z?(p.array.next({name:$,values:{...s}}),(h.isDirty||h.dirtyFields)&&A.shouldDirty&&p.state.next({name:$,dirtyFields:Df(i,s),isDirty:W($,U)})):ee&&!ee._f&&!Ut(U)?oe($,U,A):H($,U,A),dp($,l)&&p.state.next({...r}),p.values.next({name:$,values:{...s}}),!a.mount&&t()},K=async $=>{const N=$.target;let A=N.name,ee=!0;const Z=Q(o,A),U=()=>N.type?Mf(Z._f):t1($);if(Z){let se,Ke;const Ve=U(),Fr=$.type===Mc.BLUR||$.type===Mc.FOCUS_OUT,Hn=!tO(Z._f)&&!n.resolver&&!Q(r.errors,A)&&!Z._f.deps||nO(Fr,Q(r.touchedFields,A),r.isSubmitted,v,y),Ti=dp(A,l,Fr);Ie(s,A,Ve),Fr?(Z._f.onBlur&&Z._f.onBlur($),u&&u(0)):Z._f.onChange&&Z._f.onChange($);const $i=E(A,Ve,Fr,!1),Zl=!rn($i)||Ti;if(!Fr&&p.values.next({name:A,type:$.type,values:{...s}}),Hn)return h.isValid&&f(),Zl&&p.state.next({name:A,...Ti?{}:$i});if(!Fr&&Ti&&p.state.next({...r}),w(!0),n.resolver){const{errors:Kl}=await O([A]),Ql=gy(r.errors,o,A),Uo=gy(Kl,o,Ql.name||A);se=Uo.error,A=Uo.name,Ke=rn(Kl)}else se=(await fp(Z,s,b,n.shouldUseNativeValidation))[A],ee=Number.isNaN(Ve)||Ve===Q(s,A,Ve),ee&&(se?Ke=!1:h.isValid&&(Ke=await V(o,!0)));ee&&(Z._f.deps&&re(Z._f.deps),T(A,Ke,se,$i))}},re=async($,N={})=>{let A,ee;const Z=an($);if(w(!0),n.resolver){const U=await j(qe($)?$:Z);A=rn(U),ee=$?!Z.some(se=>Q(U,se)):A}else $?(ee=(await Promise.all(Z.map(async U=>{const se=Q(o,U);return await V(se&&se._f?{[U]:se}:se)}))).every(Boolean),!(!ee&&!r.isValid)&&f()):ee=A=await V(o);return p.state.next({...!tr($)||h.isValid&&A!==r.isValid?{}:{name:$},...n.resolver||!$?{isValid:A}:{},errors:r.errors,isValidating:!1}),N.shouldFocus&&!ee&&jc(o,U=>U&&Q(r.errors,U),$?Z:l.mount),ee},he=$=>{const N={...i,...a.mount?s:{}};return qe($)?N:tr($)?Q(N,$):$.map(A=>Q(N,A))},ve=($,N)=>({invalid:!!Q((N||r).errors,$),isDirty:!!Q((N||r).dirtyFields,$),isTouched:!!Q((N||r).touchedFields,$),error:Q((N||r).errors,$)}),Ue=$=>{$&&an($).forEach(N=>wt(r.errors,N)),p.state.next({errors:$?r.errors:{}})},je=($,N,A)=>{const ee=(Q(o,$,{_f:{}})._f||{}).ref;Ie(r.errors,$,{...N,ref:ee}),p.state.next({name:$,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&ee&&ee.focus&&ee.focus()},ht=($,N)=>co($)?p.values.subscribe({next:A=>$(M(void 0,N),A)}):M($,N,!0),ze=($,N={})=>{for(const A of $?an($):l.mount)l.mount.delete(A),l.array.delete(A),N.keepValue||(wt(o,A),wt(s,A)),!N.keepError&&wt(r.errors,A),!N.keepDirty&&wt(r.dirtyFields,A),!N.keepTouched&&wt(r.touchedFields,A),!n.shouldUnregister&&!N.keepDefaultValue&&wt(i,A);p.values.next({values:{...s}}),p.state.next({...r,...N.keepDirty?{isDirty:W()}:{}}),!N.keepIsValid&&f()},ue=({disabled:$,name:N,field:A,fields:ee})=>{if(uo($)){const Z=$?void 0:Q(s,N,Mf(A?A._f:Q(ee,N)._f));Ie(s,N,Z),E(N,Z,!1,!1,!0)}},Me=($,N={})=>{let A=Q(o,$);const ee=uo(N.disabled);return Ie(o,$,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:$}},name:$,mount:!0,...N}}),l.mount.add($),A?ue({field:A,disabled:N.disabled,name:$}):C($,!0,N.value),{...ee?{disabled:N.disabled}:{},...n.progressive?{required:!!N.required,min:ga(N.min),max:ga(N.max),minLength:ga(N.minLength),maxLength:ga(N.maxLength),pattern:ga(N.pattern)}:{},name:$,onChange:K,onBlur:K,ref:Z=>{if(Z){Me($,N),A=Q(o,$);const U=qe(Z.value)&&Z.querySelectorAll&&Z.querySelectorAll("input,select,textarea")[0]||Z,se=J2(U),Ke=A._f.refs||[];if(se?Ke.find(Ve=>Ve===U):U===A._f.ref)return;Ie(o,$,{_f:{...A._f,...se?{refs:[...Ke.filter(Af),U,...Array.isArray(Q(i,$))?[{}]:[]],ref:{type:U.type,name:$}}:{ref:U}}}),C($,!1,void 0,U)}else A=Q(o,$,{}),A._f&&(A._f.mount=!1),(n.shouldUnregister||N.shouldUnregister)&&!(n1(l.array,$)&&a.action)&&l.unMount.add($)}}},$e=()=>n.shouldFocusError&&jc(o,$=>$&&Q(r.errors,$),l.mount),Re=($,N)=>async A=>{A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let ee=Ot(s);if(p.state.next({isSubmitting:!0}),n.resolver){const{errors:Z,values:U}=await O();r.errors=Z,ee=U}else await V(o);wt(r.errors,"root"),rn(r.errors)?(p.state.next({errors:{}}),await $(ee,A)):(N&&await N({...r.errors},A),$e(),setTimeout($e)),p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rn(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Ne=($,N={})=>{Q(o,$)&&(qe(N.defaultValue)?L($,Q(i,$)):(L($,N.defaultValue),Ie(i,$,N.defaultValue)),N.keepTouched||wt(r.touchedFields,$),N.keepDirty||(wt(r.dirtyFields,$),r.isDirty=N.defaultValue?W($,Q(i,$)):W()),N.keepError||(wt(r.errors,$),h.isValid&&f()),p.state.next({...r}))},Oe=($,N={})=>{const A=$?Ot($):i,ee=Ot(A),Z=$&&!rn($)?ee:i;if(N.keepDefaultValues||(i=A),!N.keepValues){if(N.keepDirtyValues||g)for(const U of l.mount)Q(r.dirtyFields,U)?Ie(Z,U,Q(s,U)):L(U,Q(Z,U));else{if(Bm&&qe($))for(const U of l.mount){const se=Q(o,U);if(se&&se._f){const Ke=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(Ic(Ke)){const Ve=Ke.closest("form");if(Ve){Ve.reset();break}}}}o={}}s=e.shouldUnregister?N.keepDefaultValues?Ot(i):{}:Ot(Z),p.array.next({values:{...Z}}),p.values.next({values:{...Z}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&t(),a.mount=!h.isValid||!!N.keepIsValid,a.watch=!!e.shouldUnregister,p.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!qo($,i)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:N.keepDirtyValues?r.dirtyFields:N.keepDefaultValues&&$?Df(i,$):{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Xe=($,N)=>Oe(co($)?$(s):$,N);return{control:{register:Me,unregister:ze,getFieldState:ve,handleSubmit:Re,setError:je,_executeSchema:O,_getWatch:M,_getDirty:W,_updateValid:f,_removeUnmounted:D,_updateFieldArray:S,_updateDisabledField:ue,_getFieldArray:F,_reset:Oe,_resetDefaultValues:()=>co(n.defaultValues)&&n.defaultValues().then($=>{Xe($,n.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:$=>{r={...r,...$}},_subjects:p,_proxyFormState:h,get _fields(){return o},get _formValues(){return s},get _state(){return a},set _state($){a=$},get _defaultValues(){return i},get _names(){return l},set _names($){l=$},get _formState(){return r},set _formState($){r=$},get _options(){return n},set _options($){n={...n,...$}}},trigger:re,register:Me,handleSubmit:Re,watch:ht,setValue:L,getValues:he,reset:Xe,resetField:Ne,clearErrors:Ue,unregister:ze,setError:je,setFocus:($,N={})=>{const A=Q(o,$),ee=A&&A._f;if(ee){const Z=ee.refs?ee.refs[0]:ee.ref;Z.focus&&(Z.focus(),N.shouldSelect&&Z.select())}},getFieldState:ve}}function Wl(e={}){const t=de.useRef(),n=de.useRef(),[r,o]=de.useState({isDirty:!1,isValidating:!1,isLoading:co(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:co(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...iO(e,()=>o(s=>({...s}))),formState:r});const i=t.current.control;return i._options=e,Ed({subject:i._subjects.state,next:s=>{i1(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),de.useEffect(()=>{e.values&&!qo(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values):i._resetDefaultValues()},[e.values,i]),de.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=o1(r,i),t.current}var yy=function(e,t,n){if(e&&"reportValidity"in e){var r=Q(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},g1=function(e,t){var n=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?yy(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return yy(s,o,e)})};for(var r in t.fields)n(r)},sO=function(e,t){t.shouldUseNativeValidation&&g1(e,t);var n={};for(var r in e){var o=Q(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(lO(t.names||Object.keys(e),r)){var s=Object.assign({},aO(Q(n,r)));Ie(s,"root",i),Ie(n,r,s)}else Ie(n,r,i)}return n},aO=function(e){return Array.isArray(e)?e.filter(Boolean):[]},lO=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},uO=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(h){return e.push(h)})}),t){var l=n[s].types,u=l&&l[r.code];n[s]=u1(s,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n},Cd=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return i.shouldUseNativeValidation&&g1({},i),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(s){if(function(a){return a.errors!=null}(s))return{values:{},errors:sO(uO(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}};const cO=c.forwardRef((e,t)=>c.createElement(ke.label,ne({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),y1=cO,dO=jl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Go=c.forwardRef(({className:e,...t},n)=>x.jsx(y1,{ref:n,className:le(dO(),e),...t}));Go.displayName=y1.displayName;const kd=H2,w1=c.createContext({}),fo=({...e})=>x.jsx(w1.Provider,{value:{name:e.name},children:x.jsx(zu,{...e})}),Td=()=>{const e=c.useContext(w1),t=c.useContext(x1),{getFieldState:n,formState:r}=Bl(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},x1=c.createContext({}),nr=c.forwardRef(({className:e,...t},n)=>{const r=c.useId();return x.jsx(x1.Provider,{value:{id:r},children:x.jsx("div",{ref:n,className:le("space-y-2",e),...t})})});nr.displayName="FormItem";const rr=c.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Td();return x.jsx(Go,{ref:n,className:le(r&&"text-destructive",e),htmlFor:o,...t})});rr.displayName="FormLabel";const xr=c.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=Td();return x.jsx(Eo,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});xr.displayName="FormControl";const ho=c.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Td();return x.jsx("p",{ref:n,id:r,className:le("text-sm text-muted-foreground",e),...t})});ho.displayName="FormDescription";const br=c.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=Td(),s=o?String(o==null?void 0:o.message):t;return s?x.jsx("p",{ref:r,id:i,className:le("text-sm font-medium text-destructive",e),...n,children:s}):null});br.displayName="FormMessage";const fO=s0["useId".toString()]||(()=>{});let hO=0;function as(e){const[t,n]=c.useState(fO());return Jt(()=>{e||n(r=>r??String(hO++))},[e]),e||(t?`radix-${t}`:"")}const jf="focusScope.autoFocusOnMount",If="focusScope.autoFocusOnUnmount",wy={bubbles:!1,cancelable:!0},b1=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=Vt(o),d=Vt(i),h=c.useRef(null),p=it(t,v=>l(v)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let f=function(C){if(g.paused||!a)return;const E=C.target;a.contains(E)?h.current=E:Kr(h.current,{select:!0})},w=function(C){if(g.paused||!a)return;const E=C.relatedTarget;E!==null&&(a.contains(E)||Kr(h.current,{select:!0}))},S=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&Kr(a)};var v=f,b=w,m=S;document.addEventListener("focusin",f),document.addEventListener("focusout",w);const _=new MutationObserver(S);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,g.paused]),c.useEffect(()=>{if(a){by.add(g);const v=document.activeElement;if(!a.contains(v)){const m=new CustomEvent(jf,wy);a.addEventListener(jf,u),a.dispatchEvent(m),m.defaultPrevented||(pO(wO(S1(a)),{select:!0}),document.activeElement===v&&Kr(a))}return()=>{a.removeEventListener(jf,u),setTimeout(()=>{const m=new CustomEvent(If,wy);a.addEventListener(If,d),a.dispatchEvent(m),m.defaultPrevented||Kr(v??document.body,{select:!0}),a.removeEventListener(If,d),by.remove(g)},0)}}},[a,u,d,g]);const y=c.useCallback(v=>{if(!n&&!r||g.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,m=document.activeElement;if(b&&m){const f=v.currentTarget,[w,S]=mO(f);w&&S?!v.shiftKey&&m===S?(v.preventDefault(),n&&Kr(w,{select:!0})):v.shiftKey&&m===w&&(v.preventDefault(),n&&Kr(S,{select:!0})):m===f&&v.preventDefault()}},[n,r,g.paused]);return c.createElement(ke.div,ne({tabIndex:-1},s,{ref:p,onKeyDown:y}))});function pO(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Kr(r,{select:t}),document.activeElement!==n)return}function mO(e){const t=S1(e),n=xy(t,e),r=xy(t.reverse(),e);return[n,r]}function S1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xy(e,t){for(const n of e)if(!vO(n,{upTo:t}))return n}function vO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gO(e){return e instanceof HTMLInputElement&&"select"in e}function Kr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gO(e)&&t&&e.select()}}const by=yO();function yO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Sy(e,t),e.unshift(t)},remove(t){var n;e=Sy(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Sy(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wO(e){return e.filter(t=>t.tagName!=="A")}let Lf=0;function _1(){c.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:_y()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:_y()),Lf++,()=>{Lf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Lf--}},[])}function _y(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var er=function(){return er=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return jO;var t=IO(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},FO=T1(),UO=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(bO,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Bu,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Wu,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Bu," .").concat(Bu,` { + right: 0 `).concat(r,`; + } + + .`).concat(Wu," .").concat(Wu,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(SO,": ").concat(a,`px; + } +`)},zO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=c.useMemo(function(){return LO(o)},[o]);return c.createElement(FO,{styles:UO(i,!t,o,n?"":"!important")})},hp=!1;if(typeof window<"u")try{var yu=Object.defineProperty({},"passive",{get:function(){return hp=!0,!0}});window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{hp=!1}var Di=hp?{passive:!1}:!1,VO=function(e){return e.tagName==="TEXTAREA"},$1=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VO(e)&&n[t]==="visible")},BO=function(e){return $1(e,"overflowY")},WO=function(e){return $1(e,"overflowX")},Cy=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=R1(e,n);if(r){var o=P1(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},HO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ZO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},R1=function(e,t){return e==="v"?BO(t):WO(t)},P1=function(e,t){return e==="v"?HO(t):ZO(t)},KO=function(e,t){return e==="h"&&t==="rtl"?-1:1},QO=function(e,t,n,r,o){var i=KO(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,h=0,p=0;do{var g=P1(e,a),y=g[0],v=g[1],b=g[2],m=v-b-i*y;(y||m)&&R1(e,a)&&(h+=m,p+=y),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(o&&h===0||!o&&s>h)||!d&&(o&&p===0||!o&&-s>p))&&(u=!0),u},wu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ky=function(e){return[e.deltaX,e.deltaY]},Ty=function(e){return e&&"current"in e?e.current:e},YO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qO=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},GO=0,Mi=[];function XO(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(GO++)[0],i=c.useState(function(){return T1()})[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=xO([e.lockRef.current],(e.shards||[]).map(Ty),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(v,b){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var m=wu(v),f=n.current,w="deltaX"in v?v.deltaX:f[0]-m[0],S="deltaY"in v?v.deltaY:f[1]-m[1],_,C=v.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in v&&E==="h"&&C.type==="range")return!1;var T=Cy(E,C);if(!T)return!0;if(T?_=E:(_=E==="v"?"h":"v",T=Cy(E,C)),!T)return!1;if(!r.current&&"changedTouches"in v&&(w||S)&&(r.current=_),!_)return!0;var O=r.current||_;return QO(O,b,v,O==="h"?w:S,!0)},[]),l=c.useCallback(function(v){var b=v;if(!(!Mi.length||Mi[Mi.length-1]!==i)){var m="deltaY"in b?ky(b):wu(b),f=t.current.filter(function(_){return _.name===b.type&&_.target===b.target&&YO(_.delta,m)})[0];if(f&&f.should){b.cancelable&&b.preventDefault();return}if(!f){var w=(s.current.shards||[]).map(Ty).filter(Boolean).filter(function(_){return _.contains(b.target)}),S=w.length>0?a(b,w[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=c.useCallback(function(v,b,m,f){var w={name:v,delta:b,target:m,should:f};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=c.useCallback(function(v){n.current=wu(v),r.current=void 0},[]),h=c.useCallback(function(v){u(v.type,ky(v),v.target,a(v,e.lockRef.current))},[]),p=c.useCallback(function(v){u(v.type,wu(v),v.target,a(v,e.lockRef.current))},[]);c.useEffect(function(){return Mi.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Di),document.addEventListener("touchmove",l,Di),document.addEventListener("touchstart",d,Di),function(){Mi=Mi.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,Di),document.removeEventListener("touchmove",l,Di),document.removeEventListener("touchstart",d,Di)}},[]);var g=e.removeScrollBar,y=e.inert;return c.createElement(c.Fragment,null,y?c.createElement(i,{styles:qO(o)}):null,g?c.createElement(zO,{gapMode:"margin"}):null)}const JO=RO(k1,XO);var N1=c.forwardRef(function(e,t){return c.createElement($d,er({},e,{ref:t,sideCar:JO}))});N1.classNames=$d.classNames;const O1=N1;var eA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ji=new WeakMap,xu=new WeakMap,bu={},zf=0,A1=function(e){return e&&(e.host||A1(e.parentNode))},tA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=A1(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},nA=function(e,t,n,r){var o=tA(t,Array.isArray(e)?e:[e]);bu[n]||(bu[n]=new WeakMap);var i=bu[n],s=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))d(p);else{var g=p.getAttribute(r),y=g!==null&&g!=="false",v=(ji.get(p)||0)+1,b=(i.get(p)||0)+1;ji.set(p,v),i.set(p,b),s.push(p),v===1&&y&&xu.set(p,!0),b===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}})};return d(t),a.clear(),zf++,function(){s.forEach(function(h){var p=ji.get(h)-1,g=i.get(h)-1;ji.set(h,p),i.set(h,g),p||(xu.has(h)||h.removeAttribute(r),xu.delete(h)),g||h.removeAttribute(n)}),zf--,zf||(ji=new WeakMap,ji=new WeakMap,xu=new WeakMap,bu={})}},D1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||eA(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),nA(r,o,n,"aria-hidden")):function(){return null}};const M1="Dialog",[j1,RM]=Mr(M1),[rA,cr]=j1(M1),oA=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=c.useRef(null),l=c.useRef(null),[u=!1,d]=Os({prop:r,defaultProp:o,onChange:i});return c.createElement(rA,{scope:t,triggerRef:a,contentRef:l,contentId:as(),titleId:as(),descriptionId:as(),open:u,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(h=>!h),[d]),modal:s},n)},I1="DialogPortal",[iA,L1]=j1(I1,{forceMount:void 0}),sA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=cr(I1,t);return c.createElement(iA,{scope:t,forceMount:n},c.Children.map(r,s=>c.createElement(Bs,{present:n||i.open},c.createElement(gm,{asChild:!0,container:o},s))))},pp="DialogOverlay",aA=c.forwardRef((e,t)=>{const n=L1(pp,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=cr(pp,e.__scopeDialog);return i.modal?c.createElement(Bs,{present:r||i.open},c.createElement(lA,ne({},o,{ref:t}))):null}),lA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(pp,n);return c.createElement(O1,{as:Eo,allowPinchZoom:!0,shards:[o.contentRef]},c.createElement(ke.div,ne({"data-state":U1(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),vl="DialogContent",uA=c.forwardRef((e,t)=>{const n=L1(vl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=cr(vl,e.__scopeDialog);return c.createElement(Bs,{present:r||i.open},i.modal?c.createElement(cA,ne({},o,{ref:t})):c.createElement(dA,ne({},o,{ref:t})))}),cA=c.forwardRef((e,t)=>{const n=cr(vl,e.__scopeDialog),r=c.useRef(null),o=it(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return D1(i)},[]),c.createElement(F1,ne({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault())}))}),dA=c.forwardRef((e,t)=>{const n=cr(vl,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return c.createElement(F1,ne({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),F1=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=cr(vl,n),l=c.useRef(null),u=it(t,l);return _1(),c.createElement(c.Fragment,null,c.createElement(b1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},c.createElement(vm,ne({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":U1(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),fA="DialogTitle",hA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(fA,n);return c.createElement(ke.h2,ne({id:o.titleId},r,{ref:t}))}),pA="DialogDescription",mA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(pA,n);return c.createElement(ke.p,ne({id:o.descriptionId},r,{ref:t}))}),vA="DialogClose",gA=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cr(vA,n);return c.createElement(ke.button,ne({type:"button"},r,{ref:t,onClick:Ee(e.onClick,()=>o.onOpenChange(!1))}))});function U1(e){return e?"open":"closed"}const yA=oA,wA=sA,z1=aA,V1=uA,B1=hA,W1=mA,xA=gA,H1=yA,bA=wA,Z1=c.forwardRef(({className:e,...t},n)=>x.jsx(z1,{ref:n,className:le("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Z1.displayName=z1.displayName;const Km=c.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(bA,{children:[x.jsx(Z1,{}),x.jsxs(V1,{ref:r,className:le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...n,children:[t,x.jsxs(xA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[x.jsx(Ax,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Km.displayName=V1.displayName;const Qm=({className:e,...t})=>x.jsx("div",{className:le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qm.displayName="DialogHeader";const K1=({className:e,...t})=>x.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});K1.displayName="DialogFooter";const Ym=c.forwardRef(({className:e,...t},n)=>x.jsx(B1,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",e),...t}));Ym.displayName=B1.displayName;const qm=c.forwardRef(({className:e,...t},n)=>x.jsx(W1,{ref:n,className:le("text-sm text-muted-foreground",e),...t}));qm.displayName=W1.displayName;const SA=(e,t)=>{const n=Fo();return Il({queryKey:[e,"agents","entry",t,"memory"],queryFn:async()=>await fetch(Ir+`/agents/memory?agent_id=${t}&user_id=${e}`,{headers:{Authorization:n}}).then(r=>r.json()),enabled:!!e&&!!t})},zc=c.forwardRef(({className:e,...t},n)=>x.jsx("textarea",{className:le("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));zc.displayName="Textarea";const _A=va.object({persona:va.string(),human:va.string(),user_id:va.string(),agent_id:va.string()}),EA=e=>{const t=fd(),n=Fo();return Cm({mutationFn:async r=>await fetch(Ir+`/agents/memory?${e}`,{method:"POST",headers:{"Content-Type":" application/json",Authorization:n},body:JSON.stringify(r)}).then(o=>o.json()),onSuccess:(r,{agent_id:o})=>t.invalidateQueries({queryKey:[e,"agents","entry",o,"memory"]})})};function CA({className:e,data:t,agentId:n}){var a,l;const r=Lo(),o=EA(r.uuid),i=Wl({resolver:Cd(_A),defaultValues:{persona:(a=t==null?void 0:t.core_memory)==null?void 0:a.persona,human:(l=t==null?void 0:t.core_memory)==null?void 0:l.human,user_id:r.uuid??void 0,agent_id:n}});function s(u){o.mutate(u)}return x.jsx(kd,{...i,children:x.jsxs("form",{onSubmit:i.handleSubmit(s),className:le("flex flex-col gap-8",e),children:[x.jsx(fo,{control:i.control,name:"persona",render:({field:u})=>x.jsxs(nr,{children:[x.jsx(rr,{children:"Persona"}),x.jsx(xr,{children:x.jsx(zc,{className:"min-h-[20rem] resize-none",...u})}),x.jsx(ho,{children:"This is the agents core memory. It is immediately available without querying any other resources."}),x.jsx(br,{})]})}),x.jsx(fo,{control:i.control,name:"human",render:({field:u})=>x.jsxs(nr,{children:[x.jsx(rr,{children:"Human"}),x.jsx(xr,{children:x.jsx(zc,{className:"min-h-[20rem] resize-none",...u})}),x.jsx(ho,{children:"This is what the agent knows about you so far!"}),x.jsx(br,{})]})}),x.jsxs("div",{className:"mt-4 flex items-center justify-end",children:[o.isPending&&x.jsxs("span",{className:Po("mr-6 flex items-center animate-in slide-in-from-bottom"),children:[x.jsx(xm,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving Memory..."]}),o.isSuccess&&x.jsxs("span",{className:Po("mr-6 flex items-center text-emerald-600 animate-in slide-in-from-bottom"),children:[x.jsx(ik,{className:"mr-2 h-4 w-4"}),"New Memory Saved"]}),x.jsx(Ct,{type:"submit",disabled:o.isPending,children:"Save Memory"})]})]})})}const kA=({open:e,onOpenChange:t})=>{const n=Lo(),r=Ul(),{data:o,isLoading:i}=SA(n.uuid,r==null?void 0:r.id);return x.jsx(H1,{open:e,onOpenChange:t,children:x.jsxs(Km,{className:"sm:max-w-2xl",children:[x.jsxs(Qm,{children:[x.jsx(Ym,{children:"Edit Memory"}),x.jsx(qm,{children:"This is your agents current memory. Make changes and click save to edit it."})]}),i||!o||!r?x.jsx("p",{children:"loading.."}):x.jsx(CA,{className:"max-h-[80vh] overflow-auto px-1 py-4",data:o,agentId:r.id})]})})},TA=In({message:Qt().min(1,"Message cannot be empty...")}),$A=e=>{const[t,n]=c.useState(!1),r=Wl({resolver:Cd(TA),defaultValues:{message:""}});function o(i){e.onSend(i.message),r.reset()}return x.jsxs(kd,{...r,children:[x.jsxs("form",{onSubmit:r.handleSubmit(o),className:"mb-8 mt-4 flex items-start justify-between gap-2",children:[x.jsx(fo,{control:r.control,name:"message",render:({field:i})=>x.jsxs(nr,{className:"w-full",children:[x.jsx(rr,{children:"What's on your mind"}),x.jsx(xr,{className:"w-full",children:x.jsx(bi,{className:"w-full",placeholder:"Type something...",...i})}),x.jsx(br,{})]})}),x.jsxs("div",{className:"mt-8 flex gap-2",children:[x.jsx(Ct,{disabled:!e.enabled,type:"submit",children:"Send"}),x.jsx(Ct,{onClick:()=>n(!0),className:"ml-1",type:"button",size:"icon",variant:"outline",children:x.jsx(ok,{className:"h-4 w-4"})})]})]}),x.jsx(kA,{open:t,onOpenChange:i=>n(i)})]})},RA=()=>{const e=c.useRef(!1),t=Lo(),n=Ul(),r=DR(),o=pN((n==null?void 0:n.id)??""),i=x2(),{sendMessage:s}=Ub(),{addMessage:a}=Pb(),{setLastAgentInitMessage:l}=yd(),u=Fo(),d=c.useCallback((h,p="user")=>{if(!n||!t.uuid)return;const g=new Date;s({userId:t.uuid,agentId:n.id,message:h,role:p,bearerToken:u}),a(n.id,{type:p==="user"?"user_message":"system_message",message_type:"user_message",message:h,date:g})},[n,t.uuid,s,a]);return c.useEffect(()=>(e.current||(e.current=!0,setTimeout(()=>{if(!n)return null;(o.length===0||(r==null?void 0:r.agentId)!==n.id)&&(l({date:new Date,agentId:n.id}),d("The user is back! Lets pick up the conversation! Reflect on the previous conversation and use your function calling to send him a friendly message.","system"))},300)),()=>{e.current=!0}),[n,r==null?void 0:r.agentId,o.length,d,l]),x.jsxs("div",{className:"mx-auto max-w-screen-xl p-4",children:[x.jsx(V2,{currentAgent:n,readyState:i,previousMessages:[],messages:o}),x.jsx($A,{enabled:i!==Dm.LOADING,onSend:d})]})},PA={path:"chat",element:x.jsx(RA,{})};function NA({className:e,...t}){return x.jsx("div",{className:le("animate-pulse rounded-md bg-muted",e),...t})}function OA(e,t,n){var r=this,o=c.useRef(null),i=c.useRef(0),s=c.useRef(null),a=c.useRef([]),l=c.useRef(),u=c.useRef(),d=c.useRef(e),h=c.useRef(!0);d.current=e;var p=typeof window<"u",g=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var y=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,b="maxWait"in n,m="debounceOnServer"in n&&!!n.debounceOnServer,f=b?Math.max(+n.maxWait||0,t):null;c.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var w=c.useMemo(function(){var S=function(j){var V=a.current,D=l.current;return a.current=l.current=null,i.current=j,u.current=d.current.apply(D,V)},_=function(j,V){g&&cancelAnimationFrame(s.current),s.current=g?requestAnimationFrame(j):setTimeout(j,V)},C=function(j){if(!h.current)return!1;var V=j-o.current;return!o.current||V>=t||V<0||b&&j-i.current>=f},E=function(j){return s.current=null,v&&a.current?S(j):(a.current=l.current=null,u.current)},T=function j(){var V=Date.now();if(C(V))return E(V);if(h.current){var D=t-(V-o.current),W=b?Math.min(D,f-(V-i.current)):D;_(j,W)}},O=function(){if(p||m){var j=Date.now(),V=C(j);if(a.current=[].slice.call(arguments),l.current=r,o.current=j,V){if(!s.current&&h.current)return i.current=o.current,_(T,t),y?S(o.current):u.current;if(b)return _(T,t),S(o.current)}return s.current||_(T,t),u.current}};return O.cancel=function(){s.current&&(g?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,a.current=o.current=l.current=s.current=null},O.isPending=function(){return!!s.current},O.flush=function(){return s.current?E(Date.now()):u.current},O},[y,b,t,f,v,g,p,m]);return w}function AA(e,t){return e===t}function DA(e,t){return t}function MA(e,t,n){var r=n&&n.equalityFn||AA,o=c.useReducer(DA,e),i=o[0],s=o[1],a=OA(c.useCallback(function(u){return s(u)},[s]),t,n),l=c.useRef(e);return r(l.current,e)||(a(e),l.current=e),[i,a]}const jA=({name:e,persona:t,human:n,created_at:r,className:o,onBtnClick:i,isCurrentAgent:s})=>x.jsxs(Im,{className:o,children:[x.jsxs(Lm,{children:[x.jsxs(Fm,{className:"flex items-center justify-between",children:[x.jsx("span",{children:e}),s&&x.jsx(zb,{className:"whitespace-nowrap",children:"Current Agent"})]}),x.jsx(Um,{children:t})]}),x.jsx(zm,{children:x.jsx(Ct,{variant:"secondary",onClick:i,asChild:!0,children:x.jsx(Gi,{to:"/chat",children:"Start Chat"})})})]});function $y(e,[t,n]){return Math.min(n,Math.max(t,e))}const IA=c.createContext(void 0);function Gm(e){const t=c.useContext(IA);return e||t||"ltr"}const LA=["top","right","bottom","left"],No=Math.min,on=Math.max,Vc=Math.round,Su=Math.floor,Oo=e=>({x:e,y:e}),FA={left:"right",right:"left",bottom:"top",top:"bottom"},UA={start:"end",end:"start"};function mp(e,t,n){return on(e,No(t,n))}function Pr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Qs(e){return e.split("-")[1]}function Xm(e){return e==="x"?"y":"x"}function Jm(e){return e==="y"?"height":"width"}function Ys(e){return["top","bottom"].includes(Nr(e))?"y":"x"}function ev(e){return Xm(Ys(e))}function zA(e,t,n){n===void 0&&(n=!1);const r=Qs(e),o=ev(e),i=Jm(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Bc(s)),[s,Bc(s)]}function VA(e){const t=Bc(e);return[vp(e),t,vp(t)]}function vp(e){return e.replace(/start|end/g,t=>UA[t])}function BA(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function WA(e,t,n,r){const o=Qs(e);let i=BA(Nr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(vp)))),i}function Bc(e){return e.replace(/left|right|bottom|top/g,t=>FA[t])}function HA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Q1(e){return typeof e!="number"?HA(e):{top:e,right:e,bottom:e,left:e}}function Wc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ry(e,t,n){let{reference:r,floating:o}=e;const i=Ys(t),s=ev(t),a=Jm(s),l=Nr(t),u=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Qs(t)){case"start":g[s]-=p*(n&&u?-1:1);break;case"end":g[s]+=p*(n&&u?-1:1);break}return g}const ZA=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Ry(u,r,l),p=r,g={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=Pr(e,t)||{};if(u==null)return{};const h=Q1(d),p={x:n,y:r},g=ev(o),y=Jm(g),v=await s.getDimensions(u),b=g==="y",m=b?"top":"left",f=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[g]-p[g]-i.floating[y],_=p[g]-i.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let E=C?C[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(C)))&&(E=a.floating[w]||i.floating[y]);const T=S/2-_/2,O=E/2-v[y]/2-1,j=No(h[m],O),V=No(h[f],O),D=j,W=E-v[y]-V,M=E/2-v[y]/2+T,F=mp(D,M,W),H=!l.arrow&&Qs(o)!=null&&M!=F&&i.reference[y]/2-(MD<=0)){var O,j;const D=(((O=i.flip)==null?void 0:O.index)||0)+1,W=_[D];if(W)return{data:{index:D,overflows:T},reset:{placement:W}};let M=(j=T.filter(F=>F.overflows[0]<=0).sort((F,H)=>F.overflows[1]-H.overflows[1])[0])==null?void 0:j.placement;if(!M)switch(g){case"bestFit":{var V;const F=(V=T.map(H=>[H.placement,H.overflows.filter(oe=>oe>0).reduce((oe,L)=>oe+L,0)]).sort((H,oe)=>H[1]-oe[1])[0])==null?void 0:V[0];F&&(M=F);break}case"initialPlacement":M=a;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function Ny(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oy(e){return LA.some(t=>e[t]>=0)}const QA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Pr(e,t);switch(r){case"referenceHidden":{const i=await gl(t,{...o,elementContext:"reference"}),s=Ny(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Oy(s)}}}case"escaped":{const i=await gl(t,{...o,altBoundary:!0}),s=Ny(i,n.floating);return{data:{escapedOffsets:s,escaped:Oy(s)}}}default:return{}}}}};async function YA(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Nr(n),a=Qs(n),l=Ys(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,h=Pr(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),l?{x:g*d,y:p*u}:{x:p*u,y:g*d}}const qA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await YA(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},GA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:b=>{let{x:m,y:f}=b;return{x:m,y:f}}},...l}=Pr(e,t),u={x:n,y:r},d=await gl(t,l),h=Ys(Nr(o)),p=Xm(h);let g=u[p],y=u[h];if(i){const b=p==="y"?"top":"left",m=p==="y"?"bottom":"right",f=g+d[b],w=g-d[m];g=mp(f,g,w)}if(s){const b=h==="y"?"top":"left",m=h==="y"?"bottom":"right",f=y+d[b],w=y-d[m];y=mp(f,y,w)}const v=a.fn({...t,[p]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-r}}}}},XA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Pr(e,t),d={x:n,y:r},h=Ys(o),p=Xm(h);let g=d[p],y=d[h];const v=Pr(a,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+b.mainAxis,_=i.reference[p]+i.reference[w]-b.mainAxis;g_&&(g=_)}if(u){var m,f;const w=p==="y"?"width":"height",S=["top","left"].includes(Nr(o)),_=i.reference[h]-i.floating[w]+(S&&((m=s.offset)==null?void 0:m[h])||0)+(S?0:b.crossAxis),C=i.reference[h]+i.reference[w]+(S?0:((f=s.offset)==null?void 0:f[h])||0)-(S?b.crossAxis:0);y<_?y=_:y>C&&(y=C)}return{[p]:g,[h]:y}}}},JA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Pr(e,t),l=await gl(t,a),u=Nr(n),d=Qs(n),h=Ys(n)==="y",{width:p,height:g}=r.floating;let y,v;u==="top"||u==="bottom"?(y=u,v=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=u,y=d==="end"?"top":"bottom");const b=g-l[y],m=p-l[v],f=!t.middlewareData.shift;let w=b,S=m;if(h){const C=p-l.left-l.right;S=d||f?No(m,C):C}else{const C=g-l.top-l.bottom;w=d||f?No(b,C):C}if(f&&!d){const C=on(l.left,0),E=on(l.right,0),T=on(l.top,0),O=on(l.bottom,0);h?S=p-2*(C!==0||E!==0?C+E:on(l.left,l.right)):w=g-2*(T!==0||O!==0?T+O:on(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const _=await o.getDimensions(i.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function Ao(e){return Y1(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lr(e){var t;return(t=(Y1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y1(e){return e instanceof Node||e instanceof un(e).Node}function Or(e){return e instanceof Element||e instanceof un(e).Element}function lr(e){return e instanceof HTMLElement||e instanceof un(e).HTMLElement}function Ay(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function Hl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function eD(e){return["table","td","th"].includes(Ao(e))}function tv(e){const t=nv(),n=$n(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function tD(e){let t=Ls(e);for(;lr(t)&&!Rd(t);){if(tv(t))return t;t=Ls(t)}return null}function nv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rd(e){return["html","body","#document"].includes(Ao(e))}function $n(e){return un(e).getComputedStyle(e)}function Pd(e){return Or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ls(e){if(Ao(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ay(e)&&e.host||Lr(e);return Ay(t)?t.host:t}function q1(e){const t=Ls(e);return Rd(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&Hl(t)?t:q1(t)}function yl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=q1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=un(o);return i?t.concat(s,s.visualViewport||[],Hl(o)?o:[],s.frameElement&&n?yl(s.frameElement):[]):t.concat(o,yl(o,[],n))}function G1(e){const t=$n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lr(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Vc(n)!==i||Vc(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function rv(e){return Or(e)?e:e.contextElement}function ls(e){const t=rv(e);if(!lr(t))return Oo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=G1(t);let s=(i?Vc(n.width):n.width)/r,a=(i?Vc(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nD=Oo(0);function X1(e){const t=un(e);return!nv()||!t.visualViewport?nD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function Si(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=rv(e);let s=Oo(1);t&&(r?Or(r)&&(s=ls(r)):s=ls(e));const a=rD(i,n,r)?X1(i):Oo(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const p=un(i),g=r&&Or(r)?un(r):r;let y=p.frameElement;for(;y&&r&&g!==p;){const v=ls(y),b=y.getBoundingClientRect(),m=$n(y),f=b.left+(y.clientLeft+parseFloat(m.paddingLeft))*v.x,w=b.top+(y.clientTop+parseFloat(m.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,h*=v.y,l+=f,u+=w,y=un(y).frameElement}}return Wc({width:d,height:h,x:l,y:u})}function oD(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=lr(n),i=Lr(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Oo(1);const l=Oo(0);if((o||!o&&r!=="fixed")&&((Ao(n)!=="body"||Hl(i))&&(s=Pd(n)),lr(n))){const u=Si(n);a=ls(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function iD(e){return Array.from(e.getClientRects())}function J1(e){return Si(Lr(e)).left+Pd(e).scrollLeft}function sD(e){const t=Lr(e),n=Pd(e),r=e.ownerDocument.body,o=on(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=on(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+J1(e);const a=-n.scrollTop;return $n(r).direction==="rtl"&&(s+=on(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function aD(e,t){const n=un(e),r=Lr(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=nv();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function lD(e,t){const n=Si(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=lr(e)?ls(e):Oo(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Dy(e,t,n){let r;if(t==="viewport")r=aD(e,n);else if(t==="document")r=sD(Lr(e));else if(Or(t))r=lD(t,n);else{const o=X1(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Wc(r)}function eS(e,t){const n=Ls(e);return n===t||!Or(n)||Rd(n)?!1:$n(n).position==="fixed"||eS(n,t)}function uD(e,t){const n=t.get(e);if(n)return n;let r=yl(e,[],!1).filter(a=>Or(a)&&Ao(a)!=="body"),o=null;const i=$n(e).position==="fixed";let s=i?Ls(e):e;for(;Or(s)&&!Rd(s);){const a=$n(s),l=tv(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Hl(s)&&!l&&eS(e,s))?r=r.filter(d=>d!==s):o=a,s=Ls(s)}return t.set(e,r),r}function cD(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?uD(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=Dy(t,d,o);return u.top=on(h.top,u.top),u.right=No(h.right,u.right),u.bottom=No(h.bottom,u.bottom),u.left=on(h.left,u.left),u},Dy(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dD(e){return G1(e)}function fD(e,t,n){const r=lr(t),o=Lr(t),i=n==="fixed",s=Si(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Oo(0);if(r||!r&&!i)if((Ao(t)!=="body"||Hl(o))&&(a=Pd(t)),r){const u=Si(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&(l.x=J1(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function My(e,t){return!lr(e)||$n(e).position==="fixed"?null:t?t(e):e.offsetParent}function tS(e,t){const n=un(e);if(!lr(e))return n;let r=My(e,t);for(;r&&eD(r)&&$n(r).position==="static";)r=My(r,t);return r&&(Ao(r)==="html"||Ao(r)==="body"&&$n(r).position==="static"&&!tv(r))?n:r||tD(e)||n}const hD=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||tS,i=this.getDimensions;return{reference:fD(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function pD(e){return $n(e).direction==="rtl"}const mD={convertOffsetParentRelativeRectToViewportRelativeRect:oD,getDocumentElement:Lr,getClippingRect:cD,getOffsetParent:tS,getElementRects:hD,getClientRects:iD,getDimensions:dD,getScale:ls,isElement:Or,isRTL:pD};function vD(e,t){let n=null,r;const o=Lr(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:h,height:p}=e.getBoundingClientRect();if(a||t(),!h||!p)return;const g=Su(d),y=Su(o.clientWidth-(u+h)),v=Su(o.clientHeight-(d+p)),b=Su(u),f={rootMargin:-g+"px "+-y+"px "+-v+"px "+-b+"px",threshold:on(0,No(1,l))||1};let w=!0;function S(_){const C=_[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,f)}n.observe(e)}return s(!0),i}function gD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=rv(e),d=o||i?[...u?yl(u):[],...yl(t)]:[];d.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const h=u&&a?vD(u,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(m=>{let[f]=m;f&&f.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let y,v=l?Si(e):null;l&&b();function b(){const m=Si(e);v&&(m.x!==v.x||m.y!==v.y||m.width!==v.width||m.height!==v.height)&&n(),v=m,y=requestAnimationFrame(b)}return n(),()=>{d.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),h&&h(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const yD=(e,t,n)=>{const r=new Map,o={platform:mD,...n},i={...o.platform,_c:r};return ZA(e,t,{...o,platform:i})},wD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Py({element:r.current,padding:o}).fn(n):{}:r?Py({element:r,padding:o}).fn(n):{}}}};var Hu=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Hc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Hc(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Hc(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function nS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jy(e,t){const n=nS(e);return Math.round(t*n)/n}function Iy(e){const t=c.useRef(e);return Hu(()=>{t.current=e}),t}function xD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,h]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=c.useState(r);Hc(p,r)||g(r);const[y,v]=c.useState(null),[b,m]=c.useState(null),f=c.useCallback(H=>{H!=C.current&&(C.current=H,v(H))},[v]),w=c.useCallback(H=>{H!==E.current&&(E.current=H,m(H))},[m]),S=i||y,_=s||b,C=c.useRef(null),E=c.useRef(null),T=c.useRef(d),O=Iy(l),j=Iy(o),V=c.useCallback(()=>{if(!C.current||!E.current)return;const H={placement:t,strategy:n,middleware:p};j.current&&(H.platform=j.current),yD(C.current,E.current,H).then(oe=>{const L={...oe,isPositioned:!0};D.current&&!Hc(T.current,L)&&(T.current=L,Dr.flushSync(()=>{h(L)}))})},[p,t,n,j]);Hu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[u]);const D=c.useRef(!1);Hu(()=>(D.current=!0,()=>{D.current=!1}),[]),Hu(()=>{if(S&&(C.current=S),_&&(E.current=_),S&&_){if(O.current)return O.current(S,_,V);V()}},[S,_,V,O]);const W=c.useMemo(()=>({reference:C,floating:E,setReference:f,setFloating:w}),[f,w]),M=c.useMemo(()=>({reference:S,floating:_}),[S,_]),F=c.useMemo(()=>{const H={position:n,left:0,top:0};if(!M.floating)return H;const oe=jy(M.floating,d.x),L=jy(M.floating,d.y);return a?{...H,transform:"translate("+oe+"px, "+L+"px)",...nS(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:L}},[n,a,M.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:V,refs:W,elements:M,floatingStyles:F}),[d,V,W,M,F])}function rS(e){const[t,n]=c.useState(void 0);return Jt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const oS="Popper",[iS,sS]=Mr(oS),[bD,aS]=iS(oS),SD=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return c.createElement(bD,{scope:t,anchor:r,onAnchorChange:o},n)},_D="PopperAnchor",ED=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=aS(_D,n),s=c.useRef(null),a=it(t,s);return c.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:c.createElement(ke.div,ne({},o,{ref:a}))}),lS="PopperContent",[CD,PM]=iS(lS),kD=c.forwardRef((e,t)=>{var n,r,o,i,s,a,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:p=0,align:g="center",alignOffset:y=0,arrowPadding:v=0,avoidCollisions:b=!0,collisionBoundary:m=[],collisionPadding:f=0,sticky:w="partial",hideWhenDetached:S=!1,updatePositionStrategy:_="optimized",onPlaced:C,...E}=e,T=aS(lS,d),[O,j]=c.useState(null),V=it(t,hn=>j(hn)),[D,W]=c.useState(null),M=rS(D),F=(n=M==null?void 0:M.width)!==null&&n!==void 0?n:0,H=(r=M==null?void 0:M.height)!==null&&r!==void 0?r:0,oe=h+(g!=="center"?"-"+g:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(m)?m:[m],re=K.length>0,he={padding:L,boundary:K.filter(TD),altBoundary:re},{refs:ve,floatingStyles:Ue,placement:je,isPositioned:ht,middlewareData:ze}=xD({strategy:"fixed",placement:oe,whileElementsMounted:(...hn)=>gD(...hn,{animationFrame:_==="always"}),elements:{reference:T.anchor},middleware:[qA({mainAxis:p+H,alignmentAxis:y}),b&&GA({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?XA():void 0,...he}),b&&KA({...he}),JA({...he,apply:({elements:hn,rects:dr,availableWidth:$,availableHeight:N})=>{const{width:A,height:ee}=dr.reference,Z=hn.floating.style;Z.setProperty("--radix-popper-available-width",`${$}px`),Z.setProperty("--radix-popper-available-height",`${N}px`),Z.setProperty("--radix-popper-anchor-width",`${A}px`),Z.setProperty("--radix-popper-anchor-height",`${ee}px`)}}),D&&wD({element:D,padding:v}),$D({arrowWidth:F,arrowHeight:H}),S&&QA({strategy:"referenceHidden",...he})]}),[ue,Me]=uS(je),$e=Vt(C);Jt(()=>{ht&&($e==null||$e())},[ht,$e]);const Re=(o=ze.arrow)===null||o===void 0?void 0:o.x,Ne=(i=ze.arrow)===null||i===void 0?void 0:i.y,Oe=((s=ze.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Xe,$t]=c.useState();return Jt(()=>{O&&$t(window.getComputedStyle(O).zIndex)},[O]),c.createElement("div",{ref:ve.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ue,transform:ht?Ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Xe,["--radix-popper-transform-origin"]:[(a=ze.transformOrigin)===null||a===void 0?void 0:a.x,(l=ze.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},c.createElement(CD,{scope:d,placedSide:ue,onArrowChange:W,arrowX:Re,arrowY:Ne,shouldHideArrow:Oe},c.createElement(ke.div,ne({"data-side":ue,"data-align":Me},E,{ref:V,style:{...E.style,animation:ht?void 0:"none",opacity:(u=ze.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function TD(e){return e!==null}const $D=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=h?0:e.arrowWidth,g=h?0:e.arrowHeight,[y,v]=uS(a),b={start:"0%",center:"50%",end:"100%"}[v],m=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,f=((i=(s=u.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let w="",S="";return y==="bottom"?(w=h?b:`${m}px`,S=`${-g}px`):y==="top"?(w=h?b:`${m}px`,S=`${l.floating.height+g}px`):y==="right"?(w=`${-g}px`,S=h?b:`${f}px`):y==="left"&&(w=`${l.floating.width+g}px`,S=h?b:`${f}px`),{data:{x:w,y:S}}}});function uS(e){const[t,n="center"]=e.split("-");return[t,n]}const RD=SD,PD=ED,ND=kD;function cS(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const OD=[" ","Enter","ArrowUp","ArrowDown"],AD=[" ","Enter"],Nd="Select",[Od,ov,DD]=mm(Nd),[qs,NM]=Mr(Nd,[DD,sS]),iv=sS(),[MD,ki]=qs(Nd),[jD,ID]=qs(Nd),LD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:p,required:g}=e,y=iv(t),[v,b]=c.useState(null),[m,f]=c.useState(null),[w,S]=c.useState(!1),_=Gm(u),[C=!1,E]=Os({prop:r,defaultProp:o,onChange:i}),[T,O]=Os({prop:s,defaultProp:a,onChange:l}),j=c.useRef(null),V=v?!!v.closest("form"):!0,[D,W]=c.useState(new Set),M=Array.from(D).map(F=>F.props.value).join(";");return c.createElement(RD,y,c.createElement(MD,{required:g,scope:t,trigger:v,onTriggerChange:b,valueNode:m,onValueNodeChange:f,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:as(),value:T,onValueChange:O,open:C,onOpenChange:E,dir:_,triggerPointerDownPosRef:j,disabled:p},c.createElement(Od.Provider,{scope:t},c.createElement(jD,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(F=>{W(H=>new Set(H).add(F))},[]),onNativeOptionRemove:c.useCallback(F=>{W(H=>{const oe=new Set(H);return oe.delete(F),oe})},[])},n)),V?c.createElement(pS,{key:M,"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:h,value:T,onChange:F=>O(F.target.value),disabled:p},T===void 0?c.createElement("option",{value:""}):null,Array.from(D)):null))},FD="SelectTrigger",UD=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=iv(n),s=ki(FD,n),a=s.disabled||r,l=it(t,s.onTriggerChange),u=ov(n),[d,h,p]=mS(y=>{const v=u().filter(f=>!f.disabled),b=v.find(f=>f.value===s.value),m=vS(v,y,b);m!==void 0&&s.onValueChange(m.value)}),g=()=>{a||(s.onOpenChange(!0),p())};return c.createElement(PD,ne({asChild:!0},i),c.createElement(ke.button,ne({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":hS(s.value)?"":void 0},o,{ref:l,onClick:Ee(o.onClick,y=>{y.currentTarget.focus()}),onPointerDown:Ee(o.onPointerDown,y=>{const v=y.target;v.hasPointerCapture(y.pointerId)&&v.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:Ee(o.onKeyDown,y=>{const v=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(v&&y.key===" ")&&OD.includes(y.key)&&(g(),y.preventDefault())})})))}),zD="SelectValue",VD=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=ki(zD,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=it(t,l.onValueNodeChange);return Jt(()=>{u(d)},[u,d]),c.createElement(ke.span,ne({},a,{ref:h,style:{pointerEvents:"none"}}),hS(l.value)?c.createElement(c.Fragment,null,s):i)}),BD=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.createElement(ke.span,ne({"aria-hidden":!0},o,{ref:t}),r||"▼")}),WD=e=>c.createElement(gm,ne({asChild:!0},e)),Fs="SelectContent",HD=c.forwardRef((e,t)=>{const n=ki(Fs,e.__scopeSelect),[r,o]=c.useState();if(Jt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Dr.createPortal(c.createElement(dS,{scope:e.__scopeSelect},c.createElement(Od.Slot,{scope:e.__scopeSelect},c.createElement("div",null,e.children))),i):null}return c.createElement(ZD,ne({},e,{ref:t}))}),mr=10,[dS,Ad]=qs(Fs),ZD=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:b,...m}=e,f=ki(Fs,n),[w,S]=c.useState(null),[_,C]=c.useState(null),E=it(t,ue=>S(ue)),[T,O]=c.useState(null),[j,V]=c.useState(null),D=ov(n),[W,M]=c.useState(!1),F=c.useRef(!1);c.useEffect(()=>{if(w)return D1(w)},[w]),_1();const H=c.useCallback(ue=>{const[Me,...$e]=D().map(Oe=>Oe.ref.current),[Re]=$e.slice(-1),Ne=document.activeElement;for(const Oe of ue)if(Oe===Ne||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===Me&&_&&(_.scrollTop=0),Oe===Re&&_&&(_.scrollTop=_.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ne))return},[D,_]),oe=c.useCallback(()=>H([T,w]),[H,T,w]);c.useEffect(()=>{W&&oe()},[W,oe]);const{onOpenChange:L,triggerPointerDownPosRef:K}=f;c.useEffect(()=>{if(w){let ue={x:0,y:0};const Me=Re=>{var Ne,Oe,Xe,$t;ue={x:Math.abs(Math.round(Re.pageX)-((Ne=(Oe=K.current)===null||Oe===void 0?void 0:Oe.x)!==null&&Ne!==void 0?Ne:0)),y:Math.abs(Math.round(Re.pageY)-((Xe=($t=K.current)===null||$t===void 0?void 0:$t.y)!==null&&Xe!==void 0?Xe:0))}},$e=Re=>{ue.x<=10&&ue.y<=10?Re.preventDefault():w.contains(Re.target)||L(!1),document.removeEventListener("pointermove",Me),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",Me),document.addEventListener("pointerup",$e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Me),document.removeEventListener("pointerup",$e,{capture:!0})}}},[w,L,K]),c.useEffect(()=>{const ue=()=>L(!1);return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[L]);const[re,he]=mS(ue=>{const Me=D().filter(Ne=>!Ne.disabled),$e=Me.find(Ne=>Ne.ref.current===document.activeElement),Re=vS(Me,ue,$e);Re&&setTimeout(()=>Re.ref.current.focus())}),ve=c.useCallback((ue,Me,$e)=>{const Re=!F.current&&!$e;(f.value!==void 0&&f.value===Me||Re)&&(O(ue),Re&&(F.current=!0))},[f.value]),Ue=c.useCallback(()=>w==null?void 0:w.focus(),[w]),je=c.useCallback((ue,Me,$e)=>{const Re=!F.current&&!$e;(f.value!==void 0&&f.value===Me||Re)&&V(ue)},[f.value]),ht=r==="popper"?Ly:KD,ze=ht===Ly?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:b}:{};return c.createElement(dS,{scope:n,content:w,viewport:_,onViewportChange:C,itemRefCallback:ve,selectedItem:T,onItemLeave:Ue,itemTextRefCallback:je,focusSelectedItem:oe,selectedItemText:j,position:r,isPositioned:W,searchRef:re},c.createElement(O1,{as:Eo,allowPinchZoom:!0},c.createElement(b1,{asChild:!0,trapped:f.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Ee(o,ue=>{var Me;(Me=f.trigger)===null||Me===void 0||Me.focus({preventScroll:!0}),ue.preventDefault()})},c.createElement(vm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>f.onOpenChange(!1)},c.createElement(ht,ne({role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:ue=>ue.preventDefault()},m,ze,{onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Ee(m.onKeyDown,ue=>{const Me=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!Me&&ue.key.length===1&&he(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let Re=D().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const Ne=ue.target,Oe=Re.indexOf(Ne);Re=Re.slice(Oe+1)}setTimeout(()=>H(Re)),ue.preventDefault()}})}))))))}),KD=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ki(Fs,n),s=Ad(Fs,n),[a,l]=c.useState(null),[u,d]=c.useState(null),h=it(t,E=>d(E)),p=ov(n),g=c.useRef(!1),y=c.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:m,focusSelectedItem:f}=s,w=c.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&v&&b&&m){const E=i.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),j=m.getBoundingClientRect();if(i.dir!=="rtl"){const Ne=j.left-T.left,Oe=O.left-Ne,Xe=E.left-Oe,$t=E.width+Xe,hn=Math.max($t,T.width),dr=window.innerWidth-mr,$=$y(Oe,[mr,dr-hn]);a.style.minWidth=$t+"px",a.style.left=$+"px"}else{const Ne=T.right-j.right,Oe=window.innerWidth-O.right-Ne,Xe=window.innerWidth-E.right-Oe,$t=E.width+Xe,hn=Math.max($t,T.width),dr=window.innerWidth-mr,$=$y(Oe,[mr,dr-hn]);a.style.minWidth=$t+"px",a.style.right=$+"px"}const V=p(),D=window.innerHeight-mr*2,W=v.scrollHeight,M=window.getComputedStyle(u),F=parseInt(M.borderTopWidth,10),H=parseInt(M.paddingTop,10),oe=parseInt(M.borderBottomWidth,10),L=parseInt(M.paddingBottom,10),K=F+H+W+L+oe,re=Math.min(b.offsetHeight*5,K),he=window.getComputedStyle(v),ve=parseInt(he.paddingTop,10),Ue=parseInt(he.paddingBottom,10),je=E.top+E.height/2-mr,ht=D-je,ze=b.offsetHeight/2,ue=b.offsetTop+ze,Me=F+H+ue,$e=K-Me;if(Me<=je){const Ne=b===V[V.length-1].ref.current;a.style.bottom="0px";const Oe=u.clientHeight-v.offsetTop-v.offsetHeight,Xe=Math.max(ht,ze+(Ne?Ue:0)+Oe+oe),$t=Me+Xe;a.style.height=$t+"px"}else{const Ne=b===V[0].ref.current;a.style.top="0px";const Xe=Math.max(je,F+v.offsetTop+(Ne?ve:0)+ze)+$e;a.style.height=Xe+"px",v.scrollTop=Me-je+v.offsetTop}a.style.margin=`${mr}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,i.trigger,i.valueNode,a,u,v,b,m,i.dir,r]);Jt(()=>w(),[w]);const[S,_]=c.useState();Jt(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const C=c.useCallback(E=>{E&&y.current===!0&&(w(),f==null||f(),y.current=!1)},[w,f]);return c.createElement(QD,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:C},c.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},c.createElement(ke.div,ne({},o,{ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),Ly=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mr,...i}=e,s=iv(n);return c.createElement(ND,ne({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[QD,YD]=qs(Fs,{}),Fy="SelectViewport",qD=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ad(Fy,n),i=YD(Fy,n),s=it(t,o.onViewportChange),a=c.useRef(0);return c.createElement(c.Fragment,null,c.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),c.createElement(Od.Slot,{scope:n},c.createElement(ke.div,ne({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Ee(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const p=Math.abs(a.current-u.scrollTop);if(p>0){const g=window.innerHeight-mr*2,y=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),b=Math.max(y,v);if(b0?w:0,d.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),GD="SelectGroup",[OM,XD]=qs(GD),JD="SelectLabel",e4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=XD(JD,n);return c.createElement(ke.div,ne({id:o.id},r,{ref:t}))}),gp="SelectItem",[t4,fS]=qs(gp),n4=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=ki(gp,n),l=Ad(gp,n),u=a.value===r,[d,h]=c.useState(i??""),[p,g]=c.useState(!1),y=it(t,m=>{var f;return(f=l.itemRefCallback)===null||f===void 0?void 0:f.call(l,m,r,o)}),v=as(),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.createElement(t4,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:c.useCallback(m=>{h(f=>{var w;return f||((w=m==null?void 0:m.textContent)!==null&&w!==void 0?w:"").trim()})},[])},c.createElement(Od.ItemSlot,{scope:n,value:r,disabled:o,textValue:d},c.createElement(ke.div,ne({role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:y,onFocus:Ee(s.onFocus,()=>g(!0)),onBlur:Ee(s.onBlur,()=>g(!1)),onPointerUp:Ee(s.onPointerUp,b),onPointerMove:Ee(s.onPointerMove,m=>{if(o){var f;(f=l.onItemLeave)===null||f===void 0||f.call(l)}else m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(s.onPointerLeave,m=>{if(m.currentTarget===document.activeElement){var f;(f=l.onItemLeave)===null||f===void 0||f.call(l)}}),onKeyDown:Ee(s.onKeyDown,m=>{var f;((f=l.searchRef)===null||f===void 0?void 0:f.current)!==""&&m.key===" "||(AD.includes(m.key)&&b(),m.key===" "&&m.preventDefault())})}))))}),_u="SelectItemText",r4=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=ki(_u,n),a=Ad(_u,n),l=fS(_u,n),u=ID(_u,n),[d,h]=c.useState(null),p=it(t,m=>h(m),l.onItemTextChange,m=>{var f;return(f=a.itemTextRefCallback)===null||f===void 0?void 0:f.call(a,m,l.value,l.disabled)}),g=d==null?void 0:d.textContent,y=c.useMemo(()=>c.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=u;return Jt(()=>(v(y),()=>b(y)),[v,b,y]),c.createElement(c.Fragment,null,c.createElement(ke.span,ne({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Dr.createPortal(i.children,s.valueNode):null)}),o4="SelectItemIndicator",i4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fS(o4,n).isSelected?c.createElement(ke.span,ne({"aria-hidden":!0},r,{ref:t})):null}),s4=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.createElement(ke.div,ne({"aria-hidden":!0},r,{ref:t}))});function hS(e){return e===""||e===void 0}const pS=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=c.useRef(null),i=it(t,o),s=cS(n);return c.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const h=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(h)}},[s,n]),c.createElement(ym,{asChild:!0},c.createElement("select",ne({},r,{ref:i,defaultValue:n})))});pS.displayName="BubbleSelect";function mS(e){const t=Vt(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(s=>{const a=n.current+s;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function vS(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=a4(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function a4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const l4=LD,gS=UD,u4=VD,c4=BD,d4=WD,yS=HD,f4=qD,wS=e4,xS=n4,h4=r4,p4=i4,bS=s4,Zu=l4,Ku=u4,Ma=c.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(gS,{ref:r,className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,x.jsx(c4,{asChild:!0,children:x.jsx(ak,{className:"h-4 w-4 opacity-50"})})]}));Ma.displayName=gS.displayName;const ja=c.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>x.jsx(d4,{children:x.jsx(yS,{ref:o,className:le("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:x.jsx(f4,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ja.displayName=yS.displayName;const m4=c.forwardRef(({className:e,...t},n)=>x.jsx(wS,{ref:n,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));m4.displayName=wS.displayName;const ci=c.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(xS,{ref:r,className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(p4,{children:x.jsx(sk,{className:"h-4 w-4"})})}),x.jsx(h4,{children:t})]}));ci.displayName=xS.displayName;const v4=c.forwardRef(({className:e,...t},n)=>x.jsx(bS,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));v4.displayName=bS.displayName;const g4=e=>{const t=fd(),n=Fo();return Cm({mutationFn:async r=>{const o=await fetch(Ir+"/agents",{method:"POST",headers:{"Content-Type":" application/json",Authorization:n},body:JSON.stringify({config:r,user_id:e})});if(!o.ok){const i=await o.text();throw new Error(i||"Error creating agent")}return await o.json()},onSuccess:()=>t.invalidateQueries({queryKey:[e,"agents","list"]})})},y4=e=>{const t=Fo();return Il({queryKey:[e,"humans","list"],enabled:!!e,queryFn:async()=>{const n=await fetch(`${Ir}/humans?user_id=${encodeURIComponent(e||"")}`,{headers:{Authorization:t}});if(!n.ok)throw new Error("Network response was not ok for fetching humans");return await n.json()}})},w4=e=>{const t=Fo();return Il({queryKey:[e,"models","list"],enabled:!!e,queryFn:async()=>{const n=await fetch(`${Ir}/models?user_id=${encodeURIComponent(e||"")}`,{headers:{Authorization:t}});if(!n.ok)throw new Error("Network response was not ok for fetching models");return await n.json()}})},x4=e=>{const t=Fo();return Il({queryKey:[e,"personas","list"],enabled:!!e,queryFn:async()=>{const n=await fetch(`${Ir}/personas?user_id=${encodeURIComponent(e||"")}`,{headers:{Authorization:t}});if(!n.ok)throw new Error("Network response was not ok");return await n.json()}})},b4=({open:e,onOpenChange:t})=>{const n=Lo(),r=g4(n.uuid),{toast:o}=Wx(),{register:i,handleSubmit:s,control:a,formState:{errors:l,isSubmitting:u,isValid:d},reset:h}=Wl({mode:"onBlur"});c.useEffect(()=>{e||h()},[e,h]);const{data:p}=w4(n.uuid),{data:g}=y4(n.uuid),{data:y}=x4(n.uuid),v=b=>{n.uuid&&r.mutateAsync({name:b.name,human:b.human,persona:b.persona,model:b.model}).then(()=>{t(!1),o({title:"Agent created successfully!",duration:5e3})}).catch(m=>{let f="Error creating agent";const w=`${f}: Unspecified error.`;try{const S=JSON.parse(m.message);S.detail&&(S.detail=="None"?f=w:f=`${f}: ${S.detail}`)}catch{f=w}o({title:f,duration:5e3})})};return x.jsx(H1,{open:e,onOpenChange:t,children:x.jsx(Km,{className:"sm:max-w-[425px]",children:x.jsxs("form",{onSubmit:s(v),children:[x.jsxs(Qm,{children:[x.jsx(Ym,{children:"Create Agent"}),x.jsx(qm,{children:"Add a new agent here. Click create when you're done. Human, Persona, and Model can be left blank to use default values."})]}),x.jsxs("div",{className:"grid gap-4 py-4",children:[x.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[x.jsx(Go,{htmlFor:"name",className:"text-right",children:"Name"}),x.jsx(bi,{id:"name",placeholder:"Enter a name",...i("name",{required:!0}),className:`col-span-3 ${l.name?"border-red-500":""} border`})]}),x.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[x.jsx(Go,{htmlFor:"human",className:"text-right",children:"Human"}),x.jsx(zu,{name:"human",control:a,render:({field:{onChange:b,value:m}})=>x.jsxs(Zu,{value:m,onValueChange:f=>b(f),children:[x.jsx(Ma,{className:"col-span-3",children:x.jsx(Ku,{placeholder:"Select a human",children:m})}),x.jsx(ja,{children:g==null?void 0:g.humans.map(f=>x.jsx(ci,{value:f.name,children:f.name},f.name))})]})})]}),x.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[x.jsx(Go,{htmlFor:"persona",className:"text-right",children:"Persona"}),x.jsx(zu,{name:"persona",control:a,render:({field:{onChange:b,value:m}})=>x.jsxs(Zu,{value:m,onValueChange:f=>b(f),children:[x.jsx(Ma,{className:"col-span-3",children:x.jsx(Ku,{placeholder:"Select a persona",children:m})}),x.jsx(ja,{children:y==null?void 0:y.personas.map(f=>x.jsx(ci,{value:f.name,children:f.name},f.name))})]})})]}),x.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[x.jsx(Go,{htmlFor:"model",className:"text-right",children:"Model"}),x.jsx(zu,{name:"model",control:a,render:({field:{onChange:b,value:m}})=>x.jsxs(Zu,{value:m,onValueChange:f=>b(f),children:[x.jsx(Ma,{className:"col-span-3",children:x.jsx(Ku,{placeholder:"Select a model",children:m})}),x.jsx(ja,{children:p==null?void 0:p.models.map(f=>x.jsx(ci,{value:f.name,children:f.name},f.name))})]})})]})]}),x.jsx(K1,{children:x.jsx(Ct,{type:"submit",disabled:u||!d,children:u?x.jsx(xm,{className:"mr-2 h-4 w-4 animate-spin"}):"Create Agent"})})]})})})},S4=()=>{const{uuid:e}=Lo(),{data:t,isSuccess:n,isLoading:r}=Vm(e),{setAgent:o}=yd(),i=Ul(),[s,a]=c.useState(!1),[l,u]=c.useState(""),[d]=MA(l,300),h=((t==null?void 0:t.agents)??[]).filter(y=>y.name.includes(d)),p=r?[1,2,3,4,5,6,7,8].map((y,v)=>x.jsx(NA,{className:"h-52 w-full flex-none opacity-30 sm:w-96"},v)):h.map(y=>x.jsx(jA,{className:"flex h-52 w-full flex-none flex-col justify-between shadow-md sm:w-96",name:y.name,human:y.human,persona:y.persona,created_at:y.created_at,onBtnClick:()=>o(y),isCurrentAgent:!!i&&(i==null?void 0:i.id)===y.id},y.name)),g=c.useRef(null);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex h-full flex-col items-center overflow-y-scroll",children:[x.jsxs("div",{className:"p-2 pt-40 pb-12",children:[x.jsx("h1",{className:_2(),children:"Welcome to MemGPT"}),x.jsx("p",{className:k2("mt-2 mb-4"),children:"Select or create an agent to start your conversation..."})]}),x.jsxs("div",{className:"mx-auto mb-12 flex w-full max-w-screen-lg justify-between",children:[x.jsxs("div",{className:"relative",children:[x.jsx(bi,{value:l,onChange:y=>u(y.target.value),ref:g,placeholder:"Search for Agent",className:"w-full pl-12 sm:w-80"}),x.jsx(fk,{onClick:()=>{var y;return(y=g.current)==null?void 0:y.focus()},className:"absolute top-1/2 left-3 z-0 h-5 w-5 -translate-y-1/2"})]}),x.jsxs(Ct,{onClick:()=>a(!0),children:[x.jsx(dk,{className:"h-5 w-5"}),x.jsx("span",{className:"ml-2",children:"Add New"})]})]}),x.jsxs("div",{className:"mx-auto flex w-full max-w-screen-2xl flex-wrap gap-12 px-8 pb-20",children:[p,n&&(t==null?void 0:t.num_agents)===0?x.jsxs("div",{className:"flex w-full flex-col items-center justify-center p-20",children:[x.jsx("h3",{className:Vb(),children:"No Agents exist"}),x.jsx("p",{className:Po("mt-4"),children:"Create your first agent and start chatting by clicking the Add New button."})]}):void 0]})]}),x.jsx(b4,{open:s,onOpenChange:y=>a(y)})]})},_4=()=>{const{setAsAuthenticated:e}=jm();return Cm({mutationKey:["auth"],mutationFn:t=>fetch(Ir+"/auth",{method:"POST",headers:{"Content-Type":" application/json"},body:JSON.stringify({password:t})}).then(n=>{if(!n.ok)throw new Error("Network response was not ok");return n.json()}),onSuccess:(t,n)=>e(t.uuid,n)})},E4=new Date().getFullYear(),C4=()=>{const e=_4(),t=Pm();return x.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[x.jsxs("div",{className:"-mt-40 flex max-w-sm flex-col items-center justify-center",children:[x.jsxs(bd,{className:"mb-2 h-16 w-16 border bg-white",children:[x.jsx(Sd,{alt:"MemGPT logo.",src:"/memgpt_logo_transparent.png"}),x.jsx(_d,{className:"border",children:"MG"})]}),x.jsx("h1",{className:Vb("mb-2"),children:"Welcome to MemGPT"}),x.jsx("p",{className:"mb-6 text-muted-foreground",children:"Sign in below to start chatting with your agent"}),x.jsxs("form",{className:"w-full",onSubmit:n=>{n.preventDefault();const r=new FormData(n.currentTarget).get("password");!r||r.length===0||e.mutate(r,{onSuccess:({uuid:o},i)=>setTimeout(()=>t("/"),600)})},children:[x.jsx(Go,{className:"sr-only",htmlFor:"password",children:"Password"}),x.jsx(bi,{name:"password",className:"mb-2 w-full",type:"password",autoComplete:"off",autoCorrect:"off",id:"password"}),x.jsxs(Ct,{type:"submit",className:"mb-6 w-full",children:[e.isPending?x.jsxs("span",{className:"flex items-center animate-in slide-in-from-bottom-2",children:[x.jsx(xm,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in"]}):null,e.isSuccess?x.jsx("span",{className:"animate-in slide-in-from-bottom-2",children:"Signed in!"}):null,!e.isPending&&e.isError?x.jsx("span",{className:"animate-in slide-in-from-bottom-2",children:"Sign In Failed. Try again..."}):null,!e.isPending&&!e.isSuccess&&!e.isError?x.jsx("span",{children:"Sign In with Password"}):null]})]}),x.jsx("p",{className:"text-center text-muted-foreground",children:"By clicking continue, you agree to our Terms of Service and Privacy Policy."})]}),x.jsxs("p",{className:Po("absolute inset-x-0 bottom-3 text-center"),children:["© ",E4," MemGPT"]})]})},k4={path:"login",element:x.jsx(C4,{})},Vf="rovingFocusGroup.onEntryFocus",T4={bubbles:!1,cancelable:!0},sv="RovingFocusGroup",[yp,SS,$4]=mm(sv),[R4,_S]=Mr(sv,[$4]),[P4,N4]=R4(sv),O4=c.forwardRef((e,t)=>c.createElement(yp.Provider,{scope:e.__scopeRovingFocusGroup},c.createElement(yp.Slot,{scope:e.__scopeRovingFocusGroup},c.createElement(A4,ne({},e,{ref:t}))))),A4=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=c.useRef(null),p=it(t,h),g=Gm(i),[y=null,v]=Os({prop:s,defaultProp:a,onChange:l}),[b,m]=c.useState(!1),f=Vt(u),w=SS(n),S=c.useRef(!1),[_,C]=c.useState(0);return c.useEffect(()=>{const E=h.current;if(E)return E.addEventListener(Vf,f),()=>E.removeEventListener(Vf,f)},[f]),c.createElement(P4,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:y,onItemFocus:c.useCallback(E=>v(E),[v]),onItemShiftTab:c.useCallback(()=>m(!0),[]),onFocusableItemAdd:c.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:c.useCallback(()=>C(E=>E-1),[])},c.createElement(ke.div,ne({tabIndex:b||_===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{S.current=!0}),onFocus:Ee(e.onFocus,E=>{const T=!S.current;if(E.target===E.currentTarget&&T&&!b){const O=new CustomEvent(Vf,T4);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const j=w().filter(F=>F.focusable),V=j.find(F=>F.active),D=j.find(F=>F.id===y),M=[V,D,...j].filter(Boolean).map(F=>F.ref.current);ES(M)}}S.current=!1}),onBlur:Ee(e.onBlur,()=>m(!1))})))}),D4="RovingFocusGroupItem",M4=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=as(),l=i||a,u=N4(D4,n),d=u.currentTabStopId===l,h=SS(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return c.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),c.createElement(yp.ItemSlot,{scope:n,id:l,focusable:r,active:o},c.createElement(ke.span,ne({tabIndex:d?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:Ee(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:Ee(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ee(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=L4(y,u.orientation,u.dir);if(v!==void 0){y.preventDefault();let m=h().filter(f=>f.focusable).map(f=>f.ref.current);if(v==="last")m.reverse();else if(v==="prev"||v==="next"){v==="prev"&&m.reverse();const f=m.indexOf(y.currentTarget);m=u.loop?F4(m,f+1):m.slice(f+1)}setTimeout(()=>ES(m))}})})))}),j4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function I4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function L4(e,t,n){const r=I4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return j4[r]}function ES(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function F4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const U4=O4,z4=M4,CS="Radio",[V4,kS]=Mr(CS),[B4,W4]=V4(CS),H4=c.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...u}=e,[d,h]=c.useState(null),p=it(t,v=>h(v)),g=c.useRef(!1),y=d?!!d.closest("form"):!0;return c.createElement(B4,{scope:n,checked:o,disabled:s},c.createElement(ke.button,ne({type:"button",role:"radio","aria-checked":o,"data-state":TS(o),"data-disabled":s?"":void 0,disabled:s,value:a},u,{ref:p,onClick:Ee(e.onClick,v=>{o||l==null||l(),y&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})})),y&&c.createElement(Q4,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Z4="RadioIndicator",K4=c.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=W4(Z4,n);return c.createElement(Bs,{present:r||i.checked},c.createElement(ke.span,ne({"data-state":TS(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Q4=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=c.useRef(null),s=cS(n),a=rS(t);return c.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(p)}},[s,n,r]),c.createElement("input",ne({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function TS(e){return e?"checked":"unchecked"}const Y4=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$S="RadioGroup",[q4,AM]=Mr($S,[_S,kS]),RS=_S(),PS=kS(),[G4,X4]=q4($S),J4=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:u,loop:d=!0,onValueChange:h,...p}=e,g=RS(n),y=Gm(u),[v,b]=Os({prop:i,defaultProp:o,onChange:h});return c.createElement(G4,{scope:n,name:r,required:s,disabled:a,value:v,onValueChange:b},c.createElement(U4,ne({asChild:!0},g,{orientation:l,dir:y,loop:d}),c.createElement(ke.div,ne({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:y},p,{ref:t}))))}),eM="RadioGroupItem",tM=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=X4(eM,n),s=i.disabled||r,a=RS(n),l=PS(n),u=c.useRef(null),d=it(t,u),h=i.value===o.value,p=c.useRef(!1);return c.useEffect(()=>{const g=v=>{Y4.includes(v.key)&&(p.current=!0)},y=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",y)}},[]),c.createElement(z4,ne({asChild:!0},a,{focusable:!s,active:h}),c.createElement(H4,ne({disabled:s,required:i.required,checked:h},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:Ee(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:Ee(o.onFocus,()=>{var g;p.current&&((g=u.current)===null||g===void 0||g.click())})})))}),nM=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=PS(n);return c.createElement(K4,ne({},o,r,{ref:t}))}),NS=J4,OS=tM,rM=nM,AS=c.forwardRef(({className:e,...t},n)=>x.jsx(NS,{className:le("grid gap-2",e),...t,ref:n}));AS.displayName=NS.displayName;const DS=c.forwardRef(({className:e,children:t,...n},r)=>x.jsx(OS,{ref:r,className:le("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:x.jsx(rM,{className:"flex items-center justify-center",children:x.jsx(lk,{className:"h-2.5 w-2.5 fill-current text-current"})})}));DS.displayName=OS.displayName;const wp="horizontal",oM=["horizontal","vertical"],MS=c.forwardRef((e,t)=>{const{decorative:n,orientation:r=wp,...o}=e,i=jS(r)?r:wp,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.createElement(ke.div,ne({"data-orientation":i},a,o,{ref:t}))});MS.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!jS(r)?new Error(iM(o,n)):null}};function iM(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of: + - horizontal + - vertical + +Defaulting to \`${wp}\`.`}function jS(e){return oM.includes(e)}const IS=MS,av=c.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>x.jsx(IS,{ref:o,decorative:n,orientation:t,className:le("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));av.displayName=IS.displayName;const LS=({children:e,title:t,description:n})=>x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"text-lg font-medium",children:t}),x.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),x.jsx(av,{}),e]}),sM=In({currentAgentId:Qt({required_error:"Please select an agent."})}),aM=e=>({currentAgentId:e??""});function lM(){const e=Lo(),{data:t,isLoading:n}=Vm(e.uuid),r=Ul(),{setAgent:o}=yd(),i=Wl({resolver:Cd(sM),defaultValues:aM(r==null?void 0:r.id)});function s(a){const l=((t==null?void 0:t.agents)??[]).find(u=>u.id===a.currentAgentId);l&&(o(l),Sm({title:"Agent updated successfully!",description:"You can now continue your conversation with them!"}))}return x.jsx(LS,{title:"Agents",description:"Manage the agents you chat with...",children:x.jsx(kd,{...i,children:x.jsxs("form",{onSubmit:i.handleSubmit(s),className:"space-y-8",children:[x.jsx(fo,{control:i.control,name:"currentAgentId",render:({field:a})=>{var l;return x.jsxs(nr,{className:"space-y-1",children:[x.jsx(rr,{children:"Current Agent"}),x.jsx(ho,{children:"Agent you are currently chatting with..."}),x.jsx(br,{}),x.jsx(AS,{onValueChange:a.onChange,defaultValue:a.value,className:"flex flex-wrap gap-8 pt-2",children:(l=t==null?void 0:t.agents)==null?void 0:l.map((u,d)=>x.jsx(nr,{children:x.jsxs(rr,{className:"[&:has([data-state=checked])>div]:border-primary",children:[x.jsx(xr,{children:x.jsx(DS,{value:u.id,className:"sr-only"})}),x.jsx("div",{className:"items-center rounded-md border-2 border-muted p-1 hover:border-accent",children:x.jsxs("div",{className:"space-y-2 rounded-sm bg-[#ecedef] p-2",children:[x.jsxs("div",{className:"space-y-2 rounded-md bg-white p-2 shadow-sm",children:[x.jsx("div",{className:"h-2 w-[80px] rounded-lg bg-[#ecedef]"}),x.jsx("div",{className:"h-2 w-[100px] rounded-lg bg-[#ecedef]"})]}),x.jsxs("div",{className:"flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm",children:[x.jsx("div",{className:"h-4 w-4 rounded-full bg-[#ecedef]"}),x.jsx("div",{className:"h-2 w-[100px] rounded-lg bg-[#ecedef]"})]}),x.jsxs("div",{className:"flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm",children:[x.jsx("div",{className:"h-4 w-4 rounded-full bg-[#ecedef]"}),x.jsx("div",{className:"h-2 w-[100px] rounded-lg bg-[#ecedef]"})]})]})}),x.jsx("span",{className:"block w-full p-2 text-center font-normal",children:u.name})]})},d))})]})}}),x.jsx(Ct,{type:"submit",children:"Update agent"})]})})})}const uM=In({username:Qt().min(2,{message:"Username must be at least 2 characters."}).max(30,{message:"Username must not be longer than 30 characters."}),email:Qt({required_error:"Please select an email to display."}).email(),bio:Qt().max(160).min(4),urls:Lb(In({value:Qt().url({message:"Please enter a valid URL."})})).optional()}),cM={bio:"I own a computer.",urls:[{value:"https://shadcn.com"},{value:"http://twitter.com/shadcn"}]};function dM(){const e=Wl({resolver:Cd(uM),defaultValues:cM,mode:"onChange"}),{fields:t,append:n}=X2({name:"urls",control:e.control});function r(o){Sm({title:"You submitted the following values:",description:x.jsx("pre",{className:"bg-slate-950 mt-2 w-[340px] rounded-md p-4",children:x.jsx("code",{className:"text-white",children:JSON.stringify(o,null,2)})})})}return x.jsx(LS,{title:"Profile",description:"This is how others will see you in the MemGPT community.",children:x.jsx(kd,{...e,children:x.jsxs("form",{onSubmit:e.handleSubmit(r),className:"space-y-8",children:[x.jsx(fo,{control:e.control,name:"username",render:({field:o})=>x.jsxs(nr,{children:[x.jsx(rr,{children:"Username"}),x.jsx(xr,{children:x.jsx(bi,{placeholder:"shadcn",...o})}),x.jsx(ho,{children:"This is your public display name. It can be your real name or a pseudonym. You can only change this once every 30 days."}),x.jsx(br,{})]})}),x.jsx(fo,{control:e.control,name:"email",render:({field:o})=>x.jsxs(nr,{children:[x.jsx(rr,{children:"Email"}),x.jsxs(Zu,{onValueChange:o.onChange,defaultValue:o.value,children:[x.jsx(xr,{children:x.jsx(Ma,{children:x.jsx(Ku,{placeholder:"Select a verified email to display"})})}),x.jsxs(ja,{children:[x.jsx(ci,{value:"m@example.com",children:"m@example.com"}),x.jsx(ci,{value:"m@google.com",children:"m@google.com"}),x.jsx(ci,{value:"m@support.com",children:"m@support.com"})]})]}),x.jsxs(ho,{children:["You can manage verified email addresses in your ",x.jsx(yb,{to:"/examples/forms",children:"email settings"}),"."]}),x.jsx(br,{})]})}),x.jsx(fo,{control:e.control,name:"bio",render:({field:o})=>x.jsxs(nr,{children:[x.jsx(rr,{children:"Bio"}),x.jsx(xr,{children:x.jsx(zc,{placeholder:"Tell us a little bit about yourself",className:"resize-none",...o})}),x.jsxs(ho,{children:["You can ",x.jsx("span",{children:"@mention"})," other users and organizations to link to them."]}),x.jsx(br,{})]})}),x.jsxs("div",{children:[t.map((o,i)=>x.jsx(fo,{control:e.control,name:`urls.${i}.value`,render:({field:s})=>x.jsxs(nr,{children:[x.jsx(rr,{className:le(i!==0&&"sr-only"),children:"URLs"}),x.jsx(ho,{className:le(i!==0&&"sr-only"),children:"Add links to your website, blog, or social media profiles."}),x.jsx(xr,{children:x.jsx(bi,{...s})}),x.jsx(br,{})]})},o.id)),x.jsx(Ct,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>n({value:""}),children:"Add URL"})]}),x.jsx(Ct,{type:"submit",children:"Update profile"})]})})})}function fM({className:e,items:t,...n}){return x.jsx("nav",{className:le("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",e),...n,children:t.map((r,o)=>x.jsx(Gi,{relative:"path",to:r.to,className:le(Xb({variant:"ghost"}),"hover:bg-transparent hover:underline","[&.active]:bg-muted [&.active]:hover:bg-muted [&.active]:hover:no-underline","justify-start"),children:r.title},o))})}const hM=[{title:"Agents",to:"./agents"}];function pM(){return x.jsxs("div",{className:"space-y-6 p-10 pb-16",children:[x.jsxs("div",{className:"space-y-0.5",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),x.jsx("p",{className:"text-muted-foreground",children:"Manage your MemGPT settings, like agents, prompts, and history."})]}),x.jsx(av,{className:"my-6"}),x.jsxs("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0",children:[x.jsx("aside",{className:"-mx-4 lg:w-1/5",children:x.jsx(fM,{items:hM})}),x.jsx("div",{className:"flex-1 lg:max-w-4xl",children:x.jsx(mb,{})})]})]})}const mM={path:"settings",element:x.jsx(pM,{}),children:[{path:"agents",element:x.jsx(lM,{})},{path:"profile",element:x.jsx(dM,{})}]};function vM(){const e=new Date().getFullYear();return x.jsxs("div",{className:"flex items-end justify-between border-t p-8",children:[x.jsxs("div",{children:[x.jsx("p",{className:E2(),children:"MemGPT"}),x.jsx("p",{className:Po(),children:"Towards LLMs as Operating Systems"})]}),x.jsxs("p",{className:Po(),children:["© ",e," MemGPT"]})]})}const FS=c.createContext({setTheme(e){},toggleTheme(){},theme:localStorage.getItem("theme")==="dark"?"dark":"light"});function gM({children:e}){const[t,n]=c.useState(localStorage.getItem("theme")==="dark"?"dark":"light"),r=c.useCallback(()=>n(i=>i==="light"?"dark":"light"),[n]),o=c.useMemo(()=>({theme:t,setTheme:n,toggleTheme:r}),[t,n,r]);return c.useEffect(()=>{t==="light"?(document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light")):(document.documentElement.classList.remove("light"),document.documentElement.classList.add("dark")),localStorage.setItem("theme",t)},[t]),x.jsx(FS.Provider,{value:o,children:e})}const yM=()=>c.useContext(FS),Bf="[&.active]:opacity-100 opacity-60",wM=()=>{const{theme:e,toggleTheme:t}=yM(),{logout:n}=jm();return x.jsxs("div",{className:"flex items-start justify-between border-b py-2 sm:px-8",children:[x.jsxs(Gi,{to:"/",children:[x.jsx("span",{className:"sr-only",children:"Home"}),x.jsxs(bd,{className:"border bg-white",children:[x.jsx(Sd,{alt:"MemGPT logo.",src:"/memgpt_logo_transparent.png"}),x.jsx(_d,{className:"border",children:"MG"})]})]}),x.jsxs("nav",{className:"flex space-x-4",children:[x.jsx(Ct,{size:"sm",asChild:!0,variant:"link",children:x.jsx(Gi,{className:Bf,to:"/",children:"Home"})}),x.jsx(Ct,{size:"sm",asChild:!0,variant:"link",children:x.jsx(Gi,{className:Bf,to:"/chat",children:"Chat"})}),x.jsx(Ct,{size:"sm",asChild:!0,variant:"link",children:x.jsx(Gi,{className:Bf,to:"/settings/agents",children:"Settings"})}),x.jsx(Ct,{size:"icon",variant:"ghost",onClick:t,children:e==="light"?x.jsx(ck,{className:"h-4 w-4"}):x.jsx(pk,{className:"w-4 w-4"})}),x.jsx(Ct,{size:"icon",variant:"ghost",onClick:n,children:x.jsx(uk,{className:"h-4 w-4"})})]})]})},xM=()=>x.jsxs(b2,{children:[x.jsx(wM,{}),x.jsx("div",{className:"h-full",children:x.jsx(mb,{})}),x.jsx(vM,{})]}),bM=H$([{path:"/",element:xM(),children:[{path:"",element:x.jsx(S4,{})},PA,mM]},k4]),SM=new pT;function _M(){const{registerOnMessageCallback:e,abortStream:t}=Ub(),{addMessage:n}=Pb(),r=Ul();return c.useEffect(()=>{r&&t()},[t,r]),c.useEffect(()=>e(o=>{r&&(console.log("adding message",o,r.id),n(r.id,o))}),[t,e,r,n]),x.jsxs(wT,{client:SM,children:[x.jsxs(gM,{children:[x.jsx(J$,{router:bM}),x.jsx(Jk,{})]}),x.jsx(AT,{initialIsOpen:!1})]})}const EM=fx(document.getElementById("root"));EM.render(x.jsx(c.StrictMode,{children:x.jsx(_M,{})})); diff --git a/memgpt/server/static_files/favicon.ico b/memgpt/server/static_files/favicon.ico index 317ebcb2..c03b3ed9 100644 Binary files a/memgpt/server/static_files/favicon.ico and b/memgpt/server/static_files/favicon.ico differ diff --git a/memgpt/server/static_files/index.html b/memgpt/server/static_files/index.html index 9d41ce9c..e60547ed 100644 --- a/memgpt/server/static_files/index.html +++ b/memgpt/server/static_files/index.html @@ -2,7 +2,7 @@ - MemgptFrontend + MemGPT @@ -29,8 +29,8 @@ } } - - + +