From e6e9ddc47e6c7d03bc66d7f4b663599dc3fb2655 Mon Sep 17 00:00:00 2001 From: David Brackbill Date: Fri, 10 Jul 2026 10:59:48 -0700 Subject: [PATCH 1/2] perf(dev-server): fetch flags concurrently on startup The dev server paginated the flag list serially (following next-links at 100/page), taking up to ~50s in CI on large projects. Fetch pages concurrently instead: pull page 0, and while pages come back full, fetch the rest in bounded concurrent batches until a short page ends the list. - New internal.FetchPagesConcurrently paginator (with tests), replacing the serial GetPaginatedItems. It never trusts the API's optional total count (which reads back as 0 when absent and would truncate large projects) - a short page is the only end-of-list signal. - Retry429s: guard against a nil response before dereferencing StatusCode, so a transport-level failure returns an error instead of panicking. Api.GetAllFlags keeps its signature, so nothing downstream changes. Claude --- internal/dev_server/adapters/api.go | 35 +-- .../dev_server/adapters/internal/api_util.go | 103 +++++---- .../adapters/internal/api_util_test.go | 200 ++++++------------ 3 files changed, 140 insertions(+), 198 deletions(-) diff --git a/internal/dev_server/adapters/api.go b/internal/dev_server/adapters/api.go index c968b3ac..e7691830 100644 --- a/internal/dev_server/adapters/api.go +++ b/internal/dev_server/adapters/api.go @@ -47,7 +47,7 @@ func (a apiClientApi) GetSdkKey(ctx context.Context, projectKey, environmentKey func (a apiClientApi) GetAllFlags(ctx context.Context, projectKey string) ([]ldapi.FeatureFlag, error) { log.Printf("Fetching all flags for project '%s'", projectKey) - flags, err := a.getFlags(ctx, projectKey, nil) + flags, err := a.getFlags(ctx, projectKey) if err != nil { err = errors.Wrap(err, "unable to get all flags from LD API") } @@ -63,23 +63,30 @@ func (a apiClientApi) GetProjectEnvironments(ctx context.Context, projectKey str return environments, err } -func (a apiClientApi) getFlags(ctx context.Context, projectKey string, href *string) ([]ldapi.FeatureFlag, error) { - return internal.GetPaginatedItems(ctx, projectKey, href, func(ctx context.Context, projectKey string, limit, offset *int64) (flags *ldapi.FeatureFlags, err error) { - // loop until we do not get rate limited - query := a.apiClient.FeatureFlagsApi.GetFeatureFlags(ctx, projectKey).Limit(100) - query = query.Filter("purpose:all+!(holdout)") - - if limit != nil { - query = query.Limit(*limit) - } +const ( + flagsPageSize = 100 + flagsConcurrency = 6 +) - if offset != nil { - query = query.Offset(*offset) - } - return internal.Retry429s(query.Execute) +// getFlags pages the flags list concurrently (see internal.FetchPagesConcurrently). +func (a apiClientApi) getFlags(ctx context.Context, projectKey string) ([]ldapi.FeatureFlag, error) { + return internal.FetchPagesConcurrently(flagsPageSize, flagsConcurrency, func(offset int64) ([]ldapi.FeatureFlag, error) { + return a.getFlagsPage(ctx, projectKey, offset) }) } +func (a apiClientApi) getFlagsPage(ctx context.Context, projectKey string, offset int64) ([]ldapi.FeatureFlag, error) { + query := a.apiClient.FeatureFlagsApi.GetFeatureFlags(ctx, projectKey). + Filter("purpose:all+!(holdout)"). + Limit(flagsPageSize). + Offset(offset) + flags, err := internal.Retry429s(query.Execute) + if err != nil { + return nil, err + } + return flags.Items, nil +} + func (a apiClientApi) getEnvironments(ctx context.Context, projectKey string, href *string, query string, limit *int) ([]ldapi.Environment, error) { request := a.apiClient.EnvironmentsApi.GetEnvironmentsByProject(ctx, projectKey) diff --git a/internal/dev_server/adapters/internal/api_util.go b/internal/dev_server/adapters/internal/api_util.go index 8a2b3d33..1e7474e0 100644 --- a/internal/dev_server/adapters/internal/api_util.go +++ b/internal/dev_server/adapters/internal/api_util.go @@ -1,72 +1,63 @@ package internal import ( - "context" "log" "net/http" - "net/url" "strconv" + "sync" "time" - "github.com/launchdarkly/api-client-go/v14" "github.com/pkg/errors" ) -func GetPaginatedItems[T any, R interface { - GetItems() []T - GetLinks() map[string]ldapi.Link -}](ctx context.Context, projectKey string, href *string, fetchFunc func(context.Context, string, *int64, *int64) (R, error)) ([]T, error) { - var result R - var err error - - if href == nil { - result, err = fetchFunc(ctx, projectKey, nil, nil) - if err != nil { - return nil, err - } - } else { - limit, offset, err := parseHref(*href) - if err != nil { - return nil, errors.Wrapf(err, "unable to parse href for next link: %s", *href) - } - result, err = fetchFunc(ctx, projectKey, &limit, &offset) - if err != nil { - return nil, err - } +// FetchPagesConcurrently returns every item across an offset-paginated list. +// +// It fetches page 0, and only if that page is full keeps pulling pages in +// bounded concurrent batches (concurrency at a time) until a short page marks +// the end of the list. It deliberately never relies on a reported total count: +// that field is optional and reads back as 0 when absent, which would silently +// truncate a large result set. A short (or empty) page is the only end signal. +// Small lists cost a single request; large ones parallelise instead of paging +// serially. The first page error is returned as-is. +func FetchPagesConcurrently[T any](pageSize, concurrency int, fetch func(offset int64) ([]T, error)) ([]T, error) { + first, err := fetch(0) + if err != nil { + return nil, err + } + all := first + if len(first) < pageSize { + return all, nil } - items := result.GetItems() + for offset := int64(pageSize); ; offset += int64(concurrency) * int64(pageSize) { + batch := make([][]T, concurrency) + errs := make([]error, concurrency) + var wg sync.WaitGroup + for i := 0; i < concurrency; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + batch[i], errs[i] = fetch(offset + int64(i)*int64(pageSize)) + }(i) + } + wg.Wait() - if links := result.GetLinks(); links != nil { - if next, ok := links["next"]; ok && next.Href != nil { - newItems, err := GetPaginatedItems(ctx, projectKey, next.Href, fetchFunc) - if err != nil { - return nil, err + // Pages are contiguous by offset, so the first short/empty page ends the + // list and every page after it in the batch is empty. + done := false + for i := 0; i < concurrency; i++ { + if errs[i] != nil { + return nil, errs[i] + } + all = append(all, batch[i]...) + if len(batch[i]) < pageSize { + done = true } - items = append(items, newItems...) + } + if done { + return all, nil } } - - return items, nil -} - -func parseHref(href string) (limit, offset int64, err error) { - parsedUrl, err := url.Parse(href) - if err != nil { - return - } - l, err := strconv.Atoi(parsedUrl.Query().Get("limit")) - if err != nil { - return - } - o, err := strconv.Atoi(parsedUrl.Query().Get("offset")) - if err != nil { - return - } - - limit = int64(l) - offset = int64(o) - return } //go:generate go run go.uber.org/mock/mockgen -destination mocks.go -package internal . MockableTime @@ -91,6 +82,14 @@ func Retry429s[T any](requester func() (T, *http.Response, error)) (result T, er for { var res *http.Response result, res, err = requester() + // On a transport-level failure (DNS, connection refused, timeout) the + // client returns a nil response, so guard before touching it - otherwise + // the deref panics. A 429 arrives as a non-nil error *with* a non-nil + // response, so only bail on a nil response, never on err alone, or we'd + // skip the rate-limit retry below. + if res == nil { + return + } if res.StatusCode == 429 { resetUnixMillisString := res.Header.Get("X-Ratelimit-Reset") resetUnixMillis, strconvErr := strconv.ParseInt(resetUnixMillisString, 10, 64) diff --git a/internal/dev_server/adapters/internal/api_util_test.go b/internal/dev_server/adapters/internal/api_util_test.go index 28d388d0..5a0b59dd 100644 --- a/internal/dev_server/adapters/internal/api_util_test.go +++ b/internal/dev_server/adapters/internal/api_util_test.go @@ -1,149 +1,77 @@ package internal import ( - "context" "net/http" "testing" "time" - ldapi "github.com/launchdarkly/api-client-go/v14" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) -type testItem struct { - ID string -} - -type testResult struct { - items []testItem - links map[string]ldapi.Link -} +func TestFetchPagesConcurrently(t *testing.T) { + const pageSize, concurrency = 100, 6 -func (r testResult) GetItems() []testItem { - return r.items -} - -func (r testResult) GetLinks() map[string]ldapi.Link { - return r.links -} + // pager returns a fetch func that serves `total` sequential ints across + // pages of pageSize, recording every offset requested. + pager := func(total int) (func(offset int64) ([]int, error), *[]int64) { + var requested []int64 + fetch := func(offset int64) ([]int, error) { + requested = append(requested, offset) + var page []int + for i := offset; i < offset+pageSize && i < int64(total); i++ { + page = append(page, int(i)) + } + return page, nil + } + return fetch, &requested + } -func TestGetPaginatedItems(t *testing.T) { - ctx := context.Background() - projectKey := "test-project" + t.Run("single short page costs one request", func(t *testing.T) { + fetch, requested := pager(42) + items, err := FetchPagesConcurrently(pageSize, concurrency, fetch) + require.NoError(t, err) + assert.Len(t, items, 42) + assert.Equal(t, []int64{0}, *requested) + }) - testCases := []struct { - name string - fetchResponses []testResult - expectedItems []testItem - expectedError bool - }{ - { - name: "Single page", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{{ID: "1"}, {ID: "2"}}, - }, - { - name: "Multiple pages", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=2&offset=2")}, - }, - }, - { - items: []testItem{{ID: "3"}, {ID: "4"}}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{{ID: "1"}, {ID: "2"}, {ID: "3"}, {ID: "4"}}, - }, - { - name: "Error on second page", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=2&offset=2")}, - }, - }, - }, - expectedError: true, - }, - { - name: "Empty response", - fetchResponses: []testResult{ - { - items: []testItem{}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{}, - }, - { - name: "Multiple pages with varying item counts", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}, {ID: "3"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=3&offset=3")}, - }, - }, - { - items: []testItem{{ID: "4"}, {ID: "5"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=3&offset=5")}, - }, - }, - { - items: []testItem{{ID: "6"}}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{{ID: "1"}, {ID: "2"}, {ID: "3"}, {ID: "4"}, {ID: "5"}, {ID: "6"}}, - }, - { - name: "Invalid next link", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("invalid-url")}, - }, - }, - }, - expectedError: true, - }, - } + t.Run("exactly one full page still probes for more, then stops", func(t *testing.T) { + fetch, _ := pager(100) + items, err := FetchPagesConcurrently(pageSize, concurrency, fetch) + require.NoError(t, err) + assert.Len(t, items, 100) + }) - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - callCount := 0 - fetchFunc := func(ctx context.Context, projectKey string, limit, offset *int64) (testResult, error) { - if callCount >= len(tc.fetchResponses) { - return testResult{}, assert.AnError - } - result := tc.fetchResponses[callCount] - callCount++ - return result, nil - } + t.Run("many pages are all collected in order", func(t *testing.T) { + fetch, _ := pager(1350) // 13 full pages + a short one + items, err := FetchPagesConcurrently(pageSize, concurrency, fetch) + require.NoError(t, err) + require.Len(t, items, 1350) + for i := range items { + assert.Equal(t, i, items[i]) + } + }) - items, err := GetPaginatedItems(ctx, projectKey, nil, fetchFunc) + t.Run("never trusts a total: keeps paging while pages are full", func(t *testing.T) { + // A source that reports nothing about totals; end is only inferable from + // a short page. 250 items => pages at 0,100,200(short). + fetch, _ := pager(250) + items, err := FetchPagesConcurrently(pageSize, concurrency, fetch) + require.NoError(t, err) + assert.Len(t, items, 250) + }) - if tc.expectedError { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, tc.expectedItems, items) + t.Run("a page error aborts and propagates", func(t *testing.T) { + fetch := func(offset int64) ([]int, error) { + if offset == 0 { + return make([]int, pageSize), nil // full, so it fans out } - }) - } + return nil, assert.AnError + } + _, err := FetchPagesConcurrently(pageSize, concurrency, fetch) + assert.ErrorIs(t, err, assert.AnError) + }) } func TestRetry429s(t *testing.T) { @@ -175,15 +103,23 @@ func TestRetry429s(t *testing.T) { } else { header := make(http.Header) header.Set("X-Ratelimit-Reset", "1000") - return "", &http.Response{StatusCode: 429, Header: header}, nil + // The generated client returns a non-nil error alongside the 429 + // response; the retry must not bail on err alone. + return "", &http.Response{StatusCode: 429, Header: header}, assert.AnError } }) assert.Equal(t, "lol", res) assert.NoError(t, err) assert.Equal(t, 2, called) }) -} -func strPtr(s string) *string { - return &s + t.Run("it returns the error without panicking on a nil response", func(t *testing.T) { + called := 0 + _, err := Retry429s(func() (string, *http.Response, error) { + called++ + return "", nil, assert.AnError + }) + assert.ErrorIs(t, err, assert.AnError) + assert.Equal(t, 1, called) + }) } From 7cd06ee80a7324b62c45229cf7c1abe985090616 Mon Sep 17 00:00:00 2001 From: David Brackbill Date: Fri, 10 Jul 2026 11:38:05 -0700 Subject: [PATCH 2/2] feat(dev-server): add --stream-flag-startup for ~1s health checks Opt-in mode that reports healthy in ~1s on large projects: load flag state off the SDK stream and resolve variation display names from REST in the background, instead of blocking startup on the full flag fetch. Default behavior is unchanged when the flag is off. The background fill reuses the concurrent GetAllFlags, so there's no separate pagination, no placeholder ids, and no stream value capture - it just defers the fetch that already exists. - refreshExternalState: in streaming mode, skip the blocking fetch and keep the stored variations, then schedule the fill after overrides are applied. - FillVariations: detached, panic-recovered, per-project singleflight, bounded retry/backoff; replaces variations via SetAvailableVariationsForProject. - UpdateProject: prune overrides by flag_state, not available_variations, so a resync during the fill window can't wipe live overrides. - variationsFromFlags: guard the nil variation id. - UI polls until variations arrive; a no-op in the default mode. Claude --- cmd/dev_server/flags.go | 5 ++ cmd/dev_server/start_server.go | 4 + .../dev_server/adapters/internal/api_util.go | 25 +----- .../adapters/internal/api_util_test.go | 18 ++++ internal/dev_server/api/patch_project.go | 4 + internal/dev_server/api/post_add_project.go | 4 + internal/dev_server/db/sqlite.go | 41 ++++++++- internal/dev_server/db/sqlite_test.go | 33 +++++++- internal/dev_server/dev_server.go | 3 + internal/dev_server/model/fill_variations.go | 53 ++++++++++++ .../dev_server/model/fill_variations_test.go | 83 +++++++++++++++++++ internal/dev_server/model/mocks/store.go | 14 ++++ internal/dev_server/model/project.go | 45 ++++++++-- internal/dev_server/model/store.go | 3 + internal/dev_server/model/stream_startup.go | 31 +++++++ internal/dev_server/model/sync.go | 5 ++ internal/dev_server/ui/dist/index.html | 34 ++++---- internal/dev_server/ui/src/FlagsPage.tsx | 68 +++++++++++++++ 18 files changed, 423 insertions(+), 50 deletions(-) create mode 100644 internal/dev_server/model/fill_variations.go create mode 100644 internal/dev_server/model/fill_variations_test.go create mode 100644 internal/dev_server/model/stream_startup.go diff --git a/cmd/dev_server/flags.go b/cmd/dev_server/flags.go index 01ba78d8..16f67553 100644 --- a/cmd/dev_server/flags.go +++ b/cmd/dev_server/flags.go @@ -4,4 +4,9 @@ const ( ContextFlag = "context" OverrideFlag = "override" SourceEnvironmentFlag = "source" + + StreamFlagStartupFlag = "stream-flag-startup" + StreamFlagStartupDescription = "Load flag values from the streaming connection at startup and resolve variation " + + "display names from REST in the background. Speeds up startup on large projects (the health check passes in " + + "~1s) at the cost of variation names appearing in the UI a few seconds later." ) diff --git a/cmd/dev_server/start_server.go b/cmd/dev_server/start_server.go index a155d929..19626fec 100644 --- a/cmd/dev_server/start_server.go +++ b/cmd/dev_server/start_server.go @@ -46,6 +46,9 @@ func NewStartServerCmd(client dev_server.Client) *cobra.Command { cmd.Flags().Bool(cliflags.SyncOnceFlag, false, cliflags.SyncOnceFlagDescription) _ = viper.BindPFlag(cliflags.SyncOnceFlag, cmd.Flags().Lookup(cliflags.SyncOnceFlag)) + cmd.Flags().Bool(StreamFlagStartupFlag, false, StreamFlagStartupDescription) + _ = viper.BindPFlag(StreamFlagStartupFlag, cmd.Flags().Lookup(StreamFlagStartupFlag)) + return cmd } @@ -91,6 +94,7 @@ func startServer(client dev_server.Client) func(*cobra.Command, []string) error Port: viper.GetString(cliflags.PortFlag), CorsEnabled: viper.GetBool(cliflags.CorsEnabledFlag), CorsOrigin: viper.GetString(cliflags.CorsOriginFlag), + StreamFlagStartup: viper.GetBool(StreamFlagStartupFlag), InitialProjectSettings: initialSetting, } diff --git a/internal/dev_server/adapters/internal/api_util.go b/internal/dev_server/adapters/internal/api_util.go index 1e7474e0..5bc2c655 100644 --- a/internal/dev_server/adapters/internal/api_util.go +++ b/internal/dev_server/adapters/internal/api_util.go @@ -10,15 +10,7 @@ import ( "github.com/pkg/errors" ) -// FetchPagesConcurrently returns every item across an offset-paginated list. -// -// It fetches page 0, and only if that page is full keeps pulling pages in -// bounded concurrent batches (concurrency at a time) until a short page marks -// the end of the list. It deliberately never relies on a reported total count: -// that field is optional and reads back as 0 when absent, which would silently -// truncate a large result set. A short (or empty) page is the only end signal. -// Small lists cost a single request; large ones parallelise instead of paging -// serially. The first page error is returned as-is. +// FetchPagesConcurrently returns every item across an offset-paginated list, fetching pages in bounded concurrent batches until a short page ends the list. It never trusts a reported total count (0 when absent would truncate); a short page is the only end signal. func FetchPagesConcurrently[T any](pageSize, concurrency int, fetch func(offset int64) ([]T, error)) ([]T, error) { first, err := fetch(0) if err != nil { @@ -42,21 +34,16 @@ func FetchPagesConcurrently[T any](pageSize, concurrency int, fetch func(offset } wg.Wait() - // Pages are contiguous by offset, so the first short/empty page ends the - // list and every page after it in the batch is empty. - done := false + // Stop at the first short/empty page; pages after it are speculative probes past the end, so ignore their errors. for i := 0; i < concurrency; i++ { if errs[i] != nil { return nil, errs[i] } all = append(all, batch[i]...) if len(batch[i]) < pageSize { - done = true + return all, nil } } - if done { - return all, nil - } } } @@ -82,11 +69,7 @@ func Retry429s[T any](requester func() (T, *http.Response, error)) (result T, er for { var res *http.Response result, res, err = requester() - // On a transport-level failure (DNS, connection refused, timeout) the - // client returns a nil response, so guard before touching it - otherwise - // the deref panics. A 429 arrives as a non-nil error *with* a non-nil - // response, so only bail on a nil response, never on err alone, or we'd - // skip the rate-limit retry below. + // Only bail on a nil response (transport failure); a 429 comes back as a non-nil error with a non-nil response, so never bail on err alone or the retry is skipped. if res == nil { return } diff --git a/internal/dev_server/adapters/internal/api_util_test.go b/internal/dev_server/adapters/internal/api_util_test.go index 5a0b59dd..1659b8c5 100644 --- a/internal/dev_server/adapters/internal/api_util_test.go +++ b/internal/dev_server/adapters/internal/api_util_test.go @@ -62,6 +62,24 @@ func TestFetchPagesConcurrently(t *testing.T) { assert.Len(t, items, 250) }) + t.Run("an error on a speculative page past the end is ignored", func(t *testing.T) { + // 150 items: page 0 full, offset 100 short (end). Offsets past that are + // speculative probes in the same batch; their errors must not fail the fetch. + fetch := func(offset int64) ([]int, error) { + switch { + case offset == 0: + return make([]int, pageSize), nil + case offset == pageSize: + return make([]int, 50), nil + default: + return nil, assert.AnError + } + } + items, err := FetchPagesConcurrently(pageSize, concurrency, fetch) + require.NoError(t, err) + assert.Len(t, items, 150) + }) + t.Run("a page error aborts and propagates", func(t *testing.T) { fetch := func(offset int64) ([]int, error) { if offset == 0 { diff --git a/internal/dev_server/api/patch_project.go b/internal/dev_server/api/patch_project.go index c7fcd4a6..49e25c9e 100644 --- a/internal/dev_server/api/patch_project.go +++ b/internal/dev_server/api/patch_project.go @@ -16,6 +16,10 @@ func (s server) PatchProject(ctx context.Context, request PatchProjectRequestObj return PatchProject404Response{}, nil } + if model.StreamStartupFromContext(ctx) { + model.FillVariationsAsync(ctx, request.ProjectKey) + } + response := ProjectJSONResponse{ LastSyncedFromSource: project.LastSyncTime.Unix(), Context: project.Context, diff --git a/internal/dev_server/api/post_add_project.go b/internal/dev_server/api/post_add_project.go index 3933252b..a076bbc4 100644 --- a/internal/dev_server/api/post_add_project.go +++ b/internal/dev_server/api/post_add_project.go @@ -30,6 +30,10 @@ func (s server) PostAddProject(ctx context.Context, request PostAddProjectReques return nil, err } + if model.StreamStartupFromContext(ctx) { + model.FillVariationsAsync(ctx, request.ProjectKey) + } + response := ProjectJSONResponse{ LastSyncedFromSource: project.LastSyncTime.Unix(), Context: project.Context, diff --git a/internal/dev_server/db/sqlite.go b/internal/dev_server/db/sqlite.go index 5bd66ec7..69b357c0 100644 --- a/internal/dev_server/db/sqlite.go +++ b/internal/dev_server/db/sqlite.go @@ -114,12 +114,11 @@ func (s *Sqlite) UpdateProject(ctx context.Context, project model.Project) (bool return false, err } - // Delete all overrides that are linked to a flag that is no longer in the project - // https://github.com/launchdarkly/ldcli/issues/541#issuecomment-2920512092 + // Prune overrides for flags no longer in the project. Key off flag_state (always fully populated from the SDK), not available_variations, which lags the background fill in streaming mode and would wrongly wipe overrides. _, err = tx.ExecContext(ctx, ` DELETE FROM overrides - WHERE project_key = ? AND flag_key NOT IN (SELECT flag_key FROM available_variations WHERE project_key = ?) - `, project.Key, project.Key) + WHERE project_key = ? AND flag_key NOT IN (SELECT key FROM json_each(?)) + `, project.Key, string(flagsStateJson)) if err != nil { return false, err } @@ -174,6 +173,40 @@ func InsertAvailableVariations(ctx context.Context, tx *sql.Tx, project model.Pr return nil } +// SetAvailableVariationsForProject replaces the project's stored variations only (not flag state or overrides), so the background fill can refresh names in isolation. +func (s *Sqlite) SetAvailableVariationsForProject(ctx context.Context, projectKey string, variations []model.FlagVariation) (err error) { + tx, err := s.database.BeginTx(ctx, nil) + if err != nil { + return err + } + defer func() { + if err != nil { + _ = tx.Rollback() + } + }() + + _, err = tx.ExecContext(ctx, `DELETE FROM available_variations WHERE project_key = ?`, projectKey) + if err != nil { + return err + } + for _, variation := range variations { + var jsonValue []byte + jsonValue, err = variation.Value.MarshalJSON() + if err != nil { + return err + } + _, err = tx.ExecContext(ctx, ` + INSERT INTO available_variations + (project_key, flag_key, id, value, description, name) + VALUES (?, ?, ?, ?, ?, ?) + `, projectKey, variation.FlagKey, variation.Id, string(jsonValue), variation.Description, variation.Name) + if err != nil { + return err + } + } + return tx.Commit() +} + func (s *Sqlite) InsertProject(ctx context.Context, project model.Project) (err error) { flagsStateJson, err := json.Marshal(project.AllFlagsState) if err != nil { diff --git a/internal/dev_server/db/sqlite_test.go b/internal/dev_server/db/sqlite_test.go index 3eb3cb46..35855a4d 100644 --- a/internal/dev_server/db/sqlite_test.go +++ b/internal/dev_server/db/sqlite_test.go @@ -406,7 +406,10 @@ func TestDBFunctions(t *testing.T) { require.Len(t, overrides, 1) assert.Equal(t, override, overrides[0]) - // update the project to remove flag-1 + // update the project so flag-1 is no longer part of the flag state + project.AllFlagsState = model.FlagsState{ + "flag-2": model.FlagState{Value: ldvalue.Bool(true), Version: 1}, + } project.AvailableVariations = []model.FlagVariation{ { FlagKey: "flag-2", @@ -421,4 +424,32 @@ func TestDBFunctions(t *testing.T) { require.NoError(t, err) require.Len(t, overrides, 0) }) + + t.Run("UpdateProject keeps overrides when variations are empty but the flag still exists", func(t *testing.T) { + // Streaming startup leaves variations empty until the background fill runs; a resync in that window must keep overrides for flags still in the flag state. + project := projects[2] + + override, err := store.UpsertOverride(ctx, model.Override{ + ProjectKey: project.Key, + FlagKey: "flag-1", + Value: ldvalue.Bool(false), + Active: true, + Version: 1, + }) + require.NoError(t, err) + + project.AllFlagsState = model.FlagsState{ + "flag-1": model.FlagState{Value: ldvalue.Bool(true), Version: 1}, + } + project.AvailableVariations = nil // fill hasn't populated variations yet + + updated, err := store.UpdateProject(ctx, project) + require.NoError(t, err) + require.True(t, updated) + + overrides, err := store.GetOverridesForProject(ctx, project.Key) + require.NoError(t, err) + require.Len(t, overrides, 1) + assert.Equal(t, override, overrides[0]) + }) } diff --git a/internal/dev_server/dev_server.go b/internal/dev_server/dev_server.go index a042e7f3..43033543 100644 --- a/internal/dev_server/dev_server.go +++ b/internal/dev_server/dev_server.go @@ -33,6 +33,7 @@ type ServerParams struct { Port string CorsEnabled bool CorsOrigin string + StreamFlagStartup bool InitialProjectSettings model.InitialProjectSettings } @@ -72,6 +73,7 @@ func (c LDClient) RunServer(ctx context.Context, serverParams ServerParams) { r.Use(model.EventStoreMiddleware(sqlEventStore)) r.Use(model.StoreMiddleware(sqlStore)) r.Use(model.ObserversMiddleware(observers)) + r.Use(model.StreamStartupMiddleware(serverParams.StreamFlagStartup)) r.Handle("/", http.RedirectHandler("/ui/", http.StatusFound)) r.Handle("/ui", http.RedirectHandler("/ui/", http.StatusMovedPermanently)) r.Handle("/ui/{_}.svg", http.StripPrefix("/ui/", ui.AssetHandler)) @@ -103,6 +105,7 @@ func (c LDClient) RunServer(ctx context.Context, serverParams ServerParams) { ctx = adapters.WithApiAndSdk(ctx, *ldClient, serverParams.DevStreamURI) ctx = model.SetObserversOnContext(ctx, observers) ctx = model.ContextWithStore(ctx, sqlStore) + ctx = model.WithStreamStartup(ctx, serverParams.StreamFlagStartup) syncErr := model.CreateOrSyncProject(ctx, serverParams.InitialProjectSettings) if syncErr != nil { log.Fatal(syncErr) diff --git a/internal/dev_server/model/fill_variations.go b/internal/dev_server/model/fill_variations.go new file mode 100644 index 00000000..8f0b75f3 --- /dev/null +++ b/internal/dev_server/model/fill_variations.go @@ -0,0 +1,53 @@ +package model + +import ( + "context" + "log" + "time" + + ldapi "github.com/launchdarkly/api-client-go/v14" + "github.com/launchdarkly/ldcli/internal/dev_server/adapters" +) + +const ( + fillRetries = 3 + fillRetryDelay = 500 * time.Millisecond +) + +// FillVariationsAsync resolves a project's variations from REST in the background. It is a var so tests can stub it. +var FillVariationsAsync = func(ctx context.Context, projectKey string) { + go func() { + // Contain panics so a background failure can't take down the process. + defer func() { + if r := recover(); r != nil { + log.Printf("variation fill: recovered from panic for %q: %v", projectKey, r) + } + }() + FillVariations(context.WithoutCancel(ctx), projectKey) + }() +} + +// FillVariations fetches the project's flags from REST and replaces the stored variations with the resolved values and names. It replaces wholesale, so overlapping runs are safe and it needs no locking. +func FillVariations(ctx context.Context, projectKey string) { + api := adapters.GetApi(ctx) + var flags []ldapi.FeatureFlag + var err error + for attempt := 0; ; attempt++ { + if flags, err = api.GetAllFlags(ctx, projectKey); err == nil { + break + } + if attempt >= fillRetries { + log.Printf("variation fill: fetch failed for %q: %v", projectKey, err) + return + } + select { + case <-ctx.Done(): + return + case <-time.After(fillRetryDelay << attempt): + } + } + + if err := StoreFromContext(ctx).SetAvailableVariationsForProject(ctx, projectKey, variationsFromFlags(flags)); err != nil { + log.Printf("variation fill: store failed for %q: %v", projectKey, err) + } +} diff --git a/internal/dev_server/model/fill_variations_test.go b/internal/dev_server/model/fill_variations_test.go new file mode 100644 index 00000000..54e00636 --- /dev/null +++ b/internal/dev_server/model/fill_variations_test.go @@ -0,0 +1,83 @@ +package model_test + +import ( + "context" + "testing" + + ldapi "github.com/launchdarkly/api-client-go/v14" + "github.com/launchdarkly/go-sdk-common/v3/ldvalue" + "github.com/launchdarkly/go-server-sdk/v7/interfaces/flagstate" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + + adapters_mocks "github.com/launchdarkly/ldcli/internal/dev_server/adapters/mocks" + "github.com/launchdarkly/ldcli/internal/dev_server/model" + "github.com/launchdarkly/ldcli/internal/dev_server/model/mocks" +) + +func strPtr(s string) *string { return &s } + +func TestFillVariations(t *testing.T) { + ctx := context.Background() + ctrl := gomock.NewController(t) + ctx, api, _ := adapters_mocks.WithMockApiAndSdk(ctx, ctrl) + store := mocks.NewMockStore(ctrl) + ctx = model.ContextWithStore(ctx, store) + + api.EXPECT().GetAllFlags(gomock.Any(), "proj").Return([]ldapi.FeatureFlag{{ + Key: "boolFlag", + Variations: []ldapi.Variation{ + {Id: strPtr("t"), Name: strPtr("On"), Value: true}, + {Id: strPtr("f"), Name: strPtr("Off"), Value: false}, + }, + }}, nil) + store.EXPECT().SetAvailableVariationsForProject(gomock.Any(), "proj", gomock.Any()). + DoAndReturn(func(_ context.Context, _ string, vars []model.FlagVariation) error { + require.Len(t, vars, 2) + assert.Equal(t, "t", vars[0].Id) + require.NotNil(t, vars[0].Name) + assert.Equal(t, "On", *vars[0].Name) + return nil + }) + + model.FillVariations(ctx, "proj") +} + +// Streaming mode must not block on the REST fetch: it keeps existing variations and schedules a background fill after overrides are applied. +func TestStreamStartupDefersVariationFetch(t *testing.T) { + filled := make(chan string, 1) + original := model.FillVariationsAsync + model.FillVariationsAsync = func(_ context.Context, projectKey string) { filled <- projectKey } + defer func() { model.FillVariationsAsync = original }() + + ctx := context.Background() + ctrl := gomock.NewController(t) + ctx, api, sdk := adapters_mocks.WithMockApiAndSdk(ctx, ctrl) + store := mocks.NewMockStore(ctrl) + ctx = model.ContextWithStore(ctx, store) + ctx = model.SetObserversOnContext(ctx, model.NewObservers()) + ctx = model.WithStreamStartup(ctx, true) + + allFlagsState := flagstate.NewAllFlagsBuilder(). + AddFlag("boolFlag", flagstate.FlagState{Value: ldvalue.Bool(true)}). + Build() + + api.EXPECT().GetSdkKey(gomock.Any(), "proj", "env").Return("sdk", nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdk").Return(allFlagsState, nil) + // Stream mode preserves existing variations; GetAllFlags has no expectation, so the mock fails if it's called here. + store.EXPECT().GetAvailableVariationsForProject(gomock.Any(), "proj").Return(map[string][]model.Variation{}, nil) + store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(nil) + + err := model.CreateOrSyncProject(ctx, model.InitialProjectSettings{ + Enabled: true, ProjectKey: "proj", EnvKey: "env", + }) + require.NoError(t, err) + + select { + case pk := <-filled: + assert.Equal(t, "proj", pk, "the background fill should be scheduled for the project") + default: + t.Fatal("expected a background variation fill to be scheduled in streaming mode") + } +} diff --git a/internal/dev_server/model/mocks/store.go b/internal/dev_server/model/mocks/store.go index dd037c2e..9b8b578b 100644 --- a/internal/dev_server/model/mocks/store.go +++ b/internal/dev_server/model/mocks/store.go @@ -192,6 +192,20 @@ func (mr *MockStoreMockRecorder) RestoreBackup(ctx, stream any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RestoreBackup", reflect.TypeOf((*MockStore)(nil).RestoreBackup), ctx, stream) } +// SetAvailableVariationsForProject mocks base method. +func (m *MockStore) SetAvailableVariationsForProject(ctx context.Context, projectKey string, variations []model.FlagVariation) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetAvailableVariationsForProject", ctx, projectKey, variations) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetAvailableVariationsForProject indicates an expected call of SetAvailableVariationsForProject. +func (mr *MockStoreMockRecorder) SetAvailableVariationsForProject(ctx, projectKey, variations any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAvailableVariationsForProject", reflect.TypeOf((*MockStore)(nil).SetAvailableVariationsForProject), ctx, projectKey, variations) +} + // UpdateProject mocks base method. func (m *MockStore) UpdateProject(ctx context.Context, project model.Project) (bool, error) { m.ctrl.T.Helper() diff --git a/internal/dev_server/model/project.go b/internal/dev_server/model/project.go index 778bd96b..706a26f1 100644 --- a/internal/dev_server/model/project.go +++ b/internal/dev_server/model/project.go @@ -2,10 +2,12 @@ package model import ( "context" + "fmt" "time" "github.com/pkg/errors" + ldapi "github.com/launchdarkly/api-client-go/v14" "github.com/launchdarkly/go-sdk-common/v3/ldcontext" "github.com/launchdarkly/go-sdk-common/v3/ldvalue" "github.com/launchdarkly/ldcli/internal/dev_server/adapters" @@ -54,6 +56,16 @@ func (project *Project) refreshExternalState(ctx context.Context) error { project.AllFlagsState = flagsState project.LastSyncTime = time.Now() + if StreamStartupFromContext(ctx) { + // Defer the REST fetch to a background fill; keep the stored variations so this write doesn't blank the dropdown, and report healthy now. + existing, err := StoreFromContext(ctx).GetAvailableVariationsForProject(ctx, project.Key) + if err != nil { + return err + } + project.AvailableVariations = flattenVariations(existing) + return nil + } + availableVariations, err := project.fetchAvailableVariations(ctx) if err != nil { return err @@ -62,6 +74,17 @@ func (project *Project) refreshExternalState(ctx context.Context) error { return nil } +// flattenVariations turns the store's per-flag variation map into a flat slice. +func flattenVariations(byFlagKey map[string][]Variation) []FlagVariation { + var all []FlagVariation + for flagKey, variations := range byFlagKey { + for _, variation := range variations { + all = append(all, FlagVariation{FlagKey: flagKey, Variation: variation}) + } + } + return all +} + func UpdateProject(ctx context.Context, projectKey string, context *ldcontext.Context, sourceEnvironmentKey *string) (Project, error) { store := StoreFromContext(ctx) project, err := store.GetDevProject(ctx, projectKey) @@ -125,19 +148,27 @@ func (project Project) GetFlagStateWithOverridesForProject(ctx context.Context) } func (project Project) fetchAvailableVariations(ctx context.Context) ([]FlagVariation, error) { - apiAdapter := adapters.GetApi(ctx) - flags, err := apiAdapter.GetAllFlags(ctx, project.Key) + flags, err := adapters.GetApi(ctx).GetAllFlags(ctx, project.Key) if err != nil { return nil, err } + return variationsFromFlags(flags), nil +} + +// variationsFromFlags flattens REST flags into stored variations. +func variationsFromFlags(flags []ldapi.FeatureFlag) []FlagVariation { var allVariations []FlagVariation for _, flag := range flags { - flagKey := flag.Key - for _, variation := range flag.Variations { + for i, variation := range flag.Variations { + // Guard the nil id: fall back to a unique per-index id, never deref nil or leave an empty id (which would collide). + id := fmt.Sprintf("variation-%d", i) + if variation.Id != nil { + id = *variation.Id + } allVariations = append(allVariations, FlagVariation{ - FlagKey: flagKey, + FlagKey: flag.Key, Variation: Variation{ - Id: *variation.Id, + Id: id, Description: variation.Description, Name: variation.Name, Value: ldvalue.CopyArbitraryValue(variation.Value), @@ -145,7 +176,7 @@ func (project Project) fetchAvailableVariations(ctx context.Context) ([]FlagVari }) } } - return allVariations, nil + return allVariations } func (project Project) fetchFlagState(ctx context.Context) (FlagsState, error) { diff --git a/internal/dev_server/model/store.go b/internal/dev_server/model/store.go index 7a3b3883..289ddb90 100644 --- a/internal/dev_server/model/store.go +++ b/internal/dev_server/model/store.go @@ -28,6 +28,9 @@ type Store interface { UpsertOverride(ctx context.Context, override Override) (Override, error) GetOverridesForProject(ctx context.Context, projectKey string) (Overrides, error) GetAvailableVariationsForProject(ctx context.Context, projectKey string) (map[string][]Variation, error) + // SetAvailableVariationsForProject replaces all stored variations for the + // project (used by the background fill in streaming-startup mode). + SetAvailableVariationsForProject(ctx context.Context, projectKey string, variations []FlagVariation) error // IncrementProjectPayloadVersion atomically increments the payload version for the project and returns the new version. IncrementProjectPayloadVersion(ctx context.Context, projectKey string) (int, error) diff --git a/internal/dev_server/model/stream_startup.go b/internal/dev_server/model/stream_startup.go new file mode 100644 index 00000000..c422c7ab --- /dev/null +++ b/internal/dev_server/model/stream_startup.go @@ -0,0 +1,31 @@ +package model + +import ( + "context" + "net/http" + + "github.com/gorilla/mux" +) + +const ctxKeyStreamStartup = ctxKey("model.StreamStartup") + +// WithStreamStartup records whether streaming-startup mode is enabled: load flag state off the SDK stream and resolve variation names from REST in the background, rather than blocking startup on the full fetch. +func WithStreamStartup(ctx context.Context, enabled bool) context.Context { + return context.WithValue(ctx, ctxKeyStreamStartup, enabled) +} + +// StreamStartupFromContext reports whether streaming-startup mode is enabled (default false). +func StreamStartupFromContext(ctx context.Context) bool { + enabled, ok := ctx.Value(ctxKeyStreamStartup).(bool) + return ok && enabled +} + +// StreamStartupMiddleware puts the streaming-startup mode on the request context so handlers sync the same way startup does. +func StreamStartupMiddleware(enabled bool) mux.MiddlewareFunc { + return func(handler http.Handler) http.Handler { + return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + request = request.WithContext(WithStreamStartup(request.Context(), enabled)) + handler.ServeHTTP(writer, request) + }) + } +} diff --git a/internal/dev_server/model/sync.go b/internal/dev_server/model/sync.go index 6def0ba5..bfe6c8bb 100644 --- a/internal/dev_server/model/sync.go +++ b/internal/dev_server/model/sync.go @@ -55,6 +55,11 @@ func CreateOrSyncProject(ctx context.Context, settings InitialProjectSettings) e } } + // Overrides are applied above; only the cosmetic variation names are deferred, and only in streaming mode. + if StreamStartupFromContext(ctx) { + FillVariationsAsync(ctx, settings.ProjectKey) + } + log.Printf("Successfully synced Initial project [%s]", project.Key) return nil } diff --git a/internal/dev_server/ui/dist/index.html b/internal/dev_server/ui/dist/index.html index ab5af03b..6892adcd 100644 --- a/internal/dev_server/ui/dist/index.html +++ b/internal/dev_server/ui/dist/index.html @@ -13,7 +13,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jv;function Ek(){if(jv)return ut;jv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function w(W){return W===null||typeof W!="object"?null:(W=y&&W[y]||W["@@iterator"],typeof W=="function"?W:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,k={};function _(W,ne,le){this.props=W,this.context=ne,this.refs=k,this.updater=le||$}_.prototype.isReactComponent={},_.prototype.setState=function(W,ne){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,ne,"setState")},_.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function A(){}A.prototype=_.prototype;function R(W,ne,le){this.props=W,this.context=ne,this.refs=k,this.updater=le||$}var M=R.prototype=new A;M.constructor=R,E(M,_.prototype),M.isPureReactComponent=!0;var V=Array.isArray,I=Object.prototype.hasOwnProperty,O={current:null},ee={key:!0,ref:!0,__self:!0,__source:!0};function L(W,ne,le){var G,ce={},$e=null,ke=null;if(ne!=null)for(G in ne.ref!==void 0&&(ke=ne.ref),ne.key!==void 0&&($e=""+ne.key),ne)I.call(ne,G)&&!ee.hasOwnProperty(G)&&(ce[G]=ne[G]);var Ce=arguments.length-2;if(Ce===1)ce.children=le;else if(1>>1,ne=fe[W];if(0>>1;Wl(ce,ue))$el(ke,ce)?(fe[W]=ke,fe[$e]=ue,W=$e):(fe[W]=ce,fe[G]=ue,W=G);else if($el(ke,ue))fe[W]=ke,fe[$e]=ue,W=$e;else break e}}return Pe}function l(fe,Pe){var ue=fe.sortIndex-Pe.sortIndex;return ue!==0?ue:fe.id-Pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],h=[],m=1,y=null,w=3,$=!1,E=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(fe){for(var Pe=n(h);Pe!==null;){if(Pe.callback===null)r(h);else if(Pe.startTime<=fe)r(h),Pe.sortIndex=Pe.expirationTime,t(p,Pe);else break;Pe=n(h)}}function V(fe){if(k=!1,M(fe),!E)if(n(p)!==null)E=!0,Se(I);else{var Pe=n(h);Pe!==null&&se(V,Pe.startTime-fe)}}function I(fe,Pe){E=!1,k&&(k=!1,A(L),L=-1),$=!0;var ue=w;try{for(M(Pe),y=n(p);y!==null&&(!(y.expirationTime>Pe)||fe&&!Y());){var W=y.callback;if(typeof W=="function"){y.callback=null,w=y.priorityLevel;var ne=W(y.expirationTime<=Pe);Pe=e.unstable_now(),typeof ne=="function"?y.callback=ne:y===n(p)&&r(p),M(Pe)}else r(p);y=n(p)}if(y!==null)var le=!0;else{var G=n(h);G!==null&&se(V,G.startTime-Pe),le=!1}return le}finally{y=null,w=ue,$=!1}}var O=!1,ee=null,L=-1,re=5,K=-1;function Y(){return!(e.unstable_now()-Kfe||125W?(fe.sortIndex=ue,t(h,fe),n(p)===null&&fe===n(h)&&(k?(A(L),L=-1):k=!0,se(V,ue-W))):(fe.sortIndex=ne,t(p,fe),E||$||(E=!0,Se(I))),fe},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(fe){var Pe=w;return function(){var ue=w;w=Pe;try{return fe.apply(this,arguments)}finally{w=ue}}}}(I7)),I7}var Yv;function Dk(){return Yv||(Yv=1,F7.exports=_k()),F7.exports}/** + */var qv;function _k(){return qv||(qv=1,function(e){function t(fe,Pe){var ue=fe.length;fe.push(Pe);e:for(;0>>1,ne=fe[W];if(0>>1;Wl(ce,ue))$el(ke,ce)?(fe[W]=ke,fe[$e]=ue,W=$e):(fe[W]=ce,fe[G]=ue,W=G);else if($el(ke,ue))fe[W]=ke,fe[$e]=ue,W=$e;else break e}}return Pe}function l(fe,Pe){var ue=fe.sortIndex-Pe.sortIndex;return ue!==0?ue:fe.id-Pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],h=[],m=1,y=null,w=3,$=!1,E=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(fe){for(var Pe=n(h);Pe!==null;){if(Pe.callback===null)r(h);else if(Pe.startTime<=fe)r(h),Pe.sortIndex=Pe.expirationTime,t(p,Pe);else break;Pe=n(h)}}function I(fe){if(k=!1,M(fe),!E)if(n(p)!==null)E=!0,Se(V);else{var Pe=n(h);Pe!==null&&se(I,Pe.startTime-fe)}}function V(fe,Pe){E=!1,k&&(k=!1,A(R),R=-1),$=!0;var ue=w;try{for(M(Pe),y=n(p);y!==null&&(!(y.expirationTime>Pe)||fe&&!q());){var W=y.callback;if(typeof W=="function"){y.callback=null,w=y.priorityLevel;var ne=W(y.expirationTime<=Pe);Pe=e.unstable_now(),typeof ne=="function"?y.callback=ne:y===n(p)&&r(p),M(Pe)}else r(p);y=n(p)}if(y!==null)var le=!0;else{var G=n(h);G!==null&&se(I,G.startTime-Pe),le=!1}return le}finally{y=null,w=ue,$=!1}}var O=!1,J=null,R=-1,re=5,Z=-1;function q(){return!(e.unstable_now()-Zfe||125W?(fe.sortIndex=ue,t(h,fe),n(p)===null&&fe===n(h)&&(k?(A(R),R=-1):k=!0,se(I,ue-W))):(fe.sortIndex=ne,t(p,fe),E||$||(E=!0,Se(V))),fe},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(fe){var Pe=w;return function(){var ue=w;w=Pe;try{return fe.apply(this,arguments)}finally{w=ue}}}}(I7)),I7}var Yv;function Dk(){return Yv||(Yv=1,F7.exports=_k()),F7.exports}/** * @license React * react-dom.production.min.js * @@ -37,14 +37,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Xv;function Tk(){if(Xv)return On;Xv=1;var e=O5(),t=Dk();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function w(i){return p.call(y,i)?!0:p.call(m,i)?!1:h.test(i)?y[i]=!0:(m[i]=!0,!1)}function $(i,o,d,v){if(d!==null&&d.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return v?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function E(i,o,d,v){if(o===null||typeof o>"u"||$(i,o,d,v))return!0;if(v)return!1;if(d!==null)switch(d.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function k(i,o,d,v,x,S,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=v,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=i,this.type=o,this.sanitizeURL=S,this.removeEmptyString=T}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){_[i]=new k(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];_[o]=new k(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){_[i]=new k(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){_[i]=new k(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){_[i]=new k(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){_[i]=new k(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){_[i]=new k(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){_[i]=new k(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){_[i]=new k(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function R(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(A,R);_[o]=new k(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(A,R);_[o]=new k(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(A,R);_[o]=new k(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!1,!1)}),_.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!0,!0)});function M(i,o,d,v){var x=_.hasOwnProperty(o)?_[o]:null;(x!==null?x.type!==0:v||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function w(i){return p.call(y,i)?!0:p.call(m,i)?!1:h.test(i)?y[i]=!0:(m[i]=!0,!1)}function $(i,o,d,v){if(d!==null&&d.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return v?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function E(i,o,d,v){if(o===null||typeof o>"u"||$(i,o,d,v))return!0;if(v)return!1;if(d!==null)switch(d.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function k(i,o,d,v,x,S,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=v,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=i,this.type=o,this.sanitizeURL=S,this.removeEmptyString=T}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){_[i]=new k(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];_[o]=new k(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){_[i]=new k(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){_[i]=new k(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){_[i]=new k(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){_[i]=new k(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){_[i]=new k(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){_[i]=new k(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){_[i]=new k(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function L(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(A,L);_[o]=new k(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(A,L);_[o]=new k(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(A,L);_[o]=new k(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!1,!1)}),_.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!0,!0)});function M(i,o,d,v){var x=_.hasOwnProperty(o)?_[o]:null;(x!==null?x.type!==0:v||!(2N||x[T]!==S[N]){var H=` -`+x[T].replace(" at new "," at ");return i.displayName&&H.includes("")&&(H=H.replace("",i.displayName)),H}while(1<=T&&0<=N);break}}}finally{le=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ne(i):""}function ce(i){switch(i.tag){case 5:return ne(i.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return i=G(i.type,!1),i;case 11:return i=G(i.type.render,!1),i;case 1:return i=G(i.type,!0),i;default:return""}}function $e(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ee:return"Fragment";case O:return"Portal";case re:return"Profiler";case L:return"StrictMode";case Q:return"Suspense";case J:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Y:return(i.displayName||"Context")+".Consumer";case K:return(i._context.displayName||"Context")+".Provider";case ve:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case me:return o=i.displayName||null,o!==null?o:$e(i.type)||"Memo";case Se:o=i._payload,i=i._init;try{return $e(i(o))}catch{}}return null}function ke(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $e(o);case 8:return o===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Ce(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ge(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Le(i){var o=ge(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),v=""+i[o];if(!i.hasOwnProperty(o)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,S=d.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return x.call(this)},set:function(T){v=""+T,S.call(this,T)}}),Object.defineProperty(i,o,{enumerable:d.enumerable}),{getValue:function(){return v},setValue:function(T){v=""+T},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function _e(i){i._valueTracker||(i._valueTracker=Le(i))}function He(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var d=o.getValue(),v="";return i&&(v=ge(i)?i.checked?"true":"false":i.value),i=v,i!==d?(o.setValue(i),!0):!1}function Xe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function wt(i,o){var d=o.checked;return ue({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function Rt(i,o){var d=o.defaultValue==null?"":o.defaultValue,v=o.checked!=null?o.checked:o.defaultChecked;d=Ce(o.value!=null?o.value:d),i._wrapperState={initialChecked:v,initialValue:d,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function at(i,o){o=o.checked,o!=null&&M(i,"checked",o,!1)}function _t(i,o){at(i,o);var d=Ce(o.value),v=o.type;if(d!=null)v==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?st(i,o.type,d):o.hasOwnProperty("defaultValue")&&st(i,o.type,Ce(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function it(i,o,d){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var v=o.type;if(!(v!=="submit"&&v!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,d||o===i.value||(i.value=o),i.defaultValue=o}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function st(i,o,d){(o!=="number"||Xe(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var l0=Array.isArray;function $t(i,o,d,v){if(i=i.options,o){o={};for(var x=0;x"+o.valueOf().toString()+"",o=qt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function tn(i,o){if(o){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=o;return}}i.textContent=o}var tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pt=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(i){pt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),tt[o]=tt[i]})});function dr(i,o,d){return o==null||typeof o=="boolean"||o===""?"":d||typeof o!="number"||o===0||tt.hasOwnProperty(i)&&tt[i]?(""+o).trim():o+"px"}function T0(i,o){i=i.style;for(var d in o)if(o.hasOwnProperty(d)){var v=d.indexOf("--")===0,x=dr(d,o[d],v);d==="float"&&(d="cssFloat"),v?i.setProperty(d,x):i[d]=x}}var ai=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function En(i,o){if(o){if(ai[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function si(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $u=null;function Cu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Su=null,Gi=null,qi=null;function ad(i){if(i=B0(i)){if(typeof Su!="function")throw Error(n(280));var o=i.stateNode;o&&(o=z2(o),Su(i.stateNode,i.type,o))}}function sd(i){Gi?qi?qi.push(i):qi=[i]:Gi=i}function ud(){if(Gi){var i=Gi,o=qi;if(qi=Gi=null,ad(i),o)for(i=0;i>>=0,i===0?32:31-(bd(i)/xd|0)|0}var jl=64,h2=4194304;function Wl(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Xi(i,o){var d=i.pendingLanes;if(d===0)return 0;var v=0,x=i.suspendedLanes,S=i.pingedLanes,T=d&268435455;if(T!==0){var N=T&~x;N!==0?v=Wl(N):(S&=T,S!==0&&(v=Wl(S)))}else T=d&~x,T!==0?v=Wl(T):S!==0&&(v=Wl(S));if(v===0)return 0;if(o!==0&&o!==v&&(o&x)===0&&(x=v&-v,S=o&-o,x>=S||x===16&&(S&4194240)!==0))return o;if((v&4)!==0&&(v|=d&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=v;0d;d++)o.push(i);return o}function na(i,o,d){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Gn(o),i[o]=d}function Cd(i,o){var d=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0=Or),Id=" ",Vd=!1;function Nd(i,o){switch(i){case"keyup":return mn.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zd(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ql=!1;function Jl(i,o){switch(i){case"compositionend":return zd(o);case"keypress":return o.which!==32?null:(Vd=!0,Id);case"textInput":return i=o.data,i===Id&&Vd?null:i;default:return null}}function U3(i,o){if(Ql)return i==="compositionend"||!aa&&Nd(i,o)?(i=Iu(),pr=oa=Ot=null,Ql=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:d,offset:o-i};i=v}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=qe(d)}}function o0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?o0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function At(){for(var i=window,o=Xe();o instanceof i.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)i=o.contentWindow;else break;o=Xe(i.document)}return o}function sa(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function J3(i){var o=At(),d=i.focusedElem,v=i.selectionRange;if(o!==d&&d&&d.ownerDocument&&o0(d.ownerDocument.documentElement,d)){if(v!==null&&sa(d)){if(o=v.start,i=v.end,i===void 0&&(i=o),"selectionStart"in d)d.selectionStart=o,d.selectionEnd=Math.min(i,d.value.length);else if(i=(o=d.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var x=d.textContent.length,S=Math.min(v.start,x);v=v.end===void 0?S:Math.min(v.end,x),!i.extend&&S>v&&(x=v,v=S,S=x),x=yt(d,S);var T=yt(d,v);x&&T&&(i.rangeCount!==1||i.anchorNode!==x.node||i.anchorOffset!==x.offset||i.focusNode!==T.node||i.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(x.node,x.offset),i.removeAllRanges(),S>v?(i.addRange(o),i.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),i.addRange(o)))}}for(o=[],i=d;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Zr=null,Yu=null,hr=null,to=!1;function ua(i,o,d){var v=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;to||Zr==null||Zr!==Xe(v)||(v=Zr,"selectionStart"in v&&sa(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),hr&&Te(hr,v)||(hr=v,v=F2(Yu,"onSelect"),0uo||(i.current=tc[uo],tc[uo]=null,uo--)}function Ft(i,o){uo++,tc[uo]=i.current,i.current=o}var xi={},R0=rn(xi),ln=rn(!1),K0=xi;function co(i,o){var d=i.type.contextTypes;if(!d)return xi;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===o)return v.__reactInternalMemoizedMaskedChildContext;var x={},S;for(S in d)x[S]=o[S];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=x),x}function on(i){return i=i.childContextTypes,i!=null}function O2(){Vt(ln),Vt(R0)}function Yd(i,o,d){if(R0.current!==xi)throw Error(n(168));Ft(R0,o),Ft(ln,d)}function Xd(i,o,d){var v=i.stateNode;if(o=o.childContextTypes,typeof v.getChildContext!="function")return d;v=v.getChildContext();for(var x in v)if(!(x in o))throw Error(n(108,ke(i)||"Unknown",x));return ue({},d,v)}function _n(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||xi,K0=R0.current,Ft(R0,i),Ft(ln,ln.current),!0}function Qd(i,o,d){var v=i.stateNode;if(!v)throw Error(n(169));d?(i=Xd(i,o,K0),v.__reactInternalMemoizedMergedChildContext=i,Vt(ln),Vt(R0),Ft(R0,i)):Vt(ln),Ft(ln,d)}var jr=null,Z2=!1,nc=!1;function Jd(i){jr===null?jr=[i]:jr.push(i)}function ll(i){Z2=!0,Jd(i)}function wi(){if(!nc&&jr!==null){nc=!0;var i=0,o=Ct;try{var d=jr;for(Ct=1;i>=T,x-=T,gr=1<<32-Gn(o)+x|d<We?(y0=Oe,Oe=null):y0=Oe.sibling;var bt=ye(te,Oe,ie[We],Ee);if(bt===null){Oe===null&&(Oe=y0);break}i&&Oe&&bt.alternate===null&&o(te,Oe),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt,Oe=y0}if(We===ie.length)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;WeWe?(y0=Oe,Oe=null):y0=Oe.sibling;var Bi=ye(te,Oe,bt.value,Ee);if(Bi===null){Oe===null&&(Oe=y0);break}i&&Oe&&Bi.alternate===null&&o(te,Oe),U=S(Bi,U,We),Ze===null?Ve=Bi:Ze.sibling=Bi,Ze=Bi,Oe=y0}if(bt.done)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;!bt.done;We++,bt=ie.next())bt=we(te,bt.value,Ee),bt!==null&&(U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return Nt&&al(te,We),Ve}for(Oe=v(te,Oe);!bt.done;We++,bt=ie.next())bt=Ae(Oe,te,We,bt.value,Ee),bt!==null&&(i&&bt.alternate!==null&&Oe.delete(bt.key===null?We:bt.key),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return i&&Oe.forEach(function(w7){return o(te,w7)}),Nt&&al(te,We),Ve}function n0(te,U,ie,Ee){if(typeof ie=="object"&&ie!==null&&ie.type===ee&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case I:e:{for(var Ve=ie.key,Ze=U;Ze!==null;){if(Ze.key===Ve){if(Ve=ie.type,Ve===ee){if(Ze.tag===7){d(te,Ze.sibling),U=x(Ze,ie.props.children),U.return=te,te=U;break e}}else if(Ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===Se&&rf(Ve)===Ze.type){d(te,Ze.sibling),U=x(Ze,ie.props),U.ref=xa(te,Ze,ie),U.return=te,te=U;break e}d(te,Ze);break}else o(te,Ze);Ze=Ze.sibling}ie.type===ee?(U=xl(ie.props.children,te.mode,Ee,ie.key),U.return=te,te=U):(Ee=Ps(ie.type,ie.key,ie.props,null,te.mode,Ee),Ee.ref=xa(te,U,ie),Ee.return=te,te=Ee)}return T(te);case O:e:{for(Ze=ie.key;U!==null;){if(U.key===Ze)if(U.tag===4&&U.stateNode.containerInfo===ie.containerInfo&&U.stateNode.implementation===ie.implementation){d(te,U.sibling),U=x(U,ie.children||[]),U.return=te,te=U;break e}else{d(te,U);break}else o(te,U);U=U.sibling}U=jc(ie,te.mode,Ee),U.return=te,te=U}return T(te);case Se:return Ze=ie._init,n0(te,U,Ze(ie._payload),Ee)}if(l0(ie))return Re(te,U,ie,Ee);if(Pe(ie))return Ie(te,U,ie,Ee);ul(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"?(ie=""+ie,U!==null&&U.tag===6?(d(te,U.sibling),U=x(U,ie),U.return=te,te=U):(d(te,U),U=Hc(ie,te.mode,Ee),U.return=te,te=U),T(te)):d(te,U)}return n0}var Yt=ic(!0),W2=ic(!1),wa=rn(null),xn=null,$i=null,po=null;function Ur(){po=$i=xn=null}function U2(i){var o=wa.current;Vt(wa),i._currentValue=o}function C0(i,o,d){for(;i!==null;){var v=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),i===d)break;i=i.return}}function Ci(i,o){xn=i,po=$i=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(j0=!0),i.firstContext=null)}function An(i){var o=i._currentValue;if(po!==i)if(i={context:i,memoizedValue:o,next:null},$i===null){if(xn===null)throw Error(n(308));$i=i,xn.dependencies={lanes:0,firstContext:i}}else $i=$i.next=i;return o}var cl=null;function lc(i){cl===null?cl=[i]:cl.push(i)}function G2(i,o,d,v){var x=o.interleaved;return x===null?(d.next=d,lc(o)):(d.next=x.next,x.next=d),o.interleaved=d,Gr(i,v)}function Gr(i,o){i.lanes|=o;var d=i.alternate;for(d!==null&&(d.lanes|=o),d=i,i=i.return;i!==null;)i.childLanes|=o,d=i.alternate,d!==null&&(d.childLanes|=o),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Mn=!1;function q2(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lf(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qr(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Bn(i,o,d){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(mt&2)!==0){var x=v.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),v.pending=o,Gr(i,d)}return x=v.interleaved,x===null?(o.next=o,lc(v)):(o.next=x.next,x.next=o),v.interleaved=o,Gr(i,d)}function Y2(i,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194240)!==0)){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ra(i,d)}}function of(i,o){var d=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,d===v)){var x=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var T={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?x=S=T:S=S.next=T,d=d.next}while(d!==null);S===null?x=S=o:S=S.next=o}else x=S=o;d={baseState:v.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:v.shared,effects:v.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=o:i.next=o,d.lastBaseUpdate=o}function ho(i,o,d,v){var x=i.updateQueue;Mn=!1;var S=x.firstBaseUpdate,T=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var H=N,ae=H.next;H.next=null,T===null?S=ae:T.next=ae,T=H;var be=i.alternate;be!==null&&(be=be.updateQueue,N=be.lastBaseUpdate,N!==T&&(N===null?be.firstBaseUpdate=ae:N.next=ae,be.lastBaseUpdate=H))}if(S!==null){var we=x.baseState;T=0,be=ae=H=null,N=S;do{var ye=N.lane,Ae=N.eventTime;if((v&ye)===ye){be!==null&&(be=be.next={eventTime:Ae,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var Re=i,Ie=N;switch(ye=o,Ae=d,Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){we=Re.call(Ae,we,ye);break e}we=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,ye=typeof Re=="function"?Re.call(Ae,we,ye):Re,ye==null)break e;we=ue({},we,ye);break e;case 2:Mn=!0}}N.callback!==null&&N.lane!==0&&(i.flags|=64,ye=x.effects,ye===null?x.effects=[N]:ye.push(N))}else Ae={eventTime:Ae,lane:ye,tag:N.tag,payload:N.payload,callback:N.callback,next:null},be===null?(ae=be=Ae,H=we):be=be.next=Ae,T|=ye;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ye=N,N=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);if(be===null&&(H=we),x.baseState=H,x.firstBaseUpdate=ae,x.lastBaseUpdate=be,o=x.shared.interleaved,o!==null){x=o;do T|=x.lane,x=x.next;while(x!==o)}else S===null&&(x.shared.lanes=0);_i|=T,i.lanes=T,i.memoizedState=we}}function oc(i,o,d){if(i=o.effects,o.effects=null,i!==null)for(o=0;od?d:4,i(!0);var v=cc.transition;cc.transition={};try{i(!1),o()}finally{Ct=d,cc.transition=v}}function yc(){return Rn().memoizedState}function t7(i,o,d){var v=Ai(i);if(d={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null},bc(i))H0(o,d);else if(d=G2(i,o,d,v),d!==null){var x=G0();nr(d,i,v,x),Xn(d,o,v)}}function ff(i,o,d){var v=Ai(i),x={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null};if(bc(i))H0(o,x);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var T=o.lastRenderedState,N=S(T,d);if(x.hasEagerState=!0,x.eagerState=N,oe(N,T)){var H=o.interleaved;H===null?(x.next=x,lc(o)):(x.next=H.next,H.next=x),o.interleaved=x;return}}catch{}finally{}d=G2(i,o,x,v),d!==null&&(x=G0(),nr(d,i,v,x),Xn(d,o,v))}}function bc(i){var o=i.alternate;return i===jt||o!==null&&o===jt}function H0(i,o){Ea=mo=!0;var d=i.pending;d===null?o.next=o:(o.next=d.next,d.next=o),i.pending=o}function Xn(i,o,d){if((d&4194240)!==0){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ra(i,d)}}var is={readContext:An,useCallback:I0,useContext:I0,useEffect:I0,useImperativeHandle:I0,useInsertionEffect:I0,useLayoutEffect:I0,useMemo:I0,useReducer:I0,useRef:I0,useState:I0,useDebugValue:I0,useDeferredValue:I0,useTransition:I0,useMutableSource:I0,useSyncExternalStore:I0,useId:I0,unstable_isNewReconciler:!1},n7={readContext:An,useCallback:function(i,o){return Cr().memoizedState=[i,o===void 0?null:o],i},useContext:An,useEffect:rs,useImperativeHandle:function(i,o,d){return d=d!=null?d.concat([i]):null,ka(4194308,4,mc.bind(null,o,i),d)},useLayoutEffect:function(i,o){return ka(4194308,4,i,o)},useInsertionEffect:function(i,o){return ka(4,2,i,o)},useMemo:function(i,o){var d=Cr();return o=o===void 0?null:o,i=i(),d.memoizedState=[i,o],i},useReducer:function(i,o,d){var v=Cr();return o=d!==void 0?d(o):o,v.memoizedState=v.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},v.queue=i,i=i.dispatch=t7.bind(null,jt,i),[v.memoizedState,i]},useRef:function(i){var o=Cr();return i={current:i},o.memoizedState=i},useState:Pa,useDebugValue:_a,useDeferredValue:function(i){return Cr().memoizedState=i},useTransition:function(){var i=Pa(!1),o=i[0];return i=df.bind(null,i[1]),Cr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,d){var v=jt,x=Cr();if(Nt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=o(),g0===null)throw Error(n(349));(Ei&30)!==0||hc(v,o,d)}x.memoizedState=d;var S={value:d,getSnapshot:o};return x.queue=S,rs(Xr.bind(null,v,S,i),[i]),v.flags|=2048,yo(9,sn.bind(null,v,S,d,o),void 0,null),d},useId:function(){var i=Cr(),o=g0.identifierPrefix;if(Nt){var d=yr,v=gr;d=(v&~(1<<32-Gn(v)-1)).toString(32)+d,o=":"+o+"R"+d,d=fl++,0")&&(H=H.replace("",i.displayName)),H}while(1<=T&&0<=N);break}}}finally{le=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ne(i):""}function ce(i){switch(i.tag){case 5:return ne(i.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return i=G(i.type,!1),i;case 11:return i=G(i.type.render,!1),i;case 1:return i=G(i.type,!0),i;default:return""}}function $e(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case J:return"Fragment";case O:return"Portal";case re:return"Profiler";case R:return"StrictMode";case Q:return"Suspense";case ee:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case q:return(i.displayName||"Context")+".Consumer";case Z:return(i._context.displayName||"Context")+".Provider";case pe:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case me:return o=i.displayName||null,o!==null?o:$e(i.type)||"Memo";case Se:o=i._payload,i=i._init;try{return $e(i(o))}catch{}}return null}function ke(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $e(o);case 8:return o===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Ce(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ge(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Le(i){var o=ge(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),v=""+i[o];if(!i.hasOwnProperty(o)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,S=d.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return x.call(this)},set:function(T){v=""+T,S.call(this,T)}}),Object.defineProperty(i,o,{enumerable:d.enumerable}),{getValue:function(){return v},setValue:function(T){v=""+T},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function _e(i){i._valueTracker||(i._valueTracker=Le(i))}function He(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var d=o.getValue(),v="";return i&&(v=ge(i)?i.checked?"true":"false":i.value),i=v,i!==d?(o.setValue(i),!0):!1}function Xe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function wt(i,o){var d=o.checked;return ue({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function Rt(i,o){var d=o.defaultValue==null?"":o.defaultValue,v=o.checked!=null?o.checked:o.defaultChecked;d=Ce(o.value!=null?o.value:d),i._wrapperState={initialChecked:v,initialValue:d,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function at(i,o){o=o.checked,o!=null&&M(i,"checked",o,!1)}function _t(i,o){at(i,o);var d=Ce(o.value),v=o.type;if(d!=null)v==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?st(i,o.type,d):o.hasOwnProperty("defaultValue")&&st(i,o.type,Ce(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function it(i,o,d){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var v=o.type;if(!(v!=="submit"&&v!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,d||o===i.value||(i.value=o),i.defaultValue=o}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function st(i,o,d){(o!=="number"||Xe(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var l0=Array.isArray;function $t(i,o,d,v){if(i=i.options,o){o={};for(var x=0;x"+o.valueOf().toString()+"",o=qt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function tn(i,o){if(o){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=o;return}}i.textContent=o}var tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pt=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(i){pt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),tt[o]=tt[i]})});function fr(i,o,d){return o==null||typeof o=="boolean"||o===""?"":d||typeof o!="number"||o===0||tt.hasOwnProperty(i)&&tt[i]?(""+o).trim():o+"px"}function T0(i,o){i=i.style;for(var d in o)if(o.hasOwnProperty(d)){var v=d.indexOf("--")===0,x=fr(d,o[d],v);d==="float"&&(d="cssFloat"),v?i.setProperty(d,x):i[d]=x}}var ai=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function En(i,o){if(o){if(ai[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function si(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $u=null;function Cu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Su=null,Gi=null,qi=null;function ad(i){if(i=B0(i)){if(typeof Su!="function")throw Error(n(280));var o=i.stateNode;o&&(o=z2(o),Su(i.stateNode,i.type,o))}}function sd(i){Gi?qi?qi.push(i):qi=[i]:Gi=i}function ud(){if(Gi){var i=Gi,o=qi;if(qi=Gi=null,ad(i),o)for(i=0;i>>=0,i===0?32:31-(bd(i)/xd|0)|0}var jl=64,h2=4194304;function Wl(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Xi(i,o){var d=i.pendingLanes;if(d===0)return 0;var v=0,x=i.suspendedLanes,S=i.pingedLanes,T=d&268435455;if(T!==0){var N=T&~x;N!==0?v=Wl(N):(S&=T,S!==0&&(v=Wl(S)))}else T=d&~x,T!==0?v=Wl(T):S!==0&&(v=Wl(S));if(v===0)return 0;if(o!==0&&o!==v&&(o&x)===0&&(x=v&-v,S=o&-o,x>=S||x===16&&(S&4194240)!==0))return o;if((v&4)!==0&&(v|=d&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=v;0d;d++)o.push(i);return o}function na(i,o,d){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Gn(o),i[o]=d}function Cd(i,o){var d=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0=Or),Id=" ",Vd=!1;function Nd(i,o){switch(i){case"keyup":return mn.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zd(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ql=!1;function Jl(i,o){switch(i){case"compositionend":return zd(o);case"keypress":return o.which!==32?null:(Vd=!0,Id);case"textInput":return i=o.data,i===Id&&Vd?null:i;default:return null}}function U3(i,o){if(Ql)return i==="compositionend"||!aa&&Nd(i,o)?(i=Iu(),hr=oa=Ot=null,Ql=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:d,offset:o-i};i=v}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=qe(d)}}function o0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?o0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function At(){for(var i=window,o=Xe();o instanceof i.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)i=o.contentWindow;else break;o=Xe(i.document)}return o}function sa(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function J3(i){var o=At(),d=i.focusedElem,v=i.selectionRange;if(o!==d&&d&&d.ownerDocument&&o0(d.ownerDocument.documentElement,d)){if(v!==null&&sa(d)){if(o=v.start,i=v.end,i===void 0&&(i=o),"selectionStart"in d)d.selectionStart=o,d.selectionEnd=Math.min(i,d.value.length);else if(i=(o=d.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var x=d.textContent.length,S=Math.min(v.start,x);v=v.end===void 0?S:Math.min(v.end,x),!i.extend&&S>v&&(x=v,v=S,S=x),x=yt(d,S);var T=yt(d,v);x&&T&&(i.rangeCount!==1||i.anchorNode!==x.node||i.anchorOffset!==x.offset||i.focusNode!==T.node||i.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(x.node,x.offset),i.removeAllRanges(),S>v?(i.addRange(o),i.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),i.addRange(o)))}}for(o=[],i=d;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Zr=null,Yu=null,vr=null,to=!1;function ua(i,o,d){var v=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;to||Zr==null||Zr!==Xe(v)||(v=Zr,"selectionStart"in v&&sa(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),vr&&Te(vr,v)||(vr=v,v=F2(Yu,"onSelect"),0uo||(i.current=tc[uo],tc[uo]=null,uo--)}function Ft(i,o){uo++,tc[uo]=i.current,i.current=o}var xi={},R0=rn(xi),ln=rn(!1),K0=xi;function co(i,o){var d=i.type.contextTypes;if(!d)return xi;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===o)return v.__reactInternalMemoizedMaskedChildContext;var x={},S;for(S in d)x[S]=o[S];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=x),x}function on(i){return i=i.childContextTypes,i!=null}function O2(){Vt(ln),Vt(R0)}function Yd(i,o,d){if(R0.current!==xi)throw Error(n(168));Ft(R0,o),Ft(ln,d)}function Xd(i,o,d){var v=i.stateNode;if(o=o.childContextTypes,typeof v.getChildContext!="function")return d;v=v.getChildContext();for(var x in v)if(!(x in o))throw Error(n(108,ke(i)||"Unknown",x));return ue({},d,v)}function _n(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||xi,K0=R0.current,Ft(R0,i),Ft(ln,ln.current),!0}function Qd(i,o,d){var v=i.stateNode;if(!v)throw Error(n(169));d?(i=Xd(i,o,K0),v.__reactInternalMemoizedMergedChildContext=i,Vt(ln),Vt(R0),Ft(R0,i)):Vt(ln),Ft(ln,d)}var jr=null,Z2=!1,nc=!1;function Jd(i){jr===null?jr=[i]:jr.push(i)}function ll(i){Z2=!0,Jd(i)}function wi(){if(!nc&&jr!==null){nc=!0;var i=0,o=Ct;try{var d=jr;for(Ct=1;i>=T,x-=T,yr=1<<32-Gn(o)+x|d<We?(y0=Oe,Oe=null):y0=Oe.sibling;var bt=ye(te,Oe,ie[We],Ee);if(bt===null){Oe===null&&(Oe=y0);break}i&&Oe&&bt.alternate===null&&o(te,Oe),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt,Oe=y0}if(We===ie.length)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;WeWe?(y0=Oe,Oe=null):y0=Oe.sibling;var Bi=ye(te,Oe,bt.value,Ee);if(Bi===null){Oe===null&&(Oe=y0);break}i&&Oe&&Bi.alternate===null&&o(te,Oe),U=S(Bi,U,We),Ze===null?Ve=Bi:Ze.sibling=Bi,Ze=Bi,Oe=y0}if(bt.done)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;!bt.done;We++,bt=ie.next())bt=we(te,bt.value,Ee),bt!==null&&(U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return Nt&&al(te,We),Ve}for(Oe=v(te,Oe);!bt.done;We++,bt=ie.next())bt=Ae(Oe,te,We,bt.value,Ee),bt!==null&&(i&&bt.alternate!==null&&Oe.delete(bt.key===null?We:bt.key),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return i&&Oe.forEach(function(w7){return o(te,w7)}),Nt&&al(te,We),Ve}function n0(te,U,ie,Ee){if(typeof ie=="object"&&ie!==null&&ie.type===J&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case V:e:{for(var Ve=ie.key,Ze=U;Ze!==null;){if(Ze.key===Ve){if(Ve=ie.type,Ve===J){if(Ze.tag===7){d(te,Ze.sibling),U=x(Ze,ie.props.children),U.return=te,te=U;break e}}else if(Ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===Se&&rf(Ve)===Ze.type){d(te,Ze.sibling),U=x(Ze,ie.props),U.ref=xa(te,Ze,ie),U.return=te,te=U;break e}d(te,Ze);break}else o(te,Ze);Ze=Ze.sibling}ie.type===J?(U=xl(ie.props.children,te.mode,Ee,ie.key),U.return=te,te=U):(Ee=Ps(ie.type,ie.key,ie.props,null,te.mode,Ee),Ee.ref=xa(te,U,ie),Ee.return=te,te=Ee)}return T(te);case O:e:{for(Ze=ie.key;U!==null;){if(U.key===Ze)if(U.tag===4&&U.stateNode.containerInfo===ie.containerInfo&&U.stateNode.implementation===ie.implementation){d(te,U.sibling),U=x(U,ie.children||[]),U.return=te,te=U;break e}else{d(te,U);break}else o(te,U);U=U.sibling}U=jc(ie,te.mode,Ee),U.return=te,te=U}return T(te);case Se:return Ze=ie._init,n0(te,U,Ze(ie._payload),Ee)}if(l0(ie))return Re(te,U,ie,Ee);if(Pe(ie))return Ie(te,U,ie,Ee);ul(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"?(ie=""+ie,U!==null&&U.tag===6?(d(te,U.sibling),U=x(U,ie),U.return=te,te=U):(d(te,U),U=Hc(ie,te.mode,Ee),U.return=te,te=U),T(te)):d(te,U)}return n0}var Yt=ic(!0),W2=ic(!1),wa=rn(null),xn=null,$i=null,po=null;function Ur(){po=$i=xn=null}function U2(i){var o=wa.current;Vt(wa),i._currentValue=o}function C0(i,o,d){for(;i!==null;){var v=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),i===d)break;i=i.return}}function Ci(i,o){xn=i,po=$i=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(j0=!0),i.firstContext=null)}function An(i){var o=i._currentValue;if(po!==i)if(i={context:i,memoizedValue:o,next:null},$i===null){if(xn===null)throw Error(n(308));$i=i,xn.dependencies={lanes:0,firstContext:i}}else $i=$i.next=i;return o}var cl=null;function lc(i){cl===null?cl=[i]:cl.push(i)}function G2(i,o,d,v){var x=o.interleaved;return x===null?(d.next=d,lc(o)):(d.next=x.next,x.next=d),o.interleaved=d,Gr(i,v)}function Gr(i,o){i.lanes|=o;var d=i.alternate;for(d!==null&&(d.lanes|=o),d=i,i=i.return;i!==null;)i.childLanes|=o,d=i.alternate,d!==null&&(d.childLanes|=o),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Mn=!1;function q2(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lf(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qr(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Bn(i,o,d){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(mt&2)!==0){var x=v.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),v.pending=o,Gr(i,d)}return x=v.interleaved,x===null?(o.next=o,lc(v)):(o.next=x.next,x.next=o),v.interleaved=o,Gr(i,d)}function Y2(i,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194240)!==0)){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ra(i,d)}}function of(i,o){var d=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,d===v)){var x=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var T={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?x=S=T:S=S.next=T,d=d.next}while(d!==null);S===null?x=S=o:S=S.next=o}else x=S=o;d={baseState:v.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:v.shared,effects:v.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=o:i.next=o,d.lastBaseUpdate=o}function ho(i,o,d,v){var x=i.updateQueue;Mn=!1;var S=x.firstBaseUpdate,T=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var H=N,ae=H.next;H.next=null,T===null?S=ae:T.next=ae,T=H;var be=i.alternate;be!==null&&(be=be.updateQueue,N=be.lastBaseUpdate,N!==T&&(N===null?be.firstBaseUpdate=ae:N.next=ae,be.lastBaseUpdate=H))}if(S!==null){var we=x.baseState;T=0,be=ae=H=null,N=S;do{var ye=N.lane,Ae=N.eventTime;if((v&ye)===ye){be!==null&&(be=be.next={eventTime:Ae,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var Re=i,Ie=N;switch(ye=o,Ae=d,Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){we=Re.call(Ae,we,ye);break e}we=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,ye=typeof Re=="function"?Re.call(Ae,we,ye):Re,ye==null)break e;we=ue({},we,ye);break e;case 2:Mn=!0}}N.callback!==null&&N.lane!==0&&(i.flags|=64,ye=x.effects,ye===null?x.effects=[N]:ye.push(N))}else Ae={eventTime:Ae,lane:ye,tag:N.tag,payload:N.payload,callback:N.callback,next:null},be===null?(ae=be=Ae,H=we):be=be.next=Ae,T|=ye;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ye=N,N=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);if(be===null&&(H=we),x.baseState=H,x.firstBaseUpdate=ae,x.lastBaseUpdate=be,o=x.shared.interleaved,o!==null){x=o;do T|=x.lane,x=x.next;while(x!==o)}else S===null&&(x.shared.lanes=0);_i|=T,i.lanes=T,i.memoizedState=we}}function oc(i,o,d){if(i=o.effects,o.effects=null,i!==null)for(o=0;od?d:4,i(!0);var v=cc.transition;cc.transition={};try{i(!1),o()}finally{Ct=d,cc.transition=v}}function yc(){return Rn().memoizedState}function t7(i,o,d){var v=Ai(i);if(d={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null},bc(i))H0(o,d);else if(d=G2(i,o,d,v),d!==null){var x=G0();nr(d,i,v,x),Xn(d,o,v)}}function ff(i,o,d){var v=Ai(i),x={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null};if(bc(i))H0(o,x);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var T=o.lastRenderedState,N=S(T,d);if(x.hasEagerState=!0,x.eagerState=N,oe(N,T)){var H=o.interleaved;H===null?(x.next=x,lc(o)):(x.next=H.next,H.next=x),o.interleaved=x;return}}catch{}finally{}d=G2(i,o,x,v),d!==null&&(x=G0(),nr(d,i,v,x),Xn(d,o,v))}}function bc(i){var o=i.alternate;return i===jt||o!==null&&o===jt}function H0(i,o){Ea=mo=!0;var d=i.pending;d===null?o.next=o:(o.next=d.next,d.next=o),i.pending=o}function Xn(i,o,d){if((d&4194240)!==0){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ra(i,d)}}var is={readContext:An,useCallback:I0,useContext:I0,useEffect:I0,useImperativeHandle:I0,useInsertionEffect:I0,useLayoutEffect:I0,useMemo:I0,useReducer:I0,useRef:I0,useState:I0,useDebugValue:I0,useDeferredValue:I0,useTransition:I0,useMutableSource:I0,useSyncExternalStore:I0,useId:I0,unstable_isNewReconciler:!1},n7={readContext:An,useCallback:function(i,o){return Sr().memoizedState=[i,o===void 0?null:o],i},useContext:An,useEffect:rs,useImperativeHandle:function(i,o,d){return d=d!=null?d.concat([i]):null,ka(4194308,4,mc.bind(null,o,i),d)},useLayoutEffect:function(i,o){return ka(4194308,4,i,o)},useInsertionEffect:function(i,o){return ka(4,2,i,o)},useMemo:function(i,o){var d=Sr();return o=o===void 0?null:o,i=i(),d.memoizedState=[i,o],i},useReducer:function(i,o,d){var v=Sr();return o=d!==void 0?d(o):o,v.memoizedState=v.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},v.queue=i,i=i.dispatch=t7.bind(null,jt,i),[v.memoizedState,i]},useRef:function(i){var o=Sr();return i={current:i},o.memoizedState=i},useState:Pa,useDebugValue:_a,useDeferredValue:function(i){return Sr().memoizedState=i},useTransition:function(){var i=Pa(!1),o=i[0];return i=df.bind(null,i[1]),Sr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,d){var v=jt,x=Sr();if(Nt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=o(),g0===null)throw Error(n(349));(Ei&30)!==0||hc(v,o,d)}x.memoizedState=d;var S={value:d,getSnapshot:o};return x.queue=S,rs(Xr.bind(null,v,S,i),[i]),v.flags|=2048,yo(9,sn.bind(null,v,S,d,o),void 0,null),d},useId:function(){var i=Sr(),o=g0.identifierPrefix;if(Nt){var d=br,v=yr;d=(v&~(1<<32-Gn(v)-1)).toString(32)+d,o=":"+o+"R"+d,d=fl++,0<\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=T.createElement(d,{is:v.is}):(i=T.createElement(d),d==="select"&&(T=i,v.multiple?T.multiple=!0:v.size&&(T.size=v.size))):i=T.createElementNS(i,d),i[vr]=o,i[bi]=v,E0(i,o,!1,!1),o.stateNode=i;e:{switch(T=si(d,v),d){case"dialog":It("cancel",i),It("close",i),x=v;break;case"iframe":case"object":case"embed":It("load",i),x=v;break;case"video":case"audio":for(x=0;xml&&(o.flags|=128,v=!0,La(S,!1),o.lanes=4194304)}else{if(!v)if(i=dl(T),i!==null){if(o.flags|=128,v=!0,d=i.updateQueue,d!==null&&(o.updateQueue=d,o.flags|=4),La(S,!0),S.tail===null&&S.tailMode==="hidden"&&!T.alternate&&!Nt)return P0(o),null}else 2*zt()-S.renderingStartTime>ml&&d!==1073741824&&(o.flags|=128,v=!0,La(S,!1),o.lanes=4194304);S.isBackwards?(T.sibling=o.child,o.child=T):(d=S.last,d!==null?d.sibling=T:o.child=T,S.last=T)}return S.tail!==null?(o=S.tail,S.rendering=o,S.tail=o.sibling,S.renderingStartTime=zt(),o.sibling=null,d=Zt.current,Ft(Zt,v?d&1|2:d&1),o):(P0(o),null);case 22:case 23:return Zc(),v=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(o.flags|=8192),v&&(o.mode&1)!==0?($n&1073741824)!==0&&(P0(o),o.subtreeFlags&6&&(o.flags|=8192)):P0(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function i7(i,o){switch(sl(o),o.tag){case 1:return on(o.type)&&O2(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Si(),Vt(ln),Vt(R0),Q2(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return X2(o),null;case 13:if(Vt(Zt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));xr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Vt(Zt),null;case 4:return Si(),null;case 10:return U2(o.type._context),null;case 22:case 23:return Zc(),null;case 24:return null;default:return null}}var ps=!1,Kt=!1,W0=typeof WeakSet=="function"?WeakSet:Set,Me=null;function So(i,o){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(v){Wt(i,o,v)}else d.current=null}function Fa(i,o,d){try{d()}catch(v){Wt(i,o,v)}}var bf=!1;function l7(i,o){if(va=b2,i=At(),sa(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var v=d.getSelection&&d.getSelection();if(v&&v.rangeCount!==0){d=v.anchorNode;var x=v.anchorOffset,S=v.focusNode;v=v.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var T=0,N=-1,H=-1,ae=0,be=0,we=i,ye=null;t:for(;;){for(var Ae;we!==d||x!==0&&we.nodeType!==3||(N=T+x),we!==S||v!==0&&we.nodeType!==3||(H=T+v),we.nodeType===3&&(T+=we.nodeValue.length),(Ae=we.firstChild)!==null;)ye=we,we=Ae;for(;;){if(we===i)break t;if(ye===d&&++ae===x&&(N=T),ye===S&&++be===v&&(H=T),(Ae=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Ae}d=N===-1||H===-1?null:{start:N,end:H}}else d=null}d=d||{start:0,end:0}}else d=null;for(il={focusedElem:i,selectionRange:d},b2=!1,Me=o;Me!==null;)if(o=Me,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Me=i;else for(;Me!==null;){o=Me;try{var Re=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ie=Re.memoizedProps,n0=Re.memoizedState,te=o.stateNode,U=te.getSnapshotBeforeUpdate(o.elementType===o.type?Ie:Ln(o.type,Ie),n0);te.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var ie=o.stateNode.containerInfo;ie.nodeType===1?ie.textContent="":ie.nodeType===9&&ie.documentElement&&ie.removeChild(ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){Wt(o,o.return,Ee)}if(i=o.sibling,i!==null){i.return=o.return,Me=i;break}Me=o.return}return Re=bf,bf=!1,Re}function ei(i,o,d){var v=o.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var x=v=v.next;do{if((x.tag&i)===i){var S=x.destroy;x.destroy=void 0,S!==void 0&&Fa(o,d,S)}x=x.next}while(x!==v)}}function Ia(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var d=o=o.next;do{if((d.tag&i)===i){var v=d.create;d.destroy=v()}d=d.next}while(d!==o)}}function hs(i){var o=i.ref;if(o!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof o=="function"?o(i):o.current=i}}function xf(i){var o=i.alternate;o!==null&&(i.alternate=null,xf(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[vr],delete o[bi],delete o[N2],delete o[B],delete o[so])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function wf(i){return i.tag===5||i.tag===3||i.tag===4}function $f(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||wf(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Ac(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.nodeType===8?d.parentNode.insertBefore(i,o):d.insertBefore(i,o):(d.nodeType===8?(o=d.parentNode,o.insertBefore(i,d)):(o=d,o.appendChild(i)),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=I2));else if(v!==4&&(i=i.child,i!==null))for(Ac(i,o,d),i=i.sibling;i!==null;)Ac(i,o,d),i=i.sibling}function vs(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.insertBefore(i,o):d.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for(vs(i,o,d),i=i.sibling;i!==null;)vs(i,o,d),i=i.sibling}var m0=null,Jn=!1;function kr(i,o,d){for(d=d.child;d!==null;)Mc(i,o,d),d=d.sibling}function Mc(i,o,d){if(fr&&typeof fr.onCommitFiberUnmount=="function")try{fr.onCommitFiberUnmount(p2,d)}catch{}switch(d.tag){case 5:Kt||So(d,o);case 6:var v=m0,x=Jn;m0=null,kr(i,o,d),m0=v,Jn=x,m0!==null&&(Jn?(i=m0,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):m0.removeChild(d.stateNode));break;case 18:m0!==null&&(Jn?(i=m0,d=d.stateNode,i.nodeType===8?ec(i.parentNode,d):i.nodeType===1&&ec(i,d),Et(i)):ec(m0,d.stateNode));break;case 4:v=m0,x=Jn,m0=d.stateNode.containerInfo,Jn=!0,kr(i,o,d),m0=v,Jn=x;break;case 0:case 11:case 14:case 15:if(!Kt&&(v=d.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){x=v=v.next;do{var S=x,T=S.destroy;S=S.tag,T!==void 0&&((S&2)!==0||(S&4)!==0)&&Fa(d,o,T),x=x.next}while(x!==v)}kr(i,o,d);break;case 1:if(!Kt&&(So(d,o),v=d.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=d.memoizedProps,v.state=d.memoizedState,v.componentWillUnmount()}catch(N){Wt(d,o,N)}kr(i,o,d);break;case 21:kr(i,o,d);break;case 22:d.mode&1?(Kt=(v=Kt)||d.memoizedState!==null,kr(i,o,d),Kt=v):kr(i,o,d);break;default:kr(i,o,d)}}function Eo(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new W0),o.forEach(function(v){var x=f7.bind(null,i,v);d.has(v)||(d.add(v),v.then(x,x))})}}function wn(i,o){var d=o.deletions;if(d!==null)for(var v=0;vx&&(x=T),v&=~S}if(v=x,v=zt()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Sf(v/1960))-v,10i?16:i,Ti===null)var v=!1;else{if(i=Ti,Ti=null,U0=0,(mt&6)!==0)throw Error(n(331));var x=mt;for(mt|=4,Me=i.current;Me!==null;){var S=Me,T=S.child;if((Me.flags&16)!==0){var N=S.deletions;if(N!==null){for(var H=0;Hzt()-Fc?yl(i,0):ys|=d),cn(i,o)}function Tf(i,o){o===0&&((i.mode&1)===0?o=1:(o=h2,h2<<=1,(h2&130023424)===0&&(h2=4194304)));var d=G0();i=Gr(i,o),i!==null&&(na(i,o,d),cn(i,d))}function d7(i){var o=i.memoizedState,d=0;o!==null&&(d=o.retryLane),Tf(i,d)}function f7(i,o){var d=0;switch(i.tag){case 13:var v=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(o),Tf(i,d)}var Af;Af=function(i,o,d){if(i!==null)if(i.memoizedProps!==o.pendingProps||ln.current)j0=!0;else{if((i.lanes&d)===0&&(o.flags&128)===0)return j0=!1,gf(i,o,d);j0=(i.flags&131072)!==0}else j0=!1,Nt&&(o.flags&1048576)!==0&&ef(o,H2,o.index);switch(o.lanes=0,o.tag){case 2:var v=o.type;fs(i,o),i=o.pendingProps;var x=co(o,R0.current);Ci(o,d),x=pl(null,o,v,i,x,d);var S=J2();return o.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,on(v)?(S=!0,_n(o)):S=!1,o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,q2(o),x.updater=as,o.stateNode=x,x._reactInternals=o,wc(o,v,i,d),o=_c(null,o,v,!0,S,d)):(o.tag=0,Nt&&S&&ya(o),S0(null,o,x,d),o=o.child),o;case 16:v=o.elementType;e:{switch(fs(i,o),i=o.pendingProps,x=v._init,v=x(v._payload),o.type=v,x=o.tag=h7(v),i=Ln(v,i),x){case 0:o=Pc(null,o,v,i,d);break e;case 1:o=kc(null,o,v,i,d);break e;case 11:o=vf(null,o,v,i,d);break e;case 14:o=Cc(null,o,v,Ln(v.type,i),d);break e}throw Error(n(306,v,""))}return o;case 0:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),Pc(i,o,v,x,d);case 1:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),kc(i,o,v,x,d);case 3:e:{if(mf(o),i===null)throw Error(n(387));v=o.pendingProps,S=o.memoizedState,x=S.element,lf(i,o),ho(o,v,null,d);var T=o.memoizedState;if(v=T.element,S.isDehydrated)if(S={element:v,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){x=vl(Error(n(423)),o),o=Pr(i,o,v,d,x);break e}else if(v!==x){x=vl(Error(n(424)),o),o=Pr(i,o,v,d,x);break e}else for(bn=yi(o.stateNode.containerInfo.firstChild),F0=o,Nt=!0,Yn=null,d=W2(o,null,v,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(xr(),v===x){o=Qn(i,o,d);break e}S0(i,o,v,d)}o=o.child}return o;case 5:return sc(o),i===null&&an(o),v=o.type,x=o.pendingProps,S=i!==null?i.memoizedProps:null,T=x.children,ma(v,x)?T=null:S!==null&&ma(v,S)&&(o.flags|=32),Ec(i,o),S0(i,o,T,d),o.child;case 6:return i===null&&an(o),null;case 13:return ds(i,o,d);case 4:return ac(o,o.stateNode.containerInfo),v=o.pendingProps,i===null?o.child=Yt(o,null,v,d):S0(i,o,v,d),o.child;case 11:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),vf(i,o,v,x,d);case 7:return S0(i,o,o.pendingProps,d),o.child;case 8:return S0(i,o,o.pendingProps.children,d),o.child;case 12:return S0(i,o,o.pendingProps.children,d),o.child;case 10:e:{if(v=o.type._context,x=o.pendingProps,S=o.memoizedProps,T=x.value,Ft(wa,v._currentValue),v._currentValue=T,S!==null)if(oe(S.value,T)){if(S.children===x.children&&!ln.current){o=Qn(i,o,d);break e}}else for(S=o.child,S!==null&&(S.return=o);S!==null;){var N=S.dependencies;if(N!==null){T=S.child;for(var H=N.firstContext;H!==null;){if(H.context===v){if(S.tag===1){H=qr(-1,d&-d),H.tag=2;var ae=S.updateQueue;if(ae!==null){ae=ae.shared;var be=ae.pending;be===null?H.next=H:(H.next=be.next,be.next=H),ae.pending=H}}S.lanes|=d,H=S.alternate,H!==null&&(H.lanes|=d),C0(S.return,d,o),N.lanes|=d;break}H=H.next}}else if(S.tag===10)T=S.type===o.type?null:S.child;else if(S.tag===18){if(T=S.return,T===null)throw Error(n(341));T.lanes|=d,N=T.alternate,N!==null&&(N.lanes|=d),C0(T,d,o),T=S.sibling}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===o){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}S0(i,o,x.children,d),o=o.child}return o;case 9:return x=o.type,v=o.pendingProps.children,Ci(o,d),x=An(x),v=v(x),o.flags|=1,S0(i,o,v,d),o.child;case 14:return v=o.type,x=Ln(v,o.pendingProps),x=Ln(v.type,x),Cc(i,o,v,x,d);case 15:return Er(i,o,o.type,o.pendingProps,d);case 17:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),fs(i,o),o.tag=1,on(v)?(i=!0,_n(o)):i=!1,Ci(o,d),hl(o,v,x),wc(o,v,x,d),_c(null,o,v,!0,i,d);case 19:return Pi(i,o,d);case 22:return Sc(i,o,d)}throw Error(n(156,o.tag))};function Mf(i,o){return vd(i,o)}function p7(i,o,d,v){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(i,o,d,v){return new p7(i,o,d,v)}function Es(i){return i=i.prototype,!(!i||!i.isReactComponent)}function h7(i){if(typeof i=="function")return Es(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ve)return 11;if(i===me)return 14}return 2}function rr(i,o){var d=i.alternate;return d===null?(d=In(i.tag,o,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=o,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,o=i.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function Ps(i,o,d,v,x,S){var T=2;if(v=i,typeof i=="function")Es(i)&&(T=1);else if(typeof i=="string")T=5;else e:switch(i){case ee:return xl(d.children,x,S,o);case L:T=8,x|=8;break;case re:return i=In(12,d,o,x|2),i.elementType=re,i.lanes=S,i;case Q:return i=In(13,d,o,x),i.elementType=Q,i.lanes=S,i;case J:return i=In(19,d,o,x),i.elementType=J,i.lanes=S,i;case se:return ks(d,x,S,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case K:T=10;break e;case Y:T=9;break e;case ve:T=11;break e;case me:T=14;break e;case Se:T=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=In(T,d,o,x),o.elementType=i,o.type=v,o.lanes=S,o}function xl(i,o,d,v){return i=In(7,i,v,o),i.lanes=d,i}function ks(i,o,d,v){return i=In(22,i,v,o),i.elementType=se,i.lanes=d,i.stateNode={isHidden:!1},i}function Hc(i,o,d){return i=In(6,i,null,o),i.lanes=d,i}function jc(i,o,d){return o=In(4,i.children!==null?i.children:[],i.key,o),o.lanes=d,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function v7(i,o,d,v,x){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ta(0),this.expirationTimes=ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ta(0),this.identifierPrefix=v,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Wc(i,o,d,v,x,S,T,N,H){return i=new v7(i,o,d,N,H),o===1?(o=1,S===!0&&(o|=8)):o=0,S=In(3,null,null,o),i.current=S,S.stateNode=i,S.memoizedState={element:v,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},q2(S),i}function m7(i,o,d){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),L7.exports=Tk(),L7.exports}var Jv;function Ak(){if(Jv)return Zf;Jv=1;var e=B8();return Zf.createRoot=e.createRoot,Zf.hydrateRoot=e.hydrateRoot,Zf}var Mk=Ak();const Bk=z5(Mk);/** +`+S.stack}return{value:i,source:o,stack:x,digest:null}}function ss(i,o,d){return{value:i,source:null,stack:d??null,digest:o??null}}function $o(i,o){try{console.error(o.value)}catch(d){setTimeout(function(){throw d})}}var pf=typeof WeakMap=="function"?WeakMap:Map;function Da(i,o,d){d=qr(-1,d),d.tag=3,d.payload={element:null};var v=o.value;return d.callback=function(){bs||(bs=!0,Ic=v),$o(i,o)},d}function us(i,o,d){d=qr(-1,d),d.tag=3;var v=i.type.getDerivedStateFromError;if(typeof v=="function"){var x=o.value;d.payload=function(){return v(x)},d.callback=function(){$o(i,o)}}var S=i.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(d.callback=function(){$o(i,o),typeof v!="function"&&(Di===null?Di=new Set([this]):Di.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),d}function Ta(i,o,d){var v=i.pingCache;if(v===null){v=i.pingCache=new pf;var x=new Set;v.set(o,x)}else x=v.get(o),x===void 0&&(x=new Set,v.set(o,x));x.has(d)||(x.add(d),i=c7.bind(null,i,o,d),o.then(i,i))}function hf(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function $c(i,o,d,v,x){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(o=qr(-1,1),o.tag=2,Bn(d,o,1))),d.lanes|=1),i):(i.flags|=65536,i.lanes=x,i)}var cs=I.ReactCurrentOwner,j0=!1;function S0(i,o,d,v){o.child=i===null?W2(o,null,d,v):Yt(o,i.child,d,v)}function vf(i,o,d,v,x){d=d.render;var S=o.ref;return Ci(o,x),v=pl(i,o,d,v,S,x),d=J2(),i!==null&&!j0?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Qn(i,o,x)):(Nt&&d&&ya(o),o.flags|=1,S0(i,o,v,x),o.child)}function Cc(i,o,d,v,x){if(i===null){var S=d.type;return typeof S=="function"&&!Es(S)&&S.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(o.tag=15,o.type=S,Pr(i,o,S,v,x)):(i=Ps(d.type,null,v,o,o.mode,x),i.ref=o.ref,i.return=o,o.child=i)}if(S=i.child,(i.lanes&x)===0){var T=S.memoizedProps;if(d=d.compare,d=d!==null?d:Te,d(T,v)&&i.ref===o.ref)return Qn(i,o,x)}return o.flags|=1,i=rr(S,v),i.ref=o.ref,i.return=o,o.child=i}function Pr(i,o,d,v,x){if(i!==null){var S=i.memoizedProps;if(Te(S,v)&&i.ref===o.ref)if(j0=!1,o.pendingProps=v=S,(i.lanes&x)!==0)(i.flags&131072)!==0&&(j0=!0);else return o.lanes=i.lanes,Qn(i,o,x)}return Pc(i,o,d,v,x)}function Sc(i,o,d){var v=o.pendingProps,x=v.children,S=i!==null?i.memoizedState:null;if(v.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft(Po,$n),$n|=d;else{if((d&1073741824)===0)return i=S!==null?S.baseLanes|d:d,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,Ft(Po,$n),$n|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=S!==null?S.baseLanes:d,Ft(Po,$n),$n|=v}else S!==null?(v=S.baseLanes|d,o.memoizedState=null):v=d,Ft(Po,$n),$n|=v;return S0(i,o,x,d),o.child}function Ec(i,o){var d=o.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(o.flags|=512,o.flags|=2097152)}function Pc(i,o,d,v,x){var S=on(d)?K0:R0.current;return S=co(o,S),Ci(o,x),d=pl(i,o,d,v,S,x),v=J2(),i!==null&&!j0?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Qn(i,o,x)):(Nt&&v&&ya(o),o.flags|=1,S0(i,o,d,x),o.child)}function kc(i,o,d,v,x){if(on(d)){var S=!0;_n(o)}else S=!1;if(Ci(o,x),o.stateNode===null)fs(i,o),hl(o,d,v),wc(o,d,v,x),v=!0;else if(i===null){var T=o.stateNode,N=o.memoizedProps;T.props=N;var H=T.context,ae=d.contextType;typeof ae=="object"&&ae!==null?ae=An(ae):(ae=on(d)?K0:R0.current,ae=co(o,ae));var be=d.getDerivedStateFromProps,we=typeof be=="function"||typeof T.getSnapshotBeforeUpdate=="function";we||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(N!==v||H!==ae)&&wo(o,T,v,ae),Mn=!1;var ye=o.memoizedState;T.state=ye,ho(o,v,T,x),H=o.memoizedState,N!==v||ye!==H||ln.current||Mn?(typeof be=="function"&&(os(o,d,be,v),H=o.memoizedState),(N=Mn||xc(o,d,N,v,ye,H,ae))?(we||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=v,o.memoizedState=H),T.props=v,T.state=H,T.context=ae,v=N):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),v=!1)}else{T=o.stateNode,lf(i,o),N=o.memoizedProps,ae=o.type===o.elementType?N:Ln(o.type,N),T.props=ae,we=o.pendingProps,ye=T.context,H=d.contextType,typeof H=="object"&&H!==null?H=An(H):(H=on(d)?K0:R0.current,H=co(o,H));var Ae=d.getDerivedStateFromProps;(be=typeof Ae=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(N!==we||ye!==H)&&wo(o,T,v,H),Mn=!1,ye=o.memoizedState,T.state=ye,ho(o,v,T,x);var Re=o.memoizedState;N!==we||ye!==Re||ln.current||Mn?(typeof Ae=="function"&&(os(o,d,Ae,v),Re=o.memoizedState),(ae=Mn||xc(o,d,ae,v,ye,Re,H)||!1)?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(v,Re,H),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(v,Re,H)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=1024),o.memoizedProps=v,o.memoizedState=Re),T.props=v,T.state=Re,T.context=H,v=ae):(typeof T.componentDidUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=1024),v=!1)}return _c(i,o,d,v,S,x)}function _c(i,o,d,v,x,S){Ec(i,o);var T=(o.flags&128)!==0;if(!v&&!T)return x&&Qd(o,d,!1),Qn(i,o,S);v=o.stateNode,cs.current=o;var N=T&&typeof d.getDerivedStateFromError!="function"?null:v.render();return o.flags|=1,i!==null&&T?(o.child=Yt(o,i.child,null,S),o.child=Yt(o,null,N,S)):S0(i,o,N,S),o.memoizedState=v.state,x&&Qd(o,d,!0),o.child}function mf(i){var o=i.stateNode;o.pendingContext?Yd(i,o.pendingContext,o.pendingContext!==o.context):o.context&&Yd(i,o.context,!1),ac(i,o.containerInfo)}function kr(i,o,d,v,x){return wr(),$r(x),o.flags|=256,S0(i,o,d,v),o.child}var Aa={dehydrated:null,treeContext:null,retryLane:0};function Ma(i){return{baseLanes:i,cachePool:null,transitions:null}}function ds(i,o,d){var v=o.pendingProps,x=Zt.current,S=!1,T=(o.flags&128)!==0,N;if((N=T)||(N=i!==null&&i.memoizedState===null?!1:(x&2)!==0),N?(S=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(x|=1),Ft(Zt,x&1),i===null)return an(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(T=v.children,i=v.fallback,S?(v=o.mode,S=o.child,T={mode:"hidden",children:T},(v&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=T):S=ks(T,v,0,null),i=xl(i,v,d,null),S.return=o,i.return=o,S.sibling=i,o.child=S,o.child.memoizedState=Ma(d),o.memoizedState=Aa,i):Co(o,T));if(x=i.memoizedState,x!==null&&(N=x.dehydrated,N!==null))return Ke(i,o,T,v,N,x,d);if(S){S=v.fallback,T=o.mode,x=i.child,N=x.sibling;var H={mode:"hidden",children:v.children};return(T&1)===0&&o.child!==x?(v=o.child,v.childLanes=0,v.pendingProps=H,o.deletions=null):(v=rr(x,H),v.subtreeFlags=x.subtreeFlags&14680064),N!==null?S=rr(N,S):(S=xl(S,T,d,null),S.flags|=2),S.return=o,v.return=o,v.sibling=S,o.child=v,v=S,S=o.child,T=i.child.memoizedState,T=T===null?Ma(d):{baseLanes:T.baseLanes|d,cachePool:null,transitions:T.transitions},S.memoizedState=T,S.childLanes=i.childLanes&~d,o.memoizedState=Aa,v}return S=i.child,i=S.sibling,v=rr(S,{mode:"visible",children:v.children}),(o.mode&1)===0&&(v.lanes=d),v.return=o,v.sibling=null,i!==null&&(d=o.deletions,d===null?(o.deletions=[i],o.flags|=16):d.push(i)),o.child=v,o.memoizedState=null,v}function Co(i,o){return o=ks({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Jr(i,o,d,v){return v!==null&&$r(v),Yt(o,i.child,null,d),i=Co(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function Ke(i,o,d,v,x,S,T){if(d)return o.flags&256?(o.flags&=-257,v=ss(Error(n(422))),Jr(i,o,T,v)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(S=v.fallback,x=o.mode,v=ks({mode:"visible",children:v.children},x,0,null),S=xl(S,x,T,null),S.flags|=2,v.return=o,S.return=o,v.sibling=S,o.child=v,(o.mode&1)!==0&&Yt(o,i.child,null,T),o.child.memoizedState=Ma(T),o.memoizedState=Aa,S);if((o.mode&1)===0)return Jr(i,o,T,null);if(x.data==="$!"){if(v=x.nextSibling&&x.nextSibling.dataset,v)var N=v.dgst;return v=N,S=Error(n(419)),v=ss(S,v,void 0),Jr(i,o,T,v)}if(N=(T&i.childLanes)!==0,j0||N){if(v=g0,v!==null){switch(T&-T){case 4:x=2;break;case 16:x=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(v.suspendedLanes|T))!==0?0:x,x!==0&&x!==S.retryLane&&(S.retryLane=x,Gr(i,x),nr(v,i,x,-1))}return Kc(),v=ss(Error(n(421))),Jr(i,o,T,v)}return x.data==="$?"?(o.flags|=128,o.child=i.child,o=d7.bind(null,i),x._reactRetry=o,null):(i=S.treeContext,bn=yi(x.nextSibling),F0=o,Nt=!0,Yn=null,i!==null&&(Dn[Tn++]=yr,Dn[Tn++]=br,Dn[Tn++]=ol,yr=i.id,br=i.overflow,ol=o),o=Co(o,v.children),o.flags|=4096,o)}function Ba(i,o,d){i.lanes|=o;var v=i.alternate;v!==null&&(v.lanes|=o),C0(i.return,o,d)}function Ra(i,o,d,v,x){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:v,tail:d,tailMode:x}:(S.isBackwards=o,S.rendering=null,S.renderingStartTime=0,S.last=v,S.tail=d,S.tailMode=x)}function Pi(i,o,d){var v=o.pendingProps,x=v.revealOrder,S=v.tail;if(S0(i,o,v.children,d),v=Zt.current,(v&2)!==0)v=v&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ba(i,d,o);else if(i.tag===19)Ba(i,d,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}v&=1}if(Ft(Zt,v),(o.mode&1)===0)o.memoizedState=null;else switch(x){case"forwards":for(d=o.child,x=null;d!==null;)i=d.alternate,i!==null&&dl(i)===null&&(x=d),d=d.sibling;d=x,d===null?(x=o.child,o.child=null):(x=d.sibling,d.sibling=null),Ra(o,!1,x,d,S);break;case"backwards":for(d=null,x=o.child,o.child=null;x!==null;){if(i=x.alternate,i!==null&&dl(i)===null){o.child=x;break}i=x.sibling,x.sibling=d,d=x,x=i}Ra(o,!0,d,null,S);break;case"together":Ra(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function fs(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function Qn(i,o,d){if(i!==null&&(o.dependencies=i.dependencies),_i|=o.lanes,(d&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(n(153));if(o.child!==null){for(i=o.child,d=rr(i,i.pendingProps),o.child=d,d.return=o;i.sibling!==null;)i=i.sibling,d=d.sibling=rr(i,i.pendingProps),d.return=o;d.sibling=null}return o.child}function gf(i,o,d){switch(o.tag){case 3:mf(o),wr();break;case 5:sc(o);break;case 1:on(o.type)&&_n(o);break;case 4:ac(o,o.stateNode.containerInfo);break;case 10:var v=o.type._context,x=o.memoizedProps.value;Ft(wa,v._currentValue),v._currentValue=x;break;case 13:if(v=o.memoizedState,v!==null)return v.dehydrated!==null?(Ft(Zt,Zt.current&1),o.flags|=128,null):(d&o.child.childLanes)!==0?ds(i,o,d):(Ft(Zt,Zt.current&1),i=Qn(i,o,d),i!==null?i.sibling:null);Ft(Zt,Zt.current&1);break;case 19:if(v=(d&o.childLanes)!==0,(i.flags&128)!==0){if(v)return Pi(i,o,d);o.flags|=128}if(x=o.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),Ft(Zt,Zt.current),v)break;return null;case 22:case 23:return o.lanes=0,Sc(i,o,d)}return Qn(i,o,d)}var E0,Dc,yf,Tc;E0=function(i,o){for(var d=o.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Dc=function(){},yf=function(i,o,d,v){var x=i.memoizedProps;if(x!==v){i=o.stateNode,Yr(Cr.current);var S=null;switch(d){case"input":x=wt(i,x),v=wt(i,v),S=[];break;case"select":x=ue({},x,{value:void 0}),v=ue({},v,{value:void 0}),S=[];break;case"textarea":x=ht(i,x),v=ht(i,v),S=[];break;default:typeof x.onClick!="function"&&typeof v.onClick=="function"&&(i.onclick=I2)}En(d,v);var T;d=null;for(ae in x)if(!v.hasOwnProperty(ae)&&x.hasOwnProperty(ae)&&x[ae]!=null)if(ae==="style"){var N=x[ae];for(T in N)N.hasOwnProperty(T)&&(d||(d={}),d[T]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(l.hasOwnProperty(ae)?S||(S=[]):(S=S||[]).push(ae,null));for(ae in v){var H=v[ae];if(N=x!=null?x[ae]:void 0,v.hasOwnProperty(ae)&&H!==N&&(H!=null||N!=null))if(ae==="style")if(N){for(T in N)!N.hasOwnProperty(T)||H&&H.hasOwnProperty(T)||(d||(d={}),d[T]="");for(T in H)H.hasOwnProperty(T)&&N[T]!==H[T]&&(d||(d={}),d[T]=H[T])}else d||(S||(S=[]),S.push(ae,d)),d=H;else ae==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,N=N?N.__html:void 0,H!=null&&N!==H&&(S=S||[]).push(ae,H)):ae==="children"?typeof H!="string"&&typeof H!="number"||(S=S||[]).push(ae,""+H):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(l.hasOwnProperty(ae)?(H!=null&&ae==="onScroll"&&It("scroll",i),S||N===H||(S=[])):(S=S||[]).push(ae,H))}d&&(S=S||[]).push("style",d);var ae=S;(o.updateQueue=ae)&&(o.flags|=4)}},Tc=function(i,o,d,v){d!==v&&(o.flags|=4)};function La(i,o){if(!Nt)switch(i.tailMode){case"hidden":o=i.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var v=null;d!==null;)d.alternate!==null&&(v=d),d=d.sibling;v===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:v.sibling=null}}function P0(i){var o=i.alternate!==null&&i.alternate.child===i.child,d=0,v=0;if(o)for(var x=i.child;x!==null;)d|=x.lanes|x.childLanes,v|=x.subtreeFlags&14680064,v|=x.flags&14680064,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)d|=x.lanes|x.childLanes,v|=x.subtreeFlags,v|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=v,i.childLanes=d,o}function r7(i,o,d){var v=o.pendingProps;switch(sl(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return P0(o),null;case 1:return on(o.type)&&O2(),P0(o),null;case 3:return v=o.stateNode,Si(),Vt(ln),Vt(R0),Q2(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(i===null||i.child===null)&&(ba(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Yn!==null&&(zc(Yn),Yn=null))),Dc(i,o),P0(o),null;case 5:X2(o);var x=Yr(vo.current);if(d=o.type,i!==null&&o.stateNode!=null)yf(i,o,d,v,x),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!v){if(o.stateNode===null)throw Error(n(166));return P0(o),null}if(i=Yr(Cr.current),ba(o)){v=o.stateNode,d=o.type;var S=o.memoizedProps;switch(v[mr]=o,v[bi]=S,i=(o.mode&1)!==0,d){case"dialog":It("cancel",v),It("close",v);break;case"iframe":case"object":case"embed":It("load",v);break;case"video":case"audio":for(x=0;x<\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=T.createElement(d,{is:v.is}):(i=T.createElement(d),d==="select"&&(T=i,v.multiple?T.multiple=!0:v.size&&(T.size=v.size))):i=T.createElementNS(i,d),i[mr]=o,i[bi]=v,E0(i,o,!1,!1),o.stateNode=i;e:{switch(T=si(d,v),d){case"dialog":It("cancel",i),It("close",i),x=v;break;case"iframe":case"object":case"embed":It("load",i),x=v;break;case"video":case"audio":for(x=0;xml&&(o.flags|=128,v=!0,La(S,!1),o.lanes=4194304)}else{if(!v)if(i=dl(T),i!==null){if(o.flags|=128,v=!0,d=i.updateQueue,d!==null&&(o.updateQueue=d,o.flags|=4),La(S,!0),S.tail===null&&S.tailMode==="hidden"&&!T.alternate&&!Nt)return P0(o),null}else 2*zt()-S.renderingStartTime>ml&&d!==1073741824&&(o.flags|=128,v=!0,La(S,!1),o.lanes=4194304);S.isBackwards?(T.sibling=o.child,o.child=T):(d=S.last,d!==null?d.sibling=T:o.child=T,S.last=T)}return S.tail!==null?(o=S.tail,S.rendering=o,S.tail=o.sibling,S.renderingStartTime=zt(),o.sibling=null,d=Zt.current,Ft(Zt,v?d&1|2:d&1),o):(P0(o),null);case 22:case 23:return Zc(),v=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(o.flags|=8192),v&&(o.mode&1)!==0?($n&1073741824)!==0&&(P0(o),o.subtreeFlags&6&&(o.flags|=8192)):P0(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function i7(i,o){switch(sl(o),o.tag){case 1:return on(o.type)&&O2(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Si(),Vt(ln),Vt(R0),Q2(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return X2(o),null;case 13:if(Vt(Zt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));wr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Vt(Zt),null;case 4:return Si(),null;case 10:return U2(o.type._context),null;case 22:case 23:return Zc(),null;case 24:return null;default:return null}}var ps=!1,Kt=!1,W0=typeof WeakSet=="function"?WeakSet:Set,Me=null;function So(i,o){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(v){Wt(i,o,v)}else d.current=null}function Fa(i,o,d){try{d()}catch(v){Wt(i,o,v)}}var bf=!1;function l7(i,o){if(va=b2,i=At(),sa(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var v=d.getSelection&&d.getSelection();if(v&&v.rangeCount!==0){d=v.anchorNode;var x=v.anchorOffset,S=v.focusNode;v=v.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var T=0,N=-1,H=-1,ae=0,be=0,we=i,ye=null;t:for(;;){for(var Ae;we!==d||x!==0&&we.nodeType!==3||(N=T+x),we!==S||v!==0&&we.nodeType!==3||(H=T+v),we.nodeType===3&&(T+=we.nodeValue.length),(Ae=we.firstChild)!==null;)ye=we,we=Ae;for(;;){if(we===i)break t;if(ye===d&&++ae===x&&(N=T),ye===S&&++be===v&&(H=T),(Ae=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Ae}d=N===-1||H===-1?null:{start:N,end:H}}else d=null}d=d||{start:0,end:0}}else d=null;for(il={focusedElem:i,selectionRange:d},b2=!1,Me=o;Me!==null;)if(o=Me,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Me=i;else for(;Me!==null;){o=Me;try{var Re=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ie=Re.memoizedProps,n0=Re.memoizedState,te=o.stateNode,U=te.getSnapshotBeforeUpdate(o.elementType===o.type?Ie:Ln(o.type,Ie),n0);te.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var ie=o.stateNode.containerInfo;ie.nodeType===1?ie.textContent="":ie.nodeType===9&&ie.documentElement&&ie.removeChild(ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){Wt(o,o.return,Ee)}if(i=o.sibling,i!==null){i.return=o.return,Me=i;break}Me=o.return}return Re=bf,bf=!1,Re}function ei(i,o,d){var v=o.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var x=v=v.next;do{if((x.tag&i)===i){var S=x.destroy;x.destroy=void 0,S!==void 0&&Fa(o,d,S)}x=x.next}while(x!==v)}}function Ia(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var d=o=o.next;do{if((d.tag&i)===i){var v=d.create;d.destroy=v()}d=d.next}while(d!==o)}}function hs(i){var o=i.ref;if(o!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof o=="function"?o(i):o.current=i}}function xf(i){var o=i.alternate;o!==null&&(i.alternate=null,xf(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[mr],delete o[bi],delete o[N2],delete o[B],delete o[so])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function wf(i){return i.tag===5||i.tag===3||i.tag===4}function $f(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||wf(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Ac(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.nodeType===8?d.parentNode.insertBefore(i,o):d.insertBefore(i,o):(d.nodeType===8?(o=d.parentNode,o.insertBefore(i,d)):(o=d,o.appendChild(i)),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=I2));else if(v!==4&&(i=i.child,i!==null))for(Ac(i,o,d),i=i.sibling;i!==null;)Ac(i,o,d),i=i.sibling}function vs(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.insertBefore(i,o):d.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for(vs(i,o,d),i=i.sibling;i!==null;)vs(i,o,d),i=i.sibling}var m0=null,Jn=!1;function _r(i,o,d){for(d=d.child;d!==null;)Mc(i,o,d),d=d.sibling}function Mc(i,o,d){if(pr&&typeof pr.onCommitFiberUnmount=="function")try{pr.onCommitFiberUnmount(p2,d)}catch{}switch(d.tag){case 5:Kt||So(d,o);case 6:var v=m0,x=Jn;m0=null,_r(i,o,d),m0=v,Jn=x,m0!==null&&(Jn?(i=m0,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):m0.removeChild(d.stateNode));break;case 18:m0!==null&&(Jn?(i=m0,d=d.stateNode,i.nodeType===8?ec(i.parentNode,d):i.nodeType===1&&ec(i,d),Et(i)):ec(m0,d.stateNode));break;case 4:v=m0,x=Jn,m0=d.stateNode.containerInfo,Jn=!0,_r(i,o,d),m0=v,Jn=x;break;case 0:case 11:case 14:case 15:if(!Kt&&(v=d.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){x=v=v.next;do{var S=x,T=S.destroy;S=S.tag,T!==void 0&&((S&2)!==0||(S&4)!==0)&&Fa(d,o,T),x=x.next}while(x!==v)}_r(i,o,d);break;case 1:if(!Kt&&(So(d,o),v=d.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=d.memoizedProps,v.state=d.memoizedState,v.componentWillUnmount()}catch(N){Wt(d,o,N)}_r(i,o,d);break;case 21:_r(i,o,d);break;case 22:d.mode&1?(Kt=(v=Kt)||d.memoizedState!==null,_r(i,o,d),Kt=v):_r(i,o,d);break;default:_r(i,o,d)}}function Eo(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new W0),o.forEach(function(v){var x=f7.bind(null,i,v);d.has(v)||(d.add(v),v.then(x,x))})}}function wn(i,o){var d=o.deletions;if(d!==null)for(var v=0;vx&&(x=T),v&=~S}if(v=x,v=zt()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Sf(v/1960))-v,10i?16:i,Ti===null)var v=!1;else{if(i=Ti,Ti=null,U0=0,(mt&6)!==0)throw Error(n(331));var x=mt;for(mt|=4,Me=i.current;Me!==null;){var S=Me,T=S.child;if((Me.flags&16)!==0){var N=S.deletions;if(N!==null){for(var H=0;Hzt()-Fc?yl(i,0):ys|=d),cn(i,o)}function Tf(i,o){o===0&&((i.mode&1)===0?o=1:(o=h2,h2<<=1,(h2&130023424)===0&&(h2=4194304)));var d=G0();i=Gr(i,o),i!==null&&(na(i,o,d),cn(i,d))}function d7(i){var o=i.memoizedState,d=0;o!==null&&(d=o.retryLane),Tf(i,d)}function f7(i,o){var d=0;switch(i.tag){case 13:var v=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(o),Tf(i,d)}var Af;Af=function(i,o,d){if(i!==null)if(i.memoizedProps!==o.pendingProps||ln.current)j0=!0;else{if((i.lanes&d)===0&&(o.flags&128)===0)return j0=!1,gf(i,o,d);j0=(i.flags&131072)!==0}else j0=!1,Nt&&(o.flags&1048576)!==0&&ef(o,H2,o.index);switch(o.lanes=0,o.tag){case 2:var v=o.type;fs(i,o),i=o.pendingProps;var x=co(o,R0.current);Ci(o,d),x=pl(null,o,v,i,x,d);var S=J2();return o.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,on(v)?(S=!0,_n(o)):S=!1,o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,q2(o),x.updater=as,o.stateNode=x,x._reactInternals=o,wc(o,v,i,d),o=_c(null,o,v,!0,S,d)):(o.tag=0,Nt&&S&&ya(o),S0(null,o,x,d),o=o.child),o;case 16:v=o.elementType;e:{switch(fs(i,o),i=o.pendingProps,x=v._init,v=x(v._payload),o.type=v,x=o.tag=h7(v),i=Ln(v,i),x){case 0:o=Pc(null,o,v,i,d);break e;case 1:o=kc(null,o,v,i,d);break e;case 11:o=vf(null,o,v,i,d);break e;case 14:o=Cc(null,o,v,Ln(v.type,i),d);break e}throw Error(n(306,v,""))}return o;case 0:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),Pc(i,o,v,x,d);case 1:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),kc(i,o,v,x,d);case 3:e:{if(mf(o),i===null)throw Error(n(387));v=o.pendingProps,S=o.memoizedState,x=S.element,lf(i,o),ho(o,v,null,d);var T=o.memoizedState;if(v=T.element,S.isDehydrated)if(S={element:v,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){x=vl(Error(n(423)),o),o=kr(i,o,v,d,x);break e}else if(v!==x){x=vl(Error(n(424)),o),o=kr(i,o,v,d,x);break e}else for(bn=yi(o.stateNode.containerInfo.firstChild),F0=o,Nt=!0,Yn=null,d=W2(o,null,v,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(wr(),v===x){o=Qn(i,o,d);break e}S0(i,o,v,d)}o=o.child}return o;case 5:return sc(o),i===null&&an(o),v=o.type,x=o.pendingProps,S=i!==null?i.memoizedProps:null,T=x.children,ma(v,x)?T=null:S!==null&&ma(v,S)&&(o.flags|=32),Ec(i,o),S0(i,o,T,d),o.child;case 6:return i===null&&an(o),null;case 13:return ds(i,o,d);case 4:return ac(o,o.stateNode.containerInfo),v=o.pendingProps,i===null?o.child=Yt(o,null,v,d):S0(i,o,v,d),o.child;case 11:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),vf(i,o,v,x,d);case 7:return S0(i,o,o.pendingProps,d),o.child;case 8:return S0(i,o,o.pendingProps.children,d),o.child;case 12:return S0(i,o,o.pendingProps.children,d),o.child;case 10:e:{if(v=o.type._context,x=o.pendingProps,S=o.memoizedProps,T=x.value,Ft(wa,v._currentValue),v._currentValue=T,S!==null)if(oe(S.value,T)){if(S.children===x.children&&!ln.current){o=Qn(i,o,d);break e}}else for(S=o.child,S!==null&&(S.return=o);S!==null;){var N=S.dependencies;if(N!==null){T=S.child;for(var H=N.firstContext;H!==null;){if(H.context===v){if(S.tag===1){H=qr(-1,d&-d),H.tag=2;var ae=S.updateQueue;if(ae!==null){ae=ae.shared;var be=ae.pending;be===null?H.next=H:(H.next=be.next,be.next=H),ae.pending=H}}S.lanes|=d,H=S.alternate,H!==null&&(H.lanes|=d),C0(S.return,d,o),N.lanes|=d;break}H=H.next}}else if(S.tag===10)T=S.type===o.type?null:S.child;else if(S.tag===18){if(T=S.return,T===null)throw Error(n(341));T.lanes|=d,N=T.alternate,N!==null&&(N.lanes|=d),C0(T,d,o),T=S.sibling}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===o){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}S0(i,o,x.children,d),o=o.child}return o;case 9:return x=o.type,v=o.pendingProps.children,Ci(o,d),x=An(x),v=v(x),o.flags|=1,S0(i,o,v,d),o.child;case 14:return v=o.type,x=Ln(v,o.pendingProps),x=Ln(v.type,x),Cc(i,o,v,x,d);case 15:return Pr(i,o,o.type,o.pendingProps,d);case 17:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),fs(i,o),o.tag=1,on(v)?(i=!0,_n(o)):i=!1,Ci(o,d),hl(o,v,x),wc(o,v,x,d),_c(null,o,v,!0,i,d);case 19:return Pi(i,o,d);case 22:return Sc(i,o,d)}throw Error(n(156,o.tag))};function Mf(i,o){return vd(i,o)}function p7(i,o,d,v){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(i,o,d,v){return new p7(i,o,d,v)}function Es(i){return i=i.prototype,!(!i||!i.isReactComponent)}function h7(i){if(typeof i=="function")return Es(i)?1:0;if(i!=null){if(i=i.$$typeof,i===pe)return 11;if(i===me)return 14}return 2}function rr(i,o){var d=i.alternate;return d===null?(d=In(i.tag,o,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=o,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,o=i.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function Ps(i,o,d,v,x,S){var T=2;if(v=i,typeof i=="function")Es(i)&&(T=1);else if(typeof i=="string")T=5;else e:switch(i){case J:return xl(d.children,x,S,o);case R:T=8,x|=8;break;case re:return i=In(12,d,o,x|2),i.elementType=re,i.lanes=S,i;case Q:return i=In(13,d,o,x),i.elementType=Q,i.lanes=S,i;case ee:return i=In(19,d,o,x),i.elementType=ee,i.lanes=S,i;case se:return ks(d,x,S,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Z:T=10;break e;case q:T=9;break e;case pe:T=11;break e;case me:T=14;break e;case Se:T=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=In(T,d,o,x),o.elementType=i,o.type=v,o.lanes=S,o}function xl(i,o,d,v){return i=In(7,i,v,o),i.lanes=d,i}function ks(i,o,d,v){return i=In(22,i,v,o),i.elementType=se,i.lanes=d,i.stateNode={isHidden:!1},i}function Hc(i,o,d){return i=In(6,i,null,o),i.lanes=d,i}function jc(i,o,d){return o=In(4,i.children!==null?i.children:[],i.key,o),o.lanes=d,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function v7(i,o,d,v,x){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ta(0),this.expirationTimes=ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ta(0),this.identifierPrefix=v,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Wc(i,o,d,v,x,S,T,N,H){return i=new v7(i,o,d,N,H),o===1?(o=1,S===!0&&(o|=8)):o=0,S=In(3,null,null,o),i.current=S,S.stateNode=i,S.memoizedState={element:v,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},q2(S),i}function m7(i,o,d){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),L7.exports=Tk(),L7.exports}var Jv;function Ak(){if(Jv)return Zf;Jv=1;var e=B8();return Zf.createRoot=e.createRoot,Zf.hydrateRoot=e.hydrateRoot,Zf}var Mk=Ak();const Bk=z5(Mk);/** * react-router v7.12.0 * * Copyright (c) Remix Software Inc. @@ -53,11 +53,11 @@ * LICENSE.md file in the root directory of this source tree. * * @license MIT - */var em="popstate";function Rk(e={}){function t(r,l){let{pathname:s,search:u,hash:f}=r.location;return kp("",{pathname:s,search:u,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:b1(l)}return Fk(t,n,null,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Vr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lk(){return Math.random().toString(36).substring(2,10)}function tm(e,t){return{usr:e.state,key:e.key,idx:t}}function kp(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?au(t):t,state:n,key:t&&t.key||r||Lk()}}function b1({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function au(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Fk(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:s=!1}=r,u=l.history,f="POP",p=null,h=m();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function m(){return(u.state||{idx:null}).idx}function y(){f="POP";let _=m(),A=_==null?null:_-h;h=_,p&&p({action:f,location:k.location,delta:A})}function w(_,A){f="PUSH";let R=kp(k.location,_,A);h=m()+1;let M=tm(R,h),V=k.createHref(R);try{u.pushState(M,"",V)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;l.location.assign(V)}s&&p&&p({action:f,location:k.location,delta:1})}function $(_,A){f="REPLACE";let R=kp(k.location,_,A);h=m();let M=tm(R,h),V=k.createHref(R);u.replaceState(M,"",V),s&&p&&p({action:f,location:k.location,delta:0})}function E(_){return Ik(_)}let k={get action(){return f},get location(){return e(l,u)},listen(_){if(p)throw new Error("A history only accepts one active listener");return l.addEventListener(em,y),p=_,()=>{l.removeEventListener(em,y),p=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let A=E(_);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:w,replace:$,go(_){return u.go(_)}};return k}function Ik(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:b1(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function R8(e,t,n="/"){return Vk(e,t,n,!1)}function Vk(e,t,n,r){let l=typeof t=="string"?au(t):t,s=Rl(l.pathname||"/",n);if(s==null)return null;let u=L8(e);Nk(u);let f=null;for(let p=0;f==null&&p{let m={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&p)return;Qt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let y=Al([r,m.relativePath]),w=n.concat(m);u.children&&u.children.length>0&&(Qt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),L8(u.children,t,w,y,p)),!(u.path==null&&!u.index)&&t.push({path:y,score:Wk(y,u.index),routesMeta:w})};return e.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))s(u,f);else for(let h of F8(u.path))s(u,f,!0,h)}),t}function F8(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let u=F8(r.join("/")),f=[];return f.push(...u.map(p=>p===""?s:[s,p].join("/"))),l&&f.push(...u),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function Nk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Uk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var zk=/^:[\w-]+$/,Ok=3,Zk=2,Kk=1,Hk=10,jk=-2,nm=e=>e==="*";function Wk(e,t){let n=e.split("/"),r=n.length;return n.some(nm)&&(r+=jk),t&&(r+=Zk),n.filter(l=>!nm(l)).reduce((l,s)=>l+(zk.test(s)?Ok:s===""?Kk:Hk),r)}function Uk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Gk(e,t,n=!1){let{routesMeta:r}=e,l={},s="/",u=[];for(let f=0;f{if(m==="*"){let E=f[w]||"";u=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const $=f[w];return y&&!$?h[m]=void 0:h[m]=($||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:u,pattern:e}}function qk(e,t=!1,n=!0){Vr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,p)=>(r.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Yk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Vr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Rl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var I8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xk=e=>I8.test(e);function Qk(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?au(e):e,s;if(n)if(Xk(n))s=n;else{if(n.includes("//")){let u=n;n=n.replace(/\/\/+/g,"/"),Vr(!1,`Pathnames cannot have embedded double slashes - normalizing ${u} -> ${n}`)}n.startsWith("/")?s=rm(n.substring(1),"/"):s=rm(n,t)}else s=t;return{pathname:s,search:t_(r),hash:n_(l)}}function rm(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function V7(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Jk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ph(e){let t=Jk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kh(e,t,n,r=!1){let l;typeof e=="string"?l=au(e):(l={...e},Qt(!l.pathname||!l.pathname.includes("?"),V7("?","pathname","search",l)),Qt(!l.pathname||!l.pathname.includes("#"),V7("#","pathname","hash",l)),Qt(!l.search||!l.search.includes("#"),V7("#","search","hash",l)));let s=e===""||l.pathname==="",u=s?"/":l.pathname,f;if(u==null)f=n;else{let y=t.length-1;if(!r&&u.startsWith("..")){let w=u.split("/");for(;w[0]==="..";)w.shift(),y-=1;l.pathname=w.join("/")}f=y>=0?t[y]:"/"}let p=Qk(l,f),h=u&&u!=="/"&&u.endsWith("/"),m=(s||u===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(h||m)&&(p.pathname+="/"),p}var Al=e=>e.join("/").replace(/\/\/+/g,"/"),e_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),t_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,n_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,r_=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function i_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function l_(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var V8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N8(e,t){let n=e;if(typeof n!="string"||!I8.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(V8)try{let s=new URL(window.location.href),u=n.startsWith("//")?new URL(s.protocol+n):new URL(n),f=Rl(u.pathname,t);u.origin===s.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{Vr(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var z8=["POST","PUT","PATCH","DELETE"];new Set(z8);var o_=["GET",...z8];new Set(o_);var su=b.createContext(null);su.displayName="DataRouter";var Z5=b.createContext(null);Z5.displayName="DataRouterState";var a_=b.createContext(!1),O8=b.createContext({isTransitioning:!1});O8.displayName="ViewTransition";var s_=b.createContext(new Map);s_.displayName="Fetchers";var u_=b.createContext(null);u_.displayName="Await";var cr=b.createContext(null);cr.displayName="Navigation";var I1=b.createContext(null);I1.displayName="Location";var oi=b.createContext({outlet:null,matches:[],isDataRoute:!1});oi.displayName="Route";var _h=b.createContext(null);_h.displayName="RouteError";var Z8="REACT_ROUTER_ERROR",c_="REDIRECT",d_="ROUTE_ERROR_RESPONSE";function f_(e){if(e.startsWith(`${Z8}:${c_}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function p_(e){if(e.startsWith(`${Z8}:${d_}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new r_(t.status,t.statusText,t.data)}catch{}}function h_(e,{relative:t}={}){Qt(uu(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=b.useContext(cr),{hash:l,pathname:s,search:u}=V1(e,{relative:t}),f=s;return n!=="/"&&(f=s==="/"?n:Al([n,s])),r.createHref({pathname:f,search:u,hash:l})}function uu(){return b.useContext(I1)!=null}function Ol(){return Qt(uu(),"useLocation() may be used only in the context of a component."),b.useContext(I1).location}var K8="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function H8(e){b.useContext(cr).static||b.useLayoutEffect(e)}function j8(){let{isDataRoute:e}=b.useContext(oi);return e?__():v_()}function v_(){Qt(uu(),"useNavigate() may be used only in the context of a component.");let e=b.useContext(su),{basename:t,navigator:n}=b.useContext(cr),{matches:r}=b.useContext(oi),{pathname:l}=Ol(),s=JSON.stringify(Ph(r)),u=b.useRef(!1);return H8(()=>{u.current=!0}),b.useCallback((p,h={})=>{if(Vr(u.current,K8),!u.current)return;if(typeof p=="number"){n.go(p);return}let m=kh(p,JSON.parse(s),l,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Al([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,l,e])}b.createContext(null);function m_(){let{matches:e}=b.useContext(oi),t=e[e.length-1];return t?t.params:{}}function V1(e,{relative:t}={}){let{matches:n}=b.useContext(oi),{pathname:r}=Ol(),l=JSON.stringify(Ph(n));return b.useMemo(()=>kh(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function g_(e,t){return W8(e,t)}function W8(e,t,n,r,l){var R;Qt(uu(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=b.useContext(cr),{matches:u}=b.useContext(oi),f=u[u.length-1],p=f?f.params:{},h=f?f.pathname:"/",m=f?f.pathnameBase:"/",y=f&&f.route;{let M=y&&y.path||"";G8(h,!y||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + */var em="popstate";function Rk(e={}){function t(r,l){let{pathname:s,search:u,hash:f}=r.location;return kp("",{pathname:s,search:u,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:b1(l)}return Fk(t,n,null,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Vr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lk(){return Math.random().toString(36).substring(2,10)}function tm(e,t){return{usr:e.state,key:e.key,idx:t}}function kp(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?au(t):t,state:n,key:t&&t.key||r||Lk()}}function b1({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function au(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Fk(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:s=!1}=r,u=l.history,f="POP",p=null,h=m();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function m(){return(u.state||{idx:null}).idx}function y(){f="POP";let _=m(),A=_==null?null:_-h;h=_,p&&p({action:f,location:k.location,delta:A})}function w(_,A){f="PUSH";let L=kp(k.location,_,A);h=m()+1;let M=tm(L,h),I=k.createHref(L);try{u.pushState(M,"",I)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;l.location.assign(I)}s&&p&&p({action:f,location:k.location,delta:1})}function $(_,A){f="REPLACE";let L=kp(k.location,_,A);h=m();let M=tm(L,h),I=k.createHref(L);u.replaceState(M,"",I),s&&p&&p({action:f,location:k.location,delta:0})}function E(_){return Ik(_)}let k={get action(){return f},get location(){return e(l,u)},listen(_){if(p)throw new Error("A history only accepts one active listener");return l.addEventListener(em,y),p=_,()=>{l.removeEventListener(em,y),p=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let A=E(_);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:w,replace:$,go(_){return u.go(_)}};return k}function Ik(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:b1(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function R8(e,t,n="/"){return Vk(e,t,n,!1)}function Vk(e,t,n,r){let l=typeof t=="string"?au(t):t,s=Rl(l.pathname||"/",n);if(s==null)return null;let u=L8(e);Nk(u);let f=null;for(let p=0;f==null&&p{let m={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&p)return;Qt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let y=Al([r,m.relativePath]),w=n.concat(m);u.children&&u.children.length>0&&(Qt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),L8(u.children,t,w,y,p)),!(u.path==null&&!u.index)&&t.push({path:y,score:Wk(y,u.index),routesMeta:w})};return e.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))s(u,f);else for(let h of F8(u.path))s(u,f,!0,h)}),t}function F8(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let u=F8(r.join("/")),f=[];return f.push(...u.map(p=>p===""?s:[s,p].join("/"))),l&&f.push(...u),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function Nk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Uk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var zk=/^:[\w-]+$/,Ok=3,Zk=2,Kk=1,Hk=10,jk=-2,nm=e=>e==="*";function Wk(e,t){let n=e.split("/"),r=n.length;return n.some(nm)&&(r+=jk),t&&(r+=Zk),n.filter(l=>!nm(l)).reduce((l,s)=>l+(zk.test(s)?Ok:s===""?Kk:Hk),r)}function Uk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Gk(e,t,n=!1){let{routesMeta:r}=e,l={},s="/",u=[];for(let f=0;f{if(m==="*"){let E=f[w]||"";u=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const $=f[w];return y&&!$?h[m]=void 0:h[m]=($||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:u,pattern:e}}function qk(e,t=!1,n=!0){Vr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,p)=>(r.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Yk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Vr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Rl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var I8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xk=e=>I8.test(e);function Qk(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?au(e):e,s;if(n)if(Xk(n))s=n;else{if(n.includes("//")){let u=n;n=n.replace(/\/\/+/g,"/"),Vr(!1,`Pathnames cannot have embedded double slashes - normalizing ${u} -> ${n}`)}n.startsWith("/")?s=rm(n.substring(1),"/"):s=rm(n,t)}else s=t;return{pathname:s,search:t_(r),hash:n_(l)}}function rm(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function V7(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Jk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ph(e){let t=Jk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kh(e,t,n,r=!1){let l;typeof e=="string"?l=au(e):(l={...e},Qt(!l.pathname||!l.pathname.includes("?"),V7("?","pathname","search",l)),Qt(!l.pathname||!l.pathname.includes("#"),V7("#","pathname","hash",l)),Qt(!l.search||!l.search.includes("#"),V7("#","search","hash",l)));let s=e===""||l.pathname==="",u=s?"/":l.pathname,f;if(u==null)f=n;else{let y=t.length-1;if(!r&&u.startsWith("..")){let w=u.split("/");for(;w[0]==="..";)w.shift(),y-=1;l.pathname=w.join("/")}f=y>=0?t[y]:"/"}let p=Qk(l,f),h=u&&u!=="/"&&u.endsWith("/"),m=(s||u===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(h||m)&&(p.pathname+="/"),p}var Al=e=>e.join("/").replace(/\/\/+/g,"/"),e_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),t_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,n_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,r_=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function i_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function l_(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var V8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N8(e,t){let n=e;if(typeof n!="string"||!I8.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(V8)try{let s=new URL(window.location.href),u=n.startsWith("//")?new URL(s.protocol+n):new URL(n),f=Rl(u.pathname,t);u.origin===s.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{Vr(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var z8=["POST","PUT","PATCH","DELETE"];new Set(z8);var o_=["GET",...z8];new Set(o_);var su=b.createContext(null);su.displayName="DataRouter";var Z5=b.createContext(null);Z5.displayName="DataRouterState";var a_=b.createContext(!1),O8=b.createContext({isTransitioning:!1});O8.displayName="ViewTransition";var s_=b.createContext(new Map);s_.displayName="Fetchers";var u_=b.createContext(null);u_.displayName="Await";var dr=b.createContext(null);dr.displayName="Navigation";var I1=b.createContext(null);I1.displayName="Location";var oi=b.createContext({outlet:null,matches:[],isDataRoute:!1});oi.displayName="Route";var _h=b.createContext(null);_h.displayName="RouteError";var Z8="REACT_ROUTER_ERROR",c_="REDIRECT",d_="ROUTE_ERROR_RESPONSE";function f_(e){if(e.startsWith(`${Z8}:${c_}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function p_(e){if(e.startsWith(`${Z8}:${d_}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new r_(t.status,t.statusText,t.data)}catch{}}function h_(e,{relative:t}={}){Qt(uu(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=b.useContext(dr),{hash:l,pathname:s,search:u}=V1(e,{relative:t}),f=s;return n!=="/"&&(f=s==="/"?n:Al([n,s])),r.createHref({pathname:f,search:u,hash:l})}function uu(){return b.useContext(I1)!=null}function Ol(){return Qt(uu(),"useLocation() may be used only in the context of a component."),b.useContext(I1).location}var K8="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function H8(e){b.useContext(dr).static||b.useLayoutEffect(e)}function j8(){let{isDataRoute:e}=b.useContext(oi);return e?__():v_()}function v_(){Qt(uu(),"useNavigate() may be used only in the context of a component.");let e=b.useContext(su),{basename:t,navigator:n}=b.useContext(dr),{matches:r}=b.useContext(oi),{pathname:l}=Ol(),s=JSON.stringify(Ph(r)),u=b.useRef(!1);return H8(()=>{u.current=!0}),b.useCallback((p,h={})=>{if(Vr(u.current,K8),!u.current)return;if(typeof p=="number"){n.go(p);return}let m=kh(p,JSON.parse(s),l,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Al([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,l,e])}b.createContext(null);function m_(){let{matches:e}=b.useContext(oi),t=e[e.length-1];return t?t.params:{}}function V1(e,{relative:t}={}){let{matches:n}=b.useContext(oi),{pathname:r}=Ol(),l=JSON.stringify(Ph(n));return b.useMemo(()=>kh(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function g_(e,t){return W8(e,t)}function W8(e,t,n,r,l){var L;Qt(uu(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=b.useContext(dr),{matches:u}=b.useContext(oi),f=u[u.length-1],p=f?f.params:{},h=f?f.pathname:"/",m=f?f.pathnameBase:"/",y=f&&f.route;{let M=y&&y.path||"";G8(h,!y||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let w=Ol(),$;if(t){let M=typeof t=="string"?au(t):t;Qt(m==="/"||((R=M.pathname)==null?void 0:R.startsWith(m)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${M.pathname}" was given in the \`location\` prop.`),$=M}else $=w;let E=$.pathname||"/",k=E;if(m!=="/"){let M=m.replace(/^\//,"").split("/");k="/"+E.replace(/^\//,"").split("/").slice(M.length).join("/")}let _=R8(e,{pathname:k});Vr(y||_!=null,`No routes matched location "${$.pathname}${$.search}${$.hash}" `),Vr(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${$.pathname}${$.search}${$.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let A=$_(_&&_.map(M=>Object.assign({},M,{params:Object.assign({},p,M.params),pathname:Al([m,s.encodeLocation?s.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?m:Al([m,s.encodeLocation?s.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),u,n,r,l);return t&&A?b.createElement(I1.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...$},navigationType:"POP"}},A):A}function y_(){let e=k_(),t=i_(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:l},n):null,u)}var b_=b.createElement(y_,null),U8=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=p_(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(oi.Provider,{value:this.props.routeContext},b.createElement(_h.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(x_,{error:e},t):t}};U8.contextType=a_;var N7=new WeakMap;function x_({children:e,error:t}){let{basename:n}=b.useContext(cr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=f_(t.digest);if(r){let l=N7.get(t);if(l)throw l;let s=N8(r.location,n);if(V8&&!N7.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw N7.set(t,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function w_({routeContext:e,match:t,children:n}){let r=b.useContext(su);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(oi.Provider,{value:e},n)}function $_(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,u=n==null?void 0:n.errors;if(u!=null){let m=s.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Qt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let f=!1,p=-1;if(n)for(let m=0;m=0?s=s.slice(0,p+1):s=[s[0]];break}}}let h=n&&r?(m,y)=>{var w,$;r(m,{location:n.location,params:(($=(w=n.matches)==null?void 0:w[0])==null?void 0:$.params)??{},unstable_pattern:l_(n.matches),errorInfo:y})}:void 0;return s.reduceRight((m,y,w)=>{let $,E=!1,k=null,_=null;n&&($=u&&y.route.id?u[y.route.id]:void 0,k=y.route.errorElement||b_,f&&(p<0&&w===0?(G8("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,_=null):p===w&&(E=!0,_=y.route.hydrateFallbackElement||null)));let A=t.concat(s.slice(0,w+1)),R=()=>{let M;return $?M=k:E?M=_:y.route.Component?M=b.createElement(y.route.Component,null):y.route.element?M=y.route.element:M=m,b.createElement(w_,{match:y,routeContext:{outlet:m,matches:A,isDataRoute:n!=null},children:M})};return n&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?b.createElement(U8,{location:n.location,revalidation:n.revalidation,component:k,error:$,children:R(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:h}):R()},null)}function Dh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C_(e){let t=b.useContext(su);return Qt(t,Dh(e)),t}function S_(e){let t=b.useContext(Z5);return Qt(t,Dh(e)),t}function E_(e){let t=b.useContext(oi);return Qt(t,Dh(e)),t}function Th(e){let t=E_(e),n=t.matches[t.matches.length-1];return Qt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function P_(){return Th("useRouteId")}function k_(){var r;let e=b.useContext(_h),t=S_("useRouteError"),n=Th("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function __(){let{router:e}=C_("useNavigate"),t=Th("useNavigate"),n=b.useRef(!1);return H8(()=>{n.current=!0}),b.useCallback(async(l,s={})=>{Vr(n.current,K8),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...s}))},[e,t])}var im={};function G8(e,t,n){!t&&!im[e]&&(im[e]=!0,Vr(!1,n))}b.memo(D_);function D_({routes:e,future:t,state:n,onError:r}){return W8(e,void 0,n,r,t)}function lm({to:e,replace:t,state:n,relative:r}){Qt(uu()," may be used only in the context of a component.");let{static:l}=b.useContext(cr);Vr(!l," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:s}=b.useContext(oi),{pathname:u}=Ol(),f=j8(),p=kh(e,Ph(s),u,r==="path"),h=JSON.stringify(p);return b.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:r})},[f,h,r,t,n]),null}function qa(e){Qt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function T_({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:s=!1,unstable_useTransitions:u}){Qt(!uu(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:f,navigator:l,static:s,unstable_useTransitions:u,future:{}}),[f,l,s,u]);typeof n=="string"&&(n=au(n));let{pathname:h="/",search:m="",hash:y="",state:w=null,key:$="default"}=n,E=b.useMemo(()=>{let k=Rl(h,f);return k==null?null:{location:{pathname:k,search:m,hash:y,state:w,key:$},navigationType:r}},[f,h,m,y,w,$,r]);return Vr(E!=null,` is not able to match the URL "${h}${m}${y}" because it does not start with the basename, so the won't render anything.`),E==null?null:b.createElement(cr.Provider,{value:p},b.createElement(I1.Provider,{children:t,value:E}))}function A_({children:e,location:t}){return g_(_p(e),t)}function _p(e,t=[]){let n=[];return b.Children.forEach(e,(r,l)=>{if(!b.isValidElement(r))return;let s=[...t,l];if(r.type===b.Fragment){n.push.apply(n,_p(r.props.children,s));return}Qt(r.type===qa,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Qt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=_p(r.props.children,s)),n.push(u)}),n}var n5="get",r5="application/x-www-form-urlencoded";function K5(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function M_(e){return K5(e)&&e.tagName.toLowerCase()==="button"}function B_(e){return K5(e)&&e.tagName.toLowerCase()==="form"}function R_(e){return K5(e)&&e.tagName.toLowerCase()==="input"}function L_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function F_(e,t){return e.button===0&&(!t||t==="_self")&&!L_(e)}var Kf=null;function I_(){if(Kf===null)try{new FormData(document.createElement("form"),0),Kf=!1}catch{Kf=!0}return Kf}var V_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function z7(e){return e!=null&&!V_.has(e)?(Vr(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${r5}"`),null):e}function N_(e,t){let n,r,l,s,u;if(B_(e)){let f=e.getAttribute("action");r=f?Rl(f,t):null,n=e.getAttribute("method")||n5,l=z7(e.getAttribute("enctype"))||r5,s=new FormData(e)}else if(M_(e)||R_(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a