From 3f10bdfed98275db6416915e786dfbd8e0af56b8 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Fri, 9 Oct 2026 10:45:39 -0700 Subject: [PATCH 1/2] refactor(api,mcp)!: align thread history, panel routes and tool names Bring the remaining API and MCP names in line with the shared LabStack conventions now recorded in AGENTS.md. - Agent thread history returns items and next_cursor (null at the end), accepts page_size, and summarises threads as {id, title, updated_at}. A thread reads as {id, messages, updated_at}; AG-UI messages, run inputs and events keep their protocol names. The route parameter is :id. - POST /api/variables/resolve moves to POST /api/panels/variables/resolve, next to the other panel routes and matching resolve_panel_variables. - The MCP app helper get_panel_exemplars becomes list_panel_exemplars: it returns a bounded set of traces, not one known resource. - replace_dashboard no longer claims to be idempotent. base_version is optional and every save appends a version. - The auth middleware no longer reserves the retired /-/ prefix. - AGENTS.md states the conventions without pointing at private projects, adds id, pagination and annotation rules, and records the single-provider OIDC routes as an exception. BREAKING CHANGE: thread history JSON, the variable resolution route and the exemplar tool name change with no aliases. --- AGENTS.md | 17 ++-- cmd/fanout-docgen/routes_test.go | 2 +- docs/operations.md | 4 - internal/agent/runtime.go | 23 +++--- internal/agent/store.go | 8 +- internal/agent/store_test.go | 77 ++++++++++++++++++- internal/api/auth_middleware.go | 6 +- internal/api/auth_test.go | 12 +-- internal/api/panels.go | 2 +- internal/api/panels_test.go | 4 +- internal/mcp/apps/panels.html | 2 +- internal/mcp/dashboards.go | 2 +- internal/mcp/describe_test.go | 5 +- internal/mcp/fragment_contract_test.go | 2 +- internal/mcp/panels.go | 2 +- internal/mcp/server_test.go | 4 +- .../{chat-DjuGjU0o.js => chat-Dr6SwXRM.js} | 4 +- .../ui/dist/assets/chat._threadId-B2BwBfS8.js | 1 + .../ui/dist/assets/chat._threadId-B9WlrQOu.js | 1 - .../ui/dist/assets/chat.index-B2BwBfS8.js | 1 + .../ui/dist/assets/chat.index-B9WlrQOu.js | 1 - ...js => dashboards._dashboardId-eTWiXAiz.js} | 2 +- ...kT7wKS.js => dashboards.index-BtnZ9Vkj.js} | 2 +- .../{index-Nz8e3wJG.js => index-G9N3n5OB.js} | 6 +- ...-Bmuoa_GA.js => mcp-app-frame-BW8pt9vy.js} | 2 +- .../{page-zI1f8QoW.js => page-DclWQ-lK.js} | 2 +- ...tings-WD83lfky.js => settings-Civ3-rvD.js} | 2 +- .../{theme-C7oNnx5z.js => theme-BKAYKhPv.js} | 2 +- internal/ui/dist/index.html | 4 +- scripts/dashboard-eval/mock.ts | 2 +- .../content/docs/reference/http-routes.mdx | 8 +- site/src/content/docs/reference/mcp-tools.mdx | 44 +++++------ ui/host/e2e/smoke.spec.ts | 8 ++ ui/host/src/answer-only.test.tsx | 2 +- ui/host/src/app.test.tsx | 10 +-- ui/host/src/chat.test.tsx | 2 +- ui/host/src/dashboards/api.ts | 2 +- ui/host/src/dashboards/page.test.tsx | 14 ++-- ui/host/src/mcp-apps/transport.test.ts | 2 +- ui/host/src/mcp-apps/transport.ts | 2 +- ui/host/src/rail.test.tsx | 33 ++++++-- ui/host/src/rail.tsx | 22 +++--- 42 files changed, 230 insertions(+), 123 deletions(-) rename internal/ui/dist/assets/{chat-DjuGjU0o.js => chat-Dr6SwXRM.js} (99%) create mode 100644 internal/ui/dist/assets/chat._threadId-B2BwBfS8.js delete mode 100644 internal/ui/dist/assets/chat._threadId-B9WlrQOu.js create mode 100644 internal/ui/dist/assets/chat.index-B2BwBfS8.js delete mode 100644 internal/ui/dist/assets/chat.index-B9WlrQOu.js rename internal/ui/dist/assets/{dashboards._dashboardId-xbi0ey_r.js => dashboards._dashboardId-eTWiXAiz.js} (62%) rename internal/ui/dist/assets/{dashboards.index-CdkT7wKS.js => dashboards.index-BtnZ9Vkj.js} (55%) rename internal/ui/dist/assets/{index-Nz8e3wJG.js => index-G9N3n5OB.js} (97%) rename internal/ui/dist/assets/{mcp-app-frame-Bmuoa_GA.js => mcp-app-frame-BW8pt9vy.js} (99%) rename internal/ui/dist/assets/{page-zI1f8QoW.js => page-DclWQ-lK.js} (99%) rename internal/ui/dist/assets/{settings-WD83lfky.js => settings-Civ3-rvD.js} (99%) rename internal/ui/dist/assets/{theme-C7oNnx5z.js => theme-BKAYKhPv.js} (87%) diff --git a/AGENTS.md b/AGENTS.md index 76cb92edd..365da18c5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -97,9 +97,8 @@ v2026.9.5 ## API and MCP naming -Use the same naming conventions as Monk, Goal, Cipher, and ResponseKeeper -where the operations have the same meaning. Product-specific resources and -protocol-defined contracts keep their own semantics. +These are LabStack's shared API and MCP conventions. Product-specific +resources and protocol-defined contracts keep their own semantics. - Application HTTP routes use `/api`, lowercase words, meaningful slash-separated domains/resources/actions, and plural collections. Do not use hyphens in @@ -118,15 +117,23 @@ protocol-defined contracts keep their own semantics. - Equivalent authentication flows use `/api/auth/me`, `/api/auth/code/send`, `/api/auth/code/verify`, and `POST /api/auth/logout`. Flow selection, passkeys, account linking, and sign-in link verification are distinct operations. + OIDC sign-in uses `/api/auth/oidc/start` and `/api/auth/oidc/callback` without + a provider segment because Fanout supports exactly one configured provider. - Operational routes use `/healthz` for liveness, `/readyz` for readiness, and `/metrics` for Prometheus exposition. Preserve authorization requirements. - MCP tool names use verb-first snake_case and describe their behavior: `get`, `list`, `search`, `inspect`, `create`, `replace`, and domain actions. Full replacement uses `replace`, not `update`. Do not add product prefixes solely to avoid collisions in clients that aggregate servers. -- New product-owned JSON fields and query parameters use snake_case. Preserve - protocol-defined names, including MCP, OAuth, OTLP, and AG-UI fields. Existing +- MCP tool annotations must reflect actual read-only, destructive, and + idempotent behavior. +- Product-owned JSON fields and query parameters use snake_case; an entity's + own identifier is `id`. Preserve protocol-defined names, including MCP, + OAuth, OTLP, and AG-UI fields. Existing client-contract exceptions require a deliberate contract change. +- Cursor-paginated collections return `items` and `next_cursor` (null at the + end) and accept `page_size` and `cursor`. Unpaginated lists keep a named + array such as `dashboards` or `versions`. - Product CalVer, client-contract versions, and protocol versions are separate. Do not put the product release or maturity suffix in API paths or tool names. - Breaking naming changes update registrations, authorization classification, diff --git a/cmd/fanout-docgen/routes_test.go b/cmd/fanout-docgen/routes_test.go index 69b9785e1..75860a3ae 100644 --- a/cmd/fanout-docgen/routes_test.go +++ b/cmd/fanout-docgen/routes_test.go @@ -43,7 +43,7 @@ func TestCollectRoutesResolvesGroupPrefixes(t *testing.T) { relative := map[string]bool{ "/overview": true, "/topology": true, "/logs": true, "/trace": true, "/performance": true, - "/runs": true, "/threads": true, "/threads/:threadID": true, + "/runs": true, "/threads": true, "/threads/:id": true, } for _, r := range routes { if relative[r.Path] { diff --git a/docs/operations.md b/docs/operations.md index be52838b4..d1cac7cab 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -56,10 +56,6 @@ original host. - `/metrics` exposes Prometheus metrics. Keep it private or configure `FANOUT_METRICS_TOKEN`; do not make it public merely to simplify scraping. -When upgrading from a version that exposed `/-/metrics`, change Prometheus -`metrics_path` and any proxy rules to `/metrics`. The retired path returns 404 -even with a valid metrics token; it does not redirect. - Alert on repeated restarts, readiness failures, ingest authentication failures, telemetry drops, sustained query latency, and available disk space. Retention is controlled by `FANOUT_RETENTION_DAYS`; maintenance removes expired data on diff --git a/internal/agent/runtime.go b/internal/agent/runtime.go index 851f0e0b0..ef804e30a 100644 --- a/internal/agent/runtime.go +++ b/internal/agent/runtime.go @@ -63,9 +63,9 @@ func NewRuntime(provider Provider, tools toolExecutor, store *Store) *Runtime { func (r *Runtime) Register(group *echo.Group) { group.POST("/runs", r.Run) group.GET("/threads", r.ListThreads) - group.GET("/threads/:threadID", r.GetThread) - group.PATCH("/threads/:threadID", r.RenameThread) - group.DELETE("/threads/:threadID", r.DeleteThread) + group.GET("/threads/:id", r.GetThread) + group.PATCH("/threads/:id", r.RenameThread) + group.DELETE("/threads/:id", r.DeleteThread) } type threadCursor struct { @@ -79,10 +79,10 @@ func (r *Runtime) ListThreads(c *echo.Context) error { return ownerErr } limit := 30 - if raw := strings.TrimSpace(c.QueryParam("limit")); raw != "" { + if raw := strings.TrimSpace(c.QueryParam("page_size")); raw != "" { parsed, err := strconv.Atoi(raw) if err != nil || parsed < 1 || parsed > 100 { - return echo.NewHTTPError(http.StatusBadRequest, "limit must be between 1 and 100") + return echo.NewHTTPError(http.StatusBadRequest, "page_size must be between 1 and 100") } limit = parsed } @@ -106,7 +106,7 @@ func (r *Runtime) ListThreads(c *echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "failed to list threads").Wrap(err) } - nextCursor := "" + var nextCursor *string if len(items) > limit { items = items[:limit] last := items[len(items)-1] @@ -114,9 +114,10 @@ func (r *Runtime) ListThreads(c *echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "failed to paginate threads").Wrap(err) } - nextCursor = base64.RawURLEncoding.EncodeToString(encoded) + value := base64.RawURLEncoding.EncodeToString(encoded) + nextCursor = &value } - return c.JSON(http.StatusOK, map[string]any{"threads": items, "nextCursor": nextCursor}) + return c.JSON(http.StatusOK, map[string]any{"items": items, "next_cursor": nextCursor}) } func (r *Runtime) GetThread(c *echo.Context) error { @@ -124,7 +125,7 @@ func (r *Runtime) GetThread(c *echo.Context) error { if ownerErr != nil { return ownerErr } - thread, err := r.store.Thread(c.Request().Context(), ownerID, c.Param("threadID")) + thread, err := r.store.Thread(c.Request().Context(), ownerID, c.Param("id")) if errors.Is(err, ErrThreadNotFound) { return echo.NewHTTPError(http.StatusNotFound, "thread not found") } @@ -149,7 +150,7 @@ func (r *Runtime) RenameThread(c *echo.Context) error { if title == "" || len([]rune(title)) > 120 { return echo.NewHTTPError(http.StatusBadRequest, "thread title must be between 1 and 120 characters") } - if err := r.store.RenameThread(c.Request().Context(), ownerID, c.Param("threadID"), title); errors.Is(err, ErrThreadNotFound) { + if err := r.store.RenameThread(c.Request().Context(), ownerID, c.Param("id"), title); errors.Is(err, ErrThreadNotFound) { return echo.NewHTTPError(http.StatusNotFound, "thread not found") } else if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "failed to rename thread").Wrap(err) @@ -162,7 +163,7 @@ func (r *Runtime) DeleteThread(c *echo.Context) error { if ownerErr != nil { return ownerErr } - if err := r.store.DeleteThread(c.Request().Context(), ownerID, c.Param("threadID")); errors.Is(err, ErrThreadNotFound) { + if err := r.store.DeleteThread(c.Request().Context(), ownerID, c.Param("id")); errors.Is(err, ErrThreadNotFound) { return echo.NewHTTPError(http.StatusNotFound, "thread not found") } else if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "failed to delete thread").Wrap(err) diff --git a/internal/agent/store.go b/internal/agent/store.go index 834ac4699..eb8c1dfec 100644 --- a/internal/agent/store.go +++ b/internal/agent/store.go @@ -16,16 +16,16 @@ var ErrThreadNotFound = errors.New("agent thread not found") // Thread is a persisted agent conversation owned by one user. type Thread struct { - ThreadID string `json:"threadId"` + ThreadID string `json:"id"` Messages []agtypes.Message `json:"messages"` - Updated string `json:"updatedAt"` + Updated string `json:"updated_at"` } // ThreadSummary is the compact representation returned by conversation history. type ThreadSummary struct { - ThreadID string `json:"threadId"` + ThreadID string `json:"id"` Title string `json:"title"` - Updated string `json:"updatedAt"` + Updated string `json:"updated_at"` } // ThreadListOptions controls owner-scoped conversation history queries. diff --git a/internal/agent/store_test.go b/internal/agent/store_test.go index c76680b39..f92d94c0f 100644 --- a/internal/agent/store_test.go +++ b/internal/agent/store_test.go @@ -463,7 +463,7 @@ func TestThreadRouteHidesOtherOwnersThread(t *testing.T) { t.Fatalf("cross-owner thread read = %d, want 404", recorder.Code) } - request = httptest.NewRequest(http.MethodGet, "/api/agent/threads?q=owner&limit=1", nil) + request = httptest.NewRequest(http.MethodGet, "/api/agent/threads?q=owner&page_size=1", nil) request.AddCookie(cookie) recorder = httptest.NewRecorder() e.ServeHTTP(recorder, request) @@ -471,15 +471,84 @@ func TestThreadRouteHidesOtherOwnersThread(t *testing.T) { t.Fatalf("thread list = %d, want 200: %s", recorder.Code, recorder.Body.String()) } var page struct { - Threads []ThreadSummary `json:"threads"` - NextCursor string `json:"nextCursor"` + Items []ThreadSummary `json:"items"` + NextCursor *string `json:"next_cursor"` } if err := json.Unmarshal(recorder.Body.Bytes(), &page); err != nil { t.Fatal(err) } - if len(page.Threads) != 1 || page.Threads[0].ThreadID != "own-thread" || page.NextCursor != "" { + if len(page.Items) != 1 || page.Items[0].ThreadID != "own-thread" || page.NextCursor != nil { t.Fatalf("owner-scoped thread page = %#v", page) } + var wire map[string]json.RawMessage + if err := json.Unmarshal(recorder.Body.Bytes(), &wire); err != nil { + t.Fatal(err) + } + if len(wire) != 2 || string(wire["next_cursor"]) != "null" || wire["items"] == nil { + t.Fatalf("thread page JSON = %s", recorder.Body.String()) + } + var summaries []map[string]json.RawMessage + if err := json.Unmarshal(wire["items"], &summaries); err != nil { + t.Fatal(err) + } + if len(summaries[0]) != 3 || string(summaries[0]["id"]) != `"own-thread"` || summaries[0]["title"] == nil || summaries[0]["updated_at"] == nil { + t.Fatalf("thread summary JSON = %s", wire["items"]) + } + read := func(path string) *httptest.ResponseRecorder { + request := httptest.NewRequest(http.MethodGet, path, nil) + request.AddCookie(cookie) + recorder := httptest.NewRecorder() + e.ServeHTTP(recorder, request) + return recorder + } + threadResponse := read("/api/agent/threads/own-thread") + if threadResponse.Code != http.StatusOK { + t.Fatalf("own thread = %d: %s", threadResponse.Code, threadResponse.Body.String()) + } + wire = nil + if err := json.Unmarshal(threadResponse.Body.Bytes(), &wire); err != nil { + t.Fatal(err) + } + if len(wire) != 3 || string(wire["id"]) != `"own-thread"` || wire["messages"] == nil || wire["updated_at"] == nil { + t.Fatalf("thread JSON = %s", threadResponse.Body.String()) + } + for _, value := range []string{"0", "101", "invalid"} { + if response := read("/api/agent/threads?page_size=" + value); response.Code != http.StatusBadRequest { + t.Fatalf("page_size %q = %d, want 400", value, response.Code) + } + } + if _, err := store.StartRun(context.Background(), ownerB.ID, agtypes.RunAgentInput{ + ThreadID: "older-thread", RunID: "run-3", + Messages: []agtypes.Message{{ID: "message-2", Role: agtypes.RoleUser, Content: "Investigate another issue"}}, + }); err != nil { + t.Fatal(err) + } + if _, err := database.DB.Exec(`UPDATE agui_threads SET updated_at = '2026-10-01 00:00:00' WHERE owner_id = ?`, ownerB.ID); err != nil { + t.Fatal(err) + } + firstPage := read("/api/agent/threads?page_size=1") + if firstPage.Code != http.StatusOK { + t.Fatalf("first page = %d: %s", firstPage.Code, firstPage.Body.String()) + } + if err := json.Unmarshal(firstPage.Body.Bytes(), &page); err != nil { + t.Fatal(err) + } + if len(page.Items) != 1 || page.Items[0].ThreadID != "own-thread" || page.NextCursor == nil || *page.NextCursor == "" { + t.Fatalf("first thread page = %#v", page) + } + lastPage := read("/api/agent/threads?page_size=1&cursor=" + *page.NextCursor) + if lastPage.Code != http.StatusOK { + t.Fatalf("last page = %d: %s", lastPage.Code, lastPage.Body.String()) + } + if err := json.Unmarshal(lastPage.Body.Bytes(), &page); err != nil { + t.Fatal(err) + } + if len(page.Items) != 1 || page.Items[0].ThreadID != "older-thread" || page.NextCursor != nil { + t.Fatalf("last thread page = %#v", page) + } + if response := read("/api/agent/threads?cursor=invalid"); response.Code != http.StatusBadRequest { + t.Fatalf("invalid cursor = %d, want 400", response.Code) + } mutation := func(method, path, body string) *httptest.ResponseRecorder { request := httptest.NewRequest(method, path, strings.NewReader(body)) diff --git a/internal/api/auth_middleware.go b/internal/api/auth_middleware.go index 475147193..dec32bf0c 100644 --- a/internal/api/auth_middleware.go +++ b/internal/api/auth_middleware.go @@ -292,7 +292,7 @@ func classifyRoute(method, path string) (routePolicy, bool) { } case strings.HasPrefix(path, "/api/alerting/rules/"): return routePolicy{kind: routePolicyCapability, capability: ManageAlerts}, unsafe - case path == "/api/panels/query" || path == "/api/panels/exemplars" || path == "/api/variables/resolve" || path == "/api/annotations": + case path == "/api/panels/query" || path == "/api/panels/exemplars" || path == "/api/panels/variables/resolve" || path == "/api/annotations": return routePolicy{kind: routePolicyCapability, capability: ReadTelemetry}, method == http.MethodPost case path == "/api/telemetry/schema": return routePolicy{kind: routePolicyCapability, capability: ReadTelemetry}, read @@ -317,14 +317,14 @@ func classifyRoute(method, path string) (routePolicy, bool) { action == "access/revoke" && method == http.MethodPost return routePolicy{kind: routePolicyCapability, capability: ManageUsers}, allowed case path == "/" || path == "/favicon.ico" || path == "/favicon.svg" || - (!strings.HasPrefix(path, "/api/") && !strings.HasPrefix(path, "/debug/") && !strings.HasPrefix(path, "/-/") && path != "/metrics"): + (!strings.HasPrefix(path, "/api/") && !strings.HasPrefix(path, "/debug/") && path != "/metrics"): return routePolicy{kind: routePolicyPublic}, read } return routePolicy{}, false } func isProtectedPath(path string) bool { - return strings.HasPrefix(path, "/api/") || strings.HasPrefix(path, "/debug/") || strings.HasPrefix(path, "/-/") || path == "/metrics" + return strings.HasPrefix(path, "/api/") || strings.HasPrefix(path, "/debug/") || path == "/metrics" } func routePathKnown(path string) bool { diff --git a/internal/api/auth_test.go b/internal/api/auth_test.go index 787b84717..43a99eb63 100644 --- a/internal/api/auth_test.go +++ b/internal/api/auth_test.go @@ -133,7 +133,6 @@ func TestRetiredRoutesDoNotReachSPA(t *testing.T) { {http.MethodPost, "/api/agent"}, {http.MethodPost, "/api/users/" + admin.ID + "/logout-all"}, {http.MethodPost, "/api/settings/ingest/rotate-token"}, - {http.MethodGet, "/-/metrics"}, } { t.Run(route.method+" "+route.path, func(t *testing.T) { rec := httptest.NewRecorder() @@ -175,6 +174,7 @@ func TestRoutePolicyClassification(t *testing.T) { {http.MethodGet, "/api/dashboards/dashboard-1/versions/1", routePolicyCapability, ManageOwnDashboards}, {http.MethodPost, "/api/dashboards/dashboard-1/versions/1/restore", routePolicyCapability, ManageOwnDashboards}, {http.MethodPost, "/api/agent/runs", routePolicyCapability, RunAgent}, + {http.MethodPost, "/api/panels/variables/resolve", routePolicyCapability, ReadTelemetry}, {http.MethodGet, "/api/settings/ingest", routePolicyCapability, ReadIngestMetadata}, {http.MethodPost, "/api/settings/ingest/token/rotate", routePolicyCapability, ManageIngest}, {http.MethodPost, "/api/users/user-1/access/revoke", routePolicyCapability, ManageUsers}, @@ -222,19 +222,19 @@ func TestUnknownProtectedPathsReturn404BeforeAuthentication(t *testing.T) { } } -func TestRetiredMetricsReturns404ForScrapers(t *testing.T) { +func TestMetricsRequiresValidScraperToken(t *testing.T) { s := newTestAuthServerWith(t, config.Config{AuthMode: "local", MetricsToken: "metrics-test-token"}, auth.SMTPConfig{}) s.e.GET("/metrics", func(c *echo.Context) error { return c.NoContent(http.StatusNoContent) }) s.e.GET("/*", func(c *echo.Context) error { return c.String(http.StatusOK, "SPA") }) - for _, token := range []string{"", "wrong", "metrics-test-token"} { - req := httptest.NewRequest(http.MethodGet, "/-/metrics", nil) + for _, token := range []string{"", "wrong"} { + req := httptest.NewRequest(http.MethodGet, "/metrics", nil) if token != "" { req.Header.Set("Authorization", "Bearer "+token) } rec := httptest.NewRecorder() s.e.ServeHTTP(rec, req) - if rec.Code != http.StatusNotFound { - t.Fatalf("retired metrics = %d, want 404", rec.Code) + if rec.Code != http.StatusUnauthorized { + t.Fatalf("metrics with invalid token = %d, want 401", rec.Code) } } req := httptest.NewRequest(http.MethodGet, "/metrics", nil) diff --git a/internal/api/panels.go b/internal/api/panels.go index 77c18838c..b79377874 100644 --- a/internal/api/panels.go +++ b/internal/api/panels.go @@ -31,7 +31,7 @@ func RegisterPanelRoutes(e *echo.Echo, engine PanelEngine) { read := RequireCapability(ReadTelemetry) e.POST("/api/panels/query", h.query, read) e.POST("/api/panels/exemplars", h.exemplars, read) - e.POST("/api/variables/resolve", h.resolve, read) + e.POST("/api/panels/variables/resolve", h.resolve, read) e.GET("/api/telemetry/schema", h.schema, read) } diff --git a/internal/api/panels_test.go b/internal/api/panels_test.go index 54d1a0fbc..919006d07 100644 --- a/internal/api/panels_test.go +++ b/internal/api/panels_test.go @@ -94,7 +94,7 @@ func TestPanelQueryOperationalErrors(t *testing.T) { } func TestVariableAndSchemaRoutes(t *testing.T) { - rec := servePanels(t, &fakePanels{}, http.MethodPost, "/api/variables/resolve", `{"dashboard":{"name":"x","panels":[]}}`) + rec := servePanels(t, &fakePanels{}, http.MethodPost, "/api/panels/variables/resolve", `{"dashboard":{"name":"x","panels":[]}}`) if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), `"checkout"`) { t.Fatalf("resolve %d %s", rec.Code, rec.Body) } @@ -107,7 +107,7 @@ func TestVariableAndSchemaRoutes(t *testing.T) { func TestPanelRoutesAreClassified(t *testing.T) { for _, tc := range []struct{ method, path string }{ {http.MethodPost, "/api/panels/query"}, - {http.MethodPost, "/api/variables/resolve"}, + {http.MethodPost, "/api/panels/variables/resolve"}, {http.MethodGet, "/api/telemetry/schema"}, } { policy, ok := classifyRoute(tc.method, tc.path) diff --git a/internal/mcp/apps/panels.html b/internal/mcp/apps/panels.html index 1724d7195..b85bb45d7 100644 --- a/internal/mcp/apps/panels.html +++ b/internal/mcp/apps/panels.html @@ -110,7 +110,7 @@ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=wSe(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}o$.peek=DSe;function o$(e){return e.value||``}function DSe(){return`<`}s$.peek=OSe;function s$(e,t,n,r){let i=i$(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function OSe(){return`!`}c$.peek=kSe;function c$(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function kSe(){return`!`}l$.peek=ASe;function l$(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}d$.peek=jSe;function d$(e,t,n,r){let i=i$(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(u$(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function jSe(e,t,n){return u$(e,n)?`<`:`[`}f$.peek=MSe;function f$(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function MSe(){return`[`}function p$(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function NSe(e){let t=p$(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function PSe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function m$(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function FSe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?PSe(n):p$(n),s=e.ordered?o===`.`?`)`:`.`:NSe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),m$(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function RSe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function zSe(e,t,n,r){if(!e.children.some(function(e){return dSe(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function BSe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}h$.attention=VSe,h$.peek=HSe;function h$(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function VSe(e,t){return{construct:`strong`,markers:BSe(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function HSe(e,t,n){return n.options.strong||`*`}function USe(e,t,n,r){return n.safe(e.value,r)}function WSe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function GSe(e,t,n){let r=(m$(n)+(n.options.ruleSpaces?` `:``)).repeat(WSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var g$={blockquote:fSe,break:r$,code:vSe,definition:bSe,emphasis:a$,hardBreak:r$,heading:ESe,html:o$,image:s$,imageReference:c$,inlineCode:l$,link:d$,linkReference:f$,list:FSe,listItem:LSe,paragraph:RSe,root:zSe,strong:h$,text:USe,thematicBreak:GSe};function KSe(){return{enter:{table:qSe,tableData:v$,tableHeader:v$,tableRow:YSe},exit:{codeText:XSe,table:JSe,tableData:_$,tableHeader:_$,tableRow:_$}}}function qSe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function JSe(e){this.exit(e),this.data.inTable=void 0}function YSe(e){this.enter({type:`tableRow`,children:[]},e)}function _$(e){this.exit(e)}function v$(e){this.enter({type:`tableCell`,children:[]},e)}function XSe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ZSe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ZSe(e,t){return t===`|`?t:e}function QSe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return lSe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hCe={tokenize:CCe,partial:!0};function gCe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bCe,continuation:{tokenize:xCe},exit:SCe}},text:{91:{name:`gfmFootnoteCall`,tokenize:yCe},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_Ce,resolveTo:vCe}}}}function _Ce(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=pZ(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vCe(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yCe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||yZ(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(pZ(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return yZ(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bCe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||yZ(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=pZ(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return yZ(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),TZ(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xCe(e,t,n){return e.check(PZ,t,e.attempt(hCe,t,n))}function SCe(e){e.exit(`gfmFootnoteDefinition`)}function CCe(e,t,n){let r=this;return TZ(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wCe(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=AZ(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var TCe=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){ECe(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function ECe(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function DCe(e,t){let n=!1,r=[];for(;t-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):vZ(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):bZ(t)?TZ(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||yZ(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,bZ(t)?TZ(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return bZ(t)?TZ(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||vZ(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return bZ(t)?TZ(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||vZ(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||vZ(n)?(e.exit(`tableRow`),t(n)):bZ(n)?TZ(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||yZ(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function ACe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new TCe;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},I$(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function F$(e,t,n,r,i){let a=[],o=I$(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function I$(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var jCe={name:`tasklistCheck`,tokenize:NCe};function MCe(){return{text:{91:jCe}}}function NCe(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return yZ(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return vZ(r)?t(r):bZ(r)?e.check({tokenize:PCe},t,n)(r):n(r)}}function PCe(e,t,n){return TZ(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function FCe(e){return dZ([oCe(),gCe(),wCe(e),OCe(),MCe()])}var ICe={};function LCe(e){let t=this,n=e||ICe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(FCe(n)),a.push(rCe()),o.push(iCe(n))}function RCe({panel:e}){return(0,R.jsx)(`div`,{className:`panel-markdown`,children:(0,R.jsx)(xxe,{remarkPlugins:[LCe],skipHtml:!0,disallowedElements:[`img`],components:{a:({children:e,...t})=>(0,R.jsx)(`a`,{...t,target:`_blank`,rel:`noopener noreferrer`,children:e})},children:e.content??``})})}function L$(e,t,n,r,i,a,o={width:500,height:248}){if(![`timeseries`,`heatmap`,`state_timeline`].includes(t.viz))return e;let s=n.annotation_scope;if(n.annotation_error)return e;let c=e=>!s||s.services.some(t=>t.service===e.service&&(t.namespace===e.namespace||e.namespace===``&&!s.namespace_scoped)),l=n.from_ms??-1/0,u=n.to_ms??1/0,d=r.deploys.filter(c).filter(e=>Date.parse(e.at)>=l&&Date.parse(e.at)({xAxis:Date.parse(e.at),name:`${e.service} ${e.version}`,label:{show:!1},symbol:[`none`,`path://M0,0 L0,-6`],symbolSize:[1,6],lineStyle:{type:`dashed`,color:a.muted,width:1},tooltip:{formatter:()=>Oy(`${e.service} · ${e.version} · ${e.at}`)}})),f=[];for(let e of r.anomalies.filter(c).filter(e=>Date.parse(e.to)>l&&Date.parse(e.from)e.namespace.localeCompare(t.namespace)||e.service.localeCompare(t.service)||Date.parse(e.from)-Date.parse(t.from))){let t=Math.max(l,Date.parse(e.from)),n=Math.min(u,Date.parse(e.to)),r=`${e.title} (${e.kind}) · ${e.from} – ${e.to}`,i=Oy(`${e.service} · ${e.title} · ${e.severity} · ${e.kind} · ${e.from} – ${e.to}`),a=f.at(-1);a&&a.service===e.service&&a.namespace===e.namespace&&t<=a.to?(a.to=Math.max(a.to,n),a.count++,a.labels.includes(r)||a.labels.push(r),a.details.includes(i)||a.details.push(i)):f.push({service:e.service,namespace:e.namespace,from:t,to:n,labels:[r],details:[i],count:1})}let p=f.map(e=>[{xAxis:e.from,name:e.labels.join(` · `),itemStyle:{color:a.status.warn,opacity:a.dark?.12:.09},label:{show:!1},tooltip:{formatter:()=>(e.count>1?`${e.count} windows\n`:``)+e.details.join(` -`)}},{xAxis:e.to}]),m=e.series??[];if(!m.length)return e;let h=e.grid??{},g=Array.isArray(e.yAxis)?e.yAxis[0]:e.yAxis,_=h.containLabel?(g?.axisLabel?.width??64)+(g?.axisLabel?.margin??8):0,v=(typeof h.left==`number`?h.left:8)+_,y=o.width-(typeof h.right==`number`?h.right:16),b=Math.max(1,y-v),x=e=>o.measureText?.(e,`12px ${a.font}`)??e.length*12,S=e.legend,C=0;for(let e of S?.data??[]){let t=15+x(S?.formatter?.(e)??e);if(C&&C+(S?.itemGap??6)+t>o.width)break;C+=(C?S?.itemGap??6:0)+t}let w=[...p.length?[{text:`anomaly`,details:p.map(e=>e[0].tooltip.formatter()).join(`
`)}]:[],...[...d].sort((e,t)=>e.xAxis-t.xAxis).map(e=>({text:e.name,details:e.tooltip.formatter()}))],T=w.reduce((e,t)=>e+x(t.text)+12,0),E=!!(S?.show&&T<=o.width-16-C-12),D=E?o.width-16-C-12:b,O=0,k=w.filter(e=>{let t=x(e.text)+12;return O+t>D?!1:(O+=t,!0)}),A=(typeof h.top==`number`?h.top:8)+(k.length&&!E?18:0),j=E?1:A-17,M=E?16:typeof h.right==`number`?h.right:16,N=k.map(e=>{let t=x(e.text),n={type:`text`,right:M,top:j,annotation:!0,style:{text:e.text,fill:a.muted,backgroundColor:a.surface,padding:[1,3],fontSize:11,fontFamily:a.font,width:t,stroke:a.surface,lineWidth:3},tooltip:{formatter:()=>e.details}};return M+=t+12,n}),P=e=>e?.type===`value`||e?.type===`log`?{...e,...xy(e,o.height-A-Number(h.bottom??8)-22),axisLabel:{...e.axisLabel,hideOverlap:!0}}:e,F=Array.isArray(e.yAxis)?e.yAxis.map(P):e.yAxis?P(e.yAxis):void 0,ee=m,te=[...e.graphic??[],...N];if(t.viz===`state_timeline`&&F&&!Array.isArray(F)){let e=F.data,t=Math.max(1,Math.floor((o.height-A-Number(h.bottom??8)-22)/16));if(e.length>t){F={...F,data:e.slice(0,t)},ee=m.map(e=>({...e,data:e.data.filter(e=>e.value[1]e.style?.text?.match(/^\+\d+ rows$/)),r=e.length-t+Number(n?.style.text.match(/\d+/)?.[0]??0);te=te.filter(e=>e!==n),te.push({type:`text`,right:0,bottom:0,style:{text:`+${r} rows`,fill:a.muted,fontSize:11,fontFamily:a.font},tooltip:{formatter:()=>e.slice(t).map(Oy).join(`
`)+(n?`
`+n.tooltip.formatter():``)}})}}return{...e,...d.length||p.length?{tooltip:{...e.tooltip??{},renderMode:`html`}}:{},grid:{...h,top:A},...F?{yAxis:F}:{},graphic:te,series:ee.map((e,t)=>{if(t!==0)return e;let n=e.markLine??{},r=e.markArea??{};return{...e,markLine:{...n,silent:!1,symbol:[`none`,`none`],data:[...n.data??[],...d]},markArea:{...r,silent:!1,data:[...r.data??[],...p]}}})}}function zCe({panel:e,title:t=e.title,result:n,dark:r,height:i,group:a,annotations:o,vars:s,onSelect:c,onPoint:l,onZoom:u,onRangePending:d}){let f=(0,A.useMemo)(()=>t=>{let i=By(r),a=bre(e,n,i,t);return o?L$(a,e,n,o,s??{},i,t):a},[e,n.frame,n.previous,n.shift_ms,n.from_ms,n.to_ms,n.annotation_scope,n.annotation_error,r,o]),p=(0,A.useMemo)(()=>f({width:500,height:i}),[f,i]),m=(0,A.useCallback)(t=>!!eb(e,n,t),[e,n]);return(0,R.jsx)(pX,{keyboard:{canSelect:m,interval:n.interval,onRangePending:d,bounds:n.from_ms!==void 0&&n.to_ms!==void 0?{from:n.from_ms,to:n.to_ms}:void 0},option:p,optionForSize:f,height:i,label:`${t}: time series`,group:a,onZoom:u,onClick:l||c?t=>{let r=eb(e,n,t);if(!r)return;l?.(r);let i=Object.values(r.dimensions)[0];i!==void 0&&c?.(i)}:void 0})}function BCe(e){return e.dark?[`#0f2a43`,`#164267`,`#1e5a8a`,`#2879ae`,`#399aca`,`#57b8e3`,`#7dd3fc`]:[`#dbeafe`,`#bfdbfe`,`#93c5fd`,`#60a5fa`,`#3b82f6`,`#2563eb`,`#1d4ed8`]}function R$(e,t){return e<=1?0:e>=t?6:Math.max(0,Math.min(6,Math.floor(Math.log10(Math.max(1,e))/Math.log10(t)*6)))}var z$={healthy:`●`,degraded:`■`,unhealthy:`◆`,unknown:`○`},B$=(e,t)=>et);function V$(e,t={}){let n=new Map(e.columns.map((e,t)=>[e.name,t])),r=(t,r)=>e.values[n.get(t)??-1]?.[r],i=(e,t)=>String(r(e,t)??``),a=(e,t)=>{let n=r(e,t);return typeof n==`number`&&Number.isFinite(n)?n:null},o=t.from_ms!==void 0&&t.to_ms!==void 0&&t.to_ms>t.from_ms?(t.to_ms-t.from_ms)/1e3:void 0,s=e=>o&&e!==null?e/o:null,c=new Map,l=[];for(let t=0;t=5?`bad`:c>=1?`warn`:null})}for(let e of l)for(let t of[e.caller,e.callee])c.has(t)||c.set(t,{id:t,health:`unknown`,spans:null,p95_ms:null,error_rate:null,request_rate:null});return{nodes:[...c.values()].sort((e,t)=>B$(e.id,t.id)),edges:l.sort((e,t)=>B$(e.id,t.id))}}function VCe(e){let t=e=>typeof e==`number`&&Number.isFinite(e)?e:null,n=(e,t)=>{let n=Math.max(0,Math.min(1,e/100)),r=3.8416;return Math.max(0,(n+r/(2*t)-1.96*Math.sqrt(n*(1-n)/t+r/(4*t*t)))/(1+r/t))};return e.filter(e=>typeof e.service==`string`).map(e=>{let r=Math.max(0,t(e.spans)??0),i=t(e.error_rate),a=r>=20&&i!==null;return{name:String(e.service),health:String(e.health??`unknown`),n:r,eligible:a,score:a?n(i,r):0,metric:i===null?`—`:`${i.toFixed(1)}%`}}).sort((e,t)=>Number(t.eligible)-Number(e.eligible)||(e.eligible?t.score-e.score:0)||t.n-e.n||B$(e.name,t.name)).slice(0,4)}function HCe(e){let t=/^(\d+)(s|m|h|d)$/.exec(e??``);return t?Number(t[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[t[2]]:6e4}var H$=(e,t)=>fre(typeof e.bucket_lower==`number`?e.bucket_lower:null,typeof e.bucket_upper==`number`?e.bucket_upper:null,t),U$=e=>`${e.bucket_lower}:${e.bucket_upper}`,W$=e=>typeof e?.bucket_lower==`number`?{lower:e.bucket_lower,upper:typeof e.bucket_upper==`number`?e.bucket_upper:void 0}:void 0,UCe=e=>e>=1e3&&e<1e6&&e%1e3==0?`${e/1e3}k`:hy(`count`,e);function WCe(e){let t=[];for(let n of[...e].sort((e,t)=>Number(e.value[1])-Number(t.value[1])||Number(e.value[0])-Number(t.value[0]))){let e=t.at(-1);e&&e.value[1]===n.value[1]&&e.value[4]===n.value[4]&&e.value[3]===n.value[0]?(e.value[3]=n.value[3],e.selection.to=n.selection.to):t.push({...n,value:[...n.value],selection:{...n.selection}})}return t}function G$(e,t){return(e.bucket_lower===null?-1/0:Number(e.bucket_lower))-(t.bucket_lower===null?-1/0:Number(t.bucket_lower))||(e.bucket_upper===null?1/0:Number(e.bucket_upper))-(t.bucket_upper===null?1/0:Number(t.bucket_upper))}function K$(e,t){let n=(t.frame?.columns??[]).map(e=>e.name+(e.unit?` (${e.unit})`:``)).join(`, `);return`${e.title}: ${t.frame?.rows??0} rows; ${n}${t.frame?.truncated?`, limited data`:``}`}function GCe(e,t,n,r={width:500,height:248}){let i=t.frame??{columns:[],values:[],rows:0},a=R_(i),o=i.columns.filter(e=>e.role===`dimension`).map(e=>e.name),s=i.columns.filter(e=>e.role===`measure`),c=e.unit??i.columns.find(e=>e.name===`bucket_lower`)?.unit,l={animation:!1,aria:{enabled:!0,description:K$(e,t)},textStyle:{fontFamily:n.font,color:n.text},grid:{left:70,right:24,top:30,bottom:40,containLabel:!0},tooltip:{trigger:`item`,backgroundColor:n.surface,borderColor:n.border,textStyle:{color:n.text,fontFamily:n.font,fontSize:12},renderMode:`html`,formatter:Ay(t=>hy(e.unit,t))},legend:{show:!1,textStyle:{color:n.muted}},xAxis:{type:`value`,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11},splitLine:{lineStyle:{color:n.grid}}},yAxis:{type:`value`,splitNumber:vy(r.height-92),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11},splitLine:{lineStyle:{color:n.grid}}},series:[]};if(e.viz===`scatter`){let t=o[0],i=o[1],c=My([...new Set(a.map(e=>i?String(e[i]??``):`Items`))].map(e=>({name:e})),e),u=Fy(c.map(e=>e.name),r.width,c.length>1&&e.options?.legend!==`hidden`,n.text,n.font,r.measureText),d=e.options?.x_scale??e.options?.scale,f=e.options?.y_scale??e.options?.scale,p=e.x_unit??s[0]?.unit,m=e.unit??s[1]?.unit,h=(e,t,r,i)=>{let o=a.map(e=>e[r]).filter(e=>typeof e==`number`&&Number.isFinite(e)),s=Math.min(0,...o),c=Math.max(0,...o);return{type:t===`log`?`log`:`value`,...t===`log`?{splitNumber:vy(i)}:by(s,c,e,i),axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},splitLine:{lineStyle:{color:n.grid}},axisLabel:{fontFamily:n.font,fontSize:11,color:n.muted,formatter:gy(e),hideOverlap:!0}}};return{...l,tooltip:{...l.tooltip,formatter:e=>(Array.isArray(e)?e:[e]).map(e=>{let t=Array.isArray(e.value)?e.value:[];return ky([`${e.seriesName??``} · ${e.name??``}`,`${s[0]?.name??`x`}: ${hy(p,Number(t[0]))}`,`${s[1]?.name??`y`}: ${hy(m,Number(t[1]))}`])}).join(`
`)},legend:u.option,grid:{...l.grid,top:u.option.show?u.top+20:28,left:8,right:16,bottom:32},xAxis:{...h(p,d,s[0]?.name,r.width-80),name:s[0]?.name??`x`,nameLocation:`middle`,nameGap:28,nameTextStyle:{color:n.muted,fontFamily:n.font,fontSize:11,align:`right`,verticalAlign:`top`}},yAxis:{...h(m,f,s[1]?.name,r.height-u.top-74),name:s[1]?.name??`y`,nameLocation:`end`,nameGap:8,nameRotate:0,nameTextStyle:{color:n.muted,fontFamily:n.font,fontSize:11,align:`right`,verticalAlign:`bottom`}},series:c.map(({name:r,items:c},l)=>({type:`scatter`,name:r,interactive:!0,keyboard_unit:m,keyboard_x_unit:p,itemStyle:Ry(jy(r)?n.muted:i_(l,n.dark),n),data:a.filter(e=>!i||c.some(t=>t.name===String(e[i]??``))).filter(e=>typeof e[s[0]?.name]==`number`&&typeof e[s[1]?.name]==`number`).filter(e=>(d!==`log`||Number(e[s[0].name])>0)&&(f!==`log`||Number(e[s[1].name])>0)).map(n=>({name:String(n[t]??``),value:[n[s[0].name],n[s[1].name]],selection:{dimensions:Object.fromEntries((e.query?.by??[]).map((e,t)=>[e,String(n[o[t]]??``)]))}}))}))}}if(e.viz===`histogram`){let t=o.find(e=>e!==`bucket_lower`&&e!==`bucket_upper`),i=[...new Map([...a].sort(G$).map(e=>[U$(e),e])).values()],s=i.map(e=>H$(e,c)),u=My([...new Set(a.map(e=>t?String(e[t]??``):`Count`))].map(e=>({name:e})),e),d=Fy(u.map(e=>e.name),r.width,u.length>1&&e.options?.legend!==`hidden`,n.text,n.font,r.measureText),f=u.map(({name:r,items:o},s)=>({type:`bar`,name:r,interactive:!0,keyboard_unit:`count`,itemStyle:Ry(jy(r)?n.muted:i_(s,n.dark),n),data:i.map(n=>{let i=a.filter(e=>(!t||o.some(n=>n.name===String(e[t]??``)))&&U$(e)===U$(n));return{value:_re(i.map(e=>typeof e.count==`number`?e.count:null))??0,selection:{dimensions:t?{[e.query?.by?.[0]??t]:r}:{},bucket:W$(i[0])}}})}));return{...l,legend:d.option,grid:{...l.grid,left:16,right:8,top:d.option.show?d.top+20:28,bottom:8},xAxis:{...l.xAxis,type:`category`,data:s,splitLine:{show:!1}},yAxis:{...l.yAxis,type:`value`,name:`count`,nameLocation:`end`,nameGap:8,nameRotate:0,...by(0,Math.max(0,...f.flatMap(e=>e.data.map(e=>e.value))),`count`,r.height-(d.option.show?d.top+20:28)-30),axisLabel:{...l.yAxis.axisLabel,hideOverlap:!0},nameTextStyle:{color:n.muted,fontFamily:n.font,fontSize:11,align:`right`,verticalAlign:`bottom`}},series:f}}if(e.viz===`service_map`)return{model:V$(i,t)};if(e.viz===`heatmap`||e.viz===`state_timeline`){let i=e.viz===`heatmap`,u=o[0],d=e=>i?U$(e):String(e[u]??``),f=[...new Set((i?[...a].sort(G$):a).map(d))],p=i?f:f.slice(0,Math.max(1,Math.floor((r.height-54)/16))),m=f.slice(p.length),h=new Map(a.map(e=>[U$(e),H$(e,c)])),g=HCe(t.interval),_=s[0]?.name??`count`,v=a.filter(e=>typeof e.time==`number`&&p.includes(d(e))).map(r=>{let a=r[_],o=typeof a==`number`?uy(a,e.thresholds,e.better??t.better)??`ok`:null;return{value:[r.time,p.indexOf(d(r)),a,Number(r.time)+g,i||o===null?0:o===`bad`?3:o===`warn`?2:1],selection:{...i?{time:r.time}:{},dimensions:i?{}:{[e.query?.by?.[0]??u]:String(r[u]??``)},bucket:i?W$(r):void 0,...i?{}:{from:new Date(Number(r.time)).toISOString(),to:new Date(Number(r.time)+g).toISOString()}},itemStyle:i?void 0:{color:o===null?`${n.text}26`:n.status[o]}}}),y=v.filter(e=>Number.isFinite(Number(e.value[2]))&&Number(e.value[2])>0),b=y.map(e=>Number(e.value[2])).sort((e,t)=>e-t),x=b[Math.max(0,Math.ceil(b.length*.99)-1)]??1,S=BCe(n),C=i?y.map(e=>({...e,value:[...e.value,R$(Number(e.value[2]),x)]})):WCe(v).map(e=>({...e,tooltip:{formatter:()=>`${Oy(p[Number(e.value[1])])} · ${[`Unknown`,`OK`,`Warn`,`Bad`][Number(e.value[4])]}\n${Cy(Number(e.value[0]))} – ${Cy(Number(e.value[3]))}`}})),w=UCe(b.length?x:0);return{...l,grid:{...l.grid,left:8,right:8,top:8,bottom:i?32:m.length?24:8},tooltip:{...l.tooltip,trigger:`axis`,formatter:t=>(Array.isArray(t)?t:[t]).map(t=>{let n=Array.isArray(t.value)?t.value:[];return ky([`${t.seriesName??``} · ${t.name??``}`,i?h.get(p[Number(n[1])])??``:p[Number(n[1])]??``,`${Cy(Number(n[0]))} – ${Cy(Number(n[3]))}`,`${_}: ${hy(i?`count`:e.unit??s[0]?.unit,typeof n[2]==`number`?n[2]:null)}`])}).join(`
`)},axisPointer:{link:[{xAxisIndex:`all`}]},xAxis:{type:`time`,min:t.from_ms,max:t.to_ms,axisPointer:{show:!0},axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{fontFamily:n.font,fontSize:11,color:n.muted,formatter:Sy,hideOverlap:!0}},yAxis:{type:`category`,data:i?p.map(e=>h.get(e)):p,axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{fontFamily:n.font,fontSize:11,color:n.muted,width:140,overflow:`truncate`,...i?{interval:+((r.height-60)/Math.max(1,p.length)<12),hideOverlap:!0}:{interval:0}}},visualMap:i?{type:`continuous`,show:!0,orient:`horizontal`,right:16,bottom:0,padding:0,itemWidth:8,itemHeight:96,text:[w,b.length?`1`:`0`],textGap:10,textStyle:{color:n.muted,fontFamily:n.font,fontSize:11},min:0,max:6,dimension:5,inRange:{color:S}}:void 0,graphic:!i&&m.length?[{type:`text`,right:0,bottom:0,style:{text:`+${m.length} rows`,fill:n.muted,fontSize:11,fontFamily:n.font},tooltip:{formatter:()=>m.map(Oy).join(`
`)}}]:[],series:[{type:`custom`,clip:!0,name:e.title,interactive:!0,keyboard_unit:i?`count`:e.unit??s[0]?.unit,encode:{x:[0,3],y:1,tooltip:2},data:C,renderItem:(e,t)=>{let n=t.coord([t.value(0),t.value(1)]),r=t.coord([t.value(3),t.value(1)]),a=Math.abs(t.size([0,1])[1])*(i?1:.65),o=i&&Math.abs(r[0]-n[0])>=8?1:0;if(!i||t.value(2)>0)return{type:`rect`,shape:{x:n[0]+o/2,y:n[1]-a/2+o/2,width:Math.max(0,r[0]-n[0]-o),height:Math.max(0,a-o),r:i?0:Math.min(3,a/4)},style:{fill:t.visual(`color`),stroke:void 0,lineWidth:0,...i?{fill:S[R$(t.value(2),x)]}:{}}}}}]}}return l}function q$({panel:e,title:t,result:n,dark:r,height:i,group:a,annotations:o,vars:s,onSelect:c,onPoint:l,onZoom:u,onRangePending:d}){let f=(0,A.useMemo)(()=>t=>{let i=By(r),a=GCe(e,n,i,t);return o?L$(a,e,n,o,s??{},i,t):a},[e,n.frame,n.interval,n.better,n.from_ms,n.to_ms,n.annotation_scope,n.annotation_error,r,o]),p=K$(t?{...e,title:t}:e,n),m=(0,A.useMemo)(()=>f({width:500,height:i}),[f,i]),h=(0,A.useCallback)(t=>!!(t.data?.selection&&eb(e,n,t)),[e,n]),g=e.viz===`heatmap`||e.viz===`state_timeline`;return(0,R.jsx)(pX,{keyboard:{canSelect:h,onRangePending:d,bounds:g&&n.from_ms!==void 0&&n.to_ms!==void 0?{from:n.from_ms,to:n.to_ms}:void 0},option:m,optionForSize:f,height:i,label:p,group:g?a:void 0,onZoom:g?u:void 0,onClick:l||c?t=>{let r=h(t)?eb(e,n,t):void 0;if(r){l?.(r);let e=Object.values(r.dimensions)[0];e!==void 0&&c?.(e)}}:void 0})}function KCe(e){return(0,R.jsx)(q$,{...e})}function qCe(e){return(0,R.jsx)(q$,{...e})}function JCe(e){return(0,R.jsx)(q$,{...e})}function YCe(e){return(0,R.jsxs)(dh,{gap:4,style:{flex:`1 1 auto`,minHeight:0},children:[(0,R.jsx)(q$,{...e,height:Math.max(60,e.height-24)}),(0,R.jsx)(yl,{gap:`sm`,wrap:`nowrap`,role:`list`,"aria-label":`State legend`,style:{flexShrink:0},children:[[`● OK`,`ok`],[`■ Warn`,`warn`],[`◆ Bad`,`bad`],[`○ Unknown`,`dimmed`]].map(([t,n])=>(0,R.jsx)(Dd,{size:`xs`,style:{color:n===`dimmed`?By(e.dark).muted:zy(n,e.dark)},role:`listitem`,children:t},t))})]})}var J$=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,'(function(){var e=Object.defineProperty,t=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,n=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},r=(e,n,r)=>t(e,typeof n==`symbol`?n:n+``,r),i={};n(i,{Graph:()=>D,alg:()=>_});var a=Object.defineProperty,o=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},s=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\\0`,this._children[e]={},this._children[`\\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\\0`)return t}}children(e=`\\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,l=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,l=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,l=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let f=u(this._isDirected,i,a,o);if(f in this._edgeLabels)return l&&(this._edgeLabels[f]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[f]=l?s:this._defaultEdgeLabelFn(i,a,o);let p=d(this._isDirected,i,a,o);return i=p.v,a=p.w,Object.freeze(p),this._edgeObjs[f]=p,c(this._preds[a],i),c(this._sucs[i],a),this._in[a][f]=p,this._out[i][f]=p,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],l(this._preds[t],e),l(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function c(e,t){e[t]?e[t]++:e[t]=1}function l(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function u(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\\0`:r)}function d(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function f(e,t){return u(e,t.v,t.w,t.name)}o({},{read:()=>g,write:()=>p});function p(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:m(e),edges:h(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function m(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function h(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function g(e){let t=new s(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var _={};o(_,{CycleException:()=>w,bellmanFord:()=>y,components:()=>x,dijkstra:()=>C,dijkstraAll:()=>ne,findCycles:()=>ie,floydWarshall:()=>oe,isAcyclic:()=>ce,postorder:()=>de,preorder:()=>fe,prim:()=>pe,shortestPaths:()=>me,tarjan:()=>re,topsort:()=>T});var v=()=>1;function y(e,t,n,r){return b(e,String(t),n||v,r||function(t){return e.outEdges(t)??[]})}function b(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+oe.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n>1,!(t[r].priority1;function C(e,t,n,r){return te(e,String(t),n||ee,r||function(t){return e.outEdges(t)??[]})}function te(e,t,n,r){let i={},a=new S,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function ne(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=C(e,i,t,n),r},{})}function re(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ie(e){return re(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var ae=()=>1;function oe(e,t,n){return se(e,t||ae,n||function(t){return e.outEdges(t)??[]})}function se(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=E(e,t,n===`post`,o,a,r,i)}),i}function E(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=E(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function ue(e,t,n){return le(e,t,n,function(e,t){return e.push(t),e},[])}function de(e,t){return ue(e,t,`post`)}function fe(e,t){return ue(e,t,`pre`)}function pe(e,t){var n;let r=new s,i={},a=new S,o;function c(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(u)throw Error(`Input graph is not connected: `+e);u=!0}(n=e.nodeEdges(o))==null||n.forEach(c)}return r}function me(e,t,n,r){return he(e,t,n,r??(t=>e.outEdges(t)??[]))}function he(e,t,n,r){if(n===void 0)return C(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function _e(e){let t=new D({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function ve(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function k(e){let t=F(N(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function ye(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=M(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function be(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=M(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function A(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),O(e,`border`,i,t)}function xe(e,t=j){let n=[];for(let r=0;rj?e(...xe(t).map(t=>e(...t))):e(...t)}function N(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return M(Math.max,t)}function Se(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ce(e,t){return t()}var we=0;function P(e){return e+(``+ ++we)}function F(e,t,n=1){t??(t=e,e=0);let r=e=>ete[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Te(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var R=`\\0`;function z(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var Ee=class{constructor(){r(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return B(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&B(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,De)),n=n._prev;return`[`+e.join(`, `)+`]`}};function B(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function De(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Oe=Ee,ke=()=>1;function Ae(e,t){if(e.nodeCount()<=1)return[];let n=Me(e,t||ke);return je(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function je(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)V(e,t,n,o);for(;o=i.dequeue();)V(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(V(e,t,n,o,!0)||[]);break}}}return r}function V(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,H(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,H(t,n,o)}),e.removeNode(r.v),o}function Me(e,t){let n=new D,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Ne(i+r+3).map(()=>new Oe),o=r+1;return n.nodes().forEach(e=>{H(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function H(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Ne(e){let t=[];for(let n=0;n{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,P(`rev`))});function n(e){return t=>e.edge(t).weight}}function Fe(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Le(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Ie(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Le(e,t,n){let r=/* @__PURE__ */ new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Re(e){e.graph().dummyChains=[],e.edges().forEach(t=>ze(e,t))}function ze(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function U(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=M(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function W(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ve=He;function He(e){let t=new D({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;Ue(t,e){let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!W(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function We(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=W(t,r)),it.node(e).rank+=n)}var{preorder:Ke,postorder:qe}=_,Je=G;G.initLowLimValues=q,G.initCutValues=K,G.calcCutValue=Xe,G.leaveEdge=Qe,G.enterEdge=$e,G.exchangeEdges=et;function G(e){e=ge(e),U(e);let t=Ve(e);q(t),K(t,e);let n,r;for(;n=Qe(t);)r=$e(t,e,n),et(t,e,n,r)}function K(e,t){let n=qe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>Ye(e,t,n))}function Ye(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Xe(e,t,n)}function Xe(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,nt(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function q(e,t){arguments.length<2&&(t=e.nodes()[0]),Ze(e,{},1,t)}function Ze(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Ze(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Qe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function $e(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===rt(e,e.node(t.v),s)&&c!==rt(e,e.node(t.w),s)).reduce((e,n)=>W(t,n)!e.node(t).parent);if(!n)return;let r=Ke(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function nt(e,t,n){return e.hasEdge(t,n)}function rt(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var it=at;function at(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:ct(e);break;case`tight-tree`:st(e);break;case`longest-path`:ot(e);break;case`none`:break;default:ct(e)}}var ot=U;function st(e){U(e),Ve(e)}function ct(e){Je(e)}var lt=ut;function ut(e){let t=ft(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=dt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRanko||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function ft(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(R).forEach(r),t}function pt(e){let t=O(e,`root`,{},`_root`),n=mt(e),r=Object.values(n),i=M(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=ht(e)+1;e.children(R).forEach(r=>{J(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function J(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=A(e,`_bt`),l=A(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{J(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function mt(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(R).forEach(e=>n(e,1)),t}function ht(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function gt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var _t=vt;function vt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;tCt(e.node(t))),e.edges().forEach(t=>Ct(e.edge(t)))}function Ct(e){let t=e.width;e.width=e.height,e.height=t}function wt(e){e.nodes().forEach(t=>Y(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Y),Object.hasOwn(r,`y`)&&Y(r)})}function Y(e){e.y=-e.y}function Tt(e){e.nodes().forEach(t=>X(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(X),Object.hasOwn(r,`x`)&&X(r)})}function X(e){let t=e.x;e.x=e.y,e.y=t}function Et(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=F(M(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return z(t,e.node(n),e.node(r))}return a}function Dt(e,t){let n=0;for(let r=1;rt)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function kt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function At(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),jt(Object.values(n).filter(e=>!e.indegree))}function jt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Mt(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>I(e,[`vs`,`i`,`barycenter`,`weight`]))}function Mt(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Nt(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Se(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(Ft(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Pt(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Pt(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Pt(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Ft(e,t,n){return(r,i)=>{if(r.barycenteri.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=z(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function It(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=kt(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=It(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&Rt(t,r)}});let h=At(m,n);Lt(h,p);let g={},_=!1;for(let t=0;t{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Rt(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function zt(e,t,n,r){r||=e.nodes();let i=Bt(e),a=new D({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Bt(e){let t;for(;e.hasNode(t=P(`_root`)););return t}function Vt(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Ht(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Ht);return}let r=N(e),i=Ut(e,F(1,r+1),`inEdges`),a=Ut(e,F(r-1,-1,-1),`outEdges`),o=Et(e,n);if(Gt(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){Wt(t%2?i:a,t%4>=2,l,n),o=k(e);let u=Dt(e,o);u{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return zt(e,t,n,r.get(t)||[])})}function Wt(e,t,n,r){let i=!0,a=new D;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=It(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),Vt(e,a,s.vs)})}function Gt(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Kt(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Jt(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.ordero)&&Yt(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Jt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Yt(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Xt(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Zt(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||sn(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>sn(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function $t(e,t,n,r){let i=new D,a=e.graph(),o=an(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function en(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=on(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-M(Math.min,c);a!==`l`&&(l=i-M(Math.max,c)),l&&(e[o]=L(s,e=>e+l))})})}function nn(e,t=void 0){let n=e.ul;return n?L(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function rn(e,t){let n=k(e),r=Object.assign(Kt(e,n),qt(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=Zt(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=Qt(e,a,s.root,s.align,n===`r`);n===`r`&&(c=L(c,e=>-e)),i[o+n]=c})}),tn(i,en(e,i)),nn(i,e.graph().align)}function an(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function on(e,t){return e.node(t).width}function sn(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function cn(e,t){e=_e(e),ln(e),Object.entries(rn(e,t)).forEach(([t,n])=>e.node(t).x=n)}function ln(e){let t=k(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var un=/* @__PURE__ */ new WeakMap;function dn(e,t={}){return pn(e,Ce,t),e}function fn(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function pn(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new D({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=/* @__PURE__ */ new Set;e.edges().forEach(t=>{let n=fn(e,t.v,r),i=fn(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),pn(o,t,n);let l=wn(o);mn(l,t,n,null),hn(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=/* @__PURE__ */ new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=/* @__PURE__ */ new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=/* @__PURE__ */ new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=/* @__PURE__ */ new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=wn(e),g=mn(h,t,n,un.get(e)??null);un.set(e,g),hn(e,h),m.forEach(t=>{let n=t.indexOf(`\\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function mn(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>Tn(e)),t(` removeSelfEdges`,()=>Pn(e)),t(` acyclic`,()=>Pe(e,s)),t(` nestingGraph.run`,()=>pt(e)),t(` rank`,()=>it(_e(e))),t(` injectEdgeLabelProxies`,()=>En(e)),t(` removeEmptyRanks`,()=>be(e)),t(` nestingGraph.cleanup`,()=>gt(e)),t(` normalizeRanks`,()=>ye(e)),t(` assignRankMinMax`,()=>Dn(e)),t(` removeEdgeLabelProxies`,()=>On(e)),t(` normalize.run`,()=>Re(e)),t(` parentDummyChains`,()=>lt(e)),t(` addBorderSegments`,()=>_t(e)),t(` order`,()=>Ht(e,n,c)),t(` insertSelfEdges`,()=>Fn(e)),t(` adjustCoordinateSystem`,()=>bt(e)),t(` position`,()=>cn(e,n.corePath)),t(` positionSelfEdges`,()=>In(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>Nn(e)),t(` normalize.undo`,()=>Be(e)),t(` fixupEdgeLabelCoords`,()=>jn(e)),t(` undoCoordinateSystem`,()=>xt(e)),t(` translateGraph`,()=>kn(e)),t(` assignNodeIntersects`,()=>An(e)),t(` reversePoints`,()=>Mn(e)),t(` acyclic.undo`,()=>Ie(e)),{graph:e,rawNodes:l}}function hn(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var gn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],_n={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},vn=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],yn=[`width`,`height`,`rank`],bn={width:0,height:0},xn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Sn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Cn=[`labelpos`];function wn(e){let t=new D({multigraph:!0,compound:!0}),n=Q(e.graph());return t.setGraph(Object.assign({},_n,Z(n,gn),I(n,vn))),e.nodes().forEach(n=>{let r=Z(Q(e.node(n)),yn);Object.keys(bn).forEach(e=>{r[e]===void 0&&(r[e]=bn[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Q(e.edge(n));t.setEdge(n,Object.assign({},Sn,Z(r,xn),I(r,Cn)))}),t}function Tn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function En(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);O(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Dn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function On(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function kn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function An(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(ve(r,a)),n.points.push(ve(i,o))})}function jn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Mn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Nn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Pn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Fn(e){k(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{O(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function In(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function Z(e,t){return L(I(e,t),Number)}function Q(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}\n/*! For license information please see dagre.esm.js.LEGAL.txt */\nlet Ln={healthy:`●`,degraded:`■`,unhealthy:`◆`,unknown:`○`};new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),new Intl.NumberFormat(`en`,{maximumFractionDigits:2});let Rn={micro:11,small:12,body:14,title:16,section:22,page:32},zn={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},$=(e,t)=>et),Bn=(Rn.micro+2)/20;function Vn(e,t){let n=Object.create(null);for(let r of e.nodes)n[r.id]={full:qn(r,!1,t),compact:qn(r,!0,t)};let r=Object.entries(n).sort(([e],[t])=>$(e,t)),i=JSON.stringify([r.map(([e])=>e),e.edges.map(e=>[e.id,e.caller,e.callee]).sort((e,t)=>$(e[0],t[0]))]);return{key:JSON.stringify([i,r]),topology:i,widths:n}}function Hn(e,t,n){let r=n??Vn(e,t.measureText).widths;return{...Un(e,r,!0),full:Un(e,r,!1)}}function Un(e,t,n){let r=[...e.nodes].sort((e,t)=>$(e.id,t.id)),a=[...e.edges].sort((e,t)=>$(e.id,t.id)),o=new Set(a.flatMap(e=>[e.caller,e.callee])),s=new Set(a.map(e=>e.callee)),c=new Set(a.map(e=>e.caller)),l=new i.Graph({directed:!0,multigraph:!0});l.setDefaultEdgeLabel(()=>({}));let u=n?20:44;l.setGraph({rankdir:`LR`,ranker:`network-simplex`,acyclicer:`greedy`,ranksep:n?16:32,nodesep:n?4:8,edgesep:n?2:8,marginx:0,marginy:0});let d=new Map(r.map(e=>[e.id,t[e.id][n?`compact`:`full`]]));for(let e of r)o.has(e.id)&&l.setNode(e.id,{width:d.get(e.id),height:u});for(let e of a)l.setEdge(e.caller,e.callee,{weight:1,minlen:1},e.id);l.nodeCount()&&dn(l);let f=r.filter(e=>o.has(e.id)).map(e=>({...e,x:l.node(e.id).x-d.get(e.id)/2,y:l.node(e.id).y-u/2,width:d.get(e.id),height:u,entry:c.has(e.id)&&!s.has(e.id),uncalled:!1})),p=a.map(e=>l.edge(e.caller,e.callee,e.id).points),m=r.filter(e=>!o.has(e.id)),h=m.reduce((e,t)=>e+d.get(t.id)+12,0)-(m.length?12:0),g=m.length?Wn(`No traced calls in this window`,`12px ${zn.display}`):0,_=Math.max(1,l.graph().width??0,h,g),v=(_-h)/2,y=Math.max(0,l.graph().height??0,...p.flat().map(e=>e.y),...f.map(e=>e.y+e.height)),b=y+(y?40:24);for(let e of m)f.push({...e,x:v,y:b,width:d.get(e.id),height:u,entry:!1,uncalled:!0}),v+=d.get(e.id)+12;let x=(_-(l.graph().width??0))/2;for(let e of f)e.uncalled||(e.x+=x);for(let e of p)for(let t of e)t.x+=x;let S=new Map(f.map(e=>[e.id,e]));for(let[e,t]of a.entries()){let n=S.get(t.caller),r=S.get(t.callee),i=p[e].slice(1,-1);if(!i.length||n===r)continue;let a=n.xArray.from(e).length*Number(t.match(/([\\d.]+)px/)?.[1]??11)*.6,Gn=e=>Array.from(e).length>24?Array.from(e).slice(0,24).join(``)+`…`:e,Kn=/* @__PURE__ */ new WeakMap;function qn(e,t,n){let r=n??Wn,i=Kn.get(r);i||(i=/* @__PURE__ */ new Map,Kn.set(r,i));let a=`600 ${t?Rn.micro/Bn:12}px ${zn.display}`,o=i.get(a);o===void 0&&(o=Math.max(...Object.values(Ln).map(e=>r(e,a))),i.set(a,o));let s=t?Math.ceil(16/Bn)+1:20;return Math.ceil(Math.max(t?0:168,r(Gn(e.id),a)+o+s))}self.onmessage=e=>{let{model:t,size:n,widths:r}=e.data;self.postMessage(Hn(t,n,r))}})();'],{type:`text/javascript;charset=utf-8`});function XCe(e){let t;try{if(t=J$&&(self.URL||self.webkitURL).createObjectURL(J$),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(e){throw e}}var Y$=Object.defineProperty,ZCe=(e,t,n)=>t in e?Y$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QCe=(e,t)=>{for(var n in t)Y$(e,n,{get:t[n],enumerable:!0})},$Ce=(e,t,n)=>ZCe(e,typeof t==`symbol`?t:t+``,n),X$={};QCe(X$,{Graph:()=>f1,alg:()=>r1});var ewe=Object.defineProperty,Z$=(e,t)=>{for(var n in t)ewe(e,n,{get:t[n],enumerable:!0})},Q$=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=t1(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=twe(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,$$(this._preds[a],i),$$(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?n1(this._isDirected,e):t1(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?n1(this._isDirected,e):t1(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?n1(this._isDirected,e):t1(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],e1(this._preds[t],e),e1(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function $$(e,t){e[t]?e[t]++:e[t]=1}function e1(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function t1(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function twe(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function n1(e,t){return t1(e,t.v,t.w,t.name)}Z$({},{read:()=>awe,write:()=>nwe});function nwe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:rwe(e),edges:iwe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function rwe(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function iwe(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function awe(e){let t=new Q$(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var r1={};Z$(r1,{CycleException:()=>c1,bellmanFord:()=>i1,components:()=>cwe,dijkstra:()=>o1,dijkstraAll:()=>dwe,findCycles:()=>fwe,floydWarshall:()=>mwe,isAcyclic:()=>gwe,postorder:()=>vwe,preorder:()=>ywe,prim:()=>bwe,shortestPaths:()=>xwe,tarjan:()=>s1,topsort:()=>l1});var owe=()=>1;function i1(e,t,n,r){return swe(e,String(t),n||owe,r||function(t){return e.outEdges(t)??[]})}function swe(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+oe.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n>1,!(t[r].priority1;function o1(e,t,n,r){return uwe(e,String(t),n||lwe,r||function(t){return e.outEdges(t)??[]})}function uwe(e,t,n,r){let i={},a=new a1,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function dwe(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=o1(e,i,t,n),r},{})}function s1(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function fwe(e){return s1(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var pwe=()=>1;function mwe(e,t,n){return hwe(e,t||pwe,n||function(t){return e.outEdges(t)??[]})}function hwe(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=u1(e,t,n===`post`,o,a,r,i)}),i}function u1(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=u1(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function d1(e,t,n){return _we(e,t,n,function(e,t){return e.push(t),e},[])}function vwe(e,t){return d1(e,t,`post`)}function ywe(e,t){return d1(e,t,`pre`)}function bwe(e,t){var n;let r=new Q$,i={},a=new a1,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function xwe(e,t,n,r){return Swe(e,t,n,r??(t=>e.outEdges(t)??[]))}function Swe(e,t,n,r){if(n===void 0)return o1(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function m1(e){let t=new f1({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function h1(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function g1(e){let t=S1(b1(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function wwe(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=y1(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Twe(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=y1(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function _1(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),p1(e,`border`,i,t)}function Ewe(e,t=v1){let n=[];for(let r=0;rv1?e(...Ewe(t).map(t=>e(...t))):e(...t)}function b1(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return y1(Math.max,t)}function Dwe(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Owe(e,t){return t()}var kwe=0;function x1(e){return e+(``+ ++kwe)}function S1(e,t,n=1){t??(t=e,e=0);let r=e=>ete[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Awe(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var T1=`\0`;function E1(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var jwe=class{constructor(){$Ce(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return D1(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&D1(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Mwe)),n=n._prev;return`[`+e.join(`, `)+`]`}};function D1(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Mwe(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Nwe=jwe,Pwe=()=>1;function Fwe(e,t){if(e.nodeCount()<=1)return[];let n=Lwe(e,t||Pwe);return Iwe(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Iwe(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)O1(e,t,n,o);for(;o=i.dequeue();)O1(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(O1(e,t,n,o,!0)||[]);break}}}return r}function O1(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,k1(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,k1(t,n,o)}),e.removeNode(r.v),o}function Lwe(e,t){let n=new f1,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Rwe(i+r+3).map(()=>new Nwe),o=r+1;return n.nodes().forEach(e=>{k1(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function k1(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Rwe(e){let t=[];for(let n=0;n{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,x1(`rev`))});function n(e){return t=>e.edge(t).weight}}function Bwe(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Hwe(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Vwe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Hwe(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Uwe(e){e.graph().dummyChains=[],e.edges().forEach(t=>Wwe(e,t))}function Wwe(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function A1(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=y1(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function j1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var M1=Kwe;function Kwe(e){let t=new f1({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;qwe(t,e){let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!j1(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Jwe(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=j1(t,r)),it.node(e).rank+=n)}var{preorder:Xwe,postorder:Zwe}=r1,Qwe=N1;N1.initLowLimValues=I1,N1.initCutValues=P1,N1.calcCutValue=F1,N1.leaveEdge=R1,N1.enterEdge=z1,N1.exchangeEdges=B1;function N1(e){e=Cwe(e),A1(e);let t=M1(e);I1(t),P1(t,e);let n,r;for(;n=R1(t);)r=z1(t,e,n),B1(t,e,n,r)}function P1(e,t){let n=Zwe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>$we(e,t,n))}function $we(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=F1(e,t,n)}function F1(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,tTe(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function I1(e,t){arguments.length<2&&(t=e.nodes()[0]),L1(e,{},1,t)}function L1(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=L1(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function R1(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function z1(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===V1(e,e.node(t.v),s)&&c!==V1(e,e.node(t.w),s)).reduce((e,n)=>j1(t,n)!e.node(t).parent);if(!n)return;let r=Xwe(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function tTe(e,t,n){return e.hasEdge(t,n)}function V1(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var nTe=rTe;function rTe(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:H1(e);break;case`tight-tree`:aTe(e);break;case`longest-path`:iTe(e);break;case`none`:break;default:H1(e)}}var iTe=A1;function aTe(e){A1(e),M1(e)}function H1(e){Qwe(e)}var oTe=sTe;function sTe(e){let t=lTe(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=cTe(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRanko||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function lTe(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(T1).forEach(r),t}function uTe(e){let t=p1(e,`root`,{},`_root`),n=dTe(e),r=Object.values(n),i=y1(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=fTe(e)+1;e.children(T1).forEach(r=>{U1(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function U1(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=_1(e,`_bt`),l=_1(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{U1(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function dTe(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(T1).forEach(e=>n(e,1)),t}function fTe(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function pTe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var mTe=hTe;function hTe(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;tK1(e.node(t))),e.edges().forEach(t=>K1(e.edge(t)))}function K1(e){let t=e.width;e.width=e.height,e.height=t}function vTe(e){e.nodes().forEach(t=>q1(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(q1),Object.hasOwn(r,`y`)&&q1(r)})}function q1(e){e.y=-e.y}function yTe(e){e.nodes().forEach(t=>J1(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(J1),Object.hasOwn(r,`x`)&&J1(r)})}function J1(e){let t=e.x;e.x=e.y,e.y=t}function bTe(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=S1(y1(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return E1(t,e.node(n),e.node(r))}return a}function xTe(e,t){let n=0;for(let r=1;rt)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function CTe(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function wTe(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),TTe(Object.values(n).filter(e=>!e.indegree))}function TTe(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&ETe(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>C1(e,[`vs`,`i`,`barycenter`,`weight`]))}function ETe(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function DTe(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Dwe(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(OTe(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Y1(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Y1(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Y1(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function OTe(e,t,n){return(r,i)=>{if(r.barycenteri.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=E1(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function X1(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=CTe(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=X1(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&ATe(t,r)}});let h=wTe(m,n);kTe(h,p);let g={},_=!1;for(let t=0;t{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function ATe(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function jTe(e,t,n,r){r||=e.nodes();let i=MTe(e),a=new f1({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function MTe(e){let t;for(;e.hasNode(t=x1(`_root`)););return t}function NTe(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Z1(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Z1);return}let r=b1(e),i=Q1(e,S1(1,r+1),`inEdges`),a=Q1(e,S1(r-1,-1,-1),`outEdges`),o=bTe(e,n);if($1(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){PTe(t%2?i:a,t%4>=2,l,n),o=g1(e);let u=xTe(e,o);u{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return jTe(e,t,n,r.get(t)||[])})}function PTe(e,t,n,r){let i=!0,a=new f1;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=X1(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),NTe(e,a,s.vs)})}function $1(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function FTe(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=LTe(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.ordero)&&e0(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function LTe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function e0(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function RTe(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function zTe(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||t0(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>t0(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function VTe(e,t,n,r){let i=new f1,a=e.graph(),o=KTe(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function HTe(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=qTe(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-y1(Math.min,c);a!==`l`&&(l=i-y1(Math.max,c)),l&&(e[o]=w1(s,e=>e+l))})})}function WTe(e,t=void 0){let n=e.ul;return n?w1(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function GTe(e,t){let n=g1(e),r=Object.assign(FTe(e,n),ITe(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=zTe(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=BTe(e,a,s.root,s.align,n===`r`);n===`r`&&(c=w1(c,e=>-e)),i[o+n]=c})}),UTe(i,HTe(e,i)),WTe(i,e.graph().align)}function KTe(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function qTe(e,t){return e.node(t).width}function t0(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function JTe(e,t){e=m1(e),YTe(e),Object.entries(GTe(e,t)).forEach(([t,n])=>e.node(t).x=n)}function YTe(e){let t=g1(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var n0=new WeakMap;function XTe(e,t={}){return i0(e,Owe,t),e}function r0(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function i0(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new f1({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=r0(e,t.v,r),i=r0(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),i0(o,t,n);let l=c0(o);a0(l,t,n,null),o0(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=c0(e),g=a0(h,t,n,n0.get(e)??null);n0.set(e,g),o0(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function a0(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>iEe(e)),t(` removeSelfEdges`,()=>pEe(e)),t(` acyclic`,()=>zwe(e,s)),t(` nestingGraph.run`,()=>uTe(e)),t(` rank`,()=>nTe(m1(e))),t(` injectEdgeLabelProxies`,()=>aEe(e)),t(` removeEmptyRanks`,()=>Twe(e)),t(` nestingGraph.cleanup`,()=>pTe(e)),t(` normalizeRanks`,()=>wwe(e)),t(` assignRankMinMax`,()=>oEe(e)),t(` removeEdgeLabelProxies`,()=>sEe(e)),t(` normalize.run`,()=>Uwe(e)),t(` parentDummyChains`,()=>oTe(e)),t(` addBorderSegments`,()=>mTe(e)),t(` order`,()=>Z1(e,n,c)),t(` insertSelfEdges`,()=>mEe(e)),t(` adjustCoordinateSystem`,()=>gTe(e)),t(` position`,()=>JTe(e,n.corePath)),t(` positionSelfEdges`,()=>hEe(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>fEe(e)),t(` normalize.undo`,()=>Gwe(e)),t(` fixupEdgeLabelCoords`,()=>uEe(e)),t(` undoCoordinateSystem`,()=>_Te(e)),t(` translateGraph`,()=>cEe(e)),t(` assignNodeIntersects`,()=>lEe(e)),t(` reversePoints`,()=>dEe(e)),t(` acyclic.undo`,()=>Vwe(e)),{graph:e,rawNodes:l}}function o0(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var ZTe=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],QTe={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},$Te=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],eEe=[`width`,`height`,`rank`],s0={width:0,height:0},tEe=[`minlen`,`weight`,`width`,`height`,`labeloffset`],nEe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},rEe=[`labelpos`];function c0(e){let t=new f1({multigraph:!0,compound:!0}),n=u0(e.graph());return t.setGraph(Object.assign({},QTe,l0(n,ZTe),C1(n,$Te))),e.nodes().forEach(n=>{let r=l0(u0(e.node(n)),eEe);Object.keys(s0).forEach(e=>{r[e]===void 0&&(r[e]=s0[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=u0(e.edge(n));t.setEdge(n,Object.assign({},nEe,l0(r,tEe),C1(r,rEe)))}),t}function iEe(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function aEe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);p1(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function oEe(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function sEe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function cEe(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function lEe(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(h1(r,a)),n.points.push(h1(i,o))})}function uEe(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function dEe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function fEe(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function pEe(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function mEe(e){g1(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{p1(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function hEe(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function l0(e,t){return w1(C1(e,t),Number)}function u0(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}var d0=(e,t)=>et),f0=(e,t,n)=>Math.min(n,Math.max(t,e)),p0=20,gEe=44,m0=(zg.micro+2)/p0;function h0(e,t){let n=Object.create(null);for(let r of e.nodes)n[r.id]={full:C0(r,!1,t),compact:C0(r,!0,t)};let r=Object.entries(n).sort(([e],[t])=>d0(e,t)),i=JSON.stringify([r.map(([e])=>e),e.edges.map(e=>[e.id,e.caller,e.callee]).sort((e,t)=>d0(e[0],t[0]))]);return{key:JSON.stringify([i,r]),topology:i,widths:n}}function _Ee(e,t,n){let r=n??h0(e,t.measureText).widths;return{...g0(e,r,!0),full:g0(e,r,!1)}}function g0(e,t,n){let r=[...e.nodes].sort((e,t)=>d0(e.id,t.id)),i=[...e.edges].sort((e,t)=>d0(e.id,t.id)),a=new Set(i.flatMap(e=>[e.caller,e.callee])),o=new Set(i.map(e=>e.callee)),s=new Set(i.map(e=>e.caller)),c=new X$.Graph({directed:!0,multigraph:!0});c.setDefaultEdgeLabel(()=>({}));let l=n?p0:gEe;c.setGraph({rankdir:`LR`,ranker:`network-simplex`,acyclicer:`greedy`,ranksep:n?16:32,nodesep:n?4:8,edgesep:n?2:8,marginx:0,marginy:0});let u=new Map(r.map(e=>[e.id,t[e.id][n?`compact`:`full`]]));for(let e of r)a.has(e.id)&&c.setNode(e.id,{width:u.get(e.id),height:l});for(let e of i)c.setEdge(e.caller,e.callee,{weight:1,minlen:1},e.id);c.nodeCount()&&XTe(c);let d=r.filter(e=>a.has(e.id)).map(e=>({...e,x:c.node(e.id).x-u.get(e.id)/2,y:c.node(e.id).y-l/2,width:u.get(e.id),height:l,entry:s.has(e.id)&&!o.has(e.id),uncalled:!1})),f=i.map(e=>c.edge(e.caller,e.callee,e.id).points),p=r.filter(e=>!a.has(e.id)),m=p.reduce((e,t)=>e+u.get(t.id)+12,0)-(p.length?12:0),h=p.length?b0(`No traced calls in this window`,`12px ${Bg.display}`):0,g=Math.max(1,c.graph().width??0,m,h),_=(g-m)/2,v=Math.max(0,c.graph().height??0,...f.flat().map(e=>e.y),...d.map(e=>e.y+e.height)),y=v+(v?40:24);for(let e of p)d.push({...e,x:_,y,width:u.get(e.id),height:l,entry:!1,uncalled:!0}),_+=u.get(e.id)+12;let b=(g-(c.graph().width??0))/2;for(let e of d)e.uncalled||(e.x+=b);for(let e of f)for(let t of e)t.x+=b;let x=new Map(d.map(e=>[e.id,e]));for(let[e,t]of i.entries()){let n=x.get(t.caller),r=x.get(t.callee),i=f[e].slice(1,-1);if(!i.length||n===r)continue;let a=n.x{let r=e.nodes.filter(e=>e.uncalled);if(!r.length)return e;let i=Math.max(1,n.width-24)/t,a=[[]],o=0;for(let e of r)o&&o+12+e.width>i&&(a.push([]),o=0),a.at(-1).push(e),o+=(o?12:0)+e.width;let s=a.map(e=>e.reduce((e,t)=>e+t.width,0)+(e.length-1)*12),c=e.nodes.filter(e=>!e.uncalled),l=e.routes.flat(),u=Math.min(...c.map(e=>e.x),...l.map(e=>e.x)),d=c.length?Math.max(...c.map(e=>e.x+e.width),...l.map(e=>e.x))-u:0,f=Math.max(d,e.labelWidth,...s),p=c.length?(f-d)/2-u:0,m=c.map(e=>({...e,x:e.x+p}));return a.forEach((e,t)=>{let n=(f-s[t])/2;for(let i of e)m.push({...i,x:n,y:r[0].y+t*(i.height+12)}),n+=i.width+12}),{...e,nodes:m,routes:e.routes.map(e=>e.map(e=>({...e,x:e.x+p}))),width:f,height:Math.max(...m.map(e=>e.y+e.height))}},i=e=>{let t=e.routes.flat(),r=Math.min(0,...t.map(e=>e.x)),i=Math.min(0,...t.map(e=>e.y)),a=Math.max(e.width,...t.map(e=>e.x))-r,o=Math.max(e.height,...t.map(e=>e.y))-i,s=Math.max(0,...e.routes.flat().map(e=>e.y),...e.nodes.filter(e=>!e.uncalled).map(e=>e.y+e.height)),c=e.nodes.find(e=>e.uncalled)?.y,l=c===void 0?0:c-s,u=c===void 0?0:32;return{minX:r,minY:i,width:a,height:o,scale:Math.min(Math.max(1,n.width-24)/a,Math.max(1,n.height-24-u)/Math.max(1,o-l)),graphBottom:s,rowY:c,gap:l,lane:u}},a=r(e.full,1),o=i(a).scale<1,s=o?r(e,m0):a,{minX:c,minY:l,width:u,height:d,scale:f,graphBottom:p,rowY:m,gap:h,lane:g}=i(s),_=Math.max(o?m0:1,Math.min(f,1)),v=(d-h)*_+g,y=Math.max(n.width,u*_+24),b=Math.max(n.height,v+24),x=(y-u*_)/2,S=(b-v)/2,C=e=>({x:x+(e.x-c)*_,y:S+(e.y-l)*_+(m!==void 0&&e.y>=m?g-h*_:0)}),w=new Map(t.nodes.map(e=>[e.id,e])),T=s.nodes.map(e=>({...e,...w.get(e.id),...C(e),width:e.width*_,height:e.height*_})),E=[...t.edges].sort((e,t)=>d0(e.id,t.id)).map((e,t)=>{let n=s.routes[t].map(C),r=n.map((e,t)=>`${t?`L`:`M`}${e.x},${e.y}`).join(` `);return{...e,points:n,path:r}}),D=T.find(e=>e.entry)??T[0];return{nodes:T,edges:E,scale:_,compact:o,initialView:D?{x:f0(n.width/2-D.x-D.width/2,n.width-y,0),y:f0(n.height/2-D.y-D.height/2,n.height-b,0)}:{x:0,y:0},contentWidth:y,contentHeight:b,uncalledLabel:s.label?{x:(y-s.labelWidth)/2,y:S+(p-l)*_+8}:void 0}}var _0=e=>`${hy(`per_second`,e.request_rate)} · ${hy(`percent`,e.error_rate)} err · ${hy(`ms`,e.p95_ms)} p95`,v0=e=>{if(e===null||!Number.isFinite(e))return`—`;let t=f0(e,0,999e3);return t>0&&t<.01?`<0.01`:t>=1e3?`${Math.min(999,Math.round(t/1e3))}K`:String(Number(t.toFixed(t<1?2:+(t<10))))},y0=e=>e===null||!Number.isFinite(e)?`— err`:`${Number((e>0?f0(e,.1,100):0).toFixed(1))}% err`,yEe=e=>e===null?`—`:Number(e.toPrecision(2))>=1e3?`${v0(e/1e3)}s`:`${v0(e)}ms`,b0=(e,t)=>Array.from(e).length*Number(t.match(/([\d.]+)px/)?.[1]??11)*.6,x0=e=>Array.from(e).length>24?Array.from(e).slice(0,24).join(``)+`…`:e;function bEe(e,{width:t,scale:n,compact:r=!1,measureText:i}){let a=Math.max(12,zg.micro/n),o=zg.micro/n,s=i??b0,c=Math.max(0,t-12/n),l=s(z$[e.health]??`○`,`${a}px ${Bg.display}`),u=x0(e.id),d=e.error_rate!==null&&e.error_rate>0?y0(e.error_rate):`${v0(e.request_rate)}/s`,f=`${v0(e.request_rate)}/s · ${y0(e.error_rate)}`;return{name:u,metric:r?``:[`${f} · p95 ${yEe(e.p95_ms)}`,f,d].find(e=>s(e,`${o}px ${Bg.display}`)<=c)??``,nameSize:a,metricSize:o,nameWidth:Math.max(0,c-l-4/n)}}var S0=new WeakMap;function C0(e,t,n){let r=n??b0,i=S0.get(r);i||(i=new Map,S0.set(r,i));let a=`600 ${t?zg.micro/m0:12}px ${Bg.display}`,o=i.get(a);o===void 0&&(o=Math.max(...Object.values(z$).map(e=>r(e,a))),i.set(a,o));let s=t?Math.ceil(16/m0)+1:20;return Math.ceil(Math.max(t?0:168,r(x0(e.id),a)+o+s))}var xEe=(e,t,n)=>Math.min(n,Math.max(t,e)),w0={x:0,y:0,zoom:1};function SEe({panel:e,title:t=e.title,result:n,dark:r,height:i,onSelect:a,onPoint:o,onMapView:s}){let c=(0,A.useRef)(null),[l,u]=(0,A.useState)({width:500,height:Math.max(40,i-24)}),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(0),h=(0,A.useMemo)(()=>{let e=document.createElement(`canvas`).getContext(`2d`);return e?(t,n)=>(e.font=n,e.measureText(t).width):void 0},[p]);(0,A.useEffect)(()=>{let e=document.fonts,t=()=>m(e=>e+1);return e?.addEventListener(`loadingdone`,t),()=>e?.removeEventListener(`loadingdone`,t)},[]);let[g,_]=(0,A.useState)(),[v,y]=(0,A.useState)(),[b,x]=(0,A.useState)(w0),S=(0,A.useRef)(null),C=(0,A.useRef)(!1),w=(0,A.useMemo)(()=>V$(n.frame,n),[n.frame,n.from_ms,n.to_ms]),T=(0,A.useMemo)(()=>h0(w,h),[w,h]),[E,D]=(0,A.useState)(),[O,k]=(0,A.useState)(),j=(0,A.useRef)({model:w,size:l,structure:T});j.current={model:w,size:l,structure:T},(0,A.useLayoutEffect)(()=>{if(!d)return;let{model:e,size:t,structure:n}=j.current;if(k(void 0),e.nodes.length<=60){D({key:n.key,layout:_Ee(e,t,n.widths),model:e});return}let r;try{r=new XCe}catch{k(`Service layout unavailable`);return}let i=!0;r.onmessage=t=>{i&&D({key:n.key,layout:t.data,model:e})},r.onerror=()=>{i&&k(`Service layout unavailable`)};try{r.postMessage({model:e,size:{width:t.width,height:t.height},widths:n.widths})}catch{i=!1,r.terminate(),k(`Service layout unavailable`);return}return()=>{i=!1,r.terminate()}},[T.key,d]);let M=(0,A.useMemo)(()=>E?vEe(E.layout,E.key===T.key?w:E.model,l):{nodes:[],edges:[],scale:1,compact:!0,contentWidth:l.width,contentHeight:l.height,uncalledLabel:void 0,initialView:{x:0,y:0}},[E,w,l,T.key]),N=By(r),P=Ng[r?4:7],F=(0,A.useId)().replaceAll(`:`,``),ee=g??v,te=new Set([ee,...w.edges.filter(e=>e.caller===ee||e.callee===ee).flatMap(e=>[e.caller,e.callee])]),ne=Math.max(12,1/M.scale),I=Math.max(1e-9,...w.edges.map(e=>e.request_rate??e.calls)),re=Math.max(1,b.zoom),ie=(0,A.useMemo)(()=>{let e=M.edges.flatMap(e=>e.points),t=[...M.nodes.flatMap(e=>[e.x,e.x+e.width]),...e.map(e=>e.x)],n=[...M.nodes.flatMap(e=>[e.y,e.y+e.height]),...e.map(e=>e.y)];if(M.uncalledLabel){let e=h?.(`No traced calls in this window`,`${zg.micro}px ${Bg.display}`)??29*zg.micro*.6;t.push((M.contentWidth-e/re)/2,(M.contentWidth+e/re)/2),n.push(M.uncalledLabel.y,M.uncalledLabel.y+zg.micro/re)}return{left:Math.min(...t),right:Math.max(...t),top:Math.min(...n),bottom:Math.max(...n)}},[M,h,re]),ae=[ie.left*b.zoom+b.x<0&&`left`,ie.right*b.zoom+b.x>l.width&&`right`,ie.top*b.zoom+b.y<0&&`top`,ie.bottom*b.zoom+b.y>l.height&&`bottom`].filter(e=>!!e),oe=ae.join(` `),se=M.initialView.x,ce=M.initialView.y,le=(0,A.useCallback)(()=>x({x:se,y:ce,zoom:1}),[se,ce]),ue=b.zoom<1,de=M.contentWidth>l.width||M.contentHeight>l.height,fe=(0,A.useCallback)(()=>{if(ue||!de){le();return}let e=Math.min(l.width/M.contentWidth,l.height/M.contentHeight,1);x({x:(l.width-M.contentWidth*e)/2,y:(l.height-M.contentHeight*e)/2,zoom:e})},[ue,de,le,l.width,l.height,M.contentWidth,M.contentHeight]);(0,A.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=e.clientWidth||t.width,r=e.clientHeight||t.height;n>0&&r>0&&u(e=>e.width===n&&e.height===r?e:{width:n,height:r})};t(),f(!0);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let pe=(0,A.useRef)(void 0),L=(0,A.useRef)(w0);(0,A.useLayoutEffect)(()=>{E&&(E.key!==pe.current||b.zoom===1&&b.x===L.current.x&&b.y===L.current.y)&&le(),pe.current=E?.key,L.current={x:se,y:ce,zoom:1}},[E,le]),(0,A.useEffect)(()=>(s?.({canFit:!!oe||b.zoom!==1||b.x!==se||b.y!==ce,overview:ue,fit:fe}),()=>s?.({canFit:!1,overview:!1,fit:()=>void 0})),[s,b,fe,se,ce,oe,ue]),(0,A.useEffect)(()=>{let e=c.current;if(!e)return;let t=t=>{if(!E||O||t.deltaY===0)return;t.preventDefault();let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top;x(e=>{let n=xEe(e.zoom*Math.exp(-t.deltaY*.002),1,ne);if(n===1)return{x:se,y:ce,zoom:1};let a=n/e.zoom;return{zoom:n,x:r-(r-e.x)*a,y:i-(i-e.y)*a}})};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[ne,!!E,O,se,ce]);let me=t=>{if(C.current){C.current=!1;return}e.click&&a?a(t):o?.({dimensions:{service:t}})};return(0,R.jsxs)(`div`,{role:`region`,"aria-label":`${t}: service dependency graph; ${K$({...e,title:t},n)}`,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0,minWidth:0,width:`100%`},children:[(0,R.jsxs)(`div`,{ref:c,style:{position:`relative`,flex:`1 1 auto`,minHeight:0,overflow:`hidden`,touchAction:`none`,cursor:S.current?`grabbing`:`grab`},onMouseLeave:()=>_(void 0),onPointerDown:e=>{e.button===0&&(C.current=!1,S.current={x:e.clientX,y:e.clientY,initial:b,moved:!1})},onPointerMove:e=>{let t=S.current;if(!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.hypot(n,r)>3&&(t.moved=!0),t.moved&&(e.currentTarget.setPointerCapture?.(e.pointerId),x({...t.initial,x:t.initial.x+n,y:t.initial.y+r}))},onPointerUp:()=>{C.current=S.current?.moved??!1,S.current=null},onPointerCancel:()=>{S.current=null,C.current=!1},children:[(O||!E)&&(0,R.jsx)(Dd,{role:`status`,c:`dimmed`,children:O??`Laying out services…`}),(0,R.jsxs)(`div`,{style:{position:`relative`,width:M.contentWidth,height:M.contentHeight,transform:`translate(${b.x}px, ${b.y}px) scale(${b.zoom})`,transformOrigin:`0 0`},children:[(0,R.jsxs)(`svg`,{"aria-hidden":`true`,width:M.contentWidth,height:M.contentHeight,viewBox:`0 0 ${M.contentWidth} ${M.contentHeight}`,style:{position:`absolute`,inset:0},children:[(0,R.jsx)(`defs`,{children:[N.muted,N.status.warn,N.status.bad].map((e,t)=>(0,R.jsx)(`marker`,{id:`${F}-arrow-${t}`,viewBox:`0 0 6 6`,refX:5,refY:3,markerWidth:5,markerHeight:5,orient:`auto-start-reverse`,markerUnits:`userSpaceOnUse`,children:(0,R.jsx)(`path`,{d:`M0,0 L6,3 L0,6 Z`,fill:e})},e))}),(0,R.jsx)(`g`,{children:M.edges.map(e=>(0,R.jsx)(`path`,{d:e.path,fill:`none`,stroke:e.status?N.status[e.status]:N.muted,strokeLinejoin:`round`,strokeWidth:1+3*Math.log1p(e.request_rate??e.calls)/Math.log1p(I),opacity:ee&&e.caller!==ee&&e.callee!==ee?.25:1,markerEnd:`url(#${F}-arrow-${e.status===`bad`?2:+(e.status===`warn`)})`,style:{pointerEvents:`stroke`},children:(0,R.jsx)(`title`,{children:`${e.caller} → ${e.callee}\n${e.edge_type} · ${hy(`per_second`,e.request_rate)} · ${hy(`count`,e.calls)} calls\n${hy(`percent`,e.error_rate)} errors · ${hy(`ms`,e.average_ms)} average`})},e.id))})]}),(0,R.jsxs)(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`},children:[M.uncalledLabel&&(0,R.jsx)(`span`,{style:{position:`absolute`,left:`50%`,top:M.uncalledLabel.y,transform:`translateX(-50%)`,color:N.muted,fontSize:zg.micro/re,lineHeight:1,whiteSpace:`nowrap`},children:`No traced calls in this window`}),M.nodes.map(e=>{let t=e.health===`unhealthy`?N.status.bad:e.health===`degraded`?N.status.warn:e.health===`healthy`?N.status.ok:N.muted,n=bEe(e,{width:e.width/M.scale,scale:M.scale*re,compact:M.compact,measureText:h});return(0,R.jsxs)(`button`,{type:`button`,title:`${e.id} · ${e.health}\n${_0(e)}`,"aria-label":`${e.id}, ${e.health}, ${_0(e)}`,onMouseEnter:()=>_(e.id),onMouseLeave:()=>_(void 0),onFocus:()=>y(e.id),onBlur:()=>y(void 0),onClick:()=>me(e.id),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),C.current=!1,me(e.id))},style:{position:`absolute`,left:e.x,top:e.y,width:e.width,height:e.height,display:`flex`,flexDirection:`column`,justifyContent:`center`,gap:3/re,boxSizing:`border-box`,border:`${1/re}px solid ${e.health===`unhealthy`||e.health===`degraded`?t:N.border}`,borderRadius:6,padding:`0 ${5/re}px`,background:N.surface,color:N.text,textAlign:`left`,opacity:ee&&!te.has(e.id)?.25:1,outline:v===e.id?`2px solid ${P}`:void 0,outlineOffset:-2,pointerEvents:`auto`,cursor:`pointer`,fontFamily:Bg.display},children:[(0,R.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4/re,width:`100%`,minWidth:0,fontSize:Math.max(zg.micro/re,12*M.scale),lineHeight:1,whiteSpace:`nowrap`},children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,style:{color:t,flex:`none`},children:z$[e.health]??`○`}),(0,R.jsx)(`span`,{style:{flex:`none`,fontWeight:600,whiteSpace:`nowrap`},children:n.name})]}),!M.compact&&(0,R.jsx)(`span`,{style:{width:`100%`,fontSize:n.metricSize*M.scale,lineHeight:1,color:N.muted,whiteSpace:`nowrap`},children:n.metric})]},e.id)})]})]}),ae.map(e=>(0,R.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,pointerEvents:`none`,zIndex:1,...e===`left`||e===`right`?{top:0,bottom:0,[e]:0,width:24}:{left:0,right:0,[e]:0,height:24},background:`linear-gradient(to ${e}, transparent, var(--mantine-color-body))`}},e))]}),(0,R.jsxs)(Dd,{c:`dimmed`,fz:12,mt:4,style:{flexShrink:0},children:[w.nodes.length,` services · `,w.edges.length,` `,w.edges.length===1?`route`:`routes`]})]})}function T0({label:e,value:t,color:n,hint:r,children:i}){let a=Jt(`light`)===`dark`;return(0,R.jsxs)(ic,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,style:{display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,R.jsx)(Dd,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,R.jsx)(B,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,style:{color:n===`ok`||n===`warn`||n===`bad`?zy(n,a):void 0},children:t}),r&&(0,R.jsx)(Dd,{c:`dimmed`,size:`xs`,mt:2,children:r}),i&&(0,R.jsx)(B,{mt:4,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0},children:i})]})}function E0({health:e}){let t=Nee(e),n=`var(--mantine-color-${t_(e)}-filled)`;return(0,R.jsx)(`svg`,{"aria-hidden":!0,width:12,height:12,viewBox:`0 0 12 12`,fill:e===`unknown`?`none`:n,stroke:n,strokeDasharray:Pee(e)===`dashed`?`2 2`:void 0,children:t===`diamond`?(0,R.jsx)(`polygon`,{points:`6,0 12,6 6,12 0,6`}):t===`roundRect`?(0,R.jsx)(`rect`,{x:1,y:1,width:10,height:10,rx:2}):(0,R.jsx)(`circle`,{cx:6,cy:6,r:5})})}function CEe({values:e,color:t}){let n=(0,A.useMemo)(()=>e.map(e=>Number.isFinite(e)?e:null),[e]),r=Math.max(0,...n.filter(e=>e!==null)),i=(0,A.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:n.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:n,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[n,t]);return(0,R.jsxs)(B,{"data-health-trend":!0,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0},children:[(0,R.jsx)(pX,{option:i,height:`100%`,label:`Error rate trend`}),r>0&&(0,R.jsxs)(Dd,{c:`dimmed`,size:`xs`,ta:`right`,mt:2,style:{flexShrink:0},children:[`peak `,r.toFixed(2),`%`]})]})}function wEe({result:e,dark:t,onSelect:n,onVariable:r,vars:i}){let a=e.frame?.health,o=e=>Number.isFinite(e)?e:0,s=a?{...a,total_spans:o(a.total_spans),service_count:o(a.service_count),counts:{healthy:o(a.counts.healthy),degraded:o(a.counts.degraded),unhealthy:o(a.counts.unhealthy)}}:void 0,c=!s||s.health===`unknown`||s.service_count===0||!Number.isFinite(s.error_rate),l=c?`unknown`:s.health,u=Math.max(s?.service_count??0,1),d=r_(t),f=n??(r&&i&&Object.hasOwn(i,`service`)?e=>r(`service`,e):void 0),p=c?[]:VCe(R_(e.frame));return(0,R.jsxs)(dh,{gap:`sm`,style:{flex:`1 1 auto`,minHeight:0},role:`region`,"aria-label":`Service health: ${c?`No data`:l}; ${s?.service_count??0} services`,children:[(0,R.jsxs)(sh,{cols:2,spacing:`sm`,"data-health-tiles":!0,style:{flex:`1 1 auto`,minHeight:0},children:[(0,R.jsx)(T0,{label:`Health`,value:(0,R.jsxs)(yl,{gap:6,children:[(0,R.jsx)(E0,{health:l}),c?`No data`:l.charAt(0).toUpperCase()+l.slice(1)]}),color:t_(l),hint:c?`No telemetry in this window`:`${a_.format(s.service_count)} services`,children:p.map(e=>{let t=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(E0,{health:e.health}),(0,R.jsx)(Dd,{component:`span`,fz:12,truncate:!0,style:{minWidth:0,textAlign:`left`},title:e.name,children:e.name}),(0,R.jsx)(Dd,{component:`span`,fz:12,ff:`monospace`,style:{textAlign:`right`},children:e.metric})]}),n={display:`grid`,gridTemplateColumns:`12px minmax(0, 1fr) 64px`,alignItems:`center`,textAlign:`left`,gap:6,minHeight:20,minWidth:0,width:`100%`};return f?(0,R.jsx)(Ad,{component:`button`,type:`button`,"data-health-service":e.name,style:n,onClick:()=>f(e.name),children:t},e.name):(0,R.jsx)(B,{"data-health-service":e.name,style:n,children:t},e.name)})}),(0,R.jsx)(T0,{label:`Error rate`,value:c?`—`:`${s.error_rate.toFixed(2)}%`,color:!c&&s.error_rate>=1?`bad`:void 0,hint:c?void 0:`${a_.format(s.total_spans)} operations`,children:!c&&s.error_trend.length>1&&(0,R.jsx)(CEe,{values:s.error_trend,color:d.bad})})]}),!c&&(0,R.jsxs)(B,{style:{flexShrink:0},children:[(0,R.jsxs)(Im.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,R.jsx)(Im.Section,{value:s.counts.healthy/u*100,color:`ok`}),(0,R.jsx)(Im.Section,{value:s.counts.degraded/u*100,color:`warn`}),(0,R.jsx)(Im.Section,{value:s.counts.unhealthy/u*100,color:`bad`})]}),(0,R.jsx)(yl,{mt:6,gap:`md`,children:[`healthy`,`degraded`,`unhealthy`].map(e=>(0,R.jsxs)(yl,{gap:6,children:[(0,R.jsx)(E0,{health:e}),(0,R.jsxs)(Dd,{c:`dimmed`,size:`xs`,children:[s.counts[e],` `,e]})]},e))})]})]})}function TEe(e){return(0,R.jsx)(Xy,{...e})}function EEe(e){return(0,R.jsx)(Xy,{...e})}function DEe(e){let{panel:t,title:n,result:r,dark:i,height:a,group:o,onSelect:s,onPoint:c,onVariable:l,onZoom:u}=e;if(t.viz===`text`)return(0,R.jsx)(RCe,{panel:t});if(!r?.frame)return null;let d={...e,result:r};switch(t.viz){case`stat`:return(0,R.jsx)(Tre,{panel:t,result:r,dark:i,compare:e.compare,range:e.range});case`gauge`:return(0,R.jsx)(m_e,{panel:t,title:n,result:r,dark:i,height:a});case`timeseries`:return(0,R.jsx)(zCe,{...d});case`bar`:return(0,R.jsx)(p_e,{panel:t,title:n,result:r,dark:i,height:a,onSelect:s,onPoint:c});case`table`:return(0,R.jsx)(qy,{traceLinks:e.traceLinks,panel:t,result:r,height:a,onSelect:s,onPoint:c,onVariable:l});case`heatmap`:return(0,R.jsx)(KCe,{...d});case`histogram`:return(0,R.jsx)(qCe,{...d});case`scatter`:return(0,R.jsx)(JCe,{...d});case`state_timeline`:return(0,R.jsx)(YCe,{...d});case`service_map`:return(0,R.jsx)(SEe,{...d});case`health`:return(0,R.jsx)(wEe,{...d});case`logs`:return(0,R.jsx)(Zy,{...d});case`log_patterns`:return(0,R.jsx)(TEe,{...d});case`traces`:return(0,R.jsx)(EEe,{...d})}}function OEe({onClick:e}){return(0,R.jsx)(Xm,{label:`Keyboard shortcuts (?)`,children:(0,R.jsx)(ll,{variant:`default`,size:`lg`,"aria-label":`Keyboard shortcuts (?)`,onClick:e,children:(0,R.jsx)(rte,{size:16})})})}var D0=(0,A.createContext)(void 0);function kEe({opened:e,onClose:t,title:n,children:r,returnFocusTo:i,shortcutScope:a,onShortcuts:o,escapeEnabled:s=!0}){let c=(0,A.useRef)(!1),[l,u]=(0,A.useState)(!1),d=(0,A.useRef)(i);return d.current=i,(0,A.useEffect)(()=>{let t=c.current&&!e;if(c.current=e,!t)return;let n=requestAnimationFrame(()=>d.current()?.focus());return()=>cancelAnimationFrame(n)},[e]),(0,R.jsxs)(cm.Root,{opened:e,onClose:t,fullScreen:!0,trapFocus:!0,returnFocus:!1,closeOnEscape:s&&!l,children:[(0,R.jsx)(cm.Overlay,{}),(0,R.jsxs)(cm.Content,{"aria-label":n,"data-panel-fullscreen":!0,"data-shortcut-scope":a,children:[(0,R.jsx)(cm.Header,{children:(0,R.jsxs)(yl,{ml:`auto`,gap:`xs`,children:[o&&(0,R.jsx)(OEe,{onClick:o}),(0,R.jsx)(cm.CloseButton,{"data-autofocus":!0,"aria-label":`Close panel view`})]})}),(0,R.jsx)(cm.Body,{children:(0,R.jsx)(D0.Provider,{value:u,children:r})})]})]})}function AEe({panel:e,title:t,result:n,loading:r,compare:i,range:a,height:o,group:s,editing:c,agentAvailable:l,annotations:u,vars:d,onSelect:f,onPoint:p,onVariable:m,onZoom:h,onRangePending:g,onZoomReset:_,zoomed:v,onView:y,onCopyLink:b,onExplain:x,onFix:S,onRetry:C,onRemove:w,onDuplicate:T,staleAt:E,traceLinks:D,suspended:O=!1,menuRef:k}){let[j,M]=(0,A.useState)(),N=(0,A.useMemo)(()=>({setHint:M}),[]),P=Jt(`light`)===`dark`,F=(0,A.useRef)(null),[ee,te]=(0,A.useState)(0);(0,A.useLayoutEffect)(()=>{let e=F.current;if(!e)return;te(e.getBoundingClientRect().width);let t=new ResizeObserver(([e])=>{e&&te(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let ne=ee>0&&ee<360,[I,re]=(0,A.useState)(0);(0,A.useLayoutEffect)(()=>{let n=()=>{let n=document.createElement(`canvas`).getContext(`2d`),r=F.current?.querySelector(`[data-panel-title]`),i=r?getComputedStyle(r).fontFamily:`inherit`;n&&(n.font=`600 15px ${i}`);let a=n?.measureText(t).width??Array.from(t).length*8.25;n&&(n.font=`400 11px ${i}`);let o=[`Chart`,`Data`,`Spec`].reduce((e,t)=>e+(n?.measureText(t).width??t.length*7)+12,4),s=(e.description?24:0)+18+($y(e)?.length??0)*7;re(a+o+22+32+20+s)};return n(),document.fonts?.addEventListener(`loadingdone`,n),()=>document.fonts?.removeEventListener(`loadingdone`,n)},[t,e.description,e.time]);let ie=ne||ee>0&&ee{if(!E)return;oe(Date.now());let e=window.setInterval(()=>oe(Date.now()),3e4);return()=>window.clearInterval(e)},[E]);let[se,ce]=(0,A.useState)(`Chart`),[le,ue]=(0,A.useState)(),de=(0,A.useCallback)(e=>ue(e),[]),fe=e.click?`click to filter by ${e.click.set_variable}`:e.viz===`traces`||(e.drill===`traces`||n?.frame?.columns.some(e=>e.name===`trace_id`))&&e.viz===`table`?`click to open trace`:e.drill===`logs`?`click for matching logs`:e.drill===`traces`&&[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz)?`click for exemplar traces`:void 0,pe=Math.max(40,o-88),L=z_(e,n?.frame),me=L.length?[...new Set(L.map(e=>e.value))].join(` · `):e.sql?`sql`:e.query?.from??(e.viz===`service_map`||e.viz===`health`?`spans`:e.viz===`log_patterns`?`logs`:`spec`),he=`${e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)} · ${me}${fe?` · ${fe}`:``}`,ge=[`timeseries`,`bar`,`heatmap`,`histogram`,`scatter`,`state_timeline`,`gauge`,`service_map`].includes(e.viz),_e=se!==`Chart`||!ge||!n||n.status!==`ok`||n.frame?.truncated||n.previous?.truncated,ve=[`table`,`logs`,`traces`,`log_patterns`,`text`].includes(e.viz),ye=jEe(n?.frame?.note),be=n?.frame&&n.error,xe=!!n?.request_error?.length,Se=!!n?.error&&!xe,Ce=E?`Showing data from ${O0(E,ae)}`:void 0,we=be?`${Ce?`${Ce}. `:``}${be}`:void 0,Te=we&&we.length>200?`${we.slice(0,199)}…`:we,Ee=(0,A.useId)(),De=(0,A.useRef)(null),Oe=Ve(k,De),[ke,Ae]=(0,A.useState)(!1),[je,Me]=(0,A.useState)(!1),[Ne,Pe]=(0,A.useState)(!1),Fe=!!be&&!Ne&&(ke||je),Ie=(0,A.useContext)(D0);(0,A.useEffect)(()=>(Ie?.(Fe),()=>Ie?.(!1)),[Ie,Fe]);let Le=(0,A.useCallback)(()=>{Pe(!0),Ae(!1),Me(!1)},[]);(0,A.useEffect)(()=>{if(!Fe)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),Le())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[Fe,Le]);let Re=[...new Set([E&&!be?`Stale: last updated ${O0(E,ae)}`:void 0,n?.frame?.truncated||n?.previous?.truncated?`Truncated: showing limited data`:void 0,ye,n?.annotation_error,n?.annotation_scope?.limited?`Annotation service scope is limited.`:void 0].filter(e=>!!e))],ze=(0,A.useRef)(null),[Be,He]=(0,A.useState)(),Ue=(Be??pe)<160;(0,A.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&He(e.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let[We,Ge]=(0,A.useState)();return(0,A.useLayoutEffect)(()=>{let e=ze.current,t=F.current;if(!e||!t)return;if(!_e||!(ve||se===`Data`)){Ge(void 0);return}let n=()=>{let n=Math.max(0,t.getBoundingClientRect().bottom-e.getBoundingClientRect().bottom),r=e.scrollHeight>e.clientHeight;Ge(e=>r?e?.bottom===n?e:{bottom:n}:void 0)};n();let r=new ResizeObserver(n);r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild);let i=new MutationObserver(n);return i.observe(e,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{r.disconnect(),i.disconnect()}},[n,se,ve,_e,o,ne,Re.length]),(0,R.jsxs)(ic,{ref:F,withBorder:!0,radius:`md`,h:`100%`,p:0,style:{display:`flex`,flexDirection:`column`,minWidth:0,position:`relative`},"data-panel":e.id,"data-compact-views":ie,children:[(0,R.jsxs)(yl,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,px:16,pt:12,className:c?`panel-drag`:void 0,style:{cursor:c?`grab`:void 0,flexShrink:0},children:[(0,R.jsxs)(yl,{gap:6,wrap:`nowrap`,miw:0,style:{flex:1},children:[(0,R.jsxs)(B,{miw:0,style:{flex:1},children:[(0,R.jsx)(Dd,{"data-panel-title":!0,fw:600,fz:15,truncate:!ie||void 0,style:ie?{overflowWrap:`anywhere`}:void 0,children:t}),(0,R.jsxs)(Dd,{"data-panel-subtitle":!0,title:j??he,fz:12,ff:Bg.display,c:`dimmed`,truncate:!ne||void 0,style:{position:`relative`,...ne?{overflowWrap:`anywhere`}:{}},children:[(0,R.jsx)(`span`,{"aria-hidden":j?!0:void 0,style:{visibility:j?`hidden`:void 0},children:he}),j&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(`span`,{"data-chart-hint":!0,"aria-hidden":`true`,style:{position:`absolute`,inset:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Vre(j)})})]}),e.options?.highlight&&(0,R.jsxs)(Dd,{component:`span`,"data-highlight-term":!0,title:`highlight: ${e.options.highlight}`,fz:11,c:`dimmed`,style:{display:`inline-block`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,border:`1px solid var(--mantine-color-default-border)`,borderRadius:4,padding:`0 5px`},children:[`highlight: `,e.options.highlight]})]}),$y(e)&&(0,R.jsx)(Dd,{size:`xs`,c:`dimmed`,role:`status`,children:$y(e)}),e.description&&(0,R.jsx)(Xm,{label:e.description,multiline:!0,w:260,children:(0,R.jsx)(ll,{variant:`transparent`,color:`gray`,size:`xs`,"aria-label":`${t} description`,children:(0,R.jsx)(nte,{size:14})})}),r&&n&&(0,R.jsx)(tl,{size:12,"aria-label":`Refreshing`})]}),(0,R.jsxs)(yl,{gap:4,wrap:`nowrap`,style:{flexShrink:0},children:[!ie&&e.viz!==`text`&&(0,R.jsx)(yl,{gap:0,wrap:`nowrap`,role:`group`,"aria-label":`${t} view`,style:{border:`1px solid var(--mantine-color-default-border)`,borderRadius:5,overflow:`hidden`},children:[`Chart`,`Data`,`Spec`].map(e=>(0,R.jsx)(`button`,{type:`button`,"data-panel-view":e,"aria-pressed":se===e,onClick:()=>ce(e),style:{border:0,borderLeft:e===`Chart`?void 0:`1px solid var(--mantine-color-default-border)`,padding:`2px 6px`,fontSize:11,fontFamily:`inherit`,cursor:`pointer`,background:se===e?`var(--mantine-color-default)`:`transparent`,color:se===e?`var(--mantine-primary-color-filled)`:`var(--mantine-color-dimmed)`,fontWeight:se===e?600:400,boxShadow:se===e?`inset 0 -2px var(--mantine-primary-color-filled)`:void 0},children:e},e))}),e.viz===`service_map`&&le?.canFit&&(0,R.jsx)(ll,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":le.overview?`Return to readable ${t} view`:`Show whole ${t} graph`,onClick:le.fit,children:(0,R.jsx)(f_,{size:16})}),v&&_&&[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz)&&(0,R.jsx)(ll,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Reset ${t} zoom`,onClick:_,children:(0,R.jsx)(u_,{size:16})}),(0,R.jsxs)(Kp,{position:`bottom-end`,withinPortal:!0,onChange:e=>{e&&Le()},children:[(0,R.jsx)(Kp.Target,{children:(0,R.jsx)(ll,{ref:Oe,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`${t} menu${Te?`, refresh failed`:``}`,"aria-describedby":Te?Ee:void 0,onFocus:e=>{let t=e.currentTarget.matches(`:focus-visible`);Ae(t),t&&Pe(!1)},onBlur:()=>Ae(!1),onMouseEnter:()=>{Me(!0),Pe(!1)},onMouseLeave:Le,children:be?(0,R.jsx)(E_,{size:18,weight:`fill`,color:`var(--mantine-color-warn-filled)`}):(0,R.jsx)(tte,{size:18,weight:`bold`})})}),(0,R.jsx)(Xm,{target:De,multiline:!0,maw:`min(360px, calc(100vw - 32px))`,label:(0,R.jsxs)(R.Fragment,{children:[Ce&&(0,R.jsx)(Dd,{size:`xs`,children:Ce}),(0,R.jsx)(Dd,{"data-refresh-error-message":!0,size:`xs`,title:be||void 0,lineClamp:4,style:{overflowWrap:`anywhere`},children:be})]}),opened:Fe}),(0,R.jsxs)(Kp.Dropdown,{children:[(ie||e.viz===`text`)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Kp.RadioGroup,{value:se,onChange:ce,children:(0,R.jsx)(B,{role:`group`,"aria-label":`${t} view`,children:(e.viz===`text`?[`Chart`,`Spec`]:[`Chart`,`Data`,`Spec`]).map(t=>(0,R.jsx)(Kp.RadioItem,{value:t,"data-panel-view":t,closeMenuOnClick:!0,children:e.viz===`text`&&t===`Chart`?`Content`:t},t))})}),(0,R.jsx)(Kp.Divider,{})]}),be&&xe&&C&&(0,R.jsx)(Kp.Item,{disabled:r,onClick:()=>{Le(),C()},children:`Retry`}),Se&&l&&S&&(0,R.jsx)(Kp.Item,{onClick:S,children:`Ask Fanout to fix it`}),y&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(f_,{size:14}),onClick:y,children:`View`}),l&&x&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(ete,{size:14}),onClick:x,children:`Explain in chat`}),b&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(v_,{size:14}),onClick:b,children:`Copy link`}),T&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(v_,{size:14}),onClick:T,children:`Duplicate`}),w&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Kp.Divider,{}),(0,R.jsx)(Kp.Item,{color:`bad`,leftSection:(0,R.jsx)(ote,{size:14}),onClick:w,children:`Remove panel`})]})]})]})]})]}),(0,R.jsx)(B,{ref:ze,"data-panel-body":!0,className:`dashboard-panel-padding`,style:{flex:`1 1 0px`,isolation:`isolate`,contain:ve||se===`Data`?`paint`:void 0,minHeight:0,minWidth:0,padding:`16px`,overflow:_e?`auto`:`hidden`,display:ve||se!==`Chart`?`block`:`flex`,flexDirection:`column`},children:O?(0,R.jsx)(Rf,{h:`100%`,children:(0,R.jsx)(Dd,{size:`sm`,c:`dimmed`,children:`Shown in full-screen`})}):se===`Data`?(0,R.jsx)(Lre,{panel:e,result:n}):se===`Spec`?(0,R.jsx)(Rre,{panel:e,dark:P}):!n&&e.viz!==`text`?(0,R.jsx)(Rf,{style:{minHeight:`100%`,flexShrink:0},children:(0,R.jsx)(tl,{size:`sm`,"aria-label":`Loading panel`})}):n?.status===`error`?(0,R.jsxs)(B,{"data-panel-error":!0,style:{height:`100%`,maxHeight:`100%`,minHeight:0,minWidth:0,overflow:`hidden`,display:`flex`,flexDirection:Ue?`row`:`column`,alignItems:`center`,justifyContent:`center`,gap:Ue?6:4},children:[(0,R.jsx)(E_,{size:18,weight:`fill`,color:`var(--mantine-color-bad-filled)`,style:{flexShrink:0}}),!Ue&&(0,R.jsx)(Dd,{size:`sm`,fw:500,c:`bad`,style:{flexShrink:0},children:`This panel failed`}),(0,R.jsx)(Dd,{"data-panel-error-message":!0,title:n.error,size:`xs`,c:`dimmed`,ta:Ue?`left`:`center`,style:{minWidth:0,minHeight:0,overflow:`hidden`,...Ue?{flex:`1 1 0px`,whiteSpace:`nowrap`,textOverflow:`ellipsis`}:{overflowWrap:`anywhere`,flex:`0 1 auto`}},children:Ue?`This panel failed: ${n.error??`Request failed`}`:n.error}),xe&&C&&(0,R.jsx)(Ff,{size:`compact-xs`,variant:`light`,style:{flexShrink:0},disabled:r,onClick:C,children:`Retry`}),Se&&l&&S&&(Ue?(0,R.jsx)(Xm,{label:`Ask Fanout to fix it`,events:{hover:!0,focus:!0,touch:!1},children:(0,R.jsx)(ll,{size:32,variant:`light`,"aria-label":`Ask Fanout to fix it`,style:{flex:`0 0 32px`},onClick:S,children:(0,R.jsx)(ste,{size:16})})}):(0,R.jsx)(Ff,{size:`compact-xs`,variant:`light`,style:{flexShrink:0},onClick:S,children:`Ask Fanout to fix it`}))]}):n?.status===`empty`?(0,R.jsx)(Rf,{style:{minHeight:`100%`,flexShrink:0},children:(0,R.jsxs)(dh,{align:`center`,gap:4,maw:420,children:[(0,R.jsx)(ate,{size:20,color:`var(--mantine-color-dimmed)`}),(0,R.jsx)(Dd,{size:`sm`,c:`dimmed`,ta:`center`,children:n.diagnosis||`No data in this time range.`})]})}):(0,R.jsx)(nb.Provider,{value:N,children:(0,R.jsx)(DEe,{traceLinks:D,onMapView:de,compare:i,range:a,panel:e,title:t,result:n,dark:P,height:pe,group:s,annotations:u,vars:d,onSelect:f,onPoint:p,onVariable:m,onZoom:h,onRangePending:g})})}),Re.length>0&&(0,R.jsx)(B,{"data-panel-notes":!0,className:`dashboard-panel-padding`,pb:12,style:{display:`flex`,flexDirection:`column`,gap:4,flexShrink:0,position:`relative`,zIndex:1,paddingTop:8,background:`var(--mantine-color-body)`},children:Re.map(e=>(0,R.jsx)(Dd,{"data-panel-note":!0,fz:12,c:`dimmed`,role:`status`,title:e===ye?n?.frame?.note:void 0,style:{overflowWrap:`anywhere`},children:e},e))}),Te&&(0,R.jsx)(`span`,{id:Ee,hidden:!0,children:Te}),We&&(0,R.jsx)(B,{"data-panel-scroll-fade":!0,"aria-hidden":`true`,style:{position:`absolute`,left:16,right:16,bottom:We.bottom,height:16,pointerEvents:`none`,zIndex:1,background:`linear-gradient(to bottom, transparent, var(--mantine-color-body))`}})]})}function jEe(e){let t=e?.match(/^Split at (\S+)( · .+)$/);if(!t)return e;let n=new Date(t[1]);return Number.isFinite(n.getTime())?`Split at ${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(n)}${t[2]}`:e}function O0(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r} minute${r===1?``:`s`} ago`;let i=Math.floor(r/60);return`${i} hour${i===1?``:`s`} ago`}function MEe({variables:e,vars:t,options:n,onChange:r}){return e.length===0?null:(0,R.jsx)(yl,{gap:`sm`,wrap:`wrap`,role:`group`,"aria-label":`Dashboard variables`,children:e.map(e=>{let i=Qg(e,t,n[e.name]),a=[...e.include_all?[{value:Zg,label:`All`}]:[],...(n[e.name]??e.options?.map(e=>({value:e}))??[]).map(e=>({value:e.value,label:e.value}))],o=(0,R.jsxs)(Dd,{size:`xs`,c:`dimmed`,ff:`monospace`,children:[`$`,e.name]});return e.kind===`constant`?(0,R.jsx)(jh,{label:o,size:`xs`,value:e.value,readOnly:!0,w:160},e.name):e.kind===`text`?(0,R.jsx)(jh,{label:o,size:`xs`,w:200,defaultValue:typeof i==`string`?i:``,onBlur:t=>r(e.name,t.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.name}:${JSON.stringify(i)}`):e.multi?(0,R.jsx)(Dm,{label:o,size:`xs`,w:260,searchable:!0,clearable:!0,data:a.filter(e=>e.value!==Zg),value:Array.isArray(i)?i:i&&i!==`$__all`?[i]:[],placeholder:e.include_all?`All`:`None`,onChange:t=>r(e.name,t.length?t:e.include_all?Zg:[])},e.name):(0,R.jsx)(Qm,{label:o,size:`xs`,w:220,searchable:!0,allowDeselect:!1,data:a,value:Array.isArray(i)?i[0]??null:i||null,onChange:t=>t!==null&&r(e.name,t)},e.name)})})}var NEe=e=>({panels:e.panels.map(({grid:e,...t})=>t),variables:e.variables,time:e.time,annotations:e.annotations});function PEe(e,t,n,r){return[`variables`,e,NEe(t),n,r]}function FEe(e,t,n,r,i,a=!1){let o=!!t.variables?.some(e=>e.kind===`query`),s=Mg({queryKey:PEe(e,t,n,r),queryFn:async({signal:e})=>{let a=await i({dashboard:t,time:n,vars:r},e);return Object.fromEntries((t.variables??[]).map(e=>[e.name,a[e.name]??(e.kind===`custom`?e.options?.map(e=>({value:e})):void 0)??[]]))},enabled:o,retry:a,staleTime:6e4,placeholderData:e=>e}),c=s.isPlaceholderData?void 0:s.data,l=s.isError||(t.variables??[]).every(e=>e.kind!==`query`||r[e.name]!==void 0&&r[e.name]!==`$__all`&&(e.multi||!Array.isArray(r[e.name])||r[e.name].length>0)||!!e.default||e.include_all||c?.[e.name]!==void 0);return{...s,currentData:c,ready:l}}function IEe(e,t){let n=JSON.stringify([e.range,e.from,e.to]),r=(0,A.useRef)({search:e,onSearch:t,scope:n}),i=(0,A.useRef)(``),a=(0,A.useRef)(void 0),[o,s]=(0,A.useState)(!1);r.current.scope!==n&&(i.current!==`${e.from}/${e.to}`&&(a.current=void 0,o&&s(!1)),i.current=``),r.current={search:e,onSearch:t,scope:n};let c=(0,A.useCallback)(()=>{i.current=``,a.current=void 0,s(!1)},[]),l=(0,A.useCallback)(()=>{if(!a.current)return;let e=a.current;c(),r.current.onSearch({...r.current.search,...e},!1)},[c]);return{zoom:(0,A.useCallback)((e,t)=>{let n=Ire(e,t);if(!n)return;let o=r.current,c=`${n.from}/${n.to}`;o.search.from===n.from&&o.search.to===n.to||i.current===c||(a.current??={range:o.search.range,from:o.search.from,to:o.search.to},s(!0),i.current=c,o.onSearch({...o.search,range:void 0,...n},!1))},[]),reset:c,resetZoom:l,zoomed:o}}function LEe(e,t,n,r){let i=e=>t?.frame?.columns.some((n,r)=>n.name===e&&t.frame.values[r]?.some(e=>typeof e==`string`&&e!==``));return{onSelect:e.click&&(e.viz===`service_map`||!(e.drill&&r))?t=>n(e.click.set_variable,t):void 0,onPoint:r&&(e.viz===`service_map`||e.click||e.drill||i(`trace_id`)||e.options?.columns?.some(e=>e.format===`trace_link`&&i(e.field)))?r:void 0}}function REe(e,t,n,r){if(!t)return;let i=k_(e,t,n);if(!i)return;let a=Object.values(n.dimensions)[0],o=e.click?.set_variable;return{target:i,vars:o&&a!==void 0?{...r,[o]:a}:r}}var zEe=e=>e*40+(e-1)*12,BEe={s:3,m:6,l:10},VEe={stat:4},HEe=e=>Math.max(VEe[e.viz]??0,BEe[e.height??(e.viz===`service_map`?`l`:e.viz===`stat`?`s`:`m`)]),k0=e=>Math.max(e.viz===`service_map`?460:0,zEe(e.grid?.h??HEe(e)));function UEe(e){let t=(0,A.useRef)(void 0),n=t=>[...e.current?.querySelectorAll(`[data-panel]`)??[]].find(e=>e.dataset.panel===t&&!e.closest(`[data-panel-fullscreen],[data-fragment-fullscreen]`));return(0,A.useEffect)(()=>{t.current&&!n(t.current.panel)&&(t.current=void 0)}),{remember(n){t.current=void 0;let r=document.activeElement;if(!(r instanceof HTMLElement)||!e.current?.contains(r)||r.closest(`[data-panel]`)?.dataset.panel!==n)return;let i=r.getAttribute(`data-panel-view`),a=r.getAttribute(`aria-label`),o=r.hasAttribute(`data-chart-plot`)?`[data-chart-plot]`:i?`[data-panel-view=${JSON.stringify(i)}]`:a?`[aria-label=${JSON.stringify(a)}]`:void 0;t.current={element:r,panel:n,selector:o}},restore(e){let r=t.current;if(t.current=void 0,r&&(e===void 0||r.panel===e)&&n(r.panel))return r.element.isConnected&&!r.element.closest(`[hidden]`)?r.element:r.selector?n(r.panel)?.querySelector(r.selector)??void 0:void 0}}}var WEe=async()=>{throw Error(`Variable options unavailable`)};function GEe({fragment:e,dark:t,onQuery:n,drillClient:r,resolveVariables:i,height:a,hostDisplayMode:o,onDisplayMode:s}){let c=(0,A.useId)(),[l,u]=(0,A.useState)(e),[d,f]=(0,A.useState)(e.vars??{}),[p,m]=(0,A.useState)(e.dashboard.time),[h,g]=(0,A.useState)(!1),[_,v]=(0,A.useState)(),[y,b]=(0,A.useState)(),x=(0,A.useRef)(Date.now()),S=(0,A.useRef)(0),[C,w]=(0,A.useState)(),[T,E]=(0,A.useState)(),D=(0,A.useRef)(null),O=UEe(D),k=(0,A.useRef)(o);(0,A.useEffect)(()=>{k.current===`fullscreen`&&o===`inline`&&E(void 0),k.current=o},[o]);let j=async e=>{O.remember(e);try{(!s||await s(`fullscreen`))&&E(e)}catch{v(`Full-screen could not be opened. Please try again.`)}},M=()=>{E(void 0),s&&s(`inline`).catch(()=>v(`Full-screen could not be closed. Please try again.`))},N=(0,A.useRef)(new Map),P=(0,A.useRef)(void 0);T&&(P.current=T);let F=o===`fullscreen`&&!!T,ee=(0,A.useRef)(null),te=(0,A.useRef)(!1);(0,A.useEffect)(()=>{let e=te.current&&!F;if(te.current=F,F&&ee.current?.focus(),!e)return;let t=requestAnimationFrame(()=>(O.restore(P.current)??N.current.get(P.current??``))?.focus());return()=>cancelAnimationFrame(t)},[F]),(0,A.useEffect)(()=>{if(!F)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&!e.repeat&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!document.querySelector(`[role="dialog"]`)&&(e.preventDefault(),M())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[F,s]);let[ne,I]=(0,A.useState)(()=>window.innerHeight);(0,A.useEffect)(()=>{let e=()=>I(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{S.current++,u(e),f(e.vars??{}),m(e.dashboard.time),w(void 0),E(void 0),g(!1),v(void 0),b(void 0),le(),x.current=Date.now()},[e]),(0,A.useEffect)(()=>()=>{S.current++},[]);let re=l.dashboard,ie=FEe(c,re,p,d,i??WEe),ae=(0,A.useMemo)(()=>e_(re.variables,d,ie.currentData),[re.variables,d,ie.currentData]);async function oe(e=d,t=p){let r=++S.current;f(e),m(t),w(void 0),g(!0),v(void 0),b(x.current);let i=e===d?ae:e_(re.variables,e,ie.currentData);try{let e=Xg(await n({dashboard:re,time:t,vars:i}));if(S.current!==r)return;u(e),x.current=Date.now(),b(void 0)}catch(e){S.current===r&&v(e instanceof Error?e.message:`This view could not be refreshed.`)}finally{S.current===r&&g(!1)}}let se=(e,t)=>{let n={...d};t===void 0?delete n[e]:n[e]=t,oe(n)},{zoom:ce,reset:le,resetZoom:ue,zoomed:de}=IEe(p,e=>void oe(d,e)),fe=(e,t)=>{let n=REe(e,l.results.find(t=>t.id===e.id),t,d);n&&(n.vars!==d&&oe(n.vars),w(n.target))},pe=(e,t,n=!1)=>(0,R.jsx)(AEe,{panel:e,title:$g(e.title,ae),result:l.results.find(t=>t.id===e.id),suspended:!n&&e.id===T,menuRef:n?void 0:t=>{t?N.current.set(e.id,t):N.current.delete(e.id)},group:c,height:t,loading:h,staleAt:y,editing:!1,agentAvailable:!1,vars:ae,range:e.time?.range??p.range,compare:p.compare===`previous_period`,onVariable:se,...LEe(e,l.results.find(t=>t.id===e.id),se,t=>fe(e,t)),onZoom:ce,zoomed:de,onZoomReset:ue,onView:o===void 0||s?()=>void j(e.id):void 0,traceLinks:`button`}),L=re.panels.find(e=>e.id===T);return(0,R.jsxs)(dh,{ref:D,"data-dashboard-fragment":!0,gap:`md`,p:`md`,children:[(0,R.jsx)(B,{hidden:F,style:F?{display:`none`}:void 0,children:(0,R.jsxs)(dh,{gap:`md`,children:[re.panels.length>1&&(0,R.jsx)(Dd,{"data-fragment-header":!0,fw:600,children:Mee(l)}),(0,R.jsx)(MEe,{variables:re.variables??[],vars:d,options:ie.data??{},onChange:se}),ie.error&&(0,R.jsx)(Sd,{color:`bad`,children:`Variable options could not be loaded.`}),_&&(0,R.jsx)(Sd,{color:`bad`,children:_}),re.panels.map(e=>(0,R.jsx)(B,{h:a??k0(e),children:pe(e,a??k0(e))},e.id)),l.trace&&(0,R.jsx)(Qy,{result:l.trace,dark:t})]})}),F&&L&&(0,R.jsx)(B,{"data-fragment-fullscreen":!0,role:`region`,"aria-label":$g(L.title,ae),tabIndex:-1,ref:ee,h:`calc(100vh - 32px)`,children:pe(L,Math.max(40,ne-80),!0)}),o!==`fullscreen`&&(0,R.jsx)(kEe,{opened:!!L,onClose:M,title:L?$g(L.title,ae):`Panel`,escapeEnabled:!C,returnFocusTo:()=>O.restore(P.current)??N.current.get(P.current??``),children:L&&(0,R.jsx)(B,{h:`calc(100vh - 120px)`,children:pe(L,Math.max(40,ne-140),!0)})}),(0,R.jsx)(Fre,{client:r,spec:re,time:p,vars:ae,target:C,onChange:w})]})}function KEe(e){async function t(t,n,r){if(r?.aborted)throw new DOMException(`Canceled`,`AbortError`);let i;try{i=await e.callServerTool({name:t,arguments:n},{signal:r})}catch(e){throw e instanceof Error&&e.name===`AbortError`?e:r?.aborted?new DOMException(`Canceled`,`AbortError`):Error(`This view could not be refreshed.`)}if(r?.aborted)throw new DOMException(`Canceled`,`AbortError`);if(i.isError||!i.structuredContent)throw Error(`This view could not be refreshed.`);return i.structuredContent}return{drill:{exemplars:(e,n)=>t(`get_panel_exemplars`,{...e},n),trace:async(e,n)=>{let r=Xg(await t(`inspect_trace`,{trace_id:e.trace_id,namespace:e.namespace,from:e.window_from,to:e.window_to,limit:200},n));if(!r.trace)throw Error(`Trace unavailable`);return r.trace}},query:async e=>{if(Object.hasOwn(e,`panels`))throw Error(`Panel subsets are unavailable in chat fragments`);let n=Xg(await t(`query_panel_fragment`,{...e}));return n.vars=e.vars,n},resolveVariables:async(e,n)=>{let r=await t(`resolve_panel_variables`,{...e},n);if(!r.options||typeof r.options!=`object`||Array.isArray(r.options)||Object.values(r.options).some(e=>!Array.isArray(e)||e.some(e=>!e||typeof e.value!=`string`)))throw Error(`Invalid variable options`);return r.options}}}var A0=Object.defineProperty,qEe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),JEe=(e,t)=>{let n={};for(var r in e)A0(n,r,{get:e[r],enumerable:!0});return t&&A0(n,Symbol.toStringTag,{value:`Module`}),n},YEe=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]);function XEe(e){return typeof e==`string`&&YEe.has(e.replace(/#$/,``))}function j0(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function M0(e,t=`|`){return e.map(e=>Z0(e)).join(t)}function N0(e,t){return typeof t==`bigint`?t.toString():t}var ZEe=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function P0(e){return new ZEe(e)}function QEe(e){return e==null}function F0(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function $Ee(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){let e=t._zod.def.shape[a];return r?r(e,a):e}):V0(e,a,r?r(n.value,a):n.value))}}function tDe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?B0(e,n,()=>t[n]):V0(e,n,r.value))}}function U0(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function nDe(e){return JSON.stringify(e)}function rDe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var W0=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function G0(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var iDe=P0(()=>{if(x2.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function K0(e){if(G0(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return G0(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function q0(e){return K0(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var aDe=new Set([`string`,`number`,`symbol`]);function J0(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Y0(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function X0(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Z0(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function oDe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Q0={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sDe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function cDe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return H0(i,e,$0(e,t)),Y0(e,U0(n,{shape:i,checks:[]}))}function $0(e,t){let n=z0(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function lDe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set($0(e,t)),a={};return H0(a,e,Reflect.ownKeys(z0(e)).filter(e=>!i.has(e))),Y0(e,U0(n,{shape:a,checks:[]}))}function uDe(e,t){if(!K0(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=z0(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Y0(e,U0(e._zod.def,{shape:e2(e,t)}))}function e2(e,t){let n={};return H0(n,e,Reflect.ownKeys(z0(e))),tDe(n,t),n}function dDe(e,t){if(!K0(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Y0(e,U0(e._zod.def,{shape:e2(e,t)}))}function fDe(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return H0(n,e,Reflect.ownKeys(z0(e))),H0(n,t,Reflect.ownKeys(z0(t))),Y0(e,U0(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function t2(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set($0(t,n)):void 0,o={};return H0(o,t,Reflect.ownKeys(z0(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Y0(t,U0(t._zod.def,{shape:o,checks:[]}))}function pDe(e,t,n){let r=n?new Set($0(t,n)):void 0,i={};return H0(i,t,Reflect.ownKeys(z0(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Y0(t,U0(t._zod.def,{shape:i}))}function n2(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function i2(e){return typeof e==`string`?e:e?.message}function a2(e,t,n){var r;for(let i=t;ie;return t[SDe]=!0,t}var g2,wDe=Object.freeze({status:`aborted`}),_2={value:void 0,enumerable:!1},v2=`captureStackTrace`in Error?Error:null;function TDe(e){let t=v2;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return v2=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){_2.value=new a(r);try{Object.defineProperty(n,"_zod",_2)}finally{_2.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),_De(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?TDe(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var y2=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},b2=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(g2=globalThis).__zod_globalConfig??(g2.__zod_globalConfig={});var x2=globalThis.__zod_globalConfig;function S2(e){return e&&Object.assign(x2,e),x2}function EDe(){let e=this._zod;return e.message??=JSON.stringify(e.def,N0,2),e.message}function DDe(e){this._zod.message=e}var ODe={get:EDe,set:DDe,enumerable:!0,configurable:!0},C2={value:void 0,enumerable:!1},w2=new WeakSet([Object.prototype,Error.prototype]),T2=(e,t)=>{e.name=`$ZodError`,C2.value=t,Object.defineProperty(e,"issues",C2),C2.value=void 0,Object.defineProperty(e,"message",ODe);let n=Object.getPrototypeOf(e);w2.has(n)||(w2.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},kDe=J(`$ZodError`,T2);J(`$ZodError`,T2,void 0,{Parent:Error});function ADe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function jDe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ADe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function MDe(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new y2;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>o2(e,o,S2())));throw W0(n,a?.callee??t),n}return s.value};return t},O2=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>o2(e,o,S2())));throw W0(n,a?.callee??t),n}return s.value};return t},k2=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new y2;return a.issues.length?A2(e,a.issues,i):{success:!0,data:a.value}};function A2(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>o2(e,n,S2()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var j2=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?A2(e,a.issues,i):{success:!0,data:a.value}},NDe=Symbol.for(`zod.compile.invalid`),PDe=Symbol.for(`zod.compile.fallback`),FDe=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==NDe)return!0;if(r.definite===!0&&n===void 0)return!1}return IDe(e,t,n)});function IDe(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[PDe]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new y2;return a.issues.length===0}var LDe=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},RDe=e=>{let t=D2(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,E2(n,a))};return n},zDe=e=>{let t=D2(e),n=(e,r,i,a)=>t(e,r,i,E2(n,a));return n},BDe=e=>{let t=O2(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,E2(n,a))};return n},VDe=e=>{let t=O2(e),n=async(e,r,i,a)=>await t(e,r,i,E2(n,a));return n},HDe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return k2(e)(t,n,i)},UDe=e=>(t,n,r)=>k2(e)(t,n,r),WDe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return j2(e)(t,n,i)},GDe=e=>async(t,n,r)=>j2(e)(t,n,r),KDe=/^[cC][0-9a-z]{6,}$/,qDe=/^[0-9a-z]+$/,JDe=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,YDe=/^[0-9a-vA-V]{20}$/,XDe=/^[A-Za-z0-9]{27}$/,ZDe=/^[a-zA-Z0-9_-]{21}$/;function QDe(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var $De=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eOe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,M2=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tOe=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nOe=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function rOe(){return new RegExp(nOe,`u`)}var iOe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aOe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,oOe=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sOe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cOe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lOe=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,uOe=/^https?$/,dOe=/^\+[1-9]\d{6,14}$/,N2=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function fOe(e){return RegExp(`^${e}$`)}var pOe=fOe(N2);function P2(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mOe(e){return RegExp(`^${P2(e)}$`)}function hOe(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${P2({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${P2({precision:e.precision})}`:n;return RegExp(`^${N2}T(?:${r})$`)}var gOe=/^[\s\S]{0,}$/,_Oe=/^-?\d+$/,F2=/^-?\d+(?:\.\d+)?$/,vOe=/^(?:true|false)$/i,yOe=/^null$/i,bOe=/^undefined$/i,xOe=/^[^A-Z]*$/,SOe=/^[^a-z]*$/,I2=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),L2=e=>{let t=e.value;return!QEe(t)&&t.length!==void 0},R2={number:`number`,bigint:`bigint`,object:`date`},z2=J(`$ZodCheckLessThan`,(e,t)=>{I2.init(e,t);let n=R2[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{I2.init(e,t);let n=R2[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:R2[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),COe=J(`$ZodCheckMultipleOf`,(e,t)=>{I2.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):$Ee(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),wOe=J(`$ZodCheckNumberFormat`,(e,t)=>{I2.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Q0[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),TOe=J(`$ZodCheckMaxLength`,(e,t)=>{var n;I2.init(e,t),(n=e._zod.def).when??(n.when=L2),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?s2(r):i)<=t.maximum)return;let a=c2(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),EOe=J(`$ZodCheckMinLength`,(e,t)=>{var n;I2.init(e,t),(n=e._zod.def).when??(n.when=L2),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=c2(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),DOe=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;I2.init(e,t),(n=e._zod.def).when??(n.when=L2),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?s2(r):i;if(a===t.length)return;let o=c2(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),V2=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;I2.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),OOe=J(`$ZodCheckRegex`,(e,t)=>{V2.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kOe=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xOe,V2.init(e,t)}),AOe=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=SOe,V2.init(e,t)}),jOe=J(`$ZodCheckIncludes`,(e,t)=>{I2.init(e,t);let n=J0(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),MOe=J(`$ZodCheckStartsWith`,(e,t)=>{I2.init(e,t);let n=RegExp(`^${J0(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),NOe=J(`$ZodCheckEndsWith`,(e,t)=>{I2.init(e,t);let n=RegExp(`.*${J0(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),POe=J(`$ZodCheckOverwrite`,(e,t)=>{I2.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),FOe=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +`)}},{xAxis:e.to}]),m=e.series??[];if(!m.length)return e;let h=e.grid??{},g=Array.isArray(e.yAxis)?e.yAxis[0]:e.yAxis,_=h.containLabel?(g?.axisLabel?.width??64)+(g?.axisLabel?.margin??8):0,v=(typeof h.left==`number`?h.left:8)+_,y=o.width-(typeof h.right==`number`?h.right:16),b=Math.max(1,y-v),x=e=>o.measureText?.(e,`12px ${a.font}`)??e.length*12,S=e.legend,C=0;for(let e of S?.data??[]){let t=15+x(S?.formatter?.(e)??e);if(C&&C+(S?.itemGap??6)+t>o.width)break;C+=(C?S?.itemGap??6:0)+t}let w=[...p.length?[{text:`anomaly`,details:p.map(e=>e[0].tooltip.formatter()).join(`
`)}]:[],...[...d].sort((e,t)=>e.xAxis-t.xAxis).map(e=>({text:e.name,details:e.tooltip.formatter()}))],T=w.reduce((e,t)=>e+x(t.text)+12,0),E=!!(S?.show&&T<=o.width-16-C-12),D=E?o.width-16-C-12:b,O=0,k=w.filter(e=>{let t=x(e.text)+12;return O+t>D?!1:(O+=t,!0)}),A=(typeof h.top==`number`?h.top:8)+(k.length&&!E?18:0),j=E?1:A-17,M=E?16:typeof h.right==`number`?h.right:16,N=k.map(e=>{let t=x(e.text),n={type:`text`,right:M,top:j,annotation:!0,style:{text:e.text,fill:a.muted,backgroundColor:a.surface,padding:[1,3],fontSize:11,fontFamily:a.font,width:t,stroke:a.surface,lineWidth:3},tooltip:{formatter:()=>e.details}};return M+=t+12,n}),P=e=>e?.type===`value`||e?.type===`log`?{...e,...xy(e,o.height-A-Number(h.bottom??8)-22),axisLabel:{...e.axisLabel,hideOverlap:!0}}:e,F=Array.isArray(e.yAxis)?e.yAxis.map(P):e.yAxis?P(e.yAxis):void 0,ee=m,te=[...e.graphic??[],...N];if(t.viz===`state_timeline`&&F&&!Array.isArray(F)){let e=F.data,t=Math.max(1,Math.floor((o.height-A-Number(h.bottom??8)-22)/16));if(e.length>t){F={...F,data:e.slice(0,t)},ee=m.map(e=>({...e,data:e.data.filter(e=>e.value[1]e.style?.text?.match(/^\+\d+ rows$/)),r=e.length-t+Number(n?.style.text.match(/\d+/)?.[0]??0);te=te.filter(e=>e!==n),te.push({type:`text`,right:0,bottom:0,style:{text:`+${r} rows`,fill:a.muted,fontSize:11,fontFamily:a.font},tooltip:{formatter:()=>e.slice(t).map(Oy).join(`
`)+(n?`
`+n.tooltip.formatter():``)}})}}return{...e,...d.length||p.length?{tooltip:{...e.tooltip??{},renderMode:`html`}}:{},grid:{...h,top:A},...F?{yAxis:F}:{},graphic:te,series:ee.map((e,t)=>{if(t!==0)return e;let n=e.markLine??{},r=e.markArea??{};return{...e,markLine:{...n,silent:!1,symbol:[`none`,`none`],data:[...n.data??[],...d]},markArea:{...r,silent:!1,data:[...r.data??[],...p]}}})}}function zCe({panel:e,title:t=e.title,result:n,dark:r,height:i,group:a,annotations:o,vars:s,onSelect:c,onPoint:l,onZoom:u,onRangePending:d}){let f=(0,A.useMemo)(()=>t=>{let i=By(r),a=bre(e,n,i,t);return o?L$(a,e,n,o,s??{},i,t):a},[e,n.frame,n.previous,n.shift_ms,n.from_ms,n.to_ms,n.annotation_scope,n.annotation_error,r,o]),p=(0,A.useMemo)(()=>f({width:500,height:i}),[f,i]),m=(0,A.useCallback)(t=>!!eb(e,n,t),[e,n]);return(0,R.jsx)(pX,{keyboard:{canSelect:m,interval:n.interval,onRangePending:d,bounds:n.from_ms!==void 0&&n.to_ms!==void 0?{from:n.from_ms,to:n.to_ms}:void 0},option:p,optionForSize:f,height:i,label:`${t}: time series`,group:a,onZoom:u,onClick:l||c?t=>{let r=eb(e,n,t);if(!r)return;l?.(r);let i=Object.values(r.dimensions)[0];i!==void 0&&c?.(i)}:void 0})}function BCe(e){return e.dark?[`#0f2a43`,`#164267`,`#1e5a8a`,`#2879ae`,`#399aca`,`#57b8e3`,`#7dd3fc`]:[`#dbeafe`,`#bfdbfe`,`#93c5fd`,`#60a5fa`,`#3b82f6`,`#2563eb`,`#1d4ed8`]}function R$(e,t){return e<=1?0:e>=t?6:Math.max(0,Math.min(6,Math.floor(Math.log10(Math.max(1,e))/Math.log10(t)*6)))}var z$={healthy:`●`,degraded:`■`,unhealthy:`◆`,unknown:`○`},B$=(e,t)=>et);function V$(e,t={}){let n=new Map(e.columns.map((e,t)=>[e.name,t])),r=(t,r)=>e.values[n.get(t)??-1]?.[r],i=(e,t)=>String(r(e,t)??``),a=(e,t)=>{let n=r(e,t);return typeof n==`number`&&Number.isFinite(n)?n:null},o=t.from_ms!==void 0&&t.to_ms!==void 0&&t.to_ms>t.from_ms?(t.to_ms-t.from_ms)/1e3:void 0,s=e=>o&&e!==null?e/o:null,c=new Map,l=[];for(let t=0;t=5?`bad`:c>=1?`warn`:null})}for(let e of l)for(let t of[e.caller,e.callee])c.has(t)||c.set(t,{id:t,health:`unknown`,spans:null,p95_ms:null,error_rate:null,request_rate:null});return{nodes:[...c.values()].sort((e,t)=>B$(e.id,t.id)),edges:l.sort((e,t)=>B$(e.id,t.id))}}function VCe(e){let t=e=>typeof e==`number`&&Number.isFinite(e)?e:null,n=(e,t)=>{let n=Math.max(0,Math.min(1,e/100)),r=3.8416;return Math.max(0,(n+r/(2*t)-1.96*Math.sqrt(n*(1-n)/t+r/(4*t*t)))/(1+r/t))};return e.filter(e=>typeof e.service==`string`).map(e=>{let r=Math.max(0,t(e.spans)??0),i=t(e.error_rate),a=r>=20&&i!==null;return{name:String(e.service),health:String(e.health??`unknown`),n:r,eligible:a,score:a?n(i,r):0,metric:i===null?`—`:`${i.toFixed(1)}%`}}).sort((e,t)=>Number(t.eligible)-Number(e.eligible)||(e.eligible?t.score-e.score:0)||t.n-e.n||B$(e.name,t.name)).slice(0,4)}function HCe(e){let t=/^(\d+)(s|m|h|d)$/.exec(e??``);return t?Number(t[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[t[2]]:6e4}var H$=(e,t)=>fre(typeof e.bucket_lower==`number`?e.bucket_lower:null,typeof e.bucket_upper==`number`?e.bucket_upper:null,t),U$=e=>`${e.bucket_lower}:${e.bucket_upper}`,W$=e=>typeof e?.bucket_lower==`number`?{lower:e.bucket_lower,upper:typeof e.bucket_upper==`number`?e.bucket_upper:void 0}:void 0,UCe=e=>e>=1e3&&e<1e6&&e%1e3==0?`${e/1e3}k`:hy(`count`,e);function WCe(e){let t=[];for(let n of[...e].sort((e,t)=>Number(e.value[1])-Number(t.value[1])||Number(e.value[0])-Number(t.value[0]))){let e=t.at(-1);e&&e.value[1]===n.value[1]&&e.value[4]===n.value[4]&&e.value[3]===n.value[0]?(e.value[3]=n.value[3],e.selection.to=n.selection.to):t.push({...n,value:[...n.value],selection:{...n.selection}})}return t}function G$(e,t){return(e.bucket_lower===null?-1/0:Number(e.bucket_lower))-(t.bucket_lower===null?-1/0:Number(t.bucket_lower))||(e.bucket_upper===null?1/0:Number(e.bucket_upper))-(t.bucket_upper===null?1/0:Number(t.bucket_upper))}function K$(e,t){let n=(t.frame?.columns??[]).map(e=>e.name+(e.unit?` (${e.unit})`:``)).join(`, `);return`${e.title}: ${t.frame?.rows??0} rows; ${n}${t.frame?.truncated?`, limited data`:``}`}function GCe(e,t,n,r={width:500,height:248}){let i=t.frame??{columns:[],values:[],rows:0},a=R_(i),o=i.columns.filter(e=>e.role===`dimension`).map(e=>e.name),s=i.columns.filter(e=>e.role===`measure`),c=e.unit??i.columns.find(e=>e.name===`bucket_lower`)?.unit,l={animation:!1,aria:{enabled:!0,description:K$(e,t)},textStyle:{fontFamily:n.font,color:n.text},grid:{left:70,right:24,top:30,bottom:40,containLabel:!0},tooltip:{trigger:`item`,backgroundColor:n.surface,borderColor:n.border,textStyle:{color:n.text,fontFamily:n.font,fontSize:12},renderMode:`html`,formatter:Ay(t=>hy(e.unit,t))},legend:{show:!1,textStyle:{color:n.muted}},xAxis:{type:`value`,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11},splitLine:{lineStyle:{color:n.grid}}},yAxis:{type:`value`,splitNumber:vy(r.height-92),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11},splitLine:{lineStyle:{color:n.grid}}},series:[]};if(e.viz===`scatter`){let t=o[0],i=o[1],c=My([...new Set(a.map(e=>i?String(e[i]??``):`Items`))].map(e=>({name:e})),e),u=Fy(c.map(e=>e.name),r.width,c.length>1&&e.options?.legend!==`hidden`,n.text,n.font,r.measureText),d=e.options?.x_scale??e.options?.scale,f=e.options?.y_scale??e.options?.scale,p=e.x_unit??s[0]?.unit,m=e.unit??s[1]?.unit,h=(e,t,r,i)=>{let o=a.map(e=>e[r]).filter(e=>typeof e==`number`&&Number.isFinite(e)),s=Math.min(0,...o),c=Math.max(0,...o);return{type:t===`log`?`log`:`value`,...t===`log`?{splitNumber:vy(i)}:by(s,c,e,i),axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},splitLine:{lineStyle:{color:n.grid}},axisLabel:{fontFamily:n.font,fontSize:11,color:n.muted,formatter:gy(e),hideOverlap:!0}}};return{...l,tooltip:{...l.tooltip,formatter:e=>(Array.isArray(e)?e:[e]).map(e=>{let t=Array.isArray(e.value)?e.value:[];return ky([`${e.seriesName??``} · ${e.name??``}`,`${s[0]?.name??`x`}: ${hy(p,Number(t[0]))}`,`${s[1]?.name??`y`}: ${hy(m,Number(t[1]))}`])}).join(`
`)},legend:u.option,grid:{...l.grid,top:u.option.show?u.top+20:28,left:8,right:16,bottom:32},xAxis:{...h(p,d,s[0]?.name,r.width-80),name:s[0]?.name??`x`,nameLocation:`middle`,nameGap:28,nameTextStyle:{color:n.muted,fontFamily:n.font,fontSize:11,align:`right`,verticalAlign:`top`}},yAxis:{...h(m,f,s[1]?.name,r.height-u.top-74),name:s[1]?.name??`y`,nameLocation:`end`,nameGap:8,nameRotate:0,nameTextStyle:{color:n.muted,fontFamily:n.font,fontSize:11,align:`right`,verticalAlign:`bottom`}},series:c.map(({name:r,items:c},l)=>({type:`scatter`,name:r,interactive:!0,keyboard_unit:m,keyboard_x_unit:p,itemStyle:Ry(jy(r)?n.muted:i_(l,n.dark),n),data:a.filter(e=>!i||c.some(t=>t.name===String(e[i]??``))).filter(e=>typeof e[s[0]?.name]==`number`&&typeof e[s[1]?.name]==`number`).filter(e=>(d!==`log`||Number(e[s[0].name])>0)&&(f!==`log`||Number(e[s[1].name])>0)).map(n=>({name:String(n[t]??``),value:[n[s[0].name],n[s[1].name]],selection:{dimensions:Object.fromEntries((e.query?.by??[]).map((e,t)=>[e,String(n[o[t]]??``)]))}}))}))}}if(e.viz===`histogram`){let t=o.find(e=>e!==`bucket_lower`&&e!==`bucket_upper`),i=[...new Map([...a].sort(G$).map(e=>[U$(e),e])).values()],s=i.map(e=>H$(e,c)),u=My([...new Set(a.map(e=>t?String(e[t]??``):`Count`))].map(e=>({name:e})),e),d=Fy(u.map(e=>e.name),r.width,u.length>1&&e.options?.legend!==`hidden`,n.text,n.font,r.measureText),f=u.map(({name:r,items:o},s)=>({type:`bar`,name:r,interactive:!0,keyboard_unit:`count`,itemStyle:Ry(jy(r)?n.muted:i_(s,n.dark),n),data:i.map(n=>{let i=a.filter(e=>(!t||o.some(n=>n.name===String(e[t]??``)))&&U$(e)===U$(n));return{value:_re(i.map(e=>typeof e.count==`number`?e.count:null))??0,selection:{dimensions:t?{[e.query?.by?.[0]??t]:r}:{},bucket:W$(i[0])}}})}));return{...l,legend:d.option,grid:{...l.grid,left:16,right:8,top:d.option.show?d.top+20:28,bottom:8},xAxis:{...l.xAxis,type:`category`,data:s,splitLine:{show:!1}},yAxis:{...l.yAxis,type:`value`,name:`count`,nameLocation:`end`,nameGap:8,nameRotate:0,...by(0,Math.max(0,...f.flatMap(e=>e.data.map(e=>e.value))),`count`,r.height-(d.option.show?d.top+20:28)-30),axisLabel:{...l.yAxis.axisLabel,hideOverlap:!0},nameTextStyle:{color:n.muted,fontFamily:n.font,fontSize:11,align:`right`,verticalAlign:`bottom`}},series:f}}if(e.viz===`service_map`)return{model:V$(i,t)};if(e.viz===`heatmap`||e.viz===`state_timeline`){let i=e.viz===`heatmap`,u=o[0],d=e=>i?U$(e):String(e[u]??``),f=[...new Set((i?[...a].sort(G$):a).map(d))],p=i?f:f.slice(0,Math.max(1,Math.floor((r.height-54)/16))),m=f.slice(p.length),h=new Map(a.map(e=>[U$(e),H$(e,c)])),g=HCe(t.interval),_=s[0]?.name??`count`,v=a.filter(e=>typeof e.time==`number`&&p.includes(d(e))).map(r=>{let a=r[_],o=typeof a==`number`?uy(a,e.thresholds,e.better??t.better)??`ok`:null;return{value:[r.time,p.indexOf(d(r)),a,Number(r.time)+g,i||o===null?0:o===`bad`?3:o===`warn`?2:1],selection:{...i?{time:r.time}:{},dimensions:i?{}:{[e.query?.by?.[0]??u]:String(r[u]??``)},bucket:i?W$(r):void 0,...i?{}:{from:new Date(Number(r.time)).toISOString(),to:new Date(Number(r.time)+g).toISOString()}},itemStyle:i?void 0:{color:o===null?`${n.text}26`:n.status[o]}}}),y=v.filter(e=>Number.isFinite(Number(e.value[2]))&&Number(e.value[2])>0),b=y.map(e=>Number(e.value[2])).sort((e,t)=>e-t),x=b[Math.max(0,Math.ceil(b.length*.99)-1)]??1,S=BCe(n),C=i?y.map(e=>({...e,value:[...e.value,R$(Number(e.value[2]),x)]})):WCe(v).map(e=>({...e,tooltip:{formatter:()=>`${Oy(p[Number(e.value[1])])} · ${[`Unknown`,`OK`,`Warn`,`Bad`][Number(e.value[4])]}\n${Cy(Number(e.value[0]))} – ${Cy(Number(e.value[3]))}`}})),w=UCe(b.length?x:0);return{...l,grid:{...l.grid,left:8,right:8,top:8,bottom:i?32:m.length?24:8},tooltip:{...l.tooltip,trigger:`axis`,formatter:t=>(Array.isArray(t)?t:[t]).map(t=>{let n=Array.isArray(t.value)?t.value:[];return ky([`${t.seriesName??``} · ${t.name??``}`,i?h.get(p[Number(n[1])])??``:p[Number(n[1])]??``,`${Cy(Number(n[0]))} – ${Cy(Number(n[3]))}`,`${_}: ${hy(i?`count`:e.unit??s[0]?.unit,typeof n[2]==`number`?n[2]:null)}`])}).join(`
`)},axisPointer:{link:[{xAxisIndex:`all`}]},xAxis:{type:`time`,min:t.from_ms,max:t.to_ms,axisPointer:{show:!0},axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{fontFamily:n.font,fontSize:11,color:n.muted,formatter:Sy,hideOverlap:!0}},yAxis:{type:`category`,data:i?p.map(e=>h.get(e)):p,axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{fontFamily:n.font,fontSize:11,color:n.muted,width:140,overflow:`truncate`,...i?{interval:+((r.height-60)/Math.max(1,p.length)<12),hideOverlap:!0}:{interval:0}}},visualMap:i?{type:`continuous`,show:!0,orient:`horizontal`,right:16,bottom:0,padding:0,itemWidth:8,itemHeight:96,text:[w,b.length?`1`:`0`],textGap:10,textStyle:{color:n.muted,fontFamily:n.font,fontSize:11},min:0,max:6,dimension:5,inRange:{color:S}}:void 0,graphic:!i&&m.length?[{type:`text`,right:0,bottom:0,style:{text:`+${m.length} rows`,fill:n.muted,fontSize:11,fontFamily:n.font},tooltip:{formatter:()=>m.map(Oy).join(`
`)}}]:[],series:[{type:`custom`,clip:!0,name:e.title,interactive:!0,keyboard_unit:i?`count`:e.unit??s[0]?.unit,encode:{x:[0,3],y:1,tooltip:2},data:C,renderItem:(e,t)=>{let n=t.coord([t.value(0),t.value(1)]),r=t.coord([t.value(3),t.value(1)]),a=Math.abs(t.size([0,1])[1])*(i?1:.65),o=i&&Math.abs(r[0]-n[0])>=8?1:0;if(!i||t.value(2)>0)return{type:`rect`,shape:{x:n[0]+o/2,y:n[1]-a/2+o/2,width:Math.max(0,r[0]-n[0]-o),height:Math.max(0,a-o),r:i?0:Math.min(3,a/4)},style:{fill:t.visual(`color`),stroke:void 0,lineWidth:0,...i?{fill:S[R$(t.value(2),x)]}:{}}}}}]}}return l}function q$({panel:e,title:t,result:n,dark:r,height:i,group:a,annotations:o,vars:s,onSelect:c,onPoint:l,onZoom:u,onRangePending:d}){let f=(0,A.useMemo)(()=>t=>{let i=By(r),a=GCe(e,n,i,t);return o?L$(a,e,n,o,s??{},i,t):a},[e,n.frame,n.interval,n.better,n.from_ms,n.to_ms,n.annotation_scope,n.annotation_error,r,o]),p=K$(t?{...e,title:t}:e,n),m=(0,A.useMemo)(()=>f({width:500,height:i}),[f,i]),h=(0,A.useCallback)(t=>!!(t.data?.selection&&eb(e,n,t)),[e,n]),g=e.viz===`heatmap`||e.viz===`state_timeline`;return(0,R.jsx)(pX,{keyboard:{canSelect:h,onRangePending:d,bounds:g&&n.from_ms!==void 0&&n.to_ms!==void 0?{from:n.from_ms,to:n.to_ms}:void 0},option:m,optionForSize:f,height:i,label:p,group:g?a:void 0,onZoom:g?u:void 0,onClick:l||c?t=>{let r=h(t)?eb(e,n,t):void 0;if(r){l?.(r);let e=Object.values(r.dimensions)[0];e!==void 0&&c?.(e)}}:void 0})}function KCe(e){return(0,R.jsx)(q$,{...e})}function qCe(e){return(0,R.jsx)(q$,{...e})}function JCe(e){return(0,R.jsx)(q$,{...e})}function YCe(e){return(0,R.jsxs)(dh,{gap:4,style:{flex:`1 1 auto`,minHeight:0},children:[(0,R.jsx)(q$,{...e,height:Math.max(60,e.height-24)}),(0,R.jsx)(yl,{gap:`sm`,wrap:`nowrap`,role:`list`,"aria-label":`State legend`,style:{flexShrink:0},children:[[`● OK`,`ok`],[`■ Warn`,`warn`],[`◆ Bad`,`bad`],[`○ Unknown`,`dimmed`]].map(([t,n])=>(0,R.jsx)(Dd,{size:`xs`,style:{color:n===`dimmed`?By(e.dark).muted:zy(n,e.dark)},role:`listitem`,children:t},t))})]})}var J$=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,'(function(){var e=Object.defineProperty,t=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,n=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},r=(e,n,r)=>t(e,typeof n==`symbol`?n:n+``,r),i={};n(i,{Graph:()=>D,alg:()=>_});var a=Object.defineProperty,o=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},s=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\\0`,this._children[e]={},this._children[`\\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\\0`)return t}}children(e=`\\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,l=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,l=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,l=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let f=u(this._isDirected,i,a,o);if(f in this._edgeLabels)return l&&(this._edgeLabels[f]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[f]=l?s:this._defaultEdgeLabelFn(i,a,o);let p=d(this._isDirected,i,a,o);return i=p.v,a=p.w,Object.freeze(p),this._edgeObjs[f]=p,c(this._preds[a],i),c(this._sucs[i],a),this._in[a][f]=p,this._out[i][f]=p,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],l(this._preds[t],e),l(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function c(e,t){e[t]?e[t]++:e[t]=1}function l(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function u(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\\0`:r)}function d(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function f(e,t){return u(e,t.v,t.w,t.name)}o({},{read:()=>g,write:()=>p});function p(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:m(e),edges:h(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function m(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function h(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function g(e){let t=new s(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var _={};o(_,{CycleException:()=>w,bellmanFord:()=>y,components:()=>x,dijkstra:()=>C,dijkstraAll:()=>ne,findCycles:()=>ie,floydWarshall:()=>oe,isAcyclic:()=>ce,postorder:()=>de,preorder:()=>fe,prim:()=>pe,shortestPaths:()=>me,tarjan:()=>re,topsort:()=>T});var v=()=>1;function y(e,t,n,r){return b(e,String(t),n||v,r||function(t){return e.outEdges(t)??[]})}function b(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+oe.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n>1,!(t[r].priority1;function C(e,t,n,r){return te(e,String(t),n||ee,r||function(t){return e.outEdges(t)??[]})}function te(e,t,n,r){let i={},a=new S,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function ne(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=C(e,i,t,n),r},{})}function re(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ie(e){return re(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var ae=()=>1;function oe(e,t,n){return se(e,t||ae,n||function(t){return e.outEdges(t)??[]})}function se(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=E(e,t,n===`post`,o,a,r,i)}),i}function E(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=E(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function ue(e,t,n){return le(e,t,n,function(e,t){return e.push(t),e},[])}function de(e,t){return ue(e,t,`post`)}function fe(e,t){return ue(e,t,`pre`)}function pe(e,t){var n;let r=new s,i={},a=new S,o;function c(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(u)throw Error(`Input graph is not connected: `+e);u=!0}(n=e.nodeEdges(o))==null||n.forEach(c)}return r}function me(e,t,n,r){return he(e,t,n,r??(t=>e.outEdges(t)??[]))}function he(e,t,n,r){if(n===void 0)return C(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function _e(e){let t=new D({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function ve(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function k(e){let t=F(N(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function ye(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=M(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function be(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=M(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function A(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),O(e,`border`,i,t)}function xe(e,t=j){let n=[];for(let r=0;rj?e(...xe(t).map(t=>e(...t))):e(...t)}function N(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return M(Math.max,t)}function Se(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ce(e,t){return t()}var we=0;function P(e){return e+(``+ ++we)}function F(e,t,n=1){t??(t=e,e=0);let r=e=>ete[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Te(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var R=`\\0`;function z(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var Ee=class{constructor(){r(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return B(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&B(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,De)),n=n._prev;return`[`+e.join(`, `)+`]`}};function B(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function De(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Oe=Ee,ke=()=>1;function Ae(e,t){if(e.nodeCount()<=1)return[];let n=Me(e,t||ke);return je(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function je(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)V(e,t,n,o);for(;o=i.dequeue();)V(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(V(e,t,n,o,!0)||[]);break}}}return r}function V(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,H(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,H(t,n,o)}),e.removeNode(r.v),o}function Me(e,t){let n=new D,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Ne(i+r+3).map(()=>new Oe),o=r+1;return n.nodes().forEach(e=>{H(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function H(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Ne(e){let t=[];for(let n=0;n{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,P(`rev`))});function n(e){return t=>e.edge(t).weight}}function Fe(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Le(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Ie(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Le(e,t,n){let r=/* @__PURE__ */ new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Re(e){e.graph().dummyChains=[],e.edges().forEach(t=>ze(e,t))}function ze(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function U(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=M(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function W(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ve=He;function He(e){let t=new D({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;Ue(t,e){let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!W(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function We(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=W(t,r)),it.node(e).rank+=n)}var{preorder:Ke,postorder:qe}=_,Je=G;G.initLowLimValues=q,G.initCutValues=K,G.calcCutValue=Xe,G.leaveEdge=Qe,G.enterEdge=$e,G.exchangeEdges=et;function G(e){e=ge(e),U(e);let t=Ve(e);q(t),K(t,e);let n,r;for(;n=Qe(t);)r=$e(t,e,n),et(t,e,n,r)}function K(e,t){let n=qe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>Ye(e,t,n))}function Ye(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Xe(e,t,n)}function Xe(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,nt(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function q(e,t){arguments.length<2&&(t=e.nodes()[0]),Ze(e,{},1,t)}function Ze(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Ze(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Qe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function $e(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===rt(e,e.node(t.v),s)&&c!==rt(e,e.node(t.w),s)).reduce((e,n)=>W(t,n)!e.node(t).parent);if(!n)return;let r=Ke(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function nt(e,t,n){return e.hasEdge(t,n)}function rt(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var it=at;function at(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:ct(e);break;case`tight-tree`:st(e);break;case`longest-path`:ot(e);break;case`none`:break;default:ct(e)}}var ot=U;function st(e){U(e),Ve(e)}function ct(e){Je(e)}var lt=ut;function ut(e){let t=ft(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=dt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRanko||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function ft(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(R).forEach(r),t}function pt(e){let t=O(e,`root`,{},`_root`),n=mt(e),r=Object.values(n),i=M(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=ht(e)+1;e.children(R).forEach(r=>{J(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function J(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=A(e,`_bt`),l=A(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{J(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function mt(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(R).forEach(e=>n(e,1)),t}function ht(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function gt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var _t=vt;function vt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;tCt(e.node(t))),e.edges().forEach(t=>Ct(e.edge(t)))}function Ct(e){let t=e.width;e.width=e.height,e.height=t}function wt(e){e.nodes().forEach(t=>Y(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Y),Object.hasOwn(r,`y`)&&Y(r)})}function Y(e){e.y=-e.y}function Tt(e){e.nodes().forEach(t=>X(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(X),Object.hasOwn(r,`x`)&&X(r)})}function X(e){let t=e.x;e.x=e.y,e.y=t}function Et(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=F(M(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return z(t,e.node(n),e.node(r))}return a}function Dt(e,t){let n=0;for(let r=1;rt)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function kt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function At(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),jt(Object.values(n).filter(e=>!e.indegree))}function jt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Mt(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>I(e,[`vs`,`i`,`barycenter`,`weight`]))}function Mt(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Nt(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Se(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(Ft(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Pt(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Pt(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Pt(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Ft(e,t,n){return(r,i)=>{if(r.barycenteri.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=z(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function It(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=kt(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=It(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&Rt(t,r)}});let h=At(m,n);Lt(h,p);let g={},_=!1;for(let t=0;t{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Rt(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function zt(e,t,n,r){r||=e.nodes();let i=Bt(e),a=new D({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Bt(e){let t;for(;e.hasNode(t=P(`_root`)););return t}function Vt(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Ht(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Ht);return}let r=N(e),i=Ut(e,F(1,r+1),`inEdges`),a=Ut(e,F(r-1,-1,-1),`outEdges`),o=Et(e,n);if(Gt(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){Wt(t%2?i:a,t%4>=2,l,n),o=k(e);let u=Dt(e,o);u{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return zt(e,t,n,r.get(t)||[])})}function Wt(e,t,n,r){let i=!0,a=new D;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=It(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),Vt(e,a,s.vs)})}function Gt(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Kt(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Jt(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.ordero)&&Yt(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Jt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Yt(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Xt(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Zt(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||sn(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>sn(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function $t(e,t,n,r){let i=new D,a=e.graph(),o=an(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function en(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=on(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-M(Math.min,c);a!==`l`&&(l=i-M(Math.max,c)),l&&(e[o]=L(s,e=>e+l))})})}function nn(e,t=void 0){let n=e.ul;return n?L(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function rn(e,t){let n=k(e),r=Object.assign(Kt(e,n),qt(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=Zt(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=Qt(e,a,s.root,s.align,n===`r`);n===`r`&&(c=L(c,e=>-e)),i[o+n]=c})}),tn(i,en(e,i)),nn(i,e.graph().align)}function an(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function on(e,t){return e.node(t).width}function sn(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function cn(e,t){e=_e(e),ln(e),Object.entries(rn(e,t)).forEach(([t,n])=>e.node(t).x=n)}function ln(e){let t=k(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var un=/* @__PURE__ */ new WeakMap;function dn(e,t={}){return pn(e,Ce,t),e}function fn(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function pn(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new D({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=/* @__PURE__ */ new Set;e.edges().forEach(t=>{let n=fn(e,t.v,r),i=fn(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),pn(o,t,n);let l=wn(o);mn(l,t,n,null),hn(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=/* @__PURE__ */ new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=/* @__PURE__ */ new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=/* @__PURE__ */ new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=/* @__PURE__ */ new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=wn(e),g=mn(h,t,n,un.get(e)??null);un.set(e,g),hn(e,h),m.forEach(t=>{let n=t.indexOf(`\\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function mn(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>Tn(e)),t(` removeSelfEdges`,()=>Pn(e)),t(` acyclic`,()=>Pe(e,s)),t(` nestingGraph.run`,()=>pt(e)),t(` rank`,()=>it(_e(e))),t(` injectEdgeLabelProxies`,()=>En(e)),t(` removeEmptyRanks`,()=>be(e)),t(` nestingGraph.cleanup`,()=>gt(e)),t(` normalizeRanks`,()=>ye(e)),t(` assignRankMinMax`,()=>Dn(e)),t(` removeEdgeLabelProxies`,()=>On(e)),t(` normalize.run`,()=>Re(e)),t(` parentDummyChains`,()=>lt(e)),t(` addBorderSegments`,()=>_t(e)),t(` order`,()=>Ht(e,n,c)),t(` insertSelfEdges`,()=>Fn(e)),t(` adjustCoordinateSystem`,()=>bt(e)),t(` position`,()=>cn(e,n.corePath)),t(` positionSelfEdges`,()=>In(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>Nn(e)),t(` normalize.undo`,()=>Be(e)),t(` fixupEdgeLabelCoords`,()=>jn(e)),t(` undoCoordinateSystem`,()=>xt(e)),t(` translateGraph`,()=>kn(e)),t(` assignNodeIntersects`,()=>An(e)),t(` reversePoints`,()=>Mn(e)),t(` acyclic.undo`,()=>Ie(e)),{graph:e,rawNodes:l}}function hn(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var gn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],_n={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},vn=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],yn=[`width`,`height`,`rank`],bn={width:0,height:0},xn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Sn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Cn=[`labelpos`];function wn(e){let t=new D({multigraph:!0,compound:!0}),n=Q(e.graph());return t.setGraph(Object.assign({},_n,Z(n,gn),I(n,vn))),e.nodes().forEach(n=>{let r=Z(Q(e.node(n)),yn);Object.keys(bn).forEach(e=>{r[e]===void 0&&(r[e]=bn[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Q(e.edge(n));t.setEdge(n,Object.assign({},Sn,Z(r,xn),I(r,Cn)))}),t}function Tn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function En(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);O(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Dn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function On(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function kn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function An(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(ve(r,a)),n.points.push(ve(i,o))})}function jn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Mn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Nn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Pn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Fn(e){k(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{O(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function In(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function Z(e,t){return L(I(e,t),Number)}function Q(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}\n/*! For license information please see dagre.esm.js.LEGAL.txt */\nlet Ln={healthy:`●`,degraded:`■`,unhealthy:`◆`,unknown:`○`};new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),new Intl.NumberFormat(`en`,{maximumFractionDigits:2});let Rn={micro:11,small:12,body:14,title:16,section:22,page:32},zn={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},$=(e,t)=>et),Bn=(Rn.micro+2)/20;function Vn(e,t){let n=Object.create(null);for(let r of e.nodes)n[r.id]={full:qn(r,!1,t),compact:qn(r,!0,t)};let r=Object.entries(n).sort(([e],[t])=>$(e,t)),i=JSON.stringify([r.map(([e])=>e),e.edges.map(e=>[e.id,e.caller,e.callee]).sort((e,t)=>$(e[0],t[0]))]);return{key:JSON.stringify([i,r]),topology:i,widths:n}}function Hn(e,t,n){let r=n??Vn(e,t.measureText).widths;return{...Un(e,r,!0),full:Un(e,r,!1)}}function Un(e,t,n){let r=[...e.nodes].sort((e,t)=>$(e.id,t.id)),a=[...e.edges].sort((e,t)=>$(e.id,t.id)),o=new Set(a.flatMap(e=>[e.caller,e.callee])),s=new Set(a.map(e=>e.callee)),c=new Set(a.map(e=>e.caller)),l=new i.Graph({directed:!0,multigraph:!0});l.setDefaultEdgeLabel(()=>({}));let u=n?20:44;l.setGraph({rankdir:`LR`,ranker:`network-simplex`,acyclicer:`greedy`,ranksep:n?16:32,nodesep:n?4:8,edgesep:n?2:8,marginx:0,marginy:0});let d=new Map(r.map(e=>[e.id,t[e.id][n?`compact`:`full`]]));for(let e of r)o.has(e.id)&&l.setNode(e.id,{width:d.get(e.id),height:u});for(let e of a)l.setEdge(e.caller,e.callee,{weight:1,minlen:1},e.id);l.nodeCount()&&dn(l);let f=r.filter(e=>o.has(e.id)).map(e=>({...e,x:l.node(e.id).x-d.get(e.id)/2,y:l.node(e.id).y-u/2,width:d.get(e.id),height:u,entry:c.has(e.id)&&!s.has(e.id),uncalled:!1})),p=a.map(e=>l.edge(e.caller,e.callee,e.id).points),m=r.filter(e=>!o.has(e.id)),h=m.reduce((e,t)=>e+d.get(t.id)+12,0)-(m.length?12:0),g=m.length?Wn(`No traced calls in this window`,`12px ${zn.display}`):0,_=Math.max(1,l.graph().width??0,h,g),v=(_-h)/2,y=Math.max(0,l.graph().height??0,...p.flat().map(e=>e.y),...f.map(e=>e.y+e.height)),b=y+(y?40:24);for(let e of m)f.push({...e,x:v,y:b,width:d.get(e.id),height:u,entry:!1,uncalled:!0}),v+=d.get(e.id)+12;let x=(_-(l.graph().width??0))/2;for(let e of f)e.uncalled||(e.x+=x);for(let e of p)for(let t of e)t.x+=x;let S=new Map(f.map(e=>[e.id,e]));for(let[e,t]of a.entries()){let n=S.get(t.caller),r=S.get(t.callee),i=p[e].slice(1,-1);if(!i.length||n===r)continue;let a=n.xArray.from(e).length*Number(t.match(/([\\d.]+)px/)?.[1]??11)*.6,Gn=e=>Array.from(e).length>24?Array.from(e).slice(0,24).join(``)+`…`:e,Kn=/* @__PURE__ */ new WeakMap;function qn(e,t,n){let r=n??Wn,i=Kn.get(r);i||(i=/* @__PURE__ */ new Map,Kn.set(r,i));let a=`600 ${t?Rn.micro/Bn:12}px ${zn.display}`,o=i.get(a);o===void 0&&(o=Math.max(...Object.values(Ln).map(e=>r(e,a))),i.set(a,o));let s=t?Math.ceil(16/Bn)+1:20;return Math.ceil(Math.max(t?0:168,r(Gn(e.id),a)+o+s))}self.onmessage=e=>{let{model:t,size:n,widths:r}=e.data;self.postMessage(Hn(t,n,r))}})();'],{type:`text/javascript;charset=utf-8`});function XCe(e){let t;try{if(t=J$&&(self.URL||self.webkitURL).createObjectURL(J$),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(e){throw e}}var Y$=Object.defineProperty,ZCe=(e,t,n)=>t in e?Y$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QCe=(e,t)=>{for(var n in t)Y$(e,n,{get:t[n],enumerable:!0})},$Ce=(e,t,n)=>ZCe(e,typeof t==`symbol`?t:t+``,n),X$={};QCe(X$,{Graph:()=>f1,alg:()=>r1});var ewe=Object.defineProperty,Z$=(e,t)=>{for(var n in t)ewe(e,n,{get:t[n],enumerable:!0})},Q$=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=t1(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=twe(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,$$(this._preds[a],i),$$(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?n1(this._isDirected,e):t1(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?n1(this._isDirected,e):t1(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?n1(this._isDirected,e):t1(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],e1(this._preds[t],e),e1(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function $$(e,t){e[t]?e[t]++:e[t]=1}function e1(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function t1(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function twe(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function n1(e,t){return t1(e,t.v,t.w,t.name)}Z$({},{read:()=>awe,write:()=>nwe});function nwe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:rwe(e),edges:iwe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function rwe(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function iwe(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function awe(e){let t=new Q$(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var r1={};Z$(r1,{CycleException:()=>c1,bellmanFord:()=>i1,components:()=>cwe,dijkstra:()=>o1,dijkstraAll:()=>dwe,findCycles:()=>fwe,floydWarshall:()=>mwe,isAcyclic:()=>gwe,postorder:()=>vwe,preorder:()=>ywe,prim:()=>bwe,shortestPaths:()=>xwe,tarjan:()=>s1,topsort:()=>l1});var owe=()=>1;function i1(e,t,n,r){return swe(e,String(t),n||owe,r||function(t){return e.outEdges(t)??[]})}function swe(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+oe.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n>1,!(t[r].priority1;function o1(e,t,n,r){return uwe(e,String(t),n||lwe,r||function(t){return e.outEdges(t)??[]})}function uwe(e,t,n,r){let i={},a=new a1,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function dwe(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=o1(e,i,t,n),r},{})}function s1(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function fwe(e){return s1(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var pwe=()=>1;function mwe(e,t,n){return hwe(e,t||pwe,n||function(t){return e.outEdges(t)??[]})}function hwe(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=u1(e,t,n===`post`,o,a,r,i)}),i}function u1(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=u1(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function d1(e,t,n){return _we(e,t,n,function(e,t){return e.push(t),e},[])}function vwe(e,t){return d1(e,t,`post`)}function ywe(e,t){return d1(e,t,`pre`)}function bwe(e,t){var n;let r=new Q$,i={},a=new a1,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function xwe(e,t,n,r){return Swe(e,t,n,r??(t=>e.outEdges(t)??[]))}function Swe(e,t,n,r){if(n===void 0)return o1(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function m1(e){let t=new f1({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function h1(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function g1(e){let t=S1(b1(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function wwe(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=y1(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Twe(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=y1(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function _1(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),p1(e,`border`,i,t)}function Ewe(e,t=v1){let n=[];for(let r=0;rv1?e(...Ewe(t).map(t=>e(...t))):e(...t)}function b1(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return y1(Math.max,t)}function Dwe(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Owe(e,t){return t()}var kwe=0;function x1(e){return e+(``+ ++kwe)}function S1(e,t,n=1){t??(t=e,e=0);let r=e=>ete[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Awe(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var T1=`\0`;function E1(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var jwe=class{constructor(){$Ce(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return D1(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&D1(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Mwe)),n=n._prev;return`[`+e.join(`, `)+`]`}};function D1(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Mwe(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Nwe=jwe,Pwe=()=>1;function Fwe(e,t){if(e.nodeCount()<=1)return[];let n=Lwe(e,t||Pwe);return Iwe(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Iwe(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)O1(e,t,n,o);for(;o=i.dequeue();)O1(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(O1(e,t,n,o,!0)||[]);break}}}return r}function O1(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,k1(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,k1(t,n,o)}),e.removeNode(r.v),o}function Lwe(e,t){let n=new f1,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Rwe(i+r+3).map(()=>new Nwe),o=r+1;return n.nodes().forEach(e=>{k1(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function k1(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Rwe(e){let t=[];for(let n=0;n{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,x1(`rev`))});function n(e){return t=>e.edge(t).weight}}function Bwe(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Hwe(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Vwe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Hwe(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Uwe(e){e.graph().dummyChains=[],e.edges().forEach(t=>Wwe(e,t))}function Wwe(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function A1(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=y1(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function j1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var M1=Kwe;function Kwe(e){let t=new f1({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;qwe(t,e){let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!j1(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Jwe(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=j1(t,r)),it.node(e).rank+=n)}var{preorder:Xwe,postorder:Zwe}=r1,Qwe=N1;N1.initLowLimValues=I1,N1.initCutValues=P1,N1.calcCutValue=F1,N1.leaveEdge=R1,N1.enterEdge=z1,N1.exchangeEdges=B1;function N1(e){e=Cwe(e),A1(e);let t=M1(e);I1(t),P1(t,e);let n,r;for(;n=R1(t);)r=z1(t,e,n),B1(t,e,n,r)}function P1(e,t){let n=Zwe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>$we(e,t,n))}function $we(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=F1(e,t,n)}function F1(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,tTe(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function I1(e,t){arguments.length<2&&(t=e.nodes()[0]),L1(e,{},1,t)}function L1(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=L1(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function R1(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function z1(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===V1(e,e.node(t.v),s)&&c!==V1(e,e.node(t.w),s)).reduce((e,n)=>j1(t,n)!e.node(t).parent);if(!n)return;let r=Xwe(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function tTe(e,t,n){return e.hasEdge(t,n)}function V1(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var nTe=rTe;function rTe(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:H1(e);break;case`tight-tree`:aTe(e);break;case`longest-path`:iTe(e);break;case`none`:break;default:H1(e)}}var iTe=A1;function aTe(e){A1(e),M1(e)}function H1(e){Qwe(e)}var oTe=sTe;function sTe(e){let t=lTe(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=cTe(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRanko||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function lTe(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(T1).forEach(r),t}function uTe(e){let t=p1(e,`root`,{},`_root`),n=dTe(e),r=Object.values(n),i=y1(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=fTe(e)+1;e.children(T1).forEach(r=>{U1(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function U1(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=_1(e,`_bt`),l=_1(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{U1(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function dTe(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(T1).forEach(e=>n(e,1)),t}function fTe(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function pTe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var mTe=hTe;function hTe(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;tK1(e.node(t))),e.edges().forEach(t=>K1(e.edge(t)))}function K1(e){let t=e.width;e.width=e.height,e.height=t}function vTe(e){e.nodes().forEach(t=>q1(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(q1),Object.hasOwn(r,`y`)&&q1(r)})}function q1(e){e.y=-e.y}function yTe(e){e.nodes().forEach(t=>J1(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(J1),Object.hasOwn(r,`x`)&&J1(r)})}function J1(e){let t=e.x;e.x=e.y,e.y=t}function bTe(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=S1(y1(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return E1(t,e.node(n),e.node(r))}return a}function xTe(e,t){let n=0;for(let r=1;rt)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function CTe(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function wTe(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),TTe(Object.values(n).filter(e=>!e.indegree))}function TTe(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&ETe(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>C1(e,[`vs`,`i`,`barycenter`,`weight`]))}function ETe(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function DTe(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Dwe(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(OTe(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Y1(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Y1(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Y1(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function OTe(e,t,n){return(r,i)=>{if(r.barycenteri.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=E1(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function X1(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=CTe(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=X1(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&ATe(t,r)}});let h=wTe(m,n);kTe(h,p);let g={},_=!1;for(let t=0;t{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function ATe(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function jTe(e,t,n,r){r||=e.nodes();let i=MTe(e),a=new f1({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function MTe(e){let t;for(;e.hasNode(t=x1(`_root`)););return t}function NTe(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Z1(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Z1);return}let r=b1(e),i=Q1(e,S1(1,r+1),`inEdges`),a=Q1(e,S1(r-1,-1,-1),`outEdges`),o=bTe(e,n);if($1(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){PTe(t%2?i:a,t%4>=2,l,n),o=g1(e);let u=xTe(e,o);u{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return jTe(e,t,n,r.get(t)||[])})}function PTe(e,t,n,r){let i=!0,a=new f1;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=X1(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),NTe(e,a,s.vs)})}function $1(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function FTe(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=LTe(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.ordero)&&e0(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function LTe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function e0(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function RTe(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function zTe(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||t0(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>t0(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function VTe(e,t,n,r){let i=new f1,a=e.graph(),o=KTe(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function HTe(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=qTe(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-y1(Math.min,c);a!==`l`&&(l=i-y1(Math.max,c)),l&&(e[o]=w1(s,e=>e+l))})})}function WTe(e,t=void 0){let n=e.ul;return n?w1(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function GTe(e,t){let n=g1(e),r=Object.assign(FTe(e,n),ITe(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=zTe(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=BTe(e,a,s.root,s.align,n===`r`);n===`r`&&(c=w1(c,e=>-e)),i[o+n]=c})}),UTe(i,HTe(e,i)),WTe(i,e.graph().align)}function KTe(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function qTe(e,t){return e.node(t).width}function t0(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function JTe(e,t){e=m1(e),YTe(e),Object.entries(GTe(e,t)).forEach(([t,n])=>e.node(t).x=n)}function YTe(e){let t=g1(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var n0=new WeakMap;function XTe(e,t={}){return i0(e,Owe,t),e}function r0(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function i0(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new f1({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=r0(e,t.v,r),i=r0(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),i0(o,t,n);let l=c0(o);a0(l,t,n,null),o0(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=c0(e),g=a0(h,t,n,n0.get(e)??null);n0.set(e,g),o0(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function a0(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>iEe(e)),t(` removeSelfEdges`,()=>pEe(e)),t(` acyclic`,()=>zwe(e,s)),t(` nestingGraph.run`,()=>uTe(e)),t(` rank`,()=>nTe(m1(e))),t(` injectEdgeLabelProxies`,()=>aEe(e)),t(` removeEmptyRanks`,()=>Twe(e)),t(` nestingGraph.cleanup`,()=>pTe(e)),t(` normalizeRanks`,()=>wwe(e)),t(` assignRankMinMax`,()=>oEe(e)),t(` removeEdgeLabelProxies`,()=>sEe(e)),t(` normalize.run`,()=>Uwe(e)),t(` parentDummyChains`,()=>oTe(e)),t(` addBorderSegments`,()=>mTe(e)),t(` order`,()=>Z1(e,n,c)),t(` insertSelfEdges`,()=>mEe(e)),t(` adjustCoordinateSystem`,()=>gTe(e)),t(` position`,()=>JTe(e,n.corePath)),t(` positionSelfEdges`,()=>hEe(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>fEe(e)),t(` normalize.undo`,()=>Gwe(e)),t(` fixupEdgeLabelCoords`,()=>uEe(e)),t(` undoCoordinateSystem`,()=>_Te(e)),t(` translateGraph`,()=>cEe(e)),t(` assignNodeIntersects`,()=>lEe(e)),t(` reversePoints`,()=>dEe(e)),t(` acyclic.undo`,()=>Vwe(e)),{graph:e,rawNodes:l}}function o0(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var ZTe=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],QTe={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},$Te=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],eEe=[`width`,`height`,`rank`],s0={width:0,height:0},tEe=[`minlen`,`weight`,`width`,`height`,`labeloffset`],nEe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},rEe=[`labelpos`];function c0(e){let t=new f1({multigraph:!0,compound:!0}),n=u0(e.graph());return t.setGraph(Object.assign({},QTe,l0(n,ZTe),C1(n,$Te))),e.nodes().forEach(n=>{let r=l0(u0(e.node(n)),eEe);Object.keys(s0).forEach(e=>{r[e]===void 0&&(r[e]=s0[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=u0(e.edge(n));t.setEdge(n,Object.assign({},nEe,l0(r,tEe),C1(r,rEe)))}),t}function iEe(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function aEe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);p1(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function oEe(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function sEe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function cEe(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function lEe(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(h1(r,a)),n.points.push(h1(i,o))})}function uEe(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function dEe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function fEe(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function pEe(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function mEe(e){g1(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{p1(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function hEe(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function l0(e,t){return w1(C1(e,t),Number)}function u0(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}var d0=(e,t)=>et),f0=(e,t,n)=>Math.min(n,Math.max(t,e)),p0=20,gEe=44,m0=(zg.micro+2)/p0;function h0(e,t){let n=Object.create(null);for(let r of e.nodes)n[r.id]={full:C0(r,!1,t),compact:C0(r,!0,t)};let r=Object.entries(n).sort(([e],[t])=>d0(e,t)),i=JSON.stringify([r.map(([e])=>e),e.edges.map(e=>[e.id,e.caller,e.callee]).sort((e,t)=>d0(e[0],t[0]))]);return{key:JSON.stringify([i,r]),topology:i,widths:n}}function _Ee(e,t,n){let r=n??h0(e,t.measureText).widths;return{...g0(e,r,!0),full:g0(e,r,!1)}}function g0(e,t,n){let r=[...e.nodes].sort((e,t)=>d0(e.id,t.id)),i=[...e.edges].sort((e,t)=>d0(e.id,t.id)),a=new Set(i.flatMap(e=>[e.caller,e.callee])),o=new Set(i.map(e=>e.callee)),s=new Set(i.map(e=>e.caller)),c=new X$.Graph({directed:!0,multigraph:!0});c.setDefaultEdgeLabel(()=>({}));let l=n?p0:gEe;c.setGraph({rankdir:`LR`,ranker:`network-simplex`,acyclicer:`greedy`,ranksep:n?16:32,nodesep:n?4:8,edgesep:n?2:8,marginx:0,marginy:0});let u=new Map(r.map(e=>[e.id,t[e.id][n?`compact`:`full`]]));for(let e of r)a.has(e.id)&&c.setNode(e.id,{width:u.get(e.id),height:l});for(let e of i)c.setEdge(e.caller,e.callee,{weight:1,minlen:1},e.id);c.nodeCount()&&XTe(c);let d=r.filter(e=>a.has(e.id)).map(e=>({...e,x:c.node(e.id).x-u.get(e.id)/2,y:c.node(e.id).y-l/2,width:u.get(e.id),height:l,entry:s.has(e.id)&&!o.has(e.id),uncalled:!1})),f=i.map(e=>c.edge(e.caller,e.callee,e.id).points),p=r.filter(e=>!a.has(e.id)),m=p.reduce((e,t)=>e+u.get(t.id)+12,0)-(p.length?12:0),h=p.length?b0(`No traced calls in this window`,`12px ${Bg.display}`):0,g=Math.max(1,c.graph().width??0,m,h),_=(g-m)/2,v=Math.max(0,c.graph().height??0,...f.flat().map(e=>e.y),...d.map(e=>e.y+e.height)),y=v+(v?40:24);for(let e of p)d.push({...e,x:_,y,width:u.get(e.id),height:l,entry:!1,uncalled:!0}),_+=u.get(e.id)+12;let b=(g-(c.graph().width??0))/2;for(let e of d)e.uncalled||(e.x+=b);for(let e of f)for(let t of e)t.x+=b;let x=new Map(d.map(e=>[e.id,e]));for(let[e,t]of i.entries()){let n=x.get(t.caller),r=x.get(t.callee),i=f[e].slice(1,-1);if(!i.length||n===r)continue;let a=n.x{let r=e.nodes.filter(e=>e.uncalled);if(!r.length)return e;let i=Math.max(1,n.width-24)/t,a=[[]],o=0;for(let e of r)o&&o+12+e.width>i&&(a.push([]),o=0),a.at(-1).push(e),o+=(o?12:0)+e.width;let s=a.map(e=>e.reduce((e,t)=>e+t.width,0)+(e.length-1)*12),c=e.nodes.filter(e=>!e.uncalled),l=e.routes.flat(),u=Math.min(...c.map(e=>e.x),...l.map(e=>e.x)),d=c.length?Math.max(...c.map(e=>e.x+e.width),...l.map(e=>e.x))-u:0,f=Math.max(d,e.labelWidth,...s),p=c.length?(f-d)/2-u:0,m=c.map(e=>({...e,x:e.x+p}));return a.forEach((e,t)=>{let n=(f-s[t])/2;for(let i of e)m.push({...i,x:n,y:r[0].y+t*(i.height+12)}),n+=i.width+12}),{...e,nodes:m,routes:e.routes.map(e=>e.map(e=>({...e,x:e.x+p}))),width:f,height:Math.max(...m.map(e=>e.y+e.height))}},i=e=>{let t=e.routes.flat(),r=Math.min(0,...t.map(e=>e.x)),i=Math.min(0,...t.map(e=>e.y)),a=Math.max(e.width,...t.map(e=>e.x))-r,o=Math.max(e.height,...t.map(e=>e.y))-i,s=Math.max(0,...e.routes.flat().map(e=>e.y),...e.nodes.filter(e=>!e.uncalled).map(e=>e.y+e.height)),c=e.nodes.find(e=>e.uncalled)?.y,l=c===void 0?0:c-s,u=c===void 0?0:32;return{minX:r,minY:i,width:a,height:o,scale:Math.min(Math.max(1,n.width-24)/a,Math.max(1,n.height-24-u)/Math.max(1,o-l)),graphBottom:s,rowY:c,gap:l,lane:u}},a=r(e.full,1),o=i(a).scale<1,s=o?r(e,m0):a,{minX:c,minY:l,width:u,height:d,scale:f,graphBottom:p,rowY:m,gap:h,lane:g}=i(s),_=Math.max(o?m0:1,Math.min(f,1)),v=(d-h)*_+g,y=Math.max(n.width,u*_+24),b=Math.max(n.height,v+24),x=(y-u*_)/2,S=(b-v)/2,C=e=>({x:x+(e.x-c)*_,y:S+(e.y-l)*_+(m!==void 0&&e.y>=m?g-h*_:0)}),w=new Map(t.nodes.map(e=>[e.id,e])),T=s.nodes.map(e=>({...e,...w.get(e.id),...C(e),width:e.width*_,height:e.height*_})),E=[...t.edges].sort((e,t)=>d0(e.id,t.id)).map((e,t)=>{let n=s.routes[t].map(C),r=n.map((e,t)=>`${t?`L`:`M`}${e.x},${e.y}`).join(` `);return{...e,points:n,path:r}}),D=T.find(e=>e.entry)??T[0];return{nodes:T,edges:E,scale:_,compact:o,initialView:D?{x:f0(n.width/2-D.x-D.width/2,n.width-y,0),y:f0(n.height/2-D.y-D.height/2,n.height-b,0)}:{x:0,y:0},contentWidth:y,contentHeight:b,uncalledLabel:s.label?{x:(y-s.labelWidth)/2,y:S+(p-l)*_+8}:void 0}}var _0=e=>`${hy(`per_second`,e.request_rate)} · ${hy(`percent`,e.error_rate)} err · ${hy(`ms`,e.p95_ms)} p95`,v0=e=>{if(e===null||!Number.isFinite(e))return`—`;let t=f0(e,0,999e3);return t>0&&t<.01?`<0.01`:t>=1e3?`${Math.min(999,Math.round(t/1e3))}K`:String(Number(t.toFixed(t<1?2:+(t<10))))},y0=e=>e===null||!Number.isFinite(e)?`— err`:`${Number((e>0?f0(e,.1,100):0).toFixed(1))}% err`,yEe=e=>e===null?`—`:Number(e.toPrecision(2))>=1e3?`${v0(e/1e3)}s`:`${v0(e)}ms`,b0=(e,t)=>Array.from(e).length*Number(t.match(/([\d.]+)px/)?.[1]??11)*.6,x0=e=>Array.from(e).length>24?Array.from(e).slice(0,24).join(``)+`…`:e;function bEe(e,{width:t,scale:n,compact:r=!1,measureText:i}){let a=Math.max(12,zg.micro/n),o=zg.micro/n,s=i??b0,c=Math.max(0,t-12/n),l=s(z$[e.health]??`○`,`${a}px ${Bg.display}`),u=x0(e.id),d=e.error_rate!==null&&e.error_rate>0?y0(e.error_rate):`${v0(e.request_rate)}/s`,f=`${v0(e.request_rate)}/s · ${y0(e.error_rate)}`;return{name:u,metric:r?``:[`${f} · p95 ${yEe(e.p95_ms)}`,f,d].find(e=>s(e,`${o}px ${Bg.display}`)<=c)??``,nameSize:a,metricSize:o,nameWidth:Math.max(0,c-l-4/n)}}var S0=new WeakMap;function C0(e,t,n){let r=n??b0,i=S0.get(r);i||(i=new Map,S0.set(r,i));let a=`600 ${t?zg.micro/m0:12}px ${Bg.display}`,o=i.get(a);o===void 0&&(o=Math.max(...Object.values(z$).map(e=>r(e,a))),i.set(a,o));let s=t?Math.ceil(16/m0)+1:20;return Math.ceil(Math.max(t?0:168,r(x0(e.id),a)+o+s))}var xEe=(e,t,n)=>Math.min(n,Math.max(t,e)),w0={x:0,y:0,zoom:1};function SEe({panel:e,title:t=e.title,result:n,dark:r,height:i,onSelect:a,onPoint:o,onMapView:s}){let c=(0,A.useRef)(null),[l,u]=(0,A.useState)({width:500,height:Math.max(40,i-24)}),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(0),h=(0,A.useMemo)(()=>{let e=document.createElement(`canvas`).getContext(`2d`);return e?(t,n)=>(e.font=n,e.measureText(t).width):void 0},[p]);(0,A.useEffect)(()=>{let e=document.fonts,t=()=>m(e=>e+1);return e?.addEventListener(`loadingdone`,t),()=>e?.removeEventListener(`loadingdone`,t)},[]);let[g,_]=(0,A.useState)(),[v,y]=(0,A.useState)(),[b,x]=(0,A.useState)(w0),S=(0,A.useRef)(null),C=(0,A.useRef)(!1),w=(0,A.useMemo)(()=>V$(n.frame,n),[n.frame,n.from_ms,n.to_ms]),T=(0,A.useMemo)(()=>h0(w,h),[w,h]),[E,D]=(0,A.useState)(),[O,k]=(0,A.useState)(),j=(0,A.useRef)({model:w,size:l,structure:T});j.current={model:w,size:l,structure:T},(0,A.useLayoutEffect)(()=>{if(!d)return;let{model:e,size:t,structure:n}=j.current;if(k(void 0),e.nodes.length<=60){D({key:n.key,layout:_Ee(e,t,n.widths),model:e});return}let r;try{r=new XCe}catch{k(`Service layout unavailable`);return}let i=!0;r.onmessage=t=>{i&&D({key:n.key,layout:t.data,model:e})},r.onerror=()=>{i&&k(`Service layout unavailable`)};try{r.postMessage({model:e,size:{width:t.width,height:t.height},widths:n.widths})}catch{i=!1,r.terminate(),k(`Service layout unavailable`);return}return()=>{i=!1,r.terminate()}},[T.key,d]);let M=(0,A.useMemo)(()=>E?vEe(E.layout,E.key===T.key?w:E.model,l):{nodes:[],edges:[],scale:1,compact:!0,contentWidth:l.width,contentHeight:l.height,uncalledLabel:void 0,initialView:{x:0,y:0}},[E,w,l,T.key]),N=By(r),P=Ng[r?4:7],F=(0,A.useId)().replaceAll(`:`,``),ee=g??v,te=new Set([ee,...w.edges.filter(e=>e.caller===ee||e.callee===ee).flatMap(e=>[e.caller,e.callee])]),ne=Math.max(12,1/M.scale),I=Math.max(1e-9,...w.edges.map(e=>e.request_rate??e.calls)),re=Math.max(1,b.zoom),ie=(0,A.useMemo)(()=>{let e=M.edges.flatMap(e=>e.points),t=[...M.nodes.flatMap(e=>[e.x,e.x+e.width]),...e.map(e=>e.x)],n=[...M.nodes.flatMap(e=>[e.y,e.y+e.height]),...e.map(e=>e.y)];if(M.uncalledLabel){let e=h?.(`No traced calls in this window`,`${zg.micro}px ${Bg.display}`)??29*zg.micro*.6;t.push((M.contentWidth-e/re)/2,(M.contentWidth+e/re)/2),n.push(M.uncalledLabel.y,M.uncalledLabel.y+zg.micro/re)}return{left:Math.min(...t),right:Math.max(...t),top:Math.min(...n),bottom:Math.max(...n)}},[M,h,re]),ae=[ie.left*b.zoom+b.x<0&&`left`,ie.right*b.zoom+b.x>l.width&&`right`,ie.top*b.zoom+b.y<0&&`top`,ie.bottom*b.zoom+b.y>l.height&&`bottom`].filter(e=>!!e),oe=ae.join(` `),se=M.initialView.x,ce=M.initialView.y,le=(0,A.useCallback)(()=>x({x:se,y:ce,zoom:1}),[se,ce]),ue=b.zoom<1,de=M.contentWidth>l.width||M.contentHeight>l.height,fe=(0,A.useCallback)(()=>{if(ue||!de){le();return}let e=Math.min(l.width/M.contentWidth,l.height/M.contentHeight,1);x({x:(l.width-M.contentWidth*e)/2,y:(l.height-M.contentHeight*e)/2,zoom:e})},[ue,de,le,l.width,l.height,M.contentWidth,M.contentHeight]);(0,A.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=e.clientWidth||t.width,r=e.clientHeight||t.height;n>0&&r>0&&u(e=>e.width===n&&e.height===r?e:{width:n,height:r})};t(),f(!0);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let pe=(0,A.useRef)(void 0),L=(0,A.useRef)(w0);(0,A.useLayoutEffect)(()=>{E&&(E.key!==pe.current||b.zoom===1&&b.x===L.current.x&&b.y===L.current.y)&&le(),pe.current=E?.key,L.current={x:se,y:ce,zoom:1}},[E,le]),(0,A.useEffect)(()=>(s?.({canFit:!!oe||b.zoom!==1||b.x!==se||b.y!==ce,overview:ue,fit:fe}),()=>s?.({canFit:!1,overview:!1,fit:()=>void 0})),[s,b,fe,se,ce,oe,ue]),(0,A.useEffect)(()=>{let e=c.current;if(!e)return;let t=t=>{if(!E||O||t.deltaY===0)return;t.preventDefault();let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top;x(e=>{let n=xEe(e.zoom*Math.exp(-t.deltaY*.002),1,ne);if(n===1)return{x:se,y:ce,zoom:1};let a=n/e.zoom;return{zoom:n,x:r-(r-e.x)*a,y:i-(i-e.y)*a}})};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[ne,!!E,O,se,ce]);let me=t=>{if(C.current){C.current=!1;return}e.click&&a?a(t):o?.({dimensions:{service:t}})};return(0,R.jsxs)(`div`,{role:`region`,"aria-label":`${t}: service dependency graph; ${K$({...e,title:t},n)}`,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0,minWidth:0,width:`100%`},children:[(0,R.jsxs)(`div`,{ref:c,style:{position:`relative`,flex:`1 1 auto`,minHeight:0,overflow:`hidden`,touchAction:`none`,cursor:S.current?`grabbing`:`grab`},onMouseLeave:()=>_(void 0),onPointerDown:e=>{e.button===0&&(C.current=!1,S.current={x:e.clientX,y:e.clientY,initial:b,moved:!1})},onPointerMove:e=>{let t=S.current;if(!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.hypot(n,r)>3&&(t.moved=!0),t.moved&&(e.currentTarget.setPointerCapture?.(e.pointerId),x({...t.initial,x:t.initial.x+n,y:t.initial.y+r}))},onPointerUp:()=>{C.current=S.current?.moved??!1,S.current=null},onPointerCancel:()=>{S.current=null,C.current=!1},children:[(O||!E)&&(0,R.jsx)(Dd,{role:`status`,c:`dimmed`,children:O??`Laying out services…`}),(0,R.jsxs)(`div`,{style:{position:`relative`,width:M.contentWidth,height:M.contentHeight,transform:`translate(${b.x}px, ${b.y}px) scale(${b.zoom})`,transformOrigin:`0 0`},children:[(0,R.jsxs)(`svg`,{"aria-hidden":`true`,width:M.contentWidth,height:M.contentHeight,viewBox:`0 0 ${M.contentWidth} ${M.contentHeight}`,style:{position:`absolute`,inset:0},children:[(0,R.jsx)(`defs`,{children:[N.muted,N.status.warn,N.status.bad].map((e,t)=>(0,R.jsx)(`marker`,{id:`${F}-arrow-${t}`,viewBox:`0 0 6 6`,refX:5,refY:3,markerWidth:5,markerHeight:5,orient:`auto-start-reverse`,markerUnits:`userSpaceOnUse`,children:(0,R.jsx)(`path`,{d:`M0,0 L6,3 L0,6 Z`,fill:e})},e))}),(0,R.jsx)(`g`,{children:M.edges.map(e=>(0,R.jsx)(`path`,{d:e.path,fill:`none`,stroke:e.status?N.status[e.status]:N.muted,strokeLinejoin:`round`,strokeWidth:1+3*Math.log1p(e.request_rate??e.calls)/Math.log1p(I),opacity:ee&&e.caller!==ee&&e.callee!==ee?.25:1,markerEnd:`url(#${F}-arrow-${e.status===`bad`?2:+(e.status===`warn`)})`,style:{pointerEvents:`stroke`},children:(0,R.jsx)(`title`,{children:`${e.caller} → ${e.callee}\n${e.edge_type} · ${hy(`per_second`,e.request_rate)} · ${hy(`count`,e.calls)} calls\n${hy(`percent`,e.error_rate)} errors · ${hy(`ms`,e.average_ms)} average`})},e.id))})]}),(0,R.jsxs)(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`},children:[M.uncalledLabel&&(0,R.jsx)(`span`,{style:{position:`absolute`,left:`50%`,top:M.uncalledLabel.y,transform:`translateX(-50%)`,color:N.muted,fontSize:zg.micro/re,lineHeight:1,whiteSpace:`nowrap`},children:`No traced calls in this window`}),M.nodes.map(e=>{let t=e.health===`unhealthy`?N.status.bad:e.health===`degraded`?N.status.warn:e.health===`healthy`?N.status.ok:N.muted,n=bEe(e,{width:e.width/M.scale,scale:M.scale*re,compact:M.compact,measureText:h});return(0,R.jsxs)(`button`,{type:`button`,title:`${e.id} · ${e.health}\n${_0(e)}`,"aria-label":`${e.id}, ${e.health}, ${_0(e)}`,onMouseEnter:()=>_(e.id),onMouseLeave:()=>_(void 0),onFocus:()=>y(e.id),onBlur:()=>y(void 0),onClick:()=>me(e.id),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),C.current=!1,me(e.id))},style:{position:`absolute`,left:e.x,top:e.y,width:e.width,height:e.height,display:`flex`,flexDirection:`column`,justifyContent:`center`,gap:3/re,boxSizing:`border-box`,border:`${1/re}px solid ${e.health===`unhealthy`||e.health===`degraded`?t:N.border}`,borderRadius:6,padding:`0 ${5/re}px`,background:N.surface,color:N.text,textAlign:`left`,opacity:ee&&!te.has(e.id)?.25:1,outline:v===e.id?`2px solid ${P}`:void 0,outlineOffset:-2,pointerEvents:`auto`,cursor:`pointer`,fontFamily:Bg.display},children:[(0,R.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4/re,width:`100%`,minWidth:0,fontSize:Math.max(zg.micro/re,12*M.scale),lineHeight:1,whiteSpace:`nowrap`},children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,style:{color:t,flex:`none`},children:z$[e.health]??`○`}),(0,R.jsx)(`span`,{style:{flex:`none`,fontWeight:600,whiteSpace:`nowrap`},children:n.name})]}),!M.compact&&(0,R.jsx)(`span`,{style:{width:`100%`,fontSize:n.metricSize*M.scale,lineHeight:1,color:N.muted,whiteSpace:`nowrap`},children:n.metric})]},e.id)})]})]}),ae.map(e=>(0,R.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,pointerEvents:`none`,zIndex:1,...e===`left`||e===`right`?{top:0,bottom:0,[e]:0,width:24}:{left:0,right:0,[e]:0,height:24},background:`linear-gradient(to ${e}, transparent, var(--mantine-color-body))`}},e))]}),(0,R.jsxs)(Dd,{c:`dimmed`,fz:12,mt:4,style:{flexShrink:0},children:[w.nodes.length,` services · `,w.edges.length,` `,w.edges.length===1?`route`:`routes`]})]})}function T0({label:e,value:t,color:n,hint:r,children:i}){let a=Jt(`light`)===`dark`;return(0,R.jsxs)(ic,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,style:{display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,R.jsx)(Dd,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,R.jsx)(B,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,style:{color:n===`ok`||n===`warn`||n===`bad`?zy(n,a):void 0},children:t}),r&&(0,R.jsx)(Dd,{c:`dimmed`,size:`xs`,mt:2,children:r}),i&&(0,R.jsx)(B,{mt:4,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0},children:i})]})}function E0({health:e}){let t=Nee(e),n=`var(--mantine-color-${t_(e)}-filled)`;return(0,R.jsx)(`svg`,{"aria-hidden":!0,width:12,height:12,viewBox:`0 0 12 12`,fill:e===`unknown`?`none`:n,stroke:n,strokeDasharray:Pee(e)===`dashed`?`2 2`:void 0,children:t===`diamond`?(0,R.jsx)(`polygon`,{points:`6,0 12,6 6,12 0,6`}):t===`roundRect`?(0,R.jsx)(`rect`,{x:1,y:1,width:10,height:10,rx:2}):(0,R.jsx)(`circle`,{cx:6,cy:6,r:5})})}function CEe({values:e,color:t}){let n=(0,A.useMemo)(()=>e.map(e=>Number.isFinite(e)?e:null),[e]),r=Math.max(0,...n.filter(e=>e!==null)),i=(0,A.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:n.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:n,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[n,t]);return(0,R.jsxs)(B,{"data-health-trend":!0,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0},children:[(0,R.jsx)(pX,{option:i,height:`100%`,label:`Error rate trend`}),r>0&&(0,R.jsxs)(Dd,{c:`dimmed`,size:`xs`,ta:`right`,mt:2,style:{flexShrink:0},children:[`peak `,r.toFixed(2),`%`]})]})}function wEe({result:e,dark:t,onSelect:n,onVariable:r,vars:i}){let a=e.frame?.health,o=e=>Number.isFinite(e)?e:0,s=a?{...a,total_spans:o(a.total_spans),service_count:o(a.service_count),counts:{healthy:o(a.counts.healthy),degraded:o(a.counts.degraded),unhealthy:o(a.counts.unhealthy)}}:void 0,c=!s||s.health===`unknown`||s.service_count===0||!Number.isFinite(s.error_rate),l=c?`unknown`:s.health,u=Math.max(s?.service_count??0,1),d=r_(t),f=n??(r&&i&&Object.hasOwn(i,`service`)?e=>r(`service`,e):void 0),p=c?[]:VCe(R_(e.frame));return(0,R.jsxs)(dh,{gap:`sm`,style:{flex:`1 1 auto`,minHeight:0},role:`region`,"aria-label":`Service health: ${c?`No data`:l}; ${s?.service_count??0} services`,children:[(0,R.jsxs)(sh,{cols:2,spacing:`sm`,"data-health-tiles":!0,style:{flex:`1 1 auto`,minHeight:0},children:[(0,R.jsx)(T0,{label:`Health`,value:(0,R.jsxs)(yl,{gap:6,children:[(0,R.jsx)(E0,{health:l}),c?`No data`:l.charAt(0).toUpperCase()+l.slice(1)]}),color:t_(l),hint:c?`No telemetry in this window`:`${a_.format(s.service_count)} services`,children:p.map(e=>{let t=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(E0,{health:e.health}),(0,R.jsx)(Dd,{component:`span`,fz:12,truncate:!0,style:{minWidth:0,textAlign:`left`},title:e.name,children:e.name}),(0,R.jsx)(Dd,{component:`span`,fz:12,ff:`monospace`,style:{textAlign:`right`},children:e.metric})]}),n={display:`grid`,gridTemplateColumns:`12px minmax(0, 1fr) 64px`,alignItems:`center`,textAlign:`left`,gap:6,minHeight:20,minWidth:0,width:`100%`};return f?(0,R.jsx)(Ad,{component:`button`,type:`button`,"data-health-service":e.name,style:n,onClick:()=>f(e.name),children:t},e.name):(0,R.jsx)(B,{"data-health-service":e.name,style:n,children:t},e.name)})}),(0,R.jsx)(T0,{label:`Error rate`,value:c?`—`:`${s.error_rate.toFixed(2)}%`,color:!c&&s.error_rate>=1?`bad`:void 0,hint:c?void 0:`${a_.format(s.total_spans)} operations`,children:!c&&s.error_trend.length>1&&(0,R.jsx)(CEe,{values:s.error_trend,color:d.bad})})]}),!c&&(0,R.jsxs)(B,{style:{flexShrink:0},children:[(0,R.jsxs)(Im.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,R.jsx)(Im.Section,{value:s.counts.healthy/u*100,color:`ok`}),(0,R.jsx)(Im.Section,{value:s.counts.degraded/u*100,color:`warn`}),(0,R.jsx)(Im.Section,{value:s.counts.unhealthy/u*100,color:`bad`})]}),(0,R.jsx)(yl,{mt:6,gap:`md`,children:[`healthy`,`degraded`,`unhealthy`].map(e=>(0,R.jsxs)(yl,{gap:6,children:[(0,R.jsx)(E0,{health:e}),(0,R.jsxs)(Dd,{c:`dimmed`,size:`xs`,children:[s.counts[e],` `,e]})]},e))})]})]})}function TEe(e){return(0,R.jsx)(Xy,{...e})}function EEe(e){return(0,R.jsx)(Xy,{...e})}function DEe(e){let{panel:t,title:n,result:r,dark:i,height:a,group:o,onSelect:s,onPoint:c,onVariable:l,onZoom:u}=e;if(t.viz===`text`)return(0,R.jsx)(RCe,{panel:t});if(!r?.frame)return null;let d={...e,result:r};switch(t.viz){case`stat`:return(0,R.jsx)(Tre,{panel:t,result:r,dark:i,compare:e.compare,range:e.range});case`gauge`:return(0,R.jsx)(m_e,{panel:t,title:n,result:r,dark:i,height:a});case`timeseries`:return(0,R.jsx)(zCe,{...d});case`bar`:return(0,R.jsx)(p_e,{panel:t,title:n,result:r,dark:i,height:a,onSelect:s,onPoint:c});case`table`:return(0,R.jsx)(qy,{traceLinks:e.traceLinks,panel:t,result:r,height:a,onSelect:s,onPoint:c,onVariable:l});case`heatmap`:return(0,R.jsx)(KCe,{...d});case`histogram`:return(0,R.jsx)(qCe,{...d});case`scatter`:return(0,R.jsx)(JCe,{...d});case`state_timeline`:return(0,R.jsx)(YCe,{...d});case`service_map`:return(0,R.jsx)(SEe,{...d});case`health`:return(0,R.jsx)(wEe,{...d});case`logs`:return(0,R.jsx)(Zy,{...d});case`log_patterns`:return(0,R.jsx)(TEe,{...d});case`traces`:return(0,R.jsx)(EEe,{...d})}}function OEe({onClick:e}){return(0,R.jsx)(Xm,{label:`Keyboard shortcuts (?)`,children:(0,R.jsx)(ll,{variant:`default`,size:`lg`,"aria-label":`Keyboard shortcuts (?)`,onClick:e,children:(0,R.jsx)(rte,{size:16})})})}var D0=(0,A.createContext)(void 0);function kEe({opened:e,onClose:t,title:n,children:r,returnFocusTo:i,shortcutScope:a,onShortcuts:o,escapeEnabled:s=!0}){let c=(0,A.useRef)(!1),[l,u]=(0,A.useState)(!1),d=(0,A.useRef)(i);return d.current=i,(0,A.useEffect)(()=>{let t=c.current&&!e;if(c.current=e,!t)return;let n=requestAnimationFrame(()=>d.current()?.focus());return()=>cancelAnimationFrame(n)},[e]),(0,R.jsxs)(cm.Root,{opened:e,onClose:t,fullScreen:!0,trapFocus:!0,returnFocus:!1,closeOnEscape:s&&!l,children:[(0,R.jsx)(cm.Overlay,{}),(0,R.jsxs)(cm.Content,{"aria-label":n,"data-panel-fullscreen":!0,"data-shortcut-scope":a,children:[(0,R.jsx)(cm.Header,{children:(0,R.jsxs)(yl,{ml:`auto`,gap:`xs`,children:[o&&(0,R.jsx)(OEe,{onClick:o}),(0,R.jsx)(cm.CloseButton,{"data-autofocus":!0,"aria-label":`Close panel view`})]})}),(0,R.jsx)(cm.Body,{children:(0,R.jsx)(D0.Provider,{value:u,children:r})})]})]})}function AEe({panel:e,title:t,result:n,loading:r,compare:i,range:a,height:o,group:s,editing:c,agentAvailable:l,annotations:u,vars:d,onSelect:f,onPoint:p,onVariable:m,onZoom:h,onRangePending:g,onZoomReset:_,zoomed:v,onView:y,onCopyLink:b,onExplain:x,onFix:S,onRetry:C,onRemove:w,onDuplicate:T,staleAt:E,traceLinks:D,suspended:O=!1,menuRef:k}){let[j,M]=(0,A.useState)(),N=(0,A.useMemo)(()=>({setHint:M}),[]),P=Jt(`light`)===`dark`,F=(0,A.useRef)(null),[ee,te]=(0,A.useState)(0);(0,A.useLayoutEffect)(()=>{let e=F.current;if(!e)return;te(e.getBoundingClientRect().width);let t=new ResizeObserver(([e])=>{e&&te(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let ne=ee>0&&ee<360,[I,re]=(0,A.useState)(0);(0,A.useLayoutEffect)(()=>{let n=()=>{let n=document.createElement(`canvas`).getContext(`2d`),r=F.current?.querySelector(`[data-panel-title]`),i=r?getComputedStyle(r).fontFamily:`inherit`;n&&(n.font=`600 15px ${i}`);let a=n?.measureText(t).width??Array.from(t).length*8.25;n&&(n.font=`400 11px ${i}`);let o=[`Chart`,`Data`,`Spec`].reduce((e,t)=>e+(n?.measureText(t).width??t.length*7)+12,4),s=(e.description?24:0)+18+($y(e)?.length??0)*7;re(a+o+22+32+20+s)};return n(),document.fonts?.addEventListener(`loadingdone`,n),()=>document.fonts?.removeEventListener(`loadingdone`,n)},[t,e.description,e.time]);let ie=ne||ee>0&&ee{if(!E)return;oe(Date.now());let e=window.setInterval(()=>oe(Date.now()),3e4);return()=>window.clearInterval(e)},[E]);let[se,ce]=(0,A.useState)(`Chart`),[le,ue]=(0,A.useState)(),de=(0,A.useCallback)(e=>ue(e),[]),fe=e.click?`click to filter by ${e.click.set_variable}`:e.viz===`traces`||(e.drill===`traces`||n?.frame?.columns.some(e=>e.name===`trace_id`))&&e.viz===`table`?`click to open trace`:e.drill===`logs`?`click for matching logs`:e.drill===`traces`&&[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz)?`click for exemplar traces`:void 0,pe=Math.max(40,o-88),L=z_(e,n?.frame),me=L.length?[...new Set(L.map(e=>e.value))].join(` · `):e.sql?`sql`:e.query?.from??(e.viz===`service_map`||e.viz===`health`?`spans`:e.viz===`log_patterns`?`logs`:`spec`),he=`${e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)} · ${me}${fe?` · ${fe}`:``}`,ge=[`timeseries`,`bar`,`heatmap`,`histogram`,`scatter`,`state_timeline`,`gauge`,`service_map`].includes(e.viz),_e=se!==`Chart`||!ge||!n||n.status!==`ok`||n.frame?.truncated||n.previous?.truncated,ve=[`table`,`logs`,`traces`,`log_patterns`,`text`].includes(e.viz),ye=jEe(n?.frame?.note),be=n?.frame&&n.error,xe=!!n?.request_error?.length,Se=!!n?.error&&!xe,Ce=E?`Showing data from ${O0(E,ae)}`:void 0,we=be?`${Ce?`${Ce}. `:``}${be}`:void 0,Te=we&&we.length>200?`${we.slice(0,199)}…`:we,Ee=(0,A.useId)(),De=(0,A.useRef)(null),Oe=Ve(k,De),[ke,Ae]=(0,A.useState)(!1),[je,Me]=(0,A.useState)(!1),[Ne,Pe]=(0,A.useState)(!1),Fe=!!be&&!Ne&&(ke||je),Ie=(0,A.useContext)(D0);(0,A.useEffect)(()=>(Ie?.(Fe),()=>Ie?.(!1)),[Ie,Fe]);let Le=(0,A.useCallback)(()=>{Pe(!0),Ae(!1),Me(!1)},[]);(0,A.useEffect)(()=>{if(!Fe)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),Le())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[Fe,Le]);let Re=[...new Set([E&&!be?`Stale: last updated ${O0(E,ae)}`:void 0,n?.frame?.truncated||n?.previous?.truncated?`Truncated: showing limited data`:void 0,ye,n?.annotation_error,n?.annotation_scope?.limited?`Annotation service scope is limited.`:void 0].filter(e=>!!e))],ze=(0,A.useRef)(null),[Be,He]=(0,A.useState)(),Ue=(Be??pe)<160;(0,A.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&He(e.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let[We,Ge]=(0,A.useState)();return(0,A.useLayoutEffect)(()=>{let e=ze.current,t=F.current;if(!e||!t)return;if(!_e||!(ve||se===`Data`)){Ge(void 0);return}let n=()=>{let n=Math.max(0,t.getBoundingClientRect().bottom-e.getBoundingClientRect().bottom),r=e.scrollHeight>e.clientHeight;Ge(e=>r?e?.bottom===n?e:{bottom:n}:void 0)};n();let r=new ResizeObserver(n);r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild);let i=new MutationObserver(n);return i.observe(e,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{r.disconnect(),i.disconnect()}},[n,se,ve,_e,o,ne,Re.length]),(0,R.jsxs)(ic,{ref:F,withBorder:!0,radius:`md`,h:`100%`,p:0,style:{display:`flex`,flexDirection:`column`,minWidth:0,position:`relative`},"data-panel":e.id,"data-compact-views":ie,children:[(0,R.jsxs)(yl,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,px:16,pt:12,className:c?`panel-drag`:void 0,style:{cursor:c?`grab`:void 0,flexShrink:0},children:[(0,R.jsxs)(yl,{gap:6,wrap:`nowrap`,miw:0,style:{flex:1},children:[(0,R.jsxs)(B,{miw:0,style:{flex:1},children:[(0,R.jsx)(Dd,{"data-panel-title":!0,fw:600,fz:15,truncate:!ie||void 0,style:ie?{overflowWrap:`anywhere`}:void 0,children:t}),(0,R.jsxs)(Dd,{"data-panel-subtitle":!0,title:j??he,fz:12,ff:Bg.display,c:`dimmed`,truncate:!ne||void 0,style:{position:`relative`,...ne?{overflowWrap:`anywhere`}:{}},children:[(0,R.jsx)(`span`,{"aria-hidden":j?!0:void 0,style:{visibility:j?`hidden`:void 0},children:he}),j&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(`span`,{"data-chart-hint":!0,"aria-hidden":`true`,style:{position:`absolute`,inset:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Vre(j)})})]}),e.options?.highlight&&(0,R.jsxs)(Dd,{component:`span`,"data-highlight-term":!0,title:`highlight: ${e.options.highlight}`,fz:11,c:`dimmed`,style:{display:`inline-block`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,border:`1px solid var(--mantine-color-default-border)`,borderRadius:4,padding:`0 5px`},children:[`highlight: `,e.options.highlight]})]}),$y(e)&&(0,R.jsx)(Dd,{size:`xs`,c:`dimmed`,role:`status`,children:$y(e)}),e.description&&(0,R.jsx)(Xm,{label:e.description,multiline:!0,w:260,children:(0,R.jsx)(ll,{variant:`transparent`,color:`gray`,size:`xs`,"aria-label":`${t} description`,children:(0,R.jsx)(nte,{size:14})})}),r&&n&&(0,R.jsx)(tl,{size:12,"aria-label":`Refreshing`})]}),(0,R.jsxs)(yl,{gap:4,wrap:`nowrap`,style:{flexShrink:0},children:[!ie&&e.viz!==`text`&&(0,R.jsx)(yl,{gap:0,wrap:`nowrap`,role:`group`,"aria-label":`${t} view`,style:{border:`1px solid var(--mantine-color-default-border)`,borderRadius:5,overflow:`hidden`},children:[`Chart`,`Data`,`Spec`].map(e=>(0,R.jsx)(`button`,{type:`button`,"data-panel-view":e,"aria-pressed":se===e,onClick:()=>ce(e),style:{border:0,borderLeft:e===`Chart`?void 0:`1px solid var(--mantine-color-default-border)`,padding:`2px 6px`,fontSize:11,fontFamily:`inherit`,cursor:`pointer`,background:se===e?`var(--mantine-color-default)`:`transparent`,color:se===e?`var(--mantine-primary-color-filled)`:`var(--mantine-color-dimmed)`,fontWeight:se===e?600:400,boxShadow:se===e?`inset 0 -2px var(--mantine-primary-color-filled)`:void 0},children:e},e))}),e.viz===`service_map`&&le?.canFit&&(0,R.jsx)(ll,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":le.overview?`Return to readable ${t} view`:`Show whole ${t} graph`,onClick:le.fit,children:(0,R.jsx)(f_,{size:16})}),v&&_&&[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz)&&(0,R.jsx)(ll,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Reset ${t} zoom`,onClick:_,children:(0,R.jsx)(u_,{size:16})}),(0,R.jsxs)(Kp,{position:`bottom-end`,withinPortal:!0,onChange:e=>{e&&Le()},children:[(0,R.jsx)(Kp.Target,{children:(0,R.jsx)(ll,{ref:Oe,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`${t} menu${Te?`, refresh failed`:``}`,"aria-describedby":Te?Ee:void 0,onFocus:e=>{let t=e.currentTarget.matches(`:focus-visible`);Ae(t),t&&Pe(!1)},onBlur:()=>Ae(!1),onMouseEnter:()=>{Me(!0),Pe(!1)},onMouseLeave:Le,children:be?(0,R.jsx)(E_,{size:18,weight:`fill`,color:`var(--mantine-color-warn-filled)`}):(0,R.jsx)(tte,{size:18,weight:`bold`})})}),(0,R.jsx)(Xm,{target:De,multiline:!0,maw:`min(360px, calc(100vw - 32px))`,label:(0,R.jsxs)(R.Fragment,{children:[Ce&&(0,R.jsx)(Dd,{size:`xs`,children:Ce}),(0,R.jsx)(Dd,{"data-refresh-error-message":!0,size:`xs`,title:be||void 0,lineClamp:4,style:{overflowWrap:`anywhere`},children:be})]}),opened:Fe}),(0,R.jsxs)(Kp.Dropdown,{children:[(ie||e.viz===`text`)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Kp.RadioGroup,{value:se,onChange:ce,children:(0,R.jsx)(B,{role:`group`,"aria-label":`${t} view`,children:(e.viz===`text`?[`Chart`,`Spec`]:[`Chart`,`Data`,`Spec`]).map(t=>(0,R.jsx)(Kp.RadioItem,{value:t,"data-panel-view":t,closeMenuOnClick:!0,children:e.viz===`text`&&t===`Chart`?`Content`:t},t))})}),(0,R.jsx)(Kp.Divider,{})]}),be&&xe&&C&&(0,R.jsx)(Kp.Item,{disabled:r,onClick:()=>{Le(),C()},children:`Retry`}),Se&&l&&S&&(0,R.jsx)(Kp.Item,{onClick:S,children:`Ask Fanout to fix it`}),y&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(f_,{size:14}),onClick:y,children:`View`}),l&&x&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(ete,{size:14}),onClick:x,children:`Explain in chat`}),b&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(v_,{size:14}),onClick:b,children:`Copy link`}),T&&(0,R.jsx)(Kp.Item,{leftSection:(0,R.jsx)(v_,{size:14}),onClick:T,children:`Duplicate`}),w&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Kp.Divider,{}),(0,R.jsx)(Kp.Item,{color:`bad`,leftSection:(0,R.jsx)(ote,{size:14}),onClick:w,children:`Remove panel`})]})]})]})]})]}),(0,R.jsx)(B,{ref:ze,"data-panel-body":!0,className:`dashboard-panel-padding`,style:{flex:`1 1 0px`,isolation:`isolate`,contain:ve||se===`Data`?`paint`:void 0,minHeight:0,minWidth:0,padding:`16px`,overflow:_e?`auto`:`hidden`,display:ve||se!==`Chart`?`block`:`flex`,flexDirection:`column`},children:O?(0,R.jsx)(Rf,{h:`100%`,children:(0,R.jsx)(Dd,{size:`sm`,c:`dimmed`,children:`Shown in full-screen`})}):se===`Data`?(0,R.jsx)(Lre,{panel:e,result:n}):se===`Spec`?(0,R.jsx)(Rre,{panel:e,dark:P}):!n&&e.viz!==`text`?(0,R.jsx)(Rf,{style:{minHeight:`100%`,flexShrink:0},children:(0,R.jsx)(tl,{size:`sm`,"aria-label":`Loading panel`})}):n?.status===`error`?(0,R.jsxs)(B,{"data-panel-error":!0,style:{height:`100%`,maxHeight:`100%`,minHeight:0,minWidth:0,overflow:`hidden`,display:`flex`,flexDirection:Ue?`row`:`column`,alignItems:`center`,justifyContent:`center`,gap:Ue?6:4},children:[(0,R.jsx)(E_,{size:18,weight:`fill`,color:`var(--mantine-color-bad-filled)`,style:{flexShrink:0}}),!Ue&&(0,R.jsx)(Dd,{size:`sm`,fw:500,c:`bad`,style:{flexShrink:0},children:`This panel failed`}),(0,R.jsx)(Dd,{"data-panel-error-message":!0,title:n.error,size:`xs`,c:`dimmed`,ta:Ue?`left`:`center`,style:{minWidth:0,minHeight:0,overflow:`hidden`,...Ue?{flex:`1 1 0px`,whiteSpace:`nowrap`,textOverflow:`ellipsis`}:{overflowWrap:`anywhere`,flex:`0 1 auto`}},children:Ue?`This panel failed: ${n.error??`Request failed`}`:n.error}),xe&&C&&(0,R.jsx)(Ff,{size:`compact-xs`,variant:`light`,style:{flexShrink:0},disabled:r,onClick:C,children:`Retry`}),Se&&l&&S&&(Ue?(0,R.jsx)(Xm,{label:`Ask Fanout to fix it`,events:{hover:!0,focus:!0,touch:!1},children:(0,R.jsx)(ll,{size:32,variant:`light`,"aria-label":`Ask Fanout to fix it`,style:{flex:`0 0 32px`},onClick:S,children:(0,R.jsx)(ste,{size:16})})}):(0,R.jsx)(Ff,{size:`compact-xs`,variant:`light`,style:{flexShrink:0},onClick:S,children:`Ask Fanout to fix it`}))]}):n?.status===`empty`?(0,R.jsx)(Rf,{style:{minHeight:`100%`,flexShrink:0},children:(0,R.jsxs)(dh,{align:`center`,gap:4,maw:420,children:[(0,R.jsx)(ate,{size:20,color:`var(--mantine-color-dimmed)`}),(0,R.jsx)(Dd,{size:`sm`,c:`dimmed`,ta:`center`,children:n.diagnosis||`No data in this time range.`})]})}):(0,R.jsx)(nb.Provider,{value:N,children:(0,R.jsx)(DEe,{traceLinks:D,onMapView:de,compare:i,range:a,panel:e,title:t,result:n,dark:P,height:pe,group:s,annotations:u,vars:d,onSelect:f,onPoint:p,onVariable:m,onZoom:h,onRangePending:g})})}),Re.length>0&&(0,R.jsx)(B,{"data-panel-notes":!0,className:`dashboard-panel-padding`,pb:12,style:{display:`flex`,flexDirection:`column`,gap:4,flexShrink:0,position:`relative`,zIndex:1,paddingTop:8,background:`var(--mantine-color-body)`},children:Re.map(e=>(0,R.jsx)(Dd,{"data-panel-note":!0,fz:12,c:`dimmed`,role:`status`,title:e===ye?n?.frame?.note:void 0,style:{overflowWrap:`anywhere`},children:e},e))}),Te&&(0,R.jsx)(`span`,{id:Ee,hidden:!0,children:Te}),We&&(0,R.jsx)(B,{"data-panel-scroll-fade":!0,"aria-hidden":`true`,style:{position:`absolute`,left:16,right:16,bottom:We.bottom,height:16,pointerEvents:`none`,zIndex:1,background:`linear-gradient(to bottom, transparent, var(--mantine-color-body))`}})]})}function jEe(e){let t=e?.match(/^Split at (\S+)( · .+)$/);if(!t)return e;let n=new Date(t[1]);return Number.isFinite(n.getTime())?`Split at ${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(n)}${t[2]}`:e}function O0(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r} minute${r===1?``:`s`} ago`;let i=Math.floor(r/60);return`${i} hour${i===1?``:`s`} ago`}function MEe({variables:e,vars:t,options:n,onChange:r}){return e.length===0?null:(0,R.jsx)(yl,{gap:`sm`,wrap:`wrap`,role:`group`,"aria-label":`Dashboard variables`,children:e.map(e=>{let i=Qg(e,t,n[e.name]),a=[...e.include_all?[{value:Zg,label:`All`}]:[],...(n[e.name]??e.options?.map(e=>({value:e}))??[]).map(e=>({value:e.value,label:e.value}))],o=(0,R.jsxs)(Dd,{size:`xs`,c:`dimmed`,ff:`monospace`,children:[`$`,e.name]});return e.kind===`constant`?(0,R.jsx)(jh,{label:o,size:`xs`,value:e.value,readOnly:!0,w:160},e.name):e.kind===`text`?(0,R.jsx)(jh,{label:o,size:`xs`,w:200,defaultValue:typeof i==`string`?i:``,onBlur:t=>r(e.name,t.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.name}:${JSON.stringify(i)}`):e.multi?(0,R.jsx)(Dm,{label:o,size:`xs`,w:260,searchable:!0,clearable:!0,data:a.filter(e=>e.value!==Zg),value:Array.isArray(i)?i:i&&i!==`$__all`?[i]:[],placeholder:e.include_all?`All`:`None`,onChange:t=>r(e.name,t.length?t:e.include_all?Zg:[])},e.name):(0,R.jsx)(Qm,{label:o,size:`xs`,w:220,searchable:!0,allowDeselect:!1,data:a,value:Array.isArray(i)?i[0]??null:i||null,onChange:t=>t!==null&&r(e.name,t)},e.name)})})}var NEe=e=>({panels:e.panels.map(({grid:e,...t})=>t),variables:e.variables,time:e.time,annotations:e.annotations});function PEe(e,t,n,r){return[`variables`,e,NEe(t),n,r]}function FEe(e,t,n,r,i,a=!1){let o=!!t.variables?.some(e=>e.kind===`query`),s=Mg({queryKey:PEe(e,t,n,r),queryFn:async({signal:e})=>{let a=await i({dashboard:t,time:n,vars:r},e);return Object.fromEntries((t.variables??[]).map(e=>[e.name,a[e.name]??(e.kind===`custom`?e.options?.map(e=>({value:e})):void 0)??[]]))},enabled:o,retry:a,staleTime:6e4,placeholderData:e=>e}),c=s.isPlaceholderData?void 0:s.data,l=s.isError||(t.variables??[]).every(e=>e.kind!==`query`||r[e.name]!==void 0&&r[e.name]!==`$__all`&&(e.multi||!Array.isArray(r[e.name])||r[e.name].length>0)||!!e.default||e.include_all||c?.[e.name]!==void 0);return{...s,currentData:c,ready:l}}function IEe(e,t){let n=JSON.stringify([e.range,e.from,e.to]),r=(0,A.useRef)({search:e,onSearch:t,scope:n}),i=(0,A.useRef)(``),a=(0,A.useRef)(void 0),[o,s]=(0,A.useState)(!1);r.current.scope!==n&&(i.current!==`${e.from}/${e.to}`&&(a.current=void 0,o&&s(!1)),i.current=``),r.current={search:e,onSearch:t,scope:n};let c=(0,A.useCallback)(()=>{i.current=``,a.current=void 0,s(!1)},[]),l=(0,A.useCallback)(()=>{if(!a.current)return;let e=a.current;c(),r.current.onSearch({...r.current.search,...e},!1)},[c]);return{zoom:(0,A.useCallback)((e,t)=>{let n=Ire(e,t);if(!n)return;let o=r.current,c=`${n.from}/${n.to}`;o.search.from===n.from&&o.search.to===n.to||i.current===c||(a.current??={range:o.search.range,from:o.search.from,to:o.search.to},s(!0),i.current=c,o.onSearch({...o.search,range:void 0,...n},!1))},[]),reset:c,resetZoom:l,zoomed:o}}function LEe(e,t,n,r){let i=e=>t?.frame?.columns.some((n,r)=>n.name===e&&t.frame.values[r]?.some(e=>typeof e==`string`&&e!==``));return{onSelect:e.click&&(e.viz===`service_map`||!(e.drill&&r))?t=>n(e.click.set_variable,t):void 0,onPoint:r&&(e.viz===`service_map`||e.click||e.drill||i(`trace_id`)||e.options?.columns?.some(e=>e.format===`trace_link`&&i(e.field)))?r:void 0}}function REe(e,t,n,r){if(!t)return;let i=k_(e,t,n);if(!i)return;let a=Object.values(n.dimensions)[0],o=e.click?.set_variable;return{target:i,vars:o&&a!==void 0?{...r,[o]:a}:r}}var zEe=e=>e*40+(e-1)*12,BEe={s:3,m:6,l:10},VEe={stat:4},HEe=e=>Math.max(VEe[e.viz]??0,BEe[e.height??(e.viz===`service_map`?`l`:e.viz===`stat`?`s`:`m`)]),k0=e=>Math.max(e.viz===`service_map`?460:0,zEe(e.grid?.h??HEe(e)));function UEe(e){let t=(0,A.useRef)(void 0),n=t=>[...e.current?.querySelectorAll(`[data-panel]`)??[]].find(e=>e.dataset.panel===t&&!e.closest(`[data-panel-fullscreen],[data-fragment-fullscreen]`));return(0,A.useEffect)(()=>{t.current&&!n(t.current.panel)&&(t.current=void 0)}),{remember(n){t.current=void 0;let r=document.activeElement;if(!(r instanceof HTMLElement)||!e.current?.contains(r)||r.closest(`[data-panel]`)?.dataset.panel!==n)return;let i=r.getAttribute(`data-panel-view`),a=r.getAttribute(`aria-label`),o=r.hasAttribute(`data-chart-plot`)?`[data-chart-plot]`:i?`[data-panel-view=${JSON.stringify(i)}]`:a?`[aria-label=${JSON.stringify(a)}]`:void 0;t.current={element:r,panel:n,selector:o}},restore(e){let r=t.current;if(t.current=void 0,r&&(e===void 0||r.panel===e)&&n(r.panel))return r.element.isConnected&&!r.element.closest(`[hidden]`)?r.element:r.selector?n(r.panel)?.querySelector(r.selector)??void 0:void 0}}}var WEe=async()=>{throw Error(`Variable options unavailable`)};function GEe({fragment:e,dark:t,onQuery:n,drillClient:r,resolveVariables:i,height:a,hostDisplayMode:o,onDisplayMode:s}){let c=(0,A.useId)(),[l,u]=(0,A.useState)(e),[d,f]=(0,A.useState)(e.vars??{}),[p,m]=(0,A.useState)(e.dashboard.time),[h,g]=(0,A.useState)(!1),[_,v]=(0,A.useState)(),[y,b]=(0,A.useState)(),x=(0,A.useRef)(Date.now()),S=(0,A.useRef)(0),[C,w]=(0,A.useState)(),[T,E]=(0,A.useState)(),D=(0,A.useRef)(null),O=UEe(D),k=(0,A.useRef)(o);(0,A.useEffect)(()=>{k.current===`fullscreen`&&o===`inline`&&E(void 0),k.current=o},[o]);let j=async e=>{O.remember(e);try{(!s||await s(`fullscreen`))&&E(e)}catch{v(`Full-screen could not be opened. Please try again.`)}},M=()=>{E(void 0),s&&s(`inline`).catch(()=>v(`Full-screen could not be closed. Please try again.`))},N=(0,A.useRef)(new Map),P=(0,A.useRef)(void 0);T&&(P.current=T);let F=o===`fullscreen`&&!!T,ee=(0,A.useRef)(null),te=(0,A.useRef)(!1);(0,A.useEffect)(()=>{let e=te.current&&!F;if(te.current=F,F&&ee.current?.focus(),!e)return;let t=requestAnimationFrame(()=>(O.restore(P.current)??N.current.get(P.current??``))?.focus());return()=>cancelAnimationFrame(t)},[F]),(0,A.useEffect)(()=>{if(!F)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&!e.repeat&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!document.querySelector(`[role="dialog"]`)&&(e.preventDefault(),M())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[F,s]);let[ne,I]=(0,A.useState)(()=>window.innerHeight);(0,A.useEffect)(()=>{let e=()=>I(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{S.current++,u(e),f(e.vars??{}),m(e.dashboard.time),w(void 0),E(void 0),g(!1),v(void 0),b(void 0),le(),x.current=Date.now()},[e]),(0,A.useEffect)(()=>()=>{S.current++},[]);let re=l.dashboard,ie=FEe(c,re,p,d,i??WEe),ae=(0,A.useMemo)(()=>e_(re.variables,d,ie.currentData),[re.variables,d,ie.currentData]);async function oe(e=d,t=p){let r=++S.current;f(e),m(t),w(void 0),g(!0),v(void 0),b(x.current);let i=e===d?ae:e_(re.variables,e,ie.currentData);try{let e=Xg(await n({dashboard:re,time:t,vars:i}));if(S.current!==r)return;u(e),x.current=Date.now(),b(void 0)}catch(e){S.current===r&&v(e instanceof Error?e.message:`This view could not be refreshed.`)}finally{S.current===r&&g(!1)}}let se=(e,t)=>{let n={...d};t===void 0?delete n[e]:n[e]=t,oe(n)},{zoom:ce,reset:le,resetZoom:ue,zoomed:de}=IEe(p,e=>void oe(d,e)),fe=(e,t)=>{let n=REe(e,l.results.find(t=>t.id===e.id),t,d);n&&(n.vars!==d&&oe(n.vars),w(n.target))},pe=(e,t,n=!1)=>(0,R.jsx)(AEe,{panel:e,title:$g(e.title,ae),result:l.results.find(t=>t.id===e.id),suspended:!n&&e.id===T,menuRef:n?void 0:t=>{t?N.current.set(e.id,t):N.current.delete(e.id)},group:c,height:t,loading:h,staleAt:y,editing:!1,agentAvailable:!1,vars:ae,range:e.time?.range??p.range,compare:p.compare===`previous_period`,onVariable:se,...LEe(e,l.results.find(t=>t.id===e.id),se,t=>fe(e,t)),onZoom:ce,zoomed:de,onZoomReset:ue,onView:o===void 0||s?()=>void j(e.id):void 0,traceLinks:`button`}),L=re.panels.find(e=>e.id===T);return(0,R.jsxs)(dh,{ref:D,"data-dashboard-fragment":!0,gap:`md`,p:`md`,children:[(0,R.jsx)(B,{hidden:F,style:F?{display:`none`}:void 0,children:(0,R.jsxs)(dh,{gap:`md`,children:[re.panels.length>1&&(0,R.jsx)(Dd,{"data-fragment-header":!0,fw:600,children:Mee(l)}),(0,R.jsx)(MEe,{variables:re.variables??[],vars:d,options:ie.data??{},onChange:se}),ie.error&&(0,R.jsx)(Sd,{color:`bad`,children:`Variable options could not be loaded.`}),_&&(0,R.jsx)(Sd,{color:`bad`,children:_}),re.panels.map(e=>(0,R.jsx)(B,{h:a??k0(e),children:pe(e,a??k0(e))},e.id)),l.trace&&(0,R.jsx)(Qy,{result:l.trace,dark:t})]})}),F&&L&&(0,R.jsx)(B,{"data-fragment-fullscreen":!0,role:`region`,"aria-label":$g(L.title,ae),tabIndex:-1,ref:ee,h:`calc(100vh - 32px)`,children:pe(L,Math.max(40,ne-80),!0)}),o!==`fullscreen`&&(0,R.jsx)(kEe,{opened:!!L,onClose:M,title:L?$g(L.title,ae):`Panel`,escapeEnabled:!C,returnFocusTo:()=>O.restore(P.current)??N.current.get(P.current??``),children:L&&(0,R.jsx)(B,{h:`calc(100vh - 120px)`,children:pe(L,Math.max(40,ne-140),!0)})}),(0,R.jsx)(Fre,{client:r,spec:re,time:p,vars:ae,target:C,onChange:w})]})}function KEe(e){async function t(t,n,r){if(r?.aborted)throw new DOMException(`Canceled`,`AbortError`);let i;try{i=await e.callServerTool({name:t,arguments:n},{signal:r})}catch(e){throw e instanceof Error&&e.name===`AbortError`?e:r?.aborted?new DOMException(`Canceled`,`AbortError`):Error(`This view could not be refreshed.`)}if(r?.aborted)throw new DOMException(`Canceled`,`AbortError`);if(i.isError||!i.structuredContent)throw Error(`This view could not be refreshed.`);return i.structuredContent}return{drill:{exemplars:(e,n)=>t(`list_panel_exemplars`,{...e},n),trace:async(e,n)=>{let r=Xg(await t(`inspect_trace`,{trace_id:e.trace_id,namespace:e.namespace,from:e.window_from,to:e.window_to,limit:200},n));if(!r.trace)throw Error(`Trace unavailable`);return r.trace}},query:async e=>{if(Object.hasOwn(e,`panels`))throw Error(`Panel subsets are unavailable in chat fragments`);let n=Xg(await t(`query_panel_fragment`,{...e}));return n.vars=e.vars,n},resolveVariables:async(e,n)=>{let r=await t(`resolve_panel_variables`,{...e},n);if(!r.options||typeof r.options!=`object`||Array.isArray(r.options)||Object.values(r.options).some(e=>!Array.isArray(e)||e.some(e=>!e||typeof e.value!=`string`)))throw Error(`Invalid variable options`);return r.options}}}var A0=Object.defineProperty,qEe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),JEe=(e,t)=>{let n={};for(var r in e)A0(n,r,{get:e[r],enumerable:!0});return t&&A0(n,Symbol.toStringTag,{value:`Module`}),n},YEe=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]);function XEe(e){return typeof e==`string`&&YEe.has(e.replace(/#$/,``))}function j0(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function M0(e,t=`|`){return e.map(e=>Z0(e)).join(t)}function N0(e,t){return typeof t==`bigint`?t.toString():t}var ZEe=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function P0(e){return new ZEe(e)}function QEe(e){return e==null}function F0(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function $Ee(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){let e=t._zod.def.shape[a];return r?r(e,a):e}):V0(e,a,r?r(n.value,a):n.value))}}function tDe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?B0(e,n,()=>t[n]):V0(e,n,r.value))}}function U0(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function nDe(e){return JSON.stringify(e)}function rDe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var W0=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function G0(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var iDe=P0(()=>{if(x2.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function K0(e){if(G0(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return G0(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function q0(e){return K0(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var aDe=new Set([`string`,`number`,`symbol`]);function J0(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Y0(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function X0(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Z0(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function oDe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Q0={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sDe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function cDe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return H0(i,e,$0(e,t)),Y0(e,U0(n,{shape:i,checks:[]}))}function $0(e,t){let n=z0(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function lDe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set($0(e,t)),a={};return H0(a,e,Reflect.ownKeys(z0(e)).filter(e=>!i.has(e))),Y0(e,U0(n,{shape:a,checks:[]}))}function uDe(e,t){if(!K0(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=z0(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Y0(e,U0(e._zod.def,{shape:e2(e,t)}))}function e2(e,t){let n={};return H0(n,e,Reflect.ownKeys(z0(e))),tDe(n,t),n}function dDe(e,t){if(!K0(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Y0(e,U0(e._zod.def,{shape:e2(e,t)}))}function fDe(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return H0(n,e,Reflect.ownKeys(z0(e))),H0(n,t,Reflect.ownKeys(z0(t))),Y0(e,U0(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function t2(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set($0(t,n)):void 0,o={};return H0(o,t,Reflect.ownKeys(z0(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Y0(t,U0(t._zod.def,{shape:o,checks:[]}))}function pDe(e,t,n){let r=n?new Set($0(t,n)):void 0,i={};return H0(i,t,Reflect.ownKeys(z0(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Y0(t,U0(t._zod.def,{shape:i}))}function n2(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function i2(e){return typeof e==`string`?e:e?.message}function a2(e,t,n){var r;for(let i=t;ie;return t[SDe]=!0,t}var g2,wDe=Object.freeze({status:`aborted`}),_2={value:void 0,enumerable:!1},v2=`captureStackTrace`in Error?Error:null;function TDe(e){let t=v2;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return v2=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){_2.value=new a(r);try{Object.defineProperty(n,"_zod",_2)}finally{_2.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),_De(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?TDe(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var y2=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},b2=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(g2=globalThis).__zod_globalConfig??(g2.__zod_globalConfig={});var x2=globalThis.__zod_globalConfig;function S2(e){return e&&Object.assign(x2,e),x2}function EDe(){let e=this._zod;return e.message??=JSON.stringify(e.def,N0,2),e.message}function DDe(e){this._zod.message=e}var ODe={get:EDe,set:DDe,enumerable:!0,configurable:!0},C2={value:void 0,enumerable:!1},w2=new WeakSet([Object.prototype,Error.prototype]),T2=(e,t)=>{e.name=`$ZodError`,C2.value=t,Object.defineProperty(e,"issues",C2),C2.value=void 0,Object.defineProperty(e,"message",ODe);let n=Object.getPrototypeOf(e);w2.has(n)||(w2.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},kDe=J(`$ZodError`,T2);J(`$ZodError`,T2,void 0,{Parent:Error});function ADe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function jDe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ADe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function MDe(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new y2;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>o2(e,o,S2())));throw W0(n,a?.callee??t),n}return s.value};return t},O2=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>o2(e,o,S2())));throw W0(n,a?.callee??t),n}return s.value};return t},k2=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new y2;return a.issues.length?A2(e,a.issues,i):{success:!0,data:a.value}};function A2(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>o2(e,n,S2()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var j2=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?A2(e,a.issues,i):{success:!0,data:a.value}},NDe=Symbol.for(`zod.compile.invalid`),PDe=Symbol.for(`zod.compile.fallback`),FDe=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==NDe)return!0;if(r.definite===!0&&n===void 0)return!1}return IDe(e,t,n)});function IDe(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[PDe]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new y2;return a.issues.length===0}var LDe=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},RDe=e=>{let t=D2(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,E2(n,a))};return n},zDe=e=>{let t=D2(e),n=(e,r,i,a)=>t(e,r,i,E2(n,a));return n},BDe=e=>{let t=O2(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,E2(n,a))};return n},VDe=e=>{let t=O2(e),n=async(e,r,i,a)=>await t(e,r,i,E2(n,a));return n},HDe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return k2(e)(t,n,i)},UDe=e=>(t,n,r)=>k2(e)(t,n,r),WDe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return j2(e)(t,n,i)},GDe=e=>async(t,n,r)=>j2(e)(t,n,r),KDe=/^[cC][0-9a-z]{6,}$/,qDe=/^[0-9a-z]+$/,JDe=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,YDe=/^[0-9a-vA-V]{20}$/,XDe=/^[A-Za-z0-9]{27}$/,ZDe=/^[a-zA-Z0-9_-]{21}$/;function QDe(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var $De=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eOe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,M2=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tOe=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nOe=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function rOe(){return new RegExp(nOe,`u`)}var iOe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aOe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,oOe=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sOe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cOe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lOe=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,uOe=/^https?$/,dOe=/^\+[1-9]\d{6,14}$/,N2=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function fOe(e){return RegExp(`^${e}$`)}var pOe=fOe(N2);function P2(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mOe(e){return RegExp(`^${P2(e)}$`)}function hOe(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${P2({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${P2({precision:e.precision})}`:n;return RegExp(`^${N2}T(?:${r})$`)}var gOe=/^[\s\S]{0,}$/,_Oe=/^-?\d+$/,F2=/^-?\d+(?:\.\d+)?$/,vOe=/^(?:true|false)$/i,yOe=/^null$/i,bOe=/^undefined$/i,xOe=/^[^A-Z]*$/,SOe=/^[^a-z]*$/,I2=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),L2=e=>{let t=e.value;return!QEe(t)&&t.length!==void 0},R2={number:`number`,bigint:`bigint`,object:`date`},z2=J(`$ZodCheckLessThan`,(e,t)=>{I2.init(e,t);let n=R2[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{I2.init(e,t);let n=R2[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:R2[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),COe=J(`$ZodCheckMultipleOf`,(e,t)=>{I2.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):$Ee(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),wOe=J(`$ZodCheckNumberFormat`,(e,t)=>{I2.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Q0[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),TOe=J(`$ZodCheckMaxLength`,(e,t)=>{var n;I2.init(e,t),(n=e._zod.def).when??(n.when=L2),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?s2(r):i)<=t.maximum)return;let a=c2(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),EOe=J(`$ZodCheckMinLength`,(e,t)=>{var n;I2.init(e,t),(n=e._zod.def).when??(n.when=L2),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=c2(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),DOe=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;I2.init(e,t),(n=e._zod.def).when??(n.when=L2),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?s2(r):i;if(a===t.length)return;let o=c2(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),V2=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;I2.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),OOe=J(`$ZodCheckRegex`,(e,t)=>{V2.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kOe=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xOe,V2.init(e,t)}),AOe=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=SOe,V2.init(e,t)}),jOe=J(`$ZodCheckIncludes`,(e,t)=>{I2.init(e,t);let n=J0(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),MOe=J(`$ZodCheckStartsWith`,(e,t)=>{I2.init(e,t);let n=RegExp(`^${J0(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),NOe=J(`$ZodCheckEndsWith`,(e,t)=>{I2.init(e,t);let n=RegExp(`.*${J0(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),POe=J(`$ZodCheckOverwrite`,(e,t)=>{I2.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),FOe=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` `)}\n};`)(...Object.values(this.closed))}},IOe={major:4,minor:6,patch:5},H2=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=IOe;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=n2(t),a;for(let o of n){if(o._zod.def.when){if(mDe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new y2;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(a2(t.issues,n,e),i||=n2(t,n))});else{if(t.issues.length===n)continue;a2(t.issues,n,e),i||=n2(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(n2(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new y2;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new y2;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return d2(this,`~standard`,W2(this))},set"~standard"(e){u2(this,`~standard`,e)}}),U2=(e,t)=>e.issues.length?{issues:e.issues.map(e=>o2(e,t,S2()))}:{value:e.value};async function LOe(e,t){let n={async:!0};return U2(await e._zod.run({value:t,issues:[]},n),n)}function W2(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return U2(r,n)}catch{}return LOe(e,t)},vendor:`zod`,version:1}}var G2=J(`$ZodString`,(e,t)=>{H2.init(e,t),e._zod.pattern=t.pattern??gOe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),K2=J(`$ZodStringFormat`,(e,t)=>{V2.init(e,t),G2.init(e,t)}),ROe=J(`$ZodGUID`,(e,t)=>{t.pattern??=eOe,K2.init(e,t)}),zOe=J(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=M2(e)}else t.pattern??=M2();K2.init(e,t)}),BOe=J(`$ZodEmail`,(e,t)=>{t.pattern??=tOe,K2.init(e,t)});function q2(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function VOe(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?q2(e)||2:HOe(e,t)}function HOe(e,t){if(!t.normalize&&t.protocol?.source===uOe.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var UOe=/[\t\n\r]/g;function J2(e){return e.replace(UOe,``)}function WOe(e,t){return t.lastIndex=0,t.test(e.hostname)}function GOe(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var KOe=J(`$ZodURL`,(e,t)=>{K2.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=VOe(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=J2(r);return}t.hostname&&!WOe(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!GOe(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:J2(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qOe=J(`$ZodEmoji`,(e,t)=>{t.pattern??=rOe(),K2.init(e,t)}),JOe=J(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?ZDe:QDe(t.length),K2.init(e,t)}),YOe=J(`$ZodCUID`,(e,t)=>{t.pattern??=KDe,K2.init(e,t)}),XOe=J(`$ZodCUID2`,(e,t)=>{t.pattern??=qDe,K2.init(e,t)}),ZOe=J(`$ZodULID`,(e,t)=>{t.pattern??=JDe,K2.init(e,t)}),QOe=J(`$ZodXID`,(e,t)=>{t.pattern??=YDe,K2.init(e,t)}),$Oe=J(`$ZodKSUID`,(e,t)=>{t.pattern??=XDe,K2.init(e,t)}),eke=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=hOe(t),K2.init(e,t)}),tke=J(`$ZodISODate`,(e,t)=>{t.pattern??=pOe,K2.init(e,t)}),nke=J(`$ZodISOTime`,(e,t)=>{t.pattern??=mOe(t),K2.init(e,t)}),rke=J(`$ZodISODuration`,(e,t)=>{t.pattern??=$De,K2.init(e,t)}),ike=J(`$ZodIPv4`,(e,t)=>{t.pattern??=iOe,K2.init(e,t)}),ake=/^[0-9a-fA-F:.]+$/;function Y2(e){return ake.test(e)?q2(`http://[${e}]`):!1}var oke=J(`$ZodIPv6`,(e,t)=>{t.pattern??=aOe,K2.init(e,t),e._zod.check=n=>{Y2(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),ske=J(`$ZodCIDRv4`,(e,t)=>{t.pattern??=oOe,K2.init(e,t)});function cke(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Y2(n)}var lke=J(`$ZodCIDRv6`,(e,t)=>{t.pattern??=sOe,K2.init(e,t),e._zod.check=n=>{cke(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function X2(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Z2=/^[0-9a-zA-Z+/]*={0,2}$/,uke=J(`$ZodBase64`,(e,t)=>{t.pattern??=Z2,K2.init(e,t),e._zod.check=n=>{X2(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Q2=/^[A-Za-z0-9_-]*$/;function dke(e){if(!Q2.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return X2(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var fke=J(`$ZodBase64URL`,(e,t)=>{t.pattern??=Q2,K2.init(e,t),e._zod.check=n=>{dke(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),pke=J(`$ZodE164`,(e,t)=>{t.pattern??=dOe,K2.init(e,t)});function mke(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var hke=J(`$ZodJWT`,(e,t)=>{K2.init(e,t),e._zod.check=n=>{mke(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),$2=J(`$ZodNumber`,(e,t)=>{H2.init(e,t),e._zod.pattern=F2,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),gke=J(`$ZodNumberFormat`,(e,t)=>{wOe.init(e,t),$2.init(e,t)}),_ke=J(`$ZodBoolean`,(e,t)=>{H2.init(e,t),e._zod.pattern=vOe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),vke=J(`$ZodUndefined`,(e,t)=>{H2.init(e,t),e._zod.pattern=bOe,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),yke=J(`$ZodNull`,(e,t)=>{H2.init(e,t),e._zod.pattern=yOe,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),bke=J(`$ZodAny`,(e,t)=>{H2.init(e,t),e._zod.parse=e=>e}),xke=J(`$ZodUnknown`,(e,t)=>{H2.init(e,t),e._zod.parse=e=>e}),Ske=J(`$ZodNever`,(e,t)=>{H2.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function e4(e,t,n){e.issues.length&&t.issues.push(...r2(n,e.issues)),t.value[n]=e.value}var Cke=J(`$ZodArray`,(e,t)=>{H2.init(e,t);let n=x2.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;ee4(t,r,e)));else if(e4(c,r,e),s&&c.issues.length!==0&&n2(c))break}return o.length?Promise.all(o).then(()=>r):r}});function t4(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...r2(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var wke=[];function n4(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:wke,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=oDe(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function r4(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(n2(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>t4(e,n,i,t,d,f))):t4(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Tke=J(`$ZodObject`,(e,t)=>{H2.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=P0(()=>n4(t));h2(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||L0(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=G0,o=t.catchall,s,c=x2.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(n2(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>t4(n,t,e,r,a,o))):t4(s,t,e,r,a,o)}return o?r4(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Eke=J(`$ZodObjectJIT`,(e,t)=>{Tke.init(e,t);let n=e._zod.parse,r=P0(()=>n4(t)),i=x2.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new FOe([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` let ${e}_ab = false; diff --git a/internal/mcp/dashboards.go b/internal/mcp/dashboards.go index 8e16fd5a7..1f706ca9b 100644 --- a/internal/mcp/dashboards.go +++ b/internal/mcp/dashboards.go @@ -126,7 +126,7 @@ var dashboardTools = [...]mcp.Tool{ { Name: "replace_dashboard", Title: "Replace dashboard", Description: "Replace a dashboard's whole spec; omitted panels are removed. Use only for a redesign the user asked for; use edit_dashboard to change a few panels. " + saveReceiptGuide + "See create_dashboard for the spec guide.", - Annotations: &mcp.ToolAnnotations{DestructiveHint: boolPtr(true), IdempotentHint: true, OpenWorldHint: boolPtr(false)}, + Annotations: &mcp.ToolAnnotations{DestructiveHint: boolPtr(true), OpenWorldHint: boolPtr(false)}, }, { Name: "edit_dashboard", Title: "Edit dashboard", diff --git a/internal/mcp/describe_test.go b/internal/mcp/describe_test.go index 115418d2a..905114a38 100644 --- a/internal/mcp/describe_test.go +++ b/internal/mcp/describe_test.go @@ -98,6 +98,9 @@ func TestDescribeToolsIncludesTheDashboardTools(t *testing.T) { if !update.Destructive { t.Error("replace_dashboard reported non-destructive; it replaces a dashboard's design") } + if update.Idempotent { + t.Error("replace_dashboard reported idempotent; every save appends a version") + } if edit := found["edit_dashboard"]; edit.ReadOnly || !edit.Destructive { t.Errorf("edit_dashboard annotations = %+v, want destructive and not read-only", edit) } @@ -248,7 +251,7 @@ func TestDescribeToolsDocumentsFragmentResourcesAndAppHelpers(t *testing.T) { t.Fatalf("%s doc=%+v", name, found[name]) } } - for _, name := range []string{"query_panel_fragment", "get_panel_exemplars", "resolve_panel_variables"} { + for _, name := range []string{"query_panel_fragment", "list_panel_exemplars", "resolve_panel_variables"} { if !found[name].AppOnly || found[name].ResourceURI != "" { t.Fatalf("%s helper doc=%+v", name, found[name]) } diff --git a/internal/mcp/fragment_contract_test.go b/internal/mcp/fragment_contract_test.go index be5d88c1b..893153caa 100644 --- a/internal/mcp/fragment_contract_test.go +++ b/internal/mcp/fragment_contract_test.go @@ -233,7 +233,7 @@ func TestToolDocsDescribeFragmentInputs(t *testing.T) { t.Fatal(err) } for _, tool := range tools { - if tool.Name == "query_telemetry" || tool.Name == "query_panel_fragment" || tool.Name == "get_panel_exemplars" || tool.Name == "resolve_panel_variables" { + if tool.Name == "query_telemetry" || tool.Name == "query_panel_fragment" || tool.Name == "list_panel_exemplars" || tool.Name == "resolve_panel_variables" { for _, input := range tool.Inputs { if input.Description == "" { t.Fatalf("%s.%s missing input description", tool.Name, input.Name) diff --git a/internal/mcp/panels.go b/internal/mcp/panels.go index a69f64b52..d92766947 100644 --- a/internal/mcp/panels.go +++ b/internal/mcp/panels.go @@ -52,7 +52,7 @@ func (s *Server) registerPanelTools() { fragmentTool(s, &mcp.Tool{Name: "query_panel_fragment", Title: "Refresh telemetry panels", Description: "Run every panel in a dashboard fragment; panel subsets are forbidden.", Annotations: readOnly, Meta: appHelperMeta()}, func(ctx context.Context, req *mcp.CallToolRequest, input fragmentInput) (*mcp.CallToolResult, PanelFragment, error) { return s.queryPanelFragment(ctx, req, panel.RunRequest{Dashboard: input.Dashboard, Time: input.Time, Vars: input.Vars, Widths: input.Widths, Compare: input.Compare}) }) - fragmentTool(s, &mcp.Tool{Name: "get_panel_exemplars", Title: "Panel exemplars", Description: "Find bounded traces for a panel selection.", Annotations: readOnly, Meta: appHelperMeta()}, s.panelExemplars) + fragmentTool(s, &mcp.Tool{Name: "list_panel_exemplars", Title: "Panel exemplars", Description: "Find bounded traces for a panel selection.", Annotations: readOnly, Meta: appHelperMeta()}, s.panelExemplars) fragmentTool(s, &mcp.Tool{Name: "resolve_panel_variables", Title: "Panel variable options", Description: "Resolve variable options within a dashboard fragment window.", Annotations: readOnly, Meta: appHelperMeta()}, s.resolvePanelVariables) mcp.AddTool(s.mcp, &mcp.Tool{ diff --git a/internal/mcp/server_test.go b/internal/mcp/server_test.go index b0b2630bf..76bf8e0f2 100644 --- a/internal/mcp/server_test.go +++ b/internal/mcp/server_test.go @@ -239,7 +239,7 @@ func TestToolsAdvertiseReadableMCPApps(t *testing.T) { } continue } - if tool.Name == "query_panel_fragment" || tool.Name == "get_panel_exemplars" || tool.Name == "resolve_panel_variables" { + if tool.Name == "query_panel_fragment" || tool.Name == "list_panel_exemplars" || tool.Name == "resolve_panel_variables" { if !appOnly(tool.Meta) { t.Fatalf("not app-only: %s", tool.Name) } @@ -291,7 +291,7 @@ func TestToolsAdvertiseReadableMCPApps(t *testing.T) { t.Fatal(err) } for _, tool := range listed.Tools { - if tool.Name == "query_panel_fragment" || tool.Name == "get_panel_exemplars" || tool.Name == "resolve_panel_variables" { + if tool.Name == "query_panel_fragment" || tool.Name == "list_panel_exemplars" || tool.Name == "resolve_panel_variables" { t.Fatalf("app helper exposed without negotiation: %s", tool.Name) } } diff --git a/internal/ui/dist/assets/chat-DjuGjU0o.js b/internal/ui/dist/assets/chat-Dr6SwXRM.js similarity index 99% rename from internal/ui/dist/assets/chat-DjuGjU0o.js rename to internal/ui/dist/assets/chat-Dr6SwXRM.js index 4292a7ec5..98a7f59ff 100644 --- a/internal/ui/dist/assets/chat-DjuGjU0o.js +++ b/internal/ui/dist/assets/chat-Dr6SwXRM.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-Bmuoa_GA.js","assets/brand-oskFJPNW.js","assets/auth-CQerCjF_.js","assets/use-computed-color-scheme-Bb1nqm0Z.js","assets/FocusTrap-yVpiEwpv.js","assets/get-single-element-child-D7qmWU2f.js","assets/index-Nz8e3wJG.js","assets/preload-helper-DOsq4iEA.js","assets/theme-C7oNnx5z.js","assets/Tooltip-2jTVpG2Y.js","assets/useQuery-BynlWFEG.js","assets/index-5ZpnOwIs.css"])))=>i.map(i=>d[i]); -import{A as e,C as t,Ct as n,M as r,S as i,T as a,_ as o,a as s,bt as c,c as l,d as u,et as d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,u as b,vt as x,x as S,y as C}from"./brand-oskFJPNW.js";import{c as w,d as ee,f as T,h as E,l as D,m as O,o as te,s as k,t as A}from"./preload-helper-DOsq4iEA.js";import{t as j}from"./Tooltip-2jTVpG2Y.js";import{c as M,d as N,l as P,o as F,r as I,s as ne,t as re,u as ie}from"./dashboard-change-chips-8yAFuODi.js";var L=n(c(),1),R=x(),ae=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function oe(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ae)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var V=null;function se(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function ce({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=d(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=oe(n);if(!r)return;let[i]=se(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},f=(0,L.useEffectEvent)(u),p=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(f))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:p,ref:s})}var H=a(e=>{let{autosize:t,maxRows:n,minRows:i,__staticSelector:a,resize:o,bottomSection:s,bottomSectionProps:c,...l}=r([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&N()!==`test`,d=u?{maxRows:n,minRows:i}:{};return(0,R.jsx)(h,{component:u?ce:`textarea`,...l,__staticSelector:a||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=a(n=>{let i=r(`Typography`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=i,f=e({name:`Typography`,classes:U,props:i,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(t,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var le=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),G=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:le}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:ue}));q.displayName=`PaperPlaneTiltIcon`;var fe=q,J=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:de}));J.displayName=`StopIcon`;var pe=J;function me(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function he(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{he(t.tool_result)}catch{return}return Y.add(t),t}}var ge=64,_e=300;function ve(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=ge?t.current=!0:(s||Date.now()-o<_e)&&(t.current=!1),a()};r.addEventListener(`scroll`,d,{passive:!0}),r.addEventListener(`wheel`,c,{passive:!0}),r.addEventListener(`touchmove`,c,{passive:!0}),r.addEventListener(`keydown`,c),r.addEventListener(`pointerdown`,l),window.addEventListener(`pointerup`,u),n.current=()=>{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function ye(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var be={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function xe({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),s=(0,L.useId)(),c=e.saved,d=c?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,d?.checked?`Checked in ${Z(d.elapsed_ms)}`:void 0,c?`Saved v${c.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...c?w(c.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(S,{"data-build-receipt":e.turn_id,"data-dashboard-result":c?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(l,{gap:6,children:[(0,R.jsxs)(o,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(u,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(o,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(re,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),c&&(0,R.jsx)(u,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:c.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ie,{expanded:i,id:s,children:(0,R.jsxs)(l,{gap:4,children:[c&&(0,R.jsxs)(f,{size:`xs`,children:[c.label,` `,c.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[be[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),d&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,d.checked?`checked`:`incomplete`,` · `,Z(d.elapsed_ms)]}),d?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Se=(0,L.lazy)(()=>A(()=>import(`./mcp-app-frame-Bmuoa_GA.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function Ce(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function we(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=ee(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&D(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=typeof e?.error==`string`?e.error:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:u,readOnly:e?.code===`answer_only`}),t.set(c,l)}}return t}function Te({failures:e}){let[n,r]=(0,L.useState)(!1),a=e.filter(e=>!e.readOnly);return(0,R.jsxs)(t,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),a.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:n?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a.length,` tool `,a.length===1?`call`:`calls`,` failed`]})]}),n&&(0,R.jsx)(l,{gap:`xs`,pl:`md`,children:a.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function Ee({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let r=e.content.tool_result,a=me(r),o=[...new Set(r.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=r.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of r.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=r.dashboard.panels.length>1?[`${r.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(S,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a,` · `,o,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(C,{size:`sm`})}),children:(0,R.jsx)(Se,{content:e.content})})]})}var De=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Oe(){let{agentAvailable:e,messages:n,messageTimes:r,ready:i,running:a,activity:s,provisional:c,stopped:d,error:p,threadMissing:h,send:g,retry:y,reloadThread:x,newThread:w}=k(),{scrollRef:ee,contentRef:T,toBottom:E}=ve(),D=te(n),O=n.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(S,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(l,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(_,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(u,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let A=Ce(n),j=we(n),M=n.filter(e=>A.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=n.findIndex(e=>e.id===O),P=n.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=n.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&c&&!c.collapsed&&c.text&&!P;return(0,R.jsxs)(t,{className:`chat-pane`,children:[(0,R.jsx)(t,{className:`chat-scroll`,ref:ee,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(v,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(o,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,onClick:w,children:`New chat`})]})}),!h&&!i&&p&&(0,R.jsx)(ke,{message:p,onRetry:x,onNewThread:w}),!h&&!i&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(C,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&i&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(je,{onSelect:g}),(0,R.jsxs)(l,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Te,{failures:j.get(e.id)},e.id):(0,R.jsxs)(t,{children:[(0,R.jsx)(Me,{message:e,time:r[e.id],appView:A.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(t,{mt:`sm`,children:(0,R.jsx)(xe,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:s})})]},e.id)),(F||I)&&(0,R.jsx)(t,{"data-answer-position":!0,children:(0,R.jsx)(Me,{message:I?{id:c.id,role:`assistant`,content:c.text}:F,provisional:!!I,time:I?void 0:r[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(o,{gap:`xs`,role:`status`,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:s||`Analyzing your system`})]}),d&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(ke,{message:p,onRetry:y})]})]})]})}),!h&&(0,R.jsx)(Ae,{})]})}function ke({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(v,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(o,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(u,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Ae(){let{input:e,setInput:n,inputRef:r,submit:i,send:a,stop:s,ready:c,running:l}=k();return(0,R.jsx)(t,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(S,{component:`form`,onSubmit:i,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(o,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:r,"aria-label":`Message Fanout`,value:e,onChange:e=>n(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!c,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(j,{label:`Stop`,children:(0,R.jsx)(O,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,R.jsx)(pe,{size:16,weight:`fill`})})}):(0,R.jsx)(O,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!c,"aria-label":`Send message`,children:(0,R.jsx)(fe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function je({onSelect:e}){return(0,R.jsxs)(l,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(_,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(o,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:De.map(t=>(0,R.jsx)(u,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Me({message:e,time:n,appView:r,provisional:i=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(v,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?r?(0,R.jsx)(Ee,{view:r}):(0,R.jsx)(v,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let s=e.role===`user`,c=n?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(n)):``;return(0,R.jsxs)(t,{className:`chat-message${i?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":s?`user`:`assistant`,children:[s?(0,R.jsx)(S,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${i?` chat-markdown--provisional`:``}`,"data-provisional":i||void 0,children:(0,R.jsx)(ne,{remarkPlugins:[F],components:Pe,children:a})}),(i||c||!s)&&(0,R.jsx)(o,{className:`chat-message-meta`,gap:6,justify:s?`flex-end`:`flex-start`,mt:4,h:24,children:i?(0,R.jsx)(C,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[c&&n&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:I(n),children:c}),!s&&(0,R.jsx)(Ne,{text:a,label:`Copy message`})]})})]})}function Ne({text:e,label:t}){let{state:n,copy:r}=ye();return(0,R.jsx)(j,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(O,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(y,{size:13})})})}var Pe={table:({children:e})=>(0,R.jsx)(t,{className:`chat-table`,children:(0,R.jsx)(P,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(P.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(P.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(P.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(P.Th,{children:e}),td:({children:e})=>(0,R.jsx)(P.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Fe,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Fe({children:e}){let n=$(e);return(0,R.jsxs)(t,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(t,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Ne,{text:n,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,Oe as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BW8pt9vy.js","assets/brand-oskFJPNW.js","assets/auth-CQerCjF_.js","assets/use-computed-color-scheme-Bb1nqm0Z.js","assets/FocusTrap-yVpiEwpv.js","assets/get-single-element-child-D7qmWU2f.js","assets/index-G9N3n5OB.js","assets/preload-helper-DOsq4iEA.js","assets/theme-BKAYKhPv.js","assets/Tooltip-2jTVpG2Y.js","assets/useQuery-BynlWFEG.js","assets/index-5ZpnOwIs.css"])))=>i.map(i=>d[i]); +import{A as e,C as t,Ct as n,M as r,S as i,T as a,_ as o,a as s,bt as c,c as l,d as u,et as d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,u as b,vt as x,x as S,y as C}from"./brand-oskFJPNW.js";import{c as w,d as ee,f as T,h as E,l as D,m as O,o as te,s as k,t as A}from"./preload-helper-DOsq4iEA.js";import{t as j}from"./Tooltip-2jTVpG2Y.js";import{c as M,d as N,l as P,o as F,r as I,s as ne,t as re,u as ie}from"./dashboard-change-chips-8yAFuODi.js";var L=n(c(),1),R=x(),ae=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function oe(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ae)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var V=null;function se(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function ce({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=d(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=oe(n);if(!r)return;let[i]=se(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},f=(0,L.useEffectEvent)(u),p=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(f))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:p,ref:s})}var H=a(e=>{let{autosize:t,maxRows:n,minRows:i,__staticSelector:a,resize:o,bottomSection:s,bottomSectionProps:c,...l}=r([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&N()!==`test`,d=u?{maxRows:n,minRows:i}:{};return(0,R.jsx)(h,{component:u?ce:`textarea`,...l,__staticSelector:a||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=a(n=>{let i=r(`Typography`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=i,f=e({name:`Typography`,classes:U,props:i,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(t,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var le=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),G=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:le}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:ue}));q.displayName=`PaperPlaneTiltIcon`;var fe=q,J=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:de}));J.displayName=`StopIcon`;var pe=J;function me(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function he(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{he(t.tool_result)}catch{return}return Y.add(t),t}}var ge=64,_e=300;function ve(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=ge?t.current=!0:(s||Date.now()-o<_e)&&(t.current=!1),a()};r.addEventListener(`scroll`,d,{passive:!0}),r.addEventListener(`wheel`,c,{passive:!0}),r.addEventListener(`touchmove`,c,{passive:!0}),r.addEventListener(`keydown`,c),r.addEventListener(`pointerdown`,l),window.addEventListener(`pointerup`,u),n.current=()=>{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function ye(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var be={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function xe({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),s=(0,L.useId)(),c=e.saved,d=c?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,d?.checked?`Checked in ${Z(d.elapsed_ms)}`:void 0,c?`Saved v${c.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...c?w(c.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(S,{"data-build-receipt":e.turn_id,"data-dashboard-result":c?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(l,{gap:6,children:[(0,R.jsxs)(o,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(u,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(o,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(re,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),c&&(0,R.jsx)(u,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:c.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ie,{expanded:i,id:s,children:(0,R.jsxs)(l,{gap:4,children:[c&&(0,R.jsxs)(f,{size:`xs`,children:[c.label,` `,c.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[be[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),d&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,d.checked?`checked`:`incomplete`,` · `,Z(d.elapsed_ms)]}),d?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Se=(0,L.lazy)(()=>A(()=>import(`./mcp-app-frame-BW8pt9vy.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function Ce(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function we(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=ee(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&D(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=typeof e?.error==`string`?e.error:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:u,readOnly:e?.code===`answer_only`}),t.set(c,l)}}return t}function Te({failures:e}){let[n,r]=(0,L.useState)(!1),a=e.filter(e=>!e.readOnly);return(0,R.jsxs)(t,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),a.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:n?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a.length,` tool `,a.length===1?`call`:`calls`,` failed`]})]}),n&&(0,R.jsx)(l,{gap:`xs`,pl:`md`,children:a.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function Ee({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let r=e.content.tool_result,a=me(r),o=[...new Set(r.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=r.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of r.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=r.dashboard.panels.length>1?[`${r.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(S,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a,` · `,o,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(C,{size:`sm`})}),children:(0,R.jsx)(Se,{content:e.content})})]})}var De=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Oe(){let{agentAvailable:e,messages:n,messageTimes:r,ready:i,running:a,activity:s,provisional:c,stopped:d,error:p,threadMissing:h,send:g,retry:y,reloadThread:x,newThread:w}=k(),{scrollRef:ee,contentRef:T,toBottom:E}=ve(),D=te(n),O=n.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(S,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(l,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(_,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(u,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let A=Ce(n),j=we(n),M=n.filter(e=>A.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=n.findIndex(e=>e.id===O),P=n.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=n.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&c&&!c.collapsed&&c.text&&!P;return(0,R.jsxs)(t,{className:`chat-pane`,children:[(0,R.jsx)(t,{className:`chat-scroll`,ref:ee,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(v,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(o,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,onClick:w,children:`New chat`})]})}),!h&&!i&&p&&(0,R.jsx)(ke,{message:p,onRetry:x,onNewThread:w}),!h&&!i&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(C,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&i&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(je,{onSelect:g}),(0,R.jsxs)(l,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Te,{failures:j.get(e.id)},e.id):(0,R.jsxs)(t,{children:[(0,R.jsx)(Me,{message:e,time:r[e.id],appView:A.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(t,{mt:`sm`,children:(0,R.jsx)(xe,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:s})})]},e.id)),(F||I)&&(0,R.jsx)(t,{"data-answer-position":!0,children:(0,R.jsx)(Me,{message:I?{id:c.id,role:`assistant`,content:c.text}:F,provisional:!!I,time:I?void 0:r[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(o,{gap:`xs`,role:`status`,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:s||`Analyzing your system`})]}),d&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(ke,{message:p,onRetry:y})]})]})]})}),!h&&(0,R.jsx)(Ae,{})]})}function ke({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(v,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(o,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(u,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Ae(){let{input:e,setInput:n,inputRef:r,submit:i,send:a,stop:s,ready:c,running:l}=k();return(0,R.jsx)(t,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(S,{component:`form`,onSubmit:i,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(o,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:r,"aria-label":`Message Fanout`,value:e,onChange:e=>n(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!c,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(j,{label:`Stop`,children:(0,R.jsx)(O,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,R.jsx)(pe,{size:16,weight:`fill`})})}):(0,R.jsx)(O,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!c,"aria-label":`Send message`,children:(0,R.jsx)(fe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function je({onSelect:e}){return(0,R.jsxs)(l,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(_,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(o,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:De.map(t=>(0,R.jsx)(u,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Me({message:e,time:n,appView:r,provisional:i=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(v,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?r?(0,R.jsx)(Ee,{view:r}):(0,R.jsx)(v,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let s=e.role===`user`,c=n?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(n)):``;return(0,R.jsxs)(t,{className:`chat-message${i?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":s?`user`:`assistant`,children:[s?(0,R.jsx)(S,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${i?` chat-markdown--provisional`:``}`,"data-provisional":i||void 0,children:(0,R.jsx)(ne,{remarkPlugins:[F],components:Pe,children:a})}),(i||c||!s)&&(0,R.jsx)(o,{className:`chat-message-meta`,gap:6,justify:s?`flex-end`:`flex-start`,mt:4,h:24,children:i?(0,R.jsx)(C,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[c&&n&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:I(n),children:c}),!s&&(0,R.jsx)(Ne,{text:a,label:`Copy message`})]})})]})}function Ne({text:e,label:t}){let{state:n,copy:r}=ye();return(0,R.jsx)(j,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(O,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(y,{size:13})})})}var Pe={table:({children:e})=>(0,R.jsx)(t,{className:`chat-table`,children:(0,R.jsx)(P,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(P.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(P.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(P.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(P.Th,{children:e}),td:({children:e})=>(0,R.jsx)(P.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Fe,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Fe({children:e}){let n=$(e);return(0,R.jsxs)(t,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(t,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Ne,{text:n,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,Oe as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-B2BwBfS8.js b/internal/ui/dist/assets/chat._threadId-B2BwBfS8.js new file mode 100644 index 000000000..285eaf4d1 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-B2BwBfS8.js @@ -0,0 +1 @@ +import{t as e}from"./chat-Dr6SwXRM.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-B9WlrQOu.js b/internal/ui/dist/assets/chat._threadId-B9WlrQOu.js deleted file mode 100644 index 2ebe0c4f0..000000000 --- a/internal/ui/dist/assets/chat._threadId-B9WlrQOu.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-DjuGjU0o.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-B2BwBfS8.js b/internal/ui/dist/assets/chat.index-B2BwBfS8.js new file mode 100644 index 000000000..285eaf4d1 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-B2BwBfS8.js @@ -0,0 +1 @@ +import{t as e}from"./chat-Dr6SwXRM.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-B9WlrQOu.js b/internal/ui/dist/assets/chat.index-B9WlrQOu.js deleted file mode 100644 index 2ebe0c4f0..000000000 --- a/internal/ui/dist/assets/chat.index-B9WlrQOu.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-DjuGjU0o.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-xbi0ey_r.js b/internal/ui/dist/assets/dashboards._dashboardId-eTWiXAiz.js similarity index 62% rename from internal/ui/dist/assets/dashboards._dashboardId-xbi0ey_r.js rename to internal/ui/dist/assets/dashboards._dashboardId-eTWiXAiz.js index 95a320ee2..57e44f3e5 100644 --- a/internal/ui/dist/assets/dashboards._dashboardId-xbi0ey_r.js +++ b/internal/ui/dist/assets/dashboards._dashboardId-eTWiXAiz.js @@ -1 +1 @@ -import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-CQerCjF_.js";import{_ as n,b as r}from"./theme-C7oNnx5z.js";import{t as i}from"./page-zI1f8QoW.js";import{t as a}from"./index-Nz8e3wJG.js";var o=e();function s(){let{dashboardId:e}=a.useParams(),s=n(a.useSearch()),c=t(),l=(t,n,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file +import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-CQerCjF_.js";import{_ as n,b as r}from"./theme-BKAYKhPv.js";import{t as i}from"./page-DclWQ-lK.js";import{t as a}from"./index-G9N3n5OB.js";var o=e();function s(){let{dashboardId:e}=a.useParams(),s=n(a.useSearch()),c=t(),l=(t,n,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-CdkT7wKS.js b/internal/ui/dist/assets/dashboards.index-BtnZ9Vkj.js similarity index 55% rename from internal/ui/dist/assets/dashboards.index-CdkT7wKS.js rename to internal/ui/dist/assets/dashboards.index-BtnZ9Vkj.js index b2e819e19..099367a25 100644 --- a/internal/ui/dist/assets/dashboards.index-CdkT7wKS.js +++ b/internal/ui/dist/assets/dashboards.index-BtnZ9Vkj.js @@ -1 +1 @@ -import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-CQerCjF_.js";import{_ as n,b as r}from"./theme-C7oNnx5z.js";import{t as i}from"./page-zI1f8QoW.js";import{n as a}from"./index-Nz8e3wJG.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file +import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-CQerCjF_.js";import{_ as n,b as r}from"./theme-BKAYKhPv.js";import{t as i}from"./page-DclWQ-lK.js";import{n as a}from"./index-G9N3n5OB.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-Nz8e3wJG.js b/internal/ui/dist/assets/index-G9N3n5OB.js similarity index 97% rename from internal/ui/dist/assets/index-Nz8e3wJG.js rename to internal/ui/dist/assets/index-G9N3n5OB.js index 362e64d6c..89ec8c11d 100644 --- a/internal/ui/dist/assets/index-Nz8e3wJG.js +++ b/internal/ui/dist/assets/index-G9N3n5OB.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CmpBxgdE.js","assets/brand-oskFJPNW.js","assets/auth-CQerCjF_.js","assets/settings-WD83lfky.js","assets/Tooltip-2jTVpG2Y.js","assets/get-single-element-child-D7qmWU2f.js","assets/useQuery-BynlWFEG.js","assets/FocusTrap-yVpiEwpv.js","assets/WarningCircle.es-CsY2RrOb.js","assets/chat.index-B9WlrQOu.js","assets/chat-DjuGjU0o.js","assets/preload-helper-DOsq4iEA.js","assets/dashboard-change-chips-8yAFuODi.js","assets/chat._threadId-B9WlrQOu.js","assets/dashboards.index-CdkT7wKS.js","assets/theme-C7oNnx5z.js","assets/use-computed-color-scheme-Bb1nqm0Z.js","assets/page-zI1f8QoW.js","assets/dashboards._dashboardId-xbi0ey_r.js"])))=>i.map(i=>d[i]); -import{A as e,B as t,C as n,Ct as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,P as p,R as m,S as h,St as g,T as _,V as v,W as y,X as b,Y as ee,_ as x,_t as te,a as S,bt as ne,c as re,d as ie,f as ae,ft as oe,gt as se,ht as ce,it as le,k as ue,lt as de,mt as fe,p as pe,pt as me,rt as he,st as ge,t as _e,tt as ve,u as ye,ut as be,vt as xe,w as Se,xt as Ce,y as we,yt as Te}from"./brand-oskFJPNW.js";import{a as Ee,d as C,i as w,n as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./auth-CQerCjF_.js";import{A as Ne,B as Pe,D as Fe,E as Ie,F as Le,L as Re,M as ze,N as Be,O as Ve,P as He,R as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,g as Ye,i as Xe,j as Ze,k as Qe,m as $e,n as et,p as tt,r as nt,s as rt,t as it,u as at,v as ot,w as st,x as ct,y as lt,z as ut}from"./preload-helper-DOsq4iEA.js";import{A as dt,B as ft,E as pt,H as mt,Q as ht,S as gt,T as _t,U as vt,V as yt,W as bt,X as xt,Y as St,Z as Ct,_ as wt,a as Tt,at as Et,b as Dt,ct as Ot,dt as kt,et as At,it as jt,lt as Mt,n as Nt,nt as Pt,ot as Ft,rt as It,st as Lt,t as Rt,tt as zt,ut as Bt,x as Vt,z as Ht}from"./theme-C7oNnx5z.js";import{E as Ut,T as Wt,o as Gt,t as Kt}from"./Tooltip-2jTVpG2Y.js";import{n as qt,t as Jt}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{C as Yt,E as Xt,F as Zt,L as Qt,T as $t,_ as en,a as tn,b as nn,c as rn,d as an,f as on,g as sn,h as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-BynlWFEG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xn=Ce((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ae());else{var t=n(l);t!==null&&ce(ee,t.startTime-e)}}}var x=!1,te=-1,S=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():x=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ce(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=Ce(((e,t)=>{t.exports=xn()})),Cn=Ce((e=>{var t=Sn(),n=ne(),r=Te();function i(e){var t=`https://react.dev/errors/`+e;if(1ke||(e.current=Oe[ke],Oe[ke]=null,ke--)}function Me(e,t){ke++,Oe[ke]=e.current,e.current=t}var Ne=Ae(null),Pe=Ae(null),Fe=Ae(null),Ie=Ae(null);function Le(e,t){switch(Me(Fe,t),Me(Pe,e),Me(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wp(t),e=Tp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}je(Ne),Me(Ne,e)}function Re(){je(Ne),je(Pe),je(Fe)}function ze(e){var t=e.memoizedState;t!==null&&(xh._currentValue=t.memoizedState,Me(Ie,e)),t=Ne.current;var n=Tp(t,e.type);t!==n&&(Me(Pe,e),Me(Ne,n))}function Be(e){Pe.current===e&&(je(Ne),je(Pe)),Ie.current===e&&(je(Ie),xh._currentValue=De)}var Ve,He;function Ue(e){if(Ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||``,He=-1i.map(i=>d[i]); +import{A as e,B as t,C as n,Ct as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,P as p,R as m,S as h,St as g,T as _,V as v,W as y,X as b,Y as ee,_ as x,_t as te,a as S,bt as ne,c as re,d as ie,f as ae,ft as oe,gt as se,ht as ce,it as le,k as ue,lt as de,mt as fe,p as pe,pt as me,rt as he,st as ge,t as _e,tt as ve,u as ye,ut as be,vt as xe,w as Se,xt as Ce,y as we,yt as Te}from"./brand-oskFJPNW.js";import{a as Ee,d as C,i as w,n as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./auth-CQerCjF_.js";import{A as Ne,B as Pe,D as Fe,E as Ie,F as Le,L as Re,M as ze,N as Be,O as Ve,P as He,R as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,g as Ye,i as Xe,j as Ze,k as Qe,m as $e,n as et,p as tt,r as nt,s as rt,t as it,u as at,v as ot,w as st,x as ct,y as lt,z as ut}from"./preload-helper-DOsq4iEA.js";import{A as dt,B as ft,E as pt,H as mt,Q as ht,S as gt,T as _t,U as vt,V as yt,W as bt,X as xt,Y as St,Z as Ct,_ as wt,a as Tt,at as Et,b as Dt,ct as Ot,dt as kt,et as At,it as jt,lt as Mt,n as Nt,nt as Pt,ot as Ft,rt as It,st as Lt,t as Rt,tt as zt,ut as Bt,x as Vt,z as Ht}from"./theme-BKAYKhPv.js";import{E as Ut,T as Wt,o as Gt,t as Kt}from"./Tooltip-2jTVpG2Y.js";import{n as qt,t as Jt}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{C as Yt,E as Xt,F as Zt,L as Qt,T as $t,_ as en,a as tn,b as nn,c as rn,d as an,f as on,g as sn,h as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-BynlWFEG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xn=Ce((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ae());else{var t=n(l);t!==null&&ce(ee,t.startTime-e)}}}var x=!1,te=-1,S=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():x=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ce(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=Ce(((e,t)=>{t.exports=xn()})),Cn=Ce((e=>{var t=Sn(),n=ne(),r=Te();function i(e){var t=`https://react.dev/errors/`+e;if(1ke||(e.current=Oe[ke],Oe[ke]=null,ke--)}function Me(e,t){ke++,Oe[ke]=e.current,e.current=t}var Ne=Ae(null),Pe=Ae(null),Fe=Ae(null),Ie=Ae(null);function Le(e,t){switch(Me(Fe,t),Me(Pe,e),Me(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wp(t),e=Tp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}je(Ne),Me(Ne,e)}function Re(){je(Ne),je(Pe),je(Fe)}function ze(e){var t=e.memoizedState;t!==null&&(xh._currentValue=t.memoizedState,Me(Ie,e)),t=Ne.current;var n=Tp(t,e.type);t!==n&&(Me(Pe,e),Me(Ne,n))}function Be(e){Pe.current===e&&(je(Ne),je(Pe)),Ie.current===e&&(je(Ie),xh._currentValue=De)}var Ve,He;function Ue(e){if(Ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||``,He=-1)`:-1s(e,t,n)},i,a=_C,o=!oC.jitless,s=o&&vC.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?sw(e,u,t,f):ow(e,u,t))):i?sw(r,u,t,f):ow(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>ow(t,u,e))):ow(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function lw(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>PC(e,r,sC())))}),t}var uw=Q(`$ZodUnion`,(e,t)=>{tw.init(e,t),pC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),pC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),pC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),pC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>fC(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>lw(t,n,e,r)):lw(a,n,e,r)}}),dw=Q(`$ZodIntersection`,(e,t)=>{tw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>pw(e,t,n)):pw(e,i,a)}});function fw(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(yC(e)&&yC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=fw(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{tw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!yC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...MC(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...MC(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>PC(e,r,sC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...MC(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...MC(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),hw=Q(`$ZodEnum`,(e,t)=>{tw.init(e,t);let n=cC(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>bC.has(typeof e)).map(e=>typeof e==`string`?xC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),gw=Q(`$ZodLiteral`,(e,t)=>{tw.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?xC(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),_w=Q(`$ZodTransform`,(e,t)=>{tw.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new aC;return e.value=r,e}}),vw=Q(`$ZodOptional`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,pC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${fC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),yw=Q(`$ZodNullable`,(e,t)=>{tw.init(e,t),pC(e._zod,`optin`,()=>t.innerType._zod.optin),pC(e._zod,`optout`,()=>t.innerType._zod.optout),pC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${fC(e.source)}|null)$`):void 0}),pC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),bw=Q(`$ZodDefault`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,pC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xw(e,t)):xw(r,t)}});function xw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Sw=Q(`$ZodPrefault`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,pC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Cw=Q(`$ZodNonOptional`,(e,t)=>{tw.init(e,t),pC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ww(t,e)):ww(i,e)}});function ww(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Tw=Q(`$ZodCatch`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,pC(e._zod,`optout`,()=>t.innerType._zod.optout),pC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>PC(e,n,sC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>PC(e,n,sC()))},input:e.value}),e.issues=[]),e)}}),Ew=Q(`$ZodPipe`,(e,t)=>{tw.init(e,t),pC(e._zod,`values`,()=>t.in._zod.values),pC(e._zod,`optin`,()=>t.in._zod.optin),pC(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Dw(e,t,n)):Dw(r,t,n)}});function Dw(e,t,n){return jC(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var Ow=Q(`$ZodReadonly`,(e,t)=>{tw.init(e,t),pC(e._zod,`propValues`,()=>t.innerType._zod.propValues),pC(e._zod,`values`,()=>t.innerType._zod.values),pC(e._zod,`optin`,()=>t.innerType._zod.optin),pC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(kw):kw(r)}});function kw(e){return e.value=Object.freeze(e.value),e}var Aw=Q(`$ZodLazy`,(e,t)=>{tw.init(e,t),pC(e._zod,`innerType`,()=>t.getter()),pC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),pC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),pC(e._zod,`optin`,()=>e._zod.innerType._zod.optin),pC(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),jw=Q(`$ZodCustom`,(e,t)=>{JC.init(e,t),tw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Mw(t,n,r,e));Mw(i,n,r,e)}});function Mw(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(IC(e))}}var Nw=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Pw(){return new Nw}var Fw=Pw();function Iw(e){return new e({type:`unknown`})}function Lw(e,t){return new e({type:`never`,...CC(t)})}function Rw(e,t){return new YC({check:`max_length`,...CC(t),maximum:e})}function zw(e,t){return new XC({check:`min_length`,...CC(t),minimum:e})}function Bw(e,t){return new ZC({check:`length_equals`,...CC(t),length:e})}function Vw(e){return new QC({check:`overwrite`,tx:e})}function Hw(e,t,n){return new e({type:`array`,element:t,...CC(n)})}function Uw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...CC(n)})}var Ww=(e,t)=>{RC.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>VC(e,t)},flatten:{value:t=>BC(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};Q(`ZodError`,Ww);var Gw=Q(`ZodError`,Ww,{Parent:Error}),Kw=HC(Gw),qw=UC(Gw),Jw=WC(Gw),Yw=KC(Gw),Xw=Q(`ZodType`,(e,t)=>(tw.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>SC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Kw(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Jw(e,t,n),e.parseAsync=async(t,n)=>qw(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Yw(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(NT(t,n)),e.superRefine=t=>e.check(PT(t)),e.overwrite=t=>e.check(Vw(t)),e.optional=()=>hT(e),e.nullable=()=>_T(e),e.nullish=()=>hT(_T(e)),e.nonoptional=t=>CT(e,t),e.array=()=>nT(e),e.or=t=>aT([e,t]),e.and=t=>sT(e,t),e.transform=t=>DT(e,pT(t)),e.default=t=>yT(e,t),e.prefault=t=>xT(e,t),e.catch=t=>TT(e,t),e.pipe=t=>DT(e,t),e.readonly=()=>kT(e),e.describe=t=>{let n=e.clone();return Fw.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return Fw.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Fw.get(e);let n=e.clone();return Fw.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zw=Q(`ZodUnknown`,(e,t)=>{nw.init(e,t),Xw.init(e,t)});function Qw(){return Iw(Zw)}var $w=Q(`ZodNever`,(e,t)=>{rw.init(e,t),Xw.init(e,t)});function eT(e){return Lw($w,e)}var tT=Q(`ZodArray`,(e,t)=>{aw.init(e,t),Xw.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(zw(t,n)),e.nonempty=t=>e.check(zw(1,t)),e.max=(t,n)=>e.check(Rw(t,n)),e.length=(t,n)=>e.check(Bw(t,n)),e.unwrap=()=>e.element});function nT(e,t){return Hw(tT,e,t)}var rT=Q(`ZodObject`,(e,t)=>{cw.init(e,t),Xw.init(e,t),pC(e,`shape`,()=>t.shape),e.keyof=()=>uT(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qw()}),e.strict=()=>e.clone({...e._zod.def,catchall:eT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>DC(e,t),e.merge=t=>OC(e,t),e.pick=t=>TC(e,t),e.omit=t=>EC(e,t),e.partial=(...t)=>kC(mT,e,t[0]),e.required=(...t)=>AC(ST,e,t[0])}),iT=Q(`ZodUnion`,(e,t)=>{uw.init(e,t),Xw.init(e,t),e.options=t.options});function aT(e,t){return new iT({type:`union`,options:e,...CC(t)})}var oT=Q(`ZodIntersection`,(e,t)=>{dw.init(e,t),Xw.init(e,t)});function sT(e,t){return new oT({type:`intersection`,left:e,right:t})}var cT=Q(`ZodRecord`,(e,t)=>{mw.init(e,t),Xw.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),lT=Q(`ZodEnum`,(e,t)=>{hw.init(e,t),Xw.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new lT({...t,checks:[],...CC(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new lT({...t,checks:[],...CC(r),entries:i})}});function uT(e,t){return new lT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...CC(t)})}var dT=Q(`ZodLiteral`,(e,t)=>{gw.init(e,t),Xw.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),fT=Q(`ZodTransform`,(e,t)=>{_w.init(e,t),Xw.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(IC(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(IC(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function pT(e){return new fT({type:`transform`,transform:e})}var mT=Q(`ZodOptional`,(e,t)=>{vw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hT(e){return new mT({type:`optional`,innerType:e})}var gT=Q(`ZodNullable`,(e,t)=>{yw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _T(e){return new gT({type:`nullable`,innerType:e})}var vT=Q(`ZodDefault`,(e,t)=>{bw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yT(e,t){return new vT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var bT=Q(`ZodPrefault`,(e,t)=>{Sw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xT(e,t){return new bT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var ST=Q(`ZodNonOptional`,(e,t)=>{Cw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function CT(e,t){return new ST({type:`nonoptional`,innerType:e,...CC(t)})}var wT=Q(`ZodCatch`,(e,t)=>{Tw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function TT(e,t){return new wT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var ET=Q(`ZodPipe`,(e,t)=>{Ew.init(e,t),Xw.init(e,t),e.in=t.in,e.out=t.out});function DT(e,t){return new ET({type:`pipe`,in:e,out:t})}var OT=Q(`ZodReadonly`,(e,t)=>{Ow.init(e,t),Xw.init(e,t)});function kT(e){return new OT({type:`readonly`,innerType:e})}var AT=Q(`ZodLazy`,(e,t)=>{Aw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.getter()}),jT=Q(`ZodCustom`,(e,t)=>{jw.init(e,t),Xw.init(e,t)});function MT(e){let t=new JC({check:`custom`});return t._zod.check=e,t}function NT(e,t={}){return Uw(jT,e,t)}function PT(e){let t=MT(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(IC(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(IC(r))}},e(n.value,n)));return t}var FT=`@ag-ui/client`;function IT(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,FT))return;let t=e.metadata?.[FT];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var $=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function LT(){return vo()}function RT(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function zT(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&zT(t);return e}var BT=524288;function VT(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function HT(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!VT(t,n,BT),c=s?$(t):t,l=s?$(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(zT(c),zT(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=$(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=$(e.state),d=!0,n=!0),s&&n&&VT(c,l,BT)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&RT(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?$(c):c}:{},...d?{state:Object.isFrozen(l)?$(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function UT(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function WT(e){if(e instanceof GT)return e;if(e===!0)return new GT(UT(!0))}var GT=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function KT(e){return e.enabled?new GT(e):void 0}function qT(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function JT(e,t){return!e||t.metadata===void 0?!1:(e.metadata=wo(e.metadata,$(t.metadata)),!0)}var YT=(e,t,n,r,i)=>{let a=WT(i),o=$(n.messages),s=$(e.state),c={},l=[],u=new Set,d=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:l.filter(e=>!u.has(e))},f=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},p=()=>{let e=$(c);return c={},e.messages!==void 0||e.state!==void 0?Vc(e):cc};return t.pipe(Zc(async t=>{let i=await HT(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(f(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return p();switch(t.type){case O.TEXT_MESSAGE_START:{let i=await HT(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),p();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=JT(s,t);(!a||c)&&f({messages:o})}return p()}case O.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let l=await HT(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,JT(c,t),f({messages:o})),p()}case O.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let c=await HT(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&JT(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case O.TOOL_CALL_START:{let i=await HT(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;l.includes(e)||l.push(e);let a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(JT(a,t)||r)&&f({messages:o}),p()}let s=new Set(o.map(e=>e.id)),c=qT(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let u={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(u),JT(u,t),f({messages:o})}return p()}case O.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),p();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),p();let u=await HT(r,o,s,(r,i,a)=>{let o=l.function.arguments,s=l.function.name,c={};try{c=il(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return f(u),u.stopPropagation!==!0&&(l.function.arguments+=a,JT(l,t),f({messages:o})),p()}case O.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),p();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),p();let l=await HT(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return f(l),l.stopPropagation!==!0&&JT(c,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),p()}case O.TOOL_CALL_RESULT:{let i=await HT(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:d}=t;u.add(a);let p={id:i,toolCallId:a,role:l||`tool`,content:c,...d!=null&&{subagentRunId:d}};JT(p,t);let m=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(m===-1)o.push(p);else{let e=m+1;for(;e{t.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})})),f({messages:o})}return p()}case O.STATE_SNAPSHOT:{let i=await HT(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,f({state:s})}return p()}case O.STATE_DELTA:{let i=await HT(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=ss.applyPatch(s,e,!0,!1).newDocument,f({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return p()}case O.MESSAGES_SNAPSHOT:{let i=await HT(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=IT(t),a=n.some(e=>e.role===`activity`),s=n.some(e=>e.role===`reasoning`),c=e=>e.role===`activity`&&(i?!i.includes(e.activityType):i!==null&&!a)||e.role===`reasoning`&&!s;o=o.filter(e=>r.has(e.id)||c(e)).map(e=>r.get(e.id)??e);let l=new Set(o.map(e=>e.id));for(let e of n)l.has(e.id)||o.push(e);f({messages:o})}return p()}case O.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await HT(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(f(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:$(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:$(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),JT(d,i),f({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return p()}case O.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return p();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),p();let l=c,u=await HT(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(f(u),u.stopPropagation!==!0)try{JT(l,i)&&f({messages:o});let e=$(l.content??{}),t=ss.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:$(t),activityType:i.activityType},f({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return p()}case O.RAW:return f(await HT(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.CUSTOM:return f(await HT(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.RUN_STARTED:{let i=await HT(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),l=[],u=new Set,i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}f({messages:o})}}return p()}case O.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:d(i)},c=await HT(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return f(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),p()}case O.RUN_ERROR:return f(await HT(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.STEP_STARTED:return f(await HT(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.STEP_FINISHED:return f(await HT(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case O.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case O.REASONING_START:return f(await HT(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.REASONING_MESSAGE_START:{let i=await HT(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=JT(i,t);(!r||a)&&f({messages:o})}return p()}case O.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let l=await HT(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,JT(c,t),f({messages:o})),p()}case O.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let c=await HT(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&JT(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case O.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case O.REASONING_END:return f(await HT(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await HT(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(u),u.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return p()}case O.SUBAGENT_STARTED:return f(await HT(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.SUBAGENT_FINISHED:return f(await HT(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.SUBAGENT_ERROR:return f(await HT(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p()}return t.type,p()}),qc(),r.length>0?Qc({}):e=>e)},XT=e=>t=>{let n=WT(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=()=>{r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!0},v=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new k(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!s.toolCall.has(n.id))&&s.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},y=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new k(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(Kc(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==O.RUN_STARTED)return M(()=>new k(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==O.RUN_ERROR&&t!==O.RUN_STARTED)return M(()=>new k(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==O.RUN_STARTED&&t!==O.RUN_ERROR)return M(()=>new k(`First event must be 'RUN_STARTED'`))}else if(t===O.RUN_STARTED){if(g&&!c&&!l)return M(()=>new k(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&_()}if(e.subagentRunId===null)return M(()=>new k(`Cannot send '${t}' with 'subagentRunId: null'. The field is optional — omit it entirely.`));if(t===O.SUBAGENT_STARTED||t===O.SUBAGENT_FINISHED||t===O.SUBAGENT_ERROR){let n=t===O.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===O.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return M(()=>new k(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return M(()=>new k(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return M(()=>new k(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return M(()=>new k(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===O.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return M(()=>new k(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case O.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return M(()=>new k(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=s.message.get(n);if(i){let r=y(t,e.subagentRunId,i,`message`,n);if(r)return M(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),Vc(e)}case O.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return M(()=>new k(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=y(t,e.subagentRunId,s.message.get(n),`message`,n);return i?M(()=>i):Vc(e)}case O.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return M(()=>new k(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=y(t,e.subagentRunId,s.message.get(n),`message`,n);return i?M(()=>i):(r.delete(n),Vc(e))}case O.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return M(()=>new k(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return M(()=>new k(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));o=e}}let c=s.toolCall.get(n);if(c){let e=y(t,a,c,`tool call`,n);if(e)return M(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return M(()=>new k(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),Vc(e)}case O.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return M(()=>new k(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=y(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?M(()=>r):Vc(e)}case O.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return M(()=>new k(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=y(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?M(()=>r):(i.delete(n),Vc(e))}case O.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?M(()=>new k(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),Vc(e))}case O.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return M(r?()=>new k(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new k(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),Vc(e)}case O.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),Vc(e)}case O.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),Vc(e)}case O.REASONING_START:case O.REASONING_MESSAGE_START:{let n=e.messageId,r=t===O.REASONING_START,i=r?a:o;if(i.has(n))return M(()=>new k(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=y(t,e.subagentRunId,c,`reasoning message`,n);if(r)return M(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),Vc(e)}case O.REASONING_MESSAGE_CONTENT:case O.REASONING_MESSAGE_END:case O.REASONING_END:{let n=e.messageId,r=t===O.REASONING_END,i=r?a:o;if(!i.has(n))return M(()=>new k(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=y(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?M(()=>c):((t===O.REASONING_END||t===O.REASONING_MESSAGE_END)&&i.delete(n),Vc(e))}case O.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=y(t,e.subagentRunId,i,a,n);return o?M(()=>o):Vc(e)}case O.ACTIVITY_DELTA:{let n=e.messageId,r=y(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?M(()=>r):Vc(e)}case O.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return M(()=>new k(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return M(()=>new k(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?M(()=>new k(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?M(()=>new k(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?M(()=>new k(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),Vc(e))}case O.SUBAGENT_FINISHED:case O.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return M(()=>new k(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===O.SUBAGENT_ERROR&&typeof e.message!=`string`)return M(()=>new k(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),Vc(e)):M(()=>new k(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case O.MESSAGES_SNAPSHOT:{let t=v(e.messages,!0);if(t)return M(()=>t)}return Vc(e);case O.RUN_STARTED:g=!0;{let t=v((e.input??{}).messages,!1);if(t)return M(()=>t)}return Vc(e);case O.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,Vc(e);case O.RUN_ERROR:return l=!0,Vc(e);case O.CUSTOM:return Vc(e);default:return Vc(e)}}))},ZT=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),QT=e=>Jc(()=>Bc(e())).pipe(el(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Bc(e.text()).pipe(Kc(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,M(()=>i)}))}let t={type:ZT.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Ys(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:ZT.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):M(()=>Error(`Failed to getReader() from response`))})),$T=10485760,eE=(e,t)=>{let n=WT(t),r=new ic,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==ZT.HEADERS&&e.type===ZT.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e);if(a.length>$T){r.error(Error(`SSE buffer size exceeded maximum limit of ${$T/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` `),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` `),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},tE=10485760,nE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,rE=(e,t)=>{let n=WT(t),r=new ic,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==ZT.HEADERS&&e.type===ZT.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>tE){r.error(Error(`Protobuf message size exceeded maximum limit of ${tE/1048576} MB`));return}if(i.length{let n=WT(t),r=new ic,i=new sc(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===ZT.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?rE(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):eE(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:O.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},aE={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},oE=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)};function sE(e,t){return Eo(t)&&cE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),To(t)}var cE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},lE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Kc(r=>{switch(r.type){case O.TEXT_MESSAGE_START:{let e=r;return[{type:aE.TextMessageStart,messageId:e.messageId,role:e.role}]}case O.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:aE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case O.TEXT_MESSAGE_END:{let e=r;return[{type:aE.TextMessageEnd,messageId:e.messageId}]}case O.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:aE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case O.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return cE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(il(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:aE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case O.TOOL_CALL_END:{let e=r;return[{type:aE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case O.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&cE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:aE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:sE(e.toolCallId,e.content),actionName:t||`unknown`}]}case O.RAW:return f||(f=!0,cE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case O.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:aE.MetaEvent,name:e.name,value:e.value}]}case O.STATE_SNAPSHOT:return p(r.snapshot),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case O.STATE_DELTA:{let c=r,l;try{l=ss.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return cE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case O.MESSAGES_SNAPSHOT:return c=r.messages,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case O.RUN_STARTED:return[];case O.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=uE(c)}catch(e){return[{type:aE.RunError,message:e.message}]}return[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case O.RUN_ERROR:{let e=r;return[{type:aE.RunError,message:e.message,code:e.code}]}case O.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case O.STEP_FINISHED:return u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function uE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=oE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:sE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var dE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,fE=e=>e===`tool`?`toolCallId`:`messageId`,pE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},mE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},hE=(e,t)=>{let n=mE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},gE=e=>new Set(Object.keys(e.shape)),_E=gE(Nv),vE=gE(Lv),yE=gE(by),bE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},xE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},SE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&xE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},CE=e=>t=>{let n=WT(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:O.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:O.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:O.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&dE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${fE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Kc(e=>{switch(e.type){case O.TEXT_MESSAGE_START:case O.TEXT_MESSAGE_CONTENT:case O.TEXT_MESSAGE_END:case O.TOOL_CALL_START:case O.TOOL_CALL_ARGS:case O.TOOL_CALL_END:case O.TOOL_CALL_RESULT:case O.STATE_SNAPSHOT:case O.STATE_DELTA:case O.CUSTOM:case O.STEP_STARTED:case O.STEP_FINISHED:case O.REASONING_START:case O.REASONING_MESSAGE_START:case O.REASONING_MESSAGE_CONTENT:case O.REASONING_MESSAGE_END:case O.REASONING_END:return[...i(e.subagentRunId??void 0),e];case O.RUN_STARTED:case O.RUN_FINISHED:case O.RUN_ERROR:case O.MESSAGES_SNAPSHOT:return[...a(),e];case O.RAW:case O.ACTIVITY_SNAPSHOT:case O.ACTIVITY_DELTA:case O.REASONING_ENCRYPTED_VALUE:case O.SUBAGENT_STARTED:return[e];case O.SUBAGENT_FINISHED:case O.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case O.TEXT_MESSAGE_CHUNK:{let t=e,a=bE(e,_E),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))pE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),pE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=mE({type:O.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case O.TOOL_CALL_CHUNK:{let t=e,a=bE(e,vE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))pE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),pE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=mE({type:O.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TOOL_CALL_CHUNK`),l}case O.REASONING_MESSAGE_CHUNK:{let t=e,a=bE(e,yE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=mE({type:O.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),$c(()=>{a()}))},wE=Symbol(`agui.strip.drop`);function TE(e){let t=e;for(;;){if(t instanceof mT||t instanceof gT||t instanceof vT||t instanceof OT||t instanceof wT){t=t.unwrap();continue}if(t instanceof ET){t=t.def.in;continue}if(t instanceof AT){t=t.def.getter();continue}return t}}function EE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function DE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function OE(e){let t=TE(e);return t instanceof dT?DE(t):void 0}function kE(e,t,n,r){let i=TE(t);if(i instanceof rT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=kE(a[e],i,`${n}/${e}`,r);if(l===wE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return wE}o[e]=l}return o}if(i instanceof tT){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=kE(e,t,`${n}/${i}`,r);if(s===wE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof cT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=kE(a[e],t,`${n}/${e}`,r);if(s===wE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof iT){let t=i.options,a=EE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=TE(o);if(!(t instanceof rT))continue;let s=t.shape;if(OE(s[a])===i)return kE(e,o,n,r)}return wE}let o=t.filter(e=>TE(e)instanceof rT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=TE(i);if(t instanceof tT&&Array.isArray(e)||t instanceof rT&&s)return kE(e,i,n,r)}return e}return e}function AE(e,t){let n=[],r=kE(e,t,``,n);if(r===wE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var jE=new Set(Object.values(O));function ME(e){return jE.has(e.type)}var NE=new Map(Ey.options.map(e=>{let t=e.shape;return[String(DE(t.type)),e]})),PE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function FE(e){PE()||console.warn(`[ag-ui][enforce] ${e}`)}var IE=e=>t=>{let n=WT(e);return t.pipe(Kc(e=>{if(!ME(e))return FE(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),cc;let t=NE.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=AE(e,t);for(let t of i)FE(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return Vc(t.parse(r))}))};function LE(e){let{value:t,stripped:n}=AE(So(e,`RunAgentInput`),oy);for(let e of n)FE(`Removed unrecognised material at '${e}' from the outgoing input.`);return oy.parse(t)}var RE=class{runNext(e,t){return t.run(e).pipe(CE(!1))}runNextWithState(e,t){let n=$(e.messages||[]),r=$(e.state===void 0?{}:e.state),i=new sc;return YT(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(Zc(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:$(n),state:$(r)})))}},zE=class extends RE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function UE(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function WE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(VE(e)){let n=HE(e);return n.type!==`binary`&&t.some(t=>UE(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var GE=`THINKING_START`,KE=`THINKING_END`,qE=`THINKING_TEXT_MESSAGE_START`,JE=`THINKING_TEXT_MESSAGE_CONTENT`,YE=`THINKING_TEXT_MESSAGE_END`;function XE(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}function ZE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function QE(e,t,n){if(!ZE(e)||e[t]!==null)return e;XE(`${n}.${t}: null`,`an absent field`);let{[t]:r,...i}=e;return i}function $E(e,t,n){if(!ZE(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function eD(e){return $E(e,`content`,e=>{if(!ZE(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return QE(e,`metadata`,`${e.type} input content`);default:return e}})}function tD(e){let t=QE(e,`forwardedProps`,`RunAgentInput`);return t=$E(t,`tools`,e=>QE(e,`parameters`,`Tool`)),t=$E(t,`resume`,e=>QE(e,`payload`,`ResumeEntry`)),$E(t,`messages`,eD)}var nD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warn(e,t){XE(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=LT();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,e.messages=e.messages.map(WE),t.run(e).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){if(e.rawEvent===null){this.warn(`${e.type}.rawEvent: null`,`an absent field`);let{rawEvent:t,...n}=e;e=n}if((e.type===O.RUN_FINISHED||e.type===O.SUBAGENT_FINISHED)&&e.result===null){this.warn(`${e.type}.result: null`,`an absent field`);let{result:t,...n}=e;e=n}switch(e.type){case GE:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warn(GE,O.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${GE}.title ${JSON.stringify(t)}: ${O.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case qE:return this.currentMessageId=LT(),this.warn(qE,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case JE:{let{delta:t,...n}=e;return this.warn(JE,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(JE,this.currentMessageId),delta:t}}case YE:{let t=this.mintedContinuationId(YE,this.currentMessageId);return this.currentMessageId=null,this.warn(YE,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case KE:{let t=this.mintedContinuationId(KE,this.currentReasoningId);return this.currentReasoningId=null,this.warn(KE,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}case O.TOOL_CALL_START:case O.TOOL_CALL_CHUNK:{let t=e;if(t.parentMessageId===null){this.warn(`${e.type}.parentMessageId: null`,`an absent field`);let{parentMessageId:n,...r}=t;return r}return e}case O.RUN_FINISHED:{let t=e;if(t.outcome===null){this.warn(`RUN_FINISHED.outcome: null`,`an absent field`);let{outcome:e,...n}=t;return n}return e}case O.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case O.RUN_STARTED:{let t=tD(e.input),n=t===e.input?e:{...e,input:t},r=n;return!r.input||!Array.isArray(r.input.messages)?n:{...r,input:{...r.input,messages:r.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=eD(e);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),WE(e))}},rD=()=>e=>Jc(()=>{let t=new nD;return e.pipe(Wc(e=>t.transformEvent(e)))});function iD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function aD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function oD(e){aD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function sD(e){aD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function cD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return sD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&oD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var lD=class extends RE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(cD)};return this.runNext(i,t)}},uD=`THINKING_START`,dD=`THINKING_END`,fD=`THINKING_TEXT_MESSAGE_START`,pD=`THINKING_TEXT_MESSAGE_CONTENT`,mD=`THINKING_TEXT_MESSAGE_END`,hD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case uD:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warnAboutTransformation(uD,O.REASONING_START),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case fD:return this.currentMessageId=LT(),this.warnAboutTransformation(fD,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case pD:{let{delta:t,...n}=e;return this.warnAboutTransformation(pD,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??LT(),delta:t}}case mD:{let t=this.currentMessageId??LT();return this.warnAboutTransformation(mD,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case dD:{let t=this.currentReasoningId??LT();return this.warnAboutTransformation(dD,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}default:return e}}},gD=`SUBAGENT_STARTED`,_D=`SUBAGENT_FINISHED`,vD=`SUBAGENT_ERROR`;function yD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function bD(e){return e.map(e=>yD(e))}var xD=class extends RE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>yD(e))};return this.runNext(n,t).pipe(nl(e=>{let t=e.type;(t===gD||t===_D||t===vD)&&this.warnDroppedLifecycleEvent(t)}),Yc(e=>{let t=e.type;return t!==gD&&t!==_D&&t!==vD}),Wc(e=>{let t=yD(e);if(t.type===O.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:bD(e.messages)}}if(t.type===O.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>yD(e))}}}if(t.type===O.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:bD(e.input.messages)}}}return t}))}},SD=`1.0.1`,CD=!1,wD=new WeakSet,TD=(e,t)=>/^\d+\.\d+$/.test(e)?rC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,ED=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(TD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},DD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return SD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return SD;let a=t===`maxProtocolVersion`?n:r;if(!a)return SD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!CD&&(CD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=UT(e),this._debugLogger=KT(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?KT(UT(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!iC(e))throw new k(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??vo(),this.messages=$(r??[]),this.state=$(i??{}),this._debug=UT(a),this._debugLogger=KT(this._debug);let o=this.resolvedCeilingDuringConstruction();rC(o,`0.0.39`)<=0&&this.middlewares.unshift(new lD),rC(o,`0.0.45`)<=0&&this.middlewares.unshift(new hD),rC(o,`0.0.57`)<=0&&this.middlewares.unshift(new xD)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new zE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];wD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),$c(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)));let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Co}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>Jc(()=>this.connect(n)),e=>IE(this.debugLogger)(rD()(e)),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.isRunning=!1,e instanceof Co?cc:this.onError(n,e,a))),$c(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)),{defaultValue:void 0});let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return YT(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(nl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||vo(),...rC(this.maxProtocolVersion,SD)>=0&&{protocolVersion:`1.0`},tools:$(e?.tools??[]),context:$(e?.context??[]),forwardedProps:$(e?.forwardedProps??{}),state:$(this.state),messages:n,...e?.resume===void 0?{}:{resume:$(e.resume)}}}async onInitialize(e,t){if(wD.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new k(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(iD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new k(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Bc(HT(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Wc(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=$(this.messages),e.state=$(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=$(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=$(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=$(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??vo();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),lE(this.threadId,t.runId,this.agentId),e=>e.pipe(Wc(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function OD(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var kD=class extends DD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(OD(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=$(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return iE(QT(()=>this.fetch(this.url,this.requestInit(LE(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=$(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},AD=class extends tn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hn(t,n.data),hasPreviousPage:rn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},jD=class extends on{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new mn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=MD(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>sn(t,e))}findAll(e={}){return this.getAll().filter(t=>sn(e,t))}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(e.map(e=>e.continue().catch(vn))))}};function MD(e){return e.options.scope?.id}var ND=class extends on{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cn(r,t),a=this.get(i);return a||(a=new fn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_n.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>en(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>en(e,t)):t}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},PD=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ND,this.#t=e.mutationCache||new jD,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=an.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ln.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _n.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_n.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _n.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=_n.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return _n.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_n.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(vn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(nn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ln.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{bn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{bn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=cn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Yt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function FD(e,t){return dn(e,AD,t)}var ID=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),LD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),RD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),zD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),BD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),VD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),HD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),UD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),WD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:ID}));WD.displayName=`BookOpenIcon`;var GD=WD,KD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:LD}));KD.displayName=`MagnifyingGlassIcon`;var qD=KD,JD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:RD}));JD.displayName=`MoonIcon`;var YD=JD,XD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:zD}));XD.displayName=`PlugsConnectedIcon`;var ZD=XD,QD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:BD}));QD.displayName=`PlusIcon`;var $D=QD,eO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:VD}));eO.displayName=`SignOutIcon`;var tO=eO,nO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:HD}));nO.displayName=`SparkleIcon`;var rO=nO,iO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:UD}));iO.displayName=`SunIcon`;var aO=iO,oO=[`agent-threads`];async function sO(e){let t=await w(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var cO=[];for(let e=0;e<256;++e)cO.push((e+256).toString(16).slice(1));function lO(e,t=0){return(cO[e[t+0]]+cO[e[t+1]]+cO[e[t+2]]+cO[e[t+3]]+`-`+cO[e[t+4]]+cO[e[t+5]]+`-`+cO[e[t+6]]+cO[e[t+7]]+`-`+cO[e[t+8]]+cO[e[t+9]]+`-`+cO[e[t+10]]+cO[e[t+11]]+cO[e[t+12]]+cO[e[t+13]]+cO[e[t+14]]+cO[e[t+15]]).toLowerCase()}var uO=new Uint8Array(16);function dO(){return crypto.getRandomValues(uO)}var fO={};function pO(e,t,n){let r;if(e)r=hO(e.random??e.rng?.()??dO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=dO();mO(fO,e,i),r=hO(i,fO.msecs,fO.seq,t,n)}return t??lO(r)}function mO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=gO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function hO(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=gO(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function gO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function _O(){return pO()}function vO(){let{setColorScheme:e}=qt(),t=Jt(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,T.useState)(!1);return(0,E.jsx)(Kt,{label:`Switch to ${n} theme`,opened:r,children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,E.jsx)(aO,{size:17,weight:`bold`}):(0,E.jsx)(YD,{size:17,weight:`bold`})})})}var yO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function bO(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await w(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function xO({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=$t(),[f,p]=(0,T.useState)(``),[m]=ca(f.trim(),250),[g,_]=(0,T.useState)(null),[v,y]=(0,T.useState)(null),[b,ee]=(0,T.useState)(``),[te,S]=(0,T.useState)(``),[ne,oe]=(0,T.useState)(!1),se=(0,T.useRef)(null);(0,T.useImperativeHandle)(u,()=>({focusSearch:()=>se.current?.focus()}),[]),(0,T.useEffect)(()=>{r&&requestAnimationFrame(()=>se.current?.focus())},[r]);let ce=FD({queryKey:[...oO,m],queryFn:({pageParam:e})=>bO(m,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),le=gn({queryKey:_t,queryFn:dt,refetchInterval:3e4,staleTime:pt}),ue=(0,T.useMemo)(()=>ce.data?.pages.flatMap(e=>e.threads)??[],[ce.data]),de=(0,T.useMemo)(()=>DO(ue),[ue]),fe=gn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>sO(`/api/telemetry/schema?window=1h`),enabled:!!m&&!!l,staleTime:6e4}),me=(0,T.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(fe.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[fe.data,m]),he=(0,T.useMemo)(()=>{let e=le.data??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[le.data,m]);function ge(e){S(``),ee(e.title),_(e)}async function _e(){if(g&&b.trim()){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(g.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:b.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:oO}),_(null)}catch(e){S(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{oe(!1)}}}async function ve(){if(v){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(v.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.threadId;y(null),await d.invalidateQueries({queryKey:oO}),await d.invalidateQueries({queryKey:_t}),o(t)}catch(e){S(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{oe(!1)}}}return(0,E.jsxs)(re,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,E.jsx)(ie,{leftSection:(0,E.jsx)($D,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,E.jsx)(Gt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,E.jsxs)(re,{gap:`lg`,pb:`sm`,children:[e&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Chats`}),ce.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),ce.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!ce.isLoading&&!ce.isError&&ue.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),de.map(e=>(0,E.jsxs)(re,{gap:2,children:[de.length>1&&(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,E.jsx)(CO,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>ge(e),onDelete:()=>{S(``),y(e)}},e.threadId))]},e.label)),ce.hasNextPage&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:ce.isFetchingNextPage,onClick:()=>void ce.fetchNextPage(),children:`See all`})]}),m&&l&&fe.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),m&&l&&(fe.isSuccess||fe.isError)&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Services`}),fe.isError&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),fe.isSuccess&&me.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),me.map(e=>(0,E.jsx)(h,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,E.jsx)(ae,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Dashboards`}),le.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),le.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!le.isLoading&&!le.isError&&m&&he.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),he.map(e=>{let t=e.id===n;return(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(h,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,E.jsxs)(x,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,E.jsx)(tt,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,E.jsx)(h,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,E.jsxs)(ae,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,E.jsx)(rO,{size:14,weight:`fill`}),onClick:c,children:le.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,E.jsx)(Ae,{ref:se,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,E.jsx)(qD,{size:15}),rightSection:(0,E.jsx)(vt,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,E.jsx)(Xt,{opened:g!==null,onClose:()=>!ne&&_(null),title:`Rename chat`,centered:!0,children:(0,E.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_e()},children:(0,E.jsxs)(re,{children:[(0,E.jsx)(Ae,{label:`Name`,value:b,onChange:e=>ee(e.currentTarget.value),maxLength:120,autoFocus:!0}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>_(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{type:`submit`,loading:ne,disabled:!b.trim(),children:`Save`})]})]})})}),(0,E.jsx)(Xt,{opened:v!==null,onClose:()=>!ne&&y(null),title:`Delete chat?`,centered:!0,children:(0,E.jsxs)(re,{children:[(0,E.jsxs)(ae,{size:`sm`,children:[`This permanently removes `,(0,E.jsx)(ae,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>y(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{color:`bad`,loading:ne,onClick:()=>void ve(),children:`Delete`})]})]})})]})}function SO({children:e}){return(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function CO({thread:e,active:t,onSelect:r,onRename:i,onDelete:a}){return(0,E.jsx)(n,{"data-active":t||void 0,className:`rail-row`,children:(0,E.jsxs)(x,{gap:2,wrap:`nowrap`,children:[(0,E.jsx)(h,{onClick:r,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,children:OO(e.updatedAt)})]})}),(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,E.jsx)(yt,{size:18,weight:`bold`})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ft,{size:15}),onClick:i,children:`Rename`}),(0,E.jsx)(mt.Item,{color:`bad`,leftSection:(0,E.jsx)(Ht,{size:15}),onClick:a,children:`Delete`})]})]})]})})}function wO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function TO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var EO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function DO(e){let t=TO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-TO(wO(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return EO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function OO(e){let t=wO(e),n=TO(new Date);return Math.floor((n-TO(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function kO({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=rt(),s=C(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=jt({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(``),_=(0,T.useRef)(null),v=le(`(max-width: 62em)`),y=(0,T.useRef)(v);y.current=v,(0,T.useEffect)(()=>{f.close()},[c]),(0,T.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(Xe),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,E.jsxs)(Xa,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,E.jsx)(Xa.Header,{children:(0,E.jsxs)(x,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,E.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(uo,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,E.jsx)(_e,{size:`small`})]}),(0,E.jsxs)(x,{gap:`xs`,wrap:`nowrap`,children:[(0,E.jsx)(Kt,{label:`Documentation`,children:(0,E.jsx)($e,{component:`a`,href:yO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,E.jsx)(GD,{size:17,weight:`bold`})})}),(0,E.jsx)(vO,{}),(0,E.jsx)(AO,{onError:g})]})]})}),(0,E.jsx)(Xa.Navbar,{p:`sm`,children:(0,E.jsx)(xO,{ref:_,...b})}),(0,E.jsx)(bt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,E.jsx)(_e,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,E.jsx)(xO,{...b,autoFocusSearch:d&&p})}),(0,E.jsxs)(Xa.Main,{children:[h&&(0,E.jsx)(pe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function AO({onError:e}){let t=C(),n=ke(),r=(n.name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,E.jsx)(so,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Label,{children:n.email||`Signed in`}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ZD,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,E.jsx)(mt.Divider,{}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(tO,{size:15}),onClick:()=>void Ee().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function jO(){let{agent_available:e}=De(),t=C(),n=$t(),{threadId:r}=jt({strict:!1}),[i,a]=(0,T.useState)(_O),o=(0,T.useRef)(new Set),s=r??i,[c,l]=(0,T.useState)([]),[u,d]=(0,T.useState)({}),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(!1),[v,y]=(0,T.useState)(``),[b,ee]=(0,T.useState)(null),x=(0,T.useRef)(null),[te,S]=(0,T.useState)(!1),ne=(0,T.useRef)(!1),[re,ie]=(0,T.useState)(``),[ae,oe]=(0,T.useState)(``),[se,ce]=(0,T.useState)(0),le=(0,T.useRef)(null),ue=(0,T.useRef)({}),de=(0,T.useRef)(null),fe=(0,T.useRef)(new Map),pe=(0,T.useMemo)(()=>new kD({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>w(e,t)}),[s]),me=!e||f===s;function he(){fe.current.clear(),y(``),x.current=null,ee(null)}let ge=e=>e.filter(e=>e.role!==`reasoning`);function _e(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function ve(e){return ne.current||e instanceof Error&&e.name===`AbortError`}(0,T.useEffect)(()=>{let t=!0;if(l([]),ue.current={},d({}),p(``),h(!1),_(!1),ne.current=!1,S(!1),he(),oe(``),!e){p(s);return}!r||o.current.has(s)?(pe.setMessages([]),p(s)):w(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}pe.setMessages(ge(e.messages??[])),l(ge(e.messages??[])),p(s)}}).catch(()=>{t&&(le.current=null,oe(`This chat could not be restored. Start a new chat or try again.`))});let i=pe.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(ge(t))}},onMessagesChanged:({messages:e})=>l(ge(e)),onRunInitialized:()=>{ne.current=!1,S(!1),_(!0),oe(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{fe.current.set(e.toolCallId,nt(e.toolCallName)),y(nt(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{fe.current.delete(e.toolCallId),y([...fe.current.values()].at(-1)??_e());let r=at(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:_t}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||ne.current?(oe(``),S(!0)):(console.warn(`Agent run error`,e.code),oe(qe(e.code))),_(!1),he()},onRunFinalized:({messages:e})=>{let t=ge(e);l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})},onRunFailed:e=>{ve(e.error)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})}});return()=>{t=!1,i.unsubscribe(),pe.abortRun()}},[pe,e,n,se,s]),(0,T.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>de.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>de.current?.focus()))),e.key===`Escape`&&n===de.current&&(ie(``),de.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ye(){_(!0),oe(``);try{await pe.runAgent({forwardedProps:{...ue.current}})}catch(e){ve(e)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s)}}async function be(n,i){let a=n.trim();if(!e||!a||g||!me||m)return;ue.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:_O(),role:`user`,content:a};pe.addMessage(c),l([...pe.messages]),d(e=>({...e,[c.id]:Date.now()})),ie(``),await ye()}(0,T.useEffect)(()=>{let e=le.current;me&&r&&e&&(le.current=null,be(e.text,e.options))},[me,r,s]);function xe(e){e.preventDefault(),be(re)}function Se(){ne.current=!0,oe(``),S(!0),pe.abortRun(),_(!1),he(),o.current.delete(s)}function Ce(){!g&&pe.messages.some(e=>e.role===`user`)&&ye()}function we(n,r){if(!e)return;let i=_O();o.current.add(i),le.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Te(){pe.abortRun(),le.current=null,ue.current={},a(_O()),t({to:`/chat`})}function Ee(e){le.current=null,ue.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function Oe(){ce(e=>e+1)}return(0,E.jsx)(et.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:me,running:g,activity:v,provisional:b,stopped:te,input:re,setInput:ie,error:ae,inputRef:de,send:be,submit:xe,stop:Se,retry:Ce,reloadThread:Oe,openChat:we,newThread:Te,selectThread:Ee},children:(0,E.jsx)(kO,{children:(0,E.jsx)(Zi,{})})})}function MO(){let e=(0,T.useMemo)(()=>new PD,[]);return(0,E.jsx)(yn,{client:e,children:(0,E.jsx)(je,{children:(0,E.jsx)(jO,{})})})}var NO=It({component:MO,notFoundComponent:()=>(0,E.jsx)(Me,{to:`/`,replace:!0})}),PO=Pt(`/`)({component:zt(()=>it(()=>import(`./routes-CmpBxgdE.js`),__vite__mapDeps([0,1,2])),`component`)}),FO=Pt(`/settings`)({component:zt(()=>it(()=>import(`./settings-WD83lfky.js`),__vite__mapDeps([3,1,2,4,5,6,7,8])),`component`)}),IO=Pt(`/chat/`)({component:zt(()=>it(()=>import(`./chat.index-B9WlrQOu.js`),__vite__mapDeps([9,10,1,11,4,5,12])),`component`)}),LO=Pt(`/chat/$threadId`)({component:zt(()=>it(()=>import(`./chat._threadId-B9WlrQOu.js`),__vite__mapDeps([13,10,1,11,4,5,12])),`component`)}),RO=Pt(`/dashboards/`)({component:zt(()=>it(()=>import(`./dashboards.index-CdkT7wKS.js`),__vite__mapDeps([14,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),zO=Pt(`/dashboards/$dashboardId`)({component:zt(()=>it(()=>import(`./dashboards._dashboardId-xbi0ey_r.js`),__vite__mapDeps([18,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),BO=PO.update({id:`/`,path:`/`,getParentRoute:()=>NO}),VO=FO.update({id:`/settings`,path:`/settings`,getParentRoute:()=>NO}),HO=IO.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>NO}),UO=LO.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>NO}),WO=RO.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>NO}),GO={IndexRoute:BO,SettingsRoute:VO,ChatThreadIdRoute:UO,DashboardsDashboardIdRoute:zO.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>NO}),ChatIndexRoute:HO,DashboardsIndexRoute:WO},KO=ra({routeTree:NO._addFileChildren(GO)._addFileTypes(),parseSearch:Vt,stringifySearch:gt,defaultPreload:`intent`,scrollRestoration:!0}),qO=Tt(v),JO=Ea({...Nt,variantColorResolver:qO});(0,yo.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(T.StrictMode,{children:(0,E.jsx)(Ta,{theme:JO,defaultColorScheme:`auto`,cssVariablesResolver:Rt,children:(0,E.jsx)(oa,{router:KO})})}));export{zg as A,rv as C,W_ as D,B as E,gu as F,jm as M,Dm as N,I_ as O,Em as P,H_ as S,X_ as T,Sv as _,n_ as a,R_ as b,Q_ as c,U as d,B_ as f,J_ as g,o_ as h,sO as i,Ng as j,u_ as k,N_ as l,K_ as m,RO as n,t_ as o,H as p,yO as r,E_ as s,zO as t,j_ as u,G as v,Dv as w,D_ as x,W as y}; \ No newline at end of file +`)};function sE(e,t){return Eo(t)&&cE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),To(t)}var cE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},lE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Kc(r=>{switch(r.type){case O.TEXT_MESSAGE_START:{let e=r;return[{type:aE.TextMessageStart,messageId:e.messageId,role:e.role}]}case O.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:aE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case O.TEXT_MESSAGE_END:{let e=r;return[{type:aE.TextMessageEnd,messageId:e.messageId}]}case O.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:aE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case O.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return cE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(il(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:aE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case O.TOOL_CALL_END:{let e=r;return[{type:aE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case O.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&cE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:aE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:sE(e.toolCallId,e.content),actionName:t||`unknown`}]}case O.RAW:return f||(f=!0,cE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case O.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:aE.MetaEvent,name:e.name,value:e.value}]}case O.STATE_SNAPSHOT:return p(r.snapshot),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case O.STATE_DELTA:{let c=r,l;try{l=ss.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return cE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case O.MESSAGES_SNAPSHOT:return c=r.messages,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case O.RUN_STARTED:return[];case O.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=uE(c)}catch(e){return[{type:aE.RunError,message:e.message}]}return[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case O.RUN_ERROR:{let e=r;return[{type:aE.RunError,message:e.message,code:e.code}]}case O.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case O.STEP_FINISHED:return u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function uE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=oE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:sE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var dE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,fE=e=>e===`tool`?`toolCallId`:`messageId`,pE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},mE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},hE=(e,t)=>{let n=mE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},gE=e=>new Set(Object.keys(e.shape)),_E=gE(Nv),vE=gE(Lv),yE=gE(by),bE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},xE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},SE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&xE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},CE=e=>t=>{let n=WT(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:O.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:O.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:O.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&dE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${fE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Kc(e=>{switch(e.type){case O.TEXT_MESSAGE_START:case O.TEXT_MESSAGE_CONTENT:case O.TEXT_MESSAGE_END:case O.TOOL_CALL_START:case O.TOOL_CALL_ARGS:case O.TOOL_CALL_END:case O.TOOL_CALL_RESULT:case O.STATE_SNAPSHOT:case O.STATE_DELTA:case O.CUSTOM:case O.STEP_STARTED:case O.STEP_FINISHED:case O.REASONING_START:case O.REASONING_MESSAGE_START:case O.REASONING_MESSAGE_CONTENT:case O.REASONING_MESSAGE_END:case O.REASONING_END:return[...i(e.subagentRunId??void 0),e];case O.RUN_STARTED:case O.RUN_FINISHED:case O.RUN_ERROR:case O.MESSAGES_SNAPSHOT:return[...a(),e];case O.RAW:case O.ACTIVITY_SNAPSHOT:case O.ACTIVITY_DELTA:case O.REASONING_ENCRYPTED_VALUE:case O.SUBAGENT_STARTED:return[e];case O.SUBAGENT_FINISHED:case O.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case O.TEXT_MESSAGE_CHUNK:{let t=e,a=bE(e,_E),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))pE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),pE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=mE({type:O.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case O.TOOL_CALL_CHUNK:{let t=e,a=bE(e,vE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))pE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),pE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=mE({type:O.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TOOL_CALL_CHUNK`),l}case O.REASONING_MESSAGE_CHUNK:{let t=e,a=bE(e,yE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=mE({type:O.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),$c(()=>{a()}))},wE=Symbol(`agui.strip.drop`);function TE(e){let t=e;for(;;){if(t instanceof mT||t instanceof gT||t instanceof vT||t instanceof OT||t instanceof wT){t=t.unwrap();continue}if(t instanceof ET){t=t.def.in;continue}if(t instanceof AT){t=t.def.getter();continue}return t}}function EE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function DE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function OE(e){let t=TE(e);return t instanceof dT?DE(t):void 0}function kE(e,t,n,r){let i=TE(t);if(i instanceof rT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=kE(a[e],i,`${n}/${e}`,r);if(l===wE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return wE}o[e]=l}return o}if(i instanceof tT){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=kE(e,t,`${n}/${i}`,r);if(s===wE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof cT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=kE(a[e],t,`${n}/${e}`,r);if(s===wE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof iT){let t=i.options,a=EE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=TE(o);if(!(t instanceof rT))continue;let s=t.shape;if(OE(s[a])===i)return kE(e,o,n,r)}return wE}let o=t.filter(e=>TE(e)instanceof rT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=TE(i);if(t instanceof tT&&Array.isArray(e)||t instanceof rT&&s)return kE(e,i,n,r)}return e}return e}function AE(e,t){let n=[],r=kE(e,t,``,n);if(r===wE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var jE=new Set(Object.values(O));function ME(e){return jE.has(e.type)}var NE=new Map(Ey.options.map(e=>{let t=e.shape;return[String(DE(t.type)),e]})),PE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function FE(e){PE()||console.warn(`[ag-ui][enforce] ${e}`)}var IE=e=>t=>{let n=WT(e);return t.pipe(Kc(e=>{if(!ME(e))return FE(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),cc;let t=NE.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=AE(e,t);for(let t of i)FE(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return Vc(t.parse(r))}))};function LE(e){let{value:t,stripped:n}=AE(So(e,`RunAgentInput`),oy);for(let e of n)FE(`Removed unrecognised material at '${e}' from the outgoing input.`);return oy.parse(t)}var RE=class{runNext(e,t){return t.run(e).pipe(CE(!1))}runNextWithState(e,t){let n=$(e.messages||[]),r=$(e.state===void 0?{}:e.state),i=new sc;return YT(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(Zc(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:$(n),state:$(r)})))}},zE=class extends RE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function UE(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function WE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(VE(e)){let n=HE(e);return n.type!==`binary`&&t.some(t=>UE(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var GE=`THINKING_START`,KE=`THINKING_END`,qE=`THINKING_TEXT_MESSAGE_START`,JE=`THINKING_TEXT_MESSAGE_CONTENT`,YE=`THINKING_TEXT_MESSAGE_END`;function XE(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}function ZE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function QE(e,t,n){if(!ZE(e)||e[t]!==null)return e;XE(`${n}.${t}: null`,`an absent field`);let{[t]:r,...i}=e;return i}function $E(e,t,n){if(!ZE(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function eD(e){return $E(e,`content`,e=>{if(!ZE(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return QE(e,`metadata`,`${e.type} input content`);default:return e}})}function tD(e){let t=QE(e,`forwardedProps`,`RunAgentInput`);return t=$E(t,`tools`,e=>QE(e,`parameters`,`Tool`)),t=$E(t,`resume`,e=>QE(e,`payload`,`ResumeEntry`)),$E(t,`messages`,eD)}var nD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warn(e,t){XE(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=LT();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,e.messages=e.messages.map(WE),t.run(e).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){if(e.rawEvent===null){this.warn(`${e.type}.rawEvent: null`,`an absent field`);let{rawEvent:t,...n}=e;e=n}if((e.type===O.RUN_FINISHED||e.type===O.SUBAGENT_FINISHED)&&e.result===null){this.warn(`${e.type}.result: null`,`an absent field`);let{result:t,...n}=e;e=n}switch(e.type){case GE:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warn(GE,O.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${GE}.title ${JSON.stringify(t)}: ${O.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case qE:return this.currentMessageId=LT(),this.warn(qE,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case JE:{let{delta:t,...n}=e;return this.warn(JE,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(JE,this.currentMessageId),delta:t}}case YE:{let t=this.mintedContinuationId(YE,this.currentMessageId);return this.currentMessageId=null,this.warn(YE,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case KE:{let t=this.mintedContinuationId(KE,this.currentReasoningId);return this.currentReasoningId=null,this.warn(KE,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}case O.TOOL_CALL_START:case O.TOOL_CALL_CHUNK:{let t=e;if(t.parentMessageId===null){this.warn(`${e.type}.parentMessageId: null`,`an absent field`);let{parentMessageId:n,...r}=t;return r}return e}case O.RUN_FINISHED:{let t=e;if(t.outcome===null){this.warn(`RUN_FINISHED.outcome: null`,`an absent field`);let{outcome:e,...n}=t;return n}return e}case O.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case O.RUN_STARTED:{let t=tD(e.input),n=t===e.input?e:{...e,input:t},r=n;return!r.input||!Array.isArray(r.input.messages)?n:{...r,input:{...r.input,messages:r.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=eD(e);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),WE(e))}},rD=()=>e=>Jc(()=>{let t=new nD;return e.pipe(Wc(e=>t.transformEvent(e)))});function iD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function aD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function oD(e){aD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function sD(e){aD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function cD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return sD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&oD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var lD=class extends RE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(cD)};return this.runNext(i,t)}},uD=`THINKING_START`,dD=`THINKING_END`,fD=`THINKING_TEXT_MESSAGE_START`,pD=`THINKING_TEXT_MESSAGE_CONTENT`,mD=`THINKING_TEXT_MESSAGE_END`,hD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case uD:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warnAboutTransformation(uD,O.REASONING_START),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case fD:return this.currentMessageId=LT(),this.warnAboutTransformation(fD,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case pD:{let{delta:t,...n}=e;return this.warnAboutTransformation(pD,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??LT(),delta:t}}case mD:{let t=this.currentMessageId??LT();return this.warnAboutTransformation(mD,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case dD:{let t=this.currentReasoningId??LT();return this.warnAboutTransformation(dD,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}default:return e}}},gD=`SUBAGENT_STARTED`,_D=`SUBAGENT_FINISHED`,vD=`SUBAGENT_ERROR`;function yD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function bD(e){return e.map(e=>yD(e))}var xD=class extends RE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>yD(e))};return this.runNext(n,t).pipe(nl(e=>{let t=e.type;(t===gD||t===_D||t===vD)&&this.warnDroppedLifecycleEvent(t)}),Yc(e=>{let t=e.type;return t!==gD&&t!==_D&&t!==vD}),Wc(e=>{let t=yD(e);if(t.type===O.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:bD(e.messages)}}if(t.type===O.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>yD(e))}}}if(t.type===O.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:bD(e.input.messages)}}}return t}))}},SD=`1.0.1`,CD=!1,wD=new WeakSet,TD=(e,t)=>/^\d+\.\d+$/.test(e)?rC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,ED=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(TD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},DD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return SD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return SD;let a=t===`maxProtocolVersion`?n:r;if(!a)return SD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!CD&&(CD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=UT(e),this._debugLogger=KT(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?KT(UT(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!iC(e))throw new k(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??vo(),this.messages=$(r??[]),this.state=$(i??{}),this._debug=UT(a),this._debugLogger=KT(this._debug);let o=this.resolvedCeilingDuringConstruction();rC(o,`0.0.39`)<=0&&this.middlewares.unshift(new lD),rC(o,`0.0.45`)<=0&&this.middlewares.unshift(new hD),rC(o,`0.0.57`)<=0&&this.middlewares.unshift(new xD)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new zE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];wD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),$c(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)));let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Co}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>Jc(()=>this.connect(n)),e=>IE(this.debugLogger)(rD()(e)),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.isRunning=!1,e instanceof Co?cc:this.onError(n,e,a))),$c(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)),{defaultValue:void 0});let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return YT(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(nl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||vo(),...rC(this.maxProtocolVersion,SD)>=0&&{protocolVersion:`1.0`},tools:$(e?.tools??[]),context:$(e?.context??[]),forwardedProps:$(e?.forwardedProps??{}),state:$(this.state),messages:n,...e?.resume===void 0?{}:{resume:$(e.resume)}}}async onInitialize(e,t){if(wD.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new k(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(iD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new k(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Bc(HT(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Wc(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=$(this.messages),e.state=$(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=$(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=$(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=$(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??vo();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),lE(this.threadId,t.runId,this.agentId),e=>e.pipe(Wc(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function OD(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var kD=class extends DD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(OD(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=$(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return iE(QT(()=>this.fetch(this.url,this.requestInit(LE(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=$(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},AD=class extends tn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hn(t,n.data),hasPreviousPage:rn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},jD=class extends on{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new mn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=MD(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>sn(t,e))}findAll(e={}){return this.getAll().filter(t=>sn(e,t))}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(e.map(e=>e.continue().catch(vn))))}};function MD(e){return e.options.scope?.id}var ND=class extends on{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cn(r,t),a=this.get(i);return a||(a=new fn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_n.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>en(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>en(e,t)):t}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},PD=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ND,this.#t=e.mutationCache||new jD,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=an.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ln.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _n.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_n.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _n.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=_n.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return _n.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_n.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(vn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(nn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ln.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{bn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{bn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=cn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Yt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function FD(e,t){return dn(e,AD,t)}var ID=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),LD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),RD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),zD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),BD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),VD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),HD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),UD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),WD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:ID}));WD.displayName=`BookOpenIcon`;var GD=WD,KD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:LD}));KD.displayName=`MagnifyingGlassIcon`;var qD=KD,JD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:RD}));JD.displayName=`MoonIcon`;var YD=JD,XD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:zD}));XD.displayName=`PlugsConnectedIcon`;var ZD=XD,QD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:BD}));QD.displayName=`PlusIcon`;var $D=QD,eO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:VD}));eO.displayName=`SignOutIcon`;var tO=eO,nO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:HD}));nO.displayName=`SparkleIcon`;var rO=nO,iO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:UD}));iO.displayName=`SunIcon`;var aO=iO,oO=[`agent-threads`];async function sO(e){let t=await w(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var cO=[];for(let e=0;e<256;++e)cO.push((e+256).toString(16).slice(1));function lO(e,t=0){return(cO[e[t+0]]+cO[e[t+1]]+cO[e[t+2]]+cO[e[t+3]]+`-`+cO[e[t+4]]+cO[e[t+5]]+`-`+cO[e[t+6]]+cO[e[t+7]]+`-`+cO[e[t+8]]+cO[e[t+9]]+`-`+cO[e[t+10]]+cO[e[t+11]]+cO[e[t+12]]+cO[e[t+13]]+cO[e[t+14]]+cO[e[t+15]]).toLowerCase()}var uO=new Uint8Array(16);function dO(){return crypto.getRandomValues(uO)}var fO={};function pO(e,t,n){let r;if(e)r=hO(e.random??e.rng?.()??dO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=dO();mO(fO,e,i),r=hO(i,fO.msecs,fO.seq,t,n)}return t??lO(r)}function mO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=gO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function hO(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=gO(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function gO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function _O(){return pO()}function vO(){let{setColorScheme:e}=qt(),t=Jt(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,T.useState)(!1);return(0,E.jsx)(Kt,{label:`Switch to ${n} theme`,opened:r,children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,E.jsx)(aO,{size:17,weight:`bold`}):(0,E.jsx)(YD,{size:17,weight:`bold`})})})}var yO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function bO(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await w(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function xO({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=$t(),[f,p]=(0,T.useState)(``),[m]=ca(f.trim(),250),[g,_]=(0,T.useState)(null),[v,y]=(0,T.useState)(null),[b,ee]=(0,T.useState)(``),[te,S]=(0,T.useState)(``),[ne,oe]=(0,T.useState)(!1),se=(0,T.useRef)(null);(0,T.useImperativeHandle)(u,()=>({focusSearch:()=>se.current?.focus()}),[]),(0,T.useEffect)(()=>{r&&requestAnimationFrame(()=>se.current?.focus())},[r]);let ce=FD({queryKey:[...oO,m],queryFn:({pageParam:e})=>bO(m,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),le=gn({queryKey:_t,queryFn:dt,refetchInterval:3e4,staleTime:pt}),ue=(0,T.useMemo)(()=>ce.data?.pages.flatMap(e=>e.items)??[],[ce.data]),de=(0,T.useMemo)(()=>DO(ue),[ue]),fe=gn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>sO(`/api/telemetry/schema?window=1h`),enabled:!!m&&!!l,staleTime:6e4}),me=(0,T.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(fe.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[fe.data,m]),he=(0,T.useMemo)(()=>{let e=le.data??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[le.data,m]);function ge(e){S(``),ee(e.title),_(e)}async function _e(){if(g&&b.trim()){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(g.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:b.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:oO}),_(null)}catch(e){S(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{oe(!1)}}}async function ve(){if(v){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(v.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.id;y(null),await d.invalidateQueries({queryKey:oO}),await d.invalidateQueries({queryKey:_t}),o(t)}catch(e){S(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{oe(!1)}}}return(0,E.jsxs)(re,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,E.jsx)(ie,{leftSection:(0,E.jsx)($D,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,E.jsx)(Gt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,E.jsxs)(re,{gap:`lg`,pb:`sm`,children:[e&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Chats`}),ce.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),ce.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!ce.isLoading&&!ce.isError&&ue.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),de.map(e=>(0,E.jsxs)(re,{gap:2,children:[de.length>1&&(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,E.jsx)(CO,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>ge(e),onDelete:()=>{S(``),y(e)}},e.id))]},e.label)),ce.hasNextPage&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:ce.isFetchingNextPage,onClick:()=>void ce.fetchNextPage(),children:`See all`})]}),m&&l&&fe.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),m&&l&&(fe.isSuccess||fe.isError)&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Services`}),fe.isError&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),fe.isSuccess&&me.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),me.map(e=>(0,E.jsx)(h,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,E.jsx)(ae,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Dashboards`}),le.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),le.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!le.isLoading&&!le.isError&&m&&he.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),he.map(e=>{let t=e.id===n;return(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(h,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,E.jsxs)(x,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,E.jsx)(tt,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,E.jsx)(h,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,E.jsxs)(ae,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,E.jsx)(rO,{size:14,weight:`fill`}),onClick:c,children:le.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,E.jsx)(Ae,{ref:se,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,E.jsx)(qD,{size:15}),rightSection:(0,E.jsx)(vt,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,E.jsx)(Xt,{opened:g!==null,onClose:()=>!ne&&_(null),title:`Rename chat`,centered:!0,children:(0,E.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_e()},children:(0,E.jsxs)(re,{children:[(0,E.jsx)(Ae,{label:`Name`,value:b,onChange:e=>ee(e.currentTarget.value),maxLength:120,autoFocus:!0}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>_(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{type:`submit`,loading:ne,disabled:!b.trim(),children:`Save`})]})]})})}),(0,E.jsx)(Xt,{opened:v!==null,onClose:()=>!ne&&y(null),title:`Delete chat?`,centered:!0,children:(0,E.jsxs)(re,{children:[(0,E.jsxs)(ae,{size:`sm`,children:[`This permanently removes `,(0,E.jsx)(ae,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>y(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{color:`bad`,loading:ne,onClick:()=>void ve(),children:`Delete`})]})]})})]})}function SO({children:e}){return(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function CO({thread:e,active:t,onSelect:r,onRename:i,onDelete:a}){return(0,E.jsx)(n,{"data-active":t||void 0,className:`rail-row`,children:(0,E.jsxs)(x,{gap:2,wrap:`nowrap`,children:[(0,E.jsx)(h,{onClick:r,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,children:OO(e.updated_at)})]})}),(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,E.jsx)(yt,{size:18,weight:`bold`})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ft,{size:15}),onClick:i,children:`Rename`}),(0,E.jsx)(mt.Item,{color:`bad`,leftSection:(0,E.jsx)(Ht,{size:15}),onClick:a,children:`Delete`})]})]})]})})}function wO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function TO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var EO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function DO(e){let t=TO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-TO(wO(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return EO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function OO(e){let t=wO(e),n=TO(new Date);return Math.floor((n-TO(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function kO({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=rt(),s=C(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=jt({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(``),_=(0,T.useRef)(null),v=le(`(max-width: 62em)`),y=(0,T.useRef)(v);y.current=v,(0,T.useEffect)(()=>{f.close()},[c]),(0,T.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(Xe),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,E.jsxs)(Xa,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,E.jsx)(Xa.Header,{children:(0,E.jsxs)(x,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,E.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(uo,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,E.jsx)(_e,{size:`small`})]}),(0,E.jsxs)(x,{gap:`xs`,wrap:`nowrap`,children:[(0,E.jsx)(Kt,{label:`Documentation`,children:(0,E.jsx)($e,{component:`a`,href:yO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,E.jsx)(GD,{size:17,weight:`bold`})})}),(0,E.jsx)(vO,{}),(0,E.jsx)(AO,{onError:g})]})]})}),(0,E.jsx)(Xa.Navbar,{p:`sm`,children:(0,E.jsx)(xO,{ref:_,...b})}),(0,E.jsx)(bt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,E.jsx)(_e,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,E.jsx)(xO,{...b,autoFocusSearch:d&&p})}),(0,E.jsxs)(Xa.Main,{children:[h&&(0,E.jsx)(pe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function AO({onError:e}){let t=C(),n=ke(),r=(n.name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,E.jsx)(so,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Label,{children:n.email||`Signed in`}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ZD,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,E.jsx)(mt.Divider,{}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(tO,{size:15}),onClick:()=>void Ee().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function jO(){let{agent_available:e}=De(),t=C(),n=$t(),{threadId:r}=jt({strict:!1}),[i,a]=(0,T.useState)(_O),o=(0,T.useRef)(new Set),s=r??i,[c,l]=(0,T.useState)([]),[u,d]=(0,T.useState)({}),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(!1),[v,y]=(0,T.useState)(``),[b,ee]=(0,T.useState)(null),x=(0,T.useRef)(null),[te,S]=(0,T.useState)(!1),ne=(0,T.useRef)(!1),[re,ie]=(0,T.useState)(``),[ae,oe]=(0,T.useState)(``),[se,ce]=(0,T.useState)(0),le=(0,T.useRef)(null),ue=(0,T.useRef)({}),de=(0,T.useRef)(null),fe=(0,T.useRef)(new Map),pe=(0,T.useMemo)(()=>new kD({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>w(e,t)}),[s]),me=!e||f===s;function he(){fe.current.clear(),y(``),x.current=null,ee(null)}let ge=e=>e.filter(e=>e.role!==`reasoning`);function _e(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function ve(e){return ne.current||e instanceof Error&&e.name===`AbortError`}(0,T.useEffect)(()=>{let t=!0;if(l([]),ue.current={},d({}),p(``),h(!1),_(!1),ne.current=!1,S(!1),he(),oe(``),!e){p(s);return}!r||o.current.has(s)?(pe.setMessages([]),p(s)):w(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}pe.setMessages(ge(e.messages??[])),l(ge(e.messages??[])),p(s)}}).catch(()=>{t&&(le.current=null,oe(`This chat could not be restored. Start a new chat or try again.`))});let i=pe.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(ge(t))}},onMessagesChanged:({messages:e})=>l(ge(e)),onRunInitialized:()=>{ne.current=!1,S(!1),_(!0),oe(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{fe.current.set(e.toolCallId,nt(e.toolCallName)),y(nt(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{fe.current.delete(e.toolCallId),y([...fe.current.values()].at(-1)??_e());let r=at(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:_t}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||ne.current?(oe(``),S(!0)):(console.warn(`Agent run error`,e.code),oe(qe(e.code))),_(!1),he()},onRunFinalized:({messages:e})=>{let t=ge(e);l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})},onRunFailed:e=>{ve(e.error)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})}});return()=>{t=!1,i.unsubscribe(),pe.abortRun()}},[pe,e,n,se,s]),(0,T.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>de.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>de.current?.focus()))),e.key===`Escape`&&n===de.current&&(ie(``),de.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ye(){_(!0),oe(``);try{await pe.runAgent({forwardedProps:{...ue.current}})}catch(e){ve(e)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s)}}async function be(n,i){let a=n.trim();if(!e||!a||g||!me||m)return;ue.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:_O(),role:`user`,content:a};pe.addMessage(c),l([...pe.messages]),d(e=>({...e,[c.id]:Date.now()})),ie(``),await ye()}(0,T.useEffect)(()=>{let e=le.current;me&&r&&e&&(le.current=null,be(e.text,e.options))},[me,r,s]);function xe(e){e.preventDefault(),be(re)}function Se(){ne.current=!0,oe(``),S(!0),pe.abortRun(),_(!1),he(),o.current.delete(s)}function Ce(){!g&&pe.messages.some(e=>e.role===`user`)&&ye()}function we(n,r){if(!e)return;let i=_O();o.current.add(i),le.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Te(){pe.abortRun(),le.current=null,ue.current={},a(_O()),t({to:`/chat`})}function Ee(e){le.current=null,ue.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function Oe(){ce(e=>e+1)}return(0,E.jsx)(et.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:me,running:g,activity:v,provisional:b,stopped:te,input:re,setInput:ie,error:ae,inputRef:de,send:be,submit:xe,stop:Se,retry:Ce,reloadThread:Oe,openChat:we,newThread:Te,selectThread:Ee},children:(0,E.jsx)(kO,{children:(0,E.jsx)(Zi,{})})})}function MO(){let e=(0,T.useMemo)(()=>new PD,[]);return(0,E.jsx)(yn,{client:e,children:(0,E.jsx)(je,{children:(0,E.jsx)(jO,{})})})}var NO=It({component:MO,notFoundComponent:()=>(0,E.jsx)(Me,{to:`/`,replace:!0})}),PO=Pt(`/`)({component:zt(()=>it(()=>import(`./routes-CmpBxgdE.js`),__vite__mapDeps([0,1,2])),`component`)}),FO=Pt(`/settings`)({component:zt(()=>it(()=>import(`./settings-Civ3-rvD.js`),__vite__mapDeps([3,1,2,4,5,6,7,8])),`component`)}),IO=Pt(`/chat/`)({component:zt(()=>it(()=>import(`./chat.index-B2BwBfS8.js`),__vite__mapDeps([9,10,1,11,4,5,12])),`component`)}),LO=Pt(`/chat/$threadId`)({component:zt(()=>it(()=>import(`./chat._threadId-B2BwBfS8.js`),__vite__mapDeps([13,10,1,11,4,5,12])),`component`)}),RO=Pt(`/dashboards/`)({component:zt(()=>it(()=>import(`./dashboards.index-BtnZ9Vkj.js`),__vite__mapDeps([14,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),zO=Pt(`/dashboards/$dashboardId`)({component:zt(()=>it(()=>import(`./dashboards._dashboardId-eTWiXAiz.js`),__vite__mapDeps([18,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),BO=PO.update({id:`/`,path:`/`,getParentRoute:()=>NO}),VO=FO.update({id:`/settings`,path:`/settings`,getParentRoute:()=>NO}),HO=IO.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>NO}),UO=LO.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>NO}),WO=RO.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>NO}),GO={IndexRoute:BO,SettingsRoute:VO,ChatThreadIdRoute:UO,DashboardsDashboardIdRoute:zO.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>NO}),ChatIndexRoute:HO,DashboardsIndexRoute:WO},KO=ra({routeTree:NO._addFileChildren(GO)._addFileTypes(),parseSearch:Vt,stringifySearch:gt,defaultPreload:`intent`,scrollRestoration:!0}),qO=Tt(v),JO=Ea({...Nt,variantColorResolver:qO});(0,yo.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(T.StrictMode,{children:(0,E.jsx)(Ta,{theme:JO,defaultColorScheme:`auto`,cssVariablesResolver:Rt,children:(0,E.jsx)(oa,{router:KO})})}));export{zg as A,rv as C,W_ as D,B as E,gu as F,jm as M,Dm as N,I_ as O,Em as P,H_ as S,X_ as T,Sv as _,n_ as a,R_ as b,Q_ as c,U as d,B_ as f,J_ as g,o_ as h,sO as i,Ng as j,u_ as k,N_ as l,K_ as m,RO as n,t_ as o,H as p,yO as r,E_ as s,zO as t,j_ as u,G as v,Dv as w,D_ as x,W as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-Bmuoa_GA.js b/internal/ui/dist/assets/mcp-app-frame-BW8pt9vy.js similarity index 99% rename from internal/ui/dist/assets/mcp-app-frame-Bmuoa_GA.js rename to internal/ui/dist/assets/mcp-app-frame-BW8pt9vy.js index f22dc6a3e..a3ff6d87e 100644 --- a/internal/ui/dist/assets/mcp-app-frame-Bmuoa_GA.js +++ b/internal/ui/dist/assets/mcp-app-frame-BW8pt9vy.js @@ -1,4 +1,4 @@ -import{C as e,Ct as t,bt as n,d as r,f as i,p as a,u as o,vt as s,y as c}from"./brand-oskFJPNW.js";import{i as l}from"./auth-CQerCjF_.js";import{t as u}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{t as d}from"./FocusTrap-yVpiEwpv.js";import{n as f}from"./chat-DjuGjU0o.js";import{A as p,C as m,D as h,E as g,F as _,M as v,N as y,O as b,P as x,S,T as C,_ as ee,a as w,b as T,c as E,d as te,f as D,g as ne,h as re,j as ie,k as ae,l as oe,m as se,o as ce,p as O,s as le,u as ue,v as k,w as A,x as j,y as M}from"./index-Nz8e3wJG.js";var de={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},fe;fe||={};function pe(e){return x(ce,e)}function me(e){return y(w,e)}function he(e){return v(le,e)}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Fa.some(t=>t.hasRequestMethod(e))}function Pa(e){return Fa.some(t=>t.hasNotificationMethod(e))}var Fa=[Ri,Da],Ia=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),La=e=>Ze.safeParse(e).success,Ra=e=>Qe.safeParse(e).success,za=e=>$e.safeParse(e).success,Ba=e=>et.safeParse(e).success,Va=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ha=e=>ht.safeParse(e).success,Ua=e=>vt.safeParse(e).success,Wa=`Mcp-Param-`,Ga=`x-mcp-header`,Ka=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,qa=new Set([`string`,`integer`,`boolean`,`number`]);function Ja(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ga in o){if(!a||i.length===0)return`${Za(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ga];if(typeof e!=`string`||e.length===0)return`${Za(i)}: x-mcp-header MUST be a non-empty string`;if(!Ka.test(e))return`${Za(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!qa.has(r))return`${Za(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Ya){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Xa.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Ya=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Xa=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Za(e){return e.length===0?``:e.join(`.`)}var Qa=`=?base64?`,$a=`?=`;function eo(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function to(e){if(e.length===0||e.startsWith(Qa)&&e.endsWith($a)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function no(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function ro(e){return to(e)?`${Qa}${no(e)}${$a}`:e}function io(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function ao(e,t){let n={};for(let r of e){let e=io(t,r.path);if(e==null)continue;let i=eo(e);i!==void 0&&(n[`${Wa}${r.headerName}`]=ro(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var oo={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function so(e,t){let n=Object.hasOwn(oo,e)?oo[e]:void 0;if(n===void 0)return;let r=co(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function co(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lo(e,t){return p(e,t)}function uo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function fo(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var po=!1,mo=`draft-2020-12`;function ho(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:mo});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);po||(po=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:mo,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&go(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function go(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||go(e)))}return!1}function _o(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function vo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>_o(e)).join(`, `)}:{success:!0,data:n.value}}function yo(e){let t=ie(e,{target:mo,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var bo=/\\\.\\d\{(\d+)\}/;function xo(e){let t=bo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function So(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=xo(t)}return new Set(n.map(e=>yo(e)).filter(e=>e!==void 0))}function Co(e,t,n){return n!==`zod`||So(e,t).has(t)}function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e){try{return ho(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Eo=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Do(e){return Eo.has(e)||e.startsWith(`x-`)}var Oo=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),ko={string:uo([Gn,qn,Jn,Yn]),number:uo([Kn]),integer:uo([Kn]),boolean:uo([Wn]),array:uo([Zn,Qn])},Ao=new Set(Gn.shape.format.unwrap().options);function jo(e,t,n,r){if(!wo(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(ko,e.type)?ko[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Do(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ao.has(e.format)?(typeof s!=`string`||!Co(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Mo(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&wo(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,jo(n,`properties.${e}`,t,r)])):Oo.has(i)?n[i]=a:Do(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function No(e,t){if(!wo(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!lo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Po(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Po(e,t[r],`${n}[${r}]`)):!wo(e)||!wo(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Po(r,t[e],i):Do(e)?[]:[i]})}function Fo(e){if(!fo(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Mo(To(e.requestedSchema),t),r=lo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${No(n,r.error.message)}`);let i=Po(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Io(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Io,{elicit(e){try{return{method:`elicitation/create`,params:Fo(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Lo=!0,Ro=10,zo=250;function Bo(e){return{autoFulfill:e?.autoFulfill??Lo,maxRounds:e?.maxRounds??Ro}}function Vo(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Ho(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Uo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Wo(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Go(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Ho(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Wo(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Uo(zo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Vo(r,u,c.requestState),d);if(Va(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var Ko=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),qo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Jo={},Yo={};function Xo(e,t){let n=e.slice(0,-6);Jo[n]=t,Yo[n]=e=>t.safeParse(e).success}for(let e of Ko)Xo(e,Ia[e]);for(let[e,t]of Object.entries(qo))Xo(e,t);Object.freeze(Jo);var Zo=Object.freeze(Yo);function Qo(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var $o=[Fe,Ie,Re,Be],es=[`inputResponses`,`requestState`];function ts(e,t){let n=e.params;if(!os(n))return{message:e,lifted:{}};let r=n._meta,i=os(r)?$o.filter(e=>e in r):[],a=t===`request`?es.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&os(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function ns(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function rs(e){return()=>e}var is=rs(void 0),as=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),za(e)||Ba(e)?this._onresponse(e):La(e)?this._onrequest(e,t):Ra(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ts(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ts(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:ls(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?is:rs(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return u(e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),za(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qo(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(hs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;vo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await vo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await vo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ss(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=os(a)&&os(i)?{...a,...i}:i}return n}function cs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ls(e){let t={},n=[];if(!cs(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!cs(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function us(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function ds(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:rs(void 0),signal:r,send:(()=>us(`send`)),notify:()=>us(`notify`)}}}async function fs(e,t,n,r,i){if(!cs(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=cs(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(ds(n,a,s,i,e.sessionId)))}function ps(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function ms(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>fs(e,i,t,n,r),retry:(e,t)=>r.retry(e,ps(o,t))};return Go({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function hs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var gs=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function _s(e){if(e)try{return gs.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function vs(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ys(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...vs(t.headers),...vs(r.headers)}:t.headers}):e}function bs(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Ds(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ts[i])continue;let a=`${r}/${xs(i)}`,o=e[i];if(Array.isArray(o)){if(Cs[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Ps=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Fs=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Is=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ls=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Rs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,zs=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Bs=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Vs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Hs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Us(e){return e.test.bind(e)}var Ws={date:Ks,time:qs.bind(void 0,!1),"date-time":Ys,duration:Hs,uri:Qs,"uri-reference":Us(Ms),"uri-template":Us(Ns),url:Us(Ps),email:zs,hostname:Us(js),ipv4:Us(Bs),ipv6:Us(Vs),regex:ec,uuid:Us(Fs),"json-pointer":Us(Is),"json-pointer-uri-fragment":Us(Ls),"relative-json-pointer":Us(Rs)};function Gs(e){return e%4==0&&(e%100!=0||e%400==0)}function Ks(e){let t=e.match(Os);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&Gs(n)?29:ks[r])}function qs(e,t){let n=t.match(As);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var Js=/t|\s/i;function Ys(e){let t=e.split(Js);return t.length==2&&Ks(t[0])&&qs(!0,t[1])}var Xs=/\/|:/,Zs=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Qs(e){return Xs.test(e)&&Zs.test(e)}var $s=/[^\\]\\Z/;function ec(e){if($s.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function tc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&r{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Fa.some(t=>t.hasRequestMethod(e))}function Pa(e){return Fa.some(t=>t.hasNotificationMethod(e))}var Fa=[Ri,Da],Ia=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),La=e=>Ze.safeParse(e).success,Ra=e=>Qe.safeParse(e).success,za=e=>$e.safeParse(e).success,Ba=e=>et.safeParse(e).success,Va=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ha=e=>ht.safeParse(e).success,Ua=e=>vt.safeParse(e).success,Wa=`Mcp-Param-`,Ga=`x-mcp-header`,Ka=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,qa=new Set([`string`,`integer`,`boolean`,`number`]);function Ja(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ga in o){if(!a||i.length===0)return`${Za(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ga];if(typeof e!=`string`||e.length===0)return`${Za(i)}: x-mcp-header MUST be a non-empty string`;if(!Ka.test(e))return`${Za(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!qa.has(r))return`${Za(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Ya){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Xa.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Ya=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Xa=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Za(e){return e.length===0?``:e.join(`.`)}var Qa=`=?base64?`,$a=`?=`;function eo(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function to(e){if(e.length===0||e.startsWith(Qa)&&e.endsWith($a)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function no(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function ro(e){return to(e)?`${Qa}${no(e)}${$a}`:e}function io(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function ao(e,t){let n={};for(let r of e){let e=io(t,r.path);if(e==null)continue;let i=eo(e);i!==void 0&&(n[`${Wa}${r.headerName}`]=ro(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var oo={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function so(e,t){let n=Object.hasOwn(oo,e)?oo[e]:void 0;if(n===void 0)return;let r=co(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function co(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lo(e,t){return p(e,t)}function uo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function fo(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var po=!1,mo=`draft-2020-12`;function ho(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:mo});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);po||(po=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:mo,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&go(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function go(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||go(e)))}return!1}function _o(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function vo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>_o(e)).join(`, `)}:{success:!0,data:n.value}}function yo(e){let t=ie(e,{target:mo,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var bo=/\\\.\\d\{(\d+)\}/;function xo(e){let t=bo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function So(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=xo(t)}return new Set(n.map(e=>yo(e)).filter(e=>e!==void 0))}function Co(e,t,n){return n!==`zod`||So(e,t).has(t)}function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e){try{return ho(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Eo=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Do(e){return Eo.has(e)||e.startsWith(`x-`)}var Oo=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),ko={string:uo([Gn,qn,Jn,Yn]),number:uo([Kn]),integer:uo([Kn]),boolean:uo([Wn]),array:uo([Zn,Qn])},Ao=new Set(Gn.shape.format.unwrap().options);function jo(e,t,n,r){if(!wo(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(ko,e.type)?ko[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Do(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ao.has(e.format)?(typeof s!=`string`||!Co(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Mo(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&wo(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,jo(n,`properties.${e}`,t,r)])):Oo.has(i)?n[i]=a:Do(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function No(e,t){if(!wo(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!lo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Po(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Po(e,t[r],`${n}[${r}]`)):!wo(e)||!wo(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Po(r,t[e],i):Do(e)?[]:[i]})}function Fo(e){if(!fo(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Mo(To(e.requestedSchema),t),r=lo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${No(n,r.error.message)}`);let i=Po(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Io(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Io,{elicit(e){try{return{method:`elicitation/create`,params:Fo(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Lo=!0,Ro=10,zo=250;function Bo(e){return{autoFulfill:e?.autoFulfill??Lo,maxRounds:e?.maxRounds??Ro}}function Vo(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Ho(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Uo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Wo(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Go(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Ho(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Wo(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Uo(zo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Vo(r,u,c.requestState),d);if(Va(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var Ko=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),qo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Jo={},Yo={};function Xo(e,t){let n=e.slice(0,-6);Jo[n]=t,Yo[n]=e=>t.safeParse(e).success}for(let e of Ko)Xo(e,Ia[e]);for(let[e,t]of Object.entries(qo))Xo(e,t);Object.freeze(Jo);var Zo=Object.freeze(Yo);function Qo(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var $o=[Fe,Ie,Re,Be],es=[`inputResponses`,`requestState`];function ts(e,t){let n=e.params;if(!os(n))return{message:e,lifted:{}};let r=n._meta,i=os(r)?$o.filter(e=>e in r):[],a=t===`request`?es.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&os(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function ns(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function rs(e){return()=>e}var is=rs(void 0),as=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),za(e)||Ba(e)?this._onresponse(e):La(e)?this._onrequest(e,t):Ra(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ts(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ts(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:ls(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?is:rs(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return u(e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),za(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qo(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(hs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;vo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await vo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await vo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ss(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=os(a)&&os(i)?{...a,...i}:i}return n}function cs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ls(e){let t={},n=[];if(!cs(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!cs(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function us(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function ds(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:rs(void 0),signal:r,send:(()=>us(`send`)),notify:()=>us(`notify`)}}}async function fs(e,t,n,r,i){if(!cs(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=cs(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(ds(n,a,s,i,e.sessionId)))}function ps(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function ms(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>fs(e,i,t,n,r),retry:(e,t)=>r.retry(e,ps(o,t))};return Go({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function hs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var gs=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function _s(e){if(e)try{return gs.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function vs(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ys(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...vs(t.headers),...vs(r.headers)}:t.headers}):e}function bs(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Ds(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ts[i])continue;let a=`${r}/${xs(i)}`,o=e[i];if(Array.isArray(o)){if(Cs[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Ps=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Fs=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Is=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ls=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Rs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,zs=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Bs=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Vs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Hs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Us(e){return e.test.bind(e)}var Ws={date:Ks,time:qs.bind(void 0,!1),"date-time":Ys,duration:Hs,uri:Qs,"uri-reference":Us(Ms),"uri-template":Us(Ns),url:Us(Ps),email:zs,hostname:Us(js),ipv4:Us(Bs),ipv6:Us(Vs),regex:ec,uuid:Us(Fs),"json-pointer":Us(Is),"json-pointer-uri-fragment":Us(Ls),"relative-json-pointer":Us(Rs)};function Gs(e){return e%4==0&&(e%100!=0||e%400==0)}function Ks(e){let t=e.match(Os);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&Gs(n)?29:ks[r])}function qs(e,t){let n=t.match(As);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var Js=/t|\s/i;function Ys(e){let t=e.split(Js);return t.length==2&&Ks(t[0])&&qs(!0,t[1])}var Xs=/\/|:/,Zs=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Qs(e){return Xs.test(e)&&Zs.test(e)}var $s=/[^\\]\\Z/;function ec(e){if($s.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function tc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&rbs(e,t))||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Q(e,v,n,r,i,a,o,t).valid&&F.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let xe=[];if(y!==void 0){let t=`${s}/anyOf`,l=F.length,u=!1;for(let s=0;s{let u=Object.create(c),d=Q(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return F.push(...d.errors),d.valid&&xe.push(u),d.valid}).length;u===1?F.length=l:F.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...xe),S!==void 0){let t=`${s}/if`;if(Q(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=Q(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(ee!==void 0){let l=Q(e,ee,n,r,i,a,o,`${s}/else`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||F.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(ne!==void 0&&t.lengthre&&F.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${re} properties.`}),ie!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${xs(s)}`,c=Q(s,ie,n,r,i,a,e,t);c.valid||F.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(ae!==void 0){let t=`${s}/dependantRequired`;for(let n in ae)if(n in e){let r=ae[n];for(let i of r)i in e||F.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(oe!==void 0)for(let t in oe){let l=`${s}/dependentSchemas`;if(t in e){let s=Q(e,oe[t],n,r,i,a,o,`${l}/${xs(t)}`,c);s.valid||F.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(se!==void 0){let t=`${s}/dependencies`;for(let s in se)if(s in e){let c=se[s];if(Array.isArray(c))for(let n of c)n in e||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Q(e,c,n,r,i,a,o,`${t}/${xs(s)}`);l.valid||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(T!==void 0){let t=`${s}/properties`;for(let s in T){if(!(s in e))continue;let d=`${o}/${xs(s)}`,f=Q(e[s],T[s],n,r,i,a,d,`${t}/${xs(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,F.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&E!==void 0){let t=`${s}/patternProperties`;for(let s in E){let d=new RegExp(s,`u`),f=E[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${xs(p)}`,h=Q(e[p],f,n,r,i,a,m,`${t}/${xs(s)}`);h.valid?c[p]=l[p]=!0:(u=i,F.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&te!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${xs(s)}`,f=Q(e[s],te,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,F.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&D!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${xs(s)}`,u=Q(e[s],D,n,r,i,a,l,t);u.valid?c[s]=!0:F.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){de!==void 0&&e.length>de&&F.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${de}).`}),M!==void 0&&e.length=(A||0)&&(F.length=u),A===void 0&&j===void 0&&d===0?F.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):A!==void 0&&dj&&F.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${j} items matching schema. ${d} items were found.`})}}if(!u&&ue!==void 0){let u=`${s}/unevaluatedItems`;for(;l=me||e>me)&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${N?`or equal to `:``} ${me}.`})):(pe!==void 0&&eme&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${me}.`}),he!==void 0&&e<=he&&F.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${he}.`}),N!==void 0&&e>=N&&F.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${N}.`})),P!==void 0){let t=e%P;Math.abs(0-t)>=1.1920929e-7&&Math.abs(P-t)>=1.1920929e-7&&F.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${P}.`})}}else if(u===`string`){let t=ge===void 0&&_e===void 0?0:tc(e);ge!==void 0&&t_e&&F.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${_e}).`}),ve!==void 0&&!new RegExp(ve,`u`).test(e)&&F.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),w!==void 0&&Ws[w]&&!Ws[w](e)&&F.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${w}".`})}return{valid:F.length===0,errors:F}}var nc=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Ds(e)}validate(e){return Q(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Ds(e,this.lookup)}},rc=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=je(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new nc(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},ic=globalThis.crypto;async function ac(e){return(await ic).getRandomValues(new Uint8Array(e))}async function oc(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await sc(e);return{code_verifier:t,code_challenge:await cc(t)}}var uc=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},dc=10,fc=13,pc=32;function mc(e){}function hc(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=mc,onError:n=mc,onRetry:r=mc,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new uc(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` diff --git a/internal/ui/dist/assets/page-zI1f8QoW.js b/internal/ui/dist/assets/page-DclWQ-lK.js similarity index 99% rename from internal/ui/dist/assets/page-zI1f8QoW.js rename to internal/ui/dist/assets/page-DclWQ-lK.js index 72405e4f5..9524bf07c 100644 --- a/internal/ui/dist/assets/page-zI1f8QoW.js +++ b/internal/ui/dist/assets/page-DclWQ-lK.js @@ -1,4 +1,4 @@ -import{A as e,C as t,Ct as n,D as r,E as i,K as a,M as o,O as s,P as c,S as l,St as u,T as d,X as f,Y as p,Z as m,_ as h,a as g,at as _,bt as v,c as y,d as b,dt as x,et as S,f as C,g as w,h as T,ht as E,j as D,k as O,lt as k,m as A,o as j,ot as M,p as N,pt as P,r as F,s as I,st as L,tt as ee,u as te,ut as ne,v as re,vt as ie,x as ae,xt as R,y as oe,yt as z}from"./brand-oskFJPNW.js";import{c as B,l as se,o as ce,r as le,s as ue}from"./auth-CQerCjF_.js";import{c as de,g as fe,m as pe,p as me,s as he}from"./preload-helper-DOsq4iEA.js";import{$ as ge,A as _e,B as ve,C as ye,D as be,F as xe,G as Se,H as Ce,I as we,J as Te,K as Ee,L as De,M as Oe,N as ke,O as Ae,P as je,R as Me,T as Ne,U as Pe,V as Fe,W as Ie,Z as Le,c as Re,d as ze,et as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as Ke,l as qe,m as Je,o as Ye,ot as Xe,p as Ze,q as Qe,r as $e,s as et,st as tt,u as nt,v as rt,w as it,y as at,z as ot}from"./theme-C7oNnx5z.js";import{n as st,t as ct}from"./get-single-element-child-D7qmWU2f.js";import{C as lt,E as ut,b as dt,o as ft,t as pt,w as mt}from"./Tooltip-2jTVpG2Y.js";import{t as ht}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{E as gt,T as _t,t as vt}from"./useQuery-BynlWFEG.js";import{n as yt}from"./FocusTrap-yVpiEwpv.js";import{a as bt,c as xt,d as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./dashboard-change-chips-8yAFuODi.js";import{n as jt,r as Mt,t as Nt}from"./WarningCircle.es-CsY2RrOb.js";function Pt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ft(e);if(n.length!==Ft(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var H=ie();function Lt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,V.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,V.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ut(e){let t=(0,V.useRef)(void 0);return(0,V.useEffect)(()=>{t.current=e},[e]),t.current}function Wt(e,t,n){let r=(0,V.useRef)(null);(0,V.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Gt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=dt(s.borderTopWidth)+dt(c.borderTopWidth),u=dt(s.borderLeftWidth)+dt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,V.useRef)(null),h=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,V.useEffect)(()=>{if(t){let e=e=>{Zt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,V.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Ht(()=>{St()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var $t={root:`m_96b553a6`},en=f((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),tn=d(n=>{let r=o(`FloatingIndicator`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:p,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=r,C=m(),w=e({name:`FloatingIndicator`,classes:$t,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:en,stylesCtx:{shouldReduceMotion:C}}),T=(0,V.useRef)(null),{initialized:E,hidden:D}=Qt({target:d,parent:f,ref:T,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),O=S(b,T);return!d||!f?null:(0,H.jsx)(t,{ref:O,mod:[{initialized:E,hidden:D},h],...w(`root`),...x})});tn.displayName=`@mantine/core/FloatingIndicator`,tn.classes=$t,tn.varsResolver=en;var[nn,rn]=ut(`Accordion component was not found in the tree`),[an,on]=ut(`Accordion.Item component was not found in the tree`),sn={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},cn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,chevron:c,icon:u,onClick:d,onKeyDown:f,children:p,disabled:m,mod:h,...g}=o(`AccordionControl`,null,e),{value:_}=on(),v=rn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,H.jsxs)(l,{...v.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:m},h],onClick:e=>{d?.(e),v.onChange(_)},type:`button`,disabled:m,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ge({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:f}),...g,children:[(0,H.jsx)(t,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:n,styles:a}),children:c||v.chevron}),(0,H.jsx)(`span`,{...v.getStyles(`label`,{classNames:n,styles:a}),children:p}),u&&(0,H.jsx)(t,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:n,styles:a}),children:u})]});return b?(0,H.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:n,styles:a}),children:S}):S});cn.displayName=`@mantine/core/AccordionControl`,cn.classes=sn;var ln=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,value:c,mod:l,...u}=o(`AccordionItem`,null,e),d=rn();return(0,H.jsx)(an,{value:{value:c},children:(0,H.jsx)(t,{mod:[{active:d.isItemActive(c)},l],...d.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:d.variant}),...u})})});ln.displayName=`@mantine/core/AccordionItem`,ln.classes=sn;var un=d(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:s,keepMounted:c,keepMountedMode:l,...u}=o(`AccordionPanel`,null,e),{value:d}=on(),f=rn();return(0,H.jsx)(At,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:c??f.keepMounted,keepMountedMode:l??f.keepMountedMode,...u,children:(0,H.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:s})})});un.displayName=`@mantine/core/AccordionPanel`,un.classes=sn;var dn={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},fn=f((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:P(n),"--accordion-radius":r===void 0?void 0:L(r)}})),pn=i(n=>{let r=o(`Accordion`,dn,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=r,M=ee(g),[N,P]=se({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),F=e=>Array.isArray(N)?N.includes(e):e===N,I=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},L=e({name:`Accordion`,classes:sn,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:fn});return(0,H.jsx)(nn,{value:{isItemActive:F,onChange:I,getControlId:It(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:It(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,H.jsx)(Ee,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:L,variant:T,unstyled:l,keepMounted:k,keepMountedMode:A},children:(0,H.jsx)(t,{...L(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});pn.classes=sn,pn.varsResolver=fn,pn.displayName=`@mantine/core/Accordion`,pn.Item=ln,pn.Panel=un,pn.Control=cn,pn.Chevron=Ee;function mn(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>mn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function hn(e){return e?e.map(e=>mn(e)):[]}function gn(e){return e.reduce((e,t)=>`group`in t?{...e,...gn(t.items)}:(e[`${t.value}`]=t,e),{})}var _n={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},vn={error:null},yn=f((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":k(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),bn=d(n=>{let r=o(`ComboboxChevron`,vn,n),{size:i,error:a,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,attributes:p,mod:m,...h}=r,g=e({name:`ComboboxChevron`,classes:_n,props:r,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,varsResolver:yn,attributes:p,rootSelector:`chevron`});return(0,H.jsx)(t,{component:`svg`,...h,...g(`chevron`),size:i,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:a},m],children:(0,H.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});bn.classes=_n,bn.varsResolver=yn,bn.displayName=`@mantine/core/ComboboxChevron`;var[xn,Sn]=ut(`Combobox component was not found in tree`);function Cn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,H.jsx)(T.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Cn.displayName=`@mantine/core/ComboboxClearButton`;var wn=d(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...s}=o(`ComboboxDropdown`,null,e),c=Sn();return(0,H.jsx)(Qe.Dropdown,{...s,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":c.floatingHeight||void 0,...c.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});wn.classes=_n,wn.displayName=`@mantine/core/ComboboxDropdown`;var Tn={refProp:`ref`},En=d(e=>{let{children:t,refProp:n,ref:r}=o(`ComboboxDropdownTarget`,Tn,e);if(Sn(),!st(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,H.jsx)(Qe.Target,{ref:r,refProp:n,children:t})});En.displayName=`@mantine/core/ComboboxDropdownTarget`;var Dn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxEmpty`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...c})});Dn.classes=_n,Dn.displayName=`@mantine/core/ComboboxEmpty`;function On({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Sn(),[c,l]=(0,V.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var kn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},An=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxEventsTarget`,kn,e),d=ct(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c});return(0,V.cloneElement)(d,{...p,...u,[n]:S(l,f.store.targetRef,lt(d))})});An.displayName=`@mantine/core/ComboboxEventsTarget`;var jn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxFooter`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});jn.classes=_n,jn.displayName=`@mantine/core/ComboboxFooter`;var Mn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,children:c,label:l,id:u,...d}=o(`ComboboxGroup`,null,e),f=Sn(),p=ee(u),m=l!=null&&l!==!1&&l!==``;return(0,H.jsxs)(t,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...d,children:[m&&(0,H.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:n,styles:a}),children:l}),c]})});Mn.classes=_n,Mn.displayName=`@mantine/core/ComboboxGroup`;var Nn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxHeader`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});Nn.classes=_n,Nn.displayName=`@mantine/core/ComboboxHeader`;function Pn({value:e,valuesDivider:t=`,`,...n}){return(0,H.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Pn.displayName=`@mantine/core/ComboboxHiddenInput`;var Fn=d(e=>{let n=o(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:s,vars:c,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=n,v=Sn(),y=(0,V.useId)(),b=u||y;return(0,H.jsx)(t,{...v.getStyles(`option`,{className:i,classNames:r,styles:s,style:a}),..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(n.value,n),l?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Fn.classes=_n,Fn.displayName=`@mantine/core/ComboboxOption`;var In=d(e=>{let{classNames:n,className:r,style:i,styles:a,id:s,onMouseDown:c,labelledBy:l,...u}=o(`ComboboxOptions`,null,e),d=Sn(),f=ee(s);return(0,V.useEffect)(()=>{d.store.setListId(f)},[f]),(0,H.jsx)(t,{...d.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),c?.(e)}})});In.classes=_n,In.displayName=`@mantine/core/ComboboxOptions`;var Ln={withAriaAttributes:!0,withKeyboardNavigation:!0},Rn=d(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:s,onClick:c,withKeyboardNavigation:l,size:u,ref:d,...f}=o(`ComboboxSearch`,Ln,e),p=Sn(),m=p.getStyles(`search`),h=On({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:s,onClick:c,autoComplete:`off`});return(0,H.jsx)(T,{ref:S(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Rn.classes=_n,Rn.displayName=`@mantine/core/ComboboxSearch`;var zn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bn=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxTarget`,zn,e),d=ct(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c}),m=(0,V.cloneElement)(d,{...p,...u});return(0,H.jsx)(Qe.Target,{refProp:n,ref:S(l,f.store.targetRef),children:m})});Bn.displayName=`@mantine/core/ComboboxTarget`;function Vn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Hn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,V.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,V.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,V.useCallback)(()=>{let e=Yt(f.current);qt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,V.useCallback)(e=>{let t=Yt(f.current),n=qt(`#${l.current}`,t),r=n?Jt(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,V.useCallback)(()=>{let e=Yt(f.current),t=qt(`#${l.current} [data-combobox-active]`,e);if(t){let n=Jt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Hn(u.current,t,a))},[b,a]),C=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),w=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Un(t))},[b]),T=(0,V.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,V.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,V.useCallback)(()=>{let e=Yt(f.current);(Jt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,V.useCallback)(e=>{l.current=e},[]),k=(0,V.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,V.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,V.useCallback)(()=>u.current,[]);return(0,V.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Gn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Kn=f((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:P(n),"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)}})),qn=t=>{let n=o(`Combobox`,Gn,t),{classNames:r,styles:i,unstyled:a,children:s,store:c,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=n,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,S=Wn(),C=c||S,w=e({name:h||`Combobox`,classes:_n,props:n,classNames:r,styles:i,unstyled:a,attributes:_,vars:l,varsResolver:Kn}),T=()=>{d?.(),C.closeDropdown()};return(0,H.jsx)(xn,{value:{getStyles:w,store:C,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,H.jsx)(Qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:a,children:s})})};qn.extend=e=>e,qn.classes=_n,qn.varsResolver=Kn,qn.displayName=`@mantine/core/Combobox`,qn.Target=Bn,qn.Dropdown=wn,qn.Options=In,qn.Option=Fn,qn.Search=Rn,qn.Empty=Dn,qn.Chevron=bn,qn.Footer=jn,qn.Header=Nn,qn.EventsTarget=An,qn.DropdownTarget=En,qn.Group=Mn,qn.ClearButton=Cn,qn.HiddenInput=Pn;function Jn({children:e,role:t}){let n=(0,V.use)(w);return n?(0,H.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,H.jsx)(H.Fragment,{children:e})}var Yn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Xn=Yn;function Zn({__staticSelector:n,__stylesApiProps:r,className:i,classNames:a,styles:o,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:_=`label`,variant:v,style:y,vars:b,mod:x,attributes:S,...C}){let w=e({name:n,props:r,className:i,style:y,classes:Yn,classNames:a,styles:o,unstyled:s,attributes:S}),E=u?`${d}-description`:void 0,D=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,H.jsx)(t,{...w(`root`),__vars:{"--label-fz":M(m),"--label-lh":k(m,`label-lh`)},mod:[{"label-position":h},x],variant:v,size:m,...C,children:(0,H.jsxs)(t,{component:g,htmlFor:g===`label`?d:void 0,...w(`body`),children:[c,(0,H.jsxs)(`div`,{...w(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,H.jsx)(t,{component:_,htmlFor:_===`label`?d:void 0,...w(`label`),"data-disabled":f||void 0,children:l}),u&&(0,H.jsx)(T.Description,{id:E,size:m,__inheritStyles:!1,...w(`description`),children:u}),p&&typeof p!=`boolean`&&(0,H.jsx)(T.Error,{id:D,size:m,__inheritStyles:!1,...w(`error`),children:p})]})]})})}Zn.displayName=`@mantine/core/InlineInput`;function Qn(e){return`group`in e}function $n({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function tr(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Qn(n))tr(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function nr(e,t){return Array.isArray(e)?e.includes(t):e===t}function rr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Qn(e)){let s=nr(r,e.value),c=t&&(s?(0,H.jsx)(Se,{className:_n.optionsDropdownCheckIcon}):n?(0,H.jsx)(`div`,{className:_n.optionsDropdownCheckPlaceholder}):null),l=(0,H.jsxs)(H.Fragment,{children:[i===`left`&&c,(0,H.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,H.jsx)(qn.Option,{value:e.value,disabled:e.disabled,className:p({[_n.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,H.jsx)(rr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,H.jsx)(qn.Group,{label:e.group,children:s})}function ir({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=Sn();tr(e);let x=typeof i==`string`?(r||$n)({options:e,search:l?i:``,limit:a??1/0}):e,S=er(x),C=x.map((e,t)=>(0,H.jsx)(rr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Qn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,H.jsx)(qn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,H.jsxs)(qn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,H.jsx)(ft.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,H.jsx)(qn.Empty,{children:m})]})})}function ar(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},sr=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,sr(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,V.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ar(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ar(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){or(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function lr(e){let t=e.currentTarget;return Yt(t).activeElement!==t}var ur=(0,V.createContext)(null),dr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},fr=(0,V.createContext)(null),pr=f((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?k(n,`pg-gap`):k(t)}})),mr=d(n=>{let r=o(`PillGroup`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,size:d,disabled:f,attributes:p,...m}=r,h=(0,V.use)(ur)?.size||d||void 0,g=e({name:`PillGroup`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:p,vars:u,varsResolver:pr,stylesCtx:{size:h},rootSelector:`group`});return(0,H.jsx)(fr,{value:{size:h,disabled:f},children:(0,H.jsx)(t,{size:h,...g(`group`),...m})})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/PillGroup`;var hr={variant:`default`},gr=f((e,{radius:t},{size:n})=>({root:{"--pill-fz":k(n,`pill-fz`),"--pill-height":k(n,`pill-height`),"--pill-radius":t===void 0?void 0:L(t)}})),_r=d(n=>{let r=o(`Pill`,hr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=r,S=(0,V.use)(fr),C=(0,V.use)(ur),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=e({name:`Pill`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:b,vars:u,varsResolver:gr,stylesCtx:{size:w}});return(0,H.jsxs)(t,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,H.jsx)(`span`,{...E(`label`),children:f}),p&&(0,H.jsx)(re,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});_r.classes=dr,_r.varsResolver=gr,_r.displayName=`@mantine/core/Pill`,_r.Group=mr;var vr={field:`m_45c4369d`},yr={type:`visible`},br=d(n=>{let r=o(`PillsInputField`,yr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=r,y=(0,V.use)(ur),b=(0,V.use)(w),x=e({name:`PillsInputField`,classes:vr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:g,rootSelector:`field`}),C=f||y?.disabled;return(0,H.jsx)(t,{component:`input`,ref:S(_,y?.fieldRef),"data-type":d,disabled:C,mod:[{disabled:C,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});br.classes=vr,br.displayName=`@mantine/core/PillsInputField`;var xr={size:`sm`},Sr=d(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:s,error:c,variant:l,...u}=o([`Input`,`InputWrapper`,`PillsInput`],xr,e),d=(0,V.useRef)(null);return(0,H.jsx)(ur,{value:{fieldRef:d,size:i,disabled:a,hasError:!!c,variant:l},children:(0,H.jsx)(A,{size:i,error:c,variant:l,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:a,__staticSelector:s||`PillsInput`,withAria:!1,children:t})})});Sr.displayName=`@mantine/core/PillsInput`,Sr.classes=A.classes,Sr.Field=br;function Cr(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function wr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Tr({data:e,value:t}){let n=t.map(wr);return e.reduce((e,t)=>(Qn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(wr(e.value))===-1)}):n.indexOf(wr(t.value))===-1&&e.push(t),e),[])}var Er={xs:41,sm:50,md:60,lg:72,xl:89},Dr={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Or=i(t=>{let n=o([`Input`,`InputWrapper`,`MultiSelect`],Dr,t),{classNames:r,className:i,style:a,styles:c,unstyled:l,vars:u,size:d,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:O,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:F,disabled:I,onFocus:L,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:B,leftSectionProps:ce,inputContainer:le,inputWrapperOrder:ue,withAsterisk:de,labelProps:fe,descriptionProps:pe,errorProps:me,successProps:he,wrapperProps:ge,description:_e,label:ve,error:ye,success:be,maxValues:xe,searchable:Se,nothingFoundMessage:Ce,withCheckIcon:we,withAlignedLabels:Te,checkIconPosition:Ee,hidePickedOptions:De,withErrorStyles:Oe,withSuccessStyles:ke,name:Ae,form:je,id:Me,clearable:Ne,clearSectionMode:Pe,clearButtonProps:Fe,hiddenInputProps:Ie,placeholder:Le,hiddenInputValuesDivider:Re,required:ze,mod:Be,renderOption:Ve,renderPill:He,onRemove:Ue,onClear:We,onMaxValues:Ge,scrollAreaProps:Ke,chevronColor:qe,attributes:Je,clearSearchOnChange:Ye,openOnFocus:Xe,loading:Ze,loadingPosition:Qe,withPillsReorder:$e,...et}=n,tt=ee(Me),nt=hn(_),rt=gn(nt),it=(0,V.useRef)({}),at=Wn({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&at.selectFirstOption()},onDropdownClose:()=>{x?.(),at.resetSelectedOption()}}),{styleProps:ot,rest:{type:st,autoComplete:ct,...lt}}=s(et),[ut,dt]=se({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:mt}=cr({value:ut,onChange:dt,enabled:$e&&!I&&!F}),[ht,gt]=se({value:M,defaultValue:N,finalValue:``,onChange:P}),_t=e=>{gt(e),at.resetSelectedOption()},vt=e({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:c,unstyled:l,attributes:Je}),{resolvedClassNames:yt,resolvedStyles:bt}=D({props:n,styles:c,classNames:r}),xt=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!Se&&(e.preventDefault(),at.toggleDropdown()),e.key===`Backspace`&&ht.length===0&&ut.length>0&&(Ue?.(ut[ut.length-1]),dt(ut.slice(0,ut.length-1))),mt(e))},St=ut.map((e,t)=>{let n=rt[`${e}`]||it.current[`${e}`],r=ft(t);return He?(0,H.jsx)(V.Fragment,{children:He({option:n,value:e,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},disabled:I,reorderProps:r})},`${e}-${t}`):(0,H.jsx)(_r,{withRemoveButton:!F&&!rt[`${e}`]?.disabled,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},unstyled:l,disabled:I,...vt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,V.useEffect)(()=>{S&&at.selectFirstOption()},[S,ht]),(0,V.useEffect)(()=>{ut.forEach(e=>{`${e}`in rt&&(it.current[`${e}`]=rt[`${e}`])})},[rt,ut]);let Ct=(0,H.jsx)(qn.ClearButton,{...Fe,onClear:()=>{We?.(),dt([]),_t(``)}}),wt=Tr({data:nt,value:ut}),Tt=Ne&&ut.length>0&&!I&&!F,Et=Tt?{paddingInlineEnd:Er[d]??Er.sm}:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:at,classNames:yt,styles:bt,unstyled:l,size:d,readOnly:F,__staticSelector:`MultiSelect`,attributes:Je,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Ye&&_t(``),at.updateSelectedOptionIndex(`selected`),ut.includes(rt[`${e}`].value)?(dt(ut.filter(t=>t!==rt[`${e}`].value)),Ue?.(rt[`${e}`].value)):ut.lengthSe?at.openDropdown():at.toggleDropdown(),"data-expanded":at.dropdownOpened||void 0,id:tt,required:ze,mod:Be,attributes:Je,children:(0,H.jsxs)(_r.Group,{attributes:Je,disabled:I,unstyled:l,...vt(`pillsList`,{style:Et}),...pt(),children:[St,(0,H.jsx)(qn.EventsTarget,{autoComplete:ct,withExpandedAttribute:!0,children:(0,H.jsx)(Sr.Field,{...lt,id:tt,placeholder:Le,type:!Se&&!Le?`hidden`:`visible`,...vt(`inputField`),unstyled:l,onFocus:e=>{L?.(e),Xe&&Se&&at.openDropdown()},onBlur:e=>{te?.(e),at.closeDropdown(),_t(``)},onKeyDown:xt,value:ht,onChange:e=>{if(lr(e)){if(!F){let t=Cr(rt,e.currentTarget.value);t&&!ut.includes(t.value)&&ut.length{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ProgressLabel`,null,e),l=Ar();return(0,H.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...c})});Mr.classes=jr,Mr.displayName=`@mantine/core/ProgressLabel`;var Nr=f((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":k(t,`progress-size`),"--progress-radius":n===void 0?void 0:L(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pr=d(n=>{let r=o(`ProgressRoot`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=r,_=e({name:`Progress`,classes:jr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:Nr});return(0,H.jsx)(kr,{value:{getStyles:_,autoContrast:d},children:(0,H.jsx)(t,{mod:[{orientation:p},h],..._(`root`),...g})})});Pr.classes=jr,Pr.varsResolver=Nr,Pr.displayName=`@mantine/core/ProgressRoot`;var Fr={withAria:!0},Ir=d(e=>{let{classNames:n,className:r,style:i,styles:s,vars:l,value:u,withAria:d,color:f,striped:p,animated:m,mod:h,...g}=o(`ProgressSection`,Fr,e),_=Ar(),v=c(),y=d?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,"aria-valuetext":`${u}%`}:{};return(0,H.jsx)(t,{..._.getStyles(`section`,{className:r,classNames:n,styles:s,style:i}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${u}%`,"--progress-section-color":a(f,v),"--progress-label-color":Xt(_.autoContrast,v)?Te({color:f,theme:v,autoContrast:_.autoContrast}):void 0}})});Ir.classes=jr,Ir.displayName=`@mantine/core/ProgressSection`;var Lr=d(e=>{let t=o(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:s,striped:c,animated:l,"aria-label":u,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=D({classNames:r,styles:i,props:t});return(0,H.jsx)(Pr,{classNames:f,styles:p,vars:a,...d,children:(0,H.jsx)(Ir,{value:n,color:s,striped:c,animated:l,"aria-label":u})})});Lr.classes=jr,Lr.displayName=`@mantine/core/Progress`,Lr.Section=Ir,Lr.Root=Pr,Lr.Label=Mr;var Rr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},zr={withItemsBorders:!0},Br=f((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:L(t),"--sc-color":n?a(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":k(i,`sc-padding`),"--sc-font-size":M(i)}})),Vr=i(n=>{let r=o(`SegmentedControl`,zr,n),{classNames:i,className:a,style:s,styles:l,unstyled:u,vars:d,data:f,value:p,defaultValue:m,onChange:h,size:g,name:v,disabled:y,readOnly:b,fullWidth:x,orientation:C,radius:w,color:T,transitionDuration:E,transitionTimingFunction:D,variant:O,autoContrast:k,withItemsBorders:A,mod:j,attributes:M,ref:N,...P}=r,F=e({name:`SegmentedControl`,props:r,classes:Rr,className:a,style:s,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:Br}),I=c(),L=f.map(e=>Kt(e)?{label:`${e}`,value:e}:e),te=Gt(),[ne,re]=(0,V.useState)(_()),[ie,ae]=(0,V.useState)(null),[R,oe]=(0,V.useState)({}),z=(e,t)=>{e!==null&&R[t]!==e&&(R[t]=e,oe({...R}))},[B,ce]=se({value:p,defaultValue:m,finalValue:Array.isArray(f)?L.find(e=>!e.disabled)?.value??f[0]?.value??null:null,onChange:h}),le=ee(v),ue=L.map(e=>`${e.value}`),de=L.map(e=>(0,V.createElement)(t,{...F(`control`),mod:{active:B===e.value,orientation:C},key:`${e.value}`},(0,V.createElement)(`input`,{...F(`input`),disabled:y||e.disabled,type:`radio`,name:le,value:`${e.value}`,id:`${le}-${e.value}`,checked:B===e.value,onChange:()=>!b&&ce(e.value),"data-focus-ring":I.focusRing,key:`${e.value}-input`}),(0,V.createElement)(t,{component:`label`,...F(`label`),mod:{active:B===e.value&&!(y||e.disabled),disabled:y||e.disabled,"read-only":b},htmlFor:`${le}-${e.value}`,ref:t=>z(t,`${e.value}`),__vars:{"--sc-label-color":T===void 0?void 0:Te({color:T,theme:I,autoContrast:k})},key:`${e.value}-label`},(0,H.jsx)(`span`,{...F(`innerLabel`),children:e.label})))),fe=S(N,ae);return Vt(()=>{re(_())},[f.length]),Vt(()=>{oe(e=>{let t={};return ue.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ue]),f.length===0?null:(0,H.jsxs)(t,{...F(`root`),variant:O,size:g,ref:fe,mod:[{"full-width":x,orientation:C,initialized:te,"with-items-borders":A},j],...P,role:`radiogroup`,"data-disabled":y,children:[B!==void 0&&(0,H.jsx)(tn,{target:R[`${B}`],parent:ie,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...F(`indicator`)},ne),de]})});Vr.classes=Rr,Vr.varsResolver=Br,Vr.displayName=`@mantine/core/SegmentedControl`;var Hr={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Ur=i(e=>{let t=o([`Input`,`InputWrapper`,`Select`],Hr,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,floatingHeight:k,size:j,searchable:M,rightSection:N,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:B,clearable:ce,clearSectionMode:le,clearButtonProps:ue,hiddenInputProps:de,renderOption:fe,onClear:pe,autoComplete:me,scrollAreaProps:he,__defaultRightSection:ge,__clearSection:_e,__clearable:ve,chevronColor:ye,autoSelectOnBlur:be,openOnFocus:xe,attributes:Se,...Ce}=t,we=(0,V.useMemo)(()=>hn(h),[h]),Te=(0,V.useRef)({}),Ee=(0,V.useMemo)(()=>gn(we),[we]),De=ee(B),[Oe,ke,Ae]=se({value:g,defaultValue:_,finalValue:null,onChange:m}),je=Oe==null?void 0:`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`],Me=Ut(je),[Ne,Pe,Fe]=se({value:re,defaultValue:ie,finalValue:je?je.label:``,onChange:ae}),Ie=Wn({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Ie.selectFirstOption():Ie.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Ie.resetSelectedOption,0)}}),Le=e=>{Pe(e),Ie.resetSelectedOption()},{resolvedClassNames:Re,resolvedStyles:ze}=D({props:t,styles:r,classNames:n});(0,V.useEffect)(()=>{v&&Ie.selectFirstOption()},[v,Ne]),(0,V.useEffect)(()=>{g===null&&Le(``),g!=null&&je&&(Me?.value!==je.value||Me?.label!==je.label)&&Le(je.label)},[g,je]),(0,V.useEffect)(()=>{!Ae&&!Fe&&Le(Oe==null?``:`${Oe}`in Ee?Ee[`${Oe}`]?.label:Te.current[`${Oe}`]?.label||``)},[Ee,Oe]),(0,V.useEffect)(()=>{Oe&&`${Oe}`in Ee&&(Te.current[`${Oe}`]=Ee[`${Oe}`])},[Ee,Oe]);let Be=(0,H.jsx)(qn.ClearButton,{...ue,onClear:()=>{ke(null,null),Le(``),pe?.()}}),Ve=ce&&Oe!=null&&!C&&!S;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:Ie,__staticSelector:`Select`,classNames:Re,styles:ze,unstyled:i,readOnly:S,size:j,attributes:Se,floatingHeight:k,keepMounted:be,onOptionSubmit:e=>{b?.(e);let t=R&&`${Ee[e].value}`==`${Oe}`?null:Ee[e],n=t?t.value:null;n!==Oe&&ke(n,t),!Ae&&Le(n==null?``:t?.label||``),Ie.closeDropdown()},...x,children:[(0,H.jsx)(qn.Target,{targetType:M?`input`:`button`,autoComplete:me,withExpandedAttribute:!0,children:(0,H.jsx)(A,{id:De,__defaultRightSection:(0,H.jsx)(qn.Chevron,{size:j,error:oe,unstyled:i,color:ye}),__clearSection:Be,__clearable:Ve,__clearSectionMode:le,rightSection:N,rightSectionPointerEvents:z||`none`,...Ce,size:j,__staticSelector:`Select`,disabled:C,readOnly:S||!M,value:Ne,onChange:e=>{if(lr(e)){if(!S){let t=Cr(Ee,e.currentTarget.value);t&&`${t.value}`!=`${Oe}`&&(ke(t.value,t),!Ae&&Le(t.label))}return}Le(e.currentTarget.value),Ie.openDropdown(),v&&Ie.selectFirstOption()},onFocus:e=>{xe&&M&&Ie.openDropdown(),d?.(e)},onBlur:e=>{be&&Ie.clickSelectedOption(),Ie.closeDropdown();let t=Oe!=null&&(`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`]);Le(t&&t.label||``),f?.(e)},onClick:e=>{M?Ie.openDropdown():Ie.toggleDropdown(),p?.(e)},classNames:Re,styles:ze,unstyled:i,pointer:!M,error:oe,attributes:Se})}),(0,H.jsx)(ir,{data:we,hidden:S||C,filter:w,search:Ne,limit:T,hiddenWhenEmpty:!L,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!M&&je?.label!==Ne,value:Oe,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,unstyled:i,labelId:Ce.label?`${De}-label`:void 0,"aria-label":Ce.label?void 0:Ce[`aria-label`],renderOption:fe,scrollAreaProps:he})]}),(0,H.jsx)(qn.HiddenInput,{value:Oe,name:te,form:ne,disabled:C,...de})]})});Ur.classes={...A.classes,...qn.classes},Ur.displayName=`@mantine/core/Select`;function Wr(e){if(e!==void 0)return typeof e==`number`?P(e):e}function Gr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=c(),s=t===void 0?e:t,l=r!==void 0,u=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(s)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),d=E(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(s[r])),!l&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),f=Le(E(d),o.breakpoints).filter(e=>E(d[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:d[e.value]}));return(0,H.jsx)(O,{styles:u,media:f,selector:a})}function Kr(e){return typeof e==`object`&&e?E(e):[]}function qr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return qr(Array.from(new Set([...Kr(e),...Kr(t),...r===void 0?Kr(n):[]])))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),l=Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,H.jsx)(O,{styles:c,container:d,selector:a})}var Xr={container:`m_925c2d2c`,root:`m_2415a157`},Zr={cols:1,spacing:`md`,type:`media`},Qr=d(n=>{let i=o(`SimpleGrid`,Zr,n),{classNames:a,className:s,style:c,styles:l,unstyled:u,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=i,x=e({name:`SimpleGrid`,classes:Xr,props:i,className:s,style:c,classNames:a,styles:l,unstyled:u,attributes:y,vars:d}),S=r(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yr,{...i,selector:`.${S}`}),(0,H.jsx)(`div`,{...x(`container`),children:(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gr,{...i,selector:`.${S}`}),(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});Qr.classes=Xr,Qr.displayName=`@mantine/core/SimpleGrid`;var $r=(0,V.createContext)(null),ei={hiddenInputValuesSeparator:`,`},ti=i((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:s,readOnly:c,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=o(`SwitchGroup`,ei,e),[h,g]=se({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(c)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(u);return(0,H.jsx)($r,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,H.jsxs)(T.Wrapper,{size:i,...a,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,H.jsx)(Jn,{role:`group`,children:s}),(0,H.jsx)(`input`,{type:`hidden`,name:l,value:y,...d})]})})}));ti.classes=T.Wrapper.classes,ti.displayName=`@mantine/core/SwitchGroup`;var ni={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ri={labelPosition:`right`,withThumbIndicator:!0},ii=f((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:L(t),"--switch-height":k(r,`switch-height`),"--switch-width":k(r,`switch-width`),"--switch-thumb-size":k(r,`switch-thumb-size`),"--switch-label-font-size":k(r,`switch-label-font-size`),"--switch-track-label-padding":k(r,`switch-track-label-padding`),"--switch-color":n?a(n,e):void 0}})),ai=d(n=>{let r=o(`Switch`,ri,n),{classNames:i,className:a,style:c,styles:l,unstyled:u,vars:d,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=r,P=(0,V.use)($r),F=_||P?.size,I=e({name:`Switch`,props:r,classes:ni,className:a,style:c,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:ii}),{styleProps:L,rest:te}=s(N),ne=ee(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=se({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,H.jsxs)(Zn,{...I(`root`),__staticSelector:`Switch`,__stylesApiProps:r,id:ne,size:F,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:i,styles:l,unstyled:u,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...L,...y,children:[(0,H.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...I(`input`)}),(0,H.jsxs)(t,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...I(`track`),children:[(0,H.jsx)(t,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...I(`thumb`),children:b}),(0,H.jsx)(`span`,{...I(`trackLabel`),children:R?h:m})]})]})});ai.classes={...ni,...Xn},ai.varsResolver=ii,ai.displayName=`@mantine/core/Switch`,ai.Group=ti;var oi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),si=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),ci=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),li=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),ui=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),di=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),fi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),pi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),hi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),gi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),_i=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),vi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),yi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:oi}));yi.displayName=`ArrowClockwiseIcon`;var bi=yi,xi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:si}));xi.displayName=`ArrowCounterClockwiseIcon`;var Si=xi,Ci=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ci}));Ci.displayName=`ArrowsOutIcon`;var wi=Ci,Ti=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:li}));Ti.displayName=`CaretUpIcon`;var Ei=Ti,Di=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ui}));Di.displayName=`ChatCircleTextIcon`;var Oi=Di,ki=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:di}));ki.displayName=`ClockIcon`;var Ai=ki,ji=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:fi}));ji.displayName=`ClockCounterClockwiseIcon`;var Mi=ji,Ni=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:pi}));Ni.displayName=`InfoIcon`;var Pi=Ni,Fi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:mi}));Fi.displayName=`KeyboardIcon`;var Ii=Fi,Li=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:hi}));Li.displayName=`ListBulletsIcon`;var Ri=Li,zi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:gi}));zi.displayName=`ListMagnifyingGlassIcon`;var Bi=zi,Vi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:_i}));Vi.displayName=`MagnifyingGlassMinusIcon`;var Hi=Vi,Ui=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:vi}));Ui.displayName=`WrenchIcon`;var Wi=Ui,Gi=n(z(),1),Ki=`$__all`;function qi(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ji(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Yi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=qi(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Ji(r,u,s[0]),f=Ji(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Xi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=qi(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=$i(d,0,s-r),f=$i(f,0,l-i),{x:d,y:f}}function Zi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=qi(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Qi(e,t,n){let{margin:r,rowHeight:i}=e,a=qi(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function $i(e,t,n){return Math.max(Math.min(e,n),t)}function ea(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ta(e,t){for(let n=0;nea(e,t))}function ra(e,t){return t===`horizontal`?aa(e):t===`vertical`||t===`wrap`?ia(e):[...e]}function ia(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function aa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function oa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function sa(e,t){for(let n=0;ne.static===!0)}function la(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ua(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;ta(n,i);)i.y++}}return e}function ma(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=ra(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=na(d,t),p=f.length>0;if(p&&c)return ua(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ma(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ma(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return ma(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ma(e,n,l,u,r,c,i)}function ga(e,t,n){return Math.max(t,Math.min(n,e))}var _a=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:ga(t,0,Math.max(0,r-e.w)),y:ga(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:ga(t,1,Math.max(1,o)),h:ga(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:ga(t,e.minW??1,e.maxW??1/0),h:ga(n,e.minH??1,e.maxH??1/0)}}}];function va(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ya(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ba({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function xa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Sa(e){return e*100+`%`}function Ca(e,t,n,r){return e+n>r?t:n}function wa(e,t,n){return e<0?t:n}function Ta(e){return Math.max(0,e)}function Ea(e){return Math.max(0,e)}var Da=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:wa(o,e.height,i),top:Ea(o)}},Oa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Ca(e.left,e.width,o,n),left:Ta(i)}},ka=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Ea(r),left:0}:{height:i,width:a,top:Ea(r),left:o}},Aa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:wa(r,e.height,a),top:Ea(r)}},ja={n:Da,ne:(e,t,n)=>Da(e,Oa(e,t,n)),e:Oa,se:(e,t,n)=>Aa(e,Oa(e,t,n)),s:Aa,sw:(e,t,n)=>Aa(e,ka(e,t)),w:ka,nw:(e,t,n)=>Da(e,ka(e,t))};function Ma(e,t,n,r){let i=ja[e];return i?i(t,{...t,...n},r):n}var Na={type:`transform`,scale:1,calcStyle(e){return ba(e)}},Pa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Fa={enabled:!0,bounded:!1,threshold:3},Ia={enabled:!0,handles:[`se`]},La={enabled:!1,defaultItem:{w:1,h:1}};function Ra(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??ca(e).length>0;for(let i=o+1;it.y+t.h)break;ea(t,o)&&Ra(e,o,n+t[a],r,s)}}t[r]=n}function za(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!ta(e,t);)t.y--;let i;for(;(i=ta(e,t))!==void 0;)Ra(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Ba(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!ta(e,t);)t.x--;let i;for(;(i=ta(e,t))!==void 0;)if(Ra(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!ta(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Va={type:`vertical`,allowOverlap:!1,compact(e,t){let n=ca(e),r=oa(n),i=ia(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ya(e,t){let n=Ja(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Xa(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Za(e,t,n,r,i,a){let o=e[n];if(o)return ua(o);let s=e[r],c=Ja(t),l=c.slice(c.indexOf(n));for(let t=0;t{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),eo=R(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),to=R(((e,t)=>{var n=eo();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),no=R(((e,t)=>{t.exports=to()()})),ro=n(no(),1);function io(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&io(e.changedTouches,e=>t===e.identifier)}function ko(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ao(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function jo(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ao();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{A as e,C as t,Ct as n,D as r,E as i,K as a,M as o,O as s,P as c,S as l,St as u,T as d,X as f,Y as p,Z as m,_ as h,a as g,at as _,bt as v,c as y,d as b,dt as x,et as S,f as C,g as w,h as T,ht as E,j as D,k as O,lt as k,m as A,o as j,ot as M,p as N,pt as P,r as F,s as I,st as L,tt as ee,u as te,ut as ne,v as re,vt as ie,x as ae,xt as R,y as oe,yt as z}from"./brand-oskFJPNW.js";import{c as B,l as se,o as ce,r as le,s as ue}from"./auth-CQerCjF_.js";import{c as de,g as fe,m as pe,p as me,s as he}from"./preload-helper-DOsq4iEA.js";import{$ as ge,A as _e,B as ve,C as ye,D as be,F as xe,G as Se,H as Ce,I as we,J as Te,K as Ee,L as De,M as Oe,N as ke,O as Ae,P as je,R as Me,T as Ne,U as Pe,V as Fe,W as Ie,Z as Le,c as Re,d as ze,et as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as Ke,l as qe,m as Je,o as Ye,ot as Xe,p as Ze,q as Qe,r as $e,s as et,st as tt,u as nt,v as rt,w as it,y as at,z as ot}from"./theme-BKAYKhPv.js";import{n as st,t as ct}from"./get-single-element-child-D7qmWU2f.js";import{C as lt,E as ut,b as dt,o as ft,t as pt,w as mt}from"./Tooltip-2jTVpG2Y.js";import{t as ht}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{E as gt,T as _t,t as vt}from"./useQuery-BynlWFEG.js";import{n as yt}from"./FocusTrap-yVpiEwpv.js";import{a as bt,c as xt,d as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./dashboard-change-chips-8yAFuODi.js";import{n as jt,r as Mt,t as Nt}from"./WarningCircle.es-CsY2RrOb.js";function Pt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ft(e);if(n.length!==Ft(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var H=ie();function Lt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,V.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,V.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ut(e){let t=(0,V.useRef)(void 0);return(0,V.useEffect)(()=>{t.current=e},[e]),t.current}function Wt(e,t,n){let r=(0,V.useRef)(null);(0,V.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Gt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=dt(s.borderTopWidth)+dt(c.borderTopWidth),u=dt(s.borderLeftWidth)+dt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,V.useRef)(null),h=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,V.useEffect)(()=>{if(t){let e=e=>{Zt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,V.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Ht(()=>{St()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var $t={root:`m_96b553a6`},en=f((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),tn=d(n=>{let r=o(`FloatingIndicator`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:p,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=r,C=m(),w=e({name:`FloatingIndicator`,classes:$t,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:en,stylesCtx:{shouldReduceMotion:C}}),T=(0,V.useRef)(null),{initialized:E,hidden:D}=Qt({target:d,parent:f,ref:T,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),O=S(b,T);return!d||!f?null:(0,H.jsx)(t,{ref:O,mod:[{initialized:E,hidden:D},h],...w(`root`),...x})});tn.displayName=`@mantine/core/FloatingIndicator`,tn.classes=$t,tn.varsResolver=en;var[nn,rn]=ut(`Accordion component was not found in the tree`),[an,on]=ut(`Accordion.Item component was not found in the tree`),sn={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},cn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,chevron:c,icon:u,onClick:d,onKeyDown:f,children:p,disabled:m,mod:h,...g}=o(`AccordionControl`,null,e),{value:_}=on(),v=rn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,H.jsxs)(l,{...v.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:m},h],onClick:e=>{d?.(e),v.onChange(_)},type:`button`,disabled:m,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ge({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:f}),...g,children:[(0,H.jsx)(t,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:n,styles:a}),children:c||v.chevron}),(0,H.jsx)(`span`,{...v.getStyles(`label`,{classNames:n,styles:a}),children:p}),u&&(0,H.jsx)(t,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:n,styles:a}),children:u})]});return b?(0,H.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:n,styles:a}),children:S}):S});cn.displayName=`@mantine/core/AccordionControl`,cn.classes=sn;var ln=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,value:c,mod:l,...u}=o(`AccordionItem`,null,e),d=rn();return(0,H.jsx)(an,{value:{value:c},children:(0,H.jsx)(t,{mod:[{active:d.isItemActive(c)},l],...d.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:d.variant}),...u})})});ln.displayName=`@mantine/core/AccordionItem`,ln.classes=sn;var un=d(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:s,keepMounted:c,keepMountedMode:l,...u}=o(`AccordionPanel`,null,e),{value:d}=on(),f=rn();return(0,H.jsx)(At,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:c??f.keepMounted,keepMountedMode:l??f.keepMountedMode,...u,children:(0,H.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:s})})});un.displayName=`@mantine/core/AccordionPanel`,un.classes=sn;var dn={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},fn=f((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:P(n),"--accordion-radius":r===void 0?void 0:L(r)}})),pn=i(n=>{let r=o(`Accordion`,dn,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=r,M=ee(g),[N,P]=se({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),F=e=>Array.isArray(N)?N.includes(e):e===N,I=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},L=e({name:`Accordion`,classes:sn,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:fn});return(0,H.jsx)(nn,{value:{isItemActive:F,onChange:I,getControlId:It(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:It(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,H.jsx)(Ee,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:L,variant:T,unstyled:l,keepMounted:k,keepMountedMode:A},children:(0,H.jsx)(t,{...L(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});pn.classes=sn,pn.varsResolver=fn,pn.displayName=`@mantine/core/Accordion`,pn.Item=ln,pn.Panel=un,pn.Control=cn,pn.Chevron=Ee;function mn(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>mn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function hn(e){return e?e.map(e=>mn(e)):[]}function gn(e){return e.reduce((e,t)=>`group`in t?{...e,...gn(t.items)}:(e[`${t.value}`]=t,e),{})}var _n={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},vn={error:null},yn=f((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":k(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),bn=d(n=>{let r=o(`ComboboxChevron`,vn,n),{size:i,error:a,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,attributes:p,mod:m,...h}=r,g=e({name:`ComboboxChevron`,classes:_n,props:r,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,varsResolver:yn,attributes:p,rootSelector:`chevron`});return(0,H.jsx)(t,{component:`svg`,...h,...g(`chevron`),size:i,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:a},m],children:(0,H.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});bn.classes=_n,bn.varsResolver=yn,bn.displayName=`@mantine/core/ComboboxChevron`;var[xn,Sn]=ut(`Combobox component was not found in tree`);function Cn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,H.jsx)(T.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Cn.displayName=`@mantine/core/ComboboxClearButton`;var wn=d(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...s}=o(`ComboboxDropdown`,null,e),c=Sn();return(0,H.jsx)(Qe.Dropdown,{...s,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":c.floatingHeight||void 0,...c.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});wn.classes=_n,wn.displayName=`@mantine/core/ComboboxDropdown`;var Tn={refProp:`ref`},En=d(e=>{let{children:t,refProp:n,ref:r}=o(`ComboboxDropdownTarget`,Tn,e);if(Sn(),!st(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,H.jsx)(Qe.Target,{ref:r,refProp:n,children:t})});En.displayName=`@mantine/core/ComboboxDropdownTarget`;var Dn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxEmpty`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...c})});Dn.classes=_n,Dn.displayName=`@mantine/core/ComboboxEmpty`;function On({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Sn(),[c,l]=(0,V.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var kn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},An=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxEventsTarget`,kn,e),d=ct(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c});return(0,V.cloneElement)(d,{...p,...u,[n]:S(l,f.store.targetRef,lt(d))})});An.displayName=`@mantine/core/ComboboxEventsTarget`;var jn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxFooter`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});jn.classes=_n,jn.displayName=`@mantine/core/ComboboxFooter`;var Mn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,children:c,label:l,id:u,...d}=o(`ComboboxGroup`,null,e),f=Sn(),p=ee(u),m=l!=null&&l!==!1&&l!==``;return(0,H.jsxs)(t,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...d,children:[m&&(0,H.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:n,styles:a}),children:l}),c]})});Mn.classes=_n,Mn.displayName=`@mantine/core/ComboboxGroup`;var Nn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxHeader`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});Nn.classes=_n,Nn.displayName=`@mantine/core/ComboboxHeader`;function Pn({value:e,valuesDivider:t=`,`,...n}){return(0,H.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Pn.displayName=`@mantine/core/ComboboxHiddenInput`;var Fn=d(e=>{let n=o(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:s,vars:c,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=n,v=Sn(),y=(0,V.useId)(),b=u||y;return(0,H.jsx)(t,{...v.getStyles(`option`,{className:i,classNames:r,styles:s,style:a}),..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(n.value,n),l?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Fn.classes=_n,Fn.displayName=`@mantine/core/ComboboxOption`;var In=d(e=>{let{classNames:n,className:r,style:i,styles:a,id:s,onMouseDown:c,labelledBy:l,...u}=o(`ComboboxOptions`,null,e),d=Sn(),f=ee(s);return(0,V.useEffect)(()=>{d.store.setListId(f)},[f]),(0,H.jsx)(t,{...d.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),c?.(e)}})});In.classes=_n,In.displayName=`@mantine/core/ComboboxOptions`;var Ln={withAriaAttributes:!0,withKeyboardNavigation:!0},Rn=d(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:s,onClick:c,withKeyboardNavigation:l,size:u,ref:d,...f}=o(`ComboboxSearch`,Ln,e),p=Sn(),m=p.getStyles(`search`),h=On({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:s,onClick:c,autoComplete:`off`});return(0,H.jsx)(T,{ref:S(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Rn.classes=_n,Rn.displayName=`@mantine/core/ComboboxSearch`;var zn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bn=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxTarget`,zn,e),d=ct(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c}),m=(0,V.cloneElement)(d,{...p,...u});return(0,H.jsx)(Qe.Target,{refProp:n,ref:S(l,f.store.targetRef),children:m})});Bn.displayName=`@mantine/core/ComboboxTarget`;function Vn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Hn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,V.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,V.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,V.useCallback)(()=>{let e=Yt(f.current);qt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,V.useCallback)(e=>{let t=Yt(f.current),n=qt(`#${l.current}`,t),r=n?Jt(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,V.useCallback)(()=>{let e=Yt(f.current),t=qt(`#${l.current} [data-combobox-active]`,e);if(t){let n=Jt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Hn(u.current,t,a))},[b,a]),C=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),w=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Un(t))},[b]),T=(0,V.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,V.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,V.useCallback)(()=>{let e=Yt(f.current);(Jt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,V.useCallback)(e=>{l.current=e},[]),k=(0,V.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,V.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,V.useCallback)(()=>u.current,[]);return(0,V.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Gn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Kn=f((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:P(n),"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)}})),qn=t=>{let n=o(`Combobox`,Gn,t),{classNames:r,styles:i,unstyled:a,children:s,store:c,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=n,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,S=Wn(),C=c||S,w=e({name:h||`Combobox`,classes:_n,props:n,classNames:r,styles:i,unstyled:a,attributes:_,vars:l,varsResolver:Kn}),T=()=>{d?.(),C.closeDropdown()};return(0,H.jsx)(xn,{value:{getStyles:w,store:C,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,H.jsx)(Qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:a,children:s})})};qn.extend=e=>e,qn.classes=_n,qn.varsResolver=Kn,qn.displayName=`@mantine/core/Combobox`,qn.Target=Bn,qn.Dropdown=wn,qn.Options=In,qn.Option=Fn,qn.Search=Rn,qn.Empty=Dn,qn.Chevron=bn,qn.Footer=jn,qn.Header=Nn,qn.EventsTarget=An,qn.DropdownTarget=En,qn.Group=Mn,qn.ClearButton=Cn,qn.HiddenInput=Pn;function Jn({children:e,role:t}){let n=(0,V.use)(w);return n?(0,H.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,H.jsx)(H.Fragment,{children:e})}var Yn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Xn=Yn;function Zn({__staticSelector:n,__stylesApiProps:r,className:i,classNames:a,styles:o,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:_=`label`,variant:v,style:y,vars:b,mod:x,attributes:S,...C}){let w=e({name:n,props:r,className:i,style:y,classes:Yn,classNames:a,styles:o,unstyled:s,attributes:S}),E=u?`${d}-description`:void 0,D=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,H.jsx)(t,{...w(`root`),__vars:{"--label-fz":M(m),"--label-lh":k(m,`label-lh`)},mod:[{"label-position":h},x],variant:v,size:m,...C,children:(0,H.jsxs)(t,{component:g,htmlFor:g===`label`?d:void 0,...w(`body`),children:[c,(0,H.jsxs)(`div`,{...w(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,H.jsx)(t,{component:_,htmlFor:_===`label`?d:void 0,...w(`label`),"data-disabled":f||void 0,children:l}),u&&(0,H.jsx)(T.Description,{id:E,size:m,__inheritStyles:!1,...w(`description`),children:u}),p&&typeof p!=`boolean`&&(0,H.jsx)(T.Error,{id:D,size:m,__inheritStyles:!1,...w(`error`),children:p})]})]})})}Zn.displayName=`@mantine/core/InlineInput`;function Qn(e){return`group`in e}function $n({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function tr(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Qn(n))tr(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function nr(e,t){return Array.isArray(e)?e.includes(t):e===t}function rr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Qn(e)){let s=nr(r,e.value),c=t&&(s?(0,H.jsx)(Se,{className:_n.optionsDropdownCheckIcon}):n?(0,H.jsx)(`div`,{className:_n.optionsDropdownCheckPlaceholder}):null),l=(0,H.jsxs)(H.Fragment,{children:[i===`left`&&c,(0,H.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,H.jsx)(qn.Option,{value:e.value,disabled:e.disabled,className:p({[_n.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,H.jsx)(rr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,H.jsx)(qn.Group,{label:e.group,children:s})}function ir({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=Sn();tr(e);let x=typeof i==`string`?(r||$n)({options:e,search:l?i:``,limit:a??1/0}):e,S=er(x),C=x.map((e,t)=>(0,H.jsx)(rr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Qn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,H.jsx)(qn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,H.jsxs)(qn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,H.jsx)(ft.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,H.jsx)(qn.Empty,{children:m})]})})}function ar(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},sr=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,sr(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,V.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ar(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ar(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){or(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function lr(e){let t=e.currentTarget;return Yt(t).activeElement!==t}var ur=(0,V.createContext)(null),dr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},fr=(0,V.createContext)(null),pr=f((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?k(n,`pg-gap`):k(t)}})),mr=d(n=>{let r=o(`PillGroup`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,size:d,disabled:f,attributes:p,...m}=r,h=(0,V.use)(ur)?.size||d||void 0,g=e({name:`PillGroup`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:p,vars:u,varsResolver:pr,stylesCtx:{size:h},rootSelector:`group`});return(0,H.jsx)(fr,{value:{size:h,disabled:f},children:(0,H.jsx)(t,{size:h,...g(`group`),...m})})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/PillGroup`;var hr={variant:`default`},gr=f((e,{radius:t},{size:n})=>({root:{"--pill-fz":k(n,`pill-fz`),"--pill-height":k(n,`pill-height`),"--pill-radius":t===void 0?void 0:L(t)}})),_r=d(n=>{let r=o(`Pill`,hr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=r,S=(0,V.use)(fr),C=(0,V.use)(ur),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=e({name:`Pill`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:b,vars:u,varsResolver:gr,stylesCtx:{size:w}});return(0,H.jsxs)(t,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,H.jsx)(`span`,{...E(`label`),children:f}),p&&(0,H.jsx)(re,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});_r.classes=dr,_r.varsResolver=gr,_r.displayName=`@mantine/core/Pill`,_r.Group=mr;var vr={field:`m_45c4369d`},yr={type:`visible`},br=d(n=>{let r=o(`PillsInputField`,yr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=r,y=(0,V.use)(ur),b=(0,V.use)(w),x=e({name:`PillsInputField`,classes:vr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:g,rootSelector:`field`}),C=f||y?.disabled;return(0,H.jsx)(t,{component:`input`,ref:S(_,y?.fieldRef),"data-type":d,disabled:C,mod:[{disabled:C,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});br.classes=vr,br.displayName=`@mantine/core/PillsInputField`;var xr={size:`sm`},Sr=d(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:s,error:c,variant:l,...u}=o([`Input`,`InputWrapper`,`PillsInput`],xr,e),d=(0,V.useRef)(null);return(0,H.jsx)(ur,{value:{fieldRef:d,size:i,disabled:a,hasError:!!c,variant:l},children:(0,H.jsx)(A,{size:i,error:c,variant:l,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:a,__staticSelector:s||`PillsInput`,withAria:!1,children:t})})});Sr.displayName=`@mantine/core/PillsInput`,Sr.classes=A.classes,Sr.Field=br;function Cr(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function wr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Tr({data:e,value:t}){let n=t.map(wr);return e.reduce((e,t)=>(Qn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(wr(e.value))===-1)}):n.indexOf(wr(t.value))===-1&&e.push(t),e),[])}var Er={xs:41,sm:50,md:60,lg:72,xl:89},Dr={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Or=i(t=>{let n=o([`Input`,`InputWrapper`,`MultiSelect`],Dr,t),{classNames:r,className:i,style:a,styles:c,unstyled:l,vars:u,size:d,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:O,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:F,disabled:I,onFocus:L,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:B,leftSectionProps:ce,inputContainer:le,inputWrapperOrder:ue,withAsterisk:de,labelProps:fe,descriptionProps:pe,errorProps:me,successProps:he,wrapperProps:ge,description:_e,label:ve,error:ye,success:be,maxValues:xe,searchable:Se,nothingFoundMessage:Ce,withCheckIcon:we,withAlignedLabels:Te,checkIconPosition:Ee,hidePickedOptions:De,withErrorStyles:Oe,withSuccessStyles:ke,name:Ae,form:je,id:Me,clearable:Ne,clearSectionMode:Pe,clearButtonProps:Fe,hiddenInputProps:Ie,placeholder:Le,hiddenInputValuesDivider:Re,required:ze,mod:Be,renderOption:Ve,renderPill:He,onRemove:Ue,onClear:We,onMaxValues:Ge,scrollAreaProps:Ke,chevronColor:qe,attributes:Je,clearSearchOnChange:Ye,openOnFocus:Xe,loading:Ze,loadingPosition:Qe,withPillsReorder:$e,...et}=n,tt=ee(Me),nt=hn(_),rt=gn(nt),it=(0,V.useRef)({}),at=Wn({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&at.selectFirstOption()},onDropdownClose:()=>{x?.(),at.resetSelectedOption()}}),{styleProps:ot,rest:{type:st,autoComplete:ct,...lt}}=s(et),[ut,dt]=se({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:mt}=cr({value:ut,onChange:dt,enabled:$e&&!I&&!F}),[ht,gt]=se({value:M,defaultValue:N,finalValue:``,onChange:P}),_t=e=>{gt(e),at.resetSelectedOption()},vt=e({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:c,unstyled:l,attributes:Je}),{resolvedClassNames:yt,resolvedStyles:bt}=D({props:n,styles:c,classNames:r}),xt=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!Se&&(e.preventDefault(),at.toggleDropdown()),e.key===`Backspace`&&ht.length===0&&ut.length>0&&(Ue?.(ut[ut.length-1]),dt(ut.slice(0,ut.length-1))),mt(e))},St=ut.map((e,t)=>{let n=rt[`${e}`]||it.current[`${e}`],r=ft(t);return He?(0,H.jsx)(V.Fragment,{children:He({option:n,value:e,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},disabled:I,reorderProps:r})},`${e}-${t}`):(0,H.jsx)(_r,{withRemoveButton:!F&&!rt[`${e}`]?.disabled,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},unstyled:l,disabled:I,...vt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,V.useEffect)(()=>{S&&at.selectFirstOption()},[S,ht]),(0,V.useEffect)(()=>{ut.forEach(e=>{`${e}`in rt&&(it.current[`${e}`]=rt[`${e}`])})},[rt,ut]);let Ct=(0,H.jsx)(qn.ClearButton,{...Fe,onClear:()=>{We?.(),dt([]),_t(``)}}),wt=Tr({data:nt,value:ut}),Tt=Ne&&ut.length>0&&!I&&!F,Et=Tt?{paddingInlineEnd:Er[d]??Er.sm}:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:at,classNames:yt,styles:bt,unstyled:l,size:d,readOnly:F,__staticSelector:`MultiSelect`,attributes:Je,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Ye&&_t(``),at.updateSelectedOptionIndex(`selected`),ut.includes(rt[`${e}`].value)?(dt(ut.filter(t=>t!==rt[`${e}`].value)),Ue?.(rt[`${e}`].value)):ut.lengthSe?at.openDropdown():at.toggleDropdown(),"data-expanded":at.dropdownOpened||void 0,id:tt,required:ze,mod:Be,attributes:Je,children:(0,H.jsxs)(_r.Group,{attributes:Je,disabled:I,unstyled:l,...vt(`pillsList`,{style:Et}),...pt(),children:[St,(0,H.jsx)(qn.EventsTarget,{autoComplete:ct,withExpandedAttribute:!0,children:(0,H.jsx)(Sr.Field,{...lt,id:tt,placeholder:Le,type:!Se&&!Le?`hidden`:`visible`,...vt(`inputField`),unstyled:l,onFocus:e=>{L?.(e),Xe&&Se&&at.openDropdown()},onBlur:e=>{te?.(e),at.closeDropdown(),_t(``)},onKeyDown:xt,value:ht,onChange:e=>{if(lr(e)){if(!F){let t=Cr(rt,e.currentTarget.value);t&&!ut.includes(t.value)&&ut.length{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ProgressLabel`,null,e),l=Ar();return(0,H.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...c})});Mr.classes=jr,Mr.displayName=`@mantine/core/ProgressLabel`;var Nr=f((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":k(t,`progress-size`),"--progress-radius":n===void 0?void 0:L(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pr=d(n=>{let r=o(`ProgressRoot`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=r,_=e({name:`Progress`,classes:jr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:Nr});return(0,H.jsx)(kr,{value:{getStyles:_,autoContrast:d},children:(0,H.jsx)(t,{mod:[{orientation:p},h],..._(`root`),...g})})});Pr.classes=jr,Pr.varsResolver=Nr,Pr.displayName=`@mantine/core/ProgressRoot`;var Fr={withAria:!0},Ir=d(e=>{let{classNames:n,className:r,style:i,styles:s,vars:l,value:u,withAria:d,color:f,striped:p,animated:m,mod:h,...g}=o(`ProgressSection`,Fr,e),_=Ar(),v=c(),y=d?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,"aria-valuetext":`${u}%`}:{};return(0,H.jsx)(t,{..._.getStyles(`section`,{className:r,classNames:n,styles:s,style:i}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${u}%`,"--progress-section-color":a(f,v),"--progress-label-color":Xt(_.autoContrast,v)?Te({color:f,theme:v,autoContrast:_.autoContrast}):void 0}})});Ir.classes=jr,Ir.displayName=`@mantine/core/ProgressSection`;var Lr=d(e=>{let t=o(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:s,striped:c,animated:l,"aria-label":u,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=D({classNames:r,styles:i,props:t});return(0,H.jsx)(Pr,{classNames:f,styles:p,vars:a,...d,children:(0,H.jsx)(Ir,{value:n,color:s,striped:c,animated:l,"aria-label":u})})});Lr.classes=jr,Lr.displayName=`@mantine/core/Progress`,Lr.Section=Ir,Lr.Root=Pr,Lr.Label=Mr;var Rr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},zr={withItemsBorders:!0},Br=f((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:L(t),"--sc-color":n?a(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":k(i,`sc-padding`),"--sc-font-size":M(i)}})),Vr=i(n=>{let r=o(`SegmentedControl`,zr,n),{classNames:i,className:a,style:s,styles:l,unstyled:u,vars:d,data:f,value:p,defaultValue:m,onChange:h,size:g,name:v,disabled:y,readOnly:b,fullWidth:x,orientation:C,radius:w,color:T,transitionDuration:E,transitionTimingFunction:D,variant:O,autoContrast:k,withItemsBorders:A,mod:j,attributes:M,ref:N,...P}=r,F=e({name:`SegmentedControl`,props:r,classes:Rr,className:a,style:s,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:Br}),I=c(),L=f.map(e=>Kt(e)?{label:`${e}`,value:e}:e),te=Gt(),[ne,re]=(0,V.useState)(_()),[ie,ae]=(0,V.useState)(null),[R,oe]=(0,V.useState)({}),z=(e,t)=>{e!==null&&R[t]!==e&&(R[t]=e,oe({...R}))},[B,ce]=se({value:p,defaultValue:m,finalValue:Array.isArray(f)?L.find(e=>!e.disabled)?.value??f[0]?.value??null:null,onChange:h}),le=ee(v),ue=L.map(e=>`${e.value}`),de=L.map(e=>(0,V.createElement)(t,{...F(`control`),mod:{active:B===e.value,orientation:C},key:`${e.value}`},(0,V.createElement)(`input`,{...F(`input`),disabled:y||e.disabled,type:`radio`,name:le,value:`${e.value}`,id:`${le}-${e.value}`,checked:B===e.value,onChange:()=>!b&&ce(e.value),"data-focus-ring":I.focusRing,key:`${e.value}-input`}),(0,V.createElement)(t,{component:`label`,...F(`label`),mod:{active:B===e.value&&!(y||e.disabled),disabled:y||e.disabled,"read-only":b},htmlFor:`${le}-${e.value}`,ref:t=>z(t,`${e.value}`),__vars:{"--sc-label-color":T===void 0?void 0:Te({color:T,theme:I,autoContrast:k})},key:`${e.value}-label`},(0,H.jsx)(`span`,{...F(`innerLabel`),children:e.label})))),fe=S(N,ae);return Vt(()=>{re(_())},[f.length]),Vt(()=>{oe(e=>{let t={};return ue.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ue]),f.length===0?null:(0,H.jsxs)(t,{...F(`root`),variant:O,size:g,ref:fe,mod:[{"full-width":x,orientation:C,initialized:te,"with-items-borders":A},j],...P,role:`radiogroup`,"data-disabled":y,children:[B!==void 0&&(0,H.jsx)(tn,{target:R[`${B}`],parent:ie,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...F(`indicator`)},ne),de]})});Vr.classes=Rr,Vr.varsResolver=Br,Vr.displayName=`@mantine/core/SegmentedControl`;var Hr={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Ur=i(e=>{let t=o([`Input`,`InputWrapper`,`Select`],Hr,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,floatingHeight:k,size:j,searchable:M,rightSection:N,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:B,clearable:ce,clearSectionMode:le,clearButtonProps:ue,hiddenInputProps:de,renderOption:fe,onClear:pe,autoComplete:me,scrollAreaProps:he,__defaultRightSection:ge,__clearSection:_e,__clearable:ve,chevronColor:ye,autoSelectOnBlur:be,openOnFocus:xe,attributes:Se,...Ce}=t,we=(0,V.useMemo)(()=>hn(h),[h]),Te=(0,V.useRef)({}),Ee=(0,V.useMemo)(()=>gn(we),[we]),De=ee(B),[Oe,ke,Ae]=se({value:g,defaultValue:_,finalValue:null,onChange:m}),je=Oe==null?void 0:`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`],Me=Ut(je),[Ne,Pe,Fe]=se({value:re,defaultValue:ie,finalValue:je?je.label:``,onChange:ae}),Ie=Wn({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Ie.selectFirstOption():Ie.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Ie.resetSelectedOption,0)}}),Le=e=>{Pe(e),Ie.resetSelectedOption()},{resolvedClassNames:Re,resolvedStyles:ze}=D({props:t,styles:r,classNames:n});(0,V.useEffect)(()=>{v&&Ie.selectFirstOption()},[v,Ne]),(0,V.useEffect)(()=>{g===null&&Le(``),g!=null&&je&&(Me?.value!==je.value||Me?.label!==je.label)&&Le(je.label)},[g,je]),(0,V.useEffect)(()=>{!Ae&&!Fe&&Le(Oe==null?``:`${Oe}`in Ee?Ee[`${Oe}`]?.label:Te.current[`${Oe}`]?.label||``)},[Ee,Oe]),(0,V.useEffect)(()=>{Oe&&`${Oe}`in Ee&&(Te.current[`${Oe}`]=Ee[`${Oe}`])},[Ee,Oe]);let Be=(0,H.jsx)(qn.ClearButton,{...ue,onClear:()=>{ke(null,null),Le(``),pe?.()}}),Ve=ce&&Oe!=null&&!C&&!S;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:Ie,__staticSelector:`Select`,classNames:Re,styles:ze,unstyled:i,readOnly:S,size:j,attributes:Se,floatingHeight:k,keepMounted:be,onOptionSubmit:e=>{b?.(e);let t=R&&`${Ee[e].value}`==`${Oe}`?null:Ee[e],n=t?t.value:null;n!==Oe&&ke(n,t),!Ae&&Le(n==null?``:t?.label||``),Ie.closeDropdown()},...x,children:[(0,H.jsx)(qn.Target,{targetType:M?`input`:`button`,autoComplete:me,withExpandedAttribute:!0,children:(0,H.jsx)(A,{id:De,__defaultRightSection:(0,H.jsx)(qn.Chevron,{size:j,error:oe,unstyled:i,color:ye}),__clearSection:Be,__clearable:Ve,__clearSectionMode:le,rightSection:N,rightSectionPointerEvents:z||`none`,...Ce,size:j,__staticSelector:`Select`,disabled:C,readOnly:S||!M,value:Ne,onChange:e=>{if(lr(e)){if(!S){let t=Cr(Ee,e.currentTarget.value);t&&`${t.value}`!=`${Oe}`&&(ke(t.value,t),!Ae&&Le(t.label))}return}Le(e.currentTarget.value),Ie.openDropdown(),v&&Ie.selectFirstOption()},onFocus:e=>{xe&&M&&Ie.openDropdown(),d?.(e)},onBlur:e=>{be&&Ie.clickSelectedOption(),Ie.closeDropdown();let t=Oe!=null&&(`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`]);Le(t&&t.label||``),f?.(e)},onClick:e=>{M?Ie.openDropdown():Ie.toggleDropdown(),p?.(e)},classNames:Re,styles:ze,unstyled:i,pointer:!M,error:oe,attributes:Se})}),(0,H.jsx)(ir,{data:we,hidden:S||C,filter:w,search:Ne,limit:T,hiddenWhenEmpty:!L,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!M&&je?.label!==Ne,value:Oe,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,unstyled:i,labelId:Ce.label?`${De}-label`:void 0,"aria-label":Ce.label?void 0:Ce[`aria-label`],renderOption:fe,scrollAreaProps:he})]}),(0,H.jsx)(qn.HiddenInput,{value:Oe,name:te,form:ne,disabled:C,...de})]})});Ur.classes={...A.classes,...qn.classes},Ur.displayName=`@mantine/core/Select`;function Wr(e){if(e!==void 0)return typeof e==`number`?P(e):e}function Gr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=c(),s=t===void 0?e:t,l=r!==void 0,u=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(s)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),d=E(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(s[r])),!l&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),f=Le(E(d),o.breakpoints).filter(e=>E(d[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:d[e.value]}));return(0,H.jsx)(O,{styles:u,media:f,selector:a})}function Kr(e){return typeof e==`object`&&e?E(e):[]}function qr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return qr(Array.from(new Set([...Kr(e),...Kr(t),...r===void 0?Kr(n):[]])))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),l=Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,H.jsx)(O,{styles:c,container:d,selector:a})}var Xr={container:`m_925c2d2c`,root:`m_2415a157`},Zr={cols:1,spacing:`md`,type:`media`},Qr=d(n=>{let i=o(`SimpleGrid`,Zr,n),{classNames:a,className:s,style:c,styles:l,unstyled:u,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=i,x=e({name:`SimpleGrid`,classes:Xr,props:i,className:s,style:c,classNames:a,styles:l,unstyled:u,attributes:y,vars:d}),S=r(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yr,{...i,selector:`.${S}`}),(0,H.jsx)(`div`,{...x(`container`),children:(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gr,{...i,selector:`.${S}`}),(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});Qr.classes=Xr,Qr.displayName=`@mantine/core/SimpleGrid`;var $r=(0,V.createContext)(null),ei={hiddenInputValuesSeparator:`,`},ti=i((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:s,readOnly:c,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=o(`SwitchGroup`,ei,e),[h,g]=se({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(c)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(u);return(0,H.jsx)($r,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,H.jsxs)(T.Wrapper,{size:i,...a,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,H.jsx)(Jn,{role:`group`,children:s}),(0,H.jsx)(`input`,{type:`hidden`,name:l,value:y,...d})]})})}));ti.classes=T.Wrapper.classes,ti.displayName=`@mantine/core/SwitchGroup`;var ni={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ri={labelPosition:`right`,withThumbIndicator:!0},ii=f((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:L(t),"--switch-height":k(r,`switch-height`),"--switch-width":k(r,`switch-width`),"--switch-thumb-size":k(r,`switch-thumb-size`),"--switch-label-font-size":k(r,`switch-label-font-size`),"--switch-track-label-padding":k(r,`switch-track-label-padding`),"--switch-color":n?a(n,e):void 0}})),ai=d(n=>{let r=o(`Switch`,ri,n),{classNames:i,className:a,style:c,styles:l,unstyled:u,vars:d,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=r,P=(0,V.use)($r),F=_||P?.size,I=e({name:`Switch`,props:r,classes:ni,className:a,style:c,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:ii}),{styleProps:L,rest:te}=s(N),ne=ee(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=se({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,H.jsxs)(Zn,{...I(`root`),__staticSelector:`Switch`,__stylesApiProps:r,id:ne,size:F,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:i,styles:l,unstyled:u,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...L,...y,children:[(0,H.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...I(`input`)}),(0,H.jsxs)(t,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...I(`track`),children:[(0,H.jsx)(t,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...I(`thumb`),children:b}),(0,H.jsx)(`span`,{...I(`trackLabel`),children:R?h:m})]})]})});ai.classes={...ni,...Xn},ai.varsResolver=ii,ai.displayName=`@mantine/core/Switch`,ai.Group=ti;var oi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),si=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),ci=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),li=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),ui=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),di=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),fi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),pi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),hi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),gi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),_i=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),vi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),yi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:oi}));yi.displayName=`ArrowClockwiseIcon`;var bi=yi,xi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:si}));xi.displayName=`ArrowCounterClockwiseIcon`;var Si=xi,Ci=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ci}));Ci.displayName=`ArrowsOutIcon`;var wi=Ci,Ti=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:li}));Ti.displayName=`CaretUpIcon`;var Ei=Ti,Di=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ui}));Di.displayName=`ChatCircleTextIcon`;var Oi=Di,ki=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:di}));ki.displayName=`ClockIcon`;var Ai=ki,ji=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:fi}));ji.displayName=`ClockCounterClockwiseIcon`;var Mi=ji,Ni=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:pi}));Ni.displayName=`InfoIcon`;var Pi=Ni,Fi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:mi}));Fi.displayName=`KeyboardIcon`;var Ii=Fi,Li=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:hi}));Li.displayName=`ListBulletsIcon`;var Ri=Li,zi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:gi}));zi.displayName=`ListMagnifyingGlassIcon`;var Bi=zi,Vi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:_i}));Vi.displayName=`MagnifyingGlassMinusIcon`;var Hi=Vi,Ui=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:vi}));Ui.displayName=`WrenchIcon`;var Wi=Ui,Gi=n(z(),1),Ki=`$__all`;function qi(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ji(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Yi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=qi(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Ji(r,u,s[0]),f=Ji(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Xi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=qi(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=$i(d,0,s-r),f=$i(f,0,l-i),{x:d,y:f}}function Zi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=qi(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Qi(e,t,n){let{margin:r,rowHeight:i}=e,a=qi(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function $i(e,t,n){return Math.max(Math.min(e,n),t)}function ea(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ta(e,t){for(let n=0;nea(e,t))}function ra(e,t){return t===`horizontal`?aa(e):t===`vertical`||t===`wrap`?ia(e):[...e]}function ia(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function aa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function oa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function sa(e,t){for(let n=0;ne.static===!0)}function la(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ua(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;ta(n,i);)i.y++}}return e}function ma(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=ra(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=na(d,t),p=f.length>0;if(p&&c)return ua(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ma(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ma(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return ma(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ma(e,n,l,u,r,c,i)}function ga(e,t,n){return Math.max(t,Math.min(n,e))}var _a=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:ga(t,0,Math.max(0,r-e.w)),y:ga(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:ga(t,1,Math.max(1,o)),h:ga(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:ga(t,e.minW??1,e.maxW??1/0),h:ga(n,e.minH??1,e.maxH??1/0)}}}];function va(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ya(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ba({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function xa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Sa(e){return e*100+`%`}function Ca(e,t,n,r){return e+n>r?t:n}function wa(e,t,n){return e<0?t:n}function Ta(e){return Math.max(0,e)}function Ea(e){return Math.max(0,e)}var Da=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:wa(o,e.height,i),top:Ea(o)}},Oa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Ca(e.left,e.width,o,n),left:Ta(i)}},ka=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Ea(r),left:0}:{height:i,width:a,top:Ea(r),left:o}},Aa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:wa(r,e.height,a),top:Ea(r)}},ja={n:Da,ne:(e,t,n)=>Da(e,Oa(e,t,n)),e:Oa,se:(e,t,n)=>Aa(e,Oa(e,t,n)),s:Aa,sw:(e,t,n)=>Aa(e,ka(e,t)),w:ka,nw:(e,t,n)=>Da(e,ka(e,t))};function Ma(e,t,n,r){let i=ja[e];return i?i(t,{...t,...n},r):n}var Na={type:`transform`,scale:1,calcStyle(e){return ba(e)}},Pa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Fa={enabled:!0,bounded:!1,threshold:3},Ia={enabled:!0,handles:[`se`]},La={enabled:!1,defaultItem:{w:1,h:1}};function Ra(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??ca(e).length>0;for(let i=o+1;it.y+t.h)break;ea(t,o)&&Ra(e,o,n+t[a],r,s)}}t[r]=n}function za(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!ta(e,t);)t.y--;let i;for(;(i=ta(e,t))!==void 0;)Ra(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Ba(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!ta(e,t);)t.x--;let i;for(;(i=ta(e,t))!==void 0;)if(Ra(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!ta(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Va={type:`vertical`,allowOverlap:!1,compact(e,t){let n=ca(e),r=oa(n),i=ia(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ya(e,t){let n=Ja(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Xa(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Za(e,t,n,r,i,a){let o=e[n];if(o)return ua(o);let s=e[r],c=Ja(t),l=c.slice(c.indexOf(n));for(let t=0;t{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),eo=R(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),to=R(((e,t)=>{var n=eo();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),no=R(((e,t)=>{t.exports=to()()})),ro=n(no(),1);function io(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&io(e.changedTouches,e=>t===e.identifier)}function ko(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ao(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function jo(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ao();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&Po(e.body,`react-draggable-transparent-selection`)}function Mo(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{No(e)}):No(e)}function No(e){if(e)try{e.body&&Fo(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function Po(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Fo(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Io(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Uo(r);let i=Wo(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+so(s.paddingLeft)+so(o.marginLeft),top:-i.offsetTop+so(s.paddingTop)+so(o.marginTop),right:Co(a)-xo(i)-i.offsetLeft+so(s.paddingRight)-so(o.marginRight),bottom:So(a)-bo(i)-i.offsetTop+so(s.paddingBottom)-so(o.marginBottom)}}return oo(r.right)&&(t=Math.min(t,r.right)),oo(r.bottom)&&(n=Math.min(n,r.bottom)),oo(r.left)&&(t=Math.max(t,r.left)),oo(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Lo(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ro(e){return e.props.axis===`both`||e.props.axis===`x`}function zo(e){return e.props.axis===`both`||e.props.axis===`y`}function Bo(e,t,n){let r=typeof t==`number`?Oo(e,t):null;if(typeof t==`number`&&!r)return null;let i=Wo(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return wo(r||e,a,n.props.scale)}function Vo(e,t,n){let r=!oo(e.lastX),i=Wo(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ho(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Uo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Wo(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Go=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ko={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},qo=Ko.mouse,Jo=class extends V.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!_o(e.target,this.props.handle,t)||this.props.cancel&&_o(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ko(e);this.touchIdentifier=r;let i=Bo(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Vo(this,a,o);Go(`DraggableCore: handleDragStart: %j`,s),Go(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&jo(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,vo(n,qo.move,this.handleDrag),vo(n,qo.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Lo(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(Go(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Lo(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Mo(a.ownerDocument),Go(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Go(`DraggableCore: Removing handlers`),yo(a.ownerDocument,qo.move,this.handleDrag),yo(a.ownerDocument,qo.stop,this.handleDragStop))},this.onMouseDown=e=>(qo=Ko.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(qo=Ko.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(qo=Ko.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(qo=Ko.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&vo(e,Ko.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;yo(t,Ko.mouse.move,this.handleDrag),yo(t,Ko.touch.move,this.handleDrag),yo(t,Ko.mouse.stop,this.handleDragStop),yo(t,Ko.touch.stop,this.handleDragStop),yo(e,Ko.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Mo(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Go(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return V.cloneElement(V.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Jo.displayName=`DraggableCore`,Jo.propTypes={allowAnyClick:ro.default.bool,allowMobileScroll:ro.default.bool,children:ro.default.node.isRequired,disabled:ro.default.bool,enableUserSelectHack:ro.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:ro.default.arrayOf(ro.default.number),handle:ro.default.string,cancel:ro.default.string,nodeRef:ro.default.object,nonce:ro.default.string,onStart:ro.default.func,onDrag:ro.default.func,onStop:ro.default.func,onMouseDown:ro.default.func,scale:ro.default.number,className:co,style:co,transform:co},Jo.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Yo=class extends V.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Go(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Ho(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Go(`Draggable: onDrag: %j`,t);let n=Ho(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Io(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,Ho(this,t))===!1)return!1;Go(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Go(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,m=!s||this.state.dragging,h=s||r,g={x:Ro(this)&&m?this.state.x:h.x,y:zo(this)&&m?this.state.y:h.y};this.state.isElementSVG?f=Eo(g,c):d=To(g,c);let _=V.Children.only(n),v=p(_.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return V.createElement(Jo,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},V.cloneElement(_,{className:v,style:{..._.props.style,...d},transform:f}))}};Yo.displayName=`Draggable`,Yo.propTypes={...Jo.propTypes,axis:ro.default.oneOf([`both`,`x`,`y`,`none`]),bounds:ro.default.oneOfType([ro.default.shape({left:ro.default.number,right:ro.default.number,top:ro.default.number,bottom:ro.default.number}),ro.default.string,ro.default.oneOf([!1])]),defaultClassName:ro.default.string,defaultClassNameDragging:ro.default.string,defaultClassNameDragged:ro.default.string,defaultPosition:ro.default.shape({x:ro.default.number,y:ro.default.number}),positionOffset:ro.default.shape({x:ro.default.oneOfType([ro.default.number,ro.default.string]),y:ro.default.oneOfType([ro.default.number,ro.default.string])}),position:ro.default.shape({x:ro.default.number,y:ro.default.number}),className:co,style:co,transform:co},Yo.defaultProps={...Jo.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Xo=R(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>we,default:()=>Te}),t.exports=d(f);var p=u(v()),m=u(no()),h=u(z()),g=Xo();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function ie(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ae(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function R(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??ae();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} diff --git a/internal/ui/dist/assets/settings-WD83lfky.js b/internal/ui/dist/assets/settings-Civ3-rvD.js similarity index 99% rename from internal/ui/dist/assets/settings-WD83lfky.js rename to internal/ui/dist/assets/settings-Civ3-rvD.js index 116a70521..5d5fe4a7b 100644 --- a/internal/ui/dist/assets/settings-WD83lfky.js +++ b/internal/ui/dist/assets/settings-Civ3-rvD.js @@ -1,4 +1,4 @@ -import{C as e,Ct as t,M as n,_ as r,a as i,bt as a,c as o,d as s,f as c,i as l,o as u,p as d,r as f,vt as p,x as m,y as h}from"./brand-oskFJPNW.js";import{c as g,i as _,r as v,s as y}from"./auth-CQerCjF_.js";import{t as b}from"./Tooltip-2jTVpG2Y.js";import{E as x,T as S,t as C}from"./useQuery-BynlWFEG.js";import{n as w,r as T,t as E}from"./WarningCircle.es-CsY2RrOb.js";import{i as D,r as O}from"./index-Nz8e3wJG.js";var k=t(a(),1);function A(e={}){let t=e.timeout??2e3,[n,r]=(0,k.useState)(null),[i,a]=(0,k.useState)(!1),o=(0,k.useRef)(null);(0,k.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]);let s=e=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),s(!0)}).catch(e=>r(e)):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{a(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}var j=p(),M={timeout:1e3};function N(e){let{children:t,timeout:r,value:i,...a}=n(`CopyButton`,M,e),o=A({timeout:r});return(0,j.jsx)(j.Fragment,{children:t({copy:()=>o.copy(i),copied:o.copied,...a})})}N.displayName=`@mantine/core/CopyButton`;var P=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),F=k.forwardRef((e,t)=>k.createElement(i,{ref:t,...e,weights:P}));F.displayName=`ArrowsClockwiseIcon`;var I=F,L=[`settings`,`ingest`];function R(e,t){let n=e.trim();return t||/^https:\/\//i.test(n)||/:443$/.test(n)}function z(e,t,n){if(/^https?:\/\//i.test(e.trim()))try{let t=new URL(e);e=`${t.protocol}//${t.hostname}:${t.port||(t.protocol===`https:`?`443`:`80`)}`}catch{}let r=R(e,n)?``:` +import{C as e,Ct as t,M as n,_ as r,a as i,bt as a,c as o,d as s,f as c,i as l,o as u,p as d,r as f,vt as p,x as m,y as h}from"./brand-oskFJPNW.js";import{c as g,i as _,r as v,s as y}from"./auth-CQerCjF_.js";import{t as b}from"./Tooltip-2jTVpG2Y.js";import{E as x,T as S,t as C}from"./useQuery-BynlWFEG.js";import{n as w,r as T,t as E}from"./WarningCircle.es-CsY2RrOb.js";import{i as D,r as O}from"./index-G9N3n5OB.js";var k=t(a(),1);function A(e={}){let t=e.timeout??2e3,[n,r]=(0,k.useState)(null),[i,a]=(0,k.useState)(!1),o=(0,k.useRef)(null);(0,k.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]);let s=e=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),s(!0)}).catch(e=>r(e)):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{a(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}var j=p(),M={timeout:1e3};function N(e){let{children:t,timeout:r,value:i,...a}=n(`CopyButton`,M,e),o=A({timeout:r});return(0,j.jsx)(j.Fragment,{children:t({copy:()=>o.copy(i),copied:o.copied,...a})})}N.displayName=`@mantine/core/CopyButton`;var P=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),F=k.forwardRef((e,t)=>k.createElement(i,{ref:t,...e,weights:P}));F.displayName=`ArrowsClockwiseIcon`;var I=F,L=[`settings`,`ingest`];function R(e,t){let n=e.trim();return t||/^https:\/\//i.test(n)||/:443$/.test(n)}function z(e,t,n){if(/^https?:\/\//i.test(e.trim()))try{let t=new URL(e);e=`${t.protocol}//${t.hostname}:${t.port||(t.protocol===`https:`?`443`:`80`)}`}catch{}let r=R(e,n)?``:` tls: insecure: true`;return`exporters: otlp/fanout: diff --git a/internal/ui/dist/assets/theme-C7oNnx5z.js b/internal/ui/dist/assets/theme-BKAYKhPv.js similarity index 87% rename from internal/ui/dist/assets/theme-C7oNnx5z.js rename to internal/ui/dist/assets/theme-BKAYKhPv.js index 334e728ff..322da032f 100644 --- a/internal/ui/dist/assets/theme-C7oNnx5z.js +++ b/internal/ui/dist/assets/theme-BKAYKhPv.js @@ -1 +1 @@ -import{A as e,C as t,Ct as n,G as r,J as i,M as a,P as o,S as s,T as c,X as l,Y as u,a as d,b as f,bt as p,ct as m,et as h,gt as g,h as _,j as v,lt as y,nt as b,pt as x,q as S,rt as C,st as w,tt as T,vt as E,w as D,z as O}from"./brand-oskFJPNW.js";import{d as k,f as A,i as ee,l as j,o as M}from"./auth-CQerCjF_.js";import{B as te,C as ne,I as re,g as N,h as P,v as ie,w as ae}from"./preload-helper-DOsq4iEA.js";import{n as oe,t as F}from"./get-single-element-child-D7qmWU2f.js";import{C as se,E as I,T as L,_ as ce,a as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,l as ge,m as _e,n as ve,o as ye,p as be,r as xe,s as Se,u as Ce,v as we,x as R,y as Te}from"./Tooltip-2jTVpG2Y.js";import{r as Ee}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{A as De,D as Oe,I as ke,M as Ae,N as z,O as je,P as Me,R as Ne,j as Pe,k as Fe}from"./useQuery-BynlWFEG.js";import{t as Ie}from"./FocusTrap-yVpiEwpv.js";function Le(){throw Error(`Invariant failed`)}var Re=`__root__`;function ze(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Be(e){return e instanceof Response&&!!e.options}var Ve=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Re:this.parentRoute||Le();let r=n?Re:t?.path;r&&r!==`/`&&(r=ne(r));let i=t?.id||r,a=n?Re:ie((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:ie(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ae(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ze({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},He=class extends Ve{constructor(e){super(e)}},B=n(p(),1),Ue=B.createContext(void 0),We=B.createContext(void 0);function Ge({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ke(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var qe=[],Je=0,{link:Ye,unlink:Xe,propagate:Ze,checkDirty:Qe,shallowPropagate:$e}=Ge({update(e){return e._update()},notify(e){qe[tt++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,it(e))}}),et=0,tt=0,V,nt=0;function rt(e){try{++nt,e()}finally{--nt||at()}}function it(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Xe(n,e)}function at(){if(!(nt>0)){for(;et{i.get(),n.current?(V=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=V,o=t?.compare??Object.is;if(n)V=i,++Je,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{V=a,n&&(i.flags&=-5),it(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Qe(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&$e(e)}}else e&32&&(i.flags=e&-33);return V!==void 0&&Ye(i,V,Je),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ze(e),$e(e),at())}},i}function st(e){let t=()=>{let t=V;V=n,++Je,n.depsTail=void 0,n.flags=6;try{return e()}finally{V=t,n.flags&=-5,it(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Qe(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,it(this)}};return t(),n}var ct={};function lt(e,t){let n=B.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=te(n.current,i):i}}function H(e){let t=g(),n=B.useContext(e.from?We:Ue),r=e.from??n,i=t.stores.getMatchStore(r),a=lt(e,t),o=N(i,e=>e?a(e):ct);if(o!==ct)return o;(e.shouldThrow??!0)&&Le()}function ut(e){return H({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function dt(e){let{select:t,...n}=e;return H({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ft(e){return H({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function pt(e){return H({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mt(e){return H({...e,select:t=>e.select?e.select(t.context):t.context})}var U=E(),ht=class extends Ve{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function gt(e){return new ht(e)}var _t=class extends He{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function vt(e){return new _t(e)}function yt(e){return e=>{let t=gt(e);return t.isRoot=!1,t}}function bt(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(re(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(A)A(a());else throw a()}return B.createElement(r,e)};return o.preload=a,o}function xt(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function St(e){let t=xt(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function wt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function Tt(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(Ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Et(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=Tt(l,c,r),d=wt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[Tt(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[wt(c.length,c,!1)]?.focus()}}}function Ot(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Ee:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function W(e,t){return n=>{e?.(n),t?.(n)}}function kt(e,t){return e in t?St(t[e]):St(e)}function At(e,t){let n=e.map(e=>({value:e,px:kt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function jt(e,t,n){return n?Array.from(Ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Mt=[`mousedown`,`touchstart`];function Nt(e,t,n,r=!0,i=!1){let a=(0,B.useRef)(null),o=t||Mt,s=(0,B.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let i=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!i.includes(e))&&e(t):a.current&&!i.includes(a.current)&&e(t)}),c=o.join(`,`);return(0,B.useEffect)(()=>{if(!r)return;let e=c.split(`,`);return e.forEach(e=>document.addEventListener(e,s,i)),()=>{e.forEach(e=>document.removeEventListener(e,s,i))}},[c,r,i]),a}var Pt=[`mouse`,`touch`],Ft=10;function It(e,t={}){let{threshold:n=400,events:r=Pt,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,B.useRef)(!1),l=(0,B.useRef)(!1),u=(0,B.useRef)(-1),d=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>window.clearTimeout(u.current),[]);let f=r.join(`,`);return(0,B.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?Ft:i===!1?0:i,p=t=>{(zt(t)||Rt(t))&&(a&&a(t),d.current=Lt(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(zt(e)||Rt(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=Lt(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,f])}function Lt(e){if(Rt(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Rt(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function zt(e){return e.nativeEvent instanceof MouseEvent}function Bt({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&S({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Vt(e,t,n){return Bt({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function Ht(e,t){let n=e.colors[e.primaryColor];return r(n)?e.autoContrast?Vt(n,e,t):`var(--mantine-color-white)`:Bt({color:n[i(e,t)],theme:e,autoContrast:null})}function Ut({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,B.useRef)(-1),a=(0,B.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,B.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[Wt,Gt]=I(`Popover component was not found in the tree`);function Kt({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,B.useRef)(!1),s=(0,B.useRef)(!1),c=(0,B.useRef)(null),l=(0,B.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=W(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=W(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=It(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:W(e.onTouchStart,p.onTouchStart),onTouchEnd:W(e.onTouchEnd,p.onTouchEnd),onTouchCancel:W(e.onTouchCancel,p.onTouchCancel),onTouchMove:W(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function qt(e){let{children:t,disabled:n,longPressDelay:r}=a(`PopoverContextMenu`,null,e),i=F(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Gt(),s=Kt({childProps:i.props,disabled:n||o.disabled,opened:o.opened,longPressDelay:r,setReference:o.reference,open:()=>{o.opened||o.onToggle()}});return(0,B.cloneElement)(i,s)}qt.displayName=`@mantine/core/PopoverContextMenu`;var Jt={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Yt=c(e=>{let n=a(`PopoverDropdown`,null,e),{className:r,style:i,vars:o,children:s,onKeyDownCapture:c,variant:l,classNames:u,styles:d,ref:p,...m}=n,g=Gt(),{dir:_}=R(),v=g.arrowPosition===`merge`&&g.withArrow?le({position:g.placement,dir:_}):void 0,y=Ne({opened:g.opened,shouldReturnFocus:g.returnFocus}),b=g.withRoles?{"aria-labelledby":g.getTargetId(),id:g.getDropdownId(),role:`dialog`,tabIndex:-1}:{},S=h(p,g.floating);return g.disabled?null:(0,U.jsx)(ve,{...g.portalProps,withinPortal:g.withinPortal,children:(0,U.jsx)(f,{mounted:g.opened,...g.transitionProps,transition:g.transitionProps?.transition||`fade`,duration:g.transitionProps?.duration??150,keepMounted:g.keepMounted,keepMountedMode:g.keepMountedMode,exitDuration:typeof g.transitionProps?.exitDuration==`number`?g.transitionProps.exitDuration:g.transitionProps?.duration,children:e=>(0,U.jsx)(Ie,{active:g.trapFocus&&g.opened,innerRef:S,children:(0,U.jsxs)(t,{...b,...m,variant:l,onKeyDownCapture:Ot(()=>{g.onClose?.(),g.onDismiss?.()},{active:g.closeOnEscape,onTrigger:y,onKeyDown:c}),"data-position":g.placement,"data-fixed":g.floatingStrategy===`fixed`||void 0,...g.getStyles(`dropdown`,{className:r,props:n,classNames:u,styles:d,style:[{...e,...v,zIndex:g.zIndex,top:g.y??0,left:g.x??0,width:g.width===`target`?void 0:x(g.width),...g.referenceHidden?{display:`none`}:null},g.resolvedStyles?.dropdown,d?.dropdown,i]}),children:[s,(0,U.jsx)(he,{ref:g.arrowRef,arrowX:g.arrowX,arrowY:g.arrowY,visible:g.withArrow,position:g.placement,arrowSize:g.arrowSize,arrowRadius:g.arrowRadius,arrowOffset:g.arrowOffset,arrowPosition:g.arrowPosition,...g.getStyles(`arrow`,{props:n,classNames:u,styles:d})})]})})})})});Yt.classes=Jt,Yt.displayName=`@mantine/core/PopoverDropdown`;var Xt={refProp:`ref`,popupType:`dialog`},Zt=c(e=>{let{children:t,refProp:n,popupType:r,ref:i,...o}=a(`PopoverTarget`,Xt,e),s=F(t);if(!s)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let c=o,l=Gt(),d=h(l.reference,se(s),i),f=l.withRoles?{"aria-haspopup":r,"aria-expanded":l.opened,"aria-controls":l.opened?l.getDropdownId():void 0,id:l.getTargetId()}:{},p=s.props;return(0,B.cloneElement)(s,{...c,...f,...l.targetProps,className:u(l.targetProps.className,c.className,p.className),[n]:d,...l.controlled?null:{onClick:e=>{l.onToggle(),p.onClick?.(e)}}})});Zt.displayName=`@mantine/core/PopoverTarget`;function Qt(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function $t(e,t,n,r){let i=Qt(e.middlewares),a=[pe(e.offset),be()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(fe(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(ce(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:me(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?_e():_e(i.inline)),a.push(de({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(we({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function en(e){let[t,n]=j({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,B.useRef)(t),i=(0,B.useRef)(!1),[a,o]=(0,B.useState)(null),s=e.preventPositionChangeWhenVisible!==!1,c=(0,B.useRef)(t);t!==c.current&&(c.current=t,t&&a!==null&&o(null));let l=(0,B.useRef)(e.position);e.position!==l.current&&(l.current=e.position,i.current=!1,a!==null&&o(null));let u=(0,B.useCallback)(()=>o(null),[]),d=()=>{t&&!e.disabled&&n(!1)},f=()=>{e.disabled||n(!t)},p=ue({open:t,strategy:e.strategy,placement:s?a??e.position:e.position,middleware:$t(e,()=>p,s&&a!==null,s),whileElementsMounted:e.keepMounted?void 0:Te});(0,B.useEffect)(()=>{if(!e.keepMounted)return;let n=p.refs.reference.current,r=p.refs.floating.current;if(t&&n&&r)return Te(n,r,p.update)},[e.keepMounted,t,p.update,p.elements.reference,p.elements.floating]),C(()=>{if(!t){i.current=!1;return}if(!s||a!==null)return;let e=p.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!i.current){i.current=!0,p.update();return}p.isPositioned&&o(p.placement)}},[s,t,p.isPositioned,p.placement,a,p.update]);let m=(0,B.useRef)(p.placement);return C(()=>{m.current!==p.placement&&(m.current=p.placement,e.onPositionChange?.(p.placement))},[p.placement]),b(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:p,controlled:typeof e.opened==`boolean`,opened:t,onClose:d,onToggle:f,resetLockedPlacement:u}}var tn={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:L(`popover`),__staticSelector:`Popover`,width:`max-content`},nn=l((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:w(t),"--popover-shadow":m(n)}}));function G(t){let n=a(`Popover`,tn,t),{children:r,position:i,offset:o,onPositionChange:s,opened:c,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:p,middlewares:m,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,unstyled:x,classNames:S,styles:C,closeOnClickOutside:w,withinPortal:E,portalProps:D,closeOnEscape:k,clickOutsideEvents:A,trapFocus:ee,onClose:j,onDismiss:M,onOpen:te,onChange:ne,zIndex:re,radius:N,shadow:P,id:ie,defaultOpened:ae,__staticSelector:oe,withRoles:F,disabled:se,returnFocus:I,variant:L,keepMounted:ce,keepMountedMode:le,vars:ue,floatingStrategy:de,withOverlay:fe,overlayProps:pe,hideDetached:me,attributes:he,preventPositionChangeWhenVisible:ge,..._e}=n,ye=e({name:oe,props:n,classes:Jt,classNames:S,styles:C,unstyled:x,attributes:he,rootSelector:`dropdown`,vars:ue,varsResolver:nn}),{resolvedStyles:be}=v({classNames:S,styles:C,props:n}),Se=(0,B.useRef)(null),[Ce,we]=(0,B.useState)(null),[Te,Ee]=(0,B.useState)(null),{dir:De}=R(),Oe=O(),Ae=T(ie),z=en({middlewares:m,width:p,position:xe(De,i),offset:typeof o==`number`?o+(h?g/2:0):o,arrowRef:Se,arrowOffset:_,onPositionChange:s,opened:c,defaultOpened:ae,onChange:ne,onOpen:te,onClose:j,onDismiss:M,strategy:de,disabled:se,preventPositionChangeWhenVisible:ge,keepMounted:ce});Nt(()=>{w&&(z.onClose(),M?.())},A,[Ce,Te]);let je=(0,B.useCallback)(e=>{we(e),z.floating.refs.setReference(e)},[z.floating.refs.setReference]),Me=(0,B.useCallback)(e=>{Ee(e),z.floating.refs.setFloating(e)},[z.floating.refs.setFloating]),Ne=(0,B.useCallback)(()=>{l?.onExited?.(),u?.(),z.resetLockedPlacement()},[l?.onExited,u,z.resetLockedPlacement]),Pe=(0,B.useCallback)(()=>{l?.onEntered?.(),d?.()},[l?.onEntered,d]);return(0,U.jsxs)(Wt,{value:{returnFocus:I,disabled:se,controlled:z.controlled,reference:je,floating:Me,x:z.floating.x,y:z.floating.y,arrowX:z.floating?.middlewareData?.arrow?.x,arrowY:z.floating?.middlewareData?.arrow?.y,opened:z.opened,arrowRef:Se,transitionProps:{...l,onExited:Ne,onEntered:Pe},width:p,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,placement:z.floating.placement,trapFocus:ee,withinPortal:E,portalProps:D,zIndex:re,radius:N,shadow:P,closeOnEscape:k,onDismiss:M,onClose:z.onClose,onToggle:z.onToggle,getTargetId:()=>Ae,getDropdownId:()=>`${Ae}-dropdown`,withRoles:F,targetProps:_e,__staticSelector:oe,classNames:S,styles:C,unstyled:x,variant:L,keepMounted:ce,keepMountedMode:le,getStyles:ye,resolvedStyles:be,floatingStrategy:de,referenceHidden:me&&Oe!==`test`?z.floating.middlewareData.hide?.referenceHidden:!1},children:[r,fe&&(0,U.jsx)(f,{transition:`fade`,mounted:z.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:e=>(0,U.jsx)(ve,{withinPortal:E,children:(0,U.jsx)(ke,{...pe,...ye(`overlay`,{className:pe?.className,style:[e,pe?.style]})})})})]})}G.Target=Zt,G.Dropdown=Yt,G.ContextMenu=qt,G.varsResolver=nn,G.displayName=`@mantine/core/Popover`,G.extend=e=>e,G.withProps=e=>{let t=t=>(0,U.jsx)(G,{...e,...t});return t.extend=G.extend,t.displayName=`WithProps(${G.displayName})`,t};function rn({style:e,size:t=16,...n}){return(0,U.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:x(t),height:x(t),display:`block`},...n,children:(0,U.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}rn.displayName=`@mantine/core/AccordionChevron`;function an({size:e,style:t,...n}){let r=e===void 0?t:{width:x(e),height:x(e),...t};return(0,U.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,U.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var[on,K]=I(`Drawer component was not found in tree`),q={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},sn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerBody`,null,e),c=K();return(0,U.jsx)(z,{...c.getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...s})});sn.classes=q,sn.displayName=`@mantine/core/DrawerBody`;var cn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerCloseButton`,null,e),c=K();return(0,U.jsx)(Ae,{...c.getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...s})});cn.classes=q,cn.displayName=`@mantine/core/DrawerCloseButton`;var ln=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,radius:c,__hidden:l,...u}=a(`DrawerContent`,null,e),d=K(),f=d.scrollAreaComponent||Oe;return(0,U.jsx)(Pe,{...d.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:d.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...u,radius:c||d.radius||0,"data-hidden":l||void 0,children:(0,U.jsx)(f,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:s})})});ln.classes=q,ln.displayName=`@mantine/core/DrawerContent`;var un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerHeader`,null,e),c=K();return(0,U.jsx)(De,{...c.getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...s})});un.classes=q,un.displayName=`@mantine/core/DrawerHeader`;var dn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerOverlay`,null,e),c=K();return(0,U.jsx)(Fe,{...c.getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...s})});dn.classes=q,dn.displayName=`@mantine/core/DrawerOverlay`;function fn(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function pn(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var mn={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},hn={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},gn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),position:`left`},_n=l((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":y(n,`drawer-size`),"--drawer-flex":pn(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":fn(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":x(r)}})),vn=c(t=>{let n=a(`DrawerRoot`,gn,t),{classNames:r,className:i,style:o,styles:s,unstyled:c,vars:l,scrollAreaComponent:u,position:d,transitionProps:f,radius:p,attributes:m,...h}=n,{dir:g}=R(),_=e({name:`Drawer`,classes:q,props:n,className:i,style:o,classNames:r,styles:s,unstyled:c,attributes:m,vars:l,varsResolver:_n}),v=(g===`rtl`?hn:mn)[d];return(0,U.jsx)(on,{value:{scrollAreaComponent:u,getStyles:_,radius:p},children:(0,U.jsx)(Me,{..._(`root`),transitionProps:{transition:v,...f},"data-offset-scrollbars":u===ye.Autosize||void 0,unstyled:c,...h})})});vn.classes=q,vn.varsResolver=_n,vn.displayName=`@mantine/core/DrawerRoot`;var yn=(0,B.createContext)(null);function bn({children:e}){let[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(L(`modal`)),[a]=(0,B.useState)(()=>new WeakSet);return(0,U.jsx)(yn,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r,handledEscapeEvents:a},children:e})}bn.displayName=`@mantine/core/DrawerStack`;var xn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerTitle`,null,e),c=K();return(0,U.jsx)(je,{...c.getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...s})});xn.classes=q,xn.displayName=`@mantine/core/DrawerTitle`;var Sn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),withOverlay:!0,withCloseButton:!0},J=c(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:o,children:s,opened:c,stackId:l,zIndex:u,...d}=a(`Drawer`,Sn,e),f=(0,B.use)(yn),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l),__handledEscapeEvents:f.handledEscapeEvents}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,B.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||L(`modal`)):f.removeModal(l))},[c,l,u]),(0,U.jsxs)(vn,{opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,U.jsx)(dn,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,U.jsxs)(ln,{__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,U.jsxs)(un,{children:[t&&(0,U.jsx)(xn,{children:t}),i&&(0,U.jsx)(cn,{...o})]}),(0,U.jsx)(sn,{children:s})]})]})});J.classes=q,J.displayName=`@mantine/core/Drawer`,J.Root=vn,J.Overlay=dn,J.Content=ln,J.Body=sn,J.Header=un,J.Title=xn,J.CloseButton=cn,J.Stack=bn;var Cn={root:`m_dc6f14e2`},wn=l((e,{size:t})=>({root:{"--kbd-fz":y(t,`kbd-fz`)}})),Tn=c(n=>{let r=a(`Kbd`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,attributes:d,...f}=r,p=e({name:`Kbd`,classes:Cn,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:d,vars:u,varsResolver:wn});return(0,U.jsx)(t,{component:`kbd`,...p(`root`),...f})});Tn.classes=Cn,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/Kbd`;var[En,Y]=I(`Menu component was not found in the tree`),Dn=(0,B.createContext)(null);function On(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuCheckboxGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:[],onChange:r}),c=(0,B.useCallback)(e=>{s(o.includes(e)?o.filter(t=>t!==e):[...o,e])},[o,s]);return(0,U.jsx)(Dn,{value:{values:o,onChange:c},children:i})}On.displayName=`@mantine/core/MenuCheckboxGroup`;var X=(0,B.createContext)(null);function kn({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:c,children:l,disabled:u,dataDisabled:d,className:f,style:p,styles:m,classNames:g,buttonRef:_,others:v}){let y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=W(v.onClick,()=>{d||(r(),a&&y.closeDropdownImmediately())}),E=W(v.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=W(v.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())}),O=i?x.variantColorResolver({color:i,theme:x,variant:`light`}):void 0,k=i?S({color:i,theme:x}):null,A=y.alignItemsLabels!==`none`||t;return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:f,style:p,styles:m,classNames:g}),ref:h(w,_),role:e,"aria-checked":t,disabled:u,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":u||d||void 0,"data-mantine-stop-propagation":!0,onClick:T,onMouseMove:E,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[A&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:m,classNames:g}),"data-checked":t||void 0,children:t?n:null}),l&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:m,classNames:g}),"data-menu-item-label":!0,children:l}),c&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:m,classNames:g}),"data-position":`right`,children:c})]})}var Z={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},An=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,defaultChecked:h,onChange:g,checkIcon:_,ref:v,...y}=a(`MenuCheckboxItem`,null,e),b=Y(),x=(0,B.use)(Dn),S=x&&p!==void 0?x.values.includes(p):void 0,[C,w]=j({value:m??S,defaultValue:h,finalValue:!1,onChange:g}),T=_??b.checkIcon??(0,U.jsx)(an,{size:10});return(0,U.jsx)(kn,{role:`menuitemcheckbox`,checked:C,indicator:T,onSelect:()=>{g?w(!C):x&&p!==void 0?x.onChange(p):w(!C)},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:v,others:y,children:u})});An.classes=Z,An.displayName=`@mantine/core/MenuCheckboxItem`;function jn(e){let{children:t,disabled:n,longPressDelay:r}=a(`MenuContextMenu`,null,e),i=F(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=Gt(),c=Kt({childProps:i.props,disabled:n||s.disabled,opened:o.opened,longPressDelay:r,setReference:s.reference,open:()=>o.openDropdown()});return(0,B.cloneElement)(i,c)}jn.displayName=`@mantine/core/MenuContextMenu`;var Mn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuDivider`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`divider`,{className:r,style:i,styles:o,classNames:n}),...c})});Mn.classes=Z,Mn.displayName=`@mantine/core/MenuDivider`;var Nn=500;function Pn(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function Fn(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function In({enabled:e,opened:t,getDropdown:n}){let r=(0,B.useRef)({buffer:``,timeoutId:null});return(0,B.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,B.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},Nn);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||Fn(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,ref:d,...f}=a(`MenuDropdown`,null,e),p=(0,B.useRef)(null),m=Y(),g=In({enabled:!m.hasSearch,opened:m.opened,getDropdown:()=>p.current}),_=W(l,e=>{g(e),!(e.defaultPrevented||m.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),p.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),v=W(s,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.openDropdown()),y=W(c,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.closeDropdown());return(0,U.jsxs)(G.Dropdown,{...f,onMouseEnter:v,onMouseLeave:y,role:`menu`,"aria-orientation":`vertical`,ref:h(d,p),...m.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:_,children:[m.withInitialFocusPlaceholder&&!m.hasSearch&&(0,U.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Ln.classes=Z,Ln.displayName=`@mantine/core/MenuDropdown`;var Rn=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,closeMenuOnClick:u,leftSection:d,rightSection:f,children:p,disabled:m,"data-disabled":g,ref:_,...v}=a(`MenuItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=W(T.onClick,()=>{g||(typeof u==`boolean`?u&&y.closeDropdownImmediately():y.closeOnItemClick&&y.closeDropdownImmediately())}),D=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),O=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,k=l?S({color:l,theme:x}):null,A=W(T.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_),role:`menuitem`,disabled:m,"data-menu-item":!0,"data-disabled":m||g||void 0,"data-mantine-stop-propagation":!0,onClick:E,onMouseMove:D,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:A}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),d&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:d}),p&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:p}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:f})]})});Rn.classes=Z,Rn.displayName=`@mantine/core/MenuItem`;var zn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuLabel`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,styles:o,classNames:n}),...c})});zn.classes=Z,zn.displayName=`@mantine/core/MenuLabel`;var Bn=(0,B.createContext)(null);function Vn(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuRadioGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,U.jsx)(Bn,{value:{value:o,onChange:e=>s(e)},children:i})}Vn.displayName=`@mantine/core/MenuRadioGroup`;function Hn({size:e,style:t,...n}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:x(e),height:x(e),...t},"aria-hidden":!0,...n,children:(0,U.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,onChange:h,checkIcon:g,ref:_,...v}=a(`MenuRadioItem`,null,e),y=Y(),b=(0,B.use)(Bn),x=m??(b?b.value===p:!1),S=g??y.checkIcon??(0,U.jsx)(Hn,{size:5});return(0,U.jsx)(kn,{role:`menuitemradio`,checked:x,indicator:S,onSelect:()=>{x||(h?h(p):b&&b.onChange(p))},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:u})});Un.classes=Z,Un.displayName=`@mantine/core/MenuRadioItem`;var Wn=`[data-menu-item]:not([data-disabled])`,Gn=`[data-menu-active]`;function Kn(e){return e?.closest(`[data-menu-dropdown]`)}function qn(e){return e?Array.from(e.querySelectorAll(Wn)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function Jn(e){e&&e.querySelectorAll(Gn).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function Yn(e,t){Jn(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function Xn(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Zn={clearSearchOnClose:!0},Qn=c(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:o,clearSearchOnClose:s,ref:c,...l}=a(`MenuSearch`,Zn,e),u=Y(),d=(0,B.useRef)(null),f=h(c,d),p=(0,B.useRef)(i);p.current=i,(0,B.useEffect)(()=>u.registerSearch(),[u.registerSearch]),(0,B.useEffect)(()=>{s?u.searchExitClearRef.current=()=>{p.current?.({currentTarget:{value:``}})}:u.searchExitClearRef.current=null},[s,u.searchExitClearRef]),(0,B.useEffect)(()=>{u.opened||Jn(Kn(d.current))},[u.opened]);let m=W(i,e=>{Jn(Kn(e.currentTarget))}),g=W(r,e=>{if(e.defaultPrevented)return;let t=Kn(e.currentTarget),n=qn(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r>=n.length-1?u.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r<=0?r===-1||u.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&Yn(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&Yn(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[Xn(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),v=u.getStyles(`search`);return(0,U.jsx)(_,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:o,...l,ref:f,classNames:[{input:v.className},t],styles:[{input:v.style},n],onKeyDown:g,onChange:m,__staticSelector:`Menu`})});Qn.classes=Z,Qn.displayName=`@mantine/core/MenuSearch`;var $n=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u,onKeyDown:d,children:f,ref:p,...m}=a(`MenuSubDropdown`,null,e),g=(0,B.useRef)(null),_=Y(),v=(0,B.use)(X),y=In({enabled:!_.hasSearch,opened:v?.opened??!1,getDropdown:()=>g.current}),b=W(d,e=>{y(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),x=v?.getFloatingProps({onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u});return(0,U.jsx)(G.Dropdown,{...m,...x,role:`menu`,"aria-orientation":`vertical`,ref:h(p,g,v?.setFloating),..._.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:f})});$n.classes=Z,$n.displayName=`@mantine/core/MenuSubDropdown`;var er=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,leftSection:u,rightSection:d,children:f,disabled:p,"data-disabled":m,closeMenuOnClick:g,ref:_,...v}=a(`MenuSubItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,D=l?S({color:l,theme:x}):null,O=W(T.onKeyDown,e=>{e.key===`ArrowRight`&&(b?.open(),b?.focusFirstItem()),e.key===`ArrowLeft`&&b?.parentContext&&(b.parentContext.close(),b.parentContext.focusParentItem())}),k=W(T.onClick,()=>{!m&&g&&y.closeDropdownImmediately()}),A=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),ee=b?.getReferenceProps({onMouseEnter:T.onMouseEnter,onMouseLeave:T.onMouseLeave,onPointerEnter:T.onPointerEnter,onPointerLeave:T.onPointerLeave});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,...ee,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_,b?.setReference),role:`menuitem`,disabled:p,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:A,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),u&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:u}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:f}),(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:d||(0,U.jsx)(rn,{...y.getStyles(`chevron`),size:14})})]})});er.classes=Z,er.displayName=`@mantine/core/MenuSubItem`;function tr({children:e,refProp:t}){if(!oe(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Y(),(0,U.jsx)(G.Target,{refProp:t,popupType:`menu`,children:e})}tr.displayName=`@mantine/core/MenuSubTarget`;var nr={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function rr(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:o,opened:s,onChange:c,...l}=a(`MenuSub`,nr,e),u=T(),[d,f]=j({value:s,finalValue:!1,onChange:c}),p=(0,B.use)(X),m=Y(),{dir:h}=R(),g=xe(h,i),_=p?.registerOpenSub??m.registerOpenSub,v=(0,B.useRef)(null),y=(0,B.useCallback)(e=>{let t=v.current;return t&&t!==e&&t(),v.current=e,()=>{v.current===e&&(v.current=null)}},[]),b=(0,B.useRef)(f);b.current=f;let x=(0,B.useCallback)(()=>b.current(!0),[]),S=(0,B.useCallback)(()=>b.current(!1),[]);(0,B.useEffect)(()=>{if(d)return _(S)},[d,_,S]);let{context:C,refs:w}=ue({placement:g,open:d,onOpenChange:e=>{e?x():S()}}),{getReferenceProps:E,getFloatingProps:D}=Ce([ge(C,{handleClose:o?Se(typeof o==`object`?o:void 0):void 0,delay:{open:r,close:n}})]);return(0,U.jsx)(X,{value:{opened:d,close:S,open:x,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-target`)?.focus()},16),parentContext:p,setReference:w.setReference,setFloating:w.setFloating,getReferenceProps:E,getFloatingProps:D,registerOpenSub:y},children:(0,U.jsx)(G,{opened:d,onChange:e=>e?x():S(),withArrow:!1,id:u,position:i,...l,withinPortal:!1,children:t})})}rr.extend=e=>e,rr.displayName=`@mantine/core/MenuSub`,rr.Target=tr,rr.Dropdown=$n,rr.Item=er;var ir={refProp:`ref`};function ar(e){let{children:t,refProp:n,...r}=a(`MenuTarget`,ir,e),i=F(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=i.props,c=W(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=W(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=W(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,U.jsx)(G.Target,{refProp:n,popupType:`menu`,...r,children:(0,B.cloneElement)(i,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})}ar.displayName=`@mantine/core/MenuTarget`;var or={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Q=c(t=>{let n=a(`Menu`,or,t),{children:r,onOpen:i,onClose:o,opened:s,defaultOpened:c,trapFocus:l,onChange:u,closeOnItemClick:d,loop:f,closeOnEscape:p,trigger:m,openDelay:h,closeDelay:g,classNames:_,styles:y,unstyled:b,variant:x,vars:S,menuItemTabIndex:C,keepMounted:w,withInitialFocusPlaceholder:T,attributes:E,onExitTransitionEnd:D,alignItemsLabels:O,checkIcon:k,...A}=n,ee=e({name:`Menu`,classes:Z,props:n,classNames:_,styles:y,unstyled:b,attributes:E}),[M,te]=j({value:s,defaultValue:c,finalValue:!1,onChange:u}),[ne,re]=(0,B.useState)(!1),N=()=>{te(!1),re(!1),M&&o?.()},P=()=>{te(!0),!M&&i?.()},ie=()=>{M?N():P()},{openDropdown:ae,closeDropdown:oe}=Ut({open:P,close:N,closeDelay:g,openDelay:h}),F=(0,B.useRef)(null),se=(0,B.useCallback)(e=>{let t=F.current;return t&&t!==e&&t(),F.current=e,()=>{F.current===e&&(F.current=null)}},[]),I=(0,B.useRef)(0),[L,ce]=(0,B.useState)(!1),le=(0,B.useCallback)(()=>(I.current+=1,I.current===1&&ce(!0),()=>{--I.current,I.current===0&&ce(!1)}),[]),ue=(0,B.useRef)(null),de=()=>{ue.current?.(),D?.()},fe=e=>jt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:pe,resolvedStyles:me}=v({classNames:_,styles:y,props:n});return(0,U.jsx)(En,{value:{getStyles:ee,opened:M,toggleDropdown:ie,getItemIndex:fe,openedViaClick:ne,setOpenedViaClick:re,closeOnItemClick:d,closeDropdown:m===`click`?N:oe,openDropdown:m===`click`?P:ae,closeDropdownImmediately:N,loop:f,trigger:m,unstyled:b,menuItemTabIndex:C,withInitialFocusPlaceholder:T,registerOpenSub:se,hasSearch:L,registerSearch:le,searchExitClearRef:ue,alignItemsLabels:O,checkIcon:k},children:(0,U.jsx)(G,{returnFocus:!0,...A,opened:M,onChange:ie,defaultOpened:c,trapFocus:!w&&l,closeOnEscape:p,__staticSelector:`Menu`,classNames:pe,styles:me,unstyled:b,variant:x,keepMounted:w,onExitTransitionEnd:de,children:r})})});Q.displayName=`@mantine/core/Menu`,Q.classes=Z,Q.Item=Rn,Q.Label=zn,Q.Dropdown=Ln,Q.Target=ar,Q.Divider=Mn,Q.Search=Qn,Q.Sub=rr,Q.CheckboxItem=An,Q.CheckboxGroup=On,Q.RadioItem=Un,Q.RadioGroup=Vn,Q.ContextMenu=jn;var sr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),cr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),lr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),ur=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:sr}));ur.displayName=`DotsThreeIcon`;var dr=ur,fr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:cr}));fr.displayName=`PencilSimpleIcon`;var pr=fr,mr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:lr}));mr.displayName=`TrashIcon`;var hr=mr,gr=[`dashboards`],_r=3e4;async function $(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await ee(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw new M(s.message??`Request failed (${o.status})`,o.status,s.problems??[]);return s}var vr=e=>`/api/dashboards/${encodeURIComponent(e)}`,yr=()=>$(`/api/dashboards`).then(e=>e.dashboards),br=(e,t)=>$(vr(e),{signal:t}),xr=(e,t)=>$(`${vr(e)}/versions`,{signal:t}).then(e=>e.versions),Sr=(e,t,n)=>$(`${vr(e)}/versions/${t}`,{signal:n}),Cr=(e,t)=>$(`${vr(e)}/versions/${t}/restore`,{method:`POST`}),wr=(e,t,n,r)=>$(vr(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),Tr=(e,t,n,r)=>$(vr(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}}),Er=(e,t)=>$(`/api/panels/query`,{method:`POST`,json:e,signal:t}).then(e=>e.results),Dr=(e,t)=>$(`/api/annotations`,{method:`POST`,json:e,signal:t}),Or=(e,t)=>$(`/api/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),kr=(e,t)=>$(`/api/panels/exemplars`,{method:`POST`,json:e,signal:t});function Ar(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`200`});return $(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function jr(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function Mr(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return jr(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function Nr(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function Pr(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var Fr=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],Ir=[`off`,`10s`,`30s`,`1m`,`5m`],Lr=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},Rr=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function zr(e){let t={};typeof e.range==`string`&&Fr.includes(e.range)?t.range=e.range:Lr(e.from)&&Lr(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=Rr(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=jr(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function Br(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function Vr(e,t){let n=new URL(e);return n.search=Nr(Br({...zr(Pr(n.search)),drill:JSON.stringify(t)})),n.href}function Hr(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var Ur=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],Wr=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],Gr=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],Kr=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],qr=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],Jr=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],Yr={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},Xr={dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`],light:[`#2a78d6`,`#eb6834`,`#1baf7a`,`#4a3aa7`,`#eda100`,`#e87ba4`]},Zr={micro:11,small:12,body:14,title:16,section:22,page:32},Qr={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},$r={brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},ei={light:7,dark:5};function ti(e){let t=e.replace(`#`,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(2)+.0722*r(4)}function ni(e){let t=ti(e),n=1.05/(t+.05);return(t+.05)/.05>n?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function ri(e){return Object.fromEntries(Object.entries($r).map(([t,n])=>[`--fanout-color-${t}-contrast`,ni(n[ei[e]])]))}function ii(e){return t=>{let n=t.color??si.primaryColor,r=e({...t,color:n}),i=t.variant===`filled`||t.variant===void 0;return t.autoContrast===!1||!i||!Object.hasOwn($r,n)?r:{...r,color:`var(--fanout-color-${n}-contrast)`}}}var ai=.25,oi={xs:9,sm:10,md:11,lg:13,xl:16},si={primaryColor:`brand`,primaryShade:ei,autoContrast:!0,luminanceThreshold:ai,colors:{dark:Ur,brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},defaultRadius:`md`,fontFamily:Qr.body,fontFamilyMonospace:Qr.display,headings:{fontFamily:Qr.body,fontWeight:`600`},cursorType:`pointer`,components:{Tabs:{styles:(e,t)=>({tab:ui(t.color,`--tabs-text-color`)})},Pagination:{styles:(e,t)=>({control:ui(t.color,`--pagination-active-color`)})},Badge:{vars:(e,t)=>({root:li(t.size)})}}},ci=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":Yr.light.muted,...ri(`light`)},dark:ri(`dark`)});function li(e){let t=oi[e??`md`];return t===void 0||t>=Zr.micro?{}:{"--badge-fz":`${Zr.micro/16}rem`}}function ui(e,t){return!e||e===si.primaryColor?{[t]:`var(--fanout-color-${si.primaryColor}-contrast)`}:{}}export{Dt as $,yr as A,pr as B,Mr as C,br as D,_r as E,Er as F,an as G,Q as H,wr as I,Bt as J,rn as K,Or as L,Tr as M,Dr as N,Ar as O,kr as P,kt as Q,Cr as R,Nr as S,gr as T,Tn as U,dr as V,J as W,Vt as X,Ht as Y,At as Z,zr as _,ii as a,lt as at,Br as b,Yr as c,Ue as ct,Gr as d,Le as dt,St as et,Xr as f,Hr as g,Vr as h,ti as i,ft as it,xr as j,Sr as k,Qr as l,Be as lt,Kr as m,si as n,yt as nt,qr as o,rt as ot,Zr as p,G as q,ni as r,vt as rt,Wr as s,ot as st,ci as t,bt as tt,Jr as u,Re as ut,Fr as v,jr as w,Pr as x,Ir as y,hr as z}; \ No newline at end of file +import{A as e,C as t,Ct as n,G as r,J as i,M as a,P as o,S as s,T as c,X as l,Y as u,a as d,b as f,bt as p,ct as m,et as h,gt as g,h as _,j as v,lt as y,nt as b,pt as x,q as S,rt as C,st as w,tt as T,vt as E,w as D,z as O}from"./brand-oskFJPNW.js";import{d as k,f as A,i as ee,l as j,o as M}from"./auth-CQerCjF_.js";import{B as te,C as ne,I as re,g as N,h as P,v as ie,w as ae}from"./preload-helper-DOsq4iEA.js";import{n as oe,t as F}from"./get-single-element-child-D7qmWU2f.js";import{C as se,E as I,T as L,_ as ce,a as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,l as ge,m as _e,n as ve,o as ye,p as be,r as xe,s as Se,u as Ce,v as we,x as R,y as Te}from"./Tooltip-2jTVpG2Y.js";import{r as Ee}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{A as De,D as Oe,I as ke,M as Ae,N as z,O as je,P as Me,R as Ne,j as Pe,k as Fe}from"./useQuery-BynlWFEG.js";import{t as Ie}from"./FocusTrap-yVpiEwpv.js";function Le(){throw Error(`Invariant failed`)}var Re=`__root__`;function ze(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Be(e){return e instanceof Response&&!!e.options}var Ve=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Re:this.parentRoute||Le();let r=n?Re:t?.path;r&&r!==`/`&&(r=ne(r));let i=t?.id||r,a=n?Re:ie((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:ie(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ae(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ze({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},He=class extends Ve{constructor(e){super(e)}},B=n(p(),1),Ue=B.createContext(void 0),We=B.createContext(void 0);function Ge({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ke(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var qe=[],Je=0,{link:Ye,unlink:Xe,propagate:Ze,checkDirty:Qe,shallowPropagate:$e}=Ge({update(e){return e._update()},notify(e){qe[tt++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,it(e))}}),et=0,tt=0,V,nt=0;function rt(e){try{++nt,e()}finally{--nt||at()}}function it(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Xe(n,e)}function at(){if(!(nt>0)){for(;et{i.get(),n.current?(V=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=V,o=t?.compare??Object.is;if(n)V=i,++Je,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{V=a,n&&(i.flags&=-5),it(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Qe(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&$e(e)}}else e&32&&(i.flags=e&-33);return V!==void 0&&Ye(i,V,Je),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ze(e),$e(e),at())}},i}function st(e){let t=()=>{let t=V;V=n,++Je,n.depsTail=void 0,n.flags=6;try{return e()}finally{V=t,n.flags&=-5,it(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Qe(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,it(this)}};return t(),n}var ct={};function lt(e,t){let n=B.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=te(n.current,i):i}}function H(e){let t=g(),n=B.useContext(e.from?We:Ue),r=e.from??n,i=t.stores.getMatchStore(r),a=lt(e,t),o=N(i,e=>e?a(e):ct);if(o!==ct)return o;(e.shouldThrow??!0)&&Le()}function ut(e){return H({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function dt(e){let{select:t,...n}=e;return H({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ft(e){return H({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function pt(e){return H({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mt(e){return H({...e,select:t=>e.select?e.select(t.context):t.context})}var U=E(),ht=class extends Ve{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function gt(e){return new ht(e)}var _t=class extends He{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function vt(e){return new _t(e)}function yt(e){return e=>{let t=gt(e);return t.isRoot=!1,t}}function bt(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(re(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(A)A(a());else throw a()}return B.createElement(r,e)};return o.preload=a,o}function xt(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function St(e){let t=xt(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function wt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function Tt(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(Ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Et(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=Tt(l,c,r),d=wt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[Tt(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[wt(c.length,c,!1)]?.focus()}}}function Ot(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Ee:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function W(e,t){return n=>{e?.(n),t?.(n)}}function kt(e,t){return e in t?St(t[e]):St(e)}function At(e,t){let n=e.map(e=>({value:e,px:kt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function jt(e,t,n){return n?Array.from(Ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Mt=[`mousedown`,`touchstart`];function Nt(e,t,n,r=!0,i=!1){let a=(0,B.useRef)(null),o=t||Mt,s=(0,B.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let i=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!i.includes(e))&&e(t):a.current&&!i.includes(a.current)&&e(t)}),c=o.join(`,`);return(0,B.useEffect)(()=>{if(!r)return;let e=c.split(`,`);return e.forEach(e=>document.addEventListener(e,s,i)),()=>{e.forEach(e=>document.removeEventListener(e,s,i))}},[c,r,i]),a}var Pt=[`mouse`,`touch`],Ft=10;function It(e,t={}){let{threshold:n=400,events:r=Pt,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,B.useRef)(!1),l=(0,B.useRef)(!1),u=(0,B.useRef)(-1),d=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>window.clearTimeout(u.current),[]);let f=r.join(`,`);return(0,B.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?Ft:i===!1?0:i,p=t=>{(zt(t)||Rt(t))&&(a&&a(t),d.current=Lt(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(zt(e)||Rt(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=Lt(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,f])}function Lt(e){if(Rt(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Rt(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function zt(e){return e.nativeEvent instanceof MouseEvent}function Bt({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&S({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Vt(e,t,n){return Bt({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function Ht(e,t){let n=e.colors[e.primaryColor];return r(n)?e.autoContrast?Vt(n,e,t):`var(--mantine-color-white)`:Bt({color:n[i(e,t)],theme:e,autoContrast:null})}function Ut({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,B.useRef)(-1),a=(0,B.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,B.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[Wt,Gt]=I(`Popover component was not found in the tree`);function Kt({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,B.useRef)(!1),s=(0,B.useRef)(!1),c=(0,B.useRef)(null),l=(0,B.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=W(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=W(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=It(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:W(e.onTouchStart,p.onTouchStart),onTouchEnd:W(e.onTouchEnd,p.onTouchEnd),onTouchCancel:W(e.onTouchCancel,p.onTouchCancel),onTouchMove:W(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function qt(e){let{children:t,disabled:n,longPressDelay:r}=a(`PopoverContextMenu`,null,e),i=F(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Gt(),s=Kt({childProps:i.props,disabled:n||o.disabled,opened:o.opened,longPressDelay:r,setReference:o.reference,open:()=>{o.opened||o.onToggle()}});return(0,B.cloneElement)(i,s)}qt.displayName=`@mantine/core/PopoverContextMenu`;var Jt={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Yt=c(e=>{let n=a(`PopoverDropdown`,null,e),{className:r,style:i,vars:o,children:s,onKeyDownCapture:c,variant:l,classNames:u,styles:d,ref:p,...m}=n,g=Gt(),{dir:_}=R(),v=g.arrowPosition===`merge`&&g.withArrow?le({position:g.placement,dir:_}):void 0,y=Ne({opened:g.opened,shouldReturnFocus:g.returnFocus}),b=g.withRoles?{"aria-labelledby":g.getTargetId(),id:g.getDropdownId(),role:`dialog`,tabIndex:-1}:{},S=h(p,g.floating);return g.disabled?null:(0,U.jsx)(ve,{...g.portalProps,withinPortal:g.withinPortal,children:(0,U.jsx)(f,{mounted:g.opened,...g.transitionProps,transition:g.transitionProps?.transition||`fade`,duration:g.transitionProps?.duration??150,keepMounted:g.keepMounted,keepMountedMode:g.keepMountedMode,exitDuration:typeof g.transitionProps?.exitDuration==`number`?g.transitionProps.exitDuration:g.transitionProps?.duration,children:e=>(0,U.jsx)(Ie,{active:g.trapFocus&&g.opened,innerRef:S,children:(0,U.jsxs)(t,{...b,...m,variant:l,onKeyDownCapture:Ot(()=>{g.onClose?.(),g.onDismiss?.()},{active:g.closeOnEscape,onTrigger:y,onKeyDown:c}),"data-position":g.placement,"data-fixed":g.floatingStrategy===`fixed`||void 0,...g.getStyles(`dropdown`,{className:r,props:n,classNames:u,styles:d,style:[{...e,...v,zIndex:g.zIndex,top:g.y??0,left:g.x??0,width:g.width===`target`?void 0:x(g.width),...g.referenceHidden?{display:`none`}:null},g.resolvedStyles?.dropdown,d?.dropdown,i]}),children:[s,(0,U.jsx)(he,{ref:g.arrowRef,arrowX:g.arrowX,arrowY:g.arrowY,visible:g.withArrow,position:g.placement,arrowSize:g.arrowSize,arrowRadius:g.arrowRadius,arrowOffset:g.arrowOffset,arrowPosition:g.arrowPosition,...g.getStyles(`arrow`,{props:n,classNames:u,styles:d})})]})})})})});Yt.classes=Jt,Yt.displayName=`@mantine/core/PopoverDropdown`;var Xt={refProp:`ref`,popupType:`dialog`},Zt=c(e=>{let{children:t,refProp:n,popupType:r,ref:i,...o}=a(`PopoverTarget`,Xt,e),s=F(t);if(!s)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let c=o,l=Gt(),d=h(l.reference,se(s),i),f=l.withRoles?{"aria-haspopup":r,"aria-expanded":l.opened,"aria-controls":l.opened?l.getDropdownId():void 0,id:l.getTargetId()}:{},p=s.props;return(0,B.cloneElement)(s,{...c,...f,...l.targetProps,className:u(l.targetProps.className,c.className,p.className),[n]:d,...l.controlled?null:{onClick:e=>{l.onToggle(),p.onClick?.(e)}}})});Zt.displayName=`@mantine/core/PopoverTarget`;function Qt(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function $t(e,t,n,r){let i=Qt(e.middlewares),a=[pe(e.offset),be()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(fe(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(ce(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:me(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?_e():_e(i.inline)),a.push(de({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(we({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function en(e){let[t,n]=j({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,B.useRef)(t),i=(0,B.useRef)(!1),[a,o]=(0,B.useState)(null),s=e.preventPositionChangeWhenVisible!==!1,c=(0,B.useRef)(t);t!==c.current&&(c.current=t,t&&a!==null&&o(null));let l=(0,B.useRef)(e.position);e.position!==l.current&&(l.current=e.position,i.current=!1,a!==null&&o(null));let u=(0,B.useCallback)(()=>o(null),[]),d=()=>{t&&!e.disabled&&n(!1)},f=()=>{e.disabled||n(!t)},p=ue({open:t,strategy:e.strategy,placement:s?a??e.position:e.position,middleware:$t(e,()=>p,s&&a!==null,s),whileElementsMounted:e.keepMounted?void 0:Te});(0,B.useEffect)(()=>{if(!e.keepMounted)return;let n=p.refs.reference.current,r=p.refs.floating.current;if(t&&n&&r)return Te(n,r,p.update)},[e.keepMounted,t,p.update,p.elements.reference,p.elements.floating]),C(()=>{if(!t){i.current=!1;return}if(!s||a!==null)return;let e=p.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!i.current){i.current=!0,p.update();return}p.isPositioned&&o(p.placement)}},[s,t,p.isPositioned,p.placement,a,p.update]);let m=(0,B.useRef)(p.placement);return C(()=>{m.current!==p.placement&&(m.current=p.placement,e.onPositionChange?.(p.placement))},[p.placement]),b(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:p,controlled:typeof e.opened==`boolean`,opened:t,onClose:d,onToggle:f,resetLockedPlacement:u}}var tn={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:L(`popover`),__staticSelector:`Popover`,width:`max-content`},nn=l((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:w(t),"--popover-shadow":m(n)}}));function G(t){let n=a(`Popover`,tn,t),{children:r,position:i,offset:o,onPositionChange:s,opened:c,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:p,middlewares:m,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,unstyled:x,classNames:S,styles:C,closeOnClickOutside:w,withinPortal:E,portalProps:D,closeOnEscape:k,clickOutsideEvents:A,trapFocus:ee,onClose:j,onDismiss:M,onOpen:te,onChange:ne,zIndex:re,radius:N,shadow:P,id:ie,defaultOpened:ae,__staticSelector:oe,withRoles:F,disabled:se,returnFocus:I,variant:L,keepMounted:ce,keepMountedMode:le,vars:ue,floatingStrategy:de,withOverlay:fe,overlayProps:pe,hideDetached:me,attributes:he,preventPositionChangeWhenVisible:ge,..._e}=n,ye=e({name:oe,props:n,classes:Jt,classNames:S,styles:C,unstyled:x,attributes:he,rootSelector:`dropdown`,vars:ue,varsResolver:nn}),{resolvedStyles:be}=v({classNames:S,styles:C,props:n}),Se=(0,B.useRef)(null),[Ce,we]=(0,B.useState)(null),[Te,Ee]=(0,B.useState)(null),{dir:De}=R(),Oe=O(),Ae=T(ie),z=en({middlewares:m,width:p,position:xe(De,i),offset:typeof o==`number`?o+(h?g/2:0):o,arrowRef:Se,arrowOffset:_,onPositionChange:s,opened:c,defaultOpened:ae,onChange:ne,onOpen:te,onClose:j,onDismiss:M,strategy:de,disabled:se,preventPositionChangeWhenVisible:ge,keepMounted:ce});Nt(()=>{w&&(z.onClose(),M?.())},A,[Ce,Te]);let je=(0,B.useCallback)(e=>{we(e),z.floating.refs.setReference(e)},[z.floating.refs.setReference]),Me=(0,B.useCallback)(e=>{Ee(e),z.floating.refs.setFloating(e)},[z.floating.refs.setFloating]),Ne=(0,B.useCallback)(()=>{l?.onExited?.(),u?.(),z.resetLockedPlacement()},[l?.onExited,u,z.resetLockedPlacement]),Pe=(0,B.useCallback)(()=>{l?.onEntered?.(),d?.()},[l?.onEntered,d]);return(0,U.jsxs)(Wt,{value:{returnFocus:I,disabled:se,controlled:z.controlled,reference:je,floating:Me,x:z.floating.x,y:z.floating.y,arrowX:z.floating?.middlewareData?.arrow?.x,arrowY:z.floating?.middlewareData?.arrow?.y,opened:z.opened,arrowRef:Se,transitionProps:{...l,onExited:Ne,onEntered:Pe},width:p,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,placement:z.floating.placement,trapFocus:ee,withinPortal:E,portalProps:D,zIndex:re,radius:N,shadow:P,closeOnEscape:k,onDismiss:M,onClose:z.onClose,onToggle:z.onToggle,getTargetId:()=>Ae,getDropdownId:()=>`${Ae}-dropdown`,withRoles:F,targetProps:_e,__staticSelector:oe,classNames:S,styles:C,unstyled:x,variant:L,keepMounted:ce,keepMountedMode:le,getStyles:ye,resolvedStyles:be,floatingStrategy:de,referenceHidden:me&&Oe!==`test`?z.floating.middlewareData.hide?.referenceHidden:!1},children:[r,fe&&(0,U.jsx)(f,{transition:`fade`,mounted:z.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:e=>(0,U.jsx)(ve,{withinPortal:E,children:(0,U.jsx)(ke,{...pe,...ye(`overlay`,{className:pe?.className,style:[e,pe?.style]})})})})]})}G.Target=Zt,G.Dropdown=Yt,G.ContextMenu=qt,G.varsResolver=nn,G.displayName=`@mantine/core/Popover`,G.extend=e=>e,G.withProps=e=>{let t=t=>(0,U.jsx)(G,{...e,...t});return t.extend=G.extend,t.displayName=`WithProps(${G.displayName})`,t};function rn({style:e,size:t=16,...n}){return(0,U.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:x(t),height:x(t),display:`block`},...n,children:(0,U.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}rn.displayName=`@mantine/core/AccordionChevron`;function an({size:e,style:t,...n}){let r=e===void 0?t:{width:x(e),height:x(e),...t};return(0,U.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,U.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var[on,K]=I(`Drawer component was not found in tree`),q={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},sn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerBody`,null,e),c=K();return(0,U.jsx)(z,{...c.getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...s})});sn.classes=q,sn.displayName=`@mantine/core/DrawerBody`;var cn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerCloseButton`,null,e),c=K();return(0,U.jsx)(Ae,{...c.getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...s})});cn.classes=q,cn.displayName=`@mantine/core/DrawerCloseButton`;var ln=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,radius:c,__hidden:l,...u}=a(`DrawerContent`,null,e),d=K(),f=d.scrollAreaComponent||Oe;return(0,U.jsx)(Pe,{...d.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:d.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...u,radius:c||d.radius||0,"data-hidden":l||void 0,children:(0,U.jsx)(f,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:s})})});ln.classes=q,ln.displayName=`@mantine/core/DrawerContent`;var un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerHeader`,null,e),c=K();return(0,U.jsx)(De,{...c.getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...s})});un.classes=q,un.displayName=`@mantine/core/DrawerHeader`;var dn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerOverlay`,null,e),c=K();return(0,U.jsx)(Fe,{...c.getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...s})});dn.classes=q,dn.displayName=`@mantine/core/DrawerOverlay`;function fn(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function pn(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var mn={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},hn={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},gn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),position:`left`},_n=l((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":y(n,`drawer-size`),"--drawer-flex":pn(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":fn(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":x(r)}})),vn=c(t=>{let n=a(`DrawerRoot`,gn,t),{classNames:r,className:i,style:o,styles:s,unstyled:c,vars:l,scrollAreaComponent:u,position:d,transitionProps:f,radius:p,attributes:m,...h}=n,{dir:g}=R(),_=e({name:`Drawer`,classes:q,props:n,className:i,style:o,classNames:r,styles:s,unstyled:c,attributes:m,vars:l,varsResolver:_n}),v=(g===`rtl`?hn:mn)[d];return(0,U.jsx)(on,{value:{scrollAreaComponent:u,getStyles:_,radius:p},children:(0,U.jsx)(Me,{..._(`root`),transitionProps:{transition:v,...f},"data-offset-scrollbars":u===ye.Autosize||void 0,unstyled:c,...h})})});vn.classes=q,vn.varsResolver=_n,vn.displayName=`@mantine/core/DrawerRoot`;var yn=(0,B.createContext)(null);function bn({children:e}){let[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(L(`modal`)),[a]=(0,B.useState)(()=>new WeakSet);return(0,U.jsx)(yn,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r,handledEscapeEvents:a},children:e})}bn.displayName=`@mantine/core/DrawerStack`;var xn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerTitle`,null,e),c=K();return(0,U.jsx)(je,{...c.getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...s})});xn.classes=q,xn.displayName=`@mantine/core/DrawerTitle`;var Sn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),withOverlay:!0,withCloseButton:!0},J=c(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:o,children:s,opened:c,stackId:l,zIndex:u,...d}=a(`Drawer`,Sn,e),f=(0,B.use)(yn),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l),__handledEscapeEvents:f.handledEscapeEvents}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,B.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||L(`modal`)):f.removeModal(l))},[c,l,u]),(0,U.jsxs)(vn,{opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,U.jsx)(dn,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,U.jsxs)(ln,{__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,U.jsxs)(un,{children:[t&&(0,U.jsx)(xn,{children:t}),i&&(0,U.jsx)(cn,{...o})]}),(0,U.jsx)(sn,{children:s})]})]})});J.classes=q,J.displayName=`@mantine/core/Drawer`,J.Root=vn,J.Overlay=dn,J.Content=ln,J.Body=sn,J.Header=un,J.Title=xn,J.CloseButton=cn,J.Stack=bn;var Cn={root:`m_dc6f14e2`},wn=l((e,{size:t})=>({root:{"--kbd-fz":y(t,`kbd-fz`)}})),Tn=c(n=>{let r=a(`Kbd`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,attributes:d,...f}=r,p=e({name:`Kbd`,classes:Cn,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:d,vars:u,varsResolver:wn});return(0,U.jsx)(t,{component:`kbd`,...p(`root`),...f})});Tn.classes=Cn,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/Kbd`;var[En,Y]=I(`Menu component was not found in the tree`),Dn=(0,B.createContext)(null);function On(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuCheckboxGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:[],onChange:r}),c=(0,B.useCallback)(e=>{s(o.includes(e)?o.filter(t=>t!==e):[...o,e])},[o,s]);return(0,U.jsx)(Dn,{value:{values:o,onChange:c},children:i})}On.displayName=`@mantine/core/MenuCheckboxGroup`;var X=(0,B.createContext)(null);function kn({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:c,children:l,disabled:u,dataDisabled:d,className:f,style:p,styles:m,classNames:g,buttonRef:_,others:v}){let y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=W(v.onClick,()=>{d||(r(),a&&y.closeDropdownImmediately())}),E=W(v.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=W(v.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())}),O=i?x.variantColorResolver({color:i,theme:x,variant:`light`}):void 0,k=i?S({color:i,theme:x}):null,A=y.alignItemsLabels!==`none`||t;return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:f,style:p,styles:m,classNames:g}),ref:h(w,_),role:e,"aria-checked":t,disabled:u,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":u||d||void 0,"data-mantine-stop-propagation":!0,onClick:T,onMouseMove:E,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[A&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:m,classNames:g}),"data-checked":t||void 0,children:t?n:null}),l&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:m,classNames:g}),"data-menu-item-label":!0,children:l}),c&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:m,classNames:g}),"data-position":`right`,children:c})]})}var Z={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},An=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,defaultChecked:h,onChange:g,checkIcon:_,ref:v,...y}=a(`MenuCheckboxItem`,null,e),b=Y(),x=(0,B.use)(Dn),S=x&&p!==void 0?x.values.includes(p):void 0,[C,w]=j({value:m??S,defaultValue:h,finalValue:!1,onChange:g}),T=_??b.checkIcon??(0,U.jsx)(an,{size:10});return(0,U.jsx)(kn,{role:`menuitemcheckbox`,checked:C,indicator:T,onSelect:()=>{g?w(!C):x&&p!==void 0?x.onChange(p):w(!C)},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:v,others:y,children:u})});An.classes=Z,An.displayName=`@mantine/core/MenuCheckboxItem`;function jn(e){let{children:t,disabled:n,longPressDelay:r}=a(`MenuContextMenu`,null,e),i=F(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=Gt(),c=Kt({childProps:i.props,disabled:n||s.disabled,opened:o.opened,longPressDelay:r,setReference:s.reference,open:()=>o.openDropdown()});return(0,B.cloneElement)(i,c)}jn.displayName=`@mantine/core/MenuContextMenu`;var Mn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuDivider`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`divider`,{className:r,style:i,styles:o,classNames:n}),...c})});Mn.classes=Z,Mn.displayName=`@mantine/core/MenuDivider`;var Nn=500;function Pn(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function Fn(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function In({enabled:e,opened:t,getDropdown:n}){let r=(0,B.useRef)({buffer:``,timeoutId:null});return(0,B.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,B.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},Nn);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||Fn(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,ref:d,...f}=a(`MenuDropdown`,null,e),p=(0,B.useRef)(null),m=Y(),g=In({enabled:!m.hasSearch,opened:m.opened,getDropdown:()=>p.current}),_=W(l,e=>{g(e),!(e.defaultPrevented||m.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),p.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),v=W(s,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.openDropdown()),y=W(c,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.closeDropdown());return(0,U.jsxs)(G.Dropdown,{...f,onMouseEnter:v,onMouseLeave:y,role:`menu`,"aria-orientation":`vertical`,ref:h(d,p),...m.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:_,children:[m.withInitialFocusPlaceholder&&!m.hasSearch&&(0,U.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Ln.classes=Z,Ln.displayName=`@mantine/core/MenuDropdown`;var Rn=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,closeMenuOnClick:u,leftSection:d,rightSection:f,children:p,disabled:m,"data-disabled":g,ref:_,...v}=a(`MenuItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=W(T.onClick,()=>{g||(typeof u==`boolean`?u&&y.closeDropdownImmediately():y.closeOnItemClick&&y.closeDropdownImmediately())}),D=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),O=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,k=l?S({color:l,theme:x}):null,A=W(T.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_),role:`menuitem`,disabled:m,"data-menu-item":!0,"data-disabled":m||g||void 0,"data-mantine-stop-propagation":!0,onClick:E,onMouseMove:D,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:A}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),d&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:d}),p&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:p}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:f})]})});Rn.classes=Z,Rn.displayName=`@mantine/core/MenuItem`;var zn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuLabel`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,styles:o,classNames:n}),...c})});zn.classes=Z,zn.displayName=`@mantine/core/MenuLabel`;var Bn=(0,B.createContext)(null);function Vn(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuRadioGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,U.jsx)(Bn,{value:{value:o,onChange:e=>s(e)},children:i})}Vn.displayName=`@mantine/core/MenuRadioGroup`;function Hn({size:e,style:t,...n}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:x(e),height:x(e),...t},"aria-hidden":!0,...n,children:(0,U.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,onChange:h,checkIcon:g,ref:_,...v}=a(`MenuRadioItem`,null,e),y=Y(),b=(0,B.use)(Bn),x=m??(b?b.value===p:!1),S=g??y.checkIcon??(0,U.jsx)(Hn,{size:5});return(0,U.jsx)(kn,{role:`menuitemradio`,checked:x,indicator:S,onSelect:()=>{x||(h?h(p):b&&b.onChange(p))},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:u})});Un.classes=Z,Un.displayName=`@mantine/core/MenuRadioItem`;var Wn=`[data-menu-item]:not([data-disabled])`,Gn=`[data-menu-active]`;function Kn(e){return e?.closest(`[data-menu-dropdown]`)}function qn(e){return e?Array.from(e.querySelectorAll(Wn)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function Jn(e){e&&e.querySelectorAll(Gn).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function Yn(e,t){Jn(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function Xn(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Zn={clearSearchOnClose:!0},Qn=c(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:o,clearSearchOnClose:s,ref:c,...l}=a(`MenuSearch`,Zn,e),u=Y(),d=(0,B.useRef)(null),f=h(c,d),p=(0,B.useRef)(i);p.current=i,(0,B.useEffect)(()=>u.registerSearch(),[u.registerSearch]),(0,B.useEffect)(()=>{s?u.searchExitClearRef.current=()=>{p.current?.({currentTarget:{value:``}})}:u.searchExitClearRef.current=null},[s,u.searchExitClearRef]),(0,B.useEffect)(()=>{u.opened||Jn(Kn(d.current))},[u.opened]);let m=W(i,e=>{Jn(Kn(e.currentTarget))}),g=W(r,e=>{if(e.defaultPrevented)return;let t=Kn(e.currentTarget),n=qn(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r>=n.length-1?u.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r<=0?r===-1||u.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&Yn(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&Yn(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[Xn(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),v=u.getStyles(`search`);return(0,U.jsx)(_,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:o,...l,ref:f,classNames:[{input:v.className},t],styles:[{input:v.style},n],onKeyDown:g,onChange:m,__staticSelector:`Menu`})});Qn.classes=Z,Qn.displayName=`@mantine/core/MenuSearch`;var $n=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u,onKeyDown:d,children:f,ref:p,...m}=a(`MenuSubDropdown`,null,e),g=(0,B.useRef)(null),_=Y(),v=(0,B.use)(X),y=In({enabled:!_.hasSearch,opened:v?.opened??!1,getDropdown:()=>g.current}),b=W(d,e=>{y(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),x=v?.getFloatingProps({onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u});return(0,U.jsx)(G.Dropdown,{...m,...x,role:`menu`,"aria-orientation":`vertical`,ref:h(p,g,v?.setFloating),..._.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:f})});$n.classes=Z,$n.displayName=`@mantine/core/MenuSubDropdown`;var er=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,leftSection:u,rightSection:d,children:f,disabled:p,"data-disabled":m,closeMenuOnClick:g,ref:_,...v}=a(`MenuSubItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,D=l?S({color:l,theme:x}):null,O=W(T.onKeyDown,e=>{e.key===`ArrowRight`&&(b?.open(),b?.focusFirstItem()),e.key===`ArrowLeft`&&b?.parentContext&&(b.parentContext.close(),b.parentContext.focusParentItem())}),k=W(T.onClick,()=>{!m&&g&&y.closeDropdownImmediately()}),A=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),ee=b?.getReferenceProps({onMouseEnter:T.onMouseEnter,onMouseLeave:T.onMouseLeave,onPointerEnter:T.onPointerEnter,onPointerLeave:T.onPointerLeave});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,...ee,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_,b?.setReference),role:`menuitem`,disabled:p,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:A,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),u&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:u}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:f}),(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:d||(0,U.jsx)(rn,{...y.getStyles(`chevron`),size:14})})]})});er.classes=Z,er.displayName=`@mantine/core/MenuSubItem`;function tr({children:e,refProp:t}){if(!oe(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Y(),(0,U.jsx)(G.Target,{refProp:t,popupType:`menu`,children:e})}tr.displayName=`@mantine/core/MenuSubTarget`;var nr={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function rr(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:o,opened:s,onChange:c,...l}=a(`MenuSub`,nr,e),u=T(),[d,f]=j({value:s,finalValue:!1,onChange:c}),p=(0,B.use)(X),m=Y(),{dir:h}=R(),g=xe(h,i),_=p?.registerOpenSub??m.registerOpenSub,v=(0,B.useRef)(null),y=(0,B.useCallback)(e=>{let t=v.current;return t&&t!==e&&t(),v.current=e,()=>{v.current===e&&(v.current=null)}},[]),b=(0,B.useRef)(f);b.current=f;let x=(0,B.useCallback)(()=>b.current(!0),[]),S=(0,B.useCallback)(()=>b.current(!1),[]);(0,B.useEffect)(()=>{if(d)return _(S)},[d,_,S]);let{context:C,refs:w}=ue({placement:g,open:d,onOpenChange:e=>{e?x():S()}}),{getReferenceProps:E,getFloatingProps:D}=Ce([ge(C,{handleClose:o?Se(typeof o==`object`?o:void 0):void 0,delay:{open:r,close:n}})]);return(0,U.jsx)(X,{value:{opened:d,close:S,open:x,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-target`)?.focus()},16),parentContext:p,setReference:w.setReference,setFloating:w.setFloating,getReferenceProps:E,getFloatingProps:D,registerOpenSub:y},children:(0,U.jsx)(G,{opened:d,onChange:e=>e?x():S(),withArrow:!1,id:u,position:i,...l,withinPortal:!1,children:t})})}rr.extend=e=>e,rr.displayName=`@mantine/core/MenuSub`,rr.Target=tr,rr.Dropdown=$n,rr.Item=er;var ir={refProp:`ref`};function ar(e){let{children:t,refProp:n,...r}=a(`MenuTarget`,ir,e),i=F(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=i.props,c=W(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=W(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=W(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,U.jsx)(G.Target,{refProp:n,popupType:`menu`,...r,children:(0,B.cloneElement)(i,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})}ar.displayName=`@mantine/core/MenuTarget`;var or={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Q=c(t=>{let n=a(`Menu`,or,t),{children:r,onOpen:i,onClose:o,opened:s,defaultOpened:c,trapFocus:l,onChange:u,closeOnItemClick:d,loop:f,closeOnEscape:p,trigger:m,openDelay:h,closeDelay:g,classNames:_,styles:y,unstyled:b,variant:x,vars:S,menuItemTabIndex:C,keepMounted:w,withInitialFocusPlaceholder:T,attributes:E,onExitTransitionEnd:D,alignItemsLabels:O,checkIcon:k,...A}=n,ee=e({name:`Menu`,classes:Z,props:n,classNames:_,styles:y,unstyled:b,attributes:E}),[M,te]=j({value:s,defaultValue:c,finalValue:!1,onChange:u}),[ne,re]=(0,B.useState)(!1),N=()=>{te(!1),re(!1),M&&o?.()},P=()=>{te(!0),!M&&i?.()},ie=()=>{M?N():P()},{openDropdown:ae,closeDropdown:oe}=Ut({open:P,close:N,closeDelay:g,openDelay:h}),F=(0,B.useRef)(null),se=(0,B.useCallback)(e=>{let t=F.current;return t&&t!==e&&t(),F.current=e,()=>{F.current===e&&(F.current=null)}},[]),I=(0,B.useRef)(0),[L,ce]=(0,B.useState)(!1),le=(0,B.useCallback)(()=>(I.current+=1,I.current===1&&ce(!0),()=>{--I.current,I.current===0&&ce(!1)}),[]),ue=(0,B.useRef)(null),de=()=>{ue.current?.(),D?.()},fe=e=>jt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:pe,resolvedStyles:me}=v({classNames:_,styles:y,props:n});return(0,U.jsx)(En,{value:{getStyles:ee,opened:M,toggleDropdown:ie,getItemIndex:fe,openedViaClick:ne,setOpenedViaClick:re,closeOnItemClick:d,closeDropdown:m===`click`?N:oe,openDropdown:m===`click`?P:ae,closeDropdownImmediately:N,loop:f,trigger:m,unstyled:b,menuItemTabIndex:C,withInitialFocusPlaceholder:T,registerOpenSub:se,hasSearch:L,registerSearch:le,searchExitClearRef:ue,alignItemsLabels:O,checkIcon:k},children:(0,U.jsx)(G,{returnFocus:!0,...A,opened:M,onChange:ie,defaultOpened:c,trapFocus:!w&&l,closeOnEscape:p,__staticSelector:`Menu`,classNames:pe,styles:me,unstyled:b,variant:x,keepMounted:w,onExitTransitionEnd:de,children:r})})});Q.displayName=`@mantine/core/Menu`,Q.classes=Z,Q.Item=Rn,Q.Label=zn,Q.Dropdown=Ln,Q.Target=ar,Q.Divider=Mn,Q.Search=Qn,Q.Sub=rr,Q.CheckboxItem=An,Q.CheckboxGroup=On,Q.RadioItem=Un,Q.RadioGroup=Vn,Q.ContextMenu=jn;var sr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),cr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),lr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),ur=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:sr}));ur.displayName=`DotsThreeIcon`;var dr=ur,fr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:cr}));fr.displayName=`PencilSimpleIcon`;var pr=fr,mr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:lr}));mr.displayName=`TrashIcon`;var hr=mr,gr=[`dashboards`],_r=3e4;async function $(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await ee(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw new M(s.message??`Request failed (${o.status})`,o.status,s.problems??[]);return s}var vr=e=>`/api/dashboards/${encodeURIComponent(e)}`,yr=()=>$(`/api/dashboards`).then(e=>e.dashboards),br=(e,t)=>$(vr(e),{signal:t}),xr=(e,t)=>$(`${vr(e)}/versions`,{signal:t}).then(e=>e.versions),Sr=(e,t,n)=>$(`${vr(e)}/versions/${t}`,{signal:n}),Cr=(e,t)=>$(`${vr(e)}/versions/${t}/restore`,{method:`POST`}),wr=(e,t,n,r)=>$(vr(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),Tr=(e,t,n,r)=>$(vr(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}}),Er=(e,t)=>$(`/api/panels/query`,{method:`POST`,json:e,signal:t}).then(e=>e.results),Dr=(e,t)=>$(`/api/annotations`,{method:`POST`,json:e,signal:t}),Or=(e,t)=>$(`/api/panels/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),kr=(e,t)=>$(`/api/panels/exemplars`,{method:`POST`,json:e,signal:t});function Ar(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`200`});return $(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function jr(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function Mr(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return jr(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function Nr(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function Pr(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var Fr=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],Ir=[`off`,`10s`,`30s`,`1m`,`5m`],Lr=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},Rr=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function zr(e){let t={};typeof e.range==`string`&&Fr.includes(e.range)?t.range=e.range:Lr(e.from)&&Lr(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=Rr(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=jr(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function Br(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function Vr(e,t){let n=new URL(e);return n.search=Nr(Br({...zr(Pr(n.search)),drill:JSON.stringify(t)})),n.href}function Hr(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var Ur=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],Wr=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],Gr=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],Kr=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],qr=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],Jr=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],Yr={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},Xr={dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`],light:[`#2a78d6`,`#eb6834`,`#1baf7a`,`#4a3aa7`,`#eda100`,`#e87ba4`]},Zr={micro:11,small:12,body:14,title:16,section:22,page:32},Qr={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},$r={brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},ei={light:7,dark:5};function ti(e){let t=e.replace(`#`,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(2)+.0722*r(4)}function ni(e){let t=ti(e),n=1.05/(t+.05);return(t+.05)/.05>n?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function ri(e){return Object.fromEntries(Object.entries($r).map(([t,n])=>[`--fanout-color-${t}-contrast`,ni(n[ei[e]])]))}function ii(e){return t=>{let n=t.color??si.primaryColor,r=e({...t,color:n}),i=t.variant===`filled`||t.variant===void 0;return t.autoContrast===!1||!i||!Object.hasOwn($r,n)?r:{...r,color:`var(--fanout-color-${n}-contrast)`}}}var ai=.25,oi={xs:9,sm:10,md:11,lg:13,xl:16},si={primaryColor:`brand`,primaryShade:ei,autoContrast:!0,luminanceThreshold:ai,colors:{dark:Ur,brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},defaultRadius:`md`,fontFamily:Qr.body,fontFamilyMonospace:Qr.display,headings:{fontFamily:Qr.body,fontWeight:`600`},cursorType:`pointer`,components:{Tabs:{styles:(e,t)=>({tab:ui(t.color,`--tabs-text-color`)})},Pagination:{styles:(e,t)=>({control:ui(t.color,`--pagination-active-color`)})},Badge:{vars:(e,t)=>({root:li(t.size)})}}},ci=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":Yr.light.muted,...ri(`light`)},dark:ri(`dark`)});function li(e){let t=oi[e??`md`];return t===void 0||t>=Zr.micro?{}:{"--badge-fz":`${Zr.micro/16}rem`}}function ui(e,t){return!e||e===si.primaryColor?{[t]:`var(--fanout-color-${si.primaryColor}-contrast)`}:{}}export{Dt as $,yr as A,pr as B,Mr as C,br as D,_r as E,Er as F,an as G,Q as H,wr as I,Bt as J,rn as K,Or as L,Tr as M,Dr as N,Ar as O,kr as P,kt as Q,Cr as R,Nr as S,gr as T,Tn as U,dr as V,J as W,Vt as X,Ht as Y,At as Z,zr as _,ii as a,lt as at,Br as b,Yr as c,Ue as ct,Gr as d,Le as dt,St as et,Xr as f,Hr as g,Vr as h,ti as i,ft as it,xr as j,Sr as k,Qr as l,Be as lt,Kr as m,si as n,yt as nt,qr as o,rt as ot,Zr as p,G as q,ni as r,vt as rt,Wr as s,ot as st,ci as t,bt as tt,Jr as u,Re as ut,Fr as v,jr as w,Pr as x,Ir as y,hr as z}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index 57dbf98e7..e3b2ca265 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -21,7 +21,7 @@ document.documentElement.setAttribute("data-mantine-color-scheme", computed); } catch (e) {} - + @@ -30,7 +30,7 @@ - + diff --git a/scripts/dashboard-eval/mock.ts b/scripts/dashboard-eval/mock.ts index 6134c1bb3..94351dfbb 100644 --- a/scripts/dashboard-eval/mock.ts +++ b/scripts/dashboard-eval/mock.ts @@ -25,7 +25,7 @@ export function startMock(failure?:Failure) { const server=Bun.serve({hostname:'127.0.0.1',port:0,async fetch(req) { const path=new URL(req.url).pathname; if(req.headers.get('Fanout-Request')!=='1')return new Response(null,{status:403}); - if(path.startsWith('/api/agent/threads/'))return Response.json({messages:threads.get(path.split('/').at(-1)!)??[]}); + if(path.startsWith('/api/agent/threads/'))return Response.json({id:path.split('/').at(-1)!,messages:threads.get(path.split('/').at(-1)!)??[],updated_at:'2026-10-01 13:00:00'}); if(path.startsWith('/api/agent/runs/')&&req.method==='GET'){stats.status_reads++;return Response.json({status:statuses.get(path.split('/').at(-1)!)??'unknown'});} if(path.endsWith('/versions')) {stats.version_reads++;const id=path.split('/').at(-2)!;return Response.json({versions:Array.from({length:boards.get(id)?.version??0},(_,i)=>({version:i+1,author_kind:'agent'}))});} if(path==='/api/panels/query') { diff --git a/site/src/content/docs/reference/http-routes.mdx b/site/src/content/docs/reference/http-routes.mdx index 021985a26..84b3cdbf3 100644 --- a/site/src/content/docs/reference/http-routes.mdx +++ b/site/src/content/docs/reference/http-routes.mdx @@ -65,9 +65,9 @@ Capabilities map to roles in [roles](/reference/roles). | `GET` | `/.well-known/oauth-protected-resource/mcp` | protocol handshake | | `POST` | `/api/agent/runs` | `agent:run` | | `GET` | `/api/agent/threads` | `agent:run` | -| `DELETE` | `/api/agent/threads/:threadID` | `agent:run` | -| `GET` | `/api/agent/threads/:threadID` | `agent:run` | -| `PATCH` | `/api/agent/threads/:threadID` | `agent:run` | +| `DELETE` | `/api/agent/threads/:id` | `agent:run` | +| `GET` | `/api/agent/threads/:id` | `agent:run` | +| `PATCH` | `/api/agent/threads/:id` | `agent:run` | | `GET` | `/api/alerting/rules` | `telemetry:read` | | `POST` | `/api/alerting/rules` | `alerts:manage` | | `DELETE` | `/api/alerting/rules/:id` | `alerts:manage` | @@ -100,6 +100,7 @@ Capabilities map to roles in [roles](/reference/roles). | `Any` | `/api/mcp` | `telemetry:read` | | `POST` | `/api/panels/exemplars` | `telemetry:read` | | `POST` | `/api/panels/query` | `telemetry:read` | +| `POST` | `/api/panels/variables/resolve` | `telemetry:read` | | `GET` | `/api/settings/ingest` | `ingest:read-metadata` | | `POST` | `/api/settings/ingest/token/rotate` | `ingest:manage` | | `GET` | `/api/telemetry/schema` | `telemetry:read` | @@ -109,7 +110,6 @@ Capabilities map to roles in [roles](/reference/roles). | `DELETE` | `/api/users/:id` | `users:manage` | | `PATCH` | `/api/users/:id` | `users:manage` | | `POST` | `/api/users/:id/access/revoke` | `users:manage` | -| `POST` | `/api/variables/resolve` | `telemetry:read` | | `GET` | `/debug/pprof/` | `operations:read` | | `GET` | `/debug/pprof/:name` | `operations:read` | | `GET` | `/debug/pprof/cmdline` | `operations:read` | diff --git a/site/src/content/docs/reference/mcp-tools.mdx b/site/src/content/docs/reference/mcp-tools.mdx index 31c4a5271..92d7d9c19 100644 --- a/site/src/content/docs/reference/mcp-tools.mdx +++ b/site/src/content/docs/reference/mcp-tools.mdx @@ -43,7 +43,6 @@ AG-UI `mcp-app` activity content uses exactly `resource_uri`, `tool_name`, | [`get_dashboard`](#get_dashboard) | No — read-only | | [`get_intelligence_snapshot`](#get_intelligence_snapshot) | No — read-only | | [`get_observability_overview`](#get_observability_overview) | No — read-only | -| [`get_panel_exemplars`](#get_panel_exemplars) | No — read-only | | [`get_service_dependencies`](#get_service_dependencies) | No — read-only | | [`get_service_performance`](#get_service_performance) | No — read-only | | [`get_service_topology`](#get_service_topology) | No — read-only | @@ -51,6 +50,7 @@ AG-UI `mcp-app` activity content uses exactly `resource_uri`, `tool_name`, | [`inspect_trace`](#inspect_trace) | No — read-only | | [`list_dashboard_versions`](#list_dashboard_versions) | No — read-only | | [`list_dashboards`](#list_dashboards) | No — read-only | +| [`list_panel_exemplars`](#list_panel_exemplars) | No — read-only | | [`preview_panels`](#preview_panels) | No — read-only | | [`query_panel_fragment`](#query_panel_fragment) | No — read-only | | [`query_telemetry`](#query_telemetry) | No — read-only | @@ -116,26 +116,6 @@ Read-only. Calling it changes nothing. | `to` | `string` | no | Absolute end, RFC3339Nano; requires from and excludes window | | `window` | `string` | no | Time window such as 15m, 1h, 24h, 168h, or 720h; defaults to 1h | -## get_panel_exemplars - -**Panel exemplars** — Find bounded traces for a panel selection. - -Read-only. Calling it changes nothing. - -**Visibility:** app only; no resource attachment. - -| Input | Type | Required | Means | -|---|---|---|---| -| `dashboard` | `object` | **yes** | Complete v1 dashboard specification; every panel is executed | -| `from` | `string` | **yes** | Selection start as an RFC3339Nano UTC timestamp | -| `panel_id` | `string` | **yes** | ID of the selected panel in dashboard | -| `to` | `string` | **yes** | Selection end as an RFC3339Nano UTC timestamp, after from | -| `bucket` | `object` | no | Optional selected bucket with its exact bounds | -| `dimensions` | `object` | no | Exact dimension values of the selected series or row | -| `kind` | `string` | no | Selection signal: traces or logs; defaults from the selected panel | -| `time` | `object` | no | Optional dashboard time override: exact from/to or a relative range | -| `vars` | `object` | no | Resolved variable values: strings or lists; preserves $__all and empty lists | - ## get_service_dependencies **Service dependency traversal** — Find upstream or downstream dependencies of one service with minimum hop counts. Uses the full scoped edge rollup, handles cycles, and reports truncation from depth or node limits. @@ -231,6 +211,26 @@ Read-only. Calling it changes nothing. Takes no arguments. +## list_panel_exemplars + +**Panel exemplars** — Find bounded traces for a panel selection. + +Read-only. Calling it changes nothing. + +**Visibility:** app only; no resource attachment. + +| Input | Type | Required | Means | +|---|---|---|---| +| `dashboard` | `object` | **yes** | Complete v1 dashboard specification; every panel is executed | +| `from` | `string` | **yes** | Selection start as an RFC3339Nano UTC timestamp | +| `panel_id` | `string` | **yes** | ID of the selected panel in dashboard | +| `to` | `string` | **yes** | Selection end as an RFC3339Nano UTC timestamp, after from | +| `bucket` | `object` | no | Optional selected bucket with its exact bounds | +| `dimensions` | `object` | no | Exact dimension values of the selected series or row | +| `kind` | `string` | no | Selection signal: traces or logs; defaults from the selected panel | +| `time` | `object` | no | Optional dashboard time override: exact from/to or a relative range | +| `vars` | `object` | no | Resolved variable values: strings or lists; preserves $__all and empty lists | + ## preview_panels **Preview panels** — Check and run panels without saving them. Each panel reports ok with rows and a sample, empty with the reason, error, or invalid with the exact field and a suggestion. The result includes total elapsed_ms and executed per-panel elapsed_ms; invalid and not_run panels omit elapsed_ms because they were not executed. Fix every invalid panel and replace or explain every empty one before saving. Spec guide: see create_dashboard. @@ -279,7 +279,7 @@ Read-only. Calling it changes nothing. **Replace dashboard** — Replace a dashboard's whole spec; omitted panels are removed. Use only for a redesign the user asked for; use edit_dashboard to change a few panels. Successful saves return a receipt for that committed version: base_version, version, changes, layout_changed, dashboard_fields and save_check. Changes describe authored panel fields and position_changed; physical packing is only layout_changed. Order chips mark the minimal moved set. save_check reports checked, reason when unchecked, total elapsed_ms and one status/rows result per saved panel with elapsed_ms when executed. checked means every panel was executed, not that error or empty panels are healthy. Text rows identify nonempty content, not telemetry. Use the structured receipt rather than prose warnings as check evidence. Create receipts list added panels without layout or dashboard edit chips. No-op saves still create a new version with no change chips. Per-panel elapsed_ms is omitted when the panel did not run. See create_dashboard for the spec guide. -**Replaces existing state.** Calling it twice with the same arguments leaves the same result as calling it once, but the first call has already overwritten what was there. +**Replaces existing state.** | Input | Type | Required | Means | |---|---|---|---| diff --git a/ui/host/e2e/smoke.spec.ts b/ui/host/e2e/smoke.spec.ts index a32be32d2..d68ecb322 100644 --- a/ui/host/e2e/smoke.spec.ts +++ b/ui/host/e2e/smoke.spec.ts @@ -34,6 +34,14 @@ const expectedElements: Record = { service_map: '[role=region][aria-label*="service dependency graph"] button', health: "[data-health-tiles]", }; +test("resolves dashboard variables through the panel route", async ({ request }) => { + const response = await request.post("/api/panels/variables/resolve", { + headers: { "Fanout-Request": "1" }, data: { dashboard: spec }, + }); + expect(response.status()).toBe(200); + expect(await response.json()).toHaveProperty("options"); +}); + async function rendered(card: Locator, panel: { title: string; viz: string }, result?: ObservedResult) { const { viz, title } = panel; await expect(card.locator('[aria-label="Loading panel"], [aria-label="Refreshing"]')).toHaveCount(0); diff --git a/ui/host/src/answer-only.test.tsx b/ui/host/src/answer-only.test.tsx index b7723c8e5..24ced37fd 100644 --- a/ui/host/src/answer-only.test.tsx +++ b/ui/host/src/answer-only.test.tsx @@ -35,7 +35,7 @@ it("carries answer-only through openChat and HttpAgent, retains it on retry and const events = [{ type: "RUN_STARTED", threadId: body.threadId, runId: body.runId }, { type: "RUN_FINISHED", threadId: body.threadId, runId: body.runId }]; return new Response(events.map(event => `data: ${JSON.stringify(event)}\n\n`).join(""), { headers: { "Content-Type": "text/event-stream" } }); } - return Response.json(path === "/api/dashboards" ? { dashboards: [] } : { messages: [], threads: [], nextCursor: "" }); + return Response.json(path === "/api/dashboards" ? { dashboards: [] } : { messages: [], items: [], next_cursor: null }); })); const rootRoute = createRootRoute({ component: App }); const chat = createRoute({ getParentRoute: () => rootRoute, path: "/chat/$threadId", component: Controls }); diff --git a/ui/host/src/app.test.tsx b/ui/host/src/app.test.tsx index 51f13fd0d..6a11f7f3f 100644 --- a/ui/host/src/app.test.tsx +++ b/ui/host/src/app.test.tsx @@ -73,7 +73,7 @@ describe("Session", () => { fetchMock.mockImplementation(async (input) => { const url = new URL(String(input), "http://localhost"); if (url.pathname === "/api/dashboards") return json({ dashboards: [] }); - if (url.pathname === "/api/agent/threads") return json({ threads: [], nextCursor: "" }); + if (url.pathname === "/api/agent/threads") return json({ items: [], next_cursor: null }); if (url.pathname.startsWith("/api/agent/threads/")) return json({ message: "not found" }, 404); throw new Error(`unexpected request: ${url.pathname}`); }); @@ -101,7 +101,7 @@ describe("Session", () => { fetchMock.mockImplementation(async (input) => { const url = new URL(String(input), "http://localhost"); if (url.pathname === "/api/dashboards") return json({ dashboards: [{ id: "saved-1", name: "Cart errors", version: 2, panel_count: 2 }] }); - if (url.pathname === "/api/agent/threads") return json({ threads: [], nextCursor: "" }); + if (url.pathname === "/api/agent/threads") return json({ items: [], next_cursor: null }); return json({ message: "not found" }, 404); }); const content = JSON.stringify({ dashboard: { id: "saved-1", name: "Cart errors", version: 2, spec: { name: "Cart errors" } }, receipt: {base_version: name === "create_dashboard" ? 0 : 1, version: 2, changes: [], layout_changed: false, save_check: {checked: true, elapsed_ms: 12, panels: []}} }); @@ -166,7 +166,7 @@ describe("Session", () => { { id: "dash-main", name: "System overview", description: "", is_default: true, version: 1, panel_count: 4, updated_at: "2026-07-22 03:00:00" }, { id: "dash-checkout", name: "Checkout", description: "", is_default: false, version: 1, panel_count: 2, updated_at: "2026-07-22 03:00:00" }, ] }); - return json({ threads: [], nextCursor: "" }); + return json({ items: [], next_cursor: null }); }); const rootRoute = createRootRoute({ component: App }); const detail = createRoute({ getParentRoute: () => rootRoute, path: "/dashboards/$dashboardId", validateSearch: (raw: Record) => toSearchParams(parseSearch(raw)), component: () =>
Dashboard
}); @@ -236,7 +236,7 @@ describe("Session", () => { if(terminal==='run_throw')agentMocks.runAgent.mockImplementationOnce(()=>new Promise((_resolve,reject)=>{rejectRun=reject;})); fetchMock.mockImplementation(async input=>{ const path=new URL(String(input),"https://fanout.example.com").pathname; - return json(path==='/api/dashboards'?{dashboards:[]}:path==='/api/agent/threads'?{threads:[],nextCursor:""}:{messages:[]}); + return json(path==='/api/dashboards'?{dashboards:[]}:path==='/api/agent/threads'?{items:[],next_cursor:null}:{messages:[]}); }); window.happyDOM.setURL("https://fanout.example.com/chat/thread"); const rootRoute=createRootRoute({component:App}); @@ -303,7 +303,7 @@ describe("Session", () => { fetchMock.mockImplementation(async (input) => { const url = new URL(String(input), "http://localhost"); if (url.pathname === "/api/dashboards") return json({ dashboards: [] }); - if (url.pathname === "/api/agent/threads") return json({ threads: [], nextCursor: "" }); + if (url.pathname === "/api/agent/threads") return json({ items: [], next_cursor: null }); if (url.pathname.startsWith("/api/agent/threads/")) { threadRequests += 1; return threadRequests === 1 ? json({ message: "boom" }, 500) : json({ message: "not found" }, 404); diff --git a/ui/host/src/chat.test.tsx b/ui/host/src/chat.test.tsx index 667f14a9d..4216202dd 100644 --- a/ui/host/src/chat.test.tsx +++ b/ui/host/src/chat.test.tsx @@ -33,7 +33,7 @@ async function mountStreamChat(stored: Message[] = [{ id: "old-answer", role: "a requests.push(JSON.parse(String(init?.body))); return new Response(new ReadableStream({ start(c) { controller = c; init?.signal?.addEventListener("abort", () => c.error(new DOMException("Aborted", "AbortError")), { once: true }); } }), { headers: { "Content-Type": "text/event-stream" } }); } - const body = path === "/api/dashboards" ? { dashboards: [] } : path === "/api/agent/threads" ? { threads: [], nextCursor: "" } : { messages: stored }; + const body = path === "/api/dashboards" ? { dashboards: [] } : path === "/api/agent/threads" ? { items: [], next_cursor: null } : { messages: stored }; return Response.json(body); }); vi.stubGlobal("fetch", fetchMock); diff --git a/ui/host/src/dashboards/api.ts b/ui/host/src/dashboards/api.ts index e84b2ea9a..4a225b3cf 100644 --- a/ui/host/src/dashboards/api.ts +++ b/ui/host/src/dashboards/api.ts @@ -54,7 +54,7 @@ export const patchDashboard = (id: string, operations: Operation[], baseVersion: export const queryPanels = (body: QueryBody, signal?: AbortSignal) => request<{ results: PanelResult[] }>("/api/panels/query", { method: "POST", json: body, signal }).then((r) => r.results); export const queryAnnotations = (body: AnnotationBody, signal?: AbortSignal) => request("/api/annotations", { method: "POST", json: body, signal }); export const resolveVariables = (body: Omit, signal?: AbortSignal) => - request<{ options: Record }>("/api/variables/resolve", { method: "POST", json: body, signal }).then((r) => r.options); + request<{ options: Record }>("/api/panels/variables/resolve", { method: "POST", json: body, signal }).then((r) => r.options); export type ExemplarBody = { dashboard: DashboardSpec; panel_id: string; kind?: "traces" | "logs"; time?: DashboardTime; from: string; to: string; dimensions?: Record; bucket?: Selection["bucket"]; vars?: Record }; export type Exemplar = { trace_id: string; namespace: string; service: string; operation: string; duration_ms: number; status: string; start: string }; diff --git a/ui/host/src/dashboards/page.test.tsx b/ui/host/src/dashboards/page.test.tsx index 64d39f3d7..ed80be254 100644 --- a/ui/host/src/dashboards/page.test.tsx +++ b/ui/host/src/dashboards/page.test.tsx @@ -87,7 +87,7 @@ beforeEach(() => { if (url.pathname === "/api/dashboards") return listResponse(); if (url.pathname === "/api/dashboards/d1") return json(servedRecord); if (url.pathname === "/api/dashboards/missing") return json({ message: "dashboard not found" }, 404); - if (url.pathname === "/api/variables/resolve") return variableResponse(); + if (url.pathname === "/api/panels/variables/resolve") return variableResponse(); if (url.pathname === "/api/annotations") return annotationResponse(); if (url.pathname === "/api/panels/query") { const body = JSON.parse(String(init?.body)) as { panels: string[]; dashboard: { panels: { id: string }[] } }; @@ -241,7 +241,7 @@ describe("DashboardPage", () => { const search: DashboardSearch = { from: "2026-10-01T12:00:00Z", to: "2026-10-01T13:00:00Z", vars: { service: "cart" }, compare: "1", view: "latency", drill: JSON.stringify({ panel_id: "latency", kind: "traces", from: "2026-10-01T12:00:00Z", to: "2026-10-01T13:00:00Z", window_from: "2026-10-01T12:00:00Z", window_to: "2026-10-01T13:00:00Z", dimensions: {} }) }; const { client, onSearch } = await render(search); const count = queryBodies.length; - const variableCount = fetchMock.mock.calls.filter(([input]) => String(input) === "/api/variables/resolve").length; + const variableCount = fetchMock.mock.calls.filter(([input]) => String(input) === "/api/panels/variables/resolve").length; await act(async () => [...document.querySelectorAll("button")].find(button => button.textContent === "History")!.click()); await settle(client); expect(queryBodies).toHaveLength(count); @@ -253,7 +253,7 @@ describe("DashboardPage", () => { if (removed) expect(onSearch).toHaveBeenCalledWith({ ...search, view: undefined, drill: undefined }, true); else expect(onSearch).not.toHaveBeenCalled(); expect(queryBodies.length).toBeGreaterThan(count); - expect(fetchMock.mock.calls.filter(([input]) => String(input) === "/api/variables/resolve").length).toBeGreaterThan(variableCount); + expect(fetchMock.mock.calls.filter(([input]) => String(input) === "/api/panels/variables/resolve").length).toBeGreaterThan(variableCount); const laterBatches = queryBodies.slice(count) as { dashboard: { panels: { id: string }[] } }[]; if (removed) expect(laterBatches.every(body => body.dashboard.panels.every(panel => panel.id !== "latency"))).toBe(true); }); @@ -518,8 +518,8 @@ describe("DashboardPage", () => { variableResponse = () => new Promise(() => {}); panelResponse = () => new Promise(() => {}); const { rerender } = await render({}, "d1", false); - await vi.waitFor(() => expect(fetchMock.mock.calls.filter(([input]) => /\/api\/(panels\/query|variables\/resolve)$/.test(String(input)))).toHaveLength(2), { interval: 5, timeout: 3000 }); - const signals = fetchMock.mock.calls.filter(([input]) => /\/api\/(panels\/query|variables\/resolve)$/.test(String(input))) + await vi.waitFor(() => expect(fetchMock.mock.calls.filter(([input]) => /\/api\/(panels\/(query|variables\/resolve))$/.test(String(input)))).toHaveLength(2), { interval: 5, timeout: 3000 }); + const signals = fetchMock.mock.calls.filter(([input]) => /\/api\/(panels\/(query|variables\/resolve))$/.test(String(input))) .map(([, init]) => init?.signal); expect(signals).toHaveLength(2); expect(signals.every((signal) => signal instanceof AbortSignal)).toBe(true); @@ -612,7 +612,7 @@ describe("dashboard batch regressions", () => { else variableResponse = async () => json({ message: "Invalid" }, 400); const { client } = await render(); await settle(client); - const path = kind === "panels" ? "/api/panels/query" : "/api/variables/resolve"; + const path = kind === "panels" ? "/api/panels/query" : "/api/panels/variables/resolve"; await vi.waitFor(() => expect(fetchMock.mock.calls.filter(([input]) => String(input) === path)).toHaveLength(1), { interval: 5, timeout: 3000 }); }); }); @@ -637,7 +637,7 @@ it.each(["panels", "variables"])("retries server errors at most twice for %s", a else variableResponse = async () => json({ message: "Server failed" }, 500); const { host, client } = await render(); await settle(client); - const path = kind === "panels" ? "/api/panels/query" : "/api/variables/resolve"; + const path = kind === "panels" ? "/api/panels/query" : "/api/panels/variables/resolve"; await vi.waitFor(() => expect(fetchMock.mock.calls.filter(([input]) => String(input) === path)).toHaveLength(3), { interval: 5, timeout: 3000 }); await vi.waitFor(() => expect(host.textContent).toContain("Server failed"), { interval: 5, timeout: 3000 }); }); diff --git a/ui/host/src/mcp-apps/transport.test.ts b/ui/host/src/mcp-apps/transport.test.ts index f0ddb4ea5..ac40600d9 100644 --- a/ui/host/src/mcp-apps/transport.test.ts +++ b/ui/host/src/mcp-apps/transport.test.ts @@ -56,5 +56,5 @@ it("resolves options and exemplars only through the bridge", async () => { const body = { dashboard: fixture().dashboard, panel_id: "p", from: "a", to: "b", vars: { service: [] } }; await transport.drill.exemplars(body, controller.signal); expect(callServerTool.mock.calls[0][0].name).toBe("resolve_panel_variables"); - expect(callServerTool).toHaveBeenLastCalledWith({ name: "get_panel_exemplars", arguments: body }, { signal: controller.signal }); + expect(callServerTool).toHaveBeenLastCalledWith({ name: "list_panel_exemplars", arguments: body }, { signal: controller.signal }); }); diff --git a/ui/host/src/mcp-apps/transport.ts b/ui/host/src/mcp-apps/transport.ts index bbb62059d..9a94b3cbd 100644 --- a/ui/host/src/mcp-apps/transport.ts +++ b/ui/host/src/mcp-apps/transport.ts @@ -20,7 +20,7 @@ export function appTransport(app: App) { return result.structuredContent as T; } const drill: DrillClient = { - exemplars: (body, signal) => call("get_panel_exemplars", { ...body }, signal), + exemplars: (body, signal) => call("list_panel_exemplars", { ...body }, signal), trace: async (target, signal) => { const fragment = panelFragment(await call("inspect_trace", { trace_id: target.trace_id, namespace: target.namespace, from: target.window_from, to: target.window_to, limit: 200 }, signal)); if (!fragment.trace) throw new Error("Trace unavailable"); diff --git a/ui/host/src/rail.test.tsx b/ui/host/src/rail.test.tsx index 28302dc53..3eeefc920 100644 --- a/ui/host/src/rail.test.tsx +++ b/ui/host/src/rail.test.tsx @@ -13,8 +13,8 @@ function json(body: unknown, status = 200) { function threadsPage(query = "") { return json({ - threads: [{ threadId: "thread-checkout", title: query ? `Result for ${query}` : "Checkout latency", updatedAt: "2026-07-22 03:00:00" }], - nextCursor: "", + items: [{ id: "thread-checkout", title: query ? `Result for ${query}` : "Checkout latency", updated_at: "2026-07-22 03:00:00" }], + next_cursor: null, }); } @@ -82,6 +82,8 @@ describe("Rail", () => { expect(document.body.textContent).toContain("Chats"); expect(document.body.textContent).toContain("Dashboards"); expect(document.body.textContent).not.toContain("Investigation"); + const historyRequest = fetchMock.mock.calls.find(([input]) => new URL(String(input), "http://localhost").pathname === "/api/agent/threads"); + expect(new URL(String(historyRequest?.[0]), "http://localhost").searchParams.get("page_size")).toBe("30"); const activeRows = document.querySelectorAll('[aria-current="page"]'); expect(activeRows).toHaveLength(2); @@ -100,6 +102,27 @@ describe("Rail", () => { await act(async () => root.unmount()); }); + it("loads the next history page and stops at a null cursor", async () => { + fetchMock.mockImplementation(async (input, init) => { + const url = new URL(String(input), "http://localhost"); + if (url.pathname !== "/api/agent/threads") return respond(input, init); + return url.searchParams.has("cursor") + ? json({ items: [{ id: "thread-older", title: "Older chat", updated_at: "2026-07-21 03:00:00" }], next_cursor: null }) + : json({ items: [{ id: "thread-checkout", title: "Checkout latency", updated_at: "2026-07-22 03:00:00" }], next_cursor: "opaque-cursor" }); + }); + const { root, render } = mount(); + try { + await act(async () => render()); + await vi.waitFor(() => expect(document.body.textContent).toContain("See all")); + const more = Array.from(document.querySelectorAll("button")).find(button => button.textContent === "See all"); + await act(async () => more!.click()); + await vi.waitFor(() => expect(document.body.textContent).toContain("Older chat")); + expect(document.body.textContent).toContain("Checkout latency"); + expect(document.body.textContent).not.toContain("See all"); + expect(fetchMock.mock.calls.some(([input]) => new URL(String(input), "http://localhost").searchParams.get("cursor") === "opaque-cursor")).toBe(true); + } finally { await act(async () => root.unmount()); } + }); + it("loads persisted provenance across threads and reload without per-dashboard requests", async () => { fetchMock.mockImplementation(async (input,init) => String(input)==="/api/dashboards" ? json({dashboards:[{id:"origin-board",name:"Origin board",origin:{thread_id:"source-thread",message_id:"user",request_excerpt:"Build latency "}}]}) : respond(input,init)); for(let reload=0;reload<2;reload++) { @@ -183,12 +206,12 @@ describe("Rail", () => { it("groups chats in a fixed section order regardless of API order", async () => { const now = new Date(); const sqliteTimestamp = (date: Date) => date.toISOString().slice(0, 19).replace("T", " "); - const todayThread = { threadId: "thread-standup", title: "Standup notes", updatedAt: sqliteTimestamp(now) }; - const olderThread = { threadId: "thread-historical", title: "Historical chat", updatedAt: sqliteTimestamp(new Date(now.getTime() - 10 * 24 * 60 * 60 * 1000)) }; + const todayThread = { id: "thread-standup", title: "Standup notes", updated_at: sqliteTimestamp(now) }; + const olderThread = { id: "thread-historical", title: "Historical chat", updated_at: sqliteTimestamp(new Date(now.getTime() - 10 * 24 * 60 * 60 * 1000)) }; fetchMock.mockImplementation(async (input) => { const url = new URL(String(input), "http://localhost"); if (url.pathname === "/api/dashboards") return dashboards(); - if (url.pathname === "/api/agent/threads") return json({ threads: [olderThread, todayThread], nextCursor: "" }); + if (url.pathname === "/api/agent/threads") return json({ items: [olderThread, todayThread], next_cursor: null }); throw new Error(`unexpected request: ${url.pathname}`); }); const { root, render } = mount(); diff --git a/ui/host/src/rail.tsx b/ui/host/src/rail.tsx index c9dc22583..d8ec0256c 100644 --- a/ui/host/src/rail.tsx +++ b/ui/host/src/rail.tsx @@ -24,11 +24,11 @@ export type RailProps = { ref?: Ref; }; -type ThreadSummary = { threadId: string; title: string; updatedAt: string }; -type ThreadPage = { threads: ThreadSummary[]; nextCursor: string }; +type ThreadSummary = { id: string; title: string; updated_at: string }; +type ThreadPage = { items: ThreadSummary[]; next_cursor: string | null }; async function fetchThreads(query: string, cursor: string): Promise { - const params = new URLSearchParams({ limit: "30" }); + const params = new URLSearchParams({ page_size: "30" }); if (query) params.set("q", query); if (cursor) params.set("cursor", cursor); const response = await authorizedFetch(`/api/agent/threads?${params}`); @@ -53,11 +53,11 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID queryKey: [...threadHistoryQueryKey, query], queryFn: ({ pageParam }) => fetchThreads(query, pageParam), initialPageParam: "", - getNextPageParam: (last) => last.nextCursor || undefined, + getNextPageParam: (last) => last.next_cursor ?? undefined, enabled: agentAvailable, }); const dashboards = useQuery({ queryKey: dashboardsKey, queryFn: listDashboards, refetchInterval: 30_000, staleTime: dashboardsStaleTime }); - const threads = useMemo(() => history.data?.pages.flatMap((page) => page.threads) ?? [], [history.data]); + const threads = useMemo(() => history.data?.pages.flatMap((page) => page.items) ?? [], [history.data]); const groups = useMemo(() => groupThreads(threads), [threads]); // Searching for a service used to answer "No matching chats / No matching // dashboards" while that service was live, traced and logged — the search @@ -86,7 +86,7 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID if (!renaming || !renameTitle.trim()) return; setBusy(true); setMutationError(""); try { - const response = await authorizedFetch(`/api/agent/threads/${encodeURIComponent(renaming.threadId)}`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ title: renameTitle.trim() }) }); + const response = await authorizedFetch(`/api/agent/threads/${encodeURIComponent(renaming.id)}`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ title: renameTitle.trim() }) }); if (!response.ok) throw new Error(`Unable to rename chat (${response.status})`); await queryClient.invalidateQueries({ queryKey: threadHistoryQueryKey }); setRenaming(null); @@ -99,9 +99,9 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID if (!deleting) return; setBusy(true); setMutationError(""); try { - const response = await authorizedFetch(`/api/agent/threads/${encodeURIComponent(deleting.threadId)}`, { method: "DELETE" }); + const response = await authorizedFetch(`/api/agent/threads/${encodeURIComponent(deleting.id)}`, { method: "DELETE" }); if (!response.ok) throw new Error(`Unable to delete chat (${response.status})`); - const deletedID = deleting.threadId; + const deletedID = deleting.id; setDeleting(null); await queryClient.invalidateQueries({ queryKey: threadHistoryQueryKey }); await queryClient.invalidateQueries({ queryKey: dashboardsKey }); @@ -122,7 +122,7 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID {!history.isLoading && !history.isError && threads.length === 0 && {query ? "No matching chats" : "No chats yet"}} {groups.map((group) => {groups.length > 1 && {group.label}} - {group.threads.map((thread) => onSelectThread(thread.threadId)} onRename={() => beginRename(thread)} onDelete={() => { setMutationError(""); setDeleting(thread); }} />)} + {group.threads.map((thread) => onSelectThread(thread.id)} onRename={() => beginRename(thread)} onDelete={() => { setMutationError(""); setDeleting(thread); }} />)} )} {history.hasNextPage && } } @@ -206,7 +206,7 @@ function ThreadRow({ thread, active, onSelect, onRename, onDelete }: { thread: T {thread.title} - {threadTime(thread.updatedAt)} + {threadTime(thread.updated_at)} @@ -241,7 +241,7 @@ function groupThreads(threads: ThreadSummary[]): Array<{ label: string; threads: const day = 24 * 60 * 60 * 1000; const groups = new Map(); for (const thread of threads) { - const age = Math.floor((today - dayStart(parseSQLiteTime(thread.updatedAt))) / day); + const age = Math.floor((today - dayStart(parseSQLiteTime(thread.updated_at))) / day); const label = age <= 0 ? "Today" : age === 1 ? "Yesterday" : age <= 7 ? "Previous 7 days" : "Older"; const group = groups.get(label) ?? []; group.push(thread); From fafc2de80fe07bb721dba13c927033b2da693d7c Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Fri, 9 Oct 2026 11:06:58 -0700 Subject: [PATCH 2/2] refactor(auth,api,db)!: separate user profile, role and status User accounts follow the shared user conventions: role and status changes are separate operations from profile edits, and the fields use the shared names. - Migration 20261009000000 renames users.name to display_name and replaces the active flag with status ('active' or 'suspended'). - PATCH /api/users/{id} changes only email and display_name. PATCH /api/users/{id}/role and PATCH /api/users/{id}/status are new, admin-only routes. All three reject unknown fields and bound the body. - User JSON, including /api/auth/me and setup, uses display_name and status. - Suspension blocks every sign-in path, sessions and OAuth tokens as inactive accounts did. Role and status changes still revoke sessions, and the last active administrator is still protected. - The suspension audit event is user.suspended. BREAKING CHANGE: user JSON fields and the user update routes change with no aliases. --- AGENTS.md | 2 + cmd/fanout/main.go | 4 +- docs/authentication.md | 32 +- internal/api/auth.go | 22 +- internal/api/auth_middleware.go | 3 +- internal/api/auth_test.go | 43 +-- internal/api/oauth.go | 6 +- internal/api/oidc.go | 12 +- internal/api/oidc_test.go | 22 +- internal/api/users.go | 84 +++-- internal/api/users_test.go | 289 +++++++++++++++++- internal/auth/audit.go | 2 +- internal/auth/oauth_store.go | 14 +- internal/auth/oauth_store_test.go | 14 +- internal/auth/user_store.go | 104 ++++--- internal/auth/user_store_test.go | 2 +- internal/db/generated/models.go | 4 +- internal/db/generated/users.sql.go | 66 ++-- .../20261009000000_user_profile_status.sql | 5 + internal/db/migrations_test.go | 7 +- internal/db/queries/users.sql | 6 +- internal/db/users_schema_test.go | 77 +++++ internal/mcp/concurrent_receipts_test.go | 2 +- internal/mcp/dashboards_tools_test.go | 2 +- internal/mcp/server_test.go | 4 +- internal/panel/filter_test.go | 2 +- internal/store/store_test.go | 4 +- .../{auth-CQerCjF_.js => auth-BLat7TXI.js} | 2 +- .../{chat-Dr6SwXRM.js => chat-CnBaUKaM.js} | 4 +- .../ui/dist/assets/chat._threadId-B2BwBfS8.js | 1 - .../ui/dist/assets/chat._threadId-DrWvJyZf.js | 1 + .../ui/dist/assets/chat.index-B2BwBfS8.js | 1 - .../ui/dist/assets/chat.index-DrWvJyZf.js | 1 + ...js => dashboards._dashboardId-B_qsLVgC.js} | 2 +- ...nZ9Vkj.js => dashboards.index-DFcSFkLA.js} | 2 +- .../{index-G9N3n5OB.js => index-ZMM27O4I.js} | 6 +- ...-BW8pt9vy.js => mcp-app-frame-DT6-Vfjz.js} | 2 +- .../{page-DclWQ-lK.js => page-CSqb2kMb.js} | 2 +- ...{routes-CmpBxgdE.js => routes-dVrgKMot.js} | 2 +- ...tings-Civ3-rvD.js => settings-BZC7Pr0f.js} | 2 +- .../{theme-BKAYKhPv.js => theme-ByHk_Blp.js} | 2 +- internal/ui/dist/index.html | 6 +- .../docs/explanation/authentication-modes.mdx | 19 ++ .../content/docs/reference/http-routes.mdx | 2 + site/src/content/docs/start/first-boot.mdx | 3 + ui/host/e2e/global-setup.ts | 2 +- ui/host/src/answer-only.test.tsx | 2 +- ui/host/src/app.test.tsx | 6 +- ui/host/src/auth.test.tsx | 38 ++- ui/host/src/auth.tsx | 14 +- ui/host/src/chat.test.tsx | 2 +- ui/host/src/dashboards/page.test.tsx | 2 +- ui/host/src/settings.test.tsx | 2 +- ui/host/src/shell.tsx | 2 +- 54 files changed, 719 insertions(+), 245 deletions(-) create mode 100644 internal/db/migrations/20261009000000_user_profile_status.sql create mode 100644 internal/db/users_schema_test.go rename internal/ui/dist/assets/{auth-CQerCjF_.js => auth-BLat7TXI.js} (55%) rename internal/ui/dist/assets/{chat-Dr6SwXRM.js => chat-CnBaUKaM.js} (98%) delete mode 100644 internal/ui/dist/assets/chat._threadId-B2BwBfS8.js create mode 100644 internal/ui/dist/assets/chat._threadId-DrWvJyZf.js delete mode 100644 internal/ui/dist/assets/chat.index-B2BwBfS8.js create mode 100644 internal/ui/dist/assets/chat.index-DrWvJyZf.js rename internal/ui/dist/assets/{dashboards._dashboardId-eTWiXAiz.js => dashboards._dashboardId-B_qsLVgC.js} (62%) rename internal/ui/dist/assets/{dashboards.index-BtnZ9Vkj.js => dashboards.index-DFcSFkLA.js} (55%) rename internal/ui/dist/assets/{index-G9N3n5OB.js => index-ZMM27O4I.js} (98%) rename internal/ui/dist/assets/{mcp-app-frame-BW8pt9vy.js => mcp-app-frame-DT6-Vfjz.js} (99%) rename internal/ui/dist/assets/{page-DclWQ-lK.js => page-CSqb2kMb.js} (99%) rename internal/ui/dist/assets/{routes-CmpBxgdE.js => routes-dVrgKMot.js} (74%) rename internal/ui/dist/assets/{settings-Civ3-rvD.js => settings-BZC7Pr0f.js} (98%) rename internal/ui/dist/assets/{theme-BKAYKhPv.js => theme-ByHk_Blp.js} (99%) diff --git a/AGENTS.md b/AGENTS.md index 365da18c5..53eefe76c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -114,6 +114,8 @@ resources and protocol-defined contracts keep their own semantics. Each segment should have a domain, resource, or action meaning; do not mechanically split compound words. Colon actions are conventions in other API ecosystems. +- User profile PATCH uses `/api/users/{id}` with `email` and `display_name`; + role and status PATCH use `/api/users/{id}/role` and `/api/users/{id}/status`. - Equivalent authentication flows use `/api/auth/me`, `/api/auth/code/send`, `/api/auth/code/verify`, and `POST /api/auth/logout`. Flow selection, passkeys, account linking, and sign-in link verification are distinct operations. diff --git a/cmd/fanout/main.go b/cmd/fanout/main.go index 82b8ecf42..8f7add0cb 100644 --- a/cmd/fanout/main.go +++ b/cmd/fanout/main.go @@ -554,8 +554,8 @@ func createLoginLink(cfg config.Config, rawEmail string, output io.Writer) error if err != nil { return err } - if !user.Active { - return fmt.Errorf("user %s is inactive", email) + if user.Status != auth.UserStatusActive { + return fmt.Errorf("user %s is suspended", email) } token, err := auth.NewCodeStore(sqlite.DB, cfg.AuthCodeSecret).CreateLoginLink(email) if err != nil { diff --git a/docs/authentication.md b/docs/authentication.md index 9af92c267..4dd4ea402 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -62,7 +62,7 @@ role is fixed: self-signup can never create an operator or administrator. The setting requires complete SMTP configuration and local auth mode. Self-signup remains unavailable until the first administrator completes setup. -Inactive accounts are not recreated or reactivated. Public installations +Suspended accounts are not recreated or reactivated. Public installations should enforce traffic and AI-budget limits at the deployment edge; Fanout also retains its per-IP, per-address, expiry, and attempt limits described below. @@ -82,7 +82,7 @@ docker exec fanout --config /etc/fanout/fanout.yaml \ login-link admin@example.com ``` -The command refuses missing or inactive users and a missing control database. +The command refuses missing or suspended users and a missing control database. It writes a hashed credential and a `login_link.issued` audit event, then prints one URL to stderr. The URL expires after 15 minutes, works once, and writes a distinct `login_link.redeemed` audit event when used. Running it while Fanout is @@ -92,6 +92,28 @@ Fix SMTP after regaining access if email-code login is expected. OIDC-mode recovery remains at the identity provider or OIDC configuration layer; local login links are deliberately unavailable in that mode. +### User account API + +All user-management routes require an administrator. User projections, including +`GET /api/auth/me` and `GET /api/users`, expose `display_name` and `status`. +Status is either `active` or `suspended`; roles remain `viewer`, `operator`, +and `admin`. + +- `POST /api/users` provisions an account with `email`, `display_name`, and + `role`. New accounts have status `active`. +- `PATCH /api/users/{id}` changes only `email` and `display_name`; omitted + profile fields retain their values. +- `PATCH /api/users/{id}/role` accepts only `{"role":"viewer"}` (or + `operator` or `admin`). +- `PATCH /api/users/{id}/status` accepts only `{"status":"suspended"}` or + `{"status":"active"}`. + +Unknown fields return `400`. Email, role, and status changes revoke browser +sessions. Suspension also blocks sign-in and OAuth token use. Demotion, +suspension, and deletion cannot remove the last active administrator. +The first-run `POST /api/auth/setup` request uses `display_name` alongside +`email` and `setup_token`. + ### Adding local users without SMTP User creation remains available when SMTP is not configured. The API returns @@ -101,15 +123,15 @@ same command shown above and deliver it through a trusted channel. When SMTP is configured, Fanout sends the invitation synchronously and reports relay failure rather than claiming it was delivered. -If the local account is inactive or its address is no longer usable, the +If the local account is suspended or its address is no longer usable, the command refuses to mint a credential. Stop Fanout, copy the control database, and repair that account without deleting it or its owned data: ```sql -SELECT id, email, role, active FROM users; +SELECT id, email, display_name, role, status FROM users; UPDATE users - SET email = 'you@example.com', active = 1, role = 'admin' + SET email = 'you@example.com', status = 'active', role = 'admin' WHERE id = ''; ``` diff --git a/internal/api/auth.go b/internal/api/auth.go index b966d5f9f..e2fe08796 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -91,9 +91,9 @@ func (h *AuthHandler) Setup(c *echo.Context) error { return rateLimited(c, 15*time.Minute) } var req struct { - Email string `json:"email"` - Name string `json:"name"` - SetupToken string `json:"setup_token"` + Email string `json:"email"` + DisplayName string `json:"display_name"` + SetupToken string `json:"setup_token"` } if err := c.Bind(&req); err != nil { return echo.NewHTTPError(http.StatusBadRequest, "email is required") @@ -119,7 +119,7 @@ func (h *AuthHandler) Setup(c *echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, err.Error()) } createEvent := auth.AuditEvent{EventType: "setup.completed", Outcome: "success", RemoteIP: c.RealIP(), UserAgent: c.Request().UserAgent()} - user, err := h.users.CreateFirstAdminWithAudit(email, req.Name, createEvent) + user, err := h.users.CreateFirstAdminWithAudit(email, req.DisplayName, createEvent) if errors.Is(err, auth.ErrSetupComplete) { // The setup credential creates exactly one administrator. Establishing // a session for an existing admin here would let one token mint @@ -219,7 +219,7 @@ func (h *AuthHandler) Start(c *echo.Context) error { slog.Error("auth: login user lookup failed", "err", userErr) return echo.NewHTTPError(http.StatusInternalServerError, "failed to start login") } - if !errors.Is(userErr, auth.ErrUserNotFound) && !user.Active { + if !errors.Is(userErr, auth.ErrUserNotFound) && user.Status != auth.UserStatusActive { jitter() return c.JSON(200, map[string]bool{"code_sent": true}) } @@ -308,10 +308,10 @@ func (h *AuthHandler) Verify(c *echo.Context) error { slog.Error("auth: complete verified self-signup", "err", err) return echo.NewHTTPError(http.StatusInternalServerError, "failed to complete login") } - if errors.Is(err, auth.ErrUserNotFound) || !user.Active { - h.recordAudit(c, auth.AuditEvent{EventType: "login.failed", Outcome: "denied", TargetType: "email", Metadata: map[string]any{"reason": "inactive_or_missing"}}) + if errors.Is(err, auth.ErrUserNotFound) || user.Status != auth.UserStatusActive { + h.recordAudit(c, auth.AuditEvent{EventType: "login.failed", Outcome: "denied", TargetType: "email", Metadata: map[string]any{"reason": "suspended_or_missing"}}) jitter() - return echo.NewHTTPError(http.StatusUnauthorized, "user not found or inactive") + return echo.NewHTTPError(http.StatusUnauthorized, "user not found or suspended") } if err := h.establishSession(c, user); err != nil { @@ -353,10 +353,10 @@ func (h *AuthHandler) LoginLink(c *echo.Context) error { slog.Error("auth: login link user lookup failed", "err", err) return echo.NewHTTPError(http.StatusInternalServerError, "failed to complete login") } - if errors.Is(err, auth.ErrUserNotFound) || !user.Active { - h.recordAudit(c, auth.AuditEvent{EventType: "login.failed", Outcome: "denied", TargetType: "email", Metadata: map[string]any{"reason": "inactive_or_missing_login_link_user"}}) + if errors.Is(err, auth.ErrUserNotFound) || user.Status != auth.UserStatusActive { + h.recordAudit(c, auth.AuditEvent{EventType: "login.failed", Outcome: "denied", TargetType: "email", Metadata: map[string]any{"reason": "suspended_or_missing_login_link_user"}}) jitter() - return echo.NewHTTPError(http.StatusUnauthorized, "user not found or inactive") + return echo.NewHTTPError(http.StatusUnauthorized, "user not found or suspended") } if err := h.establishSession(c, user); err != nil { slog.Error("auth: login link session establishment failed", "user_id", user.ID, "err", err) diff --git a/internal/api/auth_middleware.go b/internal/api/auth_middleware.go index dec32bf0c..ea4eb1525 100644 --- a/internal/api/auth_middleware.go +++ b/internal/api/auth_middleware.go @@ -175,7 +175,7 @@ func authenticateSession(c *echo.Context, users *auth.UserStore, sessions *auth. case err != nil: slog.Error("auth user lookup failed", "user_id", userID, "err", err) return auth.User{}, echo.NewHTTPError(http.StatusInternalServerError, "auth check failed") - case !user.Active || user.AuthVersion != sessions.AuthVersion(ctx): + case user.Status != auth.UserStatusActive || user.AuthVersion != sessions.AuthVersion(ctx): if destroyErr := sessions.Destroy(ctx); destroyErr != nil { slog.Error("auth revoked-session destroy failed", "user_id", userID, "err", destroyErr) } @@ -314,6 +314,7 @@ func classifyRoute(method, path string) (routePolicy, bool) { return routePolicy{}, false } allowed := action == "" && (method == http.MethodPatch || method == http.MethodDelete) || + (action == "role" || action == "status") && method == http.MethodPatch || action == "access/revoke" && method == http.MethodPost return routePolicy{kind: routePolicyCapability, capability: ManageUsers}, allowed case path == "/" || path == "/favicon.ico" || path == "/favicon.svg" || diff --git a/internal/api/auth_test.go b/internal/api/auth_test.go index 43a99eb63..3c46d7a99 100644 --- a/internal/api/auth_test.go +++ b/internal/api/auth_test.go @@ -178,6 +178,9 @@ func TestRoutePolicyClassification(t *testing.T) { {http.MethodGet, "/api/settings/ingest", routePolicyCapability, ReadIngestMetadata}, {http.MethodPost, "/api/settings/ingest/token/rotate", routePolicyCapability, ManageIngest}, {http.MethodPost, "/api/users/user-1/access/revoke", routePolicyCapability, ManageUsers}, + {http.MethodPatch, "/api/users/user-1", routePolicyCapability, ManageUsers}, + {http.MethodPatch, "/api/users/user-1/role", routePolicyCapability, ManageUsers}, + {http.MethodPatch, "/api/users/user-1/status", routePolicyCapability, ManageUsers}, {http.MethodGet, "/debug/pprof/heap", routePolicyCapability, ReadOperations}, {http.MethodGet, "/metrics", routePolicyServiceCredential, ReadOperations}, {http.MethodPost, "/oauth/token", routePolicyProtocol, ""}, @@ -327,7 +330,7 @@ func TestSessionAuthDBFailureReturns500(t *testing.T) { } } -func TestRoleChangeAndDeactivationRevokeSessions(t *testing.T) { +func TestRoleChangeAndSuspensionRevokeSessions(t *testing.T) { for _, tc := range []struct { name string change func(*auth.UserStore, auth.User) error @@ -337,9 +340,9 @@ func TestRoleChangeAndDeactivationRevokeSessions(t *testing.T) { _, err := users.UpdateWithAudit(user.ID, nil, nil, &role, nil, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}) return err }}, - {name: "inactive", change: func(users *auth.UserStore, user auth.User) error { - active := false - _, err := users.UpdateWithAudit(user.ID, nil, nil, nil, &active, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}) + {name: "suspended", change: func(users *auth.UserStore, user auth.User) error { + status := auth.UserStatusSuspended + _, err := users.UpdateWithAudit(user.ID, nil, nil, nil, &status, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}) return err }}, } { @@ -445,12 +448,12 @@ func TestLogoutDeletesServerSession(t *testing.T) { func TestStartDoesNotRevealAccountState(t *testing.T) { smtp := auth.SMTPConfig{Host: "smtp.example.com", Port: 587, User: "user", Pass: "pass", From: "Fanout "} s := newTestAuthServerWith(t, config.Config{AuthMode: "local"}, smtp) - inactive, _ := s.users.CreateWithAudit("inactive@example.com", "", "operator", auth.AuditEvent{EventType: "user.created", Outcome: "success"}) - active := false - if _, err := s.users.UpdateWithAudit(inactive.ID, nil, nil, nil, &active, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { + suspended, _ := s.users.CreateWithAudit("suspended@example.com", "", "operator", auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + status := auth.UserStatusSuspended + if _, err := s.users.UpdateWithAudit(suspended.ID, nil, nil, nil, &status, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { t.Fatalf("Update: %v", err) } - for _, email := range []string{"missing@example.com", "inactive@example.com"} { + for _, email := range []string{"missing@example.com", "suspended@example.com"} { req := httptest.NewRequest(http.MethodPost, "/api/auth/code/send", strings.NewReader(`{"email":"`+email+`"}`)) req.Header.Set("Content-Type", "application/json") rec := httptest.NewRecorder() @@ -546,7 +549,7 @@ func TestLocalSelfSignupCreatesVerifiedViewer(t *testing.T) { if err != nil { t.Fatalf("GetByEmail: %v", err) } - if user.Role != auth.RoleViewer || !user.Active { + if user.Role != auth.RoleViewer || user.Status != auth.UserStatusActive { t.Fatalf("self-signup user = %#v, want active viewer", user) } firstCookie(t, rec, "fanout_session") @@ -578,33 +581,33 @@ func TestLocalSelfSignupCannotPreemptFirstAdminOrReactivateUser(t *testing.T) { } }) - t.Run("inactive user", func(t *testing.T) { + t.Run("suspended user", func(t *testing.T) { s := newTestAuthServerWith(t, config.Config{AuthMode: "local", SelfSignup: true}, auth.SMTPConfig{}) if _, err := s.users.CreateWithAudit("admin@example.com", "", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}); err != nil { t.Fatalf("Create admin: %v", err) } - viewer, err := s.users.CreateWithAudit("inactive@example.com", "", auth.RoleViewer, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + viewer, err := s.users.CreateWithAudit("suspended@example.com", "", auth.RoleViewer, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) if err != nil { t.Fatalf("Create viewer: %v", err) } - active := false - if _, err := s.users.UpdateWithAudit(viewer.ID, nil, nil, nil, &active, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { - t.Fatalf("deactivate: %v", err) + status := auth.UserStatusSuspended + if _, err := s.users.UpdateWithAudit(viewer.ID, nil, nil, nil, &status, auth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { + t.Fatalf("suspend: %v", err) } code, err := s.codes.Create(viewer.Email) if err != nil { t.Fatalf("Create code: %v", err) } - req := httptest.NewRequest(http.MethodPost, "/api/auth/code/verify", strings.NewReader(`{"email":"inactive@example.com","code":"`+code+`"}`)) + req := httptest.NewRequest(http.MethodPost, "/api/auth/code/verify", strings.NewReader(`{"email":"suspended@example.com","code":"`+code+`"}`)) req.Header.Set("Content-Type", "application/json") rec := httptest.NewRecorder() s.e.ServeHTTP(rec, req) if rec.Code != http.StatusUnauthorized { - t.Fatalf("inactive verify = %d %s, want 401", rec.Code, rec.Body.String()) + t.Fatalf("suspended verify = %d %s, want 401", rec.Code, rec.Body.String()) } got, err := s.users.GetByEmail(viewer.Email) - if err != nil || got.Active { - t.Fatalf("inactive user was reactivated: user=%#v err=%v", got, err) + if err != nil || got.Status == auth.UserStatusActive { + t.Fatalf("suspended user was reactivated: user=%#v err=%v", got, err) } }) } @@ -640,7 +643,7 @@ func TestSetupLifecycleAndIngestToken(t *testing.T) { t.Fatalf("bad setup = %d", badRec.Code) } - req := httptest.NewRequest(http.MethodPost, "/api/auth/setup", strings.NewReader(`{"email":"admin@example.com","setup_token":"`+s.setupToken+`"}`)) + req := httptest.NewRequest(http.MethodPost, "/api/auth/setup", strings.NewReader(`{"email":"admin@example.com","display_name":"First Admin","setup_token":"`+s.setupToken+`"}`)) req.Header.Set("Content-Type", "application/json") rec := httptest.NewRecorder() s.e.ServeHTTP(rec, req) @@ -660,7 +663,7 @@ func TestSetupLifecycleAndIngestToken(t *testing.T) { if body["ingest_header_name"] != "Authorization" { t.Fatalf("ingest header name = %q", body["ingest_header_name"]) } - if user, err := s.users.GetByEmail("admin@example.com"); err != nil || user.Role != auth.RoleAdmin { + if user, err := s.users.GetByEmail("admin@example.com"); err != nil || user.Role != auth.RoleAdmin || user.DisplayName != "First Admin" || user.Status != auth.UserStatusActive { t.Fatalf("admin = %+v err=%v", user, err) } if got := s.setup.Verify(s.setupToken); got != auth.SetupStatusUnset { diff --git a/internal/api/oauth.go b/internal/api/oauth.go index 79cbd988d..4f2b7bc34 100644 --- a/internal/api/oauth.go +++ b/internal/api/oauth.go @@ -251,7 +251,7 @@ func (h *MCPAuthorization) verifyMCPToken(ctx context.Context, raw string, _ *ht slog.Error("mcp oauth user lookup failed", "user_id", record.UserID, "err", err) return nil, fmt.Errorf("load mcp token user: %w", err) } - if !user.Active { + if user.Status != appauth.UserStatusActive { return nil, mcpgoauth.ErrInvalidToken } if !userCanUseMCPScopes(user, record.Scope) { @@ -547,7 +547,7 @@ func userCanUseMCPScopes(user appauth.User, raw string) bool { func (h *MCPAuthorization) browserUser(c *echo.Context) (appauth.User, bool) { user := GetCurrentUser(c) - if user == nil || !user.Active { + if user == nil || user.Status != appauth.UserStatusActive { return appauth.User{}, false } return *user, true @@ -642,7 +642,7 @@ func (h *MCPAuthorization) exchangeAuthorizationCode(c *echo.Context, clientID s // DB failure is an infrastructure error, not an invalid grant. return appauth.OAuthTokenPair{}, fmt.Errorf("load code user: %w", err) } - if !user.Active { + if user.Status != appauth.UserStatusActive { return appauth.OAuthTokenPair{}, appauth.ErrInvalidOAuthGrant } return h.store.IssueTokenPair(c.Request().Context(), code.ClientID, code.UserID, code.Scope, code.Resource) diff --git a/internal/api/oidc.go b/internal/api/oidc.go index fb0617d52..85555bd58 100644 --- a/internal/api/oidc.go +++ b/internal/api/oidc.go @@ -181,8 +181,8 @@ func (h *OIDCHandler) Callback(c *echo.Context) error { slog.Warn("OIDC login denied", "issuer", idToken.Issuer, "subject", claims.Subject, "err", err) return h.oidcDenied(c, err.Error()) } - if !user.Active { - return h.oidcDenied(c, "user is inactive") + if user.Status != appauth.UserStatusActive { + return h.oidcDenied(c, "user is suspended") } if err := h.identities.TouchLogin(ctx, identity.ID); err != nil { slog.Error("OIDC identity login timestamp update failed", "identity_id", identity.ID, "err", err) @@ -279,8 +279,8 @@ func (h *OIDCHandler) resolveUser(ctx context.Context, issuer string, claims oid if err != nil { return appauth.User{}, appauth.UserIdentity{}, err } - if !user.Active { - return appauth.User{}, appauth.UserIdentity{}, errors.New("user is inactive") + if user.Status != appauth.UserStatusActive { + return appauth.User{}, appauth.UserIdentity{}, errors.New("user is suspended") } linked, err := h.identities.CountForUser(ctx, user.ID) if err != nil { @@ -365,10 +365,10 @@ func (h *OIDCHandler) roleMappingConfigured() bool { // login. The role change, auth version increment, session revocation, and audit // event are one transaction inside UpdateWithAudit. func (h *OIDCHandler) reconcileRole(ctx context.Context, user appauth.User, claims oidcClaims, source requestSource) (appauth.User, error) { - // A deactivated account is denied by the caller. Reconciling it anyway + // A suspended account is denied by the caller. Reconciling it anyway // would rewrite its role, revoke sessions, and write an audit event on // every rejected login attempt. - if !h.roleMappingConfigured() || !user.Active { + if !h.roleMappingConfigured() || user.Status != appauth.UserStatusActive { return user, nil } mapped := h.provisionRole(claims.Groups) diff --git a/internal/api/oidc_test.go b/internal/api/oidc_test.go index 7ebd2356d..a0ffecee2 100644 --- a/internal/api/oidc_test.go +++ b/internal/api/oidc_test.go @@ -80,7 +80,7 @@ func TestOIDCWildcardDomainAllowsVerifiedViewerProvisioning(t *testing.T) { if err != nil { t.Fatalf("verified visitor was not provisioned: %v", err) } - if user.Role != appauth.RoleViewer { + if user.Role != appauth.RoleViewer || user.Status != appauth.UserStatusActive || user.DisplayName != "" { t.Fatalf("provisioned role = %q, want viewer", user.Role) } claims.EmailVerified = new(bool) @@ -434,17 +434,17 @@ func TestResolveUserRequiresActiveUnlinkedIssuerAllowedUser(t *testing.T) { t.Fatal("second identity linked to an already-linked user") } - inactive, err := users.CreateWithAudit("inactive-oidc@example.com", "", "viewer", appauth.AuditEvent{EventType: "user.created", Outcome: "success"}) + suspended, err := users.CreateWithAudit("suspended-oidc@example.com", "", "viewer", appauth.AuditEvent{EventType: "user.created", Outcome: "success"}) if err != nil { t.Fatal(err) } - active := false - if _, err := users.UpdateWithAudit(inactive.ID, nil, nil, nil, &active, appauth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { + status := appauth.UserStatusSuspended + if _, err := users.UpdateWithAudit(suspended.ID, nil, nil, nil, &status, appauth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { t.Fatal(err) } - inactiveClaims := oidcClaims{Subject: "inactive-subject", Email: inactive.Email, EmailVerified: &verified, Groups: []string{"trusted"}} - if _, _, err := handler.resolveUser(t.Context(), "https://issuer.example", inactiveClaims, requestSource{}); err == nil { - t.Fatal("inactive user was linked") + suspendedClaims := oidcClaims{Subject: "suspended-subject", Email: suspended.Email, EmailVerified: &verified, Groups: []string{"trusted"}} + if _, _, err := handler.resolveUser(t.Context(), "https://issuer.example", suspendedClaims, requestSource{}); err == nil { + t.Fatal("suspended user was linked") } } @@ -620,7 +620,7 @@ func TestResolveUserReportsUnusableEmailClaimDistinctly(t *testing.T) { } } -func TestResolveUserSkipsRoleReconciliationForInactiveUser(t *testing.T) { +func TestResolveUserSkipsRoleReconciliationForSuspendedUser(t *testing.T) { cfg := config.Config{ OIDCEmailVerification: "required", OIDCAllowedGroups: "trusted", @@ -631,8 +631,8 @@ func TestResolveUserSkipsRoleReconciliationForInactiveUser(t *testing.T) { if _, err := users.CreateWithAudit("other-admin@example.com", "", "admin", appauth.AuditEvent{EventType: "user.created", Outcome: "success"}); err != nil { t.Fatal(err) } - inactive := false - if _, err := users.UpdateWithAudit(user.ID, nil, nil, nil, &inactive, appauth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { + status := appauth.UserStatusSuspended + if _, err := users.UpdateWithAudit(user.ID, nil, nil, nil, &status, appauth.AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { t.Fatal(err) } @@ -645,7 +645,7 @@ func TestResolveUserSkipsRoleReconciliationForInactiveUser(t *testing.T) { t.Fatal(err) } if stored.Role != appauth.RoleAdmin { - t.Fatalf("role = %q, want admin: a denied login by a deactivated account must not rewrite its role", stored.Role) + t.Fatalf("role = %q, want admin: a denied login by a suspended account must not rewrite its role", stored.Role) } } diff --git a/internal/api/users.go b/internal/api/users.go index d546c522a..7f2a93182 100644 --- a/internal/api/users.go +++ b/internal/api/users.go @@ -20,6 +20,9 @@ type UserHandler struct { smtpConfigured bool } +// userBodyLimit bounds user administration requests, which carry a few short fields. +const userBodyLimit = 16 << 10 + // RegisterUserRoutes registers user management endpoints. func RegisterUserRoutes(e *echo.Echo, users *auth.UserStore, smtp auth.SMTPConfig, cfg config.Config) { mode := strings.ToLower(strings.TrimSpace(cfg.AuthMode)) @@ -32,6 +35,8 @@ func RegisterUserRoutes(e *echo.Echo, users *auth.UserStore, smtp auth.SMTPConfi e.GET("/api/users", h.ListUsers, adminOnly) e.POST("/api/users", h.CreateUser, adminOnly) e.PATCH("/api/users/:id", h.UpdateUser, adminOnly) + e.PATCH("/api/users/:id/role", h.UpdateRole, adminOnly) + e.PATCH("/api/users/:id/status", h.UpdateStatus, adminOnly) e.DELETE("/api/users/:id", h.DeleteUser, adminOnly) e.POST("/api/users/:id/access/revoke", h.RevokeAccess, adminOnly) } @@ -62,12 +67,12 @@ func (h *UserHandler) ListUsers(c *echo.Context) error { // CreateUser adds a new user (admin only). func (h *UserHandler) CreateUser(c *echo.Context) error { var req struct { - Email string `json:"email"` - Name string `json:"name"` - Role string `json:"role"` + Email string `json:"email"` + DisplayName string `json:"display_name"` + Role string `json:"role"` } - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, "email is required") + if err := decodeStrict(c, &req, userBodyLimit); err != nil { + return err } role := auth.Role(req.Role) if role == "" { @@ -81,7 +86,7 @@ func (h *UserHandler) CreateUser(c *echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusBadRequest, err.Error()) } - user, err := h.users.CreateWithAudit(email, req.Name, role, userAuditEvent(c, "user.created")) + user, err := h.users.CreateWithAudit(email, req.DisplayName, role, userAuditEvent(c, "user.created")) if err != nil { if errors.Is(err, auth.ErrUserConflict) { return echo.NewHTTPError(http.StatusConflict, "user already exists") @@ -117,20 +122,14 @@ func (h *UserHandler) CreateUser(c *echo.Context) error { return c.JSON(http.StatusCreated, resp) } -// UpdateUser modifies a user's fields (admin only). +// UpdateUser modifies only a user's profile (admin only). func (h *UserHandler) UpdateUser(c *echo.Context) error { - id := c.Param("id") var req struct { - Email *string `json:"email"` - Name *string `json:"name"` - Role *string `json:"role"` - Active *bool `json:"active"` - } - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, "invalid request") + Email *string `json:"email"` + DisplayName *string `json:"display_name"` } - if req.Role != nil && !auth.ValidRole(*req.Role) { - return echo.NewHTTPError(http.StatusBadRequest, "role must be viewer, operator, or admin") + if err := decodeStrict(c, &req, userBodyLimit); err != nil { + return err } if req.Email != nil { email, err := auth.NormalizeEmail(*req.Email) @@ -139,24 +138,51 @@ func (h *UserHandler) UpdateUser(c *echo.Context) error { } req.Email = &email } + return h.updateUser(c, req.Email, req.DisplayName, nil, nil, "user.updated") +} - eventType := auth.AuditEventType("user.updated") - if req.Role != nil { - eventType = "role.changed" - } else if req.Active != nil && !*req.Active { - eventType = "user.deactivated" +// UpdateRole modifies a user's role (admin only). +func (h *UserHandler) UpdateRole(c *echo.Context) error { + var req struct { + Role string `json:"role"` + } + if err := decodeStrict(c, &req, userBodyLimit); err != nil { + return err + } + if !auth.ValidRole(req.Role) { + return echo.NewHTTPError(http.StatusBadRequest, "role must be viewer, operator, or admin") + } + role := auth.Role(req.Role) + return h.updateUser(c, nil, nil, &role, nil, "role.changed") +} + +// UpdateStatus modifies a user's status (admin only). +func (h *UserHandler) UpdateStatus(c *echo.Context) error { + var req struct { + Status string `json:"status"` + } + if err := decodeStrict(c, &req, userBodyLimit); err != nil { + return err } - var role *auth.Role - if req.Role != nil { - parsed := auth.Role(*req.Role) - role = &parsed + if !auth.ValidUserStatus(req.Status) { + return echo.NewHTTPError(http.StatusBadRequest, "status must be active or suspended") } - user, err := h.users.UpdateWithAudit(id, req.Email, req.Name, role, req.Active, userAuditEvent(c, eventType)) + status := auth.UserStatus(req.Status) + eventType := auth.AuditEventType("user.updated") + if status == auth.UserStatusSuspended { + eventType = "user.suspended" + } + return h.updateUser(c, nil, nil, nil, &status, eventType) +} + +func (h *UserHandler) updateUser(c *echo.Context, email, displayName *string, role *auth.Role, status *auth.UserStatus, eventType auth.AuditEventType) error { + id := c.Param("id") + user, err := h.users.UpdateWithAudit(id, email, displayName, role, status, userAuditEvent(c, eventType)) if err != nil { if errors.Is(err, auth.ErrUserConflict) { return echo.NewHTTPError(http.StatusConflict, "user already exists") } - if err == auth.ErrLastActiveAdmin { + if errors.Is(err, auth.ErrLastActiveAdmin) { return echo.NewHTTPError(http.StatusConflict, err.Error()) } if errors.Is(err, auth.ErrUserNotFound) { @@ -165,7 +191,7 @@ func (h *UserHandler) UpdateUser(c *echo.Context) error { slog.Error("update user failed", "id", id, "err", err) return echo.NewHTTPError(http.StatusInternalServerError, "failed to update user") } - return c.JSON(200, user) + return c.JSON(http.StatusOK, user) } // DeleteUser removes a user (admin only). diff --git a/internal/api/users_test.go b/internal/api/users_test.go index b0b12358a..a0cda625f 100644 --- a/internal/api/users_test.go +++ b/internal/api/users_test.go @@ -16,21 +16,29 @@ func registerTestUserRoutes(s *testAuthServer) { } func TestUserMutationsProtectLastActiveAdmin(t *testing.T) { - for _, tc := range []struct{ name, method, body string }{ - {"demote", http.MethodPatch, `{"role":"viewer"}`}, - {"deactivate", http.MethodPatch, `{"active":false}`}, - {"delete", http.MethodDelete, ""}, + for _, tc := range []struct{ name, method, path, body string }{ + {"demote", http.MethodPatch, "/role", `{"role":"viewer"}`}, + {"suspend", http.MethodPatch, "/status", `{"status":"suspended"}`}, + {"delete", http.MethodDelete, "", ""}, } { t.Run(tc.name, func(t *testing.T) { s := newTestAuthServer(t) registerTestUserRoutes(s) admin, _ := s.users.CreateWithAudit("admin@example.com", "", "admin", auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + other, err := s.users.CreateWithAudit("suspended-admin@example.com", "", "admin", auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + status := auth.UserStatusSuspended + if _, err := s.users.UpdateWithAudit(other.ID, nil, nil, nil, &status, auth.AuditEvent{EventType: "user.suspended", Outcome: "success"}); err != nil { + t.Fatal(err) + } cookie := s.login(t, admin) var body *strings.Reader if tc.body != "" { body = strings.NewReader(tc.body) } - req := sessionRequest(tc.method, "/api/users/"+admin.ID, body, cookie) + req := sessionRequest(tc.method, "/api/users/"+admin.ID+tc.path, body, cookie) if body != nil { req.Header.Set("Content-Type", "application/json") } @@ -43,6 +51,41 @@ func TestUserMutationsProtectLastActiveAdmin(t *testing.T) { } } +func TestUserSecurityRoutesAllowChangesWithAnotherActiveAdmin(t *testing.T) { + for _, tc := range []struct{ path, body string }{ + {"/role", `{"role":"viewer"}`}, + {"/status", `{"status":"suspended"}`}, + } { + t.Run(tc.path, func(t *testing.T) { + s := newTestAuthServer(t) + registerTestUserRoutes(s) + admin, err := s.users.CreateWithAudit("admin@example.com", "Admin", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + target, err := s.users.CreateWithAudit("target@example.com", "Target", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + cookie := s.login(t, admin) + targetCookie := s.login(t, target) + rec := userRequest(t, s, http.MethodPatch, "/api/users/"+target.ID+tc.path, tc.body, cookie) + if rec.Code != http.StatusOK { + t.Fatalf("security change = %d: %s", rec.Code, rec.Body.String()) + } + updated, err := s.users.GetByID(target.ID) + if err != nil || updated.AuthVersion != target.AuthVersion+1 { + t.Fatalf("security change = %+v %v", updated, err) + } + me := httptest.NewRecorder() + s.e.ServeHTTP(me, sessionRequest(http.MethodGet, "/api/auth/me", nil, targetCookie)) + if me.Code != http.StatusUnauthorized { + t.Fatalf("revoked session = %d", me.Code) + } + }) + } +} + func TestDeleteUser_AllowsDeletingAdminWhenAnotherActiveAdminExists(t *testing.T) { s := newTestAuthServer(t) registerTestUserRoutes(s) @@ -75,7 +118,7 @@ func TestRevokeAccessRevokesTargetSessions(t *testing.T) { } } -func TestPatchUserPreservesOmittedFieldsAndAppliesFalse(t *testing.T) { +func TestPatchUserPreservesOmittedProfileFields(t *testing.T) { s := newTestAuthServer(t) registerTestUserRoutes(s) admin, err := s.users.CreateWithAudit("admin@example.com", "Administrator", "admin", auth.AuditEvent{EventType: "user.created", Outcome: "success"}) @@ -88,7 +131,7 @@ func TestPatchUserPreservesOmittedFieldsAndAppliesFalse(t *testing.T) { } cookie := s.login(t, admin) path := "/api/users/" + target.ID - for _, body := range []string{`{"name":"Renamed"}`, `{"active":false}`} { + for _, body := range []string{`{"display_name":"Renamed"}`, `{}`} { req := sessionRequest(http.MethodPatch, path, strings.NewReader(body), cookie) req.Header.Set("Content-Type", "application/json") rec := httptest.NewRecorder() @@ -100,9 +143,8 @@ func TestPatchUserPreservesOmittedFieldsAndAppliesFalse(t *testing.T) { if err := json.Unmarshal(rec.Body.Bytes(), &updated); err != nil { t.Fatal(err) } - wantActive := body != `{"active":false}` - if updated.Email != target.Email || updated.Role != target.Role || updated.Name != "Renamed" || updated.Active != wantActive { - t.Fatalf("PATCH %s changed omitted fields or lost false: %+v", body, updated) + if updated.Email != target.Email || updated.Role != target.Role || updated.DisplayName != "Renamed" || updated.Status != auth.UserStatusActive { + t.Fatalf("PATCH %s changed omitted fields: %+v", body, updated) } } if _, ok := classifyRoute(http.MethodPut, path); ok { @@ -134,3 +176,230 @@ func TestCreateUserWithoutSMTPReturnsLoginLinkInstruction(t *testing.T) { t.Fatalf("response = %+v", body) } } + +func userRequest(t *testing.T, s *testAuthServer, method, path, body string, cookie *http.Cookie) *httptest.ResponseRecorder { + t.Helper() + req := sessionRequest(method, path, strings.NewReader(body), cookie) + req.Header.Set("Content-Type", "application/json") + rec := httptest.NewRecorder() + s.e.ServeHTTP(rec, req) + return rec +} + +func TestUserPatchRoutes(t *testing.T) { + s := newTestAuthServer(t) + registerTestUserRoutes(s) + admin, err := s.users.CreateWithAudit("admin@example.com", "Admin", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + target, err := s.users.CreateWithAudit("target@example.com", "Original", auth.RoleOperator, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + viewer, err := s.users.CreateWithAudit("viewer@example.com", "Viewer", auth.RoleViewer, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + adminCookie := s.login(t, admin) + targetCookie := s.login(t, target) + viewerCookie := s.login(t, viewer) + for _, tc := range []struct{ path, body string }{ + {"", `{"email":"changed@example.com","display_name":"Changed"}`}, + {"/role", `{"role":"viewer"}`}, + {"/status", `{"status":"suspended"}`}, + {"/status", `{"status":"active"}`}, + } { + rec := userRequest(t, s, http.MethodPatch, "/api/users/"+target.ID+tc.path, tc.body, adminCookie) + if rec.Code != http.StatusOK { + t.Fatalf("PATCH %s %s = %d: %s", tc.path, tc.body, rec.Code, rec.Body.String()) + } + } + updated, err := s.users.GetByID(target.ID) + if err != nil { + t.Fatal(err) + } + if updated.DisplayName != "Changed" || updated.Email != "changed@example.com" || updated.Role != auth.RoleViewer || updated.Status != auth.UserStatusActive || updated.AuthVersion != target.AuthVersion+4 { + t.Fatalf("updated user = %+v", updated) + } + // Reactivation must not restore a session revoked by a security change. + me := httptest.NewRecorder() + s.e.ServeHTTP(me, sessionRequest(http.MethodGet, "/api/auth/me", nil, targetCookie)) + if me.Code != http.StatusUnauthorized { + t.Fatalf("revoked session = %d", me.Code) + } + for _, tc := range []struct{ path, body string }{ + {"", `{"display_name":"Denied"}`}, + {"/role", `{"role":"admin"}`}, + {"/status", `{"status":"suspended"}`}, + } { + for _, cookie := range []*http.Cookie{viewerCookie, nil} { + want := http.StatusForbidden + if cookie == nil { + want = http.StatusUnauthorized + } + rec := userRequest(t, s, http.MethodPatch, "/api/users/"+target.ID+tc.path, tc.body, cookie) + if rec.Code != want { + t.Fatalf("non-admin PATCH %s = %d, want %d", tc.path, rec.Code, want) + } + } + rec := userRequest(t, s, http.MethodPatch, "/api/users/missing"+tc.path, tc.body, adminCookie) + if rec.Code != http.StatusNotFound { + t.Fatalf("missing PATCH %s = %d", tc.path, rec.Code) + } + } +} + +func TestUserPatchRoutesRejectWrongFields(t *testing.T) { + s := newTestAuthServer(t) + registerTestUserRoutes(s) + admin, err := s.users.CreateWithAudit("admin@example.com", "Admin", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + cookie := s.login(t, admin) + for _, tc := range []struct{ path, body string }{ + {"", `{"role":"viewer"}`}, {"", `{"status":"suspended"}`}, + {"", `{"active":false}`}, {"", `{"name":"Old"}`}, + {"", `{"display_name":"Changed","unexpected":true}`}, + {"", `{"email":"invalid"}`}, + {"", `{"display_name":12}`}, {"", `{} {}`}, {"", `[]`}, + {"/role", `{"role":"viewer","display_name":"Changed"}`}, + {"/role", `{"role":"viewer","status":"active"}`}, + {"/role", `{"role":"invalid"}`}, {"/role", `{}`}, {"/role", `{"role":null}`}, + {"/status", `{"status":"suspended","role":"viewer"}`}, + {"/status", `{"status":"active","email":"other@example.com"}`}, + {"/status", `{"status":"disabled"}`}, {"/status", `{"status":"ACTIVE"}`}, + {"/status", `{"status":false}`}, {"/status", `{}`}, {"/status", `{"status":null}`}, + } { + rec := userRequest(t, s, http.MethodPatch, "/api/users/"+admin.ID+tc.path, tc.body, cookie) + if rec.Code != http.StatusBadRequest { + t.Fatalf("PATCH %s %s = %d: %s", tc.path, tc.body, rec.Code, rec.Body.String()) + } + } + unchanged, err := s.users.GetByID(admin.ID) + if err != nil || unchanged.Email != admin.Email || unchanged.DisplayName != admin.DisplayName || unchanged.Role != admin.Role || unchanged.Status != admin.Status || unchanged.AuthVersion != admin.AuthVersion { + t.Fatalf("invalid requests changed user: %+v %v", unchanged, err) + } +} + +func TestUserProjectionsAndProvisioning(t *testing.T) { + s := newTestAuthServer(t) + registerTestUserRoutes(s) + admin, err := s.users.CreateWithAudit("admin@example.com", "Admin", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + cookie := s.login(t, admin) + rec := userRequest(t, s, http.MethodPost, "/api/users", `{"email":"new@example.com","display_name":"New User","role":"operator"}`, cookie) + if rec.Code != http.StatusCreated { + t.Fatalf("provision = %d: %s", rec.Code, rec.Body.String()) + } + assertUserProjection := func(body []byte) { + t.Helper() + var projection map[string]any + if err := json.Unmarshal(body, &projection); err != nil { + t.Fatal(err) + } + if _, ok := projection["display_name"].(string); !ok { + t.Fatalf("missing display_name: %s", body) + } + if projection["status"] != "active" { + t.Fatalf("missing status: %s", body) + } + for _, key := range []string{"name", "active"} { + if _, ok := projection[key]; ok { + t.Fatalf("superseded %s in %s", key, body) + } + } + } + assertUserProjection(rec.Body.Bytes()) + created, err := s.users.GetByEmail("new@example.com") + if err != nil || created.DisplayName != "New User" || created.Role != auth.RoleOperator { + t.Fatalf("created = %+v %v", created, err) + } + me := httptest.NewRecorder() + s.e.ServeHTTP(me, sessionRequest(http.MethodGet, "/api/auth/me", nil, cookie)) + if me.Code != http.StatusOK { + t.Fatalf("me = %d", me.Code) + } + assertUserProjection(me.Body.Bytes()) + list := httptest.NewRecorder() + s.e.ServeHTTP(list, sessionRequest(http.MethodGet, "/api/users", nil, cookie)) + if list.Code != http.StatusOK { + t.Fatalf("list = %d", list.Code) + } + var users []json.RawMessage + if err := json.Unmarshal(list.Body.Bytes(), &users); err != nil { + t.Fatal(err) + } + if len(users) != 2 { + t.Fatalf("users = %s", list.Body.String()) + } + for _, user := range users { + assertUserProjection(user) + } + for _, body := range []string{ + `{"email":"rejected@example.com","name":"Old"}`, + `{"email":"rejected@example.com","active":true}`, + `{"email":"rejected@example.com","status":"active"}`, + } { + if rec := userRequest(t, s, http.MethodPost, "/api/users", body, cookie); rec.Code != http.StatusBadRequest { + t.Fatalf("provision %s = %d", body, rec.Code) + } + } +} + +func TestStatusRouteSuspensionBlocksSessionsAndSignIn(t *testing.T) { + s := newTestAuthServer(t) + registerTestUserRoutes(s) + admin, err := s.users.CreateWithAudit("admin@example.com", "Admin", auth.RoleAdmin, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + target, err := s.users.CreateWithAudit("target@example.com", "Target", auth.RoleOperator, auth.AuditEvent{EventType: "user.created", Outcome: "success"}) + if err != nil { + t.Fatal(err) + } + adminCookie := s.login(t, admin) + targetCookie := s.login(t, target) + code, err := s.codes.Create(target.Email) + if err != nil { + t.Fatal(err) + } + link, err := s.codes.CreateLoginLink(target.Email) + if err != nil { + t.Fatal(err) + } + rec := userRequest(t, s, http.MethodPatch, "/api/users/"+target.ID+"/status", `{"status":"suspended"}`, adminCookie) + if rec.Code != http.StatusOK { + t.Fatalf("suspend = %d: %s", rec.Code, rec.Body.String()) + } + updated, err := s.users.GetByID(target.ID) + if err != nil || updated.Status != auth.UserStatusSuspended || updated.AuthVersion != target.AuthVersion+1 { + t.Fatalf("suspended = %+v %v", updated, err) + } + me := httptest.NewRecorder() + s.e.ServeHTTP(me, sessionRequest(http.MethodGet, "/api/auth/me", nil, targetCookie)) + if me.Code != http.StatusUnauthorized { + t.Fatalf("suspended session = %d", me.Code) + } + for _, tc := range []struct{ path, body string }{ + {"/api/auth/code/verify", `{"email":"` + target.Email + `","code":"` + code + `"}`}, + {"/api/auth/link/verify", `{"token":"` + link + `"}`}, + } { + rec := userRequest(t, s, http.MethodPost, tc.path, tc.body, nil) + if rec.Code != http.StatusUnauthorized { + t.Fatalf("suspended sign-in %s = %d: %s", tc.path, rec.Code, rec.Body.String()) + } + for _, cookie := range rec.Result().Cookies() { + if cookie.Name == "fanout_session" && cookie.Value != "" { + t.Fatal("suspended sign-in issued a session") + } + } + } + var audits int + if err := s.db.DB.QueryRow(`SELECT COUNT(*) FROM auth_audit_events WHERE event_type = 'user.suspended' AND target_id = ?`, target.ID).Scan(&audits); err != nil || audits != 1 { + t.Fatalf("suspension audits = %d, %v", audits, err) + } +} diff --git a/internal/auth/audit.go b/internal/auth/audit.go index d96223320..b8024e1b9 100644 --- a/internal/auth/audit.go +++ b/internal/auth/audit.go @@ -56,7 +56,7 @@ func recordAudit(ctx context.Context, executor auditExecutor, event AuditEvent) "login.failed": {}, "login.requested": {}, "login.succeeded": {}, "logout": {}, "login_link.issued": {}, "login_link.redeemed": {}, "oidc.denied": {}, "role.changed": {}, "session.revoked": {}, "setup.completed": {}, - "user.created": {}, "user.deactivated": {}, "user.deleted": {}, "user.provisioned": {}, "user.updated": {}, + "user.created": {}, "user.suspended": {}, "user.deleted": {}, "user.provisioned": {}, "user.updated": {}, }) { appmetrics.AuthAuditWriteFailures.Inc() return fmt.Errorf("auth: invalid audit event type %q", event.EventType) diff --git a/internal/auth/oauth_store.go b/internal/auth/oauth_store.go index 54127a0f9..775fc6925 100644 --- a/internal/auth/oauth_store.go +++ b/internal/auth/oauth_store.go @@ -290,24 +290,24 @@ func (s *OAuthStore) RotateRefreshToken(ctx context.Context, clientID, raw, reso if record.ExpiresAt.Unix() <= now { return OAuthTokenPair{}, ErrInvalidOAuthGrant } - var active int64 - err = conn.QueryRowContext(ctx, `SELECT active FROM users WHERE id = ?`, record.UserID).Scan(&active) + var status string + err = conn.QueryRowContext(ctx, `SELECT status FROM users WHERE id = ?`, record.UserID).Scan(&status) switch { case errors.Is(err, sql.ErrNoRows): - active = 0 // user row is definitively gone: treat as inactive + status = string(UserStatusSuspended) // user row is definitively gone: deny refresh case err != nil: // A failed read is an infrastructure error, never an invalid grant: // do not revoke the family because the database hiccuped. return OAuthTokenPair{}, fmt.Errorf("oauth: read user for refresh: %w", err) } - if active != 1 { + if status != string(UserStatusActive) { // Same deliberate commit-before-error as the reuse branch above: the - // revocation of the inactive user's family must outlive the failure. + // revocation of the suspended user's family must outlive the failure. if _, revokeErr := conn.ExecContext(ctx, `UPDATE oauth_tokens SET revoked_at = COALESCE(revoked_at, ?) WHERE family_id = ?`, now, record.FamilyID); revokeErr != nil { - return OAuthTokenPair{}, fmt.Errorf("oauth: revoke inactive user token family: %w", revokeErr) + return OAuthTokenPair{}, fmt.Errorf("oauth: revoke suspended user token family: %w", revokeErr) } if _, commitErr := conn.ExecContext(ctx, "COMMIT"); commitErr != nil { - return OAuthTokenPair{}, fmt.Errorf("oauth: commit inactive user revocation: %w", commitErr) + return OAuthTokenPair{}, fmt.Errorf("oauth: commit suspended user revocation: %w", commitErr) } committed = true return OAuthTokenPair{}, ErrInvalidOAuthGrant diff --git a/internal/auth/oauth_store_test.go b/internal/auth/oauth_store_test.go index bbf8be0d3..d292c29d3 100644 --- a/internal/auth/oauth_store_test.go +++ b/internal/auth/oauth_store_test.go @@ -134,10 +134,10 @@ func TestRevokeAllSessionsAlsoRevokesOAuthCredentials(t *testing.T) { } } -func TestOAuthStoreRejectsWrongAudienceAndInactiveRefresh(t *testing.T) { +func TestOAuthStoreRejectsWrongAudienceAndSuspendedRefresh(t *testing.T) { sqlite := newTestSQLite(t) users := NewUserStore(sqlite.DB) - user, err := users.CreateWithAudit("inactive-oauth@example.com", "", "operator", AuditEvent{EventType: "user.created", Outcome: "success"}) + user, err := users.CreateWithAudit("suspended-oauth@example.com", "", "operator", AuditEvent{EventType: "user.created", Outcome: "success"}) if err != nil { t.Fatalf("Create user: %v", err) } @@ -154,12 +154,12 @@ func TestOAuthStoreRejectsWrongAudienceAndInactiveRefresh(t *testing.T) { if _, err := store.VerifyAccessToken(t.Context(), pair.AccessToken, "https://other.example/mcp"); !errors.Is(err, ErrInvalidOAuthToken) { t.Fatalf("wrong audience = %v, want invalid token", err) } - active := false - if _, err := users.UpdateWithAudit(user.ID, nil, nil, nil, &active, AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { - t.Fatalf("deactivate user: %v", err) + status := UserStatusSuspended + if _, err := users.UpdateWithAudit(user.ID, nil, nil, nil, &status, AuditEvent{EventType: "user.updated", Outcome: "success"}); err != nil { + t.Fatalf("suspend user: %v", err) } if _, err := store.RotateRefreshToken(t.Context(), client.ClientID, pair.RefreshToken, resource, ""); !errors.Is(err, ErrInvalidOAuthGrant) { - t.Fatalf("inactive user refresh = %v, want invalid grant", err) + t.Fatalf("suspended user refresh = %v, want invalid grant", err) } } @@ -222,7 +222,7 @@ func TestOAuthStoreRotateDBErrorDoesNotRevokeFamily(t *testing.T) { t.Fatalf("IssueTokenPair: %v", err) } - // Simulate an infrastructure failure on the user-active read. + // Simulate an infrastructure failure on the user-status read. if _, err := sqlite.DB.Exec(`ALTER TABLE users RENAME TO users_offline`); err != nil { t.Fatalf("hide users table: %v", err) } diff --git a/internal/auth/user_store.go b/internal/auth/user_store.go index e3b59947d..1da421e5a 100644 --- a/internal/auth/user_store.go +++ b/internal/auth/user_store.go @@ -38,6 +38,17 @@ func ValidRole(role string) bool { } } +type UserStatus string + +const ( + UserStatusActive UserStatus = "active" + UserStatusSuspended UserStatus = "suspended" +) + +func ValidUserStatus(status string) bool { + return UserStatus(status) == UserStatusActive || UserStatus(status) == UserStatusSuspended +} + const userTimestampLayout = "2006-01-02T15:04:05.000Z07:00" func userTimestamp(at time.Time) string { @@ -46,15 +57,15 @@ func userTimestamp(at time.Time) string { // User represents an authenticated user. type User struct { - ID string `json:"id"` - Email string `json:"email"` - Name string `json:"name,omitempty"` - Role Role `json:"role"` - Active bool `json:"active"` - AuthVersion int64 `json:"-"` - LoggedInAt string `json:"logged_in_at,omitempty"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` + ID string `json:"id"` + Email string `json:"email"` + DisplayName string `json:"display_name"` + Role Role `json:"role"` + Status UserStatus `json:"status"` + AuthVersion int64 `json:"-"` + LoggedInAt string `json:"logged_in_at,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` } // UserStore provides CRUD operations for users. @@ -73,9 +84,9 @@ func toUser(u generated.User) User { return User{ ID: u.ID, Email: u.Email, - Name: u.Name.String, + DisplayName: u.DisplayName.String, Role: Role(u.Role), - Active: u.Active == 1, + Status: UserStatus(u.Status), AuthVersion: u.AuthVersion, LoggedInAt: u.LoggedInAt.String, CreatedAt: u.CreatedAt, @@ -84,15 +95,15 @@ func toUser(u generated.User) User { } // CreateWithAudit adds a new user. -func (s *UserStore) CreateWithAudit(email, name string, role Role, event AuditEvent) (User, error) { - return s.create(email, name, role, &event) +func (s *UserStore) CreateWithAudit(email, displayName string, role Role, event AuditEvent) (User, error) { + return s.create(email, displayName, role, &event) } -func (s *UserStore) create(email, name string, role Role, event *AuditEvent) (User, error) { +func (s *UserStore) create(email, displayName string, role Role, event *AuditEvent) (User, error) { if !ValidRole(string(role)) { return User{}, fmt.Errorf("auth: invalid role %q", role) } - params, err := newCreateUserParams(email, name, role) + params, err := newCreateUserParams(email, displayName, role) if err != nil { return User{}, err } @@ -175,12 +186,12 @@ func (s *UserStore) List() ([]User, error) { return users, nil } -// UpdateWithAudit modifies a user's fields. Email, role, or active-state changes revoke every browser session. -func (s *UserStore) UpdateWithAudit(id string, email, name *string, role *Role, active *bool, event AuditEvent) (User, error) { - return s.update(id, email, name, role, active, &event) +// UpdateWithAudit modifies a user's fields. Email, role, or status changes revoke every browser session. +func (s *UserStore) UpdateWithAudit(id string, email, displayName *string, role *Role, status *UserStatus, event AuditEvent) (User, error) { + return s.update(id, email, displayName, role, status, &event) } -func (s *UserStore) update(id string, email, name *string, role *Role, active *bool, event *AuditEvent) (User, error) { +func (s *UserStore) update(id string, email, displayName *string, role *Role, status *UserStatus, event *AuditEvent) (User, error) { ctx, cancel := DetachedWriteContext(context.Background()) defer cancel() conn, err := s.db.Conn(ctx) @@ -213,8 +224,8 @@ func (s *UserStore) update(id string, email, name *string, role *Role, active *b if email != nil { existing.Email = *email } - if name != nil { - existing.Name = *name + if displayName != nil { + existing.DisplayName = *displayName } if role != nil { if !ValidRole(string(*role)) { @@ -222,10 +233,13 @@ func (s *UserStore) update(id string, email, name *string, role *Role, active *b } existing.Role = *role } - if active != nil { - existing.Active = *active + if status != nil { + if !ValidUserStatus(string(*status)) { + return User{}, fmt.Errorf("auth: invalid status %q", *status) + } + existing.Status = *status } - if row.Role == "admin" && row.Active == 1 && (!existing.Active || existing.Role != "admin") { + if row.Role == "admin" && row.Status == string(UserStatusActive) && (existing.Status != UserStatusActive || existing.Role != "admin") { admins, err := q.CountActiveAdmins(ctx) if err != nil { return User{}, fmt.Errorf("auth: count active admins: %w", err) @@ -235,18 +249,14 @@ func (s *UserStore) update(id string, email, name *string, role *Role, active *b } } - activeInt := int64(0) - if existing.Active { - activeInt = 1 - } now := userTimestamp(time.Now()) u, err := q.UpdateUser(ctx, generated.UpdateUserParams{ - Email: existing.Email, - Name: sql.NullString{String: existing.Name, Valid: existing.Name != ""}, - Role: string(existing.Role), - Active: activeInt, - UpdatedAt: now, - ID: id, + Email: existing.Email, + DisplayName: sql.NullString{String: existing.DisplayName, Valid: existing.DisplayName != ""}, + Role: string(existing.Role), + Status: string(existing.Status), + UpdatedAt: now, + ID: id, }) if err != nil { if appstore.IsUniqueConstraint(err) { @@ -254,7 +264,7 @@ func (s *UserStore) update(id string, email, name *string, role *Role, active *b } return User{}, fmt.Errorf("auth: update user: %w", err) } - securityChanged := before.Email != existing.Email || before.Role != existing.Role || before.Active != existing.Active + securityChanged := before.Email != existing.Email || before.Role != existing.Role || before.Status != existing.Status if securityChanged { if err := q.IncrementUserAuthVersion(ctx, generated.IncrementUserAuthVersionParams{UpdatedAt: now, ID: id}); err != nil { return User{}, fmt.Errorf("auth: increment auth version: %w", err) @@ -313,7 +323,7 @@ func (s *UserStore) delete(id string, event *AuditEvent) error { if err != nil { return fmt.Errorf("auth: get user by id: %w", err) } - if row.Role == "admin" && row.Active == 1 { + if row.Role == "admin" && row.Status == string(UserStatusActive) { admins, err := q.CountActiveAdmins(ctx) if err != nil { return fmt.Errorf("auth: count active admins: %w", err) @@ -428,11 +438,11 @@ func (s *UserStore) revokeAllSessions(id string, event *AuditEvent) error { // CreateFirstAdminWithAudit atomically creates the first admin user. // Returns ErrSetupComplete if users already exist (race-safe). -func (s *UserStore) CreateFirstAdminWithAudit(email, name string, event AuditEvent) (User, error) { - return s.createFirstAdmin(email, name, &event) +func (s *UserStore) CreateFirstAdminWithAudit(email, displayName string, event AuditEvent) (User, error) { + return s.createFirstAdmin(email, displayName, &event) } -func (s *UserStore) createFirstAdmin(email, name string, event *AuditEvent) (User, error) { +func (s *UserStore) createFirstAdmin(email, displayName string, event *AuditEvent) (User, error) { ctx := context.Background() conn, err := s.db.Conn(ctx) if err != nil { @@ -459,7 +469,7 @@ func (s *UserStore) createFirstAdmin(email, name string, event *AuditEvent) (Use return User{}, ErrSetupComplete } - params, err := newCreateUserParams(email, name, RoleAdmin) + params, err := newCreateUserParams(email, displayName, RoleAdmin) if err != nil { return User{}, err } @@ -484,18 +494,18 @@ func (s *UserStore) createFirstAdmin(email, name string, event *AuditEvent) (Use // ErrSetupComplete is returned when setup is attempted but users already exist. var ErrSetupComplete = errors.New("setup already complete") -func newCreateUserParams(email, name string, role Role) (generated.CreateUserParams, error) { +func newCreateUserParams(email, displayName string, role Role) (generated.CreateUserParams, error) { id, err := appid.New() if err != nil { return generated.CreateUserParams{}, fmt.Errorf("auth: generate user id: %w", err) } now := userTimestamp(time.Now()) return generated.CreateUserParams{ - ID: id, - Email: email, - Name: sql.NullString{String: name, Valid: name != ""}, - Role: string(role), - CreatedAt: now, - UpdatedAt: now, + ID: id, + Email: email, + DisplayName: sql.NullString{String: displayName, Valid: displayName != ""}, + Role: string(role), + CreatedAt: now, + UpdatedAt: now, }, nil } diff --git a/internal/auth/user_store_test.go b/internal/auth/user_store_test.go index efabfd117..e3ea460f8 100644 --- a/internal/auth/user_store_test.go +++ b/internal/auth/user_store_test.go @@ -197,7 +197,7 @@ func TestUserTimestampsUseOneSortableFormat(t *testing.T) { t.Fatalf("touch timestamps = logged %q updated %q", touched.LoggedInAt, touched.UpdatedAt) } - if _, err := sqlite.DB.Exec(`INSERT INTO users(id,email,role,active) VALUES(?,?,?,1)`, "default-time", "default-time@example.com", "viewer"); err != nil { + if _, err := sqlite.DB.Exec(`INSERT INTO users(id,email,role,status) VALUES(?,?,?,'active')`, "default-time", "default-time@example.com", "viewer"); err != nil { t.Fatal(err) } var created, updated string diff --git a/internal/db/generated/models.go b/internal/db/generated/models.go index f3de52077..4aed7e708 100644 --- a/internal/db/generated/models.go +++ b/internal/db/generated/models.go @@ -161,13 +161,13 @@ type Setting struct { type User struct { ID string `json:"id"` Email string `json:"email"` - Name sql.NullString `json:"name"` + DisplayName sql.NullString `json:"display_name"` Role string `json:"role"` - Active int64 `json:"active"` AuthVersion int64 `json:"auth_version"` LoggedInAt sql.NullString `json:"logged_in_at"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` + Status string `json:"status"` } type UserIdentity struct { diff --git a/internal/db/generated/users.sql.go b/internal/db/generated/users.sql.go index c6942cb2c..92e374b61 100644 --- a/internal/db/generated/users.sql.go +++ b/internal/db/generated/users.sql.go @@ -11,7 +11,7 @@ import ( ) const countActiveAdmins = `-- name: CountActiveAdmins :one -SELECT COUNT(*) FROM users WHERE role = 'admin' AND active = 1 +SELECT COUNT(*) FROM users WHERE role = 'admin' AND status = 'active' ` func (q *Queries) CountActiveAdmins(ctx context.Context) (int64, error) { @@ -33,25 +33,25 @@ func (q *Queries) CountUsers(ctx context.Context) (int64, error) { } const createUser = `-- name: CreateUser :one -INSERT INTO users (id, email, name, role, created_at, updated_at) +INSERT INTO users (id, email, display_name, role, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) -RETURNING id, email, name, role, active, auth_version, logged_in_at, created_at, updated_at +RETURNING id, email, display_name, role, auth_version, logged_in_at, created_at, updated_at, status ` type CreateUserParams struct { - ID string `json:"id"` - Email string `json:"email"` - Name sql.NullString `json:"name"` - Role string `json:"role"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` + ID string `json:"id"` + Email string `json:"email"` + DisplayName sql.NullString `json:"display_name"` + Role string `json:"role"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` } func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { row := q.db.QueryRowContext(ctx, createUser, arg.ID, arg.Email, - arg.Name, + arg.DisplayName, arg.Role, arg.CreatedAt, arg.UpdatedAt, @@ -60,13 +60,13 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, e err := row.Scan( &i.ID, &i.Email, - &i.Name, + &i.DisplayName, &i.Role, - &i.Active, &i.AuthVersion, &i.LoggedInAt, &i.CreatedAt, &i.UpdatedAt, + &i.Status, ) return i, err } @@ -80,7 +80,7 @@ func (q *Queries) DeleteUser(ctx context.Context, id string) (sql.Result, error) } const getUserByEmail = `-- name: GetUserByEmail :one -SELECT id, email, name, role, active, auth_version, logged_in_at, created_at, updated_at FROM users WHERE email = ? +SELECT id, email, display_name, role, auth_version, logged_in_at, created_at, updated_at, status FROM users WHERE email = ? ` func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error) { @@ -89,19 +89,19 @@ func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error err := row.Scan( &i.ID, &i.Email, - &i.Name, + &i.DisplayName, &i.Role, - &i.Active, &i.AuthVersion, &i.LoggedInAt, &i.CreatedAt, &i.UpdatedAt, + &i.Status, ) return i, err } const getUserByID = `-- name: GetUserByID :one -SELECT id, email, name, role, active, auth_version, logged_in_at, created_at, updated_at FROM users WHERE id = ? +SELECT id, email, display_name, role, auth_version, logged_in_at, created_at, updated_at, status FROM users WHERE id = ? ` func (q *Queries) GetUserByID(ctx context.Context, id string) (User, error) { @@ -110,13 +110,13 @@ func (q *Queries) GetUserByID(ctx context.Context, id string) (User, error) { err := row.Scan( &i.ID, &i.Email, - &i.Name, + &i.DisplayName, &i.Role, - &i.Active, &i.AuthVersion, &i.LoggedInAt, &i.CreatedAt, &i.UpdatedAt, + &i.Status, ) return i, err } @@ -136,7 +136,7 @@ func (q *Queries) IncrementUserAuthVersion(ctx context.Context, arg IncrementUse } const listUsers = `-- name: ListUsers :many -SELECT id, email, name, role, active, auth_version, logged_in_at, created_at, updated_at FROM users ORDER BY created_at DESC +SELECT id, email, display_name, role, auth_version, logged_in_at, created_at, updated_at, status FROM users ORDER BY created_at DESC ` func (q *Queries) ListUsers(ctx context.Context) ([]User, error) { @@ -151,13 +151,13 @@ func (q *Queries) ListUsers(ctx context.Context) ([]User, error) { if err := rows.Scan( &i.ID, &i.Email, - &i.Name, + &i.DisplayName, &i.Role, - &i.Active, &i.AuthVersion, &i.LoggedInAt, &i.CreatedAt, &i.UpdatedAt, + &i.Status, ); err != nil { return nil, err } @@ -188,26 +188,26 @@ func (q *Queries) TouchLogin(ctx context.Context, arg TouchLoginParams) error { } const updateUser = `-- name: UpdateUser :one -UPDATE users SET email = ?, name = ?, role = ?, active = ?, updated_at = ? +UPDATE users SET email = ?, display_name = ?, role = ?, status = ?, updated_at = ? WHERE id = ? -RETURNING id, email, name, role, active, auth_version, logged_in_at, created_at, updated_at +RETURNING id, email, display_name, role, auth_version, logged_in_at, created_at, updated_at, status ` type UpdateUserParams struct { - Email string `json:"email"` - Name sql.NullString `json:"name"` - Role string `json:"role"` - Active int64 `json:"active"` - UpdatedAt string `json:"updated_at"` - ID string `json:"id"` + Email string `json:"email"` + DisplayName sql.NullString `json:"display_name"` + Role string `json:"role"` + Status string `json:"status"` + UpdatedAt string `json:"updated_at"` + ID string `json:"id"` } func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) { row := q.db.QueryRowContext(ctx, updateUser, arg.Email, - arg.Name, + arg.DisplayName, arg.Role, - arg.Active, + arg.Status, arg.UpdatedAt, arg.ID, ) @@ -215,13 +215,13 @@ func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, e err := row.Scan( &i.ID, &i.Email, - &i.Name, + &i.DisplayName, &i.Role, - &i.Active, &i.AuthVersion, &i.LoggedInAt, &i.CreatedAt, &i.UpdatedAt, + &i.Status, ) return i, err } diff --git a/internal/db/migrations/20261009000000_user_profile_status.sql b/internal/db/migrations/20261009000000_user_profile_status.sql new file mode 100644 index 000000000..c88774cbd --- /dev/null +++ b/internal/db/migrations/20261009000000_user_profile_status.sql @@ -0,0 +1,5 @@ +-- +goose Up +ALTER TABLE users RENAME COLUMN name TO display_name; +ALTER TABLE users ADD COLUMN status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'suspended')); +UPDATE users SET status = CASE WHEN active = 1 THEN 'active' ELSE 'suspended' END; +ALTER TABLE users DROP COLUMN active; diff --git a/internal/db/migrations_test.go b/internal/db/migrations_test.go index e20717dbe..065df77cf 100644 --- a/internal/db/migrations_test.go +++ b/internal/db/migrations_test.go @@ -11,9 +11,10 @@ import ( // never change or remove a checksum for a migration already published. func TestMigrationChecksums(t *testing.T) { checksums := map[string]string{ - "migrations/20260930000000_initial.sql": "2f256d45df0a604c198e165af00b66f63d9f36b13e27f2898c485da524883203", - "migrations/20261004000000_dashboard_specs.sql": "11894224e7c3ef0efcacae9a6f5f8f6d4af27ddd81ed8868b96b44fb9bbf7d36", - "migrations/20261008000001_dashboard_origins.sql": "6e7e89adf6e51633da0d73b052b12eec08ae3e7dd21ca315a4ac2fecfa703501", + "migrations/20260930000000_initial.sql": "2f256d45df0a604c198e165af00b66f63d9f36b13e27f2898c485da524883203", + "migrations/20261004000000_dashboard_specs.sql": "11894224e7c3ef0efcacae9a6f5f8f6d4af27ddd81ed8868b96b44fb9bbf7d36", + "migrations/20261008000001_dashboard_origins.sql": "6e7e89adf6e51633da0d73b052b12eec08ae3e7dd21ca315a4ac2fecfa703501", + "migrations/20261009000000_user_profile_status.sql": "aed4c0a316a5fb67b1e60c82d45c6b3ec34a2fbb44721ef772f6b5d3df546659", } paths, err := fs.Glob(migrationsFS, "migrations/*.sql") if err != nil { diff --git a/internal/db/queries/users.sql b/internal/db/queries/users.sql index 92fb4fca2..7ab436dc0 100644 --- a/internal/db/queries/users.sql +++ b/internal/db/queries/users.sql @@ -11,15 +11,15 @@ SELECT * FROM users ORDER BY created_at DESC; SELECT COUNT(*) FROM users; -- name: CountActiveAdmins :one -SELECT COUNT(*) FROM users WHERE role = 'admin' AND active = 1; +SELECT COUNT(*) FROM users WHERE role = 'admin' AND status = 'active'; -- name: CreateUser :one -INSERT INTO users (id, email, name, role, created_at, updated_at) +INSERT INTO users (id, email, display_name, role, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) RETURNING *; -- name: UpdateUser :one -UPDATE users SET email = ?, name = ?, role = ?, active = ?, updated_at = ? +UPDATE users SET email = ?, display_name = ?, role = ?, status = ?, updated_at = ? WHERE id = ? RETURNING *; diff --git a/internal/db/users_schema_test.go b/internal/db/users_schema_test.go new file mode 100644 index 000000000..500551373 --- /dev/null +++ b/internal/db/users_schema_test.go @@ -0,0 +1,77 @@ +package db + +import ( + "database/sql" + "io/fs" + "testing" + + "github.com/pressly/goose/v3" + _ "modernc.org/sqlite" +) + +func TestUserProfileStatusMigration(t *testing.T) { + database, err := sql.Open("sqlite", ":memory:") + if err != nil { + t.Fatal(err) + } + defer database.Close() + database.SetMaxOpenConns(1) + migrations, err := fs.Sub(migrationsFS, "migrations") + if err != nil { + t.Fatal(err) + } + provider, err := goose.NewProvider(goose.DialectSQLite3, database, migrations, goose.WithDisableGlobalRegistry(true)) + if err != nil { + t.Fatal(err) + } + if _, err := provider.UpTo(t.Context(), 20261008000001); err != nil { + t.Fatal(err) + } + if _, err := database.Exec(`INSERT INTO users (id, email, name, role, active, auth_version) VALUES + ('active-user', 'active@example.test', 'Active User', 'admin', 1, 7), + ('suspended-user', 'suspended@example.test', 'Suspended User', 'operator', 0, 3), + ('unnamed-user', 'unnamed@example.test', NULL, 'viewer', 1, 1)`); err != nil { + t.Fatal(err) + } + if err := Migrate(t.Context(), database); err != nil { + t.Fatal(err) + } + for _, tc := range []struct { + id, displayName, role, status string + version int + }{ + {"active-user", "Active User", "admin", "active", 7}, + {"suspended-user", "Suspended User", "operator", "suspended", 3}, + {"unnamed-user", "", "viewer", "active", 1}, + } { + var displayName sql.NullString + var role, status string + var version int + if err := database.QueryRow(`SELECT display_name, role, status, auth_version FROM users WHERE id = ?`, tc.id).Scan(&displayName, &role, &status, &version); err != nil { + t.Fatal(err) + } + if displayName.String != tc.displayName || role != tc.role || status != tc.status || version != tc.version { + t.Fatalf("migrated %s = %q %q %q %d", tc.id, displayName.String, role, status, version) + } + } + for _, column := range []string{"name", "active"} { + if _, err := database.Exec(`SELECT ` + column + ` FROM users`); err == nil { + t.Fatalf("superseded column %s remains", column) + } + } + for _, status := range []any{"disabled", "", nil} { + if _, err := database.Exec(`UPDATE users SET status = ? WHERE id = 'active-user'`, status); err == nil { + t.Fatalf("status constraint accepted %v", status) + } + } + if _, err := database.Exec(`INSERT INTO users (id, email) VALUES ('default-user', 'default@example.test')`); err != nil { + t.Fatal(err) + } + var status string + if err := database.QueryRow(`SELECT status FROM users WHERE id = 'default-user'`).Scan(&status); err != nil || status != "active" { + t.Fatalf("default status = %q, %v", status, err) + } + if err := Migrate(t.Context(), database); err != nil { + t.Fatalf("repeat migration: %v", err) + } +} diff --git a/internal/mcp/concurrent_receipts_test.go b/internal/mcp/concurrent_receipts_test.go index a4de23313..1c212949f 100644 --- a/internal/mcp/concurrent_receipts_test.go +++ b/internal/mcp/concurrent_receipts_test.go @@ -21,7 +21,7 @@ func newConcurrentFileServer(t *testing.T) *Server { } t.Cleanup(func() { _ = database.Close() }) for _, owner := range []string{"owner", "other"} { - if _, err := database.DB.Exec(`INSERT INTO users(id,email,name,role,active) VALUES(?,?,?,'admin',1)`, owner, owner+"@example.test", owner); err != nil { + if _, err := database.DB.Exec(`INSERT INTO users(id,email,display_name,role,status) VALUES(?,?,?,'admin','active')`, owner, owner+"@example.test", owner); err != nil { t.Fatal(err) } } diff --git a/internal/mcp/dashboards_tools_test.go b/internal/mcp/dashboards_tools_test.go index 2e1d96e65..aebc81c87 100644 --- a/internal/mcp/dashboards_tools_test.go +++ b/internal/mcp/dashboards_tools_test.go @@ -26,7 +26,7 @@ func newToolServer(t *testing.T, validator dashboard.Validator, panels panelExec } t.Cleanup(func() { _ = database.Close() }) for _, owner := range []string{"owner", "other"} { - if _, err := database.DB.Exec(`INSERT INTO users(id,email,name,role,active) VALUES(?,?,?,'admin',1)`, owner, owner+"@example.test", owner); err != nil { + if _, err := database.DB.Exec(`INSERT INTO users(id,email,display_name,role,status) VALUES(?,?,?,'admin','active')`, owner, owner+"@example.test", owner); err != nil { t.Fatal(err) } } diff --git a/internal/mcp/server_test.go b/internal/mcp/server_test.go index 76bf8e0f2..ce76b425a 100644 --- a/internal/mcp/server_test.go +++ b/internal/mcp/server_test.go @@ -51,7 +51,7 @@ func TestDashboardToolsUseAuthenticatedOwner(t *testing.T) { } defer database.Close() ctx := context.Background() - if _, err := database.DB.ExecContext(ctx, `INSERT INTO users(id,email,name,role,active) VALUES('owner','owner@example.test','Owner','admin',1)`); err != nil { + if _, err := database.DB.ExecContext(ctx, `INSERT INTO users(id,email,display_name,role,status) VALUES('owner','owner@example.test','Owner','admin','active')`); err != nil { t.Fatal(err) } server := NewWithIntelligence(&fakeObservability{}, dashboard.New(database.DB, structural{}), nil, nil, "test") @@ -84,7 +84,7 @@ func TestDashboardOwnerIgnoresSpoofedMetaWhenTokenPresent(t *testing.T) { defer database.Close() ctx := context.Background() for _, owner := range []string{"owner", "attacker"} { - if _, err := database.DB.ExecContext(ctx, `INSERT INTO users(id,email,name,role,active) VALUES(?,?,?,'admin',1)`, owner, owner+"@example.test", owner); err != nil { + if _, err := database.DB.ExecContext(ctx, `INSERT INTO users(id,email,display_name,role,status) VALUES(?,?,?,'admin','active')`, owner, owner+"@example.test", owner); err != nil { t.Fatal(err) } } diff --git a/internal/panel/filter_test.go b/internal/panel/filter_test.go index 113705c8e..89d8902ee 100644 --- a/internal/panel/filter_test.go +++ b/internal/panel/filter_test.go @@ -51,7 +51,7 @@ func TestCheckFilterRejectsUnsafeExpressions(t *testing.T) { vars := map[string]Variable{"service": {Name: "service", Kind: "query"}, "routes": {Name: "routes", Kind: "query", Multi: true}} cases := map[string]string{ "1=1) UNION SELECT * FROM users WHERE (1=1": "single boolean expression", - "service IN (SELECT name FROM users)": "not allowed", + "service IN (SELECT display_name FROM users)": "not allowed", "read_text('/etc/passwd') <> ''": "read_text", "servce = 'checkout'": "service", "service = $svc": "$svc", diff --git a/internal/store/store_test.go b/internal/store/store_test.go index e9a9a56cb..359a65f5d 100644 --- a/internal/store/store_test.go +++ b/internal/store/store_test.go @@ -205,7 +205,7 @@ func TestNewSQLite_InitializesWithOnlyGooseMetadata(t *testing.T) { if err := s.DB.QueryRow(`SELECT COUNT(*) FROM goose_db_version WHERE version_id > 0 AND is_applied=1`).Scan(&applied); err != nil { t.Fatal(err) } - if applied != 3 { - t.Fatalf("applied versions = %d, want 3", applied) + if applied != 4 { + t.Fatalf("applied versions = %d, want 4", applied) } } diff --git a/internal/ui/dist/assets/auth-CQerCjF_.js b/internal/ui/dist/assets/auth-BLat7TXI.js similarity index 55% rename from internal/ui/dist/assets/auth-CQerCjF_.js rename to internal/ui/dist/assets/auth-BLat7TXI.js index df41344a1..3e931b508 100644 --- a/internal/ui/dist/assets/auth-CQerCjF_.js +++ b/internal/ui/dist/assets/auth-BLat7TXI.js @@ -1 +1 @@ -import{A as e,C as t,Ct as n,K as r,M as i,Q as a,T as o,X as s,_ as c,a as l,bt as u,c as d,d as f,f as p,gt as m,h,i as ee,j as te,l as g,lt as ne,m as _,o as v,p as y,r as re,t as b,tt as ie,u as ae,vt as oe,x as se,y as ce}from"./brand-oskFJPNW.js";var x=n(u(),1),S=x.use,C=x.useLayoutEffect;function le(e){let t=m();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function w(e){let t=m(),n=le(),r=x.useRef(null);return C(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function T({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,x.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var E={root:`m_b183c0a2`},D=oe(),O=s((e,{color:t})=>({root:{"--code-bg":t?r(t,e):void 0}})),k=o(n=>{let r=i(`Code`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,color:d,block:f,mod:p,attributes:m,...h}=r,ee=e({name:`Code`,props:r,classes:E,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:O});return(0,D.jsx)(t,{component:f?`pre`:`code`,mod:[{block:f},p],...ee(`root`),...h,dir:`ltr`})});k.classes=E,k.varsResolver=O,k.displayName=`@mantine/core/Code`;function A(e,t){if(e<1)return[];let n=Array(e).fill(``);if(t){let r=t.trim().split(``);for(let t=0;t({root:{"--pin-input-size":ne(t??`sm`,`pin-input-size`)}})),M=o(t=>{let{name:n,form:r,className:o,value:s,defaultValue:l,variant:u,gap:d,style:f,size:p,classNames:m,styles:ee,unstyled:g,length:ne,onChange:_,onComplete:v,manageFocus:y,autoFocus:re,error:b,success:ae,radius:oe,disabled:se,oneTimeCode:ce,placeholder:S,type:C,mask:le,readOnly:w,inputType:E,inputMode:O,ariaLabel:k,vars:M,id:N,hiddenInputProps:P,rootRef:F,getInputProps:I,attributes:L,ref:pe,...R}=i([`Input`,`PinInput`],fe,t),z=ie(N),B=e({name:`PinInput`,classes:ue,props:t,className:o,style:f,classNames:m,styles:ee,unstyled:g,attributes:L,vars:M,varsResolver:j}),{resolvedClassNames:me,resolvedStyles:V}=te({classNames:m,styles:ee,props:t}),[H,he]=(0,x.useState)(-1),U=(0,x.useRef)([]),W=ne??4,G=(0,x.useRef)(!1),[K,q]=T({value:s===void 0?void 0:A(W,s),defaultValue:l?.split(``).slice(0,W),finalValue:A(W,``),onChange:e=>{let t=e.join(``).trim();_?.(t),t.length===W&&!G.current?(G.current=!0,v?.(t)):t.length(C instanceof RegExp?C:C&&C in de?de[C]:null)?.test(e),X=(e,t)=>{if(y){if(e===`next`){let e=t+1;e=0&&U.current[e]?.focus()}}},Z=(e,t)=>{let n=[...J];return n[t]=e,q(n),n},Q=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(Y(n)){q(A(W,n));let e=Math.min(n.length,W);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(O===`numeric`){let t=[`Backspace`,`Tab`,`Control`,`Delete`,`ArrowLeft`,`ArrowRight`],a=n||r;if(!(t.includes(i)||a||!Number.isNaN(Number(i)))){e.preventDefault();return}}switch(i){case`ArrowLeft`:e.preventDefault(),X(`prev`,t);break;case`ArrowRight`:e.preventDefault(),X(`next`,t);break;case`Tab`:a&&t>0&&y&&(e.preventDefault(),X(`prev`,t));break;case` `:e.preventDefault(),X(`next`,t);break;case`Delete`:e.preventDefault(),Z(``,t);break;case`Backspace`:s===``?(e.preventDefault(),X(`prev`,t)):(Z(``,t),t0&&i===J[t]&&(e.preventDefault(),X(`next`,t))}},ve=(e,t)=>{e.target.select(),he(t)},$=()=>{he(-1)},ye=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(Y(t.trim())){let e=A(W,t);q(e);let n=e.filter(e=>e!==``).length;n>=W?U.current[W-1]?.focus():U.current[n]?.focus()}};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{...R,...B(`root`),ref:F,role:`group`,id:z,gap:d,unstyled:g,wrap:`nowrap`,variant:u,__size:p,dir:`ltr`,children:J.map((e,t)=>(0,x.createElement)(h,{component:`input`,...B(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:me,styles:V,size:p,__staticSelector:`PinInput`,id:`${z}-${t+1}`,key:`${z}-${t}`,inputMode:O||(C===`number`?`numeric`:`text`),onChange:e=>Q(e,t),onKeyDown:e=>_e(e,t),onFocus:e=>ve(e,t),onBlur:$,onPaste:ye,type:E||(le?`password`:C===`number`?`tel`:`text`),radius:oe,error:b,success:ae,variant:u,disabled:se,ref:e=>{e&&(t===0&&a(pe,e),U.current[t]=e)},autoComplete:ce?`one-time-code`:`off`,placeholder:H===t?``:S,value:e,autoFocus:re&&t===0,unstyled:g,"aria-label":k,readOnly:w,...I?.(t)}))}),(0,D.jsx)(`input`,{type:`hidden`,name:n,form:r,value:ge,...P})]})});M.classes={...ue,..._.classes},M.varsResolver=j,M.displayName=`@mantine/core/PinInput`;var N=o(e=>{let t=i([`Input`,`InputWrapper`,`TextInput`],null,e);return(0,D.jsx)(_,{component:`input`,...t,__staticSelector:`TextInput`})});N.classes=_.classes,N.displayName=`@mantine/core/TextInput`;var P=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),F=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),I=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),L=x.forwardRef((e,t)=>x.createElement(l,{ref:t,...e,weights:P}));L.displayName=`ArrowLeftIcon`;var pe=L,R=x.forwardRef((e,t)=>x.createElement(l,{ref:t,...e,weights:F}));R.displayName=`ArrowRightIcon`;var z=R,B=x.forwardRef((e,t)=>x.createElement(l,{ref:t,...e,weights:I}));B.displayName=`UserPlusIcon`;var me=B,V=class extends Error{status;problems;constructor(e,t,n=[]){super(e),this.status=t,this.problems=n}},H=`fanout:unauthorized`;function he(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function U(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function W(){window.dispatchEvent(new Event(H))}async function G(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&W(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new V(e.message??e.error??`You do not have permission to perform this action.`,r.status)}return r}async function K(){let e=await G(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&W(),window.location.assign(`/`)}var q=(0,x.createContext)(null);function J(){let e=(0,x.useContext)(q);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var ge=(0,x.createContext)(null);function Y(){let e=(0,x.useContext)(ge);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function X(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Z(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function Q({children:e,wide:n=!1}){return(0,D.jsx)(t,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,D.jsx)(ae,{mih:`100dvh`,px:`md`,py:48,children:(0,D.jsx)(g,{size:n?680:480,w:`100%`,children:(0,D.jsx)(se,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function _e(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function ve(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function $({children:e}){let n=le(),[r,i]=(0,x.useState)(null),[a,o]=(0,x.useState)(!1),[s,l]=(0,x.useState)(`none`),[u,m]=(0,x.useState)(null),[h,te]=(0,x.useState)(!1),[g,ne]=(0,x.useState)(``),[_,ie]=(0,x.useState)(``),[oe,se]=(0,x.useState)(_e),[S,C]=(0,x.useState)(ve),[w,T]=(0,x.useState)(``),[E,O]=(0,x.useState)(!1),[A,ue]=(0,x.useState)(0),[de,fe]=(0,x.useState)(()=>Date.now()),[j,P]=(0,x.useState)(!1),[F,I]=(0,x.useState)(``),[L,R]=(0,x.useState)(null),[B,V]=(0,x.useState)(!1),W=(0,x.useRef)(null),G=he(),K=s===`user`;async function J(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){l(`none`),m(null);return}let t=await e.json().catch(()=>null);l(U(t)),m(X(t))}async function Y(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;m(X(await e.json().catch(()=>null)))}catch{}}(0,x.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),n({href:e.pathname+e.search+e.hash,replace:!0}))},[n]),(0,x.useEffect)(()=>{Z(`/api/auth/status`).then(i).catch(e=>I(String(e))).finally(()=>o(!0)),J().catch(()=>l(`none`)).finally(()=>te(!0));let e=()=>{l(`none`),m(null)};return window.addEventListener(H,e),()=>window.removeEventListener(H,e)},[]),(0,x.useEffect)(()=>{h&&s===`none`&&S&&(P(!0),I(``),Z(`/api/auth/link/verify`,{token:S}).then(()=>{l(`user`),Y()}).catch(e=>I(e instanceof Error?e.message:String(e))).finally(()=>{C(``),P(!1)}))},[S,h,s]),(0,x.useEffect)(()=>{K&&h&&G&&window.location.replace(G)},[K,G,h]),(0,x.useEffect)(()=>{if(A<=Date.now())return;let e=setInterval(()=>{fe(Date.now()),Date.now()>=A&&clearInterval(e)},1e3);return()=>clearInterval(e)},[A]);let $=Math.max(0,Math.ceil((A-de)/1e3));(0,x.useEffect)(()=>{E&&!j&&F&&W.current?.querySelector(`input`)?.focus()},[j,E,F]);async function ye(e){try{await navigator.clipboard.writeText(e),V(!0)}catch{I(`Clipboard access failed. Select and copy the token manually.`)}}if(L?.ingest_token)return(0,D.jsx)(Q,{wide:!0,children:(0,D.jsxs)(d,{gap:`lg`,children:[(0,D.jsx)(b,{}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(p,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,D.jsx)(v,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,D.jsx)(p,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(p,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,D.jsx)(k,{block:!0,children:L.suggested_endpoint??window.location.origin})]}),(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(p,{size:`sm`,fw:600,children:`Header`}),(0,D.jsxs)(k,{block:!0,children:[L.ingest_header_name??`Authorization`,`: Bearer `,L.ingest_token]})]}),F&&(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F}),(0,D.jsxs)(c,{grow:!0,align:`stretch`,children:[(0,D.jsx)(f,{variant:`light`,radius:`md`,leftSection:B?(0,D.jsx)(ee,{size:16,weight:`bold`}):(0,D.jsx)(re,{size:16}),onClick:()=>void ye(`${L.ingest_header_name??`Authorization`}: Bearer ${L.ingest_token}`),children:B?`Copied`:`Copy header`}),(0,D.jsx)(f,{radius:`md`,rightSection:(0,D.jsx)(z,{size:16,weight:`bold`}),onClick:()=>{l(`user`),R(null),Y()},children:`Continue to Fanout`})]}),(0,D.jsx)(f,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ye(L.ingest_token??``),children:`Copy token only`})]})});if(!h||!a||S)return(0,D.jsx)(ae,{mih:`100dvh`,children:(0,D.jsx)(ce,{size:`sm`})});if(!r)return(0,D.jsx)(Q,{children:(0,D.jsxs)(d,{gap:`lg`,children:[(0,D.jsx)(b,{}),(0,D.jsx)(v,{order:1,children:`Fanout is unavailable`}),(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F||`Authentication status could not be loaded.`})]})});if(K&&G)return null;if(K)return(0,D.jsx)(q.Provider,{value:r,children:(0,D.jsx)(ge.Provider,{value:u??{id:``,email:g,name:_,role:``},children:e})});if(r&&!r.setup_required&&r.auth_mode===`oidc`){let e=G?`/api/auth/oidc/start?return_to=${encodeURIComponent(G)}`:`/api/auth/oidc/start`;return(0,D.jsx)(Q,{children:(0,D.jsxs)(d,{gap:28,children:[(0,D.jsx)(b,{}),(0,D.jsxs)(d,{gap:10,children:[(0,D.jsx)(p,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,D.jsx)(v,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,D.jsx)(p,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),F&&(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F}),(0,D.jsx)(f,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,D.jsx)(z,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function be(){P(!0),I(``);try{await Z(`/api/auth/code/send`,{email:g}),O(!0),T(``),ue(Date.now()+3e4),fe(Date.now())}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}async function xe(e){P(!0),I(``);try{await Z(`/api/auth/code/verify`,{email:g,code:e}),l(`user`),O(!1),T(``),ue(0),Y()}catch(e){T(``),I(e instanceof Error?e.message:String(e))}finally{P(!1)}}function Se(){O(!1),T(``),I(``)}async function Ce(e){e.preventDefault(),P(!0),I(``);try{if(r?.setup_required){let e=await Z(`/api/auth/setup`,{email:g,name:_,setup_token:oe});e.ingest_token?R(e):(l(`user`),Y())}else if(E){await xe(w);return}else{await be();return}}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}let we=E&&!r?.setup_required,Te=r?.setup_required?`Create the first admin`:we?`Check your email`:r?.self_signup?`Sign in or create an account`:`Sign in`,Ee=r?.setup_required?`Use the one-time token printed by the Fanout process.`:r?.smtp_configured?we?`We sent a code to ${g}.`:r?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,D.jsx)(Q,{children:(0,D.jsxs)(d,{gap:28,children:[(0,D.jsx)(b,{}),(0,D.jsxs)(d,{gap:10,children:[(0,D.jsx)(p,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:r?.setup_required?`One-time setup`:`Secure workspace`}),(0,D.jsx)(v,{order:1,fz:{base:28,sm:32},lh:1.08,children:Te}),Ee&&(0,D.jsx)(p,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ee})]}),(0,D.jsx)(`form`,{onSubmit:Ce,children:(0,D.jsxs)(d,{gap:`md`,children:[(0,D.jsx)(N,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:g,onChange:e=>ne(e.currentTarget.value),disabled:E,variant:`filled`,radius:`md`,size:`md`,autoFocus:!E}),r?.setup_required&&(0,D.jsx)(N,{label:`Name`,placeholder:`Your name`,value:_,onChange:e=>ie(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),r?.setup_required&&(0,D.jsx)(N,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:oe,onChange:e=>se(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),we&&(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(p,{size:`sm`,fw:600,children:`Verification code`}),(0,D.jsx)(t,{ref:W,children:(0,D.jsx)(M,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:w,onChange:T,onComplete:e=>void xe(e),disabled:j,error:!!F,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,D.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,D.jsxs)(p,{c:`dimmed`,size:`xs`,children:[`Sent to `,g]}),(0,D.jsx)(f,{variant:`subtle`,size:`compact-xs`,leftSection:(0,D.jsx)(pe,{size:12,weight:`bold`}),onClick:Se,disabled:j,children:`Change email`})]}),(0,D.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,D.jsx)(p,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,D.jsx)(f,{variant:`subtle`,size:`compact-xs`,onClick:()=>void be(),disabled:j||$>0,children:$>0?`Resend in ${$}s`:`Resend code`})]})]}),F&&(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F}),we?(0,D.jsx)(f,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:j,disabled:j||w.length<6,rightSection:(0,D.jsx)(z,{size:17,weight:`bold`}),children:`Verify code`}):(0,D.jsx)(f,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:j,disabled:!r||!r.setup_required&&!r.smtp_configured,leftSection:r?.setup_required?(0,D.jsx)(me,{size:17,weight:`bold`}):void 0,rightSection:r?.setup_required?void 0:(0,D.jsx)(z,{size:17,weight:`bold`}),children:r?.setup_required?`Create admin`:`Send code`})]})})]})})}export{K as a,k as c,le as d,S as f,G as i,T as l,J as n,V as o,C as p,Y as r,N as s,$ as t,w as u}; \ No newline at end of file +import{A as e,C as t,Ct as n,K as r,M as i,Q as a,T as o,X as s,_ as c,a as l,bt as u,c as d,d as f,f as p,gt as m,h,i as ee,j as te,l as g,lt as ne,m as _,o as v,p as y,r as re,t as b,tt as ie,u as ae,vt as oe,x as se,y as ce}from"./brand-oskFJPNW.js";var x=n(u(),1),S=x.use,C=x.useLayoutEffect;function le(e){let t=m();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function w(e){let t=m(),n=le(),r=x.useRef(null);return C(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function T({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,x.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var E={root:`m_b183c0a2`},D=oe(),O=s((e,{color:t})=>({root:{"--code-bg":t?r(t,e):void 0}})),k=o(n=>{let r=i(`Code`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,color:d,block:f,mod:p,attributes:m,...h}=r,ee=e({name:`Code`,props:r,classes:E,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:O});return(0,D.jsx)(t,{component:f?`pre`:`code`,mod:[{block:f},p],...ee(`root`),...h,dir:`ltr`})});k.classes=E,k.varsResolver=O,k.displayName=`@mantine/core/Code`;function A(e,t){if(e<1)return[];let n=Array(e).fill(``);if(t){let r=t.trim().split(``);for(let t=0;t({root:{"--pin-input-size":ne(t??`sm`,`pin-input-size`)}})),M=o(t=>{let{name:n,form:r,className:o,value:s,defaultValue:l,variant:u,gap:d,style:f,size:p,classNames:m,styles:ee,unstyled:g,length:ne,onChange:_,onComplete:v,manageFocus:y,autoFocus:re,error:b,success:ae,radius:oe,disabled:se,oneTimeCode:ce,placeholder:S,type:C,mask:le,readOnly:w,inputType:E,inputMode:O,ariaLabel:k,vars:M,id:N,hiddenInputProps:P,rootRef:F,getInputProps:I,attributes:L,ref:pe,...R}=i([`Input`,`PinInput`],fe,t),z=ie(N),B=e({name:`PinInput`,classes:ue,props:t,className:o,style:f,classNames:m,styles:ee,unstyled:g,attributes:L,vars:M,varsResolver:j}),{resolvedClassNames:me,resolvedStyles:V}=te({classNames:m,styles:ee,props:t}),[H,he]=(0,x.useState)(-1),U=(0,x.useRef)([]),W=ne??4,G=(0,x.useRef)(!1),[K,q]=T({value:s===void 0?void 0:A(W,s),defaultValue:l?.split(``).slice(0,W),finalValue:A(W,``),onChange:e=>{let t=e.join(``).trim();_?.(t),t.length===W&&!G.current?(G.current=!0,v?.(t)):t.length(C instanceof RegExp?C:C&&C in de?de[C]:null)?.test(e),X=(e,t)=>{if(y){if(e===`next`){let e=t+1;e=0&&U.current[e]?.focus()}}},Z=(e,t)=>{let n=[...J];return n[t]=e,q(n),n},Q=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(Y(n)){q(A(W,n));let e=Math.min(n.length,W);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(O===`numeric`){let t=[`Backspace`,`Tab`,`Control`,`Delete`,`ArrowLeft`,`ArrowRight`],a=n||r;if(!(t.includes(i)||a||!Number.isNaN(Number(i)))){e.preventDefault();return}}switch(i){case`ArrowLeft`:e.preventDefault(),X(`prev`,t);break;case`ArrowRight`:e.preventDefault(),X(`next`,t);break;case`Tab`:a&&t>0&&y&&(e.preventDefault(),X(`prev`,t));break;case` `:e.preventDefault(),X(`next`,t);break;case`Delete`:e.preventDefault(),Z(``,t);break;case`Backspace`:s===``?(e.preventDefault(),X(`prev`,t)):(Z(``,t),t0&&i===J[t]&&(e.preventDefault(),X(`next`,t))}},ve=(e,t)=>{e.target.select(),he(t)},$=()=>{he(-1)},ye=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(Y(t.trim())){let e=A(W,t);q(e);let n=e.filter(e=>e!==``).length;n>=W?U.current[W-1]?.focus():U.current[n]?.focus()}};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{...R,...B(`root`),ref:F,role:`group`,id:z,gap:d,unstyled:g,wrap:`nowrap`,variant:u,__size:p,dir:`ltr`,children:J.map((e,t)=>(0,x.createElement)(h,{component:`input`,...B(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:me,styles:V,size:p,__staticSelector:`PinInput`,id:`${z}-${t+1}`,key:`${z}-${t}`,inputMode:O||(C===`number`?`numeric`:`text`),onChange:e=>Q(e,t),onKeyDown:e=>_e(e,t),onFocus:e=>ve(e,t),onBlur:$,onPaste:ye,type:E||(le?`password`:C===`number`?`tel`:`text`),radius:oe,error:b,success:ae,variant:u,disabled:se,ref:e=>{e&&(t===0&&a(pe,e),U.current[t]=e)},autoComplete:ce?`one-time-code`:`off`,placeholder:H===t?``:S,value:e,autoFocus:re&&t===0,unstyled:g,"aria-label":k,readOnly:w,...I?.(t)}))}),(0,D.jsx)(`input`,{type:`hidden`,name:n,form:r,value:ge,...P})]})});M.classes={...ue,..._.classes},M.varsResolver=j,M.displayName=`@mantine/core/PinInput`;var N=o(e=>{let t=i([`Input`,`InputWrapper`,`TextInput`],null,e);return(0,D.jsx)(_,{component:`input`,...t,__staticSelector:`TextInput`})});N.classes=_.classes,N.displayName=`@mantine/core/TextInput`;var P=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),F=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),I=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),L=x.forwardRef((e,t)=>x.createElement(l,{ref:t,...e,weights:P}));L.displayName=`ArrowLeftIcon`;var pe=L,R=x.forwardRef((e,t)=>x.createElement(l,{ref:t,...e,weights:F}));R.displayName=`ArrowRightIcon`;var z=R,B=x.forwardRef((e,t)=>x.createElement(l,{ref:t,...e,weights:I}));B.displayName=`UserPlusIcon`;var me=B,V=class extends Error{status;problems;constructor(e,t,n=[]){super(e),this.status=t,this.problems=n}},H=`fanout:unauthorized`;function he(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function U(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function W(){window.dispatchEvent(new Event(H))}async function G(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&W(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new V(e.message??e.error??`You do not have permission to perform this action.`,r.status)}return r}async function K(){let e=await G(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&W(),window.location.assign(`/`)}var q=(0,x.createContext)(null);function J(){let e=(0,x.useContext)(q);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var ge=(0,x.createContext)(null);function Y(){let e=(0,x.useContext)(ge);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function X(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function Z(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function Q({children:e,wide:n=!1}){return(0,D.jsx)(t,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,D.jsx)(ae,{mih:`100dvh`,px:`md`,py:48,children:(0,D.jsx)(g,{size:n?680:480,w:`100%`,children:(0,D.jsx)(se,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function _e(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function ve(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function $({children:e}){let n=le(),[r,i]=(0,x.useState)(null),[a,o]=(0,x.useState)(!1),[s,l]=(0,x.useState)(`none`),[u,m]=(0,x.useState)(null),[h,te]=(0,x.useState)(!1),[g,ne]=(0,x.useState)(``),[_,ie]=(0,x.useState)(``),[oe,se]=(0,x.useState)(_e),[S,C]=(0,x.useState)(ve),[w,T]=(0,x.useState)(``),[E,O]=(0,x.useState)(!1),[A,ue]=(0,x.useState)(0),[de,fe]=(0,x.useState)(()=>Date.now()),[j,P]=(0,x.useState)(!1),[F,I]=(0,x.useState)(``),[L,R]=(0,x.useState)(null),[B,V]=(0,x.useState)(!1),W=(0,x.useRef)(null),G=he(),K=s===`user`;async function J(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){l(`none`),m(null);return}let t=await e.json().catch(()=>null);l(U(t)),m(X(t))}async function Y(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;m(X(await e.json().catch(()=>null)))}catch{}}(0,x.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),n({href:e.pathname+e.search+e.hash,replace:!0}))},[n]),(0,x.useEffect)(()=>{Z(`/api/auth/status`).then(i).catch(e=>I(String(e))).finally(()=>o(!0)),J().catch(()=>l(`none`)).finally(()=>te(!0));let e=()=>{l(`none`),m(null)};return window.addEventListener(H,e),()=>window.removeEventListener(H,e)},[]),(0,x.useEffect)(()=>{h&&s===`none`&&S&&(P(!0),I(``),Z(`/api/auth/link/verify`,{token:S}).then(()=>{l(`user`),Y()}).catch(e=>I(e instanceof Error?e.message:String(e))).finally(()=>{C(``),P(!1)}))},[S,h,s]),(0,x.useEffect)(()=>{K&&h&&G&&window.location.replace(G)},[K,G,h]),(0,x.useEffect)(()=>{if(A<=Date.now())return;let e=setInterval(()=>{fe(Date.now()),Date.now()>=A&&clearInterval(e)},1e3);return()=>clearInterval(e)},[A]);let $=Math.max(0,Math.ceil((A-de)/1e3));(0,x.useEffect)(()=>{E&&!j&&F&&W.current?.querySelector(`input`)?.focus()},[j,E,F]);async function ye(e){try{await navigator.clipboard.writeText(e),V(!0)}catch{I(`Clipboard access failed. Select and copy the token manually.`)}}if(L?.ingest_token)return(0,D.jsx)(Q,{wide:!0,children:(0,D.jsxs)(d,{gap:`lg`,children:[(0,D.jsx)(b,{}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(p,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,D.jsx)(v,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,D.jsx)(p,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(p,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,D.jsx)(k,{block:!0,children:L.suggested_endpoint??window.location.origin})]}),(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(p,{size:`sm`,fw:600,children:`Header`}),(0,D.jsxs)(k,{block:!0,children:[L.ingest_header_name??`Authorization`,`: Bearer `,L.ingest_token]})]}),F&&(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F}),(0,D.jsxs)(c,{grow:!0,align:`stretch`,children:[(0,D.jsx)(f,{variant:`light`,radius:`md`,leftSection:B?(0,D.jsx)(ee,{size:16,weight:`bold`}):(0,D.jsx)(re,{size:16}),onClick:()=>void ye(`${L.ingest_header_name??`Authorization`}: Bearer ${L.ingest_token}`),children:B?`Copied`:`Copy header`}),(0,D.jsx)(f,{radius:`md`,rightSection:(0,D.jsx)(z,{size:16,weight:`bold`}),onClick:()=>{l(`user`),R(null),Y()},children:`Continue to Fanout`})]}),(0,D.jsx)(f,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ye(L.ingest_token??``),children:`Copy token only`})]})});if(!h||!a||S)return(0,D.jsx)(ae,{mih:`100dvh`,children:(0,D.jsx)(ce,{size:`sm`})});if(!r)return(0,D.jsx)(Q,{children:(0,D.jsxs)(d,{gap:`lg`,children:[(0,D.jsx)(b,{}),(0,D.jsx)(v,{order:1,children:`Fanout is unavailable`}),(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F||`Authentication status could not be loaded.`})]})});if(K&&G)return null;if(K)return(0,D.jsx)(q.Provider,{value:r,children:(0,D.jsx)(ge.Provider,{value:u??{id:``,email:g,display_name:_,status:`active`,role:``},children:e})});if(r&&!r.setup_required&&r.auth_mode===`oidc`){let e=G?`/api/auth/oidc/start?return_to=${encodeURIComponent(G)}`:`/api/auth/oidc/start`;return(0,D.jsx)(Q,{children:(0,D.jsxs)(d,{gap:28,children:[(0,D.jsx)(b,{}),(0,D.jsxs)(d,{gap:10,children:[(0,D.jsx)(p,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,D.jsx)(v,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,D.jsx)(p,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),F&&(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F}),(0,D.jsx)(f,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,D.jsx)(z,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function be(){P(!0),I(``);try{await Z(`/api/auth/code/send`,{email:g}),O(!0),T(``),ue(Date.now()+3e4),fe(Date.now())}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}async function xe(e){P(!0),I(``);try{await Z(`/api/auth/code/verify`,{email:g,code:e}),l(`user`),O(!1),T(``),ue(0),Y()}catch(e){T(``),I(e instanceof Error?e.message:String(e))}finally{P(!1)}}function Se(){O(!1),T(``),I(``)}async function Ce(e){e.preventDefault(),P(!0),I(``);try{if(r?.setup_required){let e=await Z(`/api/auth/setup`,{email:g,display_name:_,setup_token:oe});e.ingest_token?R(e):(l(`user`),Y())}else if(E){await xe(w);return}else{await be();return}}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}let we=E&&!r?.setup_required,Te=r?.setup_required?`Create the first admin`:we?`Check your email`:r?.self_signup?`Sign in or create an account`:`Sign in`,Ee=r?.setup_required?`Use the one-time token printed by the Fanout process.`:r?.smtp_configured?we?`We sent a code to ${g}.`:r?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,D.jsx)(Q,{children:(0,D.jsxs)(d,{gap:28,children:[(0,D.jsx)(b,{}),(0,D.jsxs)(d,{gap:10,children:[(0,D.jsx)(p,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:r?.setup_required?`One-time setup`:`Secure workspace`}),(0,D.jsx)(v,{order:1,fz:{base:28,sm:32},lh:1.08,children:Te}),Ee&&(0,D.jsx)(p,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ee})]}),(0,D.jsx)(`form`,{onSubmit:Ce,children:(0,D.jsxs)(d,{gap:`md`,children:[(0,D.jsx)(N,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:g,onChange:e=>ne(e.currentTarget.value),disabled:E,variant:`filled`,radius:`md`,size:`md`,autoFocus:!E}),r?.setup_required&&(0,D.jsx)(N,{label:`Display name`,placeholder:`Your display name`,value:_,onChange:e=>ie(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),r?.setup_required&&(0,D.jsx)(N,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:oe,onChange:e=>se(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),we&&(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(p,{size:`sm`,fw:600,children:`Verification code`}),(0,D.jsx)(t,{ref:W,children:(0,D.jsx)(M,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:w,onChange:T,onComplete:e=>void xe(e),disabled:j,error:!!F,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,D.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,D.jsxs)(p,{c:`dimmed`,size:`xs`,children:[`Sent to `,g]}),(0,D.jsx)(f,{variant:`subtle`,size:`compact-xs`,leftSection:(0,D.jsx)(pe,{size:12,weight:`bold`}),onClick:Se,disabled:j,children:`Change email`})]}),(0,D.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,D.jsx)(p,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,D.jsx)(f,{variant:`subtle`,size:`compact-xs`,onClick:()=>void be(),disabled:j||$>0,children:$>0?`Resend in ${$}s`:`Resend code`})]})]}),F&&(0,D.jsx)(y,{color:`bad`,radius:`md`,children:F}),we?(0,D.jsx)(f,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:j,disabled:j||w.length<6,rightSection:(0,D.jsx)(z,{size:17,weight:`bold`}),children:`Verify code`}):(0,D.jsx)(f,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:j,disabled:!r||!r.setup_required&&!r.smtp_configured,leftSection:r?.setup_required?(0,D.jsx)(me,{size:17,weight:`bold`}):void 0,rightSection:r?.setup_required?void 0:(0,D.jsx)(z,{size:17,weight:`bold`}),children:r?.setup_required?`Create admin`:`Send code`})]})})]})})}export{K as a,k as c,le as d,S as f,G as i,T as l,J as n,V as o,C as p,Y as r,N as s,$ as t,w as u}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat-Dr6SwXRM.js b/internal/ui/dist/assets/chat-CnBaUKaM.js similarity index 98% rename from internal/ui/dist/assets/chat-Dr6SwXRM.js rename to internal/ui/dist/assets/chat-CnBaUKaM.js index 98a7f59ff..c7a601234 100644 --- a/internal/ui/dist/assets/chat-Dr6SwXRM.js +++ b/internal/ui/dist/assets/chat-CnBaUKaM.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BW8pt9vy.js","assets/brand-oskFJPNW.js","assets/auth-CQerCjF_.js","assets/use-computed-color-scheme-Bb1nqm0Z.js","assets/FocusTrap-yVpiEwpv.js","assets/get-single-element-child-D7qmWU2f.js","assets/index-G9N3n5OB.js","assets/preload-helper-DOsq4iEA.js","assets/theme-BKAYKhPv.js","assets/Tooltip-2jTVpG2Y.js","assets/useQuery-BynlWFEG.js","assets/index-5ZpnOwIs.css"])))=>i.map(i=>d[i]); -import{A as e,C as t,Ct as n,M as r,S as i,T as a,_ as o,a as s,bt as c,c as l,d as u,et as d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,u as b,vt as x,x as S,y as C}from"./brand-oskFJPNW.js";import{c as w,d as ee,f as T,h as E,l as D,m as O,o as te,s as k,t as A}from"./preload-helper-DOsq4iEA.js";import{t as j}from"./Tooltip-2jTVpG2Y.js";import{c as M,d as N,l as P,o as F,r as I,s as ne,t as re,u as ie}from"./dashboard-change-chips-8yAFuODi.js";var L=n(c(),1),R=x(),ae=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function oe(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ae)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var V=null;function se(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function ce({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=d(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=oe(n);if(!r)return;let[i]=se(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},f=(0,L.useEffectEvent)(u),p=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(f))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:p,ref:s})}var H=a(e=>{let{autosize:t,maxRows:n,minRows:i,__staticSelector:a,resize:o,bottomSection:s,bottomSectionProps:c,...l}=r([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&N()!==`test`,d=u?{maxRows:n,minRows:i}:{};return(0,R.jsx)(h,{component:u?ce:`textarea`,...l,__staticSelector:a||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=a(n=>{let i=r(`Typography`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=i,f=e({name:`Typography`,classes:U,props:i,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(t,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var le=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),G=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:le}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:ue}));q.displayName=`PaperPlaneTiltIcon`;var fe=q,J=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:de}));J.displayName=`StopIcon`;var pe=J;function me(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function he(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{he(t.tool_result)}catch{return}return Y.add(t),t}}var ge=64,_e=300;function ve(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=ge?t.current=!0:(s||Date.now()-o<_e)&&(t.current=!1),a()};r.addEventListener(`scroll`,d,{passive:!0}),r.addEventListener(`wheel`,c,{passive:!0}),r.addEventListener(`touchmove`,c,{passive:!0}),r.addEventListener(`keydown`,c),r.addEventListener(`pointerdown`,l),window.addEventListener(`pointerup`,u),n.current=()=>{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function ye(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var be={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function xe({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),s=(0,L.useId)(),c=e.saved,d=c?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,d?.checked?`Checked in ${Z(d.elapsed_ms)}`:void 0,c?`Saved v${c.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...c?w(c.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(S,{"data-build-receipt":e.turn_id,"data-dashboard-result":c?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(l,{gap:6,children:[(0,R.jsxs)(o,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(u,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(o,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(re,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),c&&(0,R.jsx)(u,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:c.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ie,{expanded:i,id:s,children:(0,R.jsxs)(l,{gap:4,children:[c&&(0,R.jsxs)(f,{size:`xs`,children:[c.label,` `,c.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[be[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),d&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,d.checked?`checked`:`incomplete`,` · `,Z(d.elapsed_ms)]}),d?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Se=(0,L.lazy)(()=>A(()=>import(`./mcp-app-frame-BW8pt9vy.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function Ce(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function we(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=ee(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&D(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=typeof e?.error==`string`?e.error:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:u,readOnly:e?.code===`answer_only`}),t.set(c,l)}}return t}function Te({failures:e}){let[n,r]=(0,L.useState)(!1),a=e.filter(e=>!e.readOnly);return(0,R.jsxs)(t,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),a.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:n?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a.length,` tool `,a.length===1?`call`:`calls`,` failed`]})]}),n&&(0,R.jsx)(l,{gap:`xs`,pl:`md`,children:a.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function Ee({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let r=e.content.tool_result,a=me(r),o=[...new Set(r.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=r.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of r.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=r.dashboard.panels.length>1?[`${r.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(S,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a,` · `,o,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(C,{size:`sm`})}),children:(0,R.jsx)(Se,{content:e.content})})]})}var De=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Oe(){let{agentAvailable:e,messages:n,messageTimes:r,ready:i,running:a,activity:s,provisional:c,stopped:d,error:p,threadMissing:h,send:g,retry:y,reloadThread:x,newThread:w}=k(),{scrollRef:ee,contentRef:T,toBottom:E}=ve(),D=te(n),O=n.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(S,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(l,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(_,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(u,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let A=Ce(n),j=we(n),M=n.filter(e=>A.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=n.findIndex(e=>e.id===O),P=n.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=n.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&c&&!c.collapsed&&c.text&&!P;return(0,R.jsxs)(t,{className:`chat-pane`,children:[(0,R.jsx)(t,{className:`chat-scroll`,ref:ee,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(v,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(o,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,onClick:w,children:`New chat`})]})}),!h&&!i&&p&&(0,R.jsx)(ke,{message:p,onRetry:x,onNewThread:w}),!h&&!i&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(C,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&i&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(je,{onSelect:g}),(0,R.jsxs)(l,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Te,{failures:j.get(e.id)},e.id):(0,R.jsxs)(t,{children:[(0,R.jsx)(Me,{message:e,time:r[e.id],appView:A.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(t,{mt:`sm`,children:(0,R.jsx)(xe,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:s})})]},e.id)),(F||I)&&(0,R.jsx)(t,{"data-answer-position":!0,children:(0,R.jsx)(Me,{message:I?{id:c.id,role:`assistant`,content:c.text}:F,provisional:!!I,time:I?void 0:r[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(o,{gap:`xs`,role:`status`,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:s||`Analyzing your system`})]}),d&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(ke,{message:p,onRetry:y})]})]})]})}),!h&&(0,R.jsx)(Ae,{})]})}function ke({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(v,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(o,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(u,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Ae(){let{input:e,setInput:n,inputRef:r,submit:i,send:a,stop:s,ready:c,running:l}=k();return(0,R.jsx)(t,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(S,{component:`form`,onSubmit:i,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(o,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:r,"aria-label":`Message Fanout`,value:e,onChange:e=>n(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!c,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(j,{label:`Stop`,children:(0,R.jsx)(O,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,R.jsx)(pe,{size:16,weight:`fill`})})}):(0,R.jsx)(O,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!c,"aria-label":`Send message`,children:(0,R.jsx)(fe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function je({onSelect:e}){return(0,R.jsxs)(l,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(_,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(o,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:De.map(t=>(0,R.jsx)(u,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Me({message:e,time:n,appView:r,provisional:i=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(v,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?r?(0,R.jsx)(Ee,{view:r}):(0,R.jsx)(v,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let s=e.role===`user`,c=n?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(n)):``;return(0,R.jsxs)(t,{className:`chat-message${i?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":s?`user`:`assistant`,children:[s?(0,R.jsx)(S,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${i?` chat-markdown--provisional`:``}`,"data-provisional":i||void 0,children:(0,R.jsx)(ne,{remarkPlugins:[F],components:Pe,children:a})}),(i||c||!s)&&(0,R.jsx)(o,{className:`chat-message-meta`,gap:6,justify:s?`flex-end`:`flex-start`,mt:4,h:24,children:i?(0,R.jsx)(C,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[c&&n&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:I(n),children:c}),!s&&(0,R.jsx)(Ne,{text:a,label:`Copy message`})]})})]})}function Ne({text:e,label:t}){let{state:n,copy:r}=ye();return(0,R.jsx)(j,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(O,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(y,{size:13})})})}var Pe={table:({children:e})=>(0,R.jsx)(t,{className:`chat-table`,children:(0,R.jsx)(P,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(P.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(P.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(P.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(P.Th,{children:e}),td:({children:e})=>(0,R.jsx)(P.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Fe,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Fe({children:e}){let n=$(e);return(0,R.jsxs)(t,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(t,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Ne,{text:n,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,Oe as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-DT6-Vfjz.js","assets/brand-oskFJPNW.js","assets/auth-BLat7TXI.js","assets/use-computed-color-scheme-Bb1nqm0Z.js","assets/FocusTrap-yVpiEwpv.js","assets/get-single-element-child-D7qmWU2f.js","assets/index-ZMM27O4I.js","assets/preload-helper-DOsq4iEA.js","assets/theme-ByHk_Blp.js","assets/Tooltip-2jTVpG2Y.js","assets/useQuery-BynlWFEG.js","assets/index-5ZpnOwIs.css"])))=>i.map(i=>d[i]); +import{A as e,C as t,Ct as n,M as r,S as i,T as a,_ as o,a as s,bt as c,c as l,d as u,et as d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,u as b,vt as x,x as S,y as C}from"./brand-oskFJPNW.js";import{c as w,d as ee,f as T,h as E,l as D,m as O,o as te,s as k,t as A}from"./preload-helper-DOsq4iEA.js";import{t as j}from"./Tooltip-2jTVpG2Y.js";import{c as M,d as N,l as P,o as F,r as I,s as ne,t as re,u as ie}from"./dashboard-change-chips-8yAFuODi.js";var L=n(c(),1),R=x(),ae=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function oe(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ae)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var V=null;function se(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function ce({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=d(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=oe(n);if(!r)return;let[i]=se(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},f=(0,L.useEffectEvent)(u),p=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(f))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:p,ref:s})}var H=a(e=>{let{autosize:t,maxRows:n,minRows:i,__staticSelector:a,resize:o,bottomSection:s,bottomSectionProps:c,...l}=r([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&N()!==`test`,d=u?{maxRows:n,minRows:i}:{};return(0,R.jsx)(h,{component:u?ce:`textarea`,...l,__staticSelector:a||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=a(n=>{let i=r(`Typography`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=i,f=e({name:`Typography`,classes:U,props:i,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(t,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var le=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),G=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:le}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:ue}));q.displayName=`PaperPlaneTiltIcon`;var fe=q,J=L.forwardRef((e,t)=>L.createElement(s,{ref:t,...e,weights:de}));J.displayName=`StopIcon`;var pe=J;function me(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function he(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{he(t.tool_result)}catch{return}return Y.add(t),t}}var ge=64,_e=300;function ve(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=ge?t.current=!0:(s||Date.now()-o<_e)&&(t.current=!1),a()};r.addEventListener(`scroll`,d,{passive:!0}),r.addEventListener(`wheel`,c,{passive:!0}),r.addEventListener(`touchmove`,c,{passive:!0}),r.addEventListener(`keydown`,c),r.addEventListener(`pointerdown`,l),window.addEventListener(`pointerup`,u),n.current=()=>{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function ye(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var be={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function xe({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),s=(0,L.useId)(),c=e.saved,d=c?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,d?.checked?`Checked in ${Z(d.elapsed_ms)}`:void 0,c?`Saved v${c.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...c?w(c.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(S,{"data-build-receipt":e.turn_id,"data-dashboard-result":c?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(l,{gap:6,children:[(0,R.jsxs)(o,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(u,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(o,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(re,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),c&&(0,R.jsx)(u,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:c.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ie,{expanded:i,id:s,children:(0,R.jsxs)(l,{gap:4,children:[c&&(0,R.jsxs)(f,{size:`xs`,children:[c.label,` `,c.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[be[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),d&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,d.checked?`checked`:`incomplete`,` · `,Z(d.elapsed_ms)]}),d?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Se=(0,L.lazy)(()=>A(()=>import(`./mcp-app-frame-DT6-Vfjz.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function Ce(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function we(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=ee(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&D(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=typeof e?.error==`string`?e.error:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:u,readOnly:e?.code===`answer_only`}),t.set(c,l)}}return t}function Te({failures:e}){let[n,r]=(0,L.useState)(!1),a=e.filter(e=>!e.readOnly);return(0,R.jsxs)(t,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),a.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:n?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a.length,` tool `,a.length===1?`call`:`calls`,` failed`]})]}),n&&(0,R.jsx)(l,{gap:`xs`,pl:`md`,children:a.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function Ee({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let r=e.content.tool_result,a=me(r),o=[...new Set(r.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=r.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of r.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=r.dashboard.panels.length>1?[`${r.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(S,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(i,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a,` · `,o,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(C,{size:`sm`})}),children:(0,R.jsx)(Se,{content:e.content})})]})}var De=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Oe(){let{agentAvailable:e,messages:n,messageTimes:r,ready:i,running:a,activity:s,provisional:c,stopped:d,error:p,threadMissing:h,send:g,retry:y,reloadThread:x,newThread:w}=k(),{scrollRef:ee,contentRef:T,toBottom:E}=ve(),D=te(n),O=n.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(S,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(l,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(_,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(u,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let A=Ce(n),j=we(n),M=n.filter(e=>A.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=n.findIndex(e=>e.id===O),P=n.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=n.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&c&&!c.collapsed&&c.text&&!P;return(0,R.jsxs)(t,{className:`chat-pane`,children:[(0,R.jsx)(t,{className:`chat-scroll`,ref:ee,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(v,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(o,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,onClick:w,children:`New chat`})]})}),!h&&!i&&p&&(0,R.jsx)(ke,{message:p,onRetry:x,onNewThread:w}),!h&&!i&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(C,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&i&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(je,{onSelect:g}),(0,R.jsxs)(l,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Te,{failures:j.get(e.id)},e.id):(0,R.jsxs)(t,{children:[(0,R.jsx)(Me,{message:e,time:r[e.id],appView:A.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(t,{mt:`sm`,children:(0,R.jsx)(xe,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:s})})]},e.id)),(F||I)&&(0,R.jsx)(t,{"data-answer-position":!0,children:(0,R.jsx)(Me,{message:I?{id:c.id,role:`assistant`,content:c.text}:F,provisional:!!I,time:I?void 0:r[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(o,{gap:`xs`,role:`status`,children:[(0,R.jsx)(C,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:s||`Analyzing your system`})]}),d&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(ke,{message:p,onRetry:y})]})]})]})}),!h&&(0,R.jsx)(Ae,{})]})}function ke({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(v,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(o,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(u,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Ae(){let{input:e,setInput:n,inputRef:r,submit:i,send:a,stop:s,ready:c,running:l}=k();return(0,R.jsx)(t,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(S,{component:`form`,onSubmit:i,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(o,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:r,"aria-label":`Message Fanout`,value:e,onChange:e=>n(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!c,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(j,{label:`Stop`,children:(0,R.jsx)(O,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,R.jsx)(pe,{size:16,weight:`fill`})})}):(0,R.jsx)(O,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!c,"aria-label":`Send message`,children:(0,R.jsx)(fe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function je({onSelect:e}){return(0,R.jsxs)(l,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(_,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(o,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:De.map(t=>(0,R.jsx)(u,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Me({message:e,time:n,appView:r,provisional:i=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(v,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?r?(0,R.jsx)(Ee,{view:r}):(0,R.jsx)(v,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let s=e.role===`user`,c=n?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(n)):``;return(0,R.jsxs)(t,{className:`chat-message${i?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":s?`user`:`assistant`,children:[s?(0,R.jsx)(S,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${i?` chat-markdown--provisional`:``}`,"data-provisional":i||void 0,children:(0,R.jsx)(ne,{remarkPlugins:[F],components:Pe,children:a})}),(i||c||!s)&&(0,R.jsx)(o,{className:`chat-message-meta`,gap:6,justify:s?`flex-end`:`flex-start`,mt:4,h:24,children:i?(0,R.jsx)(C,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[c&&n&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:I(n),children:c}),!s&&(0,R.jsx)(Ne,{text:a,label:`Copy message`})]})})]})}function Ne({text:e,label:t}){let{state:n,copy:r}=ye();return(0,R.jsx)(j,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(O,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(y,{size:13})})})}var Pe={table:({children:e})=>(0,R.jsx)(t,{className:`chat-table`,children:(0,R.jsx)(P,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(P.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(P.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(P.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(P.Th,{children:e}),td:({children:e})=>(0,R.jsx)(P.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Fe,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Fe({children:e}){let n=$(e);return(0,R.jsxs)(t,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(t,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Ne,{text:n,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,Oe as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-B2BwBfS8.js b/internal/ui/dist/assets/chat._threadId-B2BwBfS8.js deleted file mode 100644 index 285eaf4d1..000000000 --- a/internal/ui/dist/assets/chat._threadId-B2BwBfS8.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-Dr6SwXRM.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DrWvJyZf.js b/internal/ui/dist/assets/chat._threadId-DrWvJyZf.js new file mode 100644 index 000000000..4c6f7e2d1 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-DrWvJyZf.js @@ -0,0 +1 @@ +import{t as e}from"./chat-CnBaUKaM.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-B2BwBfS8.js b/internal/ui/dist/assets/chat.index-B2BwBfS8.js deleted file mode 100644 index 285eaf4d1..000000000 --- a/internal/ui/dist/assets/chat.index-B2BwBfS8.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-Dr6SwXRM.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-DrWvJyZf.js b/internal/ui/dist/assets/chat.index-DrWvJyZf.js new file mode 100644 index 000000000..4c6f7e2d1 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-DrWvJyZf.js @@ -0,0 +1 @@ +import{t as e}from"./chat-CnBaUKaM.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-eTWiXAiz.js b/internal/ui/dist/assets/dashboards._dashboardId-B_qsLVgC.js similarity index 62% rename from internal/ui/dist/assets/dashboards._dashboardId-eTWiXAiz.js rename to internal/ui/dist/assets/dashboards._dashboardId-B_qsLVgC.js index 57e44f3e5..66abfabe0 100644 --- a/internal/ui/dist/assets/dashboards._dashboardId-eTWiXAiz.js +++ b/internal/ui/dist/assets/dashboards._dashboardId-B_qsLVgC.js @@ -1 +1 @@ -import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-CQerCjF_.js";import{_ as n,b as r}from"./theme-BKAYKhPv.js";import{t as i}from"./page-DclWQ-lK.js";import{t as a}from"./index-G9N3n5OB.js";var o=e();function s(){let{dashboardId:e}=a.useParams(),s=n(a.useSearch()),c=t(),l=(t,n,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file +import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-BLat7TXI.js";import{_ as n,b as r}from"./theme-ByHk_Blp.js";import{t as i}from"./page-CSqb2kMb.js";import{t as a}from"./index-ZMM27O4I.js";var o=e();function s(){let{dashboardId:e}=a.useParams(),s=n(a.useSearch()),c=t(),l=(t,n,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-BtnZ9Vkj.js b/internal/ui/dist/assets/dashboards.index-DFcSFkLA.js similarity index 55% rename from internal/ui/dist/assets/dashboards.index-BtnZ9Vkj.js rename to internal/ui/dist/assets/dashboards.index-DFcSFkLA.js index 099367a25..ace48d0af 100644 --- a/internal/ui/dist/assets/dashboards.index-BtnZ9Vkj.js +++ b/internal/ui/dist/assets/dashboards.index-DFcSFkLA.js @@ -1 +1 @@ -import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-CQerCjF_.js";import{_ as n,b as r}from"./theme-BKAYKhPv.js";import{t as i}from"./page-DclWQ-lK.js";import{n as a}from"./index-G9N3n5OB.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file +import{vt as e}from"./brand-oskFJPNW.js";import{d as t}from"./auth-BLat7TXI.js";import{_ as n,b as r}from"./theme-ByHk_Blp.js";import{t as i}from"./page-CSqb2kMb.js";import{n as a}from"./index-ZMM27O4I.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-G9N3n5OB.js b/internal/ui/dist/assets/index-ZMM27O4I.js similarity index 98% rename from internal/ui/dist/assets/index-G9N3n5OB.js rename to internal/ui/dist/assets/index-ZMM27O4I.js index 89ec8c11d..c6963360d 100644 --- a/internal/ui/dist/assets/index-G9N3n5OB.js +++ b/internal/ui/dist/assets/index-ZMM27O4I.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CmpBxgdE.js","assets/brand-oskFJPNW.js","assets/auth-CQerCjF_.js","assets/settings-Civ3-rvD.js","assets/Tooltip-2jTVpG2Y.js","assets/get-single-element-child-D7qmWU2f.js","assets/useQuery-BynlWFEG.js","assets/FocusTrap-yVpiEwpv.js","assets/WarningCircle.es-CsY2RrOb.js","assets/chat.index-B2BwBfS8.js","assets/chat-Dr6SwXRM.js","assets/preload-helper-DOsq4iEA.js","assets/dashboard-change-chips-8yAFuODi.js","assets/chat._threadId-B2BwBfS8.js","assets/dashboards.index-BtnZ9Vkj.js","assets/theme-BKAYKhPv.js","assets/use-computed-color-scheme-Bb1nqm0Z.js","assets/page-DclWQ-lK.js","assets/dashboards._dashboardId-eTWiXAiz.js"])))=>i.map(i=>d[i]); -import{A as e,B as t,C as n,Ct as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,P as p,R as m,S as h,St as g,T as _,V as v,W as y,X as b,Y as ee,_ as x,_t as te,a as S,bt as ne,c as re,d as ie,f as ae,ft as oe,gt as se,ht as ce,it as le,k as ue,lt as de,mt as fe,p as pe,pt as me,rt as he,st as ge,t as _e,tt as ve,u as ye,ut as be,vt as xe,w as Se,xt as Ce,y as we,yt as Te}from"./brand-oskFJPNW.js";import{a as Ee,d as C,i as w,n as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./auth-CQerCjF_.js";import{A as Ne,B as Pe,D as Fe,E as Ie,F as Le,L as Re,M as ze,N as Be,O as Ve,P as He,R as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,g as Ye,i as Xe,j as Ze,k as Qe,m as $e,n as et,p as tt,r as nt,s as rt,t as it,u as at,v as ot,w as st,x as ct,y as lt,z as ut}from"./preload-helper-DOsq4iEA.js";import{A as dt,B as ft,E as pt,H as mt,Q as ht,S as gt,T as _t,U as vt,V as yt,W as bt,X as xt,Y as St,Z as Ct,_ as wt,a as Tt,at as Et,b as Dt,ct as Ot,dt as kt,et as At,it as jt,lt as Mt,n as Nt,nt as Pt,ot as Ft,rt as It,st as Lt,t as Rt,tt as zt,ut as Bt,x as Vt,z as Ht}from"./theme-BKAYKhPv.js";import{E as Ut,T as Wt,o as Gt,t as Kt}from"./Tooltip-2jTVpG2Y.js";import{n as qt,t as Jt}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{C as Yt,E as Xt,F as Zt,L as Qt,T as $t,_ as en,a as tn,b as nn,c as rn,d as an,f as on,g as sn,h as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-BynlWFEG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xn=Ce((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ae());else{var t=n(l);t!==null&&ce(ee,t.startTime-e)}}}var x=!1,te=-1,S=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():x=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ce(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=Ce(((e,t)=>{t.exports=xn()})),Cn=Ce((e=>{var t=Sn(),n=ne(),r=Te();function i(e){var t=`https://react.dev/errors/`+e;if(1ke||(e.current=Oe[ke],Oe[ke]=null,ke--)}function Me(e,t){ke++,Oe[ke]=e.current,e.current=t}var Ne=Ae(null),Pe=Ae(null),Fe=Ae(null),Ie=Ae(null);function Le(e,t){switch(Me(Fe,t),Me(Pe,e),Me(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wp(t),e=Tp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}je(Ne),Me(Ne,e)}function Re(){je(Ne),je(Pe),je(Fe)}function ze(e){var t=e.memoizedState;t!==null&&(xh._currentValue=t.memoizedState,Me(Ie,e)),t=Ne.current;var n=Tp(t,e.type);t!==n&&(Me(Pe,e),Me(Ne,n))}function Be(e){Pe.current===e&&(je(Ne),je(Pe)),Ie.current===e&&(je(Ie),xh._currentValue=De)}var Ve,He;function Ue(e){if(Ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||``,He=-1i.map(i=>d[i]); +import{A as e,B as t,C as n,Ct as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,P as p,R as m,S as h,St as g,T as _,V as v,W as y,X as b,Y as ee,_ as x,_t as te,a as S,bt as ne,c as re,d as ie,f as ae,ft as oe,gt as se,ht as ce,it as le,k as ue,lt as de,mt as fe,p as pe,pt as me,rt as he,st as ge,t as _e,tt as ve,u as ye,ut as be,vt as xe,w as Se,xt as Ce,y as we,yt as Te}from"./brand-oskFJPNW.js";import{a as Ee,d as C,i as w,n as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./auth-BLat7TXI.js";import{A as Ne,B as Pe,D as Fe,E as Ie,F as Le,L as Re,M as ze,N as Be,O as Ve,P as He,R as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,g as Ye,i as Xe,j as Ze,k as Qe,m as $e,n as et,p as tt,r as nt,s as rt,t as it,u as at,v as ot,w as st,x as ct,y as lt,z as ut}from"./preload-helper-DOsq4iEA.js";import{A as dt,B as ft,E as pt,H as mt,Q as ht,S as gt,T as _t,U as vt,V as yt,W as bt,X as xt,Y as St,Z as Ct,_ as wt,a as Tt,at as Et,b as Dt,ct as Ot,dt as kt,et as At,it as jt,lt as Mt,n as Nt,nt as Pt,ot as Ft,rt as It,st as Lt,t as Rt,tt as zt,ut as Bt,x as Vt,z as Ht}from"./theme-ByHk_Blp.js";import{E as Ut,T as Wt,o as Gt,t as Kt}from"./Tooltip-2jTVpG2Y.js";import{n as qt,t as Jt}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{C as Yt,E as Xt,F as Zt,L as Qt,T as $t,_ as en,a as tn,b as nn,c as rn,d as an,f as on,g as sn,h as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-BynlWFEG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xn=Ce((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ae());else{var t=n(l);t!==null&&ce(ee,t.startTime-e)}}}var x=!1,te=-1,S=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():x=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ce(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=Ce(((e,t)=>{t.exports=xn()})),Cn=Ce((e=>{var t=Sn(),n=ne(),r=Te();function i(e){var t=`https://react.dev/errors/`+e;if(1ke||(e.current=Oe[ke],Oe[ke]=null,ke--)}function Me(e,t){ke++,Oe[ke]=e.current,e.current=t}var Ne=Ae(null),Pe=Ae(null),Fe=Ae(null),Ie=Ae(null);function Le(e,t){switch(Me(Fe,t),Me(Pe,e),Me(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wp(t),e=Tp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}je(Ne),Me(Ne,e)}function Re(){je(Ne),je(Pe),je(Fe)}function ze(e){var t=e.memoizedState;t!==null&&(xh._currentValue=t.memoizedState,Me(Ie,e)),t=Ne.current;var n=Tp(t,e.type);t!==n&&(Me(Pe,e),Me(Ne,n))}function Be(e){Pe.current===e&&(je(Ne),je(Pe)),Ie.current===e&&(je(Ie),xh._currentValue=De)}var Ve,He;function Ue(e){if(Ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||``,He=-1)`:-1s(e,t,n)},i,a=_C,o=!oC.jitless,s=o&&vC.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?sw(e,u,t,f):ow(e,u,t))):i?sw(r,u,t,f):ow(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>ow(t,u,e))):ow(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function lw(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>PC(e,r,sC())))}),t}var uw=Q(`$ZodUnion`,(e,t)=>{tw.init(e,t),pC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),pC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),pC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),pC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>fC(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>lw(t,n,e,r)):lw(a,n,e,r)}}),dw=Q(`$ZodIntersection`,(e,t)=>{tw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>pw(e,t,n)):pw(e,i,a)}});function fw(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(yC(e)&&yC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=fw(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{tw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!yC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...MC(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...MC(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>PC(e,r,sC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...MC(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...MC(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),hw=Q(`$ZodEnum`,(e,t)=>{tw.init(e,t);let n=cC(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>bC.has(typeof e)).map(e=>typeof e==`string`?xC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),gw=Q(`$ZodLiteral`,(e,t)=>{tw.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?xC(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),_w=Q(`$ZodTransform`,(e,t)=>{tw.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new aC;return e.value=r,e}}),vw=Q(`$ZodOptional`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,pC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${fC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),yw=Q(`$ZodNullable`,(e,t)=>{tw.init(e,t),pC(e._zod,`optin`,()=>t.innerType._zod.optin),pC(e._zod,`optout`,()=>t.innerType._zod.optout),pC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${fC(e.source)}|null)$`):void 0}),pC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),bw=Q(`$ZodDefault`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,pC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xw(e,t)):xw(r,t)}});function xw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Sw=Q(`$ZodPrefault`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,pC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Cw=Q(`$ZodNonOptional`,(e,t)=>{tw.init(e,t),pC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ww(t,e)):ww(i,e)}});function ww(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Tw=Q(`$ZodCatch`,(e,t)=>{tw.init(e,t),e._zod.optin=`optional`,pC(e._zod,`optout`,()=>t.innerType._zod.optout),pC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>PC(e,n,sC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>PC(e,n,sC()))},input:e.value}),e.issues=[]),e)}}),Ew=Q(`$ZodPipe`,(e,t)=>{tw.init(e,t),pC(e._zod,`values`,()=>t.in._zod.values),pC(e._zod,`optin`,()=>t.in._zod.optin),pC(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Dw(e,t,n)):Dw(r,t,n)}});function Dw(e,t,n){return jC(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var Ow=Q(`$ZodReadonly`,(e,t)=>{tw.init(e,t),pC(e._zod,`propValues`,()=>t.innerType._zod.propValues),pC(e._zod,`values`,()=>t.innerType._zod.values),pC(e._zod,`optin`,()=>t.innerType._zod.optin),pC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(kw):kw(r)}});function kw(e){return e.value=Object.freeze(e.value),e}var Aw=Q(`$ZodLazy`,(e,t)=>{tw.init(e,t),pC(e._zod,`innerType`,()=>t.getter()),pC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),pC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),pC(e._zod,`optin`,()=>e._zod.innerType._zod.optin),pC(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),jw=Q(`$ZodCustom`,(e,t)=>{JC.init(e,t),tw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Mw(t,n,r,e));Mw(i,n,r,e)}});function Mw(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(IC(e))}}var Nw=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Pw(){return new Nw}var Fw=Pw();function Iw(e){return new e({type:`unknown`})}function Lw(e,t){return new e({type:`never`,...CC(t)})}function Rw(e,t){return new YC({check:`max_length`,...CC(t),maximum:e})}function zw(e,t){return new XC({check:`min_length`,...CC(t),minimum:e})}function Bw(e,t){return new ZC({check:`length_equals`,...CC(t),length:e})}function Vw(e){return new QC({check:`overwrite`,tx:e})}function Hw(e,t,n){return new e({type:`array`,element:t,...CC(n)})}function Uw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...CC(n)})}var Ww=(e,t)=>{RC.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>VC(e,t)},flatten:{value:t=>BC(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};Q(`ZodError`,Ww);var Gw=Q(`ZodError`,Ww,{Parent:Error}),Kw=HC(Gw),qw=UC(Gw),Jw=WC(Gw),Yw=KC(Gw),Xw=Q(`ZodType`,(e,t)=>(tw.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>SC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Kw(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Jw(e,t,n),e.parseAsync=async(t,n)=>qw(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Yw(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(NT(t,n)),e.superRefine=t=>e.check(PT(t)),e.overwrite=t=>e.check(Vw(t)),e.optional=()=>hT(e),e.nullable=()=>_T(e),e.nullish=()=>hT(_T(e)),e.nonoptional=t=>CT(e,t),e.array=()=>nT(e),e.or=t=>aT([e,t]),e.and=t=>sT(e,t),e.transform=t=>DT(e,pT(t)),e.default=t=>yT(e,t),e.prefault=t=>xT(e,t),e.catch=t=>TT(e,t),e.pipe=t=>DT(e,t),e.readonly=()=>kT(e),e.describe=t=>{let n=e.clone();return Fw.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return Fw.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Fw.get(e);let n=e.clone();return Fw.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zw=Q(`ZodUnknown`,(e,t)=>{nw.init(e,t),Xw.init(e,t)});function Qw(){return Iw(Zw)}var $w=Q(`ZodNever`,(e,t)=>{rw.init(e,t),Xw.init(e,t)});function eT(e){return Lw($w,e)}var tT=Q(`ZodArray`,(e,t)=>{aw.init(e,t),Xw.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(zw(t,n)),e.nonempty=t=>e.check(zw(1,t)),e.max=(t,n)=>e.check(Rw(t,n)),e.length=(t,n)=>e.check(Bw(t,n)),e.unwrap=()=>e.element});function nT(e,t){return Hw(tT,e,t)}var rT=Q(`ZodObject`,(e,t)=>{cw.init(e,t),Xw.init(e,t),pC(e,`shape`,()=>t.shape),e.keyof=()=>uT(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qw()}),e.strict=()=>e.clone({...e._zod.def,catchall:eT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>DC(e,t),e.merge=t=>OC(e,t),e.pick=t=>TC(e,t),e.omit=t=>EC(e,t),e.partial=(...t)=>kC(mT,e,t[0]),e.required=(...t)=>AC(ST,e,t[0])}),iT=Q(`ZodUnion`,(e,t)=>{uw.init(e,t),Xw.init(e,t),e.options=t.options});function aT(e,t){return new iT({type:`union`,options:e,...CC(t)})}var oT=Q(`ZodIntersection`,(e,t)=>{dw.init(e,t),Xw.init(e,t)});function sT(e,t){return new oT({type:`intersection`,left:e,right:t})}var cT=Q(`ZodRecord`,(e,t)=>{mw.init(e,t),Xw.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),lT=Q(`ZodEnum`,(e,t)=>{hw.init(e,t),Xw.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new lT({...t,checks:[],...CC(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new lT({...t,checks:[],...CC(r),entries:i})}});function uT(e,t){return new lT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...CC(t)})}var dT=Q(`ZodLiteral`,(e,t)=>{gw.init(e,t),Xw.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),fT=Q(`ZodTransform`,(e,t)=>{_w.init(e,t),Xw.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(IC(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(IC(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function pT(e){return new fT({type:`transform`,transform:e})}var mT=Q(`ZodOptional`,(e,t)=>{vw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hT(e){return new mT({type:`optional`,innerType:e})}var gT=Q(`ZodNullable`,(e,t)=>{yw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _T(e){return new gT({type:`nullable`,innerType:e})}var vT=Q(`ZodDefault`,(e,t)=>{bw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yT(e,t){return new vT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var bT=Q(`ZodPrefault`,(e,t)=>{Sw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xT(e,t){return new bT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var ST=Q(`ZodNonOptional`,(e,t)=>{Cw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType});function CT(e,t){return new ST({type:`nonoptional`,innerType:e,...CC(t)})}var wT=Q(`ZodCatch`,(e,t)=>{Tw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function TT(e,t){return new wT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var ET=Q(`ZodPipe`,(e,t)=>{Ew.init(e,t),Xw.init(e,t),e.in=t.in,e.out=t.out});function DT(e,t){return new ET({type:`pipe`,in:e,out:t})}var OT=Q(`ZodReadonly`,(e,t)=>{Ow.init(e,t),Xw.init(e,t)});function kT(e){return new OT({type:`readonly`,innerType:e})}var AT=Q(`ZodLazy`,(e,t)=>{Aw.init(e,t),Xw.init(e,t),e.unwrap=()=>e._zod.def.getter()}),jT=Q(`ZodCustom`,(e,t)=>{jw.init(e,t),Xw.init(e,t)});function MT(e){let t=new JC({check:`custom`});return t._zod.check=e,t}function NT(e,t={}){return Uw(jT,e,t)}function PT(e){let t=MT(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(IC(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(IC(r))}},e(n.value,n)));return t}var FT=`@ag-ui/client`;function IT(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,FT))return;let t=e.metadata?.[FT];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var $=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function LT(){return vo()}function RT(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function zT(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&zT(t);return e}var BT=524288;function VT(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function HT(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!VT(t,n,BT),c=s?$(t):t,l=s?$(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(zT(c),zT(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=$(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=$(e.state),d=!0,n=!0),s&&n&&VT(c,l,BT)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&RT(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?$(c):c}:{},...d?{state:Object.isFrozen(l)?$(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function UT(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function WT(e){if(e instanceof GT)return e;if(e===!0)return new GT(UT(!0))}var GT=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function KT(e){return e.enabled?new GT(e):void 0}function qT(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function JT(e,t){return!e||t.metadata===void 0?!1:(e.metadata=wo(e.metadata,$(t.metadata)),!0)}var YT=(e,t,n,r,i)=>{let a=WT(i),o=$(n.messages),s=$(e.state),c={},l=[],u=new Set,d=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:l.filter(e=>!u.has(e))},f=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},p=()=>{let e=$(c);return c={},e.messages!==void 0||e.state!==void 0?Vc(e):cc};return t.pipe(Zc(async t=>{let i=await HT(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(f(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return p();switch(t.type){case O.TEXT_MESSAGE_START:{let i=await HT(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),p();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=JT(s,t);(!a||c)&&f({messages:o})}return p()}case O.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let l=await HT(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,JT(c,t),f({messages:o})),p()}case O.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let c=await HT(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&JT(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case O.TOOL_CALL_START:{let i=await HT(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;l.includes(e)||l.push(e);let a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(JT(a,t)||r)&&f({messages:o}),p()}let s=new Set(o.map(e=>e.id)),c=qT(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let u={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(u),JT(u,t),f({messages:o})}return p()}case O.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),p();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),p();let u=await HT(r,o,s,(r,i,a)=>{let o=l.function.arguments,s=l.function.name,c={};try{c=il(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return f(u),u.stopPropagation!==!0&&(l.function.arguments+=a,JT(l,t),f({messages:o})),p()}case O.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),p();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),p();let l=await HT(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return f(l),l.stopPropagation!==!0&&JT(c,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),p()}case O.TOOL_CALL_RESULT:{let i=await HT(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:d}=t;u.add(a);let p={id:i,toolCallId:a,role:l||`tool`,content:c,...d!=null&&{subagentRunId:d}};JT(p,t);let m=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(m===-1)o.push(p);else{let e=m+1;for(;e{t.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})})),f({messages:o})}return p()}case O.STATE_SNAPSHOT:{let i=await HT(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,f({state:s})}return p()}case O.STATE_DELTA:{let i=await HT(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=ss.applyPatch(s,e,!0,!1).newDocument,f({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return p()}case O.MESSAGES_SNAPSHOT:{let i=await HT(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=IT(t),a=n.some(e=>e.role===`activity`),s=n.some(e=>e.role===`reasoning`),c=e=>e.role===`activity`&&(i?!i.includes(e.activityType):i!==null&&!a)||e.role===`reasoning`&&!s;o=o.filter(e=>r.has(e.id)||c(e)).map(e=>r.get(e.id)??e);let l=new Set(o.map(e=>e.id));for(let e of n)l.has(e.id)||o.push(e);f({messages:o})}return p()}case O.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await HT(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(f(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:$(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:$(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),JT(d,i),f({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return p()}case O.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return p();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),p();let l=c,u=await HT(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(f(u),u.stopPropagation!==!0)try{JT(l,i)&&f({messages:o});let e=$(l.content??{}),t=ss.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:$(t),activityType:i.activityType},f({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return p()}case O.RAW:return f(await HT(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.CUSTOM:return f(await HT(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.RUN_STARTED:{let i=await HT(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),l=[],u=new Set,i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}f({messages:o})}}return p()}case O.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:d(i)},c=await HT(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return f(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),p()}case O.RUN_ERROR:return f(await HT(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.STEP_STARTED:return f(await HT(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.STEP_FINISHED:return f(await HT(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case O.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case O.REASONING_START:return f(await HT(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.REASONING_MESSAGE_START:{let i=await HT(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=JT(i,t);(!r||a)&&f({messages:o})}return p()}case O.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let l=await HT(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,JT(c,t),f({messages:o})),p()}case O.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let c=await HT(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&JT(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case O.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case O.REASONING_END:return f(await HT(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await HT(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(u),u.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return p()}case O.SUBAGENT_STARTED:return f(await HT(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.SUBAGENT_FINISHED:return f(await HT(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case O.SUBAGENT_ERROR:return f(await HT(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p()}return t.type,p()}),qc(),r.length>0?Qc({}):e=>e)},XT=e=>t=>{let n=WT(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=()=>{r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!0},v=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new k(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!s.toolCall.has(n.id))&&s.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},y=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new k(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(Kc(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==O.RUN_STARTED)return M(()=>new k(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==O.RUN_ERROR&&t!==O.RUN_STARTED)return M(()=>new k(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==O.RUN_STARTED&&t!==O.RUN_ERROR)return M(()=>new k(`First event must be 'RUN_STARTED'`))}else if(t===O.RUN_STARTED){if(g&&!c&&!l)return M(()=>new k(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&_()}if(e.subagentRunId===null)return M(()=>new k(`Cannot send '${t}' with 'subagentRunId: null'. The field is optional — omit it entirely.`));if(t===O.SUBAGENT_STARTED||t===O.SUBAGENT_FINISHED||t===O.SUBAGENT_ERROR){let n=t===O.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===O.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return M(()=>new k(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return M(()=>new k(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return M(()=>new k(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return M(()=>new k(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===O.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return M(()=>new k(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case O.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return M(()=>new k(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=s.message.get(n);if(i){let r=y(t,e.subagentRunId,i,`message`,n);if(r)return M(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),Vc(e)}case O.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return M(()=>new k(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=y(t,e.subagentRunId,s.message.get(n),`message`,n);return i?M(()=>i):Vc(e)}case O.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return M(()=>new k(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=y(t,e.subagentRunId,s.message.get(n),`message`,n);return i?M(()=>i):(r.delete(n),Vc(e))}case O.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return M(()=>new k(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return M(()=>new k(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));o=e}}let c=s.toolCall.get(n);if(c){let e=y(t,a,c,`tool call`,n);if(e)return M(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return M(()=>new k(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),Vc(e)}case O.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return M(()=>new k(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=y(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?M(()=>r):Vc(e)}case O.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return M(()=>new k(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=y(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?M(()=>r):(i.delete(n),Vc(e))}case O.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?M(()=>new k(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),Vc(e))}case O.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return M(r?()=>new k(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new k(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),Vc(e)}case O.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),Vc(e)}case O.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),Vc(e)}case O.REASONING_START:case O.REASONING_MESSAGE_START:{let n=e.messageId,r=t===O.REASONING_START,i=r?a:o;if(i.has(n))return M(()=>new k(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=y(t,e.subagentRunId,c,`reasoning message`,n);if(r)return M(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),Vc(e)}case O.REASONING_MESSAGE_CONTENT:case O.REASONING_MESSAGE_END:case O.REASONING_END:{let n=e.messageId,r=t===O.REASONING_END,i=r?a:o;if(!i.has(n))return M(()=>new k(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=y(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?M(()=>c):((t===O.REASONING_END||t===O.REASONING_MESSAGE_END)&&i.delete(n),Vc(e))}case O.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=y(t,e.subagentRunId,i,a,n);return o?M(()=>o):Vc(e)}case O.ACTIVITY_DELTA:{let n=e.messageId,r=y(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?M(()=>r):Vc(e)}case O.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return M(()=>new k(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return M(()=>new k(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?M(()=>new k(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?M(()=>new k(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?M(()=>new k(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),Vc(e))}case O.SUBAGENT_FINISHED:case O.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return M(()=>new k(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===O.SUBAGENT_ERROR&&typeof e.message!=`string`)return M(()=>new k(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),Vc(e)):M(()=>new k(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case O.MESSAGES_SNAPSHOT:{let t=v(e.messages,!0);if(t)return M(()=>t)}return Vc(e);case O.RUN_STARTED:g=!0;{let t=v((e.input??{}).messages,!1);if(t)return M(()=>t)}return Vc(e);case O.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return M(()=>new k(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,Vc(e);case O.RUN_ERROR:return l=!0,Vc(e);case O.CUSTOM:return Vc(e);default:return Vc(e)}}))},ZT=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),QT=e=>Jc(()=>Bc(e())).pipe(el(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Bc(e.text()).pipe(Kc(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,M(()=>i)}))}let t={type:ZT.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Ys(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:ZT.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):M(()=>Error(`Failed to getReader() from response`))})),$T=10485760,eE=(e,t)=>{let n=WT(t),r=new ic,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==ZT.HEADERS&&e.type===ZT.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e);if(a.length>$T){r.error(Error(`SSE buffer size exceeded maximum limit of ${$T/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` `),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` `),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},tE=10485760,nE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,rE=(e,t)=>{let n=WT(t),r=new ic,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==ZT.HEADERS&&e.type===ZT.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>tE){r.error(Error(`Protobuf message size exceeded maximum limit of ${tE/1048576} MB`));return}if(i.length{let n=WT(t),r=new ic,i=new sc(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===ZT.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?rE(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):eE(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:O.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},aE={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},oE=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)};function sE(e,t){return Eo(t)&&cE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),To(t)}var cE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},lE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Kc(r=>{switch(r.type){case O.TEXT_MESSAGE_START:{let e=r;return[{type:aE.TextMessageStart,messageId:e.messageId,role:e.role}]}case O.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:aE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case O.TEXT_MESSAGE_END:{let e=r;return[{type:aE.TextMessageEnd,messageId:e.messageId}]}case O.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:aE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case O.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return cE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(il(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:aE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case O.TOOL_CALL_END:{let e=r;return[{type:aE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case O.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&cE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:aE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:sE(e.toolCallId,e.content),actionName:t||`unknown`}]}case O.RAW:return f||(f=!0,cE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case O.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:aE.MetaEvent,name:e.name,value:e.value}]}case O.STATE_SNAPSHOT:return p(r.snapshot),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case O.STATE_DELTA:{let c=r,l;try{l=ss.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return cE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case O.MESSAGES_SNAPSHOT:return c=r.messages,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case O.RUN_STARTED:return[];case O.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=uE(c)}catch(e){return[{type:aE.RunError,message:e.message}]}return[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case O.RUN_ERROR:{let e=r;return[{type:aE.RunError,message:e.message,code:e.code}]}case O.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case O.STEP_FINISHED:return u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function uE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=oE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:sE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var dE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,fE=e=>e===`tool`?`toolCallId`:`messageId`,pE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},mE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},hE=(e,t)=>{let n=mE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},gE=e=>new Set(Object.keys(e.shape)),_E=gE(Nv),vE=gE(Lv),yE=gE(by),bE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},xE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},SE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&xE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},CE=e=>t=>{let n=WT(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:O.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:O.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:O.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&dE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${fE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Kc(e=>{switch(e.type){case O.TEXT_MESSAGE_START:case O.TEXT_MESSAGE_CONTENT:case O.TEXT_MESSAGE_END:case O.TOOL_CALL_START:case O.TOOL_CALL_ARGS:case O.TOOL_CALL_END:case O.TOOL_CALL_RESULT:case O.STATE_SNAPSHOT:case O.STATE_DELTA:case O.CUSTOM:case O.STEP_STARTED:case O.STEP_FINISHED:case O.REASONING_START:case O.REASONING_MESSAGE_START:case O.REASONING_MESSAGE_CONTENT:case O.REASONING_MESSAGE_END:case O.REASONING_END:return[...i(e.subagentRunId??void 0),e];case O.RUN_STARTED:case O.RUN_FINISHED:case O.RUN_ERROR:case O.MESSAGES_SNAPSHOT:return[...a(),e];case O.RAW:case O.ACTIVITY_SNAPSHOT:case O.ACTIVITY_DELTA:case O.REASONING_ENCRYPTED_VALUE:case O.SUBAGENT_STARTED:return[e];case O.SUBAGENT_FINISHED:case O.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case O.TEXT_MESSAGE_CHUNK:{let t=e,a=bE(e,_E),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))pE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),pE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=mE({type:O.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case O.TOOL_CALL_CHUNK:{let t=e,a=bE(e,vE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))pE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),pE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=mE({type:O.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TOOL_CALL_CHUNK`),l}case O.REASONING_MESSAGE_CHUNK:{let t=e,a=bE(e,yE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=mE({type:O.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),$c(()=>{a()}))},wE=Symbol(`agui.strip.drop`);function TE(e){let t=e;for(;;){if(t instanceof mT||t instanceof gT||t instanceof vT||t instanceof OT||t instanceof wT){t=t.unwrap();continue}if(t instanceof ET){t=t.def.in;continue}if(t instanceof AT){t=t.def.getter();continue}return t}}function EE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function DE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function OE(e){let t=TE(e);return t instanceof dT?DE(t):void 0}function kE(e,t,n,r){let i=TE(t);if(i instanceof rT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=kE(a[e],i,`${n}/${e}`,r);if(l===wE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return wE}o[e]=l}return o}if(i instanceof tT){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=kE(e,t,`${n}/${i}`,r);if(s===wE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof cT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=kE(a[e],t,`${n}/${e}`,r);if(s===wE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof iT){let t=i.options,a=EE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=TE(o);if(!(t instanceof rT))continue;let s=t.shape;if(OE(s[a])===i)return kE(e,o,n,r)}return wE}let o=t.filter(e=>TE(e)instanceof rT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=TE(i);if(t instanceof tT&&Array.isArray(e)||t instanceof rT&&s)return kE(e,i,n,r)}return e}return e}function AE(e,t){let n=[],r=kE(e,t,``,n);if(r===wE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var jE=new Set(Object.values(O));function ME(e){return jE.has(e.type)}var NE=new Map(Ey.options.map(e=>{let t=e.shape;return[String(DE(t.type)),e]})),PE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function FE(e){PE()||console.warn(`[ag-ui][enforce] ${e}`)}var IE=e=>t=>{let n=WT(e);return t.pipe(Kc(e=>{if(!ME(e))return FE(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),cc;let t=NE.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=AE(e,t);for(let t of i)FE(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return Vc(t.parse(r))}))};function LE(e){let{value:t,stripped:n}=AE(So(e,`RunAgentInput`),oy);for(let e of n)FE(`Removed unrecognised material at '${e}' from the outgoing input.`);return oy.parse(t)}var RE=class{runNext(e,t){return t.run(e).pipe(CE(!1))}runNextWithState(e,t){let n=$(e.messages||[]),r=$(e.state===void 0?{}:e.state),i=new sc;return YT(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(Zc(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:$(n),state:$(r)})))}},zE=class extends RE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function UE(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function WE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(VE(e)){let n=HE(e);return n.type!==`binary`&&t.some(t=>UE(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var GE=`THINKING_START`,KE=`THINKING_END`,qE=`THINKING_TEXT_MESSAGE_START`,JE=`THINKING_TEXT_MESSAGE_CONTENT`,YE=`THINKING_TEXT_MESSAGE_END`;function XE(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}function ZE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function QE(e,t,n){if(!ZE(e)||e[t]!==null)return e;XE(`${n}.${t}: null`,`an absent field`);let{[t]:r,...i}=e;return i}function $E(e,t,n){if(!ZE(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function eD(e){return $E(e,`content`,e=>{if(!ZE(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return QE(e,`metadata`,`${e.type} input content`);default:return e}})}function tD(e){let t=QE(e,`forwardedProps`,`RunAgentInput`);return t=$E(t,`tools`,e=>QE(e,`parameters`,`Tool`)),t=$E(t,`resume`,e=>QE(e,`payload`,`ResumeEntry`)),$E(t,`messages`,eD)}var nD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warn(e,t){XE(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=LT();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,e.messages=e.messages.map(WE),t.run(e).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){if(e.rawEvent===null){this.warn(`${e.type}.rawEvent: null`,`an absent field`);let{rawEvent:t,...n}=e;e=n}if((e.type===O.RUN_FINISHED||e.type===O.SUBAGENT_FINISHED)&&e.result===null){this.warn(`${e.type}.result: null`,`an absent field`);let{result:t,...n}=e;e=n}switch(e.type){case GE:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warn(GE,O.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${GE}.title ${JSON.stringify(t)}: ${O.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case qE:return this.currentMessageId=LT(),this.warn(qE,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case JE:{let{delta:t,...n}=e;return this.warn(JE,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(JE,this.currentMessageId),delta:t}}case YE:{let t=this.mintedContinuationId(YE,this.currentMessageId);return this.currentMessageId=null,this.warn(YE,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case KE:{let t=this.mintedContinuationId(KE,this.currentReasoningId);return this.currentReasoningId=null,this.warn(KE,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}case O.TOOL_CALL_START:case O.TOOL_CALL_CHUNK:{let t=e;if(t.parentMessageId===null){this.warn(`${e.type}.parentMessageId: null`,`an absent field`);let{parentMessageId:n,...r}=t;return r}return e}case O.RUN_FINISHED:{let t=e;if(t.outcome===null){this.warn(`RUN_FINISHED.outcome: null`,`an absent field`);let{outcome:e,...n}=t;return n}return e}case O.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case O.RUN_STARTED:{let t=tD(e.input),n=t===e.input?e:{...e,input:t},r=n;return!r.input||!Array.isArray(r.input.messages)?n:{...r,input:{...r.input,messages:r.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=eD(e);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),WE(e))}},rD=()=>e=>Jc(()=>{let t=new nD;return e.pipe(Wc(e=>t.transformEvent(e)))});function iD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function aD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function oD(e){aD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function sD(e){aD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function cD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return sD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&oD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var lD=class extends RE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(cD)};return this.runNext(i,t)}},uD=`THINKING_START`,dD=`THINKING_END`,fD=`THINKING_TEXT_MESSAGE_START`,pD=`THINKING_TEXT_MESSAGE_CONTENT`,mD=`THINKING_TEXT_MESSAGE_END`,hD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case uD:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warnAboutTransformation(uD,O.REASONING_START),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case fD:return this.currentMessageId=LT(),this.warnAboutTransformation(fD,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case pD:{let{delta:t,...n}=e;return this.warnAboutTransformation(pD,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??LT(),delta:t}}case mD:{let t=this.currentMessageId??LT();return this.warnAboutTransformation(mD,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case dD:{let t=this.currentReasoningId??LT();return this.warnAboutTransformation(dD,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}default:return e}}},gD=`SUBAGENT_STARTED`,_D=`SUBAGENT_FINISHED`,vD=`SUBAGENT_ERROR`;function yD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function bD(e){return e.map(e=>yD(e))}var xD=class extends RE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>yD(e))};return this.runNext(n,t).pipe(nl(e=>{let t=e.type;(t===gD||t===_D||t===vD)&&this.warnDroppedLifecycleEvent(t)}),Yc(e=>{let t=e.type;return t!==gD&&t!==_D&&t!==vD}),Wc(e=>{let t=yD(e);if(t.type===O.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:bD(e.messages)}}if(t.type===O.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>yD(e))}}}if(t.type===O.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:bD(e.input.messages)}}}return t}))}},SD=`1.0.1`,CD=!1,wD=new WeakSet,TD=(e,t)=>/^\d+\.\d+$/.test(e)?rC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,ED=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(TD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},DD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return SD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return SD;let a=t===`maxProtocolVersion`?n:r;if(!a)return SD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!CD&&(CD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=UT(e),this._debugLogger=KT(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?KT(UT(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!iC(e))throw new k(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??vo(),this.messages=$(r??[]),this.state=$(i??{}),this._debug=UT(a),this._debugLogger=KT(this._debug);let o=this.resolvedCeilingDuringConstruction();rC(o,`0.0.39`)<=0&&this.middlewares.unshift(new lD),rC(o,`0.0.45`)<=0&&this.middlewares.unshift(new hD),rC(o,`0.0.57`)<=0&&this.middlewares.unshift(new xD)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new zE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];wD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),$c(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)));let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Co}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>Jc(()=>this.connect(n)),e=>IE(this.debugLogger)(rD()(e)),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.isRunning=!1,e instanceof Co?cc:this.onError(n,e,a))),$c(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)),{defaultValue:void 0});let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return YT(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(nl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||vo(),...rC(this.maxProtocolVersion,SD)>=0&&{protocolVersion:`1.0`},tools:$(e?.tools??[]),context:$(e?.context??[]),forwardedProps:$(e?.forwardedProps??{}),state:$(this.state),messages:n,...e?.resume===void 0?{}:{resume:$(e.resume)}}}async onInitialize(e,t){if(wD.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new k(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(iD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new k(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Bc(HT(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Wc(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=$(this.messages),e.state=$(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=$(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=$(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=$(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??vo();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),lE(this.threadId,t.runId,this.agentId),e=>e.pipe(Wc(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function OD(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var kD=class extends DD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(OD(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=$(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return iE(QT(()=>this.fetch(this.url,this.requestInit(LE(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=$(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},AD=class extends tn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hn(t,n.data),hasPreviousPage:rn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},jD=class extends on{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new mn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=MD(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>sn(t,e))}findAll(e={}){return this.getAll().filter(t=>sn(e,t))}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(e.map(e=>e.continue().catch(vn))))}};function MD(e){return e.options.scope?.id}var ND=class extends on{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cn(r,t),a=this.get(i);return a||(a=new fn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_n.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>en(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>en(e,t)):t}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},PD=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ND,this.#t=e.mutationCache||new jD,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=an.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ln.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _n.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_n.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _n.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=_n.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return _n.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_n.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(vn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(nn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ln.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{bn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{bn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=cn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Yt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function FD(e,t){return dn(e,AD,t)}var ID=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),LD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),RD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),zD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),BD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),VD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),HD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),UD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),WD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:ID}));WD.displayName=`BookOpenIcon`;var GD=WD,KD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:LD}));KD.displayName=`MagnifyingGlassIcon`;var qD=KD,JD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:RD}));JD.displayName=`MoonIcon`;var YD=JD,XD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:zD}));XD.displayName=`PlugsConnectedIcon`;var ZD=XD,QD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:BD}));QD.displayName=`PlusIcon`;var $D=QD,eO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:VD}));eO.displayName=`SignOutIcon`;var tO=eO,nO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:HD}));nO.displayName=`SparkleIcon`;var rO=nO,iO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:UD}));iO.displayName=`SunIcon`;var aO=iO,oO=[`agent-threads`];async function sO(e){let t=await w(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var cO=[];for(let e=0;e<256;++e)cO.push((e+256).toString(16).slice(1));function lO(e,t=0){return(cO[e[t+0]]+cO[e[t+1]]+cO[e[t+2]]+cO[e[t+3]]+`-`+cO[e[t+4]]+cO[e[t+5]]+`-`+cO[e[t+6]]+cO[e[t+7]]+`-`+cO[e[t+8]]+cO[e[t+9]]+`-`+cO[e[t+10]]+cO[e[t+11]]+cO[e[t+12]]+cO[e[t+13]]+cO[e[t+14]]+cO[e[t+15]]).toLowerCase()}var uO=new Uint8Array(16);function dO(){return crypto.getRandomValues(uO)}var fO={};function pO(e,t,n){let r;if(e)r=hO(e.random??e.rng?.()??dO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=dO();mO(fO,e,i),r=hO(i,fO.msecs,fO.seq,t,n)}return t??lO(r)}function mO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=gO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function hO(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=gO(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function gO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function _O(){return pO()}function vO(){let{setColorScheme:e}=qt(),t=Jt(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,T.useState)(!1);return(0,E.jsx)(Kt,{label:`Switch to ${n} theme`,opened:r,children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,E.jsx)(aO,{size:17,weight:`bold`}):(0,E.jsx)(YD,{size:17,weight:`bold`})})})}var yO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function bO(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await w(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function xO({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=$t(),[f,p]=(0,T.useState)(``),[m]=ca(f.trim(),250),[g,_]=(0,T.useState)(null),[v,y]=(0,T.useState)(null),[b,ee]=(0,T.useState)(``),[te,S]=(0,T.useState)(``),[ne,oe]=(0,T.useState)(!1),se=(0,T.useRef)(null);(0,T.useImperativeHandle)(u,()=>({focusSearch:()=>se.current?.focus()}),[]),(0,T.useEffect)(()=>{r&&requestAnimationFrame(()=>se.current?.focus())},[r]);let ce=FD({queryKey:[...oO,m],queryFn:({pageParam:e})=>bO(m,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),le=gn({queryKey:_t,queryFn:dt,refetchInterval:3e4,staleTime:pt}),ue=(0,T.useMemo)(()=>ce.data?.pages.flatMap(e=>e.items)??[],[ce.data]),de=(0,T.useMemo)(()=>DO(ue),[ue]),fe=gn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>sO(`/api/telemetry/schema?window=1h`),enabled:!!m&&!!l,staleTime:6e4}),me=(0,T.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(fe.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[fe.data,m]),he=(0,T.useMemo)(()=>{let e=le.data??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[le.data,m]);function ge(e){S(``),ee(e.title),_(e)}async function _e(){if(g&&b.trim()){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(g.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:b.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:oO}),_(null)}catch(e){S(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{oe(!1)}}}async function ve(){if(v){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(v.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.id;y(null),await d.invalidateQueries({queryKey:oO}),await d.invalidateQueries({queryKey:_t}),o(t)}catch(e){S(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{oe(!1)}}}return(0,E.jsxs)(re,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,E.jsx)(ie,{leftSection:(0,E.jsx)($D,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,E.jsx)(Gt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,E.jsxs)(re,{gap:`lg`,pb:`sm`,children:[e&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Chats`}),ce.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),ce.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!ce.isLoading&&!ce.isError&&ue.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),de.map(e=>(0,E.jsxs)(re,{gap:2,children:[de.length>1&&(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,E.jsx)(CO,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>ge(e),onDelete:()=>{S(``),y(e)}},e.id))]},e.label)),ce.hasNextPage&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:ce.isFetchingNextPage,onClick:()=>void ce.fetchNextPage(),children:`See all`})]}),m&&l&&fe.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),m&&l&&(fe.isSuccess||fe.isError)&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Services`}),fe.isError&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),fe.isSuccess&&me.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),me.map(e=>(0,E.jsx)(h,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,E.jsx)(ae,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Dashboards`}),le.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),le.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!le.isLoading&&!le.isError&&m&&he.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),he.map(e=>{let t=e.id===n;return(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(h,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,E.jsxs)(x,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,E.jsx)(tt,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,E.jsx)(h,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,E.jsxs)(ae,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,E.jsx)(rO,{size:14,weight:`fill`}),onClick:c,children:le.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,E.jsx)(Ae,{ref:se,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,E.jsx)(qD,{size:15}),rightSection:(0,E.jsx)(vt,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,E.jsx)(Xt,{opened:g!==null,onClose:()=>!ne&&_(null),title:`Rename chat`,centered:!0,children:(0,E.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_e()},children:(0,E.jsxs)(re,{children:[(0,E.jsx)(Ae,{label:`Name`,value:b,onChange:e=>ee(e.currentTarget.value),maxLength:120,autoFocus:!0}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>_(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{type:`submit`,loading:ne,disabled:!b.trim(),children:`Save`})]})]})})}),(0,E.jsx)(Xt,{opened:v!==null,onClose:()=>!ne&&y(null),title:`Delete chat?`,centered:!0,children:(0,E.jsxs)(re,{children:[(0,E.jsxs)(ae,{size:`sm`,children:[`This permanently removes `,(0,E.jsx)(ae,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>y(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{color:`bad`,loading:ne,onClick:()=>void ve(),children:`Delete`})]})]})})]})}function SO({children:e}){return(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function CO({thread:e,active:t,onSelect:r,onRename:i,onDelete:a}){return(0,E.jsx)(n,{"data-active":t||void 0,className:`rail-row`,children:(0,E.jsxs)(x,{gap:2,wrap:`nowrap`,children:[(0,E.jsx)(h,{onClick:r,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,children:OO(e.updated_at)})]})}),(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,E.jsx)(yt,{size:18,weight:`bold`})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ft,{size:15}),onClick:i,children:`Rename`}),(0,E.jsx)(mt.Item,{color:`bad`,leftSection:(0,E.jsx)(Ht,{size:15}),onClick:a,children:`Delete`})]})]})]})})}function wO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function TO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var EO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function DO(e){let t=TO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-TO(wO(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return EO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function OO(e){let t=wO(e),n=TO(new Date);return Math.floor((n-TO(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function kO({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=rt(),s=C(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=jt({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(``),_=(0,T.useRef)(null),v=le(`(max-width: 62em)`),y=(0,T.useRef)(v);y.current=v,(0,T.useEffect)(()=>{f.close()},[c]),(0,T.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(Xe),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,E.jsxs)(Xa,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,E.jsx)(Xa.Header,{children:(0,E.jsxs)(x,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,E.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(uo,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,E.jsx)(_e,{size:`small`})]}),(0,E.jsxs)(x,{gap:`xs`,wrap:`nowrap`,children:[(0,E.jsx)(Kt,{label:`Documentation`,children:(0,E.jsx)($e,{component:`a`,href:yO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,E.jsx)(GD,{size:17,weight:`bold`})})}),(0,E.jsx)(vO,{}),(0,E.jsx)(AO,{onError:g})]})]})}),(0,E.jsx)(Xa.Navbar,{p:`sm`,children:(0,E.jsx)(xO,{ref:_,...b})}),(0,E.jsx)(bt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,E.jsx)(_e,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,E.jsx)(xO,{...b,autoFocusSearch:d&&p})}),(0,E.jsxs)(Xa.Main,{children:[h&&(0,E.jsx)(pe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function AO({onError:e}){let t=C(),n=ke(),r=(n.name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,E.jsx)(so,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Label,{children:n.email||`Signed in`}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ZD,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,E.jsx)(mt.Divider,{}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(tO,{size:15}),onClick:()=>void Ee().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function jO(){let{agent_available:e}=De(),t=C(),n=$t(),{threadId:r}=jt({strict:!1}),[i,a]=(0,T.useState)(_O),o=(0,T.useRef)(new Set),s=r??i,[c,l]=(0,T.useState)([]),[u,d]=(0,T.useState)({}),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(!1),[v,y]=(0,T.useState)(``),[b,ee]=(0,T.useState)(null),x=(0,T.useRef)(null),[te,S]=(0,T.useState)(!1),ne=(0,T.useRef)(!1),[re,ie]=(0,T.useState)(``),[ae,oe]=(0,T.useState)(``),[se,ce]=(0,T.useState)(0),le=(0,T.useRef)(null),ue=(0,T.useRef)({}),de=(0,T.useRef)(null),fe=(0,T.useRef)(new Map),pe=(0,T.useMemo)(()=>new kD({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>w(e,t)}),[s]),me=!e||f===s;function he(){fe.current.clear(),y(``),x.current=null,ee(null)}let ge=e=>e.filter(e=>e.role!==`reasoning`);function _e(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function ve(e){return ne.current||e instanceof Error&&e.name===`AbortError`}(0,T.useEffect)(()=>{let t=!0;if(l([]),ue.current={},d({}),p(``),h(!1),_(!1),ne.current=!1,S(!1),he(),oe(``),!e){p(s);return}!r||o.current.has(s)?(pe.setMessages([]),p(s)):w(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}pe.setMessages(ge(e.messages??[])),l(ge(e.messages??[])),p(s)}}).catch(()=>{t&&(le.current=null,oe(`This chat could not be restored. Start a new chat or try again.`))});let i=pe.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(ge(t))}},onMessagesChanged:({messages:e})=>l(ge(e)),onRunInitialized:()=>{ne.current=!1,S(!1),_(!0),oe(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{fe.current.set(e.toolCallId,nt(e.toolCallName)),y(nt(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{fe.current.delete(e.toolCallId),y([...fe.current.values()].at(-1)??_e());let r=at(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:_t}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||ne.current?(oe(``),S(!0)):(console.warn(`Agent run error`,e.code),oe(qe(e.code))),_(!1),he()},onRunFinalized:({messages:e})=>{let t=ge(e);l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})},onRunFailed:e=>{ve(e.error)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})}});return()=>{t=!1,i.unsubscribe(),pe.abortRun()}},[pe,e,n,se,s]),(0,T.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>de.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>de.current?.focus()))),e.key===`Escape`&&n===de.current&&(ie(``),de.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ye(){_(!0),oe(``);try{await pe.runAgent({forwardedProps:{...ue.current}})}catch(e){ve(e)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s)}}async function be(n,i){let a=n.trim();if(!e||!a||g||!me||m)return;ue.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:_O(),role:`user`,content:a};pe.addMessage(c),l([...pe.messages]),d(e=>({...e,[c.id]:Date.now()})),ie(``),await ye()}(0,T.useEffect)(()=>{let e=le.current;me&&r&&e&&(le.current=null,be(e.text,e.options))},[me,r,s]);function xe(e){e.preventDefault(),be(re)}function Se(){ne.current=!0,oe(``),S(!0),pe.abortRun(),_(!1),he(),o.current.delete(s)}function Ce(){!g&&pe.messages.some(e=>e.role===`user`)&&ye()}function we(n,r){if(!e)return;let i=_O();o.current.add(i),le.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Te(){pe.abortRun(),le.current=null,ue.current={},a(_O()),t({to:`/chat`})}function Ee(e){le.current=null,ue.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function Oe(){ce(e=>e+1)}return(0,E.jsx)(et.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:me,running:g,activity:v,provisional:b,stopped:te,input:re,setInput:ie,error:ae,inputRef:de,send:be,submit:xe,stop:Se,retry:Ce,reloadThread:Oe,openChat:we,newThread:Te,selectThread:Ee},children:(0,E.jsx)(kO,{children:(0,E.jsx)(Zi,{})})})}function MO(){let e=(0,T.useMemo)(()=>new PD,[]);return(0,E.jsx)(yn,{client:e,children:(0,E.jsx)(je,{children:(0,E.jsx)(jO,{})})})}var NO=It({component:MO,notFoundComponent:()=>(0,E.jsx)(Me,{to:`/`,replace:!0})}),PO=Pt(`/`)({component:zt(()=>it(()=>import(`./routes-CmpBxgdE.js`),__vite__mapDeps([0,1,2])),`component`)}),FO=Pt(`/settings`)({component:zt(()=>it(()=>import(`./settings-Civ3-rvD.js`),__vite__mapDeps([3,1,2,4,5,6,7,8])),`component`)}),IO=Pt(`/chat/`)({component:zt(()=>it(()=>import(`./chat.index-B2BwBfS8.js`),__vite__mapDeps([9,10,1,11,4,5,12])),`component`)}),LO=Pt(`/chat/$threadId`)({component:zt(()=>it(()=>import(`./chat._threadId-B2BwBfS8.js`),__vite__mapDeps([13,10,1,11,4,5,12])),`component`)}),RO=Pt(`/dashboards/`)({component:zt(()=>it(()=>import(`./dashboards.index-BtnZ9Vkj.js`),__vite__mapDeps([14,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),zO=Pt(`/dashboards/$dashboardId`)({component:zt(()=>it(()=>import(`./dashboards._dashboardId-eTWiXAiz.js`),__vite__mapDeps([18,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),BO=PO.update({id:`/`,path:`/`,getParentRoute:()=>NO}),VO=FO.update({id:`/settings`,path:`/settings`,getParentRoute:()=>NO}),HO=IO.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>NO}),UO=LO.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>NO}),WO=RO.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>NO}),GO={IndexRoute:BO,SettingsRoute:VO,ChatThreadIdRoute:UO,DashboardsDashboardIdRoute:zO.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>NO}),ChatIndexRoute:HO,DashboardsIndexRoute:WO},KO=ra({routeTree:NO._addFileChildren(GO)._addFileTypes(),parseSearch:Vt,stringifySearch:gt,defaultPreload:`intent`,scrollRestoration:!0}),qO=Tt(v),JO=Ea({...Nt,variantColorResolver:qO});(0,yo.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(T.StrictMode,{children:(0,E.jsx)(Ta,{theme:JO,defaultColorScheme:`auto`,cssVariablesResolver:Rt,children:(0,E.jsx)(oa,{router:KO})})}));export{zg as A,rv as C,W_ as D,B as E,gu as F,jm as M,Dm as N,I_ as O,Em as P,H_ as S,X_ as T,Sv as _,n_ as a,R_ as b,Q_ as c,U as d,B_ as f,J_ as g,o_ as h,sO as i,Ng as j,u_ as k,N_ as l,K_ as m,RO as n,t_ as o,H as p,yO as r,E_ as s,zO as t,j_ as u,G as v,Dv as w,D_ as x,W as y}; \ No newline at end of file +`)};function sE(e,t){return Eo(t)&&cE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),To(t)}var cE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},lE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Kc(r=>{switch(r.type){case O.TEXT_MESSAGE_START:{let e=r;return[{type:aE.TextMessageStart,messageId:e.messageId,role:e.role}]}case O.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:aE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case O.TEXT_MESSAGE_END:{let e=r;return[{type:aE.TextMessageEnd,messageId:e.messageId}]}case O.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:aE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case O.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return cE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(il(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:aE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case O.TOOL_CALL_END:{let e=r;return[{type:aE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case O.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&cE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:aE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:sE(e.toolCallId,e.content),actionName:t||`unknown`}]}case O.RAW:return f||(f=!0,cE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case O.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:aE.MetaEvent,name:e.name,value:e.value}]}case O.STATE_SNAPSHOT:return p(r.snapshot),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case O.STATE_DELTA:{let c=r,l;try{l=ss.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return cE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case O.MESSAGES_SNAPSHOT:return c=r.messages,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case O.RUN_STARTED:return[];case O.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=uE(c)}catch(e){return[{type:aE.RunError,message:e.message}]}return[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case O.RUN_ERROR:{let e=r;return[{type:aE.RunError,message:e.message,code:e.code}]}case O.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case O.STEP_FINISHED:return u=[],l=null,[{type:aE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function uE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=oE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:sE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var dE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,fE=e=>e===`tool`?`toolCallId`:`messageId`,pE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},mE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},hE=(e,t)=>{let n=mE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},gE=e=>new Set(Object.keys(e.shape)),_E=gE(Nv),vE=gE(Lv),yE=gE(by),bE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},xE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},SE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&xE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},CE=e=>t=>{let n=WT(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:O.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:O.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:O.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&dE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${fE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Kc(e=>{switch(e.type){case O.TEXT_MESSAGE_START:case O.TEXT_MESSAGE_CONTENT:case O.TEXT_MESSAGE_END:case O.TOOL_CALL_START:case O.TOOL_CALL_ARGS:case O.TOOL_CALL_END:case O.TOOL_CALL_RESULT:case O.STATE_SNAPSHOT:case O.STATE_DELTA:case O.CUSTOM:case O.STEP_STARTED:case O.STEP_FINISHED:case O.REASONING_START:case O.REASONING_MESSAGE_START:case O.REASONING_MESSAGE_CONTENT:case O.REASONING_MESSAGE_END:case O.REASONING_END:return[...i(e.subagentRunId??void 0),e];case O.RUN_STARTED:case O.RUN_FINISHED:case O.RUN_ERROR:case O.MESSAGES_SNAPSHOT:return[...a(),e];case O.RAW:case O.ACTIVITY_SNAPSHOT:case O.ACTIVITY_DELTA:case O.REASONING_ENCRYPTED_VALUE:case O.SUBAGENT_STARTED:return[e];case O.SUBAGENT_FINISHED:case O.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case O.TEXT_MESSAGE_CHUNK:{let t=e,a=bE(e,_E),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))pE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),pE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=mE({type:O.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case O.TOOL_CALL_CHUNK:{let t=e,a=bE(e,vE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))pE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),pE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=mE({type:O.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`TOOL_CALL_CHUNK`),l}case O.REASONING_MESSAGE_CHUNK:{let t=e,a=bE(e,yE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=mE({type:O.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=hE({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:O.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return SE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),$c(()=>{a()}))},wE=Symbol(`agui.strip.drop`);function TE(e){let t=e;for(;;){if(t instanceof mT||t instanceof gT||t instanceof vT||t instanceof OT||t instanceof wT){t=t.unwrap();continue}if(t instanceof ET){t=t.def.in;continue}if(t instanceof AT){t=t.def.getter();continue}return t}}function EE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function DE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function OE(e){let t=TE(e);return t instanceof dT?DE(t):void 0}function kE(e,t,n,r){let i=TE(t);if(i instanceof rT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=kE(a[e],i,`${n}/${e}`,r);if(l===wE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return wE}o[e]=l}return o}if(i instanceof tT){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=kE(e,t,`${n}/${i}`,r);if(s===wE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof cT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=kE(a[e],t,`${n}/${e}`,r);if(s===wE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof iT){let t=i.options,a=EE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=TE(o);if(!(t instanceof rT))continue;let s=t.shape;if(OE(s[a])===i)return kE(e,o,n,r)}return wE}let o=t.filter(e=>TE(e)instanceof rT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=TE(i);if(t instanceof tT&&Array.isArray(e)||t instanceof rT&&s)return kE(e,i,n,r)}return e}return e}function AE(e,t){let n=[],r=kE(e,t,``,n);if(r===wE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var jE=new Set(Object.values(O));function ME(e){return jE.has(e.type)}var NE=new Map(Ey.options.map(e=>{let t=e.shape;return[String(DE(t.type)),e]})),PE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function FE(e){PE()||console.warn(`[ag-ui][enforce] ${e}`)}var IE=e=>t=>{let n=WT(e);return t.pipe(Kc(e=>{if(!ME(e))return FE(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),cc;let t=NE.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=AE(e,t);for(let t of i)FE(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return Vc(t.parse(r))}))};function LE(e){let{value:t,stripped:n}=AE(So(e,`RunAgentInput`),oy);for(let e of n)FE(`Removed unrecognised material at '${e}' from the outgoing input.`);return oy.parse(t)}var RE=class{runNext(e,t){return t.run(e).pipe(CE(!1))}runNextWithState(e,t){let n=$(e.messages||[]),r=$(e.state===void 0?{}:e.state),i=new sc;return YT(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(Zc(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:$(n),state:$(r)})))}},zE=class extends RE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function UE(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function WE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(VE(e)){let n=HE(e);return n.type!==`binary`&&t.some(t=>UE(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var GE=`THINKING_START`,KE=`THINKING_END`,qE=`THINKING_TEXT_MESSAGE_START`,JE=`THINKING_TEXT_MESSAGE_CONTENT`,YE=`THINKING_TEXT_MESSAGE_END`;function XE(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}function ZE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function QE(e,t,n){if(!ZE(e)||e[t]!==null)return e;XE(`${n}.${t}: null`,`an absent field`);let{[t]:r,...i}=e;return i}function $E(e,t,n){if(!ZE(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function eD(e){return $E(e,`content`,e=>{if(!ZE(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return QE(e,`metadata`,`${e.type} input content`);default:return e}})}function tD(e){let t=QE(e,`forwardedProps`,`RunAgentInput`);return t=$E(t,`tools`,e=>QE(e,`parameters`,`Tool`)),t=$E(t,`resume`,e=>QE(e,`payload`,`ResumeEntry`)),$E(t,`messages`,eD)}var nD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warn(e,t){XE(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=LT();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,e.messages=e.messages.map(WE),t.run(e).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){if(e.rawEvent===null){this.warn(`${e.type}.rawEvent: null`,`an absent field`);let{rawEvent:t,...n}=e;e=n}if((e.type===O.RUN_FINISHED||e.type===O.SUBAGENT_FINISHED)&&e.result===null){this.warn(`${e.type}.result: null`,`an absent field`);let{result:t,...n}=e;e=n}switch(e.type){case GE:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warn(GE,O.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${GE}.title ${JSON.stringify(t)}: ${O.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case qE:return this.currentMessageId=LT(),this.warn(qE,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case JE:{let{delta:t,...n}=e;return this.warn(JE,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(JE,this.currentMessageId),delta:t}}case YE:{let t=this.mintedContinuationId(YE,this.currentMessageId);return this.currentMessageId=null,this.warn(YE,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case KE:{let t=this.mintedContinuationId(KE,this.currentReasoningId);return this.currentReasoningId=null,this.warn(KE,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}case O.TOOL_CALL_START:case O.TOOL_CALL_CHUNK:{let t=e;if(t.parentMessageId===null){this.warn(`${e.type}.parentMessageId: null`,`an absent field`);let{parentMessageId:n,...r}=t;return r}return e}case O.RUN_FINISHED:{let t=e;if(t.outcome===null){this.warn(`RUN_FINISHED.outcome: null`,`an absent field`);let{outcome:e,...n}=t;return n}return e}case O.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case O.RUN_STARTED:{let t=tD(e.input),n=t===e.input?e:{...e,input:t},r=n;return!r.input||!Array.isArray(r.input.messages)?n:{...r,input:{...r.input,messages:r.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=eD(e);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),WE(e))}},rD=()=>e=>Jc(()=>{let t=new nD;return e.pipe(Wc(e=>t.transformEvent(e)))});function iD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function aD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function oD(e){aD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function sD(e){aD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function cD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return sD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&oD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var lD=class extends RE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(cD)};return this.runNext(i,t)}},uD=`THINKING_START`,dD=`THINKING_END`,fD=`THINKING_TEXT_MESSAGE_START`,pD=`THINKING_TEXT_MESSAGE_CONTENT`,mD=`THINKING_TEXT_MESSAGE_END`,hD=class extends RE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Wc(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case uD:{this.currentReasoningId=LT();let{title:t,...n}=e;return this.warnAboutTransformation(uD,O.REASONING_START),{...n,type:O.REASONING_START,messageId:this.currentReasoningId}}case fD:return this.currentMessageId=LT(),this.warnAboutTransformation(fD,O.REASONING_MESSAGE_START),{...e,type:O.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case pD:{let{delta:t,...n}=e;return this.warnAboutTransformation(pD,O.REASONING_MESSAGE_CONTENT),{...n,type:O.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??LT(),delta:t}}case mD:{let t=this.currentMessageId??LT();return this.warnAboutTransformation(mD,O.REASONING_MESSAGE_END),{...e,type:O.REASONING_MESSAGE_END,messageId:t}}case dD:{let t=this.currentReasoningId??LT();return this.warnAboutTransformation(dD,O.REASONING_END),{...e,type:O.REASONING_END,messageId:t}}default:return e}}},gD=`SUBAGENT_STARTED`,_D=`SUBAGENT_FINISHED`,vD=`SUBAGENT_ERROR`;function yD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function bD(e){return e.map(e=>yD(e))}var xD=class extends RE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>yD(e))};return this.runNext(n,t).pipe(nl(e=>{let t=e.type;(t===gD||t===_D||t===vD)&&this.warnDroppedLifecycleEvent(t)}),Yc(e=>{let t=e.type;return t!==gD&&t!==_D&&t!==vD}),Wc(e=>{let t=yD(e);if(t.type===O.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:bD(e.messages)}}if(t.type===O.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>yD(e))}}}if(t.type===O.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:bD(e.input.messages)}}}return t}))}},SD=`1.0.1`,CD=!1,wD=new WeakSet,TD=(e,t)=>/^\d+\.\d+$/.test(e)?rC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,ED=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(TD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},DD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return SD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return SD;let a=t===`maxProtocolVersion`?n:r;if(!a)return SD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!CD&&(CD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=UT(e),this._debugLogger=KT(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?KT(UT(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!iC(e))throw new k(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??vo(),this.messages=$(r??[]),this.state=$(i??{}),this._debug=UT(a),this._debugLogger=KT(this._debug);let o=this.resolvedCeilingDuringConstruction();rC(o,`0.0.39`)<=0&&this.middlewares.unshift(new lD),rC(o,`0.0.45`)<=0&&this.middlewares.unshift(new hD),rC(o,`0.0.57`)<=0&&this.middlewares.unshift(new xD)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new zE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];wD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),$c(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)));let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Co}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??vo();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>ED(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new ic;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Uc(qs(()=>Jc(()=>this.connect(n)),e=>IE(this.debugLogger)(rD()(e)),CE(this.debugLogger),XT(this.debugLogger),e=>e.pipe(tl(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Xc(e=>(this.isRunning=!1,e instanceof Co?cc:this.onError(n,e,a))),$c(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Vc(null)),{defaultValue:void 0});let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return YT(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(nl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||vo(),...rC(this.maxProtocolVersion,SD)>=0&&{protocolVersion:`1.0`},tools:$(e?.tools??[]),context:$(e?.context??[]),forwardedProps:$(e?.forwardedProps??{}),state:$(this.state),messages:n,...e?.resume===void 0?{}:{resume:$(e.resume)}}}async onInitialize(e,t){if(wD.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new k(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(iD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new k(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Bc(HT(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Wc(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await HT(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=$(this.messages),e.state=$(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=$(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=$(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=$(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??vo();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new nD].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(IE(this.debugLogger),CE(this.debugLogger),XT(this.debugLogger),lE(this.threadId,t.runId,this.agentId),e=>e.pipe(Wc(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function OD(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var kD=class extends DD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(OD(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=$(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return iE(QT(()=>this.fetch(this.url,this.requestInit(LE(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=$(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},AD=class extends tn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hn(t,n.data),hasPreviousPage:rn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},jD=class extends on{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new mn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=MD(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=MD(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>sn(t,e))}findAll(e={}){return this.getAll().filter(t=>sn(e,t))}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(e.map(e=>e.continue().catch(vn))))}};function MD(e){return e.options.scope?.id}var ND=class extends on{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cn(r,t),a=this.get(i);return a||(a=new fn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_n.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>en(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>en(e,t)):t}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},PD=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ND,this.#t=e.mutationCache||new jD,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=an.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ln.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _n.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_n.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _n.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=_n.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return _n.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_n.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(vn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(nn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ln.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{bn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{bn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=cn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Yt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function FD(e,t){return dn(e,AD,t)}var ID=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),LD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),RD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),zD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),BD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),VD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),HD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),UD=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),WD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:ID}));WD.displayName=`BookOpenIcon`;var GD=WD,KD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:LD}));KD.displayName=`MagnifyingGlassIcon`;var qD=KD,JD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:RD}));JD.displayName=`MoonIcon`;var YD=JD,XD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:zD}));XD.displayName=`PlugsConnectedIcon`;var ZD=XD,QD=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:BD}));QD.displayName=`PlusIcon`;var $D=QD,eO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:VD}));eO.displayName=`SignOutIcon`;var tO=eO,nO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:HD}));nO.displayName=`SparkleIcon`;var rO=nO,iO=T.forwardRef((e,t)=>T.createElement(S,{ref:t,...e,weights:UD}));iO.displayName=`SunIcon`;var aO=iO,oO=[`agent-threads`];async function sO(e){let t=await w(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var cO=[];for(let e=0;e<256;++e)cO.push((e+256).toString(16).slice(1));function lO(e,t=0){return(cO[e[t+0]]+cO[e[t+1]]+cO[e[t+2]]+cO[e[t+3]]+`-`+cO[e[t+4]]+cO[e[t+5]]+`-`+cO[e[t+6]]+cO[e[t+7]]+`-`+cO[e[t+8]]+cO[e[t+9]]+`-`+cO[e[t+10]]+cO[e[t+11]]+cO[e[t+12]]+cO[e[t+13]]+cO[e[t+14]]+cO[e[t+15]]).toLowerCase()}var uO=new Uint8Array(16);function dO(){return crypto.getRandomValues(uO)}var fO={};function pO(e,t,n){let r;if(e)r=hO(e.random??e.rng?.()??dO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=dO();mO(fO,e,i),r=hO(i,fO.msecs,fO.seq,t,n)}return t??lO(r)}function mO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=gO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function hO(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=gO(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function gO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function _O(){return pO()}function vO(){let{setColorScheme:e}=qt(),t=Jt(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,T.useState)(!1);return(0,E.jsx)(Kt,{label:`Switch to ${n} theme`,opened:r,children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,E.jsx)(aO,{size:17,weight:`bold`}):(0,E.jsx)(YD,{size:17,weight:`bold`})})})}var yO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function bO(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await w(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function xO({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=$t(),[f,p]=(0,T.useState)(``),[m]=ca(f.trim(),250),[g,_]=(0,T.useState)(null),[v,y]=(0,T.useState)(null),[b,ee]=(0,T.useState)(``),[te,S]=(0,T.useState)(``),[ne,oe]=(0,T.useState)(!1),se=(0,T.useRef)(null);(0,T.useImperativeHandle)(u,()=>({focusSearch:()=>se.current?.focus()}),[]),(0,T.useEffect)(()=>{r&&requestAnimationFrame(()=>se.current?.focus())},[r]);let ce=FD({queryKey:[...oO,m],queryFn:({pageParam:e})=>bO(m,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),le=gn({queryKey:_t,queryFn:dt,refetchInterval:3e4,staleTime:pt}),ue=(0,T.useMemo)(()=>ce.data?.pages.flatMap(e=>e.items)??[],[ce.data]),de=(0,T.useMemo)(()=>DO(ue),[ue]),fe=gn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>sO(`/api/telemetry/schema?window=1h`),enabled:!!m&&!!l,staleTime:6e4}),me=(0,T.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(fe.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[fe.data,m]),he=(0,T.useMemo)(()=>{let e=le.data??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[le.data,m]);function ge(e){S(``),ee(e.title),_(e)}async function _e(){if(g&&b.trim()){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(g.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:b.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:oO}),_(null)}catch(e){S(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{oe(!1)}}}async function ve(){if(v){oe(!0),S(``);try{let e=await w(`/api/agent/threads/${encodeURIComponent(v.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.id;y(null),await d.invalidateQueries({queryKey:oO}),await d.invalidateQueries({queryKey:_t}),o(t)}catch(e){S(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{oe(!1)}}}return(0,E.jsxs)(re,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,E.jsx)(ie,{leftSection:(0,E.jsx)($D,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,E.jsx)(Gt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,E.jsxs)(re,{gap:`lg`,pb:`sm`,children:[e&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Chats`}),ce.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),ce.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!ce.isLoading&&!ce.isError&&ue.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),de.map(e=>(0,E.jsxs)(re,{gap:2,children:[de.length>1&&(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,E.jsx)(CO,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>ge(e),onDelete:()=>{S(``),y(e)}},e.id))]},e.label)),ce.hasNextPage&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:ce.isFetchingNextPage,onClick:()=>void ce.fetchNextPage(),children:`See all`})]}),m&&l&&fe.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),m&&l&&(fe.isSuccess||fe.isError)&&(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Services`}),fe.isError&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),fe.isSuccess&&me.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),me.map(e=>(0,E.jsx)(h,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,E.jsx)(ae,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,E.jsxs)(re,{gap:4,children:[(0,E.jsx)(SO,{children:`Dashboards`}),le.isLoading&&(0,E.jsx)(ye,{py:`md`,children:(0,E.jsx)(we,{size:`xs`})}),le.isError&&(0,E.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!le.isLoading&&!le.isError&&m&&he.length===0&&(0,E.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),he.map(e=>{let t=e.id===n;return(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(h,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,E.jsxs)(x,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,E.jsx)(tt,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,E.jsx)(h,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,E.jsxs)(ae,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,E.jsx)(ie,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,E.jsx)(rO,{size:14,weight:`fill`}),onClick:c,children:le.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,E.jsx)(Ae,{ref:se,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,E.jsx)(qD,{size:15}),rightSection:(0,E.jsx)(vt,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,E.jsx)(Xt,{opened:g!==null,onClose:()=>!ne&&_(null),title:`Rename chat`,centered:!0,children:(0,E.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_e()},children:(0,E.jsxs)(re,{children:[(0,E.jsx)(Ae,{label:`Name`,value:b,onChange:e=>ee(e.currentTarget.value),maxLength:120,autoFocus:!0}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>_(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{type:`submit`,loading:ne,disabled:!b.trim(),children:`Save`})]})]})})}),(0,E.jsx)(Xt,{opened:v!==null,onClose:()=>!ne&&y(null),title:`Delete chat?`,centered:!0,children:(0,E.jsxs)(re,{children:[(0,E.jsxs)(ae,{size:`sm`,children:[`This permanently removes `,(0,E.jsx)(ae,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),te&&(0,E.jsx)(pe,{color:`bad`,children:te}),(0,E.jsxs)(x,{justify:`flex-end`,children:[(0,E.jsx)(ie,{variant:`default`,onClick:()=>y(null),disabled:ne,children:`Cancel`}),(0,E.jsx)(ie,{color:`bad`,loading:ne,onClick:()=>void ve(),children:`Delete`})]})]})})]})}function SO({children:e}){return(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function CO({thread:e,active:t,onSelect:r,onRename:i,onDelete:a}){return(0,E.jsx)(n,{"data-active":t||void 0,className:`rail-row`,children:(0,E.jsxs)(x,{gap:2,wrap:`nowrap`,children:[(0,E.jsx)(h,{onClick:r,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,E.jsxs)(re,{gap:0,children:[(0,E.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,E.jsx)(ae,{c:`dimmed`,size:`xs`,children:OO(e.updated_at)})]})}),(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,E.jsx)(yt,{size:18,weight:`bold`})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ft,{size:15}),onClick:i,children:`Rename`}),(0,E.jsx)(mt.Item,{color:`bad`,leftSection:(0,E.jsx)(Ht,{size:15}),onClick:a,children:`Delete`})]})]})]})})}function wO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function TO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var EO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function DO(e){let t=TO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-TO(wO(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return EO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function OO(e){let t=wO(e),n=TO(new Date);return Math.floor((n-TO(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function kO({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=rt(),s=C(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=jt({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(``),_=(0,T.useRef)(null),v=le(`(max-width: 62em)`),y=(0,T.useRef)(v);y.current=v,(0,T.useEffect)(()=>{f.close()},[c]),(0,T.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(Xe),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,E.jsxs)(Xa,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,E.jsx)(Xa.Header,{children:(0,E.jsxs)(x,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,E.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(uo,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,E.jsx)(_e,{size:`small`})]}),(0,E.jsxs)(x,{gap:`xs`,wrap:`nowrap`,children:[(0,E.jsx)(Kt,{label:`Documentation`,children:(0,E.jsx)($e,{component:`a`,href:yO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,E.jsx)(GD,{size:17,weight:`bold`})})}),(0,E.jsx)(vO,{}),(0,E.jsx)(AO,{onError:g})]})]})}),(0,E.jsx)(Xa.Navbar,{p:`sm`,children:(0,E.jsx)(xO,{ref:_,...b})}),(0,E.jsx)(bt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,E.jsx)(_e,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,E.jsx)(xO,{...b,autoFocusSearch:d&&p})}),(0,E.jsxs)(Xa.Main,{children:[h&&(0,E.jsx)(pe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function AO({onError:e}){let t=C(),n=ke(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,E.jsxs)(mt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,E.jsx)(mt.Target,{children:(0,E.jsx)($e,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,E.jsx)(so,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,E.jsxs)(mt.Dropdown,{children:[(0,E.jsx)(mt.Label,{children:n.email||`Signed in`}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(ZD,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,E.jsx)(mt.Divider,{}),(0,E.jsx)(mt.Item,{leftSection:(0,E.jsx)(tO,{size:15}),onClick:()=>void Ee().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function jO(){let{agent_available:e}=De(),t=C(),n=$t(),{threadId:r}=jt({strict:!1}),[i,a]=(0,T.useState)(_O),o=(0,T.useRef)(new Set),s=r??i,[c,l]=(0,T.useState)([]),[u,d]=(0,T.useState)({}),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(!1),[v,y]=(0,T.useState)(``),[b,ee]=(0,T.useState)(null),x=(0,T.useRef)(null),[te,S]=(0,T.useState)(!1),ne=(0,T.useRef)(!1),[re,ie]=(0,T.useState)(``),[ae,oe]=(0,T.useState)(``),[se,ce]=(0,T.useState)(0),le=(0,T.useRef)(null),ue=(0,T.useRef)({}),de=(0,T.useRef)(null),fe=(0,T.useRef)(new Map),pe=(0,T.useMemo)(()=>new kD({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>w(e,t)}),[s]),me=!e||f===s;function he(){fe.current.clear(),y(``),x.current=null,ee(null)}let ge=e=>e.filter(e=>e.role!==`reasoning`);function _e(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function ve(e){return ne.current||e instanceof Error&&e.name===`AbortError`}(0,T.useEffect)(()=>{let t=!0;if(l([]),ue.current={},d({}),p(``),h(!1),_(!1),ne.current=!1,S(!1),he(),oe(``),!e){p(s);return}!r||o.current.has(s)?(pe.setMessages([]),p(s)):w(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}pe.setMessages(ge(e.messages??[])),l(ge(e.messages??[])),p(s)}}).catch(()=>{t&&(le.current=null,oe(`This chat could not be restored. Start a new chat or try again.`))});let i=pe.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(ge(t))}},onMessagesChanged:({messages:e})=>l(ge(e)),onRunInitialized:()=>{ne.current=!1,S(!1),_(!0),oe(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{fe.current.set(e.toolCallId,nt(e.toolCallName)),y(nt(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{fe.current.delete(e.toolCallId),y([...fe.current.values()].at(-1)??_e());let r=at(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:_t}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||ne.current?(oe(``),S(!0)):(console.warn(`Agent run error`,e.code),oe(qe(e.code))),_(!1),he()},onRunFinalized:({messages:e})=>{let t=ge(e);l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})},onRunFailed:e=>{ve(e.error)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s),n.invalidateQueries({queryKey:oO})}});return()=>{t=!1,i.unsubscribe(),pe.abortRun()}},[pe,e,n,se,s]),(0,T.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>de.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>de.current?.focus()))),e.key===`Escape`&&n===de.current&&(ie(``),de.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ye(){_(!0),oe(``);try{await pe.runAgent({forwardedProps:{...ue.current}})}catch(e){ve(e)?(oe(``),S(!0)):(console.error(`Agent run failed`,e),oe(qe())),_(!1),he(),o.current.delete(s)}}async function be(n,i){let a=n.trim();if(!e||!a||g||!me||m)return;ue.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:_O(),role:`user`,content:a};pe.addMessage(c),l([...pe.messages]),d(e=>({...e,[c.id]:Date.now()})),ie(``),await ye()}(0,T.useEffect)(()=>{let e=le.current;me&&r&&e&&(le.current=null,be(e.text,e.options))},[me,r,s]);function xe(e){e.preventDefault(),be(re)}function Se(){ne.current=!0,oe(``),S(!0),pe.abortRun(),_(!1),he(),o.current.delete(s)}function Ce(){!g&&pe.messages.some(e=>e.role===`user`)&&ye()}function we(n,r){if(!e)return;let i=_O();o.current.add(i),le.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Te(){pe.abortRun(),le.current=null,ue.current={},a(_O()),t({to:`/chat`})}function Ee(e){le.current=null,ue.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function Oe(){ce(e=>e+1)}return(0,E.jsx)(et.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:me,running:g,activity:v,provisional:b,stopped:te,input:re,setInput:ie,error:ae,inputRef:de,send:be,submit:xe,stop:Se,retry:Ce,reloadThread:Oe,openChat:we,newThread:Te,selectThread:Ee},children:(0,E.jsx)(kO,{children:(0,E.jsx)(Zi,{})})})}function MO(){let e=(0,T.useMemo)(()=>new PD,[]);return(0,E.jsx)(yn,{client:e,children:(0,E.jsx)(je,{children:(0,E.jsx)(jO,{})})})}var NO=It({component:MO,notFoundComponent:()=>(0,E.jsx)(Me,{to:`/`,replace:!0})}),PO=Pt(`/`)({component:zt(()=>it(()=>import(`./routes-dVrgKMot.js`),__vite__mapDeps([0,1,2])),`component`)}),FO=Pt(`/settings`)({component:zt(()=>it(()=>import(`./settings-BZC7Pr0f.js`),__vite__mapDeps([3,1,2,4,5,6,7,8])),`component`)}),IO=Pt(`/chat/`)({component:zt(()=>it(()=>import(`./chat.index-DrWvJyZf.js`),__vite__mapDeps([9,10,1,11,4,5,12])),`component`)}),LO=Pt(`/chat/$threadId`)({component:zt(()=>it(()=>import(`./chat._threadId-DrWvJyZf.js`),__vite__mapDeps([13,10,1,11,4,5,12])),`component`)}),RO=Pt(`/dashboards/`)({component:zt(()=>it(()=>import(`./dashboards.index-DFcSFkLA.js`),__vite__mapDeps([14,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),zO=Pt(`/dashboards/$dashboardId`)({component:zt(()=>it(()=>import(`./dashboards._dashboardId-B_qsLVgC.js`),__vite__mapDeps([18,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Dt(wt(e))}),BO=PO.update({id:`/`,path:`/`,getParentRoute:()=>NO}),VO=FO.update({id:`/settings`,path:`/settings`,getParentRoute:()=>NO}),HO=IO.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>NO}),UO=LO.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>NO}),WO=RO.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>NO}),GO={IndexRoute:BO,SettingsRoute:VO,ChatThreadIdRoute:UO,DashboardsDashboardIdRoute:zO.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>NO}),ChatIndexRoute:HO,DashboardsIndexRoute:WO},KO=ra({routeTree:NO._addFileChildren(GO)._addFileTypes(),parseSearch:Vt,stringifySearch:gt,defaultPreload:`intent`,scrollRestoration:!0}),qO=Tt(v),JO=Ea({...Nt,variantColorResolver:qO});(0,yo.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(T.StrictMode,{children:(0,E.jsx)(Ta,{theme:JO,defaultColorScheme:`auto`,cssVariablesResolver:Rt,children:(0,E.jsx)(oa,{router:KO})})}));export{zg as A,rv as C,W_ as D,B as E,gu as F,jm as M,Dm as N,I_ as O,Em as P,H_ as S,X_ as T,Sv as _,n_ as a,R_ as b,Q_ as c,U as d,B_ as f,J_ as g,o_ as h,sO as i,Ng as j,u_ as k,N_ as l,K_ as m,RO as n,t_ as o,H as p,yO as r,E_ as s,zO as t,j_ as u,G as v,Dv as w,D_ as x,W as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-BW8pt9vy.js b/internal/ui/dist/assets/mcp-app-frame-DT6-Vfjz.js similarity index 99% rename from internal/ui/dist/assets/mcp-app-frame-BW8pt9vy.js rename to internal/ui/dist/assets/mcp-app-frame-DT6-Vfjz.js index a3ff6d87e..92f407b9b 100644 --- a/internal/ui/dist/assets/mcp-app-frame-BW8pt9vy.js +++ b/internal/ui/dist/assets/mcp-app-frame-DT6-Vfjz.js @@ -1,4 +1,4 @@ -import{C as e,Ct as t,bt as n,d as r,f as i,p as a,u as o,vt as s,y as c}from"./brand-oskFJPNW.js";import{i as l}from"./auth-CQerCjF_.js";import{t as u}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{t as d}from"./FocusTrap-yVpiEwpv.js";import{n as f}from"./chat-Dr6SwXRM.js";import{A as p,C as m,D as h,E as g,F as _,M as v,N as y,O as b,P as x,S,T as C,_ as ee,a as w,b as T,c as E,d as te,f as D,g as ne,h as re,j as ie,k as ae,l as oe,m as se,o as ce,p as O,s as le,u as ue,v as k,w as A,x as j,y as M}from"./index-G9N3n5OB.js";var de={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},fe;fe||={};function pe(e){return x(ce,e)}function me(e){return y(w,e)}function he(e){return v(le,e)}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Fa.some(t=>t.hasRequestMethod(e))}function Pa(e){return Fa.some(t=>t.hasNotificationMethod(e))}var Fa=[Ri,Da],Ia=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),La=e=>Ze.safeParse(e).success,Ra=e=>Qe.safeParse(e).success,za=e=>$e.safeParse(e).success,Ba=e=>et.safeParse(e).success,Va=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ha=e=>ht.safeParse(e).success,Ua=e=>vt.safeParse(e).success,Wa=`Mcp-Param-`,Ga=`x-mcp-header`,Ka=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,qa=new Set([`string`,`integer`,`boolean`,`number`]);function Ja(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ga in o){if(!a||i.length===0)return`${Za(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ga];if(typeof e!=`string`||e.length===0)return`${Za(i)}: x-mcp-header MUST be a non-empty string`;if(!Ka.test(e))return`${Za(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!qa.has(r))return`${Za(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Ya){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Xa.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Ya=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Xa=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Za(e){return e.length===0?``:e.join(`.`)}var Qa=`=?base64?`,$a=`?=`;function eo(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function to(e){if(e.length===0||e.startsWith(Qa)&&e.endsWith($a)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function no(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function ro(e){return to(e)?`${Qa}${no(e)}${$a}`:e}function io(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function ao(e,t){let n={};for(let r of e){let e=io(t,r.path);if(e==null)continue;let i=eo(e);i!==void 0&&(n[`${Wa}${r.headerName}`]=ro(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var oo={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function so(e,t){let n=Object.hasOwn(oo,e)?oo[e]:void 0;if(n===void 0)return;let r=co(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function co(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lo(e,t){return p(e,t)}function uo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function fo(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var po=!1,mo=`draft-2020-12`;function ho(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:mo});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);po||(po=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:mo,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&go(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function go(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||go(e)))}return!1}function _o(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function vo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>_o(e)).join(`, `)}:{success:!0,data:n.value}}function yo(e){let t=ie(e,{target:mo,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var bo=/\\\.\\d\{(\d+)\}/;function xo(e){let t=bo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function So(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=xo(t)}return new Set(n.map(e=>yo(e)).filter(e=>e!==void 0))}function Co(e,t,n){return n!==`zod`||So(e,t).has(t)}function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e){try{return ho(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Eo=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Do(e){return Eo.has(e)||e.startsWith(`x-`)}var Oo=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),ko={string:uo([Gn,qn,Jn,Yn]),number:uo([Kn]),integer:uo([Kn]),boolean:uo([Wn]),array:uo([Zn,Qn])},Ao=new Set(Gn.shape.format.unwrap().options);function jo(e,t,n,r){if(!wo(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(ko,e.type)?ko[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Do(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ao.has(e.format)?(typeof s!=`string`||!Co(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Mo(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&wo(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,jo(n,`properties.${e}`,t,r)])):Oo.has(i)?n[i]=a:Do(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function No(e,t){if(!wo(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!lo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Po(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Po(e,t[r],`${n}[${r}]`)):!wo(e)||!wo(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Po(r,t[e],i):Do(e)?[]:[i]})}function Fo(e){if(!fo(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Mo(To(e.requestedSchema),t),r=lo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${No(n,r.error.message)}`);let i=Po(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Io(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Io,{elicit(e){try{return{method:`elicitation/create`,params:Fo(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Lo=!0,Ro=10,zo=250;function Bo(e){return{autoFulfill:e?.autoFulfill??Lo,maxRounds:e?.maxRounds??Ro}}function Vo(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Ho(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Uo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Wo(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Go(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Ho(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Wo(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Uo(zo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Vo(r,u,c.requestState),d);if(Va(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var Ko=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),qo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Jo={},Yo={};function Xo(e,t){let n=e.slice(0,-6);Jo[n]=t,Yo[n]=e=>t.safeParse(e).success}for(let e of Ko)Xo(e,Ia[e]);for(let[e,t]of Object.entries(qo))Xo(e,t);Object.freeze(Jo);var Zo=Object.freeze(Yo);function Qo(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var $o=[Fe,Ie,Re,Be],es=[`inputResponses`,`requestState`];function ts(e,t){let n=e.params;if(!os(n))return{message:e,lifted:{}};let r=n._meta,i=os(r)?$o.filter(e=>e in r):[],a=t===`request`?es.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&os(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function ns(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function rs(e){return()=>e}var is=rs(void 0),as=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),za(e)||Ba(e)?this._onresponse(e):La(e)?this._onrequest(e,t):Ra(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ts(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ts(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:ls(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?is:rs(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return u(e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),za(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qo(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(hs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;vo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await vo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await vo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ss(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=os(a)&&os(i)?{...a,...i}:i}return n}function cs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ls(e){let t={},n=[];if(!cs(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!cs(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function us(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function ds(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:rs(void 0),signal:r,send:(()=>us(`send`)),notify:()=>us(`notify`)}}}async function fs(e,t,n,r,i){if(!cs(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=cs(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(ds(n,a,s,i,e.sessionId)))}function ps(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function ms(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>fs(e,i,t,n,r),retry:(e,t)=>r.retry(e,ps(o,t))};return Go({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function hs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var gs=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function _s(e){if(e)try{return gs.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function vs(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ys(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...vs(t.headers),...vs(r.headers)}:t.headers}):e}function bs(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Ds(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ts[i])continue;let a=`${r}/${xs(i)}`,o=e[i];if(Array.isArray(o)){if(Cs[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Ps=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Fs=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Is=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ls=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Rs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,zs=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Bs=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Vs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Hs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Us(e){return e.test.bind(e)}var Ws={date:Ks,time:qs.bind(void 0,!1),"date-time":Ys,duration:Hs,uri:Qs,"uri-reference":Us(Ms),"uri-template":Us(Ns),url:Us(Ps),email:zs,hostname:Us(js),ipv4:Us(Bs),ipv6:Us(Vs),regex:ec,uuid:Us(Fs),"json-pointer":Us(Is),"json-pointer-uri-fragment":Us(Ls),"relative-json-pointer":Us(Rs)};function Gs(e){return e%4==0&&(e%100!=0||e%400==0)}function Ks(e){let t=e.match(Os);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&Gs(n)?29:ks[r])}function qs(e,t){let n=t.match(As);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var Js=/t|\s/i;function Ys(e){let t=e.split(Js);return t.length==2&&Ks(t[0])&&qs(!0,t[1])}var Xs=/\/|:/,Zs=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Qs(e){return Xs.test(e)&&Zs.test(e)}var $s=/[^\\]\\Z/;function ec(e){if($s.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function tc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&r{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Fa.some(t=>t.hasRequestMethod(e))}function Pa(e){return Fa.some(t=>t.hasNotificationMethod(e))}var Fa=[Ri,Da],Ia=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),La=e=>Ze.safeParse(e).success,Ra=e=>Qe.safeParse(e).success,za=e=>$e.safeParse(e).success,Ba=e=>et.safeParse(e).success,Va=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ha=e=>ht.safeParse(e).success,Ua=e=>vt.safeParse(e).success,Wa=`Mcp-Param-`,Ga=`x-mcp-header`,Ka=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,qa=new Set([`string`,`integer`,`boolean`,`number`]);function Ja(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ga in o){if(!a||i.length===0)return`${Za(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ga];if(typeof e!=`string`||e.length===0)return`${Za(i)}: x-mcp-header MUST be a non-empty string`;if(!Ka.test(e))return`${Za(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!qa.has(r))return`${Za(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Ya){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Xa.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Ya=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Xa=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Za(e){return e.length===0?``:e.join(`.`)}var Qa=`=?base64?`,$a=`?=`;function eo(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function to(e){if(e.length===0||e.startsWith(Qa)&&e.endsWith($a)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function no(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function ro(e){return to(e)?`${Qa}${no(e)}${$a}`:e}function io(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function ao(e,t){let n={};for(let r of e){let e=io(t,r.path);if(e==null)continue;let i=eo(e);i!==void 0&&(n[`${Wa}${r.headerName}`]=ro(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var oo={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function so(e,t){let n=Object.hasOwn(oo,e)?oo[e]:void 0;if(n===void 0)return;let r=co(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function co(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lo(e,t){return p(e,t)}function uo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function fo(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var po=!1,mo=`draft-2020-12`;function ho(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:mo});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);po||(po=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:mo,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&go(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function go(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||go(e)))}return!1}function _o(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function vo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>_o(e)).join(`, `)}:{success:!0,data:n.value}}function yo(e){let t=ie(e,{target:mo,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var bo=/\\\.\\d\{(\d+)\}/;function xo(e){let t=bo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function So(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=xo(t)}return new Set(n.map(e=>yo(e)).filter(e=>e!==void 0))}function Co(e,t,n){return n!==`zod`||So(e,t).has(t)}function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e){try{return ho(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Eo=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Do(e){return Eo.has(e)||e.startsWith(`x-`)}var Oo=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),ko={string:uo([Gn,qn,Jn,Yn]),number:uo([Kn]),integer:uo([Kn]),boolean:uo([Wn]),array:uo([Zn,Qn])},Ao=new Set(Gn.shape.format.unwrap().options);function jo(e,t,n,r){if(!wo(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(ko,e.type)?ko[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Do(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ao.has(e.format)?(typeof s!=`string`||!Co(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Mo(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&wo(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,jo(n,`properties.${e}`,t,r)])):Oo.has(i)?n[i]=a:Do(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function No(e,t){if(!wo(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!lo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Po(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Po(e,t[r],`${n}[${r}]`)):!wo(e)||!wo(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Po(r,t[e],i):Do(e)?[]:[i]})}function Fo(e){if(!fo(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Mo(To(e.requestedSchema),t),r=lo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${No(n,r.error.message)}`);let i=Po(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Io(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Io,{elicit(e){try{return{method:`elicitation/create`,params:Fo(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Lo=!0,Ro=10,zo=250;function Bo(e){return{autoFulfill:e?.autoFulfill??Lo,maxRounds:e?.maxRounds??Ro}}function Vo(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Ho(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Uo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Wo(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Go(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Ho(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Wo(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Uo(zo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Vo(r,u,c.requestState),d);if(Va(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var Ko=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),qo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Jo={},Yo={};function Xo(e,t){let n=e.slice(0,-6);Jo[n]=t,Yo[n]=e=>t.safeParse(e).success}for(let e of Ko)Xo(e,Ia[e]);for(let[e,t]of Object.entries(qo))Xo(e,t);Object.freeze(Jo);var Zo=Object.freeze(Yo);function Qo(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var $o=[Fe,Ie,Re,Be],es=[`inputResponses`,`requestState`];function ts(e,t){let n=e.params;if(!os(n))return{message:e,lifted:{}};let r=n._meta,i=os(r)?$o.filter(e=>e in r):[],a=t===`request`?es.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&os(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function ns(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function rs(e){return()=>e}var is=rs(void 0),as=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),za(e)||Ba(e)?this._onresponse(e):La(e)?this._onrequest(e,t):Ra(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ts(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ts(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:ls(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?is:rs(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return u(e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),za(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),fo(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qo(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(hs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;vo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await vo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await vo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ss(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=os(a)&&os(i)?{...a,...i}:i}return n}function cs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ls(e){let t={},n=[];if(!cs(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!cs(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function us(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function ds(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:rs(void 0),signal:r,send:(()=>us(`send`)),notify:()=>us(`notify`)}}}async function fs(e,t,n,r,i){if(!cs(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=cs(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(ds(n,a,s,i,e.sessionId)))}function ps(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function ms(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>fs(e,i,t,n,r),retry:(e,t)=>r.retry(e,ps(o,t))};return Go({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function hs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var gs=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function _s(e){if(e)try{return gs.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function vs(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ys(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...vs(t.headers),...vs(r.headers)}:t.headers}):e}function bs(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Ds(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ts[i])continue;let a=`${r}/${xs(i)}`,o=e[i];if(Array.isArray(o)){if(Cs[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Ps=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Fs=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Is=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ls=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Rs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,zs=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Bs=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Vs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Hs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Us(e){return e.test.bind(e)}var Ws={date:Ks,time:qs.bind(void 0,!1),"date-time":Ys,duration:Hs,uri:Qs,"uri-reference":Us(Ms),"uri-template":Us(Ns),url:Us(Ps),email:zs,hostname:Us(js),ipv4:Us(Bs),ipv6:Us(Vs),regex:ec,uuid:Us(Fs),"json-pointer":Us(Is),"json-pointer-uri-fragment":Us(Ls),"relative-json-pointer":Us(Rs)};function Gs(e){return e%4==0&&(e%100!=0||e%400==0)}function Ks(e){let t=e.match(Os);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&Gs(n)?29:ks[r])}function qs(e,t){let n=t.match(As);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var Js=/t|\s/i;function Ys(e){let t=e.split(Js);return t.length==2&&Ks(t[0])&&qs(!0,t[1])}var Xs=/\/|:/,Zs=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Qs(e){return Xs.test(e)&&Zs.test(e)}var $s=/[^\\]\\Z/;function ec(e){if($s.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function tc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&rbs(e,t))||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Q(e,v,n,r,i,a,o,t).valid&&F.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let xe=[];if(y!==void 0){let t=`${s}/anyOf`,l=F.length,u=!1;for(let s=0;s{let u=Object.create(c),d=Q(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return F.push(...d.errors),d.valid&&xe.push(u),d.valid}).length;u===1?F.length=l:F.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...xe),S!==void 0){let t=`${s}/if`;if(Q(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=Q(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(ee!==void 0){let l=Q(e,ee,n,r,i,a,o,`${s}/else`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||F.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(ne!==void 0&&t.lengthre&&F.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${re} properties.`}),ie!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${xs(s)}`,c=Q(s,ie,n,r,i,a,e,t);c.valid||F.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(ae!==void 0){let t=`${s}/dependantRequired`;for(let n in ae)if(n in e){let r=ae[n];for(let i of r)i in e||F.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(oe!==void 0)for(let t in oe){let l=`${s}/dependentSchemas`;if(t in e){let s=Q(e,oe[t],n,r,i,a,o,`${l}/${xs(t)}`,c);s.valid||F.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(se!==void 0){let t=`${s}/dependencies`;for(let s in se)if(s in e){let c=se[s];if(Array.isArray(c))for(let n of c)n in e||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Q(e,c,n,r,i,a,o,`${t}/${xs(s)}`);l.valid||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(T!==void 0){let t=`${s}/properties`;for(let s in T){if(!(s in e))continue;let d=`${o}/${xs(s)}`,f=Q(e[s],T[s],n,r,i,a,d,`${t}/${xs(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,F.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&E!==void 0){let t=`${s}/patternProperties`;for(let s in E){let d=new RegExp(s,`u`),f=E[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${xs(p)}`,h=Q(e[p],f,n,r,i,a,m,`${t}/${xs(s)}`);h.valid?c[p]=l[p]=!0:(u=i,F.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&te!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${xs(s)}`,f=Q(e[s],te,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,F.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&D!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${xs(s)}`,u=Q(e[s],D,n,r,i,a,l,t);u.valid?c[s]=!0:F.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){de!==void 0&&e.length>de&&F.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${de}).`}),M!==void 0&&e.length=(A||0)&&(F.length=u),A===void 0&&j===void 0&&d===0?F.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):A!==void 0&&dj&&F.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${j} items matching schema. ${d} items were found.`})}}if(!u&&ue!==void 0){let u=`${s}/unevaluatedItems`;for(;l=me||e>me)&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${N?`or equal to `:``} ${me}.`})):(pe!==void 0&&eme&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${me}.`}),he!==void 0&&e<=he&&F.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${he}.`}),N!==void 0&&e>=N&&F.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${N}.`})),P!==void 0){let t=e%P;Math.abs(0-t)>=1.1920929e-7&&Math.abs(P-t)>=1.1920929e-7&&F.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${P}.`})}}else if(u===`string`){let t=ge===void 0&&_e===void 0?0:tc(e);ge!==void 0&&t_e&&F.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${_e}).`}),ve!==void 0&&!new RegExp(ve,`u`).test(e)&&F.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),w!==void 0&&Ws[w]&&!Ws[w](e)&&F.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${w}".`})}return{valid:F.length===0,errors:F}}var nc=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Ds(e)}validate(e){return Q(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Ds(e,this.lookup)}},rc=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=je(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new nc(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},ic=globalThis.crypto;async function ac(e){return(await ic).getRandomValues(new Uint8Array(e))}async function oc(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await sc(e);return{code_verifier:t,code_challenge:await cc(t)}}var uc=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},dc=10,fc=13,pc=32;function mc(e){}function hc(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=mc,onError:n=mc,onRetry:r=mc,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new uc(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` diff --git a/internal/ui/dist/assets/page-DclWQ-lK.js b/internal/ui/dist/assets/page-CSqb2kMb.js similarity index 99% rename from internal/ui/dist/assets/page-DclWQ-lK.js rename to internal/ui/dist/assets/page-CSqb2kMb.js index 9524bf07c..d665feef0 100644 --- a/internal/ui/dist/assets/page-DclWQ-lK.js +++ b/internal/ui/dist/assets/page-CSqb2kMb.js @@ -1,4 +1,4 @@ -import{A as e,C as t,Ct as n,D as r,E as i,K as a,M as o,O as s,P as c,S as l,St as u,T as d,X as f,Y as p,Z as m,_ as h,a as g,at as _,bt as v,c as y,d as b,dt as x,et as S,f as C,g as w,h as T,ht as E,j as D,k as O,lt as k,m as A,o as j,ot as M,p as N,pt as P,r as F,s as I,st as L,tt as ee,u as te,ut as ne,v as re,vt as ie,x as ae,xt as R,y as oe,yt as z}from"./brand-oskFJPNW.js";import{c as B,l as se,o as ce,r as le,s as ue}from"./auth-CQerCjF_.js";import{c as de,g as fe,m as pe,p as me,s as he}from"./preload-helper-DOsq4iEA.js";import{$ as ge,A as _e,B as ve,C as ye,D as be,F as xe,G as Se,H as Ce,I as we,J as Te,K as Ee,L as De,M as Oe,N as ke,O as Ae,P as je,R as Me,T as Ne,U as Pe,V as Fe,W as Ie,Z as Le,c as Re,d as ze,et as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as Ke,l as qe,m as Je,o as Ye,ot as Xe,p as Ze,q as Qe,r as $e,s as et,st as tt,u as nt,v as rt,w as it,y as at,z as ot}from"./theme-BKAYKhPv.js";import{n as st,t as ct}from"./get-single-element-child-D7qmWU2f.js";import{C as lt,E as ut,b as dt,o as ft,t as pt,w as mt}from"./Tooltip-2jTVpG2Y.js";import{t as ht}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{E as gt,T as _t,t as vt}from"./useQuery-BynlWFEG.js";import{n as yt}from"./FocusTrap-yVpiEwpv.js";import{a as bt,c as xt,d as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./dashboard-change-chips-8yAFuODi.js";import{n as jt,r as Mt,t as Nt}from"./WarningCircle.es-CsY2RrOb.js";function Pt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ft(e);if(n.length!==Ft(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var H=ie();function Lt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,V.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,V.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ut(e){let t=(0,V.useRef)(void 0);return(0,V.useEffect)(()=>{t.current=e},[e]),t.current}function Wt(e,t,n){let r=(0,V.useRef)(null);(0,V.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Gt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=dt(s.borderTopWidth)+dt(c.borderTopWidth),u=dt(s.borderLeftWidth)+dt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,V.useRef)(null),h=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,V.useEffect)(()=>{if(t){let e=e=>{Zt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,V.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Ht(()=>{St()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var $t={root:`m_96b553a6`},en=f((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),tn=d(n=>{let r=o(`FloatingIndicator`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:p,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=r,C=m(),w=e({name:`FloatingIndicator`,classes:$t,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:en,stylesCtx:{shouldReduceMotion:C}}),T=(0,V.useRef)(null),{initialized:E,hidden:D}=Qt({target:d,parent:f,ref:T,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),O=S(b,T);return!d||!f?null:(0,H.jsx)(t,{ref:O,mod:[{initialized:E,hidden:D},h],...w(`root`),...x})});tn.displayName=`@mantine/core/FloatingIndicator`,tn.classes=$t,tn.varsResolver=en;var[nn,rn]=ut(`Accordion component was not found in the tree`),[an,on]=ut(`Accordion.Item component was not found in the tree`),sn={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},cn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,chevron:c,icon:u,onClick:d,onKeyDown:f,children:p,disabled:m,mod:h,...g}=o(`AccordionControl`,null,e),{value:_}=on(),v=rn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,H.jsxs)(l,{...v.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:m},h],onClick:e=>{d?.(e),v.onChange(_)},type:`button`,disabled:m,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ge({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:f}),...g,children:[(0,H.jsx)(t,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:n,styles:a}),children:c||v.chevron}),(0,H.jsx)(`span`,{...v.getStyles(`label`,{classNames:n,styles:a}),children:p}),u&&(0,H.jsx)(t,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:n,styles:a}),children:u})]});return b?(0,H.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:n,styles:a}),children:S}):S});cn.displayName=`@mantine/core/AccordionControl`,cn.classes=sn;var ln=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,value:c,mod:l,...u}=o(`AccordionItem`,null,e),d=rn();return(0,H.jsx)(an,{value:{value:c},children:(0,H.jsx)(t,{mod:[{active:d.isItemActive(c)},l],...d.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:d.variant}),...u})})});ln.displayName=`@mantine/core/AccordionItem`,ln.classes=sn;var un=d(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:s,keepMounted:c,keepMountedMode:l,...u}=o(`AccordionPanel`,null,e),{value:d}=on(),f=rn();return(0,H.jsx)(At,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:c??f.keepMounted,keepMountedMode:l??f.keepMountedMode,...u,children:(0,H.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:s})})});un.displayName=`@mantine/core/AccordionPanel`,un.classes=sn;var dn={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},fn=f((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:P(n),"--accordion-radius":r===void 0?void 0:L(r)}})),pn=i(n=>{let r=o(`Accordion`,dn,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=r,M=ee(g),[N,P]=se({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),F=e=>Array.isArray(N)?N.includes(e):e===N,I=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},L=e({name:`Accordion`,classes:sn,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:fn});return(0,H.jsx)(nn,{value:{isItemActive:F,onChange:I,getControlId:It(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:It(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,H.jsx)(Ee,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:L,variant:T,unstyled:l,keepMounted:k,keepMountedMode:A},children:(0,H.jsx)(t,{...L(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});pn.classes=sn,pn.varsResolver=fn,pn.displayName=`@mantine/core/Accordion`,pn.Item=ln,pn.Panel=un,pn.Control=cn,pn.Chevron=Ee;function mn(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>mn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function hn(e){return e?e.map(e=>mn(e)):[]}function gn(e){return e.reduce((e,t)=>`group`in t?{...e,...gn(t.items)}:(e[`${t.value}`]=t,e),{})}var _n={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},vn={error:null},yn=f((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":k(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),bn=d(n=>{let r=o(`ComboboxChevron`,vn,n),{size:i,error:a,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,attributes:p,mod:m,...h}=r,g=e({name:`ComboboxChevron`,classes:_n,props:r,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,varsResolver:yn,attributes:p,rootSelector:`chevron`});return(0,H.jsx)(t,{component:`svg`,...h,...g(`chevron`),size:i,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:a},m],children:(0,H.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});bn.classes=_n,bn.varsResolver=yn,bn.displayName=`@mantine/core/ComboboxChevron`;var[xn,Sn]=ut(`Combobox component was not found in tree`);function Cn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,H.jsx)(T.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Cn.displayName=`@mantine/core/ComboboxClearButton`;var wn=d(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...s}=o(`ComboboxDropdown`,null,e),c=Sn();return(0,H.jsx)(Qe.Dropdown,{...s,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":c.floatingHeight||void 0,...c.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});wn.classes=_n,wn.displayName=`@mantine/core/ComboboxDropdown`;var Tn={refProp:`ref`},En=d(e=>{let{children:t,refProp:n,ref:r}=o(`ComboboxDropdownTarget`,Tn,e);if(Sn(),!st(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,H.jsx)(Qe.Target,{ref:r,refProp:n,children:t})});En.displayName=`@mantine/core/ComboboxDropdownTarget`;var Dn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxEmpty`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...c})});Dn.classes=_n,Dn.displayName=`@mantine/core/ComboboxEmpty`;function On({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Sn(),[c,l]=(0,V.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var kn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},An=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxEventsTarget`,kn,e),d=ct(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c});return(0,V.cloneElement)(d,{...p,...u,[n]:S(l,f.store.targetRef,lt(d))})});An.displayName=`@mantine/core/ComboboxEventsTarget`;var jn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxFooter`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});jn.classes=_n,jn.displayName=`@mantine/core/ComboboxFooter`;var Mn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,children:c,label:l,id:u,...d}=o(`ComboboxGroup`,null,e),f=Sn(),p=ee(u),m=l!=null&&l!==!1&&l!==``;return(0,H.jsxs)(t,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...d,children:[m&&(0,H.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:n,styles:a}),children:l}),c]})});Mn.classes=_n,Mn.displayName=`@mantine/core/ComboboxGroup`;var Nn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxHeader`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});Nn.classes=_n,Nn.displayName=`@mantine/core/ComboboxHeader`;function Pn({value:e,valuesDivider:t=`,`,...n}){return(0,H.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Pn.displayName=`@mantine/core/ComboboxHiddenInput`;var Fn=d(e=>{let n=o(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:s,vars:c,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=n,v=Sn(),y=(0,V.useId)(),b=u||y;return(0,H.jsx)(t,{...v.getStyles(`option`,{className:i,classNames:r,styles:s,style:a}),..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(n.value,n),l?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Fn.classes=_n,Fn.displayName=`@mantine/core/ComboboxOption`;var In=d(e=>{let{classNames:n,className:r,style:i,styles:a,id:s,onMouseDown:c,labelledBy:l,...u}=o(`ComboboxOptions`,null,e),d=Sn(),f=ee(s);return(0,V.useEffect)(()=>{d.store.setListId(f)},[f]),(0,H.jsx)(t,{...d.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),c?.(e)}})});In.classes=_n,In.displayName=`@mantine/core/ComboboxOptions`;var Ln={withAriaAttributes:!0,withKeyboardNavigation:!0},Rn=d(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:s,onClick:c,withKeyboardNavigation:l,size:u,ref:d,...f}=o(`ComboboxSearch`,Ln,e),p=Sn(),m=p.getStyles(`search`),h=On({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:s,onClick:c,autoComplete:`off`});return(0,H.jsx)(T,{ref:S(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Rn.classes=_n,Rn.displayName=`@mantine/core/ComboboxSearch`;var zn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bn=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxTarget`,zn,e),d=ct(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c}),m=(0,V.cloneElement)(d,{...p,...u});return(0,H.jsx)(Qe.Target,{refProp:n,ref:S(l,f.store.targetRef),children:m})});Bn.displayName=`@mantine/core/ComboboxTarget`;function Vn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Hn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,V.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,V.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,V.useCallback)(()=>{let e=Yt(f.current);qt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,V.useCallback)(e=>{let t=Yt(f.current),n=qt(`#${l.current}`,t),r=n?Jt(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,V.useCallback)(()=>{let e=Yt(f.current),t=qt(`#${l.current} [data-combobox-active]`,e);if(t){let n=Jt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Hn(u.current,t,a))},[b,a]),C=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),w=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Un(t))},[b]),T=(0,V.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,V.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,V.useCallback)(()=>{let e=Yt(f.current);(Jt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,V.useCallback)(e=>{l.current=e},[]),k=(0,V.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,V.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,V.useCallback)(()=>u.current,[]);return(0,V.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Gn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Kn=f((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:P(n),"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)}})),qn=t=>{let n=o(`Combobox`,Gn,t),{classNames:r,styles:i,unstyled:a,children:s,store:c,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=n,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,S=Wn(),C=c||S,w=e({name:h||`Combobox`,classes:_n,props:n,classNames:r,styles:i,unstyled:a,attributes:_,vars:l,varsResolver:Kn}),T=()=>{d?.(),C.closeDropdown()};return(0,H.jsx)(xn,{value:{getStyles:w,store:C,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,H.jsx)(Qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:a,children:s})})};qn.extend=e=>e,qn.classes=_n,qn.varsResolver=Kn,qn.displayName=`@mantine/core/Combobox`,qn.Target=Bn,qn.Dropdown=wn,qn.Options=In,qn.Option=Fn,qn.Search=Rn,qn.Empty=Dn,qn.Chevron=bn,qn.Footer=jn,qn.Header=Nn,qn.EventsTarget=An,qn.DropdownTarget=En,qn.Group=Mn,qn.ClearButton=Cn,qn.HiddenInput=Pn;function Jn({children:e,role:t}){let n=(0,V.use)(w);return n?(0,H.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,H.jsx)(H.Fragment,{children:e})}var Yn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Xn=Yn;function Zn({__staticSelector:n,__stylesApiProps:r,className:i,classNames:a,styles:o,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:_=`label`,variant:v,style:y,vars:b,mod:x,attributes:S,...C}){let w=e({name:n,props:r,className:i,style:y,classes:Yn,classNames:a,styles:o,unstyled:s,attributes:S}),E=u?`${d}-description`:void 0,D=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,H.jsx)(t,{...w(`root`),__vars:{"--label-fz":M(m),"--label-lh":k(m,`label-lh`)},mod:[{"label-position":h},x],variant:v,size:m,...C,children:(0,H.jsxs)(t,{component:g,htmlFor:g===`label`?d:void 0,...w(`body`),children:[c,(0,H.jsxs)(`div`,{...w(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,H.jsx)(t,{component:_,htmlFor:_===`label`?d:void 0,...w(`label`),"data-disabled":f||void 0,children:l}),u&&(0,H.jsx)(T.Description,{id:E,size:m,__inheritStyles:!1,...w(`description`),children:u}),p&&typeof p!=`boolean`&&(0,H.jsx)(T.Error,{id:D,size:m,__inheritStyles:!1,...w(`error`),children:p})]})]})})}Zn.displayName=`@mantine/core/InlineInput`;function Qn(e){return`group`in e}function $n({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function tr(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Qn(n))tr(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function nr(e,t){return Array.isArray(e)?e.includes(t):e===t}function rr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Qn(e)){let s=nr(r,e.value),c=t&&(s?(0,H.jsx)(Se,{className:_n.optionsDropdownCheckIcon}):n?(0,H.jsx)(`div`,{className:_n.optionsDropdownCheckPlaceholder}):null),l=(0,H.jsxs)(H.Fragment,{children:[i===`left`&&c,(0,H.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,H.jsx)(qn.Option,{value:e.value,disabled:e.disabled,className:p({[_n.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,H.jsx)(rr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,H.jsx)(qn.Group,{label:e.group,children:s})}function ir({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=Sn();tr(e);let x=typeof i==`string`?(r||$n)({options:e,search:l?i:``,limit:a??1/0}):e,S=er(x),C=x.map((e,t)=>(0,H.jsx)(rr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Qn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,H.jsx)(qn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,H.jsxs)(qn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,H.jsx)(ft.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,H.jsx)(qn.Empty,{children:m})]})})}function ar(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},sr=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,sr(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,V.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ar(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ar(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){or(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function lr(e){let t=e.currentTarget;return Yt(t).activeElement!==t}var ur=(0,V.createContext)(null),dr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},fr=(0,V.createContext)(null),pr=f((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?k(n,`pg-gap`):k(t)}})),mr=d(n=>{let r=o(`PillGroup`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,size:d,disabled:f,attributes:p,...m}=r,h=(0,V.use)(ur)?.size||d||void 0,g=e({name:`PillGroup`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:p,vars:u,varsResolver:pr,stylesCtx:{size:h},rootSelector:`group`});return(0,H.jsx)(fr,{value:{size:h,disabled:f},children:(0,H.jsx)(t,{size:h,...g(`group`),...m})})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/PillGroup`;var hr={variant:`default`},gr=f((e,{radius:t},{size:n})=>({root:{"--pill-fz":k(n,`pill-fz`),"--pill-height":k(n,`pill-height`),"--pill-radius":t===void 0?void 0:L(t)}})),_r=d(n=>{let r=o(`Pill`,hr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=r,S=(0,V.use)(fr),C=(0,V.use)(ur),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=e({name:`Pill`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:b,vars:u,varsResolver:gr,stylesCtx:{size:w}});return(0,H.jsxs)(t,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,H.jsx)(`span`,{...E(`label`),children:f}),p&&(0,H.jsx)(re,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});_r.classes=dr,_r.varsResolver=gr,_r.displayName=`@mantine/core/Pill`,_r.Group=mr;var vr={field:`m_45c4369d`},yr={type:`visible`},br=d(n=>{let r=o(`PillsInputField`,yr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=r,y=(0,V.use)(ur),b=(0,V.use)(w),x=e({name:`PillsInputField`,classes:vr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:g,rootSelector:`field`}),C=f||y?.disabled;return(0,H.jsx)(t,{component:`input`,ref:S(_,y?.fieldRef),"data-type":d,disabled:C,mod:[{disabled:C,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});br.classes=vr,br.displayName=`@mantine/core/PillsInputField`;var xr={size:`sm`},Sr=d(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:s,error:c,variant:l,...u}=o([`Input`,`InputWrapper`,`PillsInput`],xr,e),d=(0,V.useRef)(null);return(0,H.jsx)(ur,{value:{fieldRef:d,size:i,disabled:a,hasError:!!c,variant:l},children:(0,H.jsx)(A,{size:i,error:c,variant:l,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:a,__staticSelector:s||`PillsInput`,withAria:!1,children:t})})});Sr.displayName=`@mantine/core/PillsInput`,Sr.classes=A.classes,Sr.Field=br;function Cr(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function wr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Tr({data:e,value:t}){let n=t.map(wr);return e.reduce((e,t)=>(Qn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(wr(e.value))===-1)}):n.indexOf(wr(t.value))===-1&&e.push(t),e),[])}var Er={xs:41,sm:50,md:60,lg:72,xl:89},Dr={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Or=i(t=>{let n=o([`Input`,`InputWrapper`,`MultiSelect`],Dr,t),{classNames:r,className:i,style:a,styles:c,unstyled:l,vars:u,size:d,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:O,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:F,disabled:I,onFocus:L,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:B,leftSectionProps:ce,inputContainer:le,inputWrapperOrder:ue,withAsterisk:de,labelProps:fe,descriptionProps:pe,errorProps:me,successProps:he,wrapperProps:ge,description:_e,label:ve,error:ye,success:be,maxValues:xe,searchable:Se,nothingFoundMessage:Ce,withCheckIcon:we,withAlignedLabels:Te,checkIconPosition:Ee,hidePickedOptions:De,withErrorStyles:Oe,withSuccessStyles:ke,name:Ae,form:je,id:Me,clearable:Ne,clearSectionMode:Pe,clearButtonProps:Fe,hiddenInputProps:Ie,placeholder:Le,hiddenInputValuesDivider:Re,required:ze,mod:Be,renderOption:Ve,renderPill:He,onRemove:Ue,onClear:We,onMaxValues:Ge,scrollAreaProps:Ke,chevronColor:qe,attributes:Je,clearSearchOnChange:Ye,openOnFocus:Xe,loading:Ze,loadingPosition:Qe,withPillsReorder:$e,...et}=n,tt=ee(Me),nt=hn(_),rt=gn(nt),it=(0,V.useRef)({}),at=Wn({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&at.selectFirstOption()},onDropdownClose:()=>{x?.(),at.resetSelectedOption()}}),{styleProps:ot,rest:{type:st,autoComplete:ct,...lt}}=s(et),[ut,dt]=se({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:mt}=cr({value:ut,onChange:dt,enabled:$e&&!I&&!F}),[ht,gt]=se({value:M,defaultValue:N,finalValue:``,onChange:P}),_t=e=>{gt(e),at.resetSelectedOption()},vt=e({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:c,unstyled:l,attributes:Je}),{resolvedClassNames:yt,resolvedStyles:bt}=D({props:n,styles:c,classNames:r}),xt=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!Se&&(e.preventDefault(),at.toggleDropdown()),e.key===`Backspace`&&ht.length===0&&ut.length>0&&(Ue?.(ut[ut.length-1]),dt(ut.slice(0,ut.length-1))),mt(e))},St=ut.map((e,t)=>{let n=rt[`${e}`]||it.current[`${e}`],r=ft(t);return He?(0,H.jsx)(V.Fragment,{children:He({option:n,value:e,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},disabled:I,reorderProps:r})},`${e}-${t}`):(0,H.jsx)(_r,{withRemoveButton:!F&&!rt[`${e}`]?.disabled,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},unstyled:l,disabled:I,...vt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,V.useEffect)(()=>{S&&at.selectFirstOption()},[S,ht]),(0,V.useEffect)(()=>{ut.forEach(e=>{`${e}`in rt&&(it.current[`${e}`]=rt[`${e}`])})},[rt,ut]);let Ct=(0,H.jsx)(qn.ClearButton,{...Fe,onClear:()=>{We?.(),dt([]),_t(``)}}),wt=Tr({data:nt,value:ut}),Tt=Ne&&ut.length>0&&!I&&!F,Et=Tt?{paddingInlineEnd:Er[d]??Er.sm}:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:at,classNames:yt,styles:bt,unstyled:l,size:d,readOnly:F,__staticSelector:`MultiSelect`,attributes:Je,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Ye&&_t(``),at.updateSelectedOptionIndex(`selected`),ut.includes(rt[`${e}`].value)?(dt(ut.filter(t=>t!==rt[`${e}`].value)),Ue?.(rt[`${e}`].value)):ut.lengthSe?at.openDropdown():at.toggleDropdown(),"data-expanded":at.dropdownOpened||void 0,id:tt,required:ze,mod:Be,attributes:Je,children:(0,H.jsxs)(_r.Group,{attributes:Je,disabled:I,unstyled:l,...vt(`pillsList`,{style:Et}),...pt(),children:[St,(0,H.jsx)(qn.EventsTarget,{autoComplete:ct,withExpandedAttribute:!0,children:(0,H.jsx)(Sr.Field,{...lt,id:tt,placeholder:Le,type:!Se&&!Le?`hidden`:`visible`,...vt(`inputField`),unstyled:l,onFocus:e=>{L?.(e),Xe&&Se&&at.openDropdown()},onBlur:e=>{te?.(e),at.closeDropdown(),_t(``)},onKeyDown:xt,value:ht,onChange:e=>{if(lr(e)){if(!F){let t=Cr(rt,e.currentTarget.value);t&&!ut.includes(t.value)&&ut.length{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ProgressLabel`,null,e),l=Ar();return(0,H.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...c})});Mr.classes=jr,Mr.displayName=`@mantine/core/ProgressLabel`;var Nr=f((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":k(t,`progress-size`),"--progress-radius":n===void 0?void 0:L(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pr=d(n=>{let r=o(`ProgressRoot`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=r,_=e({name:`Progress`,classes:jr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:Nr});return(0,H.jsx)(kr,{value:{getStyles:_,autoContrast:d},children:(0,H.jsx)(t,{mod:[{orientation:p},h],..._(`root`),...g})})});Pr.classes=jr,Pr.varsResolver=Nr,Pr.displayName=`@mantine/core/ProgressRoot`;var Fr={withAria:!0},Ir=d(e=>{let{classNames:n,className:r,style:i,styles:s,vars:l,value:u,withAria:d,color:f,striped:p,animated:m,mod:h,...g}=o(`ProgressSection`,Fr,e),_=Ar(),v=c(),y=d?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,"aria-valuetext":`${u}%`}:{};return(0,H.jsx)(t,{..._.getStyles(`section`,{className:r,classNames:n,styles:s,style:i}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${u}%`,"--progress-section-color":a(f,v),"--progress-label-color":Xt(_.autoContrast,v)?Te({color:f,theme:v,autoContrast:_.autoContrast}):void 0}})});Ir.classes=jr,Ir.displayName=`@mantine/core/ProgressSection`;var Lr=d(e=>{let t=o(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:s,striped:c,animated:l,"aria-label":u,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=D({classNames:r,styles:i,props:t});return(0,H.jsx)(Pr,{classNames:f,styles:p,vars:a,...d,children:(0,H.jsx)(Ir,{value:n,color:s,striped:c,animated:l,"aria-label":u})})});Lr.classes=jr,Lr.displayName=`@mantine/core/Progress`,Lr.Section=Ir,Lr.Root=Pr,Lr.Label=Mr;var Rr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},zr={withItemsBorders:!0},Br=f((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:L(t),"--sc-color":n?a(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":k(i,`sc-padding`),"--sc-font-size":M(i)}})),Vr=i(n=>{let r=o(`SegmentedControl`,zr,n),{classNames:i,className:a,style:s,styles:l,unstyled:u,vars:d,data:f,value:p,defaultValue:m,onChange:h,size:g,name:v,disabled:y,readOnly:b,fullWidth:x,orientation:C,radius:w,color:T,transitionDuration:E,transitionTimingFunction:D,variant:O,autoContrast:k,withItemsBorders:A,mod:j,attributes:M,ref:N,...P}=r,F=e({name:`SegmentedControl`,props:r,classes:Rr,className:a,style:s,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:Br}),I=c(),L=f.map(e=>Kt(e)?{label:`${e}`,value:e}:e),te=Gt(),[ne,re]=(0,V.useState)(_()),[ie,ae]=(0,V.useState)(null),[R,oe]=(0,V.useState)({}),z=(e,t)=>{e!==null&&R[t]!==e&&(R[t]=e,oe({...R}))},[B,ce]=se({value:p,defaultValue:m,finalValue:Array.isArray(f)?L.find(e=>!e.disabled)?.value??f[0]?.value??null:null,onChange:h}),le=ee(v),ue=L.map(e=>`${e.value}`),de=L.map(e=>(0,V.createElement)(t,{...F(`control`),mod:{active:B===e.value,orientation:C},key:`${e.value}`},(0,V.createElement)(`input`,{...F(`input`),disabled:y||e.disabled,type:`radio`,name:le,value:`${e.value}`,id:`${le}-${e.value}`,checked:B===e.value,onChange:()=>!b&&ce(e.value),"data-focus-ring":I.focusRing,key:`${e.value}-input`}),(0,V.createElement)(t,{component:`label`,...F(`label`),mod:{active:B===e.value&&!(y||e.disabled),disabled:y||e.disabled,"read-only":b},htmlFor:`${le}-${e.value}`,ref:t=>z(t,`${e.value}`),__vars:{"--sc-label-color":T===void 0?void 0:Te({color:T,theme:I,autoContrast:k})},key:`${e.value}-label`},(0,H.jsx)(`span`,{...F(`innerLabel`),children:e.label})))),fe=S(N,ae);return Vt(()=>{re(_())},[f.length]),Vt(()=>{oe(e=>{let t={};return ue.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ue]),f.length===0?null:(0,H.jsxs)(t,{...F(`root`),variant:O,size:g,ref:fe,mod:[{"full-width":x,orientation:C,initialized:te,"with-items-borders":A},j],...P,role:`radiogroup`,"data-disabled":y,children:[B!==void 0&&(0,H.jsx)(tn,{target:R[`${B}`],parent:ie,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...F(`indicator`)},ne),de]})});Vr.classes=Rr,Vr.varsResolver=Br,Vr.displayName=`@mantine/core/SegmentedControl`;var Hr={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Ur=i(e=>{let t=o([`Input`,`InputWrapper`,`Select`],Hr,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,floatingHeight:k,size:j,searchable:M,rightSection:N,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:B,clearable:ce,clearSectionMode:le,clearButtonProps:ue,hiddenInputProps:de,renderOption:fe,onClear:pe,autoComplete:me,scrollAreaProps:he,__defaultRightSection:ge,__clearSection:_e,__clearable:ve,chevronColor:ye,autoSelectOnBlur:be,openOnFocus:xe,attributes:Se,...Ce}=t,we=(0,V.useMemo)(()=>hn(h),[h]),Te=(0,V.useRef)({}),Ee=(0,V.useMemo)(()=>gn(we),[we]),De=ee(B),[Oe,ke,Ae]=se({value:g,defaultValue:_,finalValue:null,onChange:m}),je=Oe==null?void 0:`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`],Me=Ut(je),[Ne,Pe,Fe]=se({value:re,defaultValue:ie,finalValue:je?je.label:``,onChange:ae}),Ie=Wn({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Ie.selectFirstOption():Ie.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Ie.resetSelectedOption,0)}}),Le=e=>{Pe(e),Ie.resetSelectedOption()},{resolvedClassNames:Re,resolvedStyles:ze}=D({props:t,styles:r,classNames:n});(0,V.useEffect)(()=>{v&&Ie.selectFirstOption()},[v,Ne]),(0,V.useEffect)(()=>{g===null&&Le(``),g!=null&&je&&(Me?.value!==je.value||Me?.label!==je.label)&&Le(je.label)},[g,je]),(0,V.useEffect)(()=>{!Ae&&!Fe&&Le(Oe==null?``:`${Oe}`in Ee?Ee[`${Oe}`]?.label:Te.current[`${Oe}`]?.label||``)},[Ee,Oe]),(0,V.useEffect)(()=>{Oe&&`${Oe}`in Ee&&(Te.current[`${Oe}`]=Ee[`${Oe}`])},[Ee,Oe]);let Be=(0,H.jsx)(qn.ClearButton,{...ue,onClear:()=>{ke(null,null),Le(``),pe?.()}}),Ve=ce&&Oe!=null&&!C&&!S;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:Ie,__staticSelector:`Select`,classNames:Re,styles:ze,unstyled:i,readOnly:S,size:j,attributes:Se,floatingHeight:k,keepMounted:be,onOptionSubmit:e=>{b?.(e);let t=R&&`${Ee[e].value}`==`${Oe}`?null:Ee[e],n=t?t.value:null;n!==Oe&&ke(n,t),!Ae&&Le(n==null?``:t?.label||``),Ie.closeDropdown()},...x,children:[(0,H.jsx)(qn.Target,{targetType:M?`input`:`button`,autoComplete:me,withExpandedAttribute:!0,children:(0,H.jsx)(A,{id:De,__defaultRightSection:(0,H.jsx)(qn.Chevron,{size:j,error:oe,unstyled:i,color:ye}),__clearSection:Be,__clearable:Ve,__clearSectionMode:le,rightSection:N,rightSectionPointerEvents:z||`none`,...Ce,size:j,__staticSelector:`Select`,disabled:C,readOnly:S||!M,value:Ne,onChange:e=>{if(lr(e)){if(!S){let t=Cr(Ee,e.currentTarget.value);t&&`${t.value}`!=`${Oe}`&&(ke(t.value,t),!Ae&&Le(t.label))}return}Le(e.currentTarget.value),Ie.openDropdown(),v&&Ie.selectFirstOption()},onFocus:e=>{xe&&M&&Ie.openDropdown(),d?.(e)},onBlur:e=>{be&&Ie.clickSelectedOption(),Ie.closeDropdown();let t=Oe!=null&&(`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`]);Le(t&&t.label||``),f?.(e)},onClick:e=>{M?Ie.openDropdown():Ie.toggleDropdown(),p?.(e)},classNames:Re,styles:ze,unstyled:i,pointer:!M,error:oe,attributes:Se})}),(0,H.jsx)(ir,{data:we,hidden:S||C,filter:w,search:Ne,limit:T,hiddenWhenEmpty:!L,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!M&&je?.label!==Ne,value:Oe,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,unstyled:i,labelId:Ce.label?`${De}-label`:void 0,"aria-label":Ce.label?void 0:Ce[`aria-label`],renderOption:fe,scrollAreaProps:he})]}),(0,H.jsx)(qn.HiddenInput,{value:Oe,name:te,form:ne,disabled:C,...de})]})});Ur.classes={...A.classes,...qn.classes},Ur.displayName=`@mantine/core/Select`;function Wr(e){if(e!==void 0)return typeof e==`number`?P(e):e}function Gr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=c(),s=t===void 0?e:t,l=r!==void 0,u=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(s)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),d=E(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(s[r])),!l&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),f=Le(E(d),o.breakpoints).filter(e=>E(d[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:d[e.value]}));return(0,H.jsx)(O,{styles:u,media:f,selector:a})}function Kr(e){return typeof e==`object`&&e?E(e):[]}function qr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return qr(Array.from(new Set([...Kr(e),...Kr(t),...r===void 0?Kr(n):[]])))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),l=Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,H.jsx)(O,{styles:c,container:d,selector:a})}var Xr={container:`m_925c2d2c`,root:`m_2415a157`},Zr={cols:1,spacing:`md`,type:`media`},Qr=d(n=>{let i=o(`SimpleGrid`,Zr,n),{classNames:a,className:s,style:c,styles:l,unstyled:u,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=i,x=e({name:`SimpleGrid`,classes:Xr,props:i,className:s,style:c,classNames:a,styles:l,unstyled:u,attributes:y,vars:d}),S=r(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yr,{...i,selector:`.${S}`}),(0,H.jsx)(`div`,{...x(`container`),children:(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gr,{...i,selector:`.${S}`}),(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});Qr.classes=Xr,Qr.displayName=`@mantine/core/SimpleGrid`;var $r=(0,V.createContext)(null),ei={hiddenInputValuesSeparator:`,`},ti=i((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:s,readOnly:c,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=o(`SwitchGroup`,ei,e),[h,g]=se({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(c)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(u);return(0,H.jsx)($r,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,H.jsxs)(T.Wrapper,{size:i,...a,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,H.jsx)(Jn,{role:`group`,children:s}),(0,H.jsx)(`input`,{type:`hidden`,name:l,value:y,...d})]})})}));ti.classes=T.Wrapper.classes,ti.displayName=`@mantine/core/SwitchGroup`;var ni={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ri={labelPosition:`right`,withThumbIndicator:!0},ii=f((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:L(t),"--switch-height":k(r,`switch-height`),"--switch-width":k(r,`switch-width`),"--switch-thumb-size":k(r,`switch-thumb-size`),"--switch-label-font-size":k(r,`switch-label-font-size`),"--switch-track-label-padding":k(r,`switch-track-label-padding`),"--switch-color":n?a(n,e):void 0}})),ai=d(n=>{let r=o(`Switch`,ri,n),{classNames:i,className:a,style:c,styles:l,unstyled:u,vars:d,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=r,P=(0,V.use)($r),F=_||P?.size,I=e({name:`Switch`,props:r,classes:ni,className:a,style:c,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:ii}),{styleProps:L,rest:te}=s(N),ne=ee(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=se({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,H.jsxs)(Zn,{...I(`root`),__staticSelector:`Switch`,__stylesApiProps:r,id:ne,size:F,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:i,styles:l,unstyled:u,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...L,...y,children:[(0,H.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...I(`input`)}),(0,H.jsxs)(t,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...I(`track`),children:[(0,H.jsx)(t,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...I(`thumb`),children:b}),(0,H.jsx)(`span`,{...I(`trackLabel`),children:R?h:m})]})]})});ai.classes={...ni,...Xn},ai.varsResolver=ii,ai.displayName=`@mantine/core/Switch`,ai.Group=ti;var oi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),si=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),ci=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),li=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),ui=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),di=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),fi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),pi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),hi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),gi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),_i=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),vi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),yi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:oi}));yi.displayName=`ArrowClockwiseIcon`;var bi=yi,xi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:si}));xi.displayName=`ArrowCounterClockwiseIcon`;var Si=xi,Ci=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ci}));Ci.displayName=`ArrowsOutIcon`;var wi=Ci,Ti=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:li}));Ti.displayName=`CaretUpIcon`;var Ei=Ti,Di=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ui}));Di.displayName=`ChatCircleTextIcon`;var Oi=Di,ki=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:di}));ki.displayName=`ClockIcon`;var Ai=ki,ji=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:fi}));ji.displayName=`ClockCounterClockwiseIcon`;var Mi=ji,Ni=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:pi}));Ni.displayName=`InfoIcon`;var Pi=Ni,Fi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:mi}));Fi.displayName=`KeyboardIcon`;var Ii=Fi,Li=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:hi}));Li.displayName=`ListBulletsIcon`;var Ri=Li,zi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:gi}));zi.displayName=`ListMagnifyingGlassIcon`;var Bi=zi,Vi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:_i}));Vi.displayName=`MagnifyingGlassMinusIcon`;var Hi=Vi,Ui=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:vi}));Ui.displayName=`WrenchIcon`;var Wi=Ui,Gi=n(z(),1),Ki=`$__all`;function qi(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ji(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Yi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=qi(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Ji(r,u,s[0]),f=Ji(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Xi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=qi(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=$i(d,0,s-r),f=$i(f,0,l-i),{x:d,y:f}}function Zi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=qi(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Qi(e,t,n){let{margin:r,rowHeight:i}=e,a=qi(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function $i(e,t,n){return Math.max(Math.min(e,n),t)}function ea(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ta(e,t){for(let n=0;nea(e,t))}function ra(e,t){return t===`horizontal`?aa(e):t===`vertical`||t===`wrap`?ia(e):[...e]}function ia(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function aa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function oa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function sa(e,t){for(let n=0;ne.static===!0)}function la(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ua(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;ta(n,i);)i.y++}}return e}function ma(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=ra(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=na(d,t),p=f.length>0;if(p&&c)return ua(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ma(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ma(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return ma(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ma(e,n,l,u,r,c,i)}function ga(e,t,n){return Math.max(t,Math.min(n,e))}var _a=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:ga(t,0,Math.max(0,r-e.w)),y:ga(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:ga(t,1,Math.max(1,o)),h:ga(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:ga(t,e.minW??1,e.maxW??1/0),h:ga(n,e.minH??1,e.maxH??1/0)}}}];function va(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ya(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ba({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function xa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Sa(e){return e*100+`%`}function Ca(e,t,n,r){return e+n>r?t:n}function wa(e,t,n){return e<0?t:n}function Ta(e){return Math.max(0,e)}function Ea(e){return Math.max(0,e)}var Da=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:wa(o,e.height,i),top:Ea(o)}},Oa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Ca(e.left,e.width,o,n),left:Ta(i)}},ka=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Ea(r),left:0}:{height:i,width:a,top:Ea(r),left:o}},Aa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:wa(r,e.height,a),top:Ea(r)}},ja={n:Da,ne:(e,t,n)=>Da(e,Oa(e,t,n)),e:Oa,se:(e,t,n)=>Aa(e,Oa(e,t,n)),s:Aa,sw:(e,t,n)=>Aa(e,ka(e,t)),w:ka,nw:(e,t,n)=>Da(e,ka(e,t))};function Ma(e,t,n,r){let i=ja[e];return i?i(t,{...t,...n},r):n}var Na={type:`transform`,scale:1,calcStyle(e){return ba(e)}},Pa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Fa={enabled:!0,bounded:!1,threshold:3},Ia={enabled:!0,handles:[`se`]},La={enabled:!1,defaultItem:{w:1,h:1}};function Ra(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??ca(e).length>0;for(let i=o+1;it.y+t.h)break;ea(t,o)&&Ra(e,o,n+t[a],r,s)}}t[r]=n}function za(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!ta(e,t);)t.y--;let i;for(;(i=ta(e,t))!==void 0;)Ra(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Ba(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!ta(e,t);)t.x--;let i;for(;(i=ta(e,t))!==void 0;)if(Ra(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!ta(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Va={type:`vertical`,allowOverlap:!1,compact(e,t){let n=ca(e),r=oa(n),i=ia(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ya(e,t){let n=Ja(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Xa(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Za(e,t,n,r,i,a){let o=e[n];if(o)return ua(o);let s=e[r],c=Ja(t),l=c.slice(c.indexOf(n));for(let t=0;t{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),eo=R(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),to=R(((e,t)=>{var n=eo();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),no=R(((e,t)=>{t.exports=to()()})),ro=n(no(),1);function io(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&io(e.changedTouches,e=>t===e.identifier)}function ko(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ao(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function jo(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ao();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{A as e,C as t,Ct as n,D as r,E as i,K as a,M as o,O as s,P as c,S as l,St as u,T as d,X as f,Y as p,Z as m,_ as h,a as g,at as _,bt as v,c as y,d as b,dt as x,et as S,f as C,g as w,h as T,ht as E,j as D,k as O,lt as k,m as A,o as j,ot as M,p as N,pt as P,r as F,s as I,st as L,tt as ee,u as te,ut as ne,v as re,vt as ie,x as ae,xt as R,y as oe,yt as z}from"./brand-oskFJPNW.js";import{c as B,l as se,o as ce,r as le,s as ue}from"./auth-BLat7TXI.js";import{c as de,g as fe,m as pe,p as me,s as he}from"./preload-helper-DOsq4iEA.js";import{$ as ge,A as _e,B as ve,C as ye,D as be,F as xe,G as Se,H as Ce,I as we,J as Te,K as Ee,L as De,M as Oe,N as ke,O as Ae,P as je,R as Me,T as Ne,U as Pe,V as Fe,W as Ie,Z as Le,c as Re,d as ze,et as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as Ke,l as qe,m as Je,o as Ye,ot as Xe,p as Ze,q as Qe,r as $e,s as et,st as tt,u as nt,v as rt,w as it,y as at,z as ot}from"./theme-ByHk_Blp.js";import{n as st,t as ct}from"./get-single-element-child-D7qmWU2f.js";import{C as lt,E as ut,b as dt,o as ft,t as pt,w as mt}from"./Tooltip-2jTVpG2Y.js";import{t as ht}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{E as gt,T as _t,t as vt}from"./useQuery-BynlWFEG.js";import{n as yt}from"./FocusTrap-yVpiEwpv.js";import{a as bt,c as xt,d as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./dashboard-change-chips-8yAFuODi.js";import{n as jt,r as Mt,t as Nt}from"./WarningCircle.es-CsY2RrOb.js";function Pt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ft(e);if(n.length!==Ft(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var H=ie();function Lt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,V.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,V.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ut(e){let t=(0,V.useRef)(void 0);return(0,V.useEffect)(()=>{t.current=e},[e]),t.current}function Wt(e,t,n){let r=(0,V.useRef)(null);(0,V.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Gt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=dt(s.borderTopWidth)+dt(c.borderTopWidth),u=dt(s.borderLeftWidth)+dt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,V.useRef)(null),h=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,V.useEffect)(()=>{if(t){let e=e=>{Zt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,V.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Ht(()=>{St()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var $t={root:`m_96b553a6`},en=f((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),tn=d(n=>{let r=o(`FloatingIndicator`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:p,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=r,C=m(),w=e({name:`FloatingIndicator`,classes:$t,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:en,stylesCtx:{shouldReduceMotion:C}}),T=(0,V.useRef)(null),{initialized:E,hidden:D}=Qt({target:d,parent:f,ref:T,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),O=S(b,T);return!d||!f?null:(0,H.jsx)(t,{ref:O,mod:[{initialized:E,hidden:D},h],...w(`root`),...x})});tn.displayName=`@mantine/core/FloatingIndicator`,tn.classes=$t,tn.varsResolver=en;var[nn,rn]=ut(`Accordion component was not found in the tree`),[an,on]=ut(`Accordion.Item component was not found in the tree`),sn={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},cn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,chevron:c,icon:u,onClick:d,onKeyDown:f,children:p,disabled:m,mod:h,...g}=o(`AccordionControl`,null,e),{value:_}=on(),v=rn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,H.jsxs)(l,{...v.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:m},h],onClick:e=>{d?.(e),v.onChange(_)},type:`button`,disabled:m,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ge({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:f}),...g,children:[(0,H.jsx)(t,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:n,styles:a}),children:c||v.chevron}),(0,H.jsx)(`span`,{...v.getStyles(`label`,{classNames:n,styles:a}),children:p}),u&&(0,H.jsx)(t,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:n,styles:a}),children:u})]});return b?(0,H.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:n,styles:a}),children:S}):S});cn.displayName=`@mantine/core/AccordionControl`,cn.classes=sn;var ln=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,value:c,mod:l,...u}=o(`AccordionItem`,null,e),d=rn();return(0,H.jsx)(an,{value:{value:c},children:(0,H.jsx)(t,{mod:[{active:d.isItemActive(c)},l],...d.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:d.variant}),...u})})});ln.displayName=`@mantine/core/AccordionItem`,ln.classes=sn;var un=d(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:s,keepMounted:c,keepMountedMode:l,...u}=o(`AccordionPanel`,null,e),{value:d}=on(),f=rn();return(0,H.jsx)(At,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:c??f.keepMounted,keepMountedMode:l??f.keepMountedMode,...u,children:(0,H.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:s})})});un.displayName=`@mantine/core/AccordionPanel`,un.classes=sn;var dn={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},fn=f((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:P(n),"--accordion-radius":r===void 0?void 0:L(r)}})),pn=i(n=>{let r=o(`Accordion`,dn,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=r,M=ee(g),[N,P]=se({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),F=e=>Array.isArray(N)?N.includes(e):e===N,I=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},L=e({name:`Accordion`,classes:sn,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:fn});return(0,H.jsx)(nn,{value:{isItemActive:F,onChange:I,getControlId:It(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:It(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,H.jsx)(Ee,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:L,variant:T,unstyled:l,keepMounted:k,keepMountedMode:A},children:(0,H.jsx)(t,{...L(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});pn.classes=sn,pn.varsResolver=fn,pn.displayName=`@mantine/core/Accordion`,pn.Item=ln,pn.Panel=un,pn.Control=cn,pn.Chevron=Ee;function mn(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>mn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function hn(e){return e?e.map(e=>mn(e)):[]}function gn(e){return e.reduce((e,t)=>`group`in t?{...e,...gn(t.items)}:(e[`${t.value}`]=t,e),{})}var _n={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},vn={error:null},yn=f((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":k(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),bn=d(n=>{let r=o(`ComboboxChevron`,vn,n),{size:i,error:a,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,attributes:p,mod:m,...h}=r,g=e({name:`ComboboxChevron`,classes:_n,props:r,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,varsResolver:yn,attributes:p,rootSelector:`chevron`});return(0,H.jsx)(t,{component:`svg`,...h,...g(`chevron`),size:i,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:a},m],children:(0,H.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});bn.classes=_n,bn.varsResolver=yn,bn.displayName=`@mantine/core/ComboboxChevron`;var[xn,Sn]=ut(`Combobox component was not found in tree`);function Cn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,H.jsx)(T.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Cn.displayName=`@mantine/core/ComboboxClearButton`;var wn=d(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...s}=o(`ComboboxDropdown`,null,e),c=Sn();return(0,H.jsx)(Qe.Dropdown,{...s,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":c.floatingHeight||void 0,...c.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});wn.classes=_n,wn.displayName=`@mantine/core/ComboboxDropdown`;var Tn={refProp:`ref`},En=d(e=>{let{children:t,refProp:n,ref:r}=o(`ComboboxDropdownTarget`,Tn,e);if(Sn(),!st(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,H.jsx)(Qe.Target,{ref:r,refProp:n,children:t})});En.displayName=`@mantine/core/ComboboxDropdownTarget`;var Dn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxEmpty`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...c})});Dn.classes=_n,Dn.displayName=`@mantine/core/ComboboxEmpty`;function On({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Sn(),[c,l]=(0,V.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var kn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},An=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxEventsTarget`,kn,e),d=ct(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c});return(0,V.cloneElement)(d,{...p,...u,[n]:S(l,f.store.targetRef,lt(d))})});An.displayName=`@mantine/core/ComboboxEventsTarget`;var jn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxFooter`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});jn.classes=_n,jn.displayName=`@mantine/core/ComboboxFooter`;var Mn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,children:c,label:l,id:u,...d}=o(`ComboboxGroup`,null,e),f=Sn(),p=ee(u),m=l!=null&&l!==!1&&l!==``;return(0,H.jsxs)(t,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...d,children:[m&&(0,H.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:n,styles:a}),children:l}),c]})});Mn.classes=_n,Mn.displayName=`@mantine/core/ComboboxGroup`;var Nn=d(e=>{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ComboboxHeader`,null,e),l=Sn();return(0,H.jsx)(t,{...l.getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...c,onMouseDown:e=>{e.preventDefault()}})});Nn.classes=_n,Nn.displayName=`@mantine/core/ComboboxHeader`;function Pn({value:e,valuesDivider:t=`,`,...n}){return(0,H.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Pn.displayName=`@mantine/core/ComboboxHiddenInput`;var Fn=d(e=>{let n=o(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:s,vars:c,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=n,v=Sn(),y=(0,V.useId)(),b=u||y;return(0,H.jsx)(t,{...v.getStyles(`option`,{className:i,classNames:r,styles:s,style:a}),..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(n.value,n),l?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Fn.classes=_n,Fn.displayName=`@mantine/core/ComboboxOption`;var In=d(e=>{let{classNames:n,className:r,style:i,styles:a,id:s,onMouseDown:c,labelledBy:l,...u}=o(`ComboboxOptions`,null,e),d=Sn(),f=ee(s);return(0,V.useEffect)(()=>{d.store.setListId(f)},[f]),(0,H.jsx)(t,{...d.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),c?.(e)}})});In.classes=_n,In.displayName=`@mantine/core/ComboboxOptions`;var Ln={withAriaAttributes:!0,withKeyboardNavigation:!0},Rn=d(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:s,onClick:c,withKeyboardNavigation:l,size:u,ref:d,...f}=o(`ComboboxSearch`,Ln,e),p=Sn(),m=p.getStyles(`search`),h=On({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:s,onClick:c,autoComplete:`off`});return(0,H.jsx)(T,{ref:S(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Rn.classes=_n,Rn.displayName=`@mantine/core/ComboboxSearch`;var zn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bn=d(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:c,ref:l,...u}=o(`ComboboxTarget`,zn,e),d=ct(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c}),m=(0,V.cloneElement)(d,{...p,...u});return(0,H.jsx)(Qe.Target,{refProp:n,ref:S(l,f.store.targetRef),children:m})});Bn.displayName=`@mantine/core/ComboboxTarget`;function Vn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Hn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,V.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,V.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,V.useCallback)(()=>{let e=Yt(f.current);qt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,V.useCallback)(e=>{let t=Yt(f.current),n=qt(`#${l.current}`,t),r=n?Jt(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,V.useCallback)(()=>{let e=Yt(f.current),t=qt(`#${l.current} [data-combobox-active]`,e);if(t){let n=Jt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Hn(u.current,t,a))},[b,a]),C=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),w=(0,V.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Un(t))},[b]),T=(0,V.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,V.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,V.useCallback)(()=>{let e=Yt(f.current);(Jt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,V.useCallback)(e=>{l.current=e},[]),k=(0,V.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,V.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,V.useCallback)(()=>u.current,[]);return(0,V.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Gn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Kn=f((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:P(n),"--combobox-option-fz":M(t),"--combobox-option-padding":k(t,`combobox-option-padding`)}})),qn=t=>{let n=o(`Combobox`,Gn,t),{classNames:r,styles:i,unstyled:a,children:s,store:c,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=n,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,S=Wn(),C=c||S,w=e({name:h||`Combobox`,classes:_n,props:n,classNames:r,styles:i,unstyled:a,attributes:_,vars:l,varsResolver:Kn}),T=()=>{d?.(),C.closeDropdown()};return(0,H.jsx)(xn,{value:{getStyles:w,store:C,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,H.jsx)(Qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:a,children:s})})};qn.extend=e=>e,qn.classes=_n,qn.varsResolver=Kn,qn.displayName=`@mantine/core/Combobox`,qn.Target=Bn,qn.Dropdown=wn,qn.Options=In,qn.Option=Fn,qn.Search=Rn,qn.Empty=Dn,qn.Chevron=bn,qn.Footer=jn,qn.Header=Nn,qn.EventsTarget=An,qn.DropdownTarget=En,qn.Group=Mn,qn.ClearButton=Cn,qn.HiddenInput=Pn;function Jn({children:e,role:t}){let n=(0,V.use)(w);return n?(0,H.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,H.jsx)(H.Fragment,{children:e})}var Yn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Xn=Yn;function Zn({__staticSelector:n,__stylesApiProps:r,className:i,classNames:a,styles:o,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:_=`label`,variant:v,style:y,vars:b,mod:x,attributes:S,...C}){let w=e({name:n,props:r,className:i,style:y,classes:Yn,classNames:a,styles:o,unstyled:s,attributes:S}),E=u?`${d}-description`:void 0,D=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,H.jsx)(t,{...w(`root`),__vars:{"--label-fz":M(m),"--label-lh":k(m,`label-lh`)},mod:[{"label-position":h},x],variant:v,size:m,...C,children:(0,H.jsxs)(t,{component:g,htmlFor:g===`label`?d:void 0,...w(`body`),children:[c,(0,H.jsxs)(`div`,{...w(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,H.jsx)(t,{component:_,htmlFor:_===`label`?d:void 0,...w(`label`),"data-disabled":f||void 0,children:l}),u&&(0,H.jsx)(T.Description,{id:E,size:m,__inheritStyles:!1,...w(`description`),children:u}),p&&typeof p!=`boolean`&&(0,H.jsx)(T.Error,{id:D,size:m,__inheritStyles:!1,...w(`error`),children:p})]})]})})}Zn.displayName=`@mantine/core/InlineInput`;function Qn(e){return`group`in e}function $n({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function tr(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Qn(n))tr(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function nr(e,t){return Array.isArray(e)?e.includes(t):e===t}function rr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Qn(e)){let s=nr(r,e.value),c=t&&(s?(0,H.jsx)(Se,{className:_n.optionsDropdownCheckIcon}):n?(0,H.jsx)(`div`,{className:_n.optionsDropdownCheckPlaceholder}):null),l=(0,H.jsxs)(H.Fragment,{children:[i===`left`&&c,(0,H.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,H.jsx)(qn.Option,{value:e.value,disabled:e.disabled,className:p({[_n.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,H.jsx)(rr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,H.jsx)(qn.Group,{label:e.group,children:s})}function ir({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=Sn();tr(e);let x=typeof i==`string`?(r||$n)({options:e,search:l?i:``,limit:a??1/0}):e,S=er(x),C=x.map((e,t)=>(0,H.jsx)(rr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Qn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,H.jsx)(qn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,H.jsxs)(qn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,H.jsx)(ft.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,H.jsx)(qn.Empty,{children:m})]})})}function ar(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},sr=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,sr(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,V.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ar(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ar(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){or(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function lr(e){let t=e.currentTarget;return Yt(t).activeElement!==t}var ur=(0,V.createContext)(null),dr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},fr=(0,V.createContext)(null),pr=f((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?k(n,`pg-gap`):k(t)}})),mr=d(n=>{let r=o(`PillGroup`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,size:d,disabled:f,attributes:p,...m}=r,h=(0,V.use)(ur)?.size||d||void 0,g=e({name:`PillGroup`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:p,vars:u,varsResolver:pr,stylesCtx:{size:h},rootSelector:`group`});return(0,H.jsx)(fr,{value:{size:h,disabled:f},children:(0,H.jsx)(t,{size:h,...g(`group`),...m})})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/PillGroup`;var hr={variant:`default`},gr=f((e,{radius:t},{size:n})=>({root:{"--pill-fz":k(n,`pill-fz`),"--pill-height":k(n,`pill-height`),"--pill-radius":t===void 0?void 0:L(t)}})),_r=d(n=>{let r=o(`Pill`,hr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=r,S=(0,V.use)(fr),C=(0,V.use)(ur),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=e({name:`Pill`,classes:dr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:b,vars:u,varsResolver:gr,stylesCtx:{size:w}});return(0,H.jsxs)(t,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,H.jsx)(`span`,{...E(`label`),children:f}),p&&(0,H.jsx)(re,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});_r.classes=dr,_r.varsResolver=gr,_r.displayName=`@mantine/core/Pill`,_r.Group=mr;var vr={field:`m_45c4369d`},yr={type:`visible`},br=d(n=>{let r=o(`PillsInputField`,yr,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=r,y=(0,V.use)(ur),b=(0,V.use)(w),x=e({name:`PillsInputField`,classes:vr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:g,rootSelector:`field`}),C=f||y?.disabled;return(0,H.jsx)(t,{component:`input`,ref:S(_,y?.fieldRef),"data-type":d,disabled:C,mod:[{disabled:C,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});br.classes=vr,br.displayName=`@mantine/core/PillsInputField`;var xr={size:`sm`},Sr=d(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:s,error:c,variant:l,...u}=o([`Input`,`InputWrapper`,`PillsInput`],xr,e),d=(0,V.useRef)(null);return(0,H.jsx)(ur,{value:{fieldRef:d,size:i,disabled:a,hasError:!!c,variant:l},children:(0,H.jsx)(A,{size:i,error:c,variant:l,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:a,__staticSelector:s||`PillsInput`,withAria:!1,children:t})})});Sr.displayName=`@mantine/core/PillsInput`,Sr.classes=A.classes,Sr.Field=br;function Cr(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function wr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Tr({data:e,value:t}){let n=t.map(wr);return e.reduce((e,t)=>(Qn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(wr(e.value))===-1)}):n.indexOf(wr(t.value))===-1&&e.push(t),e),[])}var Er={xs:41,sm:50,md:60,lg:72,xl:89},Dr={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Or=i(t=>{let n=o([`Input`,`InputWrapper`,`MultiSelect`],Dr,t),{classNames:r,className:i,style:a,styles:c,unstyled:l,vars:u,size:d,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:O,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:F,disabled:I,onFocus:L,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:B,leftSectionProps:ce,inputContainer:le,inputWrapperOrder:ue,withAsterisk:de,labelProps:fe,descriptionProps:pe,errorProps:me,successProps:he,wrapperProps:ge,description:_e,label:ve,error:ye,success:be,maxValues:xe,searchable:Se,nothingFoundMessage:Ce,withCheckIcon:we,withAlignedLabels:Te,checkIconPosition:Ee,hidePickedOptions:De,withErrorStyles:Oe,withSuccessStyles:ke,name:Ae,form:je,id:Me,clearable:Ne,clearSectionMode:Pe,clearButtonProps:Fe,hiddenInputProps:Ie,placeholder:Le,hiddenInputValuesDivider:Re,required:ze,mod:Be,renderOption:Ve,renderPill:He,onRemove:Ue,onClear:We,onMaxValues:Ge,scrollAreaProps:Ke,chevronColor:qe,attributes:Je,clearSearchOnChange:Ye,openOnFocus:Xe,loading:Ze,loadingPosition:Qe,withPillsReorder:$e,...et}=n,tt=ee(Me),nt=hn(_),rt=gn(nt),it=(0,V.useRef)({}),at=Wn({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&at.selectFirstOption()},onDropdownClose:()=>{x?.(),at.resetSelectedOption()}}),{styleProps:ot,rest:{type:st,autoComplete:ct,...lt}}=s(et),[ut,dt]=se({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:mt}=cr({value:ut,onChange:dt,enabled:$e&&!I&&!F}),[ht,gt]=se({value:M,defaultValue:N,finalValue:``,onChange:P}),_t=e=>{gt(e),at.resetSelectedOption()},vt=e({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:c,unstyled:l,attributes:Je}),{resolvedClassNames:yt,resolvedStyles:bt}=D({props:n,styles:c,classNames:r}),xt=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!Se&&(e.preventDefault(),at.toggleDropdown()),e.key===`Backspace`&&ht.length===0&&ut.length>0&&(Ue?.(ut[ut.length-1]),dt(ut.slice(0,ut.length-1))),mt(e))},St=ut.map((e,t)=>{let n=rt[`${e}`]||it.current[`${e}`],r=ft(t);return He?(0,H.jsx)(V.Fragment,{children:He({option:n,value:e,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},disabled:I,reorderProps:r})},`${e}-${t}`):(0,H.jsx)(_r,{withRemoveButton:!F&&!rt[`${e}`]?.disabled,onRemove:()=>{dt(ut.filter(t=>e!==t)),Ue?.(e)},unstyled:l,disabled:I,...vt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,V.useEffect)(()=>{S&&at.selectFirstOption()},[S,ht]),(0,V.useEffect)(()=>{ut.forEach(e=>{`${e}`in rt&&(it.current[`${e}`]=rt[`${e}`])})},[rt,ut]);let Ct=(0,H.jsx)(qn.ClearButton,{...Fe,onClear:()=>{We?.(),dt([]),_t(``)}}),wt=Tr({data:nt,value:ut}),Tt=Ne&&ut.length>0&&!I&&!F,Et=Tt?{paddingInlineEnd:Er[d]??Er.sm}:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:at,classNames:yt,styles:bt,unstyled:l,size:d,readOnly:F,__staticSelector:`MultiSelect`,attributes:Je,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Ye&&_t(``),at.updateSelectedOptionIndex(`selected`),ut.includes(rt[`${e}`].value)?(dt(ut.filter(t=>t!==rt[`${e}`].value)),Ue?.(rt[`${e}`].value)):ut.lengthSe?at.openDropdown():at.toggleDropdown(),"data-expanded":at.dropdownOpened||void 0,id:tt,required:ze,mod:Be,attributes:Je,children:(0,H.jsxs)(_r.Group,{attributes:Je,disabled:I,unstyled:l,...vt(`pillsList`,{style:Et}),...pt(),children:[St,(0,H.jsx)(qn.EventsTarget,{autoComplete:ct,withExpandedAttribute:!0,children:(0,H.jsx)(Sr.Field,{...lt,id:tt,placeholder:Le,type:!Se&&!Le?`hidden`:`visible`,...vt(`inputField`),unstyled:l,onFocus:e=>{L?.(e),Xe&&Se&&at.openDropdown()},onBlur:e=>{te?.(e),at.closeDropdown(),_t(``)},onKeyDown:xt,value:ht,onChange:e=>{if(lr(e)){if(!F){let t=Cr(rt,e.currentTarget.value);t&&!ut.includes(t.value)&&ut.length{let{classNames:n,className:r,style:i,styles:a,vars:s,...c}=o(`ProgressLabel`,null,e),l=Ar();return(0,H.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...c})});Mr.classes=jr,Mr.displayName=`@mantine/core/ProgressLabel`;var Nr=f((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":k(t,`progress-size`),"--progress-radius":n===void 0?void 0:L(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pr=d(n=>{let r=o(`ProgressRoot`,null,n),{classNames:i,className:a,style:s,styles:c,unstyled:l,vars:u,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=r,_=e({name:`Progress`,classes:jr,props:r,className:a,style:s,classNames:i,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:Nr});return(0,H.jsx)(kr,{value:{getStyles:_,autoContrast:d},children:(0,H.jsx)(t,{mod:[{orientation:p},h],..._(`root`),...g})})});Pr.classes=jr,Pr.varsResolver=Nr,Pr.displayName=`@mantine/core/ProgressRoot`;var Fr={withAria:!0},Ir=d(e=>{let{classNames:n,className:r,style:i,styles:s,vars:l,value:u,withAria:d,color:f,striped:p,animated:m,mod:h,...g}=o(`ProgressSection`,Fr,e),_=Ar(),v=c(),y=d?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,"aria-valuetext":`${u}%`}:{};return(0,H.jsx)(t,{..._.getStyles(`section`,{className:r,classNames:n,styles:s,style:i}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${u}%`,"--progress-section-color":a(f,v),"--progress-label-color":Xt(_.autoContrast,v)?Te({color:f,theme:v,autoContrast:_.autoContrast}):void 0}})});Ir.classes=jr,Ir.displayName=`@mantine/core/ProgressSection`;var Lr=d(e=>{let t=o(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:s,striped:c,animated:l,"aria-label":u,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=D({classNames:r,styles:i,props:t});return(0,H.jsx)(Pr,{classNames:f,styles:p,vars:a,...d,children:(0,H.jsx)(Ir,{value:n,color:s,striped:c,animated:l,"aria-label":u})})});Lr.classes=jr,Lr.displayName=`@mantine/core/Progress`,Lr.Section=Ir,Lr.Root=Pr,Lr.Label=Mr;var Rr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},zr={withItemsBorders:!0},Br=f((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:L(t),"--sc-color":n?a(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":k(i,`sc-padding`),"--sc-font-size":M(i)}})),Vr=i(n=>{let r=o(`SegmentedControl`,zr,n),{classNames:i,className:a,style:s,styles:l,unstyled:u,vars:d,data:f,value:p,defaultValue:m,onChange:h,size:g,name:v,disabled:y,readOnly:b,fullWidth:x,orientation:C,radius:w,color:T,transitionDuration:E,transitionTimingFunction:D,variant:O,autoContrast:k,withItemsBorders:A,mod:j,attributes:M,ref:N,...P}=r,F=e({name:`SegmentedControl`,props:r,classes:Rr,className:a,style:s,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:Br}),I=c(),L=f.map(e=>Kt(e)?{label:`${e}`,value:e}:e),te=Gt(),[ne,re]=(0,V.useState)(_()),[ie,ae]=(0,V.useState)(null),[R,oe]=(0,V.useState)({}),z=(e,t)=>{e!==null&&R[t]!==e&&(R[t]=e,oe({...R}))},[B,ce]=se({value:p,defaultValue:m,finalValue:Array.isArray(f)?L.find(e=>!e.disabled)?.value??f[0]?.value??null:null,onChange:h}),le=ee(v),ue=L.map(e=>`${e.value}`),de=L.map(e=>(0,V.createElement)(t,{...F(`control`),mod:{active:B===e.value,orientation:C},key:`${e.value}`},(0,V.createElement)(`input`,{...F(`input`),disabled:y||e.disabled,type:`radio`,name:le,value:`${e.value}`,id:`${le}-${e.value}`,checked:B===e.value,onChange:()=>!b&&ce(e.value),"data-focus-ring":I.focusRing,key:`${e.value}-input`}),(0,V.createElement)(t,{component:`label`,...F(`label`),mod:{active:B===e.value&&!(y||e.disabled),disabled:y||e.disabled,"read-only":b},htmlFor:`${le}-${e.value}`,ref:t=>z(t,`${e.value}`),__vars:{"--sc-label-color":T===void 0?void 0:Te({color:T,theme:I,autoContrast:k})},key:`${e.value}-label`},(0,H.jsx)(`span`,{...F(`innerLabel`),children:e.label})))),fe=S(N,ae);return Vt(()=>{re(_())},[f.length]),Vt(()=>{oe(e=>{let t={};return ue.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ue]),f.length===0?null:(0,H.jsxs)(t,{...F(`root`),variant:O,size:g,ref:fe,mod:[{"full-width":x,orientation:C,initialized:te,"with-items-borders":A},j],...P,role:`radiogroup`,"data-disabled":y,children:[B!==void 0&&(0,H.jsx)(tn,{target:R[`${B}`],parent:ie,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...F(`indicator`)},ne),de]})});Vr.classes=Rr,Vr.varsResolver=Br,Vr.displayName=`@mantine/core/SegmentedControl`;var Hr={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Ur=i(e=>{let t=o([`Input`,`InputWrapper`,`Select`],Hr,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,floatingHeight:k,size:j,searchable:M,rightSection:N,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:B,clearable:ce,clearSectionMode:le,clearButtonProps:ue,hiddenInputProps:de,renderOption:fe,onClear:pe,autoComplete:me,scrollAreaProps:he,__defaultRightSection:ge,__clearSection:_e,__clearable:ve,chevronColor:ye,autoSelectOnBlur:be,openOnFocus:xe,attributes:Se,...Ce}=t,we=(0,V.useMemo)(()=>hn(h),[h]),Te=(0,V.useRef)({}),Ee=(0,V.useMemo)(()=>gn(we),[we]),De=ee(B),[Oe,ke,Ae]=se({value:g,defaultValue:_,finalValue:null,onChange:m}),je=Oe==null?void 0:`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`],Me=Ut(je),[Ne,Pe,Fe]=se({value:re,defaultValue:ie,finalValue:je?je.label:``,onChange:ae}),Ie=Wn({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Ie.selectFirstOption():Ie.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Ie.resetSelectedOption,0)}}),Le=e=>{Pe(e),Ie.resetSelectedOption()},{resolvedClassNames:Re,resolvedStyles:ze}=D({props:t,styles:r,classNames:n});(0,V.useEffect)(()=>{v&&Ie.selectFirstOption()},[v,Ne]),(0,V.useEffect)(()=>{g===null&&Le(``),g!=null&&je&&(Me?.value!==je.value||Me?.label!==je.label)&&Le(je.label)},[g,je]),(0,V.useEffect)(()=>{!Ae&&!Fe&&Le(Oe==null?``:`${Oe}`in Ee?Ee[`${Oe}`]?.label:Te.current[`${Oe}`]?.label||``)},[Ee,Oe]),(0,V.useEffect)(()=>{Oe&&`${Oe}`in Ee&&(Te.current[`${Oe}`]=Ee[`${Oe}`])},[Ee,Oe]);let Be=(0,H.jsx)(qn.ClearButton,{...ue,onClear:()=>{ke(null,null),Le(``),pe?.()}}),Ve=ce&&Oe!=null&&!C&&!S;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(qn,{store:Ie,__staticSelector:`Select`,classNames:Re,styles:ze,unstyled:i,readOnly:S,size:j,attributes:Se,floatingHeight:k,keepMounted:be,onOptionSubmit:e=>{b?.(e);let t=R&&`${Ee[e].value}`==`${Oe}`?null:Ee[e],n=t?t.value:null;n!==Oe&&ke(n,t),!Ae&&Le(n==null?``:t?.label||``),Ie.closeDropdown()},...x,children:[(0,H.jsx)(qn.Target,{targetType:M?`input`:`button`,autoComplete:me,withExpandedAttribute:!0,children:(0,H.jsx)(A,{id:De,__defaultRightSection:(0,H.jsx)(qn.Chevron,{size:j,error:oe,unstyled:i,color:ye}),__clearSection:Be,__clearable:Ve,__clearSectionMode:le,rightSection:N,rightSectionPointerEvents:z||`none`,...Ce,size:j,__staticSelector:`Select`,disabled:C,readOnly:S||!M,value:Ne,onChange:e=>{if(lr(e)){if(!S){let t=Cr(Ee,e.currentTarget.value);t&&`${t.value}`!=`${Oe}`&&(ke(t.value,t),!Ae&&Le(t.label))}return}Le(e.currentTarget.value),Ie.openDropdown(),v&&Ie.selectFirstOption()},onFocus:e=>{xe&&M&&Ie.openDropdown(),d?.(e)},onBlur:e=>{be&&Ie.clickSelectedOption(),Ie.closeDropdown();let t=Oe!=null&&(`${Oe}`in Ee?Ee[`${Oe}`]:Te.current[`${Oe}`]);Le(t&&t.label||``),f?.(e)},onClick:e=>{M?Ie.openDropdown():Ie.toggleDropdown(),p?.(e)},classNames:Re,styles:ze,unstyled:i,pointer:!M,error:oe,attributes:Se})}),(0,H.jsx)(ir,{data:we,hidden:S||C,filter:w,search:Ne,limit:T,hiddenWhenEmpty:!L,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!M&&je?.label!==Ne,value:Oe,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:L,unstyled:i,labelId:Ce.label?`${De}-label`:void 0,"aria-label":Ce.label?void 0:Ce[`aria-label`],renderOption:fe,scrollAreaProps:he})]}),(0,H.jsx)(qn.HiddenInput,{value:Oe,name:te,form:ne,disabled:C,...de})]})});Ur.classes={...A.classes,...qn.classes},Ur.displayName=`@mantine/core/Select`;function Wr(e){if(e!==void 0)return typeof e==`number`?P(e):e}function Gr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=c(),s=t===void 0?e:t,l=r!==void 0,u=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(s)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),d=E(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(s[r])),!l&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),f=Le(E(d),o.breakpoints).filter(e=>E(d[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:d[e.value]}));return(0,H.jsx)(O,{styles:u,media:f,selector:a})}function Kr(e){return typeof e==`object`&&e?E(e):[]}function qr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return qr(Array.from(new Set([...Kr(e),...Kr(t),...r===void 0?Kr(n):[]])))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=x({"--sg-spacing-x":ne(Lt(e)),"--sg-spacing-y":ne(Lt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":Lt(n)?.toString()}}),l=Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=ne(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=ne(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,H.jsx)(O,{styles:c,container:d,selector:a})}var Xr={container:`m_925c2d2c`,root:`m_2415a157`},Zr={cols:1,spacing:`md`,type:`media`},Qr=d(n=>{let i=o(`SimpleGrid`,Zr,n),{classNames:a,className:s,style:c,styles:l,unstyled:u,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=i,x=e({name:`SimpleGrid`,classes:Xr,props:i,className:s,style:c,classNames:a,styles:l,unstyled:u,attributes:y,vars:d}),S=r(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yr,{...i,selector:`.${S}`}),(0,H.jsx)(`div`,{...x(`container`),children:(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gr,{...i,selector:`.${S}`}),(0,H.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});Qr.classes=Xr,Qr.displayName=`@mantine/core/SimpleGrid`;var $r=(0,V.createContext)(null),ei={hiddenInputValuesSeparator:`,`},ti=i((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:s,readOnly:c,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=o(`SwitchGroup`,ei,e),[h,g]=se({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(c)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(u);return(0,H.jsx)($r,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,H.jsxs)(T.Wrapper,{size:i,...a,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,H.jsx)(Jn,{role:`group`,children:s}),(0,H.jsx)(`input`,{type:`hidden`,name:l,value:y,...d})]})})}));ti.classes=T.Wrapper.classes,ti.displayName=`@mantine/core/SwitchGroup`;var ni={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ri={labelPosition:`right`,withThumbIndicator:!0},ii=f((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:L(t),"--switch-height":k(r,`switch-height`),"--switch-width":k(r,`switch-width`),"--switch-thumb-size":k(r,`switch-thumb-size`),"--switch-label-font-size":k(r,`switch-label-font-size`),"--switch-track-label-padding":k(r,`switch-track-label-padding`),"--switch-color":n?a(n,e):void 0}})),ai=d(n=>{let r=o(`Switch`,ri,n),{classNames:i,className:a,style:c,styles:l,unstyled:u,vars:d,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=r,P=(0,V.use)($r),F=_||P?.size,I=e({name:`Switch`,props:r,classes:ni,className:a,style:c,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:ii}),{styleProps:L,rest:te}=s(N),ne=ee(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=se({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,H.jsxs)(Zn,{...I(`root`),__staticSelector:`Switch`,__stylesApiProps:r,id:ne,size:F,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:i,styles:l,unstyled:u,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...L,...y,children:[(0,H.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...I(`input`)}),(0,H.jsxs)(t,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...I(`track`),children:[(0,H.jsx)(t,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...I(`thumb`),children:b}),(0,H.jsx)(`span`,{...I(`trackLabel`),children:R?h:m})]})]})});ai.classes={...ni,...Xn},ai.varsResolver=ii,ai.displayName=`@mantine/core/Switch`,ai.Group=ti;var oi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),si=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),ci=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),li=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),ui=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),di=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),fi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),pi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),hi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),gi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),_i=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),vi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),yi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:oi}));yi.displayName=`ArrowClockwiseIcon`;var bi=yi,xi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:si}));xi.displayName=`ArrowCounterClockwiseIcon`;var Si=xi,Ci=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ci}));Ci.displayName=`ArrowsOutIcon`;var wi=Ci,Ti=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:li}));Ti.displayName=`CaretUpIcon`;var Ei=Ti,Di=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:ui}));Di.displayName=`ChatCircleTextIcon`;var Oi=Di,ki=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:di}));ki.displayName=`ClockIcon`;var Ai=ki,ji=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:fi}));ji.displayName=`ClockCounterClockwiseIcon`;var Mi=ji,Ni=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:pi}));Ni.displayName=`InfoIcon`;var Pi=Ni,Fi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:mi}));Fi.displayName=`KeyboardIcon`;var Ii=Fi,Li=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:hi}));Li.displayName=`ListBulletsIcon`;var Ri=Li,zi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:gi}));zi.displayName=`ListMagnifyingGlassIcon`;var Bi=zi,Vi=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:_i}));Vi.displayName=`MagnifyingGlassMinusIcon`;var Hi=Vi,Ui=V.forwardRef((e,t)=>V.createElement(g,{ref:t,...e,weights:vi}));Ui.displayName=`WrenchIcon`;var Wi=Ui,Gi=n(z(),1),Ki=`$__all`;function qi(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ji(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Yi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=qi(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Ji(r,u,s[0]),f=Ji(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Xi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=qi(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=$i(d,0,s-r),f=$i(f,0,l-i),{x:d,y:f}}function Zi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=qi(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Qi(e,t,n){let{margin:r,rowHeight:i}=e,a=qi(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function $i(e,t,n){return Math.max(Math.min(e,n),t)}function ea(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ta(e,t){for(let n=0;nea(e,t))}function ra(e,t){return t===`horizontal`?aa(e):t===`vertical`||t===`wrap`?ia(e):[...e]}function ia(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function aa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function oa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function sa(e,t){for(let n=0;ne.static===!0)}function la(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ua(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;ta(n,i);)i.y++}}return e}function ma(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=ra(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=na(d,t),p=f.length>0;if(p&&c)return ua(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ma(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ma(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return ma(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ma(e,n,l,u,r,c,i)}function ga(e,t,n){return Math.max(t,Math.min(n,e))}var _a=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:ga(t,0,Math.max(0,r-e.w)),y:ga(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:ga(t,1,Math.max(1,o)),h:ga(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:ga(t,e.minW??1,e.maxW??1/0),h:ga(n,e.minH??1,e.maxH??1/0)}}}];function va(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ya(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ba({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function xa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Sa(e){return e*100+`%`}function Ca(e,t,n,r){return e+n>r?t:n}function wa(e,t,n){return e<0?t:n}function Ta(e){return Math.max(0,e)}function Ea(e){return Math.max(0,e)}var Da=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:wa(o,e.height,i),top:Ea(o)}},Oa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Ca(e.left,e.width,o,n),left:Ta(i)}},ka=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Ea(r),left:0}:{height:i,width:a,top:Ea(r),left:o}},Aa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:wa(r,e.height,a),top:Ea(r)}},ja={n:Da,ne:(e,t,n)=>Da(e,Oa(e,t,n)),e:Oa,se:(e,t,n)=>Aa(e,Oa(e,t,n)),s:Aa,sw:(e,t,n)=>Aa(e,ka(e,t)),w:ka,nw:(e,t,n)=>Da(e,ka(e,t))};function Ma(e,t,n,r){let i=ja[e];return i?i(t,{...t,...n},r):n}var Na={type:`transform`,scale:1,calcStyle(e){return ba(e)}},Pa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Fa={enabled:!0,bounded:!1,threshold:3},Ia={enabled:!0,handles:[`se`]},La={enabled:!1,defaultItem:{w:1,h:1}};function Ra(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??ca(e).length>0;for(let i=o+1;it.y+t.h)break;ea(t,o)&&Ra(e,o,n+t[a],r,s)}}t[r]=n}function za(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!ta(e,t);)t.y--;let i;for(;(i=ta(e,t))!==void 0;)Ra(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Ba(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!ta(e,t);)t.x--;let i;for(;(i=ta(e,t))!==void 0;)if(Ra(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!ta(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Va={type:`vertical`,allowOverlap:!1,compact(e,t){let n=ca(e),r=oa(n),i=ia(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ya(e,t){let n=Ja(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Xa(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Za(e,t,n,r,i,a){let o=e[n];if(o)return ua(o);let s=e[r],c=Ja(t),l=c.slice(c.indexOf(n));for(let t=0;t{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),eo=R(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),to=R(((e,t)=>{var n=eo();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),no=R(((e,t)=>{t.exports=to()()})),ro=n(no(),1);function io(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&io(e.changedTouches,e=>t===e.identifier)}function ko(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ao(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function jo(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ao();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&Po(e.body,`react-draggable-transparent-selection`)}function Mo(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{No(e)}):No(e)}function No(e){if(e)try{e.body&&Fo(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function Po(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Fo(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Io(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Uo(r);let i=Wo(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+so(s.paddingLeft)+so(o.marginLeft),top:-i.offsetTop+so(s.paddingTop)+so(o.marginTop),right:Co(a)-xo(i)-i.offsetLeft+so(s.paddingRight)-so(o.marginRight),bottom:So(a)-bo(i)-i.offsetTop+so(s.paddingBottom)-so(o.marginBottom)}}return oo(r.right)&&(t=Math.min(t,r.right)),oo(r.bottom)&&(n=Math.min(n,r.bottom)),oo(r.left)&&(t=Math.max(t,r.left)),oo(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Lo(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ro(e){return e.props.axis===`both`||e.props.axis===`x`}function zo(e){return e.props.axis===`both`||e.props.axis===`y`}function Bo(e,t,n){let r=typeof t==`number`?Oo(e,t):null;if(typeof t==`number`&&!r)return null;let i=Wo(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return wo(r||e,a,n.props.scale)}function Vo(e,t,n){let r=!oo(e.lastX),i=Wo(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ho(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Uo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Wo(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Go=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ko={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},qo=Ko.mouse,Jo=class extends V.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!_o(e.target,this.props.handle,t)||this.props.cancel&&_o(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ko(e);this.touchIdentifier=r;let i=Bo(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Vo(this,a,o);Go(`DraggableCore: handleDragStart: %j`,s),Go(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&jo(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,vo(n,qo.move,this.handleDrag),vo(n,qo.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Lo(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(Go(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Lo(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Mo(a.ownerDocument),Go(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Go(`DraggableCore: Removing handlers`),yo(a.ownerDocument,qo.move,this.handleDrag),yo(a.ownerDocument,qo.stop,this.handleDragStop))},this.onMouseDown=e=>(qo=Ko.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(qo=Ko.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(qo=Ko.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(qo=Ko.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&vo(e,Ko.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;yo(t,Ko.mouse.move,this.handleDrag),yo(t,Ko.touch.move,this.handleDrag),yo(t,Ko.mouse.stop,this.handleDragStop),yo(t,Ko.touch.stop,this.handleDragStop),yo(e,Ko.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Mo(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Go(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return V.cloneElement(V.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Jo.displayName=`DraggableCore`,Jo.propTypes={allowAnyClick:ro.default.bool,allowMobileScroll:ro.default.bool,children:ro.default.node.isRequired,disabled:ro.default.bool,enableUserSelectHack:ro.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:ro.default.arrayOf(ro.default.number),handle:ro.default.string,cancel:ro.default.string,nodeRef:ro.default.object,nonce:ro.default.string,onStart:ro.default.func,onDrag:ro.default.func,onStop:ro.default.func,onMouseDown:ro.default.func,scale:ro.default.number,className:co,style:co,transform:co},Jo.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Yo=class extends V.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Go(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Ho(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Go(`Draggable: onDrag: %j`,t);let n=Ho(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Io(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,Ho(this,t))===!1)return!1;Go(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Go(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,m=!s||this.state.dragging,h=s||r,g={x:Ro(this)&&m?this.state.x:h.x,y:zo(this)&&m?this.state.y:h.y};this.state.isElementSVG?f=Eo(g,c):d=To(g,c);let _=V.Children.only(n),v=p(_.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return V.createElement(Jo,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},V.cloneElement(_,{className:v,style:{..._.props.style,...d},transform:f}))}};Yo.displayName=`Draggable`,Yo.propTypes={...Jo.propTypes,axis:ro.default.oneOf([`both`,`x`,`y`,`none`]),bounds:ro.default.oneOfType([ro.default.shape({left:ro.default.number,right:ro.default.number,top:ro.default.number,bottom:ro.default.number}),ro.default.string,ro.default.oneOf([!1])]),defaultClassName:ro.default.string,defaultClassNameDragging:ro.default.string,defaultClassNameDragged:ro.default.string,defaultPosition:ro.default.shape({x:ro.default.number,y:ro.default.number}),positionOffset:ro.default.shape({x:ro.default.oneOfType([ro.default.number,ro.default.string]),y:ro.default.oneOfType([ro.default.number,ro.default.string])}),position:ro.default.shape({x:ro.default.number,y:ro.default.number}),className:co,style:co,transform:co},Yo.defaultProps={...Jo.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Xo=R(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>we,default:()=>Te}),t.exports=d(f);var p=u(v()),m=u(no()),h=u(z()),g=Xo();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function ie(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ae(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function R(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??ae();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} diff --git a/internal/ui/dist/assets/routes-CmpBxgdE.js b/internal/ui/dist/assets/routes-dVrgKMot.js similarity index 74% rename from internal/ui/dist/assets/routes-CmpBxgdE.js rename to internal/ui/dist/assets/routes-dVrgKMot.js index f3b3d3f8a..bb038f515 100644 --- a/internal/ui/dist/assets/routes-CmpBxgdE.js +++ b/internal/ui/dist/assets/routes-dVrgKMot.js @@ -1 +1 @@ -import{vt as e}from"./brand-oskFJPNW.js";import{n as t,u as n}from"./auth-CQerCjF_.js";var r=e();function i(){let{agent_available:e}=t();return e?(0,r.jsx)(n,{to:`/chat`,replace:!0}):(0,r.jsx)(n,{to:`/dashboards`,replace:!0})}export{i as component}; \ No newline at end of file +import{vt as e}from"./brand-oskFJPNW.js";import{n as t,u as n}from"./auth-BLat7TXI.js";var r=e();function i(){let{agent_available:e}=t();return e?(0,r.jsx)(n,{to:`/chat`,replace:!0}):(0,r.jsx)(n,{to:`/dashboards`,replace:!0})}export{i as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/settings-Civ3-rvD.js b/internal/ui/dist/assets/settings-BZC7Pr0f.js similarity index 98% rename from internal/ui/dist/assets/settings-Civ3-rvD.js rename to internal/ui/dist/assets/settings-BZC7Pr0f.js index 5d5fe4a7b..f055340c0 100644 --- a/internal/ui/dist/assets/settings-Civ3-rvD.js +++ b/internal/ui/dist/assets/settings-BZC7Pr0f.js @@ -1,4 +1,4 @@ -import{C as e,Ct as t,M as n,_ as r,a as i,bt as a,c as o,d as s,f as c,i as l,o as u,p as d,r as f,vt as p,x as m,y as h}from"./brand-oskFJPNW.js";import{c as g,i as _,r as v,s as y}from"./auth-CQerCjF_.js";import{t as b}from"./Tooltip-2jTVpG2Y.js";import{E as x,T as S,t as C}from"./useQuery-BynlWFEG.js";import{n as w,r as T,t as E}from"./WarningCircle.es-CsY2RrOb.js";import{i as D,r as O}from"./index-G9N3n5OB.js";var k=t(a(),1);function A(e={}){let t=e.timeout??2e3,[n,r]=(0,k.useState)(null),[i,a]=(0,k.useState)(!1),o=(0,k.useRef)(null);(0,k.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]);let s=e=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),s(!0)}).catch(e=>r(e)):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{a(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}var j=p(),M={timeout:1e3};function N(e){let{children:t,timeout:r,value:i,...a}=n(`CopyButton`,M,e),o=A({timeout:r});return(0,j.jsx)(j.Fragment,{children:t({copy:()=>o.copy(i),copied:o.copied,...a})})}N.displayName=`@mantine/core/CopyButton`;var P=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),F=k.forwardRef((e,t)=>k.createElement(i,{ref:t,...e,weights:P}));F.displayName=`ArrowsClockwiseIcon`;var I=F,L=[`settings`,`ingest`];function R(e,t){let n=e.trim();return t||/^https:\/\//i.test(n)||/:443$/.test(n)}function z(e,t,n){if(/^https?:\/\//i.test(e.trim()))try{let t=new URL(e);e=`${t.protocol}//${t.hostname}:${t.port||(t.protocol===`https:`?`443`:`80`)}`}catch{}let r=R(e,n)?``:` +import{C as e,Ct as t,M as n,_ as r,a as i,bt as a,c as o,d as s,f as c,i as l,o as u,p as d,r as f,vt as p,x as m,y as h}from"./brand-oskFJPNW.js";import{c as g,i as _,r as v,s as y}from"./auth-BLat7TXI.js";import{t as b}from"./Tooltip-2jTVpG2Y.js";import{E as x,T as S,t as C}from"./useQuery-BynlWFEG.js";import{n as w,r as T,t as E}from"./WarningCircle.es-CsY2RrOb.js";import{i as D,r as O}from"./index-ZMM27O4I.js";var k=t(a(),1);function A(e={}){let t=e.timeout??2e3,[n,r]=(0,k.useState)(null),[i,a]=(0,k.useState)(!1),o=(0,k.useRef)(null);(0,k.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]);let s=e=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),s(!0)}).catch(e=>r(e)):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{a(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}var j=p(),M={timeout:1e3};function N(e){let{children:t,timeout:r,value:i,...a}=n(`CopyButton`,M,e),o=A({timeout:r});return(0,j.jsx)(j.Fragment,{children:t({copy:()=>o.copy(i),copied:o.copied,...a})})}N.displayName=`@mantine/core/CopyButton`;var P=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),F=k.forwardRef((e,t)=>k.createElement(i,{ref:t,...e,weights:P}));F.displayName=`ArrowsClockwiseIcon`;var I=F,L=[`settings`,`ingest`];function R(e,t){let n=e.trim();return t||/^https:\/\//i.test(n)||/:443$/.test(n)}function z(e,t,n){if(/^https?:\/\//i.test(e.trim()))try{let t=new URL(e);e=`${t.protocol}//${t.hostname}:${t.port||(t.protocol===`https:`?`443`:`80`)}`}catch{}let r=R(e,n)?``:` tls: insecure: true`;return`exporters: otlp/fanout: diff --git a/internal/ui/dist/assets/theme-BKAYKhPv.js b/internal/ui/dist/assets/theme-ByHk_Blp.js similarity index 99% rename from internal/ui/dist/assets/theme-BKAYKhPv.js rename to internal/ui/dist/assets/theme-ByHk_Blp.js index 322da032f..ec169c88b 100644 --- a/internal/ui/dist/assets/theme-BKAYKhPv.js +++ b/internal/ui/dist/assets/theme-ByHk_Blp.js @@ -1 +1 @@ -import{A as e,C as t,Ct as n,G as r,J as i,M as a,P as o,S as s,T as c,X as l,Y as u,a as d,b as f,bt as p,ct as m,et as h,gt as g,h as _,j as v,lt as y,nt as b,pt as x,q as S,rt as C,st as w,tt as T,vt as E,w as D,z as O}from"./brand-oskFJPNW.js";import{d as k,f as A,i as ee,l as j,o as M}from"./auth-CQerCjF_.js";import{B as te,C as ne,I as re,g as N,h as P,v as ie,w as ae}from"./preload-helper-DOsq4iEA.js";import{n as oe,t as F}from"./get-single-element-child-D7qmWU2f.js";import{C as se,E as I,T as L,_ as ce,a as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,l as ge,m as _e,n as ve,o as ye,p as be,r as xe,s as Se,u as Ce,v as we,x as R,y as Te}from"./Tooltip-2jTVpG2Y.js";import{r as Ee}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{A as De,D as Oe,I as ke,M as Ae,N as z,O as je,P as Me,R as Ne,j as Pe,k as Fe}from"./useQuery-BynlWFEG.js";import{t as Ie}from"./FocusTrap-yVpiEwpv.js";function Le(){throw Error(`Invariant failed`)}var Re=`__root__`;function ze(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Be(e){return e instanceof Response&&!!e.options}var Ve=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Re:this.parentRoute||Le();let r=n?Re:t?.path;r&&r!==`/`&&(r=ne(r));let i=t?.id||r,a=n?Re:ie((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:ie(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ae(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ze({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},He=class extends Ve{constructor(e){super(e)}},B=n(p(),1),Ue=B.createContext(void 0),We=B.createContext(void 0);function Ge({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ke(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var qe=[],Je=0,{link:Ye,unlink:Xe,propagate:Ze,checkDirty:Qe,shallowPropagate:$e}=Ge({update(e){return e._update()},notify(e){qe[tt++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,it(e))}}),et=0,tt=0,V,nt=0;function rt(e){try{++nt,e()}finally{--nt||at()}}function it(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Xe(n,e)}function at(){if(!(nt>0)){for(;et{i.get(),n.current?(V=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=V,o=t?.compare??Object.is;if(n)V=i,++Je,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{V=a,n&&(i.flags&=-5),it(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Qe(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&$e(e)}}else e&32&&(i.flags=e&-33);return V!==void 0&&Ye(i,V,Je),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ze(e),$e(e),at())}},i}function st(e){let t=()=>{let t=V;V=n,++Je,n.depsTail=void 0,n.flags=6;try{return e()}finally{V=t,n.flags&=-5,it(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Qe(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,it(this)}};return t(),n}var ct={};function lt(e,t){let n=B.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=te(n.current,i):i}}function H(e){let t=g(),n=B.useContext(e.from?We:Ue),r=e.from??n,i=t.stores.getMatchStore(r),a=lt(e,t),o=N(i,e=>e?a(e):ct);if(o!==ct)return o;(e.shouldThrow??!0)&&Le()}function ut(e){return H({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function dt(e){let{select:t,...n}=e;return H({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ft(e){return H({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function pt(e){return H({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mt(e){return H({...e,select:t=>e.select?e.select(t.context):t.context})}var U=E(),ht=class extends Ve{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function gt(e){return new ht(e)}var _t=class extends He{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function vt(e){return new _t(e)}function yt(e){return e=>{let t=gt(e);return t.isRoot=!1,t}}function bt(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(re(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(A)A(a());else throw a()}return B.createElement(r,e)};return o.preload=a,o}function xt(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function St(e){let t=xt(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function wt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function Tt(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(Ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Et(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=Tt(l,c,r),d=wt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[Tt(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[wt(c.length,c,!1)]?.focus()}}}function Ot(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Ee:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function W(e,t){return n=>{e?.(n),t?.(n)}}function kt(e,t){return e in t?St(t[e]):St(e)}function At(e,t){let n=e.map(e=>({value:e,px:kt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function jt(e,t,n){return n?Array.from(Ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Mt=[`mousedown`,`touchstart`];function Nt(e,t,n,r=!0,i=!1){let a=(0,B.useRef)(null),o=t||Mt,s=(0,B.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let i=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!i.includes(e))&&e(t):a.current&&!i.includes(a.current)&&e(t)}),c=o.join(`,`);return(0,B.useEffect)(()=>{if(!r)return;let e=c.split(`,`);return e.forEach(e=>document.addEventListener(e,s,i)),()=>{e.forEach(e=>document.removeEventListener(e,s,i))}},[c,r,i]),a}var Pt=[`mouse`,`touch`],Ft=10;function It(e,t={}){let{threshold:n=400,events:r=Pt,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,B.useRef)(!1),l=(0,B.useRef)(!1),u=(0,B.useRef)(-1),d=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>window.clearTimeout(u.current),[]);let f=r.join(`,`);return(0,B.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?Ft:i===!1?0:i,p=t=>{(zt(t)||Rt(t))&&(a&&a(t),d.current=Lt(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(zt(e)||Rt(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=Lt(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,f])}function Lt(e){if(Rt(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Rt(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function zt(e){return e.nativeEvent instanceof MouseEvent}function Bt({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&S({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Vt(e,t,n){return Bt({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function Ht(e,t){let n=e.colors[e.primaryColor];return r(n)?e.autoContrast?Vt(n,e,t):`var(--mantine-color-white)`:Bt({color:n[i(e,t)],theme:e,autoContrast:null})}function Ut({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,B.useRef)(-1),a=(0,B.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,B.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[Wt,Gt]=I(`Popover component was not found in the tree`);function Kt({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,B.useRef)(!1),s=(0,B.useRef)(!1),c=(0,B.useRef)(null),l=(0,B.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=W(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=W(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=It(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:W(e.onTouchStart,p.onTouchStart),onTouchEnd:W(e.onTouchEnd,p.onTouchEnd),onTouchCancel:W(e.onTouchCancel,p.onTouchCancel),onTouchMove:W(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function qt(e){let{children:t,disabled:n,longPressDelay:r}=a(`PopoverContextMenu`,null,e),i=F(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Gt(),s=Kt({childProps:i.props,disabled:n||o.disabled,opened:o.opened,longPressDelay:r,setReference:o.reference,open:()=>{o.opened||o.onToggle()}});return(0,B.cloneElement)(i,s)}qt.displayName=`@mantine/core/PopoverContextMenu`;var Jt={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Yt=c(e=>{let n=a(`PopoverDropdown`,null,e),{className:r,style:i,vars:o,children:s,onKeyDownCapture:c,variant:l,classNames:u,styles:d,ref:p,...m}=n,g=Gt(),{dir:_}=R(),v=g.arrowPosition===`merge`&&g.withArrow?le({position:g.placement,dir:_}):void 0,y=Ne({opened:g.opened,shouldReturnFocus:g.returnFocus}),b=g.withRoles?{"aria-labelledby":g.getTargetId(),id:g.getDropdownId(),role:`dialog`,tabIndex:-1}:{},S=h(p,g.floating);return g.disabled?null:(0,U.jsx)(ve,{...g.portalProps,withinPortal:g.withinPortal,children:(0,U.jsx)(f,{mounted:g.opened,...g.transitionProps,transition:g.transitionProps?.transition||`fade`,duration:g.transitionProps?.duration??150,keepMounted:g.keepMounted,keepMountedMode:g.keepMountedMode,exitDuration:typeof g.transitionProps?.exitDuration==`number`?g.transitionProps.exitDuration:g.transitionProps?.duration,children:e=>(0,U.jsx)(Ie,{active:g.trapFocus&&g.opened,innerRef:S,children:(0,U.jsxs)(t,{...b,...m,variant:l,onKeyDownCapture:Ot(()=>{g.onClose?.(),g.onDismiss?.()},{active:g.closeOnEscape,onTrigger:y,onKeyDown:c}),"data-position":g.placement,"data-fixed":g.floatingStrategy===`fixed`||void 0,...g.getStyles(`dropdown`,{className:r,props:n,classNames:u,styles:d,style:[{...e,...v,zIndex:g.zIndex,top:g.y??0,left:g.x??0,width:g.width===`target`?void 0:x(g.width),...g.referenceHidden?{display:`none`}:null},g.resolvedStyles?.dropdown,d?.dropdown,i]}),children:[s,(0,U.jsx)(he,{ref:g.arrowRef,arrowX:g.arrowX,arrowY:g.arrowY,visible:g.withArrow,position:g.placement,arrowSize:g.arrowSize,arrowRadius:g.arrowRadius,arrowOffset:g.arrowOffset,arrowPosition:g.arrowPosition,...g.getStyles(`arrow`,{props:n,classNames:u,styles:d})})]})})})})});Yt.classes=Jt,Yt.displayName=`@mantine/core/PopoverDropdown`;var Xt={refProp:`ref`,popupType:`dialog`},Zt=c(e=>{let{children:t,refProp:n,popupType:r,ref:i,...o}=a(`PopoverTarget`,Xt,e),s=F(t);if(!s)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let c=o,l=Gt(),d=h(l.reference,se(s),i),f=l.withRoles?{"aria-haspopup":r,"aria-expanded":l.opened,"aria-controls":l.opened?l.getDropdownId():void 0,id:l.getTargetId()}:{},p=s.props;return(0,B.cloneElement)(s,{...c,...f,...l.targetProps,className:u(l.targetProps.className,c.className,p.className),[n]:d,...l.controlled?null:{onClick:e=>{l.onToggle(),p.onClick?.(e)}}})});Zt.displayName=`@mantine/core/PopoverTarget`;function Qt(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function $t(e,t,n,r){let i=Qt(e.middlewares),a=[pe(e.offset),be()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(fe(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(ce(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:me(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?_e():_e(i.inline)),a.push(de({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(we({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function en(e){let[t,n]=j({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,B.useRef)(t),i=(0,B.useRef)(!1),[a,o]=(0,B.useState)(null),s=e.preventPositionChangeWhenVisible!==!1,c=(0,B.useRef)(t);t!==c.current&&(c.current=t,t&&a!==null&&o(null));let l=(0,B.useRef)(e.position);e.position!==l.current&&(l.current=e.position,i.current=!1,a!==null&&o(null));let u=(0,B.useCallback)(()=>o(null),[]),d=()=>{t&&!e.disabled&&n(!1)},f=()=>{e.disabled||n(!t)},p=ue({open:t,strategy:e.strategy,placement:s?a??e.position:e.position,middleware:$t(e,()=>p,s&&a!==null,s),whileElementsMounted:e.keepMounted?void 0:Te});(0,B.useEffect)(()=>{if(!e.keepMounted)return;let n=p.refs.reference.current,r=p.refs.floating.current;if(t&&n&&r)return Te(n,r,p.update)},[e.keepMounted,t,p.update,p.elements.reference,p.elements.floating]),C(()=>{if(!t){i.current=!1;return}if(!s||a!==null)return;let e=p.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!i.current){i.current=!0,p.update();return}p.isPositioned&&o(p.placement)}},[s,t,p.isPositioned,p.placement,a,p.update]);let m=(0,B.useRef)(p.placement);return C(()=>{m.current!==p.placement&&(m.current=p.placement,e.onPositionChange?.(p.placement))},[p.placement]),b(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:p,controlled:typeof e.opened==`boolean`,opened:t,onClose:d,onToggle:f,resetLockedPlacement:u}}var tn={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:L(`popover`),__staticSelector:`Popover`,width:`max-content`},nn=l((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:w(t),"--popover-shadow":m(n)}}));function G(t){let n=a(`Popover`,tn,t),{children:r,position:i,offset:o,onPositionChange:s,opened:c,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:p,middlewares:m,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,unstyled:x,classNames:S,styles:C,closeOnClickOutside:w,withinPortal:E,portalProps:D,closeOnEscape:k,clickOutsideEvents:A,trapFocus:ee,onClose:j,onDismiss:M,onOpen:te,onChange:ne,zIndex:re,radius:N,shadow:P,id:ie,defaultOpened:ae,__staticSelector:oe,withRoles:F,disabled:se,returnFocus:I,variant:L,keepMounted:ce,keepMountedMode:le,vars:ue,floatingStrategy:de,withOverlay:fe,overlayProps:pe,hideDetached:me,attributes:he,preventPositionChangeWhenVisible:ge,..._e}=n,ye=e({name:oe,props:n,classes:Jt,classNames:S,styles:C,unstyled:x,attributes:he,rootSelector:`dropdown`,vars:ue,varsResolver:nn}),{resolvedStyles:be}=v({classNames:S,styles:C,props:n}),Se=(0,B.useRef)(null),[Ce,we]=(0,B.useState)(null),[Te,Ee]=(0,B.useState)(null),{dir:De}=R(),Oe=O(),Ae=T(ie),z=en({middlewares:m,width:p,position:xe(De,i),offset:typeof o==`number`?o+(h?g/2:0):o,arrowRef:Se,arrowOffset:_,onPositionChange:s,opened:c,defaultOpened:ae,onChange:ne,onOpen:te,onClose:j,onDismiss:M,strategy:de,disabled:se,preventPositionChangeWhenVisible:ge,keepMounted:ce});Nt(()=>{w&&(z.onClose(),M?.())},A,[Ce,Te]);let je=(0,B.useCallback)(e=>{we(e),z.floating.refs.setReference(e)},[z.floating.refs.setReference]),Me=(0,B.useCallback)(e=>{Ee(e),z.floating.refs.setFloating(e)},[z.floating.refs.setFloating]),Ne=(0,B.useCallback)(()=>{l?.onExited?.(),u?.(),z.resetLockedPlacement()},[l?.onExited,u,z.resetLockedPlacement]),Pe=(0,B.useCallback)(()=>{l?.onEntered?.(),d?.()},[l?.onEntered,d]);return(0,U.jsxs)(Wt,{value:{returnFocus:I,disabled:se,controlled:z.controlled,reference:je,floating:Me,x:z.floating.x,y:z.floating.y,arrowX:z.floating?.middlewareData?.arrow?.x,arrowY:z.floating?.middlewareData?.arrow?.y,opened:z.opened,arrowRef:Se,transitionProps:{...l,onExited:Ne,onEntered:Pe},width:p,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,placement:z.floating.placement,trapFocus:ee,withinPortal:E,portalProps:D,zIndex:re,radius:N,shadow:P,closeOnEscape:k,onDismiss:M,onClose:z.onClose,onToggle:z.onToggle,getTargetId:()=>Ae,getDropdownId:()=>`${Ae}-dropdown`,withRoles:F,targetProps:_e,__staticSelector:oe,classNames:S,styles:C,unstyled:x,variant:L,keepMounted:ce,keepMountedMode:le,getStyles:ye,resolvedStyles:be,floatingStrategy:de,referenceHidden:me&&Oe!==`test`?z.floating.middlewareData.hide?.referenceHidden:!1},children:[r,fe&&(0,U.jsx)(f,{transition:`fade`,mounted:z.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:e=>(0,U.jsx)(ve,{withinPortal:E,children:(0,U.jsx)(ke,{...pe,...ye(`overlay`,{className:pe?.className,style:[e,pe?.style]})})})})]})}G.Target=Zt,G.Dropdown=Yt,G.ContextMenu=qt,G.varsResolver=nn,G.displayName=`@mantine/core/Popover`,G.extend=e=>e,G.withProps=e=>{let t=t=>(0,U.jsx)(G,{...e,...t});return t.extend=G.extend,t.displayName=`WithProps(${G.displayName})`,t};function rn({style:e,size:t=16,...n}){return(0,U.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:x(t),height:x(t),display:`block`},...n,children:(0,U.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}rn.displayName=`@mantine/core/AccordionChevron`;function an({size:e,style:t,...n}){let r=e===void 0?t:{width:x(e),height:x(e),...t};return(0,U.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,U.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var[on,K]=I(`Drawer component was not found in tree`),q={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},sn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerBody`,null,e),c=K();return(0,U.jsx)(z,{...c.getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...s})});sn.classes=q,sn.displayName=`@mantine/core/DrawerBody`;var cn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerCloseButton`,null,e),c=K();return(0,U.jsx)(Ae,{...c.getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...s})});cn.classes=q,cn.displayName=`@mantine/core/DrawerCloseButton`;var ln=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,radius:c,__hidden:l,...u}=a(`DrawerContent`,null,e),d=K(),f=d.scrollAreaComponent||Oe;return(0,U.jsx)(Pe,{...d.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:d.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...u,radius:c||d.radius||0,"data-hidden":l||void 0,children:(0,U.jsx)(f,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:s})})});ln.classes=q,ln.displayName=`@mantine/core/DrawerContent`;var un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerHeader`,null,e),c=K();return(0,U.jsx)(De,{...c.getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...s})});un.classes=q,un.displayName=`@mantine/core/DrawerHeader`;var dn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerOverlay`,null,e),c=K();return(0,U.jsx)(Fe,{...c.getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...s})});dn.classes=q,dn.displayName=`@mantine/core/DrawerOverlay`;function fn(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function pn(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var mn={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},hn={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},gn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),position:`left`},_n=l((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":y(n,`drawer-size`),"--drawer-flex":pn(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":fn(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":x(r)}})),vn=c(t=>{let n=a(`DrawerRoot`,gn,t),{classNames:r,className:i,style:o,styles:s,unstyled:c,vars:l,scrollAreaComponent:u,position:d,transitionProps:f,radius:p,attributes:m,...h}=n,{dir:g}=R(),_=e({name:`Drawer`,classes:q,props:n,className:i,style:o,classNames:r,styles:s,unstyled:c,attributes:m,vars:l,varsResolver:_n}),v=(g===`rtl`?hn:mn)[d];return(0,U.jsx)(on,{value:{scrollAreaComponent:u,getStyles:_,radius:p},children:(0,U.jsx)(Me,{..._(`root`),transitionProps:{transition:v,...f},"data-offset-scrollbars":u===ye.Autosize||void 0,unstyled:c,...h})})});vn.classes=q,vn.varsResolver=_n,vn.displayName=`@mantine/core/DrawerRoot`;var yn=(0,B.createContext)(null);function bn({children:e}){let[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(L(`modal`)),[a]=(0,B.useState)(()=>new WeakSet);return(0,U.jsx)(yn,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r,handledEscapeEvents:a},children:e})}bn.displayName=`@mantine/core/DrawerStack`;var xn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerTitle`,null,e),c=K();return(0,U.jsx)(je,{...c.getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...s})});xn.classes=q,xn.displayName=`@mantine/core/DrawerTitle`;var Sn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),withOverlay:!0,withCloseButton:!0},J=c(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:o,children:s,opened:c,stackId:l,zIndex:u,...d}=a(`Drawer`,Sn,e),f=(0,B.use)(yn),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l),__handledEscapeEvents:f.handledEscapeEvents}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,B.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||L(`modal`)):f.removeModal(l))},[c,l,u]),(0,U.jsxs)(vn,{opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,U.jsx)(dn,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,U.jsxs)(ln,{__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,U.jsxs)(un,{children:[t&&(0,U.jsx)(xn,{children:t}),i&&(0,U.jsx)(cn,{...o})]}),(0,U.jsx)(sn,{children:s})]})]})});J.classes=q,J.displayName=`@mantine/core/Drawer`,J.Root=vn,J.Overlay=dn,J.Content=ln,J.Body=sn,J.Header=un,J.Title=xn,J.CloseButton=cn,J.Stack=bn;var Cn={root:`m_dc6f14e2`},wn=l((e,{size:t})=>({root:{"--kbd-fz":y(t,`kbd-fz`)}})),Tn=c(n=>{let r=a(`Kbd`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,attributes:d,...f}=r,p=e({name:`Kbd`,classes:Cn,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:d,vars:u,varsResolver:wn});return(0,U.jsx)(t,{component:`kbd`,...p(`root`),...f})});Tn.classes=Cn,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/Kbd`;var[En,Y]=I(`Menu component was not found in the tree`),Dn=(0,B.createContext)(null);function On(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuCheckboxGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:[],onChange:r}),c=(0,B.useCallback)(e=>{s(o.includes(e)?o.filter(t=>t!==e):[...o,e])},[o,s]);return(0,U.jsx)(Dn,{value:{values:o,onChange:c},children:i})}On.displayName=`@mantine/core/MenuCheckboxGroup`;var X=(0,B.createContext)(null);function kn({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:c,children:l,disabled:u,dataDisabled:d,className:f,style:p,styles:m,classNames:g,buttonRef:_,others:v}){let y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=W(v.onClick,()=>{d||(r(),a&&y.closeDropdownImmediately())}),E=W(v.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=W(v.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())}),O=i?x.variantColorResolver({color:i,theme:x,variant:`light`}):void 0,k=i?S({color:i,theme:x}):null,A=y.alignItemsLabels!==`none`||t;return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:f,style:p,styles:m,classNames:g}),ref:h(w,_),role:e,"aria-checked":t,disabled:u,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":u||d||void 0,"data-mantine-stop-propagation":!0,onClick:T,onMouseMove:E,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[A&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:m,classNames:g}),"data-checked":t||void 0,children:t?n:null}),l&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:m,classNames:g}),"data-menu-item-label":!0,children:l}),c&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:m,classNames:g}),"data-position":`right`,children:c})]})}var Z={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},An=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,defaultChecked:h,onChange:g,checkIcon:_,ref:v,...y}=a(`MenuCheckboxItem`,null,e),b=Y(),x=(0,B.use)(Dn),S=x&&p!==void 0?x.values.includes(p):void 0,[C,w]=j({value:m??S,defaultValue:h,finalValue:!1,onChange:g}),T=_??b.checkIcon??(0,U.jsx)(an,{size:10});return(0,U.jsx)(kn,{role:`menuitemcheckbox`,checked:C,indicator:T,onSelect:()=>{g?w(!C):x&&p!==void 0?x.onChange(p):w(!C)},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:v,others:y,children:u})});An.classes=Z,An.displayName=`@mantine/core/MenuCheckboxItem`;function jn(e){let{children:t,disabled:n,longPressDelay:r}=a(`MenuContextMenu`,null,e),i=F(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=Gt(),c=Kt({childProps:i.props,disabled:n||s.disabled,opened:o.opened,longPressDelay:r,setReference:s.reference,open:()=>o.openDropdown()});return(0,B.cloneElement)(i,c)}jn.displayName=`@mantine/core/MenuContextMenu`;var Mn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuDivider`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`divider`,{className:r,style:i,styles:o,classNames:n}),...c})});Mn.classes=Z,Mn.displayName=`@mantine/core/MenuDivider`;var Nn=500;function Pn(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function Fn(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function In({enabled:e,opened:t,getDropdown:n}){let r=(0,B.useRef)({buffer:``,timeoutId:null});return(0,B.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,B.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},Nn);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||Fn(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,ref:d,...f}=a(`MenuDropdown`,null,e),p=(0,B.useRef)(null),m=Y(),g=In({enabled:!m.hasSearch,opened:m.opened,getDropdown:()=>p.current}),_=W(l,e=>{g(e),!(e.defaultPrevented||m.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),p.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),v=W(s,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.openDropdown()),y=W(c,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.closeDropdown());return(0,U.jsxs)(G.Dropdown,{...f,onMouseEnter:v,onMouseLeave:y,role:`menu`,"aria-orientation":`vertical`,ref:h(d,p),...m.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:_,children:[m.withInitialFocusPlaceholder&&!m.hasSearch&&(0,U.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Ln.classes=Z,Ln.displayName=`@mantine/core/MenuDropdown`;var Rn=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,closeMenuOnClick:u,leftSection:d,rightSection:f,children:p,disabled:m,"data-disabled":g,ref:_,...v}=a(`MenuItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=W(T.onClick,()=>{g||(typeof u==`boolean`?u&&y.closeDropdownImmediately():y.closeOnItemClick&&y.closeDropdownImmediately())}),D=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),O=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,k=l?S({color:l,theme:x}):null,A=W(T.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_),role:`menuitem`,disabled:m,"data-menu-item":!0,"data-disabled":m||g||void 0,"data-mantine-stop-propagation":!0,onClick:E,onMouseMove:D,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:A}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),d&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:d}),p&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:p}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:f})]})});Rn.classes=Z,Rn.displayName=`@mantine/core/MenuItem`;var zn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuLabel`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,styles:o,classNames:n}),...c})});zn.classes=Z,zn.displayName=`@mantine/core/MenuLabel`;var Bn=(0,B.createContext)(null);function Vn(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuRadioGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,U.jsx)(Bn,{value:{value:o,onChange:e=>s(e)},children:i})}Vn.displayName=`@mantine/core/MenuRadioGroup`;function Hn({size:e,style:t,...n}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:x(e),height:x(e),...t},"aria-hidden":!0,...n,children:(0,U.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,onChange:h,checkIcon:g,ref:_,...v}=a(`MenuRadioItem`,null,e),y=Y(),b=(0,B.use)(Bn),x=m??(b?b.value===p:!1),S=g??y.checkIcon??(0,U.jsx)(Hn,{size:5});return(0,U.jsx)(kn,{role:`menuitemradio`,checked:x,indicator:S,onSelect:()=>{x||(h?h(p):b&&b.onChange(p))},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:u})});Un.classes=Z,Un.displayName=`@mantine/core/MenuRadioItem`;var Wn=`[data-menu-item]:not([data-disabled])`,Gn=`[data-menu-active]`;function Kn(e){return e?.closest(`[data-menu-dropdown]`)}function qn(e){return e?Array.from(e.querySelectorAll(Wn)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function Jn(e){e&&e.querySelectorAll(Gn).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function Yn(e,t){Jn(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function Xn(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Zn={clearSearchOnClose:!0},Qn=c(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:o,clearSearchOnClose:s,ref:c,...l}=a(`MenuSearch`,Zn,e),u=Y(),d=(0,B.useRef)(null),f=h(c,d),p=(0,B.useRef)(i);p.current=i,(0,B.useEffect)(()=>u.registerSearch(),[u.registerSearch]),(0,B.useEffect)(()=>{s?u.searchExitClearRef.current=()=>{p.current?.({currentTarget:{value:``}})}:u.searchExitClearRef.current=null},[s,u.searchExitClearRef]),(0,B.useEffect)(()=>{u.opened||Jn(Kn(d.current))},[u.opened]);let m=W(i,e=>{Jn(Kn(e.currentTarget))}),g=W(r,e=>{if(e.defaultPrevented)return;let t=Kn(e.currentTarget),n=qn(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r>=n.length-1?u.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r<=0?r===-1||u.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&Yn(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&Yn(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[Xn(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),v=u.getStyles(`search`);return(0,U.jsx)(_,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:o,...l,ref:f,classNames:[{input:v.className},t],styles:[{input:v.style},n],onKeyDown:g,onChange:m,__staticSelector:`Menu`})});Qn.classes=Z,Qn.displayName=`@mantine/core/MenuSearch`;var $n=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u,onKeyDown:d,children:f,ref:p,...m}=a(`MenuSubDropdown`,null,e),g=(0,B.useRef)(null),_=Y(),v=(0,B.use)(X),y=In({enabled:!_.hasSearch,opened:v?.opened??!1,getDropdown:()=>g.current}),b=W(d,e=>{y(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),x=v?.getFloatingProps({onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u});return(0,U.jsx)(G.Dropdown,{...m,...x,role:`menu`,"aria-orientation":`vertical`,ref:h(p,g,v?.setFloating),..._.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:f})});$n.classes=Z,$n.displayName=`@mantine/core/MenuSubDropdown`;var er=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,leftSection:u,rightSection:d,children:f,disabled:p,"data-disabled":m,closeMenuOnClick:g,ref:_,...v}=a(`MenuSubItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,D=l?S({color:l,theme:x}):null,O=W(T.onKeyDown,e=>{e.key===`ArrowRight`&&(b?.open(),b?.focusFirstItem()),e.key===`ArrowLeft`&&b?.parentContext&&(b.parentContext.close(),b.parentContext.focusParentItem())}),k=W(T.onClick,()=>{!m&&g&&y.closeDropdownImmediately()}),A=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),ee=b?.getReferenceProps({onMouseEnter:T.onMouseEnter,onMouseLeave:T.onMouseLeave,onPointerEnter:T.onPointerEnter,onPointerLeave:T.onPointerLeave});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,...ee,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_,b?.setReference),role:`menuitem`,disabled:p,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:A,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),u&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:u}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:f}),(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:d||(0,U.jsx)(rn,{...y.getStyles(`chevron`),size:14})})]})});er.classes=Z,er.displayName=`@mantine/core/MenuSubItem`;function tr({children:e,refProp:t}){if(!oe(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Y(),(0,U.jsx)(G.Target,{refProp:t,popupType:`menu`,children:e})}tr.displayName=`@mantine/core/MenuSubTarget`;var nr={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function rr(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:o,opened:s,onChange:c,...l}=a(`MenuSub`,nr,e),u=T(),[d,f]=j({value:s,finalValue:!1,onChange:c}),p=(0,B.use)(X),m=Y(),{dir:h}=R(),g=xe(h,i),_=p?.registerOpenSub??m.registerOpenSub,v=(0,B.useRef)(null),y=(0,B.useCallback)(e=>{let t=v.current;return t&&t!==e&&t(),v.current=e,()=>{v.current===e&&(v.current=null)}},[]),b=(0,B.useRef)(f);b.current=f;let x=(0,B.useCallback)(()=>b.current(!0),[]),S=(0,B.useCallback)(()=>b.current(!1),[]);(0,B.useEffect)(()=>{if(d)return _(S)},[d,_,S]);let{context:C,refs:w}=ue({placement:g,open:d,onOpenChange:e=>{e?x():S()}}),{getReferenceProps:E,getFloatingProps:D}=Ce([ge(C,{handleClose:o?Se(typeof o==`object`?o:void 0):void 0,delay:{open:r,close:n}})]);return(0,U.jsx)(X,{value:{opened:d,close:S,open:x,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-target`)?.focus()},16),parentContext:p,setReference:w.setReference,setFloating:w.setFloating,getReferenceProps:E,getFloatingProps:D,registerOpenSub:y},children:(0,U.jsx)(G,{opened:d,onChange:e=>e?x():S(),withArrow:!1,id:u,position:i,...l,withinPortal:!1,children:t})})}rr.extend=e=>e,rr.displayName=`@mantine/core/MenuSub`,rr.Target=tr,rr.Dropdown=$n,rr.Item=er;var ir={refProp:`ref`};function ar(e){let{children:t,refProp:n,...r}=a(`MenuTarget`,ir,e),i=F(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=i.props,c=W(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=W(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=W(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,U.jsx)(G.Target,{refProp:n,popupType:`menu`,...r,children:(0,B.cloneElement)(i,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})}ar.displayName=`@mantine/core/MenuTarget`;var or={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Q=c(t=>{let n=a(`Menu`,or,t),{children:r,onOpen:i,onClose:o,opened:s,defaultOpened:c,trapFocus:l,onChange:u,closeOnItemClick:d,loop:f,closeOnEscape:p,trigger:m,openDelay:h,closeDelay:g,classNames:_,styles:y,unstyled:b,variant:x,vars:S,menuItemTabIndex:C,keepMounted:w,withInitialFocusPlaceholder:T,attributes:E,onExitTransitionEnd:D,alignItemsLabels:O,checkIcon:k,...A}=n,ee=e({name:`Menu`,classes:Z,props:n,classNames:_,styles:y,unstyled:b,attributes:E}),[M,te]=j({value:s,defaultValue:c,finalValue:!1,onChange:u}),[ne,re]=(0,B.useState)(!1),N=()=>{te(!1),re(!1),M&&o?.()},P=()=>{te(!0),!M&&i?.()},ie=()=>{M?N():P()},{openDropdown:ae,closeDropdown:oe}=Ut({open:P,close:N,closeDelay:g,openDelay:h}),F=(0,B.useRef)(null),se=(0,B.useCallback)(e=>{let t=F.current;return t&&t!==e&&t(),F.current=e,()=>{F.current===e&&(F.current=null)}},[]),I=(0,B.useRef)(0),[L,ce]=(0,B.useState)(!1),le=(0,B.useCallback)(()=>(I.current+=1,I.current===1&&ce(!0),()=>{--I.current,I.current===0&&ce(!1)}),[]),ue=(0,B.useRef)(null),de=()=>{ue.current?.(),D?.()},fe=e=>jt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:pe,resolvedStyles:me}=v({classNames:_,styles:y,props:n});return(0,U.jsx)(En,{value:{getStyles:ee,opened:M,toggleDropdown:ie,getItemIndex:fe,openedViaClick:ne,setOpenedViaClick:re,closeOnItemClick:d,closeDropdown:m===`click`?N:oe,openDropdown:m===`click`?P:ae,closeDropdownImmediately:N,loop:f,trigger:m,unstyled:b,menuItemTabIndex:C,withInitialFocusPlaceholder:T,registerOpenSub:se,hasSearch:L,registerSearch:le,searchExitClearRef:ue,alignItemsLabels:O,checkIcon:k},children:(0,U.jsx)(G,{returnFocus:!0,...A,opened:M,onChange:ie,defaultOpened:c,trapFocus:!w&&l,closeOnEscape:p,__staticSelector:`Menu`,classNames:pe,styles:me,unstyled:b,variant:x,keepMounted:w,onExitTransitionEnd:de,children:r})})});Q.displayName=`@mantine/core/Menu`,Q.classes=Z,Q.Item=Rn,Q.Label=zn,Q.Dropdown=Ln,Q.Target=ar,Q.Divider=Mn,Q.Search=Qn,Q.Sub=rr,Q.CheckboxItem=An,Q.CheckboxGroup=On,Q.RadioItem=Un,Q.RadioGroup=Vn,Q.ContextMenu=jn;var sr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),cr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),lr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),ur=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:sr}));ur.displayName=`DotsThreeIcon`;var dr=ur,fr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:cr}));fr.displayName=`PencilSimpleIcon`;var pr=fr,mr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:lr}));mr.displayName=`TrashIcon`;var hr=mr,gr=[`dashboards`],_r=3e4;async function $(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await ee(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw new M(s.message??`Request failed (${o.status})`,o.status,s.problems??[]);return s}var vr=e=>`/api/dashboards/${encodeURIComponent(e)}`,yr=()=>$(`/api/dashboards`).then(e=>e.dashboards),br=(e,t)=>$(vr(e),{signal:t}),xr=(e,t)=>$(`${vr(e)}/versions`,{signal:t}).then(e=>e.versions),Sr=(e,t,n)=>$(`${vr(e)}/versions/${t}`,{signal:n}),Cr=(e,t)=>$(`${vr(e)}/versions/${t}/restore`,{method:`POST`}),wr=(e,t,n,r)=>$(vr(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),Tr=(e,t,n,r)=>$(vr(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}}),Er=(e,t)=>$(`/api/panels/query`,{method:`POST`,json:e,signal:t}).then(e=>e.results),Dr=(e,t)=>$(`/api/annotations`,{method:`POST`,json:e,signal:t}),Or=(e,t)=>$(`/api/panels/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),kr=(e,t)=>$(`/api/panels/exemplars`,{method:`POST`,json:e,signal:t});function Ar(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`200`});return $(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function jr(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function Mr(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return jr(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function Nr(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function Pr(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var Fr=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],Ir=[`off`,`10s`,`30s`,`1m`,`5m`],Lr=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},Rr=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function zr(e){let t={};typeof e.range==`string`&&Fr.includes(e.range)?t.range=e.range:Lr(e.from)&&Lr(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=Rr(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=jr(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function Br(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function Vr(e,t){let n=new URL(e);return n.search=Nr(Br({...zr(Pr(n.search)),drill:JSON.stringify(t)})),n.href}function Hr(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var Ur=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],Wr=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],Gr=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],Kr=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],qr=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],Jr=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],Yr={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},Xr={dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`],light:[`#2a78d6`,`#eb6834`,`#1baf7a`,`#4a3aa7`,`#eda100`,`#e87ba4`]},Zr={micro:11,small:12,body:14,title:16,section:22,page:32},Qr={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},$r={brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},ei={light:7,dark:5};function ti(e){let t=e.replace(`#`,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(2)+.0722*r(4)}function ni(e){let t=ti(e),n=1.05/(t+.05);return(t+.05)/.05>n?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function ri(e){return Object.fromEntries(Object.entries($r).map(([t,n])=>[`--fanout-color-${t}-contrast`,ni(n[ei[e]])]))}function ii(e){return t=>{let n=t.color??si.primaryColor,r=e({...t,color:n}),i=t.variant===`filled`||t.variant===void 0;return t.autoContrast===!1||!i||!Object.hasOwn($r,n)?r:{...r,color:`var(--fanout-color-${n}-contrast)`}}}var ai=.25,oi={xs:9,sm:10,md:11,lg:13,xl:16},si={primaryColor:`brand`,primaryShade:ei,autoContrast:!0,luminanceThreshold:ai,colors:{dark:Ur,brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},defaultRadius:`md`,fontFamily:Qr.body,fontFamilyMonospace:Qr.display,headings:{fontFamily:Qr.body,fontWeight:`600`},cursorType:`pointer`,components:{Tabs:{styles:(e,t)=>({tab:ui(t.color,`--tabs-text-color`)})},Pagination:{styles:(e,t)=>({control:ui(t.color,`--pagination-active-color`)})},Badge:{vars:(e,t)=>({root:li(t.size)})}}},ci=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":Yr.light.muted,...ri(`light`)},dark:ri(`dark`)});function li(e){let t=oi[e??`md`];return t===void 0||t>=Zr.micro?{}:{"--badge-fz":`${Zr.micro/16}rem`}}function ui(e,t){return!e||e===si.primaryColor?{[t]:`var(--fanout-color-${si.primaryColor}-contrast)`}:{}}export{Dt as $,yr as A,pr as B,Mr as C,br as D,_r as E,Er as F,an as G,Q as H,wr as I,Bt as J,rn as K,Or as L,Tr as M,Dr as N,Ar as O,kr as P,kt as Q,Cr as R,Nr as S,gr as T,Tn as U,dr as V,J as W,Vt as X,Ht as Y,At as Z,zr as _,ii as a,lt as at,Br as b,Yr as c,Ue as ct,Gr as d,Le as dt,St as et,Xr as f,Hr as g,Vr as h,ti as i,ft as it,xr as j,Sr as k,Qr as l,Be as lt,Kr as m,si as n,yt as nt,qr as o,rt as ot,Zr as p,G as q,ni as r,vt as rt,Wr as s,ot as st,ci as t,bt as tt,Jr as u,Re as ut,Fr as v,jr as w,Pr as x,Ir as y,hr as z}; \ No newline at end of file +import{A as e,C as t,Ct as n,G as r,J as i,M as a,P as o,S as s,T as c,X as l,Y as u,a as d,b as f,bt as p,ct as m,et as h,gt as g,h as _,j as v,lt as y,nt as b,pt as x,q as S,rt as C,st as w,tt as T,vt as E,w as D,z as O}from"./brand-oskFJPNW.js";import{d as k,f as A,i as ee,l as j,o as M}from"./auth-BLat7TXI.js";import{B as te,C as ne,I as re,g as N,h as P,v as ie,w as ae}from"./preload-helper-DOsq4iEA.js";import{n as oe,t as F}from"./get-single-element-child-D7qmWU2f.js";import{C as se,E as I,T as L,_ as ce,a as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,l as ge,m as _e,n as ve,o as ye,p as be,r as xe,s as Se,u as Ce,v as we,x as R,y as Te}from"./Tooltip-2jTVpG2Y.js";import{r as Ee}from"./use-computed-color-scheme-Bb1nqm0Z.js";import{A as De,D as Oe,I as ke,M as Ae,N as z,O as je,P as Me,R as Ne,j as Pe,k as Fe}from"./useQuery-BynlWFEG.js";import{t as Ie}from"./FocusTrap-yVpiEwpv.js";function Le(){throw Error(`Invariant failed`)}var Re=`__root__`;function ze(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Be(e){return e instanceof Response&&!!e.options}var Ve=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Re:this.parentRoute||Le();let r=n?Re:t?.path;r&&r!==`/`&&(r=ne(r));let i=t?.id||r,a=n?Re:ie((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:ie(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ae(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ze({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},He=class extends Ve{constructor(e){super(e)}},B=n(p(),1),Ue=B.createContext(void 0),We=B.createContext(void 0);function Ge({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ke(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var qe=[],Je=0,{link:Ye,unlink:Xe,propagate:Ze,checkDirty:Qe,shallowPropagate:$e}=Ge({update(e){return e._update()},notify(e){qe[tt++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,it(e))}}),et=0,tt=0,V,nt=0;function rt(e){try{++nt,e()}finally{--nt||at()}}function it(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Xe(n,e)}function at(){if(!(nt>0)){for(;et{i.get(),n.current?(V=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=V,o=t?.compare??Object.is;if(n)V=i,++Je,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{V=a,n&&(i.flags&=-5),it(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Qe(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&$e(e)}}else e&32&&(i.flags=e&-33);return V!==void 0&&Ye(i,V,Je),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ze(e),$e(e),at())}},i}function st(e){let t=()=>{let t=V;V=n,++Je,n.depsTail=void 0,n.flags=6;try{return e()}finally{V=t,n.flags&=-5,it(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Qe(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,it(this)}};return t(),n}var ct={};function lt(e,t){let n=B.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=te(n.current,i):i}}function H(e){let t=g(),n=B.useContext(e.from?We:Ue),r=e.from??n,i=t.stores.getMatchStore(r),a=lt(e,t),o=N(i,e=>e?a(e):ct);if(o!==ct)return o;(e.shouldThrow??!0)&&Le()}function ut(e){return H({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function dt(e){let{select:t,...n}=e;return H({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ft(e){return H({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function pt(e){return H({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mt(e){return H({...e,select:t=>e.select?e.select(t.context):t.context})}var U=E(),ht=class extends Ve{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function gt(e){return new ht(e)}var _t=class extends He{constructor(e){super(e),this.useMatch=e=>H({...e,from:this.id}),this.useRouteContext=e=>mt({...e,from:this.id}),this.useSearch=e=>pt({...e,from:this.id}),this.useParams=e=>ft({...e,from:this.id}),this.useLoaderDeps=e=>dt({...e,from:this.id}),this.useLoaderData=e=>ut({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,U.jsx)(P,{ref:t,from:this.fullPath,...e}))}};function vt(e){return new _t(e)}function yt(e){return e=>{let t=gt(e);return t.isRoot=!1,t}}function bt(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(re(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(A)A(a());else throw a()}return B.createElement(r,e)};return o.preload=a,o}function xt(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function St(e){let t=xt(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function wt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function Tt(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(Ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Et(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=Tt(l,c,r),d=wt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[Tt(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[wt(c.length,c,!1)]?.focus()}}}function Ot(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Ee:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function W(e,t){return n=>{e?.(n),t?.(n)}}function kt(e,t){return e in t?St(t[e]):St(e)}function At(e,t){let n=e.map(e=>({value:e,px:kt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function jt(e,t,n){return n?Array.from(Ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Mt=[`mousedown`,`touchstart`];function Nt(e,t,n,r=!0,i=!1){let a=(0,B.useRef)(null),o=t||Mt,s=(0,B.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let i=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!i.includes(e))&&e(t):a.current&&!i.includes(a.current)&&e(t)}),c=o.join(`,`);return(0,B.useEffect)(()=>{if(!r)return;let e=c.split(`,`);return e.forEach(e=>document.addEventListener(e,s,i)),()=>{e.forEach(e=>document.removeEventListener(e,s,i))}},[c,r,i]),a}var Pt=[`mouse`,`touch`],Ft=10;function It(e,t={}){let{threshold:n=400,events:r=Pt,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,B.useRef)(!1),l=(0,B.useRef)(!1),u=(0,B.useRef)(-1),d=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>window.clearTimeout(u.current),[]);let f=r.join(`,`);return(0,B.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?Ft:i===!1?0:i,p=t=>{(zt(t)||Rt(t))&&(a&&a(t),d.current=Lt(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(zt(e)||Rt(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=Lt(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,f])}function Lt(e){if(Rt(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Rt(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function zt(e){return e.nativeEvent instanceof MouseEvent}function Bt({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&S({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Vt(e,t,n){return Bt({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function Ht(e,t){let n=e.colors[e.primaryColor];return r(n)?e.autoContrast?Vt(n,e,t):`var(--mantine-color-white)`:Bt({color:n[i(e,t)],theme:e,autoContrast:null})}function Ut({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,B.useRef)(-1),a=(0,B.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,B.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[Wt,Gt]=I(`Popover component was not found in the tree`);function Kt({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,B.useRef)(!1),s=(0,B.useRef)(!1),c=(0,B.useRef)(null),l=(0,B.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=W(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=W(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=It(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:W(e.onTouchStart,p.onTouchStart),onTouchEnd:W(e.onTouchEnd,p.onTouchEnd),onTouchCancel:W(e.onTouchCancel,p.onTouchCancel),onTouchMove:W(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function qt(e){let{children:t,disabled:n,longPressDelay:r}=a(`PopoverContextMenu`,null,e),i=F(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Gt(),s=Kt({childProps:i.props,disabled:n||o.disabled,opened:o.opened,longPressDelay:r,setReference:o.reference,open:()=>{o.opened||o.onToggle()}});return(0,B.cloneElement)(i,s)}qt.displayName=`@mantine/core/PopoverContextMenu`;var Jt={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Yt=c(e=>{let n=a(`PopoverDropdown`,null,e),{className:r,style:i,vars:o,children:s,onKeyDownCapture:c,variant:l,classNames:u,styles:d,ref:p,...m}=n,g=Gt(),{dir:_}=R(),v=g.arrowPosition===`merge`&&g.withArrow?le({position:g.placement,dir:_}):void 0,y=Ne({opened:g.opened,shouldReturnFocus:g.returnFocus}),b=g.withRoles?{"aria-labelledby":g.getTargetId(),id:g.getDropdownId(),role:`dialog`,tabIndex:-1}:{},S=h(p,g.floating);return g.disabled?null:(0,U.jsx)(ve,{...g.portalProps,withinPortal:g.withinPortal,children:(0,U.jsx)(f,{mounted:g.opened,...g.transitionProps,transition:g.transitionProps?.transition||`fade`,duration:g.transitionProps?.duration??150,keepMounted:g.keepMounted,keepMountedMode:g.keepMountedMode,exitDuration:typeof g.transitionProps?.exitDuration==`number`?g.transitionProps.exitDuration:g.transitionProps?.duration,children:e=>(0,U.jsx)(Ie,{active:g.trapFocus&&g.opened,innerRef:S,children:(0,U.jsxs)(t,{...b,...m,variant:l,onKeyDownCapture:Ot(()=>{g.onClose?.(),g.onDismiss?.()},{active:g.closeOnEscape,onTrigger:y,onKeyDown:c}),"data-position":g.placement,"data-fixed":g.floatingStrategy===`fixed`||void 0,...g.getStyles(`dropdown`,{className:r,props:n,classNames:u,styles:d,style:[{...e,...v,zIndex:g.zIndex,top:g.y??0,left:g.x??0,width:g.width===`target`?void 0:x(g.width),...g.referenceHidden?{display:`none`}:null},g.resolvedStyles?.dropdown,d?.dropdown,i]}),children:[s,(0,U.jsx)(he,{ref:g.arrowRef,arrowX:g.arrowX,arrowY:g.arrowY,visible:g.withArrow,position:g.placement,arrowSize:g.arrowSize,arrowRadius:g.arrowRadius,arrowOffset:g.arrowOffset,arrowPosition:g.arrowPosition,...g.getStyles(`arrow`,{props:n,classNames:u,styles:d})})]})})})})});Yt.classes=Jt,Yt.displayName=`@mantine/core/PopoverDropdown`;var Xt={refProp:`ref`,popupType:`dialog`},Zt=c(e=>{let{children:t,refProp:n,popupType:r,ref:i,...o}=a(`PopoverTarget`,Xt,e),s=F(t);if(!s)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let c=o,l=Gt(),d=h(l.reference,se(s),i),f=l.withRoles?{"aria-haspopup":r,"aria-expanded":l.opened,"aria-controls":l.opened?l.getDropdownId():void 0,id:l.getTargetId()}:{},p=s.props;return(0,B.cloneElement)(s,{...c,...f,...l.targetProps,className:u(l.targetProps.className,c.className,p.className),[n]:d,...l.controlled?null:{onClick:e=>{l.onToggle(),p.onClick?.(e)}}})});Zt.displayName=`@mantine/core/PopoverTarget`;function Qt(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function $t(e,t,n,r){let i=Qt(e.middlewares),a=[pe(e.offset),be()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(fe(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(ce(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:me(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?_e():_e(i.inline)),a.push(de({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(we({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function en(e){let[t,n]=j({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,B.useRef)(t),i=(0,B.useRef)(!1),[a,o]=(0,B.useState)(null),s=e.preventPositionChangeWhenVisible!==!1,c=(0,B.useRef)(t);t!==c.current&&(c.current=t,t&&a!==null&&o(null));let l=(0,B.useRef)(e.position);e.position!==l.current&&(l.current=e.position,i.current=!1,a!==null&&o(null));let u=(0,B.useCallback)(()=>o(null),[]),d=()=>{t&&!e.disabled&&n(!1)},f=()=>{e.disabled||n(!t)},p=ue({open:t,strategy:e.strategy,placement:s?a??e.position:e.position,middleware:$t(e,()=>p,s&&a!==null,s),whileElementsMounted:e.keepMounted?void 0:Te});(0,B.useEffect)(()=>{if(!e.keepMounted)return;let n=p.refs.reference.current,r=p.refs.floating.current;if(t&&n&&r)return Te(n,r,p.update)},[e.keepMounted,t,p.update,p.elements.reference,p.elements.floating]),C(()=>{if(!t){i.current=!1;return}if(!s||a!==null)return;let e=p.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!i.current){i.current=!0,p.update();return}p.isPositioned&&o(p.placement)}},[s,t,p.isPositioned,p.placement,a,p.update]);let m=(0,B.useRef)(p.placement);return C(()=>{m.current!==p.placement&&(m.current=p.placement,e.onPositionChange?.(p.placement))},[p.placement]),b(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:p,controlled:typeof e.opened==`boolean`,opened:t,onClose:d,onToggle:f,resetLockedPlacement:u}}var tn={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:L(`popover`),__staticSelector:`Popover`,width:`max-content`},nn=l((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:w(t),"--popover-shadow":m(n)}}));function G(t){let n=a(`Popover`,tn,t),{children:r,position:i,offset:o,onPositionChange:s,opened:c,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:p,middlewares:m,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,unstyled:x,classNames:S,styles:C,closeOnClickOutside:w,withinPortal:E,portalProps:D,closeOnEscape:k,clickOutsideEvents:A,trapFocus:ee,onClose:j,onDismiss:M,onOpen:te,onChange:ne,zIndex:re,radius:N,shadow:P,id:ie,defaultOpened:ae,__staticSelector:oe,withRoles:F,disabled:se,returnFocus:I,variant:L,keepMounted:ce,keepMountedMode:le,vars:ue,floatingStrategy:de,withOverlay:fe,overlayProps:pe,hideDetached:me,attributes:he,preventPositionChangeWhenVisible:ge,..._e}=n,ye=e({name:oe,props:n,classes:Jt,classNames:S,styles:C,unstyled:x,attributes:he,rootSelector:`dropdown`,vars:ue,varsResolver:nn}),{resolvedStyles:be}=v({classNames:S,styles:C,props:n}),Se=(0,B.useRef)(null),[Ce,we]=(0,B.useState)(null),[Te,Ee]=(0,B.useState)(null),{dir:De}=R(),Oe=O(),Ae=T(ie),z=en({middlewares:m,width:p,position:xe(De,i),offset:typeof o==`number`?o+(h?g/2:0):o,arrowRef:Se,arrowOffset:_,onPositionChange:s,opened:c,defaultOpened:ae,onChange:ne,onOpen:te,onClose:j,onDismiss:M,strategy:de,disabled:se,preventPositionChangeWhenVisible:ge,keepMounted:ce});Nt(()=>{w&&(z.onClose(),M?.())},A,[Ce,Te]);let je=(0,B.useCallback)(e=>{we(e),z.floating.refs.setReference(e)},[z.floating.refs.setReference]),Me=(0,B.useCallback)(e=>{Ee(e),z.floating.refs.setFloating(e)},[z.floating.refs.setFloating]),Ne=(0,B.useCallback)(()=>{l?.onExited?.(),u?.(),z.resetLockedPlacement()},[l?.onExited,u,z.resetLockedPlacement]),Pe=(0,B.useCallback)(()=>{l?.onEntered?.(),d?.()},[l?.onEntered,d]);return(0,U.jsxs)(Wt,{value:{returnFocus:I,disabled:se,controlled:z.controlled,reference:je,floating:Me,x:z.floating.x,y:z.floating.y,arrowX:z.floating?.middlewareData?.arrow?.x,arrowY:z.floating?.middlewareData?.arrow?.y,opened:z.opened,arrowRef:Se,transitionProps:{...l,onExited:Ne,onEntered:Pe},width:p,withArrow:h,arrowSize:g,arrowOffset:_,arrowRadius:y,arrowPosition:b,placement:z.floating.placement,trapFocus:ee,withinPortal:E,portalProps:D,zIndex:re,radius:N,shadow:P,closeOnEscape:k,onDismiss:M,onClose:z.onClose,onToggle:z.onToggle,getTargetId:()=>Ae,getDropdownId:()=>`${Ae}-dropdown`,withRoles:F,targetProps:_e,__staticSelector:oe,classNames:S,styles:C,unstyled:x,variant:L,keepMounted:ce,keepMountedMode:le,getStyles:ye,resolvedStyles:be,floatingStrategy:de,referenceHidden:me&&Oe!==`test`?z.floating.middlewareData.hide?.referenceHidden:!1},children:[r,fe&&(0,U.jsx)(f,{transition:`fade`,mounted:z.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:e=>(0,U.jsx)(ve,{withinPortal:E,children:(0,U.jsx)(ke,{...pe,...ye(`overlay`,{className:pe?.className,style:[e,pe?.style]})})})})]})}G.Target=Zt,G.Dropdown=Yt,G.ContextMenu=qt,G.varsResolver=nn,G.displayName=`@mantine/core/Popover`,G.extend=e=>e,G.withProps=e=>{let t=t=>(0,U.jsx)(G,{...e,...t});return t.extend=G.extend,t.displayName=`WithProps(${G.displayName})`,t};function rn({style:e,size:t=16,...n}){return(0,U.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:x(t),height:x(t),display:`block`},...n,children:(0,U.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}rn.displayName=`@mantine/core/AccordionChevron`;function an({size:e,style:t,...n}){let r=e===void 0?t:{width:x(e),height:x(e),...t};return(0,U.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,U.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var[on,K]=I(`Drawer component was not found in tree`),q={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},sn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerBody`,null,e),c=K();return(0,U.jsx)(z,{...c.getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...s})});sn.classes=q,sn.displayName=`@mantine/core/DrawerBody`;var cn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerCloseButton`,null,e),c=K();return(0,U.jsx)(Ae,{...c.getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...s})});cn.classes=q,cn.displayName=`@mantine/core/DrawerCloseButton`;var ln=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,radius:c,__hidden:l,...u}=a(`DrawerContent`,null,e),d=K(),f=d.scrollAreaComponent||Oe;return(0,U.jsx)(Pe,{...d.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:d.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...u,radius:c||d.radius||0,"data-hidden":l||void 0,children:(0,U.jsx)(f,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:s})})});ln.classes=q,ln.displayName=`@mantine/core/DrawerContent`;var un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerHeader`,null,e),c=K();return(0,U.jsx)(De,{...c.getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...s})});un.classes=q,un.displayName=`@mantine/core/DrawerHeader`;var dn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerOverlay`,null,e),c=K();return(0,U.jsx)(Fe,{...c.getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...s})});dn.classes=q,dn.displayName=`@mantine/core/DrawerOverlay`;function fn(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function pn(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var mn={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},hn={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},gn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),position:`left`},_n=l((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":y(n,`drawer-size`),"--drawer-flex":pn(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":fn(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":x(r)}})),vn=c(t=>{let n=a(`DrawerRoot`,gn,t),{classNames:r,className:i,style:o,styles:s,unstyled:c,vars:l,scrollAreaComponent:u,position:d,transitionProps:f,radius:p,attributes:m,...h}=n,{dir:g}=R(),_=e({name:`Drawer`,classes:q,props:n,className:i,style:o,classNames:r,styles:s,unstyled:c,attributes:m,vars:l,varsResolver:_n}),v=(g===`rtl`?hn:mn)[d];return(0,U.jsx)(on,{value:{scrollAreaComponent:u,getStyles:_,radius:p},children:(0,U.jsx)(Me,{..._(`root`),transitionProps:{transition:v,...f},"data-offset-scrollbars":u===ye.Autosize||void 0,unstyled:c,...h})})});vn.classes=q,vn.varsResolver=_n,vn.displayName=`@mantine/core/DrawerRoot`;var yn=(0,B.createContext)(null);function bn({children:e}){let[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(L(`modal`)),[a]=(0,B.useState)(()=>new WeakSet);return(0,U.jsx)(yn,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r,handledEscapeEvents:a},children:e})}bn.displayName=`@mantine/core/DrawerStack`;var xn=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,...s}=a(`DrawerTitle`,null,e),c=K();return(0,U.jsx)(je,{...c.getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...s})});xn.classes=q,xn.displayName=`@mantine/core/DrawerTitle`;var Sn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:L(`modal`),withOverlay:!0,withCloseButton:!0},J=c(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:o,children:s,opened:c,stackId:l,zIndex:u,...d}=a(`Drawer`,Sn,e),f=(0,B.use)(yn),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l),__handledEscapeEvents:f.handledEscapeEvents}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,B.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||L(`modal`)):f.removeModal(l))},[c,l,u]),(0,U.jsxs)(vn,{opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,U.jsx)(dn,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,U.jsxs)(ln,{__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,U.jsxs)(un,{children:[t&&(0,U.jsx)(xn,{children:t}),i&&(0,U.jsx)(cn,{...o})]}),(0,U.jsx)(sn,{children:s})]})]})});J.classes=q,J.displayName=`@mantine/core/Drawer`,J.Root=vn,J.Overlay=dn,J.Content=ln,J.Body=sn,J.Header=un,J.Title=xn,J.CloseButton=cn,J.Stack=bn;var Cn={root:`m_dc6f14e2`},wn=l((e,{size:t})=>({root:{"--kbd-fz":y(t,`kbd-fz`)}})),Tn=c(n=>{let r=a(`Kbd`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,attributes:d,...f}=r,p=e({name:`Kbd`,classes:Cn,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:d,vars:u,varsResolver:wn});return(0,U.jsx)(t,{component:`kbd`,...p(`root`),...f})});Tn.classes=Cn,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/Kbd`;var[En,Y]=I(`Menu component was not found in the tree`),Dn=(0,B.createContext)(null);function On(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuCheckboxGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:[],onChange:r}),c=(0,B.useCallback)(e=>{s(o.includes(e)?o.filter(t=>t!==e):[...o,e])},[o,s]);return(0,U.jsx)(Dn,{value:{values:o,onChange:c},children:i})}On.displayName=`@mantine/core/MenuCheckboxGroup`;var X=(0,B.createContext)(null);function kn({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:c,children:l,disabled:u,dataDisabled:d,className:f,style:p,styles:m,classNames:g,buttonRef:_,others:v}){let y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=W(v.onClick,()=>{d||(r(),a&&y.closeDropdownImmediately())}),E=W(v.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=W(v.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())}),O=i?x.variantColorResolver({color:i,theme:x,variant:`light`}):void 0,k=i?S({color:i,theme:x}):null,A=y.alignItemsLabels!==`none`||t;return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:f,style:p,styles:m,classNames:g}),ref:h(w,_),role:e,"aria-checked":t,disabled:u,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":u||d||void 0,"data-mantine-stop-propagation":!0,onClick:T,onMouseMove:E,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[A&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:m,classNames:g}),"data-checked":t||void 0,children:t?n:null}),l&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:m,classNames:g}),"data-menu-item-label":!0,children:l}),c&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:m,classNames:g}),"data-position":`right`,children:c})]})}var Z={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},An=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,defaultChecked:h,onChange:g,checkIcon:_,ref:v,...y}=a(`MenuCheckboxItem`,null,e),b=Y(),x=(0,B.use)(Dn),S=x&&p!==void 0?x.values.includes(p):void 0,[C,w]=j({value:m??S,defaultValue:h,finalValue:!1,onChange:g}),T=_??b.checkIcon??(0,U.jsx)(an,{size:10});return(0,U.jsx)(kn,{role:`menuitemcheckbox`,checked:C,indicator:T,onSelect:()=>{g?w(!C):x&&p!==void 0?x.onChange(p):w(!C)},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:v,others:y,children:u})});An.classes=Z,An.displayName=`@mantine/core/MenuCheckboxItem`;function jn(e){let{children:t,disabled:n,longPressDelay:r}=a(`MenuContextMenu`,null,e),i=F(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=Gt(),c=Kt({childProps:i.props,disabled:n||s.disabled,opened:o.opened,longPressDelay:r,setReference:s.reference,open:()=>o.openDropdown()});return(0,B.cloneElement)(i,c)}jn.displayName=`@mantine/core/MenuContextMenu`;var Mn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuDivider`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`divider`,{className:r,style:i,styles:o,classNames:n}),...c})});Mn.classes=Z,Mn.displayName=`@mantine/core/MenuDivider`;var Nn=500;function Pn(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function Fn(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function In({enabled:e,opened:t,getDropdown:n}){let r=(0,B.useRef)({buffer:``,timeoutId:null});return(0,B.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,B.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},Nn);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||Fn(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,ref:d,...f}=a(`MenuDropdown`,null,e),p=(0,B.useRef)(null),m=Y(),g=In({enabled:!m.hasSearch,opened:m.opened,getDropdown:()=>p.current}),_=W(l,e=>{g(e),!(e.defaultPrevented||m.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),p.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),v=W(s,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.openDropdown()),y=W(c,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.closeDropdown());return(0,U.jsxs)(G.Dropdown,{...f,onMouseEnter:v,onMouseLeave:y,role:`menu`,"aria-orientation":`vertical`,ref:h(d,p),...m.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:_,children:[m.withInitialFocusPlaceholder&&!m.hasSearch&&(0,U.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Ln.classes=Z,Ln.displayName=`@mantine/core/MenuDropdown`;var Rn=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,closeMenuOnClick:u,leftSection:d,rightSection:f,children:p,disabled:m,"data-disabled":g,ref:_,...v}=a(`MenuItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=W(T.onClick,()=>{g||(typeof u==`boolean`?u&&y.closeDropdownImmediately():y.closeOnItemClick&&y.closeDropdownImmediately())}),D=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),O=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,k=l?S({color:l,theme:x}):null,A=W(T.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_),role:`menuitem`,disabled:m,"data-menu-item":!0,"data-disabled":m||g||void 0,"data-mantine-stop-propagation":!0,onClick:E,onMouseMove:D,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:A}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),d&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:d}),p&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:p}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:f})]})});Rn.classes=Z,Rn.displayName=`@mantine/core/MenuItem`;var zn=c(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`MenuLabel`,null,e),l=Y();return(0,U.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,styles:o,classNames:n}),...c})});zn.classes=Z,zn.displayName=`@mantine/core/MenuLabel`;var Bn=(0,B.createContext)(null);function Vn(e){let{value:t,defaultValue:n,onChange:r,children:i}=a(`MenuRadioGroup`,null,e),[o,s]=j({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,U.jsx)(Bn,{value:{value:o,onChange:e=>s(e)},children:i})}Vn.displayName=`@mantine/core/MenuRadioGroup`;function Hn({size:e,style:t,...n}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:x(e),height:x(e),...t},"aria-hidden":!0,...n,children:(0,U.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Un=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,color:s,closeMenuOnClick:c,rightSection:l,children:u,disabled:d,"data-disabled":f,value:p,checked:m,onChange:h,checkIcon:g,ref:_,...v}=a(`MenuRadioItem`,null,e),y=Y(),b=(0,B.use)(Bn),x=m??(b?b.value===p:!1),S=g??y.checkIcon??(0,U.jsx)(Hn,{size:5});return(0,U.jsx)(kn,{role:`menuitemradio`,checked:x,indicator:S,onSelect:()=>{x||(h?h(p):b&&b.onChange(p))},color:s,closeMenuOnClick:c,rightSection:l,disabled:d,dataDisabled:f,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:u})});Un.classes=Z,Un.displayName=`@mantine/core/MenuRadioItem`;var Wn=`[data-menu-item]:not([data-disabled])`,Gn=`[data-menu-active]`;function Kn(e){return e?.closest(`[data-menu-dropdown]`)}function qn(e){return e?Array.from(e.querySelectorAll(Wn)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function Jn(e){e&&e.querySelectorAll(Gn).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function Yn(e,t){Jn(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function Xn(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Zn={clearSearchOnClose:!0},Qn=c(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:o,clearSearchOnClose:s,ref:c,...l}=a(`MenuSearch`,Zn,e),u=Y(),d=(0,B.useRef)(null),f=h(c,d),p=(0,B.useRef)(i);p.current=i,(0,B.useEffect)(()=>u.registerSearch(),[u.registerSearch]),(0,B.useEffect)(()=>{s?u.searchExitClearRef.current=()=>{p.current?.({currentTarget:{value:``}})}:u.searchExitClearRef.current=null},[s,u.searchExitClearRef]),(0,B.useEffect)(()=>{u.opened||Jn(Kn(d.current))},[u.opened]);let m=W(i,e=>{Jn(Kn(e.currentTarget))}),g=W(r,e=>{if(e.defaultPrevented)return;let t=Kn(e.currentTarget),n=qn(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r>=n.length-1?u.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=Xn(n);Yn(n[r<=0?r===-1||u.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&Yn(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&Yn(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[Xn(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),v=u.getStyles(`search`);return(0,U.jsx)(_,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:o,...l,ref:f,classNames:[{input:v.className},t],styles:[{input:v.style},n],onKeyDown:g,onChange:m,__staticSelector:`Menu`})});Qn.classes=Z,Qn.displayName=`@mantine/core/MenuSearch`;var $n=c(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u,onKeyDown:d,children:f,ref:p,...m}=a(`MenuSubDropdown`,null,e),g=(0,B.useRef)(null),_=Y(),v=(0,B.use)(X),y=In({enabled:!_.hasSearch,opened:v?.opened??!1,getDropdown:()=>g.current}),b=W(d,e=>{y(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),x=v?.getFloatingProps({onMouseEnter:s,onMouseLeave:c,onPointerEnter:l,onPointerLeave:u});return(0,U.jsx)(G.Dropdown,{...m,...x,role:`menu`,"aria-orientation":`vertical`,ref:h(p,g,v?.setFloating),..._.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:f})});$n.classes=Z,$n.displayName=`@mantine/core/MenuSubDropdown`;var er=D(e=>{let{classNames:t,className:n,style:r,styles:i,vars:c,color:l,leftSection:u,rightSection:d,children:f,disabled:p,"data-disabled":m,closeMenuOnClick:g,ref:_,...v}=a(`MenuSubItem`,null,e),y=Y(),b=(0,B.use)(X),x=o(),{dir:C}=R(),w=(0,B.useRef)(null),T=v,E=l?x.variantColorResolver({color:l,theme:x,variant:`light`}):void 0,D=l?S({color:l,theme:x}):null,O=W(T.onKeyDown,e=>{e.key===`ArrowRight`&&(b?.open(),b?.focusFirstItem()),e.key===`ArrowLeft`&&b?.parentContext&&(b.parentContext.close(),b.parentContext.focusParentItem())}),k=W(T.onClick,()=>{!m&&g&&y.closeDropdownImmediately()}),A=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),ee=b?.getReferenceProps({onMouseEnter:T.onMouseEnter,onMouseLeave:T.onMouseLeave,onPointerEnter:T.onPointerEnter,onPointerLeave:T.onPointerLeave});return(0,U.jsxs)(s,{onMouseDown:e=>e.preventDefault(),...v,...ee,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(w,_,b?.setReference),role:`menuitem`,disabled:p,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:A,onKeyDown:Dt({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),u&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:u}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:f}),(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:d||(0,U.jsx)(rn,{...y.getStyles(`chevron`),size:14})})]})});er.classes=Z,er.displayName=`@mantine/core/MenuSubItem`;function tr({children:e,refProp:t}){if(!oe(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Y(),(0,U.jsx)(G.Target,{refProp:t,popupType:`menu`,children:e})}tr.displayName=`@mantine/core/MenuSubTarget`;var nr={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function rr(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:o,opened:s,onChange:c,...l}=a(`MenuSub`,nr,e),u=T(),[d,f]=j({value:s,finalValue:!1,onChange:c}),p=(0,B.use)(X),m=Y(),{dir:h}=R(),g=xe(h,i),_=p?.registerOpenSub??m.registerOpenSub,v=(0,B.useRef)(null),y=(0,B.useCallback)(e=>{let t=v.current;return t&&t!==e&&t(),v.current=e,()=>{v.current===e&&(v.current=null)}},[]),b=(0,B.useRef)(f);b.current=f;let x=(0,B.useCallback)(()=>b.current(!0),[]),S=(0,B.useCallback)(()=>b.current(!1),[]);(0,B.useEffect)(()=>{if(d)return _(S)},[d,_,S]);let{context:C,refs:w}=ue({placement:g,open:d,onOpenChange:e=>{e?x():S()}}),{getReferenceProps:E,getFloatingProps:D}=Ce([ge(C,{handleClose:o?Se(typeof o==`object`?o:void 0):void 0,delay:{open:r,close:n}})]);return(0,U.jsx)(X,{value:{opened:d,close:S,open:x,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-target`)?.focus()},16),parentContext:p,setReference:w.setReference,setFloating:w.setFloating,getReferenceProps:E,getFloatingProps:D,registerOpenSub:y},children:(0,U.jsx)(G,{opened:d,onChange:e=>e?x():S(),withArrow:!1,id:u,position:i,...l,withinPortal:!1,children:t})})}rr.extend=e=>e,rr.displayName=`@mantine/core/MenuSub`,rr.Target=tr,rr.Dropdown=$n,rr.Item=er;var ir={refProp:`ref`};function ar(e){let{children:t,refProp:n,...r}=a(`MenuTarget`,ir,e),i=F(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Y(),s=i.props,c=W(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=W(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=W(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,U.jsx)(G.Target,{refProp:n,popupType:`menu`,...r,children:(0,B.cloneElement)(i,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})}ar.displayName=`@mantine/core/MenuTarget`;var or={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Q=c(t=>{let n=a(`Menu`,or,t),{children:r,onOpen:i,onClose:o,opened:s,defaultOpened:c,trapFocus:l,onChange:u,closeOnItemClick:d,loop:f,closeOnEscape:p,trigger:m,openDelay:h,closeDelay:g,classNames:_,styles:y,unstyled:b,variant:x,vars:S,menuItemTabIndex:C,keepMounted:w,withInitialFocusPlaceholder:T,attributes:E,onExitTransitionEnd:D,alignItemsLabels:O,checkIcon:k,...A}=n,ee=e({name:`Menu`,classes:Z,props:n,classNames:_,styles:y,unstyled:b,attributes:E}),[M,te]=j({value:s,defaultValue:c,finalValue:!1,onChange:u}),[ne,re]=(0,B.useState)(!1),N=()=>{te(!1),re(!1),M&&o?.()},P=()=>{te(!0),!M&&i?.()},ie=()=>{M?N():P()},{openDropdown:ae,closeDropdown:oe}=Ut({open:P,close:N,closeDelay:g,openDelay:h}),F=(0,B.useRef)(null),se=(0,B.useCallback)(e=>{let t=F.current;return t&&t!==e&&t(),F.current=e,()=>{F.current===e&&(F.current=null)}},[]),I=(0,B.useRef)(0),[L,ce]=(0,B.useState)(!1),le=(0,B.useCallback)(()=>(I.current+=1,I.current===1&&ce(!0),()=>{--I.current,I.current===0&&ce(!1)}),[]),ue=(0,B.useRef)(null),de=()=>{ue.current?.(),D?.()},fe=e=>jt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:pe,resolvedStyles:me}=v({classNames:_,styles:y,props:n});return(0,U.jsx)(En,{value:{getStyles:ee,opened:M,toggleDropdown:ie,getItemIndex:fe,openedViaClick:ne,setOpenedViaClick:re,closeOnItemClick:d,closeDropdown:m===`click`?N:oe,openDropdown:m===`click`?P:ae,closeDropdownImmediately:N,loop:f,trigger:m,unstyled:b,menuItemTabIndex:C,withInitialFocusPlaceholder:T,registerOpenSub:se,hasSearch:L,registerSearch:le,searchExitClearRef:ue,alignItemsLabels:O,checkIcon:k},children:(0,U.jsx)(G,{returnFocus:!0,...A,opened:M,onChange:ie,defaultOpened:c,trapFocus:!w&&l,closeOnEscape:p,__staticSelector:`Menu`,classNames:pe,styles:me,unstyled:b,variant:x,keepMounted:w,onExitTransitionEnd:de,children:r})})});Q.displayName=`@mantine/core/Menu`,Q.classes=Z,Q.Item=Rn,Q.Label=zn,Q.Dropdown=Ln,Q.Target=ar,Q.Divider=Mn,Q.Search=Qn,Q.Sub=rr,Q.CheckboxItem=An,Q.CheckboxGroup=On,Q.RadioItem=Un,Q.RadioGroup=Vn,Q.ContextMenu=jn;var sr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),cr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),lr=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),ur=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:sr}));ur.displayName=`DotsThreeIcon`;var dr=ur,fr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:cr}));fr.displayName=`PencilSimpleIcon`;var pr=fr,mr=B.forwardRef((e,t)=>B.createElement(d,{ref:t,...e,weights:lr}));mr.displayName=`TrashIcon`;var hr=mr,gr=[`dashboards`],_r=3e4;async function $(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await ee(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw new M(s.message??`Request failed (${o.status})`,o.status,s.problems??[]);return s}var vr=e=>`/api/dashboards/${encodeURIComponent(e)}`,yr=()=>$(`/api/dashboards`).then(e=>e.dashboards),br=(e,t)=>$(vr(e),{signal:t}),xr=(e,t)=>$(`${vr(e)}/versions`,{signal:t}).then(e=>e.versions),Sr=(e,t,n)=>$(`${vr(e)}/versions/${t}`,{signal:n}),Cr=(e,t)=>$(`${vr(e)}/versions/${t}/restore`,{method:`POST`}),wr=(e,t,n,r)=>$(vr(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),Tr=(e,t,n,r)=>$(vr(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}}),Er=(e,t)=>$(`/api/panels/query`,{method:`POST`,json:e,signal:t}).then(e=>e.results),Dr=(e,t)=>$(`/api/annotations`,{method:`POST`,json:e,signal:t}),Or=(e,t)=>$(`/api/panels/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),kr=(e,t)=>$(`/api/panels/exemplars`,{method:`POST`,json:e,signal:t});function Ar(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`200`});return $(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function jr(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function Mr(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return jr(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function Nr(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function Pr(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var Fr=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],Ir=[`off`,`10s`,`30s`,`1m`,`5m`],Lr=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},Rr=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function zr(e){let t={};typeof e.range==`string`&&Fr.includes(e.range)?t.range=e.range:Lr(e.from)&&Lr(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=Rr(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=jr(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function Br(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function Vr(e,t){let n=new URL(e);return n.search=Nr(Br({...zr(Pr(n.search)),drill:JSON.stringify(t)})),n.href}function Hr(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var Ur=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],Wr=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],Gr=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],Kr=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],qr=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],Jr=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],Yr={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},Xr={dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`],light:[`#2a78d6`,`#eb6834`,`#1baf7a`,`#4a3aa7`,`#eda100`,`#e87ba4`]},Zr={micro:11,small:12,body:14,title:16,section:22,page:32},Qr={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},$r={brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},ei={light:7,dark:5};function ti(e){let t=e.replace(`#`,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(2)+.0722*r(4)}function ni(e){let t=ti(e),n=1.05/(t+.05);return(t+.05)/.05>n?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function ri(e){return Object.fromEntries(Object.entries($r).map(([t,n])=>[`--fanout-color-${t}-contrast`,ni(n[ei[e]])]))}function ii(e){return t=>{let n=t.color??si.primaryColor,r=e({...t,color:n}),i=t.variant===`filled`||t.variant===void 0;return t.autoContrast===!1||!i||!Object.hasOwn($r,n)?r:{...r,color:`var(--fanout-color-${n}-contrast)`}}}var ai=.25,oi={xs:9,sm:10,md:11,lg:13,xl:16},si={primaryColor:`brand`,primaryShade:ei,autoContrast:!0,luminanceThreshold:ai,colors:{dark:Ur,brand:Wr,ok:Gr,warn:Kr,bad:qr,info:Jr},defaultRadius:`md`,fontFamily:Qr.body,fontFamilyMonospace:Qr.display,headings:{fontFamily:Qr.body,fontWeight:`600`},cursorType:`pointer`,components:{Tabs:{styles:(e,t)=>({tab:ui(t.color,`--tabs-text-color`)})},Pagination:{styles:(e,t)=>({control:ui(t.color,`--pagination-active-color`)})},Badge:{vars:(e,t)=>({root:li(t.size)})}}},ci=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":Yr.light.muted,...ri(`light`)},dark:ri(`dark`)});function li(e){let t=oi[e??`md`];return t===void 0||t>=Zr.micro?{}:{"--badge-fz":`${Zr.micro/16}rem`}}function ui(e,t){return!e||e===si.primaryColor?{[t]:`var(--fanout-color-${si.primaryColor}-contrast)`}:{}}export{Dt as $,yr as A,pr as B,Mr as C,br as D,_r as E,Er as F,an as G,Q as H,wr as I,Bt as J,rn as K,Or as L,Tr as M,Dr as N,Ar as O,kr as P,kt as Q,Cr as R,Nr as S,gr as T,Tn as U,dr as V,J as W,Vt as X,Ht as Y,At as Z,zr as _,ii as a,lt as at,Br as b,Yr as c,Ue as ct,Gr as d,Le as dt,St as et,Xr as f,Hr as g,Vr as h,ti as i,ft as it,xr as j,Sr as k,Qr as l,Be as lt,Kr as m,si as n,yt as nt,qr as o,rt as ot,Zr as p,G as q,ni as r,vt as rt,Wr as s,ot as st,ci as t,bt as tt,Jr as u,Re as ut,Fr as v,jr as w,Pr as x,Ir as y,hr as z}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index e3b2ca265..e4dc6da68 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -21,16 +21,16 @@ document.documentElement.setAttribute("data-mantine-color-scheme", computed); } catch (e) {} - + - + - + diff --git a/site/src/content/docs/explanation/authentication-modes.mdx b/site/src/content/docs/explanation/authentication-modes.mdx index 0de12eef3..da11af7c6 100644 --- a/site/src/content/docs/explanation/authentication-modes.mdx +++ b/site/src/content/docs/explanation/authentication-modes.mdx @@ -25,6 +25,25 @@ designed path, not a workaround — see In local mode, roles are managed inside Fanout. +### Account profiles and suspension + +User responses from `GET /api/auth/me` and `GET /api/users` use `display_name` +and `status`. Status is `active` or `suspended`; roles remain `viewer`, +`operator`, and `admin`. + +Administrators provision users with `POST /api/users`, supplying `email`, +`display_name`, and `role`. New users have status `active`. Profile edits use +`PATCH /api/users/{id}` with only `email` and `display_name`. Change roles with +`PATCH /api/users/{id}/role` and a body such as `{"role":"viewer"}`; suspend an +account with `PATCH /api/users/{id}/status` and `{"status":"suspended"}`. +Use `{"status":"active"}` on that same status route to restore sign-in. +Unknown fields and invalid statuses return `400`. + +Email, role, and status changes revoke existing browser sessions. Suspension +blocks both local and OIDC sign-in, as well as OAuth token use. Restoring status +does not restore revoked sessions. The last active administrator cannot be +demoted, suspended, or deleted. These account rules apply in both auth modes. + ### Self-signup `FANOUT_SELF_SIGNUP` (default `false`) lets anyone who can receive an email code diff --git a/site/src/content/docs/reference/http-routes.mdx b/site/src/content/docs/reference/http-routes.mdx index 84b3cdbf3..d4ecf96a9 100644 --- a/site/src/content/docs/reference/http-routes.mdx +++ b/site/src/content/docs/reference/http-routes.mdx @@ -110,6 +110,8 @@ Capabilities map to roles in [roles](/reference/roles). | `DELETE` | `/api/users/:id` | `users:manage` | | `PATCH` | `/api/users/:id` | `users:manage` | | `POST` | `/api/users/:id/access/revoke` | `users:manage` | +| `PATCH` | `/api/users/:id/role` | `users:manage` | +| `PATCH` | `/api/users/:id/status` | `users:manage` | | `GET` | `/debug/pprof/` | `operations:read` | | `GET` | `/debug/pprof/:name` | `operations:read` | | `GET` | `/debug/pprof/cmdline` | `operations:read` | diff --git a/site/src/content/docs/start/first-boot.mdx b/site/src/content/docs/start/first-boot.mdx index 00d959a2f..1d7de0567 100644 --- a/site/src/content/docs/start/first-boot.mdx +++ b/site/src/content/docs/start/first-boot.mdx @@ -62,6 +62,9 @@ Open the URL, create the administrator, and **save the ingest token shown after setup**. The raw token is displayed once; Fanout stores only its hash and cannot show it again. +The setup form sends `email`, `display_name`, and `setup_token` to +`POST /api/auth/setup`. The first administrator starts with status `active`. + The warning in the banner is not boilerplate. The URL carries a credential that creates an administrator, and container logs are routinely shipped somewhere else. Treat a leaked setup URL as an unclaimed admin account and restart with a diff --git a/ui/host/e2e/global-setup.ts b/ui/host/e2e/global-setup.ts index e4f2f278a..e2ec71c08 100644 --- a/ui/host/e2e/global-setup.ts +++ b/ui/host/e2e/global-setup.ts @@ -106,7 +106,7 @@ export default async function globalSetup() { const response = await safeRequest("/readyz", () => api!.get("/readyz", { timeout: Math.max(1, Math.min(1000, startDeadline - Date.now())) })); return response.status() === 200 ? undefined : `HTTP ${response.status()} /readyz`; }, 100); - const { body: setup } = await requestJSON("/api/auth/setup", { email: "smoke@example.test", name: "Browser smoke", setup_token: decodeURIComponent(token) }); + const { body: setup } = await requestJSON("/api/auth/setup", { email: "smoke@example.test", display_name: "Browser smoke", setup_token: decodeURIComponent(token) }); const { ingest_token: ingestToken } = setup as { ingest_token?: string }; if (!ingestToken) throw new Error("Setup returned no ingest credential"); const tokenFile = join(dir, "ingest-token"); diff --git a/ui/host/src/answer-only.test.tsx b/ui/host/src/answer-only.test.tsx index 24ced37fd..4a764aa2f 100644 --- a/ui/host/src/answer-only.test.tsx +++ b/ui/host/src/answer-only.test.tsx @@ -10,7 +10,7 @@ import { useFanoutApp } from "./app-context"; vi.mock("./auth", () => ({ default: ({ children }: { children: React.ReactNode }) => children, useRuntimeStatus: () => ({ agent_available: true, setup_required: false, auth_mode: "local" }), - useViewer: () => ({ id: "viewer", email: "viewer@example.test", name: "Viewer", role: "viewer" }), + useViewer: () => ({ id: "viewer", email: "viewer@example.test", display_name: "Viewer", status: "active" as const, role: "viewer" }), authorizedFetch: (input: RequestInfo | URL, init?: RequestInit) => fetch(input, init), logout: vi.fn(), clearSession: vi.fn(), })); diff --git a/ui/host/src/app.test.tsx b/ui/host/src/app.test.tsx index 6a11f7f3f..b93d087a4 100644 --- a/ui/host/src/app.test.tsx +++ b/ui/host/src/app.test.tsx @@ -30,8 +30,8 @@ vi.mock("@ag-ui/client", () => ({ }, })); -const defaultViewer = { id: "viewer-1", email: "v@example.com", name: "Vee", role: "admin" }; -const viewerMock = vi.hoisted(() => ({ current: { id: "viewer-1", email: "v@example.com", name: "Vee", role: "admin" } })); +const defaultViewer = { id: "viewer-1", email: "v@example.com", display_name: "Vee", status: "active" as const, role: "admin" }; +const viewerMock = vi.hoisted(() => ({ current: { id: "viewer-1", email: "v@example.com", display_name: "Vee", status: "active" as const, role: "admin" } })); vi.mock("./auth", () => ({ default: ({ children }: { children: React.ReactNode }) => children, @@ -366,7 +366,7 @@ describe("Session", () => { }); it("falls back to the email initial when the viewer's name is only whitespace", async () => { - viewerMock.current = { id: "viewer-1", email: "v@example.com", name: " ", role: "admin" }; + viewerMock.current = { id: "viewer-1", email: "v@example.com", display_name: " ", status: "active" as const, role: "admin" }; const rootRoute = createRootRoute({ component: App }); const chatIndex = createRoute({ getParentRoute: () => rootRoute, path: "/chat/", component: ChatPage }); const router = createRouter({ routeTree: rootRoute.addChildren([chatIndex]) }); diff --git a/ui/host/src/auth.test.tsx b/ui/host/src/auth.test.tsx index be4172a11..79064743b 100644 --- a/ui/host/src/auth.test.tsx +++ b/ui/host/src/auth.test.tsx @@ -191,12 +191,13 @@ describe("AuthGate OAuth return", () => { fetchMock.mockImplementation(async (input) => authResponse(input, { id: "viewer-123", email: "v@example.com", - name: "Vee", + display_name: "Vee", + status: "active", role: "viewer", })); function Probe() { const viewer = useViewer(); - return
Signed in as {viewer.email} ({viewer.role})
; + return
Signed in as {viewer.display_name}: {viewer.email} ({viewer.role}, {viewer.status})
; } const container = document.createElement("div"); document.body.append(container); @@ -208,7 +209,38 @@ describe("AuthGate OAuth return", () => { , )); - await vi.waitFor(() => expect(document.body.textContent).toContain("Signed in as v@example.com (viewer)")); + await vi.waitFor(() => expect(document.body.textContent).toContain("Signed in as Vee: v@example.com (viewer, active)")); + await act(async () => root.unmount()); + }); + + it("sends display_name when setting up the first administrator", async () => { + window.happyDOM.setURL("https://fanout.example.com/"); + let setupBody: unknown; + fetchMock.mockImplementation(async (input, init) => { + const path = String(input); + if (path === "/api/auth/status") return json({ setup_required: true, auth_mode: "local", agent_available: true, smtp_configured: false, self_signup: false }); + if (path === "/api/auth/me") return json({ message: "not authenticated" }, 401); + if (path === "/api/auth/setup") { + setupBody = JSON.parse(String(init?.body)); + return json({ status: "authenticated" }); + } + throw new Error(`unexpected request: ${path}`); + }); + const container = document.createElement("div"); + document.body.append(container); + const root = createRoot(container); + await act(async () => root.render(
Fanout application
)); + await vi.waitFor(() => expect(document.body.textContent).toContain("Create the first admin")); + const inputs = document.querySelectorAll('form input'); + expect(inputs).toHaveLength(3); + await act(async () => { + for (const [index, value] of ["admin@example.com", "First Admin", "setup-credential"].entries()) { + Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(inputs[index], value); + inputs[index].dispatchEvent(new Event("input", { bubbles: true })); + } + }); + await act(async () => document.querySelector("form")!.dispatchEvent(new Event("submit", { bubbles: true, cancelable: true }))); + await vi.waitFor(() => expect(setupBody).toEqual({ email: "admin@example.com", display_name: "First Admin", setup_token: "setup-credential" })); await act(async () => root.unmount()); }); diff --git a/ui/host/src/auth.tsx b/ui/host/src/auth.tsx index 31e8bedab..df1581c41 100644 --- a/ui/host/src/auth.tsx +++ b/ui/host/src/auth.tsx @@ -23,7 +23,7 @@ export function useRuntimeStatus(): Status { return status; } -export type Viewer = { id: string; email: string; name: string; role: string }; +export type Viewer = { id: string; email: string; display_name: string; status: "active" | "suspended"; role: string }; const ViewerContext = createContext(null); export function useViewer(): Viewer { @@ -36,10 +36,12 @@ function viewerFromMe(user: unknown): Viewer | null { if (!user || typeof user !== "object") return null; const record = user as Record; if (typeof record.id !== "string" || record.id === "") return null; + if (record.status !== "active" && record.status !== "suspended") return null; return { id: record.id, email: typeof record.email === "string" ? record.email : "", - name: typeof record.name === "string" ? record.name : "", + display_name: typeof record.display_name === "string" ? record.display_name : "", + status: record.status, role: typeof record.role === "string" ? record.role : "", }; } @@ -106,7 +108,7 @@ export default function AuthGate({ children }: { children: ReactNode }) { const [account, setAccount] = useState(null); const [sessionReady, setSessionReady] = useState(false); const [email, setEmail] = useState(""); - const [name, setName] = useState(""); + const [displayName, setDisplayName] = useState(""); const [setupToken, setSetupToken] = useState(readSetupTokenFromURL); const [loginToken, setLoginToken] = useState(readLoginTokenFromURL); const [code, setCode] = useState(""); @@ -225,7 +227,7 @@ export default function AuthGate({ children }: { children: ReactNode }) { if (!status) return Fanout is unavailable{error || "Authentication status could not be loaded."}; if (authenticated && returnTo) return null; if (authenticated) return - {children} + {children} ; if (status && !status.setup_required && status.auth_mode === "oidc") { @@ -291,7 +293,7 @@ export default function AuthGate({ children }: { children: ReactNode }) { setError(""); try { if (status?.setup_required) { - const result = await jsonRequest("/api/auth/setup", { email, name, setup_token: setupToken }) as SetupResult; + const result = await jsonRequest("/api/auth/setup", { email, display_name: displayName, setup_token: setupToken }) as SetupResult; if (result.ingest_token) setSetupResult(result); else { setViewer("user"); void refreshAccount(); } } else if (!codeSent) { await sendCode(); @@ -329,7 +331,7 @@ export default function AuthGate({ children }: { children: ReactNode }) {
setEmail(event.currentTarget.value)} disabled={codeSent} variant="filled" radius="md" size="md" autoFocus={!codeSent} /> - {status?.setup_required && setName(event.currentTarget.value)} variant="filled" radius="md" size="md" />} + {status?.setup_required && setDisplayName(event.currentTarget.value)} variant="filled" radius="md" size="md" />} {status?.setup_required && setSetupToken(event.currentTarget.value)} autoComplete="one-time-code" variant="filled" radius="md" size="md" />} {onCodeStep && Verification code diff --git a/ui/host/src/chat.test.tsx b/ui/host/src/chat.test.tsx index 4216202dd..5316a4e41 100644 --- a/ui/host/src/chat.test.tsx +++ b/ui/host/src/chat.test.tsx @@ -14,7 +14,7 @@ vi.mock("./mcp-app-frame", () => ({ default: () =>
Panel fra vi.mock("./auth", () => ({ default: ({ children }: { children: React.ReactNode }) => children, useRuntimeStatus: () => ({ agent_available: true, setup_required: false, auth_mode: "local" }), - useViewer: () => ({ id: "viewer", email: "viewer@example.test", name: "Viewer", role: "admin" }), + useViewer: () => ({ id: "viewer", email: "viewer@example.test", display_name: "Viewer", status: "active" as const, role: "admin" }), authorizedFetch: (input: RequestInfo | URL, init?: RequestInit) => fetch(input, init), logout: vi.fn(), clearSession: vi.fn(), })); diff --git a/ui/host/src/dashboards/page.test.tsx b/ui/host/src/dashboards/page.test.tsx index ed80be254..bc5076c99 100644 --- a/ui/host/src/dashboards/page.test.tsx +++ b/ui/host/src/dashboards/page.test.tsx @@ -13,7 +13,7 @@ import { assertServiceMapDOM } from "../../tests/service-map-collector"; const viewer = vi.hoisted(() => ({ role: "viewer" })); vi.mock("../auth", async (importOriginal) => ({ ...await importOriginal(), - useViewer: () => ({ id: "viewer", email: "viewer@example.test", name: "Viewer", role: viewer.role }), + useViewer: () => ({ id: "viewer", email: "viewer@example.test", display_name: "Viewer", status: "active" as const, role: viewer.role }), })); const charts = vi.hoisted(() => ({ option: vi.fn() })); diff --git a/ui/host/src/settings.test.tsx b/ui/host/src/settings.test.tsx index f1abe457e..64b4cefd6 100644 --- a/ui/host/src/settings.test.tsx +++ b/ui/host/src/settings.test.tsx @@ -9,7 +9,7 @@ const fetchMock = vi.fn(); let role = "admin"; vi.mock("./auth", () => ({ - useViewer: () => ({ id: "u1", email: "v@labstack.com", name: "V", role }), + useViewer: () => ({ id: "u1", email: "v@labstack.com", display_name: "V", status: "active" as const, role }), authorizedFetch: (url: string, init?: RequestInit) => fetchMock(url, init), })); diff --git a/ui/host/src/shell.tsx b/ui/host/src/shell.tsx index 8f3aa3dbb..0685e764a 100644 --- a/ui/host/src/shell.tsx +++ b/ui/host/src/shell.tsx @@ -92,7 +92,7 @@ export default function Shell({ children }: { children: ReactNode }) { function AccountMenu({ onError }: { onError: (message: string) => void }) { const navigate = useNavigate(); const viewer = useViewer(); - const label = viewer.name.trim() || viewer.email.trim() || "?"; + const label = viewer.display_name.trim() || viewer.email.trim() || "?"; const initial = label.charAt(0).toUpperCase(); return