diff --git a/README.md b/README.md index c7eed3e..aec4576 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ loadout sync # install into detected agents (asks first) | `loadout source add\|list\|remove ` | Track skills from external git repos (pinned in `sources.lock.yaml`) | | `loadout check` | Check sources for updates — `git ls-remote` only, nothing fetched or applied | | `loadout update [source]` | Fetch updates, show changelog + artifact diff, apply to the store after confirmation | -| `loadout bundle export [--archive]` | Export the store as a shareable directory or `.loadout.tar.gz` — everything by default, or exactly `--artifacts`/`--profiles`/`--library` (repeatable) plus `--sources` | -| `loadout bundle import ` | Validate a bundle, show the merge plan (`--on-conflict skip\|overwrite`), apply after confirmation | +| `loadout bundle export [--archive\|--flat]` | Export the store as a shareable directory, `.loadout.tar.gz`, or a single self-contained `.loadout.yaml` document (`--flat`) — everything by default, or exactly `--artifacts`/`--profiles`/`--library` (repeatable) plus `--sources` | +| `loadout bundle import ` | Validate a bundle (directory, `.tar.gz`, or flat YAML — auto-detected), show the merge plan (`--on-conflict skip\|overwrite`), apply after confirmation | | `loadout wizard` (alias `create`) | Guided builder: stack + engineering conventions + SDD → generated skills/instructions/commands (`--preset`, `--profile`, `--answers`, `--save-profile`, `--yes`) | | `loadout profile list\|show\|rm` | Save, list, inspect and delete named wizard answer sets (see `--save-profile` above) | | `loadout loadouts save\|list\|show\|switch\|rm` | Named, switchable sets of active artifacts — `switch` installs the set and removes whatever isn't in it (always asks before writing) | @@ -230,7 +230,16 @@ loadout bundle export --archive --artifacts demo --profiles acme-backend # → `--sources` additionally includes `sources.lock.yaml` in a selective export (it's always included in a full, unfiltered one). -The web UI covers the same import flow for `.loadout.tar.gz` archives: from the dashboard's "share" section, upload the file, review the plan (new / conflicting / identical artifacts, new sources), toggle skip-vs-overwrite for conflicts, and confirm — then run a sync to install into your agents. Directory bundles (the non-`--archive` export) are import-able from the CLI only. For picking exactly what to share instead of exporting everything, the dashboard's share section links to a dedicated **Export** page: chip-select artifacts (grouped by kind, with per-kind and select-all shortcuts), profiles, and library entries or whole groups, then download the resulting `.loadout.tar.gz`. +For sharing a small selection somewhere text-shaped — a gist, a doc, a chat message — `--flat` writes one self-contained YAML document (`apiVersion: loadout-config/v1`) instead of a directory or archive: + +```bash +loadout bundle export --flat --artifacts demo --profiles acme-backend -o config.yaml +loadout bundle import config.yaml --yes # same merge plan/apply path as any other bundle +``` + +`bundle import` auto-detects the input shape (directory, `.tar.gz`, or flat YAML) from content, not the file extension, so there's no separate import command to remember. + +The web UI covers the same import flow: from the dashboard's "share" section, either upload a `.loadout.tar.gz` file or paste a flat YAML document directly into a textarea, review the plan (new / conflicting / identical artifacts, new sources), toggle skip-vs-overwrite for conflicts, and confirm — then run a sync to install into your agents. Directory bundles (the non-`--archive` export) are import-able from the CLI only. For picking exactly what to share instead of exporting everything, the dashboard's share section links to a dedicated **Export** page: chip-select artifacts (grouped by kind, with per-kind and select-all shortcuts), profiles, and library entries or whole groups, then either download a `.loadout.tar.gz` or render a copyable/downloadable flat YAML document. ## Supported agents diff --git a/integration/m4_test.go b/integration/m4_test.go index 834811c..435a8a6 100644 --- a/integration/m4_test.go +++ b/integration/m4_test.go @@ -84,3 +84,94 @@ func TestBundleFlow_ExportWipeImport(t *testing.T) { t.Fatalf("imported instruction not synced: %v\n%s", err, raw) } } + +// TestBundleFlow_FlatYAML mirrors TestBundleFlow_ExportWipeImport but uses +// the single-file --flat format instead of a .tar.gz archive — the same +// "new machine" story, paste-into-a-gist shaped. +func TestBundleFlow_FlatYAML(t *testing.T) { + machineA := newEnv(t) + machineA.mustRun("init", "--name", "team-kit") + machineA.mustRun("new", "skill", "review") + machineA.mustRun("new", "instruction", "style") + + if out, err := machineA.run("", "wizard", "--preset", "go-cli", "--save-profile", "acme-backend"); err != nil { + t.Fatalf("save-profile errored: %v\n%s", err, out) + } + storeRootA := filepath.Join(machineA.home, ".local", "share", "loadout", "store") + libraryDir := filepath.Join(storeRootA, "library") + if err := os.MkdirAll(libraryDir, 0o755); err != nil { + t.Fatal(err) + } + // Entries are content-addressed (sha256(trimmed text)[:12]) — a group + // referencing this entry must use the real derived ID, not a made-up + // one, or SaveGroup's membership validation on import rejects it. + const entryID = "13465ce6d578" // sha256("always write tests first")[:12] + libraryYAML := "instructions:\n - id: " + entryID + "\n text: always write tests first\n createdAt: 2026-01-01T00:00:00Z\n" + if err := os.WriteFile(filepath.Join(libraryDir, "instructions.yaml"), []byte(libraryYAML), 0o644); err != nil { + t.Fatal(err) + } + groupsYAML := "groups:\n - name: testing-rules\n entryIds: [" + entryID + "]\n createdAt: 2026-01-01T00:00:00Z\n" + if err := os.WriteFile(filepath.Join(libraryDir, "groups.yaml"), []byte(groupsYAML), 0o644); err != nil { + t.Fatal(err) + } + + flatFile := filepath.Join(machineA.home, "team.loadout.yaml") + out := machineA.mustRun("bundle", "export", "--flat", "--out", flatFile) + if !strings.Contains(out, flatFile) { + t.Fatalf("export output:\n%s", out) + } + rawFlat, err := os.ReadFile(flatFile) + if err != nil { + t.Fatal(err) + } + if !strings.HasPrefix(string(rawFlat), "apiVersion: loadout-config/v1") { + t.Fatalf("flat export missing expected apiVersion header:\n%s", rawFlat) + } + + machineB := newEnv(t) + machineB.mustRun("init", "--name", "mine") + + if out, err := machineB.run("", "bundle", "import", flatFile); err != nil { + t.Fatalf("declined import errored: %v\n%s", err, out) + } + storeSkills := filepath.Join(machineB.home, ".local", "share", "loadout", "store", "skills", "review") + if _, err := os.Stat(storeSkills); !os.IsNotExist(err) { + t.Fatal("import wrote without confirmation") + } + + out = machineB.mustRun("bundle", "import", flatFile, "--yes") + if !strings.Contains(out, "review") || !strings.Contains(out, "style") { + t.Fatalf("import output:\n%s", out) + } + if !strings.Contains(out, "acme-backend") { + t.Fatalf("import output missing the profile:\n%s", out) + } + if !strings.Contains(out, "library entry") { + t.Fatalf("import output missing the library entry:\n%s", out) + } + if !strings.Contains(out, "library group testing-rules") { + t.Fatalf("import output missing the library group:\n%s", out) + } + + storeRootB := filepath.Join(machineB.home, ".local", "share", "loadout", "store") + if _, err := os.Stat(filepath.Join(storeRootB, "profiles", "acme-backend.yaml")); err != nil { + t.Fatalf("profile not imported into machine B's store: %v", err) + } + libRaw, err := os.ReadFile(filepath.Join(storeRootB, "library", "instructions.yaml")) + if err != nil || !strings.Contains(string(libRaw), "always write tests first") { + t.Fatalf("library entry not imported into machine B's store: %v\n%s", err, libRaw) + } + groupsRaw, err := os.ReadFile(filepath.Join(storeRootB, "library", "groups.yaml")) + if err != nil || !strings.Contains(string(groupsRaw), "testing-rules") { + t.Fatalf("library group not imported into machine B's store: %v\n%s", err, groupsRaw) + } + + machineB.mustRun("sync", "--yes") + if _, err := os.Stat(machineB.claude("skills", "review", "SKILL.md")); err != nil { + t.Fatalf("imported skill not synced on machine B: %v", err) + } + rawInstr, err := os.ReadFile(machineB.claude("CLAUDE.md")) + if err != nil || !strings.Contains(string(rawInstr), "loadout:begin style") { + t.Fatalf("imported instruction not synced: %v\n%s", err, rawInstr) + } +} diff --git a/internal/bundle/archive.go b/internal/bundle/archive.go index 2dd37a0..bf42f45 100644 --- a/internal/bundle/archive.go +++ b/internal/bundle/archive.go @@ -115,8 +115,14 @@ func untarGz(archive, dir string) error { } } -// openBundle returns the bundle root for a directory or extracts a .tar.gz -// into a temp dir (cleanup returned). +// gzipMagic is the two-byte header every gzip stream starts with. +var gzipMagic = []byte{0x1f, 0x8b} + +// openBundle returns the bundle root for a directory, extracts a .tar.gz +// into a temp dir, or unpacks a single flat YAML document into a temp dir +// shaped like a bundle — detected by content, not file extension, so it +// works the same whether the path ends in .tar.gz, .yaml, or nothing at +// all. cleanup is returned for the two temp-dir cases. func openBundle(src string) (root string, cleanup func(), err error) { info, err := os.Stat(src) if err != nil { @@ -125,13 +131,30 @@ func openBundle(src string) (root string, cleanup func(), err error) { if info.IsDir() { return src, nil, nil } - tmp, err := os.MkdirTemp("", "loadout-import-*") + + f, err := os.Open(src) if err != nil { return "", nil, err } - if err := untarGz(src, tmp); err != nil { - os.RemoveAll(tmp) + magic := make([]byte, 2) + n, _ := io.ReadFull(f, magic) + f.Close() + + if n == 2 && magic[0] == gzipMagic[0] && magic[1] == gzipMagic[1] { + tmp, err := os.MkdirTemp("", "loadout-import-*") + if err != nil { + return "", nil, err + } + if err := untarGz(src, tmp); err != nil { + os.RemoveAll(tmp) + return "", nil, err + } + return tmp, func() { os.RemoveAll(tmp) }, nil + } + + raw, err := os.ReadFile(src) + if err != nil { return "", nil, err } - return tmp, func() { os.RemoveAll(tmp) }, nil + return unpackFlat(raw) } diff --git a/internal/bundle/bundle.go b/internal/bundle/bundle.go index 9880c55..237549d 100644 --- a/internal/bundle/bundle.go +++ b/internal/bundle/bundle.go @@ -10,6 +10,7 @@ import ( "io/fs" "os" "path/filepath" + "slices" "sort" "strings" "time" @@ -156,6 +157,12 @@ type ImportPlan struct { // content-addressed (see wizard.AddToLibrary), so merging them is // always safe — there is no conflict concept for the library. NewLibraryEntries []wizard.LibraryEntry + // NewGroups and ConflictGroups are library groups (library/groups.yaml) + // diffed by name — same shape as profiles: a name the local store + // doesn't have is New, the same name with different member entries is + // a Conflict. + NewGroups []string + ConflictGroups []string bundleRoot string cleanup func() @@ -171,9 +178,9 @@ func (p *ImportPlan) Close() { // Changes reports how many artifacts Apply would write with the given // overwrite policy. func (p *ImportPlan) Changes(overwrite bool) int { - n := len(p.New) + len(p.Sources) + len(p.NewProfiles) + len(p.NewLibraryEntries) + n := len(p.New) + len(p.Sources) + len(p.NewProfiles) + len(p.NewLibraryEntries) + len(p.NewGroups) if overwrite { - n += len(p.Conflicts) + len(p.ConflictProfiles) + n += len(p.Conflicts) + len(p.ConflictProfiles) + len(p.ConflictGroups) } return n } @@ -293,6 +300,30 @@ func PlanImport(s *store.Store, src string) (*ImportPlan, error) { } } + localGroups, err := wizard.ListGroups(s) + if err != nil { + plan.Close() + return nil, err + } + bundleGroups, err := wizard.ListGroups(bundleStore) + if err != nil { + plan.Close() + return nil, err + } + localGroupByName := make(map[string]wizard.LibraryGroup, len(localGroups)) + for _, g := range localGroups { + localGroupByName[g.Name] = g + } + for _, g := range bundleGroups { + local, exists := localGroupByName[g.Name] + switch { + case !exists: + plan.NewGroups = append(plan.NewGroups, g.Name) + case !slices.Equal(local.EntryIDs, g.EntryIDs): + plan.ConflictGroups = append(plan.ConflictGroups, g.Name) + } + } + sort.Slice(plan.New, func(i, j int) bool { return plan.New[i].ID < plan.New[j].ID }) sort.Slice(plan.Conflicts, func(i, j int) bool { return plan.Conflicts[i].ID < plan.Conflicts[j].ID }) sort.Strings(plan.NewProfiles) @@ -410,6 +441,41 @@ func Apply(s *store.Store, p *ImportPlan, overwrite bool) ([]string, error) { } } + if len(p.NewGroups) > 0 || (overwrite && len(p.ConflictGroups) > 0) { + bundleStore, err := store.Open(p.bundleRoot) + if err != nil { + return applied, err + } + bundleGroups, err := wizard.ListGroups(bundleStore) + if err != nil { + return applied, err + } + byName := make(map[string]wizard.LibraryGroup, len(bundleGroups)) + for _, g := range bundleGroups { + byName[g.Name] = g + } + applyGroup := func(name string) error { + g, ok := byName[name] + if !ok { + return fmt.Errorf("group %q not found in bundle", name) + } + _, err := wizard.SaveGroup(s, g.Name, g.EntryIDs) + return err + } + for _, name := range p.NewGroups { + if err := applyGroup(name); err != nil { + return applied, err + } + } + if overwrite { + for _, name := range p.ConflictGroups { + if err := applyGroup(name); err != nil { + return applied, err + } + } + } + } + return applied, nil } diff --git a/internal/bundle/bundle_test.go b/internal/bundle/bundle_test.go index 722d353..fec34ae 100644 --- a/internal/bundle/bundle_test.go +++ b/internal/bundle/bundle_test.go @@ -269,6 +269,103 @@ func TestApply_SkipsConflictingProfileWithoutOverwrite(t *testing.T) { } } +func TestPlanImport_IncludesGroups(t *testing.T) { + src := testStore(t, "team-kit") + a, err := wizard.AddToLibrary(src, "always write tests first") + if err != nil { + t.Fatal(err) + } + if _, err := wizard.SaveGroup(src, "testing-rules", []string{a.ID}); err != nil { + t.Fatal(err) + } + dest := filepath.Join(t.TempDir(), "exported") + if _, err := Export(src, dest, "test"); err != nil { + t.Fatal(err) + } + + fresh := testStore(t, "mine") + plan, err := PlanImport(fresh, dest) + if err != nil { + t.Fatal(err) + } + defer plan.Close() + if len(plan.NewGroups) != 1 || plan.NewGroups[0] != "testing-rules" { + t.Fatalf("NewGroups = %v, want [testing-rules]", plan.NewGroups) + } + + if _, err := Apply(fresh, plan, false); err != nil { + t.Fatal(err) + } + groups, err := wizard.ListGroups(fresh) + if err != nil { + t.Fatal(err) + } + if len(groups) != 1 || groups[0].Name != "testing-rules" || len(groups[0].EntryIDs) != 1 { + t.Fatalf("imported groups = %v", groups) + } +} + +func TestApply_SkipsConflictingGroupWithoutOverwrite(t *testing.T) { + src := testStore(t, "team-kit") + a, err := wizard.AddToLibrary(src, "entry a") + if err != nil { + t.Fatal(err) + } + if _, err := wizard.SaveGroup(src, "rules", []string{a.ID}); err != nil { + t.Fatal(err) + } + dest := filepath.Join(t.TempDir(), "exported") + if _, err := Export(src, dest, "test"); err != nil { + t.Fatal(err) + } + + local := testStore(t, "mine") + b, err := wizard.AddToLibrary(local, "entry b") + if err != nil { + t.Fatal(err) + } + if _, err := wizard.SaveGroup(local, "rules", []string{b.ID}); err != nil { + t.Fatal(err) + } + + plan, err := PlanImport(local, dest) + if err != nil { + t.Fatal(err) + } + defer plan.Close() + if len(plan.ConflictGroups) != 1 || plan.ConflictGroups[0] != "rules" { + t.Fatalf("ConflictGroups = %v", plan.ConflictGroups) + } + + // Skip policy: local group untouched. Apply also needs entry "a" to + // exist locally before an overwrite could succeed. + if _, err := wizard.AddToLibrary(local, "entry a"); err != nil { + t.Fatal(err) + } + if _, err := Apply(local, plan, false); err != nil { + t.Fatal(err) + } + groups, err := wizard.ListGroups(local) + if err != nil { + t.Fatal(err) + } + if len(groups) != 1 || groups[0].EntryIDs[0] != b.ID { + t.Fatalf("skip policy should leave the local group untouched, got %v", groups) + } + + // Overwrite policy replaces membership with the bundle's version. + if _, err := Apply(local, plan, true); err != nil { + t.Fatal(err) + } + groups, err = wizard.ListGroups(local) + if err != nil { + t.Fatal(err) + } + if len(groups) != 1 || groups[0].EntryIDs[0] != a.ID { + t.Fatalf("overwrite policy should replace membership with the bundle's, got %v", groups) + } +} + func TestUntarGz_RejectsPathTraversal(t *testing.T) { // Hand-craft a malicious archive. dir := t.TempDir() diff --git a/internal/bundle/flat.go b/internal/bundle/flat.go new file mode 100644 index 0000000..f6ae83a --- /dev/null +++ b/internal/bundle/flat.go @@ -0,0 +1,294 @@ +package bundle + +import ( + "fmt" + "os" + "path/filepath" + "time" + + "github.com/AxeForging/loadout/internal/domain" + "github.com/AxeForging/loadout/internal/store" + "github.com/AxeForging/loadout/internal/wizard" + "github.com/goccy/go-yaml" +) + +// FlatAPIVersion is the schema for the single-file YAML export — a fully +// self-contained alternative to the directory/.tar.gz bundle formats, +// small enough to paste into a gist or a doc. It's the same bundle +// contents as the other formats, just a different transport encoding: +// file bytes are inlined as plain strings instead of living on disk +// inside an archive. +const FlatAPIVersion = "loadout-config/v1" + +// FlatArtifact mirrors domain.Artifact but inlines its file content as +// strings (not []byte, which goccy/go-yaml would base64-encode) so the +// document stays human-readable. +type FlatArtifact struct { + ID string `yaml:"id"` + Kind string `yaml:"kind"` + Path string `yaml:"path"` + Targets []string `yaml:"targets,omitempty"` + Origin string `yaml:"origin,omitempty"` + Tags []string `yaml:"tags,omitempty"` + Files map[string]string `yaml:"files"` +} + +// FlatProfile pairs a saved profile's name with its answers (wizard's +// SaveProfile/LoadProfile keep these separate; the flat document needs +// them together). +type FlatProfile struct { + Name string `yaml:"name"` + Answers wizard.Answers `yaml:"answers"` +} + +// FlatConfig is the full single-file document. +type FlatConfig struct { + APIVersion string `yaml:"apiVersion"` + Name string `yaml:"name"` + CreatedAt time.Time `yaml:"createdAt"` + CreatedBy string `yaml:"createdBy"` + Artifacts []FlatArtifact `yaml:"artifacts"` + Profiles []FlatProfile `yaml:"profiles,omitempty"` + Library []wizard.LibraryEntry `yaml:"library,omitempty"` + Groups []wizard.LibraryGroup `yaml:"libraryGroups,omitempty"` + Sources []domain.SourceRef `yaml:"sources,omitempty"` +} + +// ExportFlat renders a Selection as one self-contained YAML document. It +// reuses ExportSelected's filtering by staging into a temp directory first +// and reading that back into the flat shape, rather than duplicating +// selection logic — the flat format is just an alternate encoding of the +// same bundle contents. +func ExportFlat(s *store.Store, createdBy string, sel Selection) ([]byte, error) { + staging, err := os.MkdirTemp("", "loadout-flat-export-*") + if err != nil { + return nil, err + } + defer os.RemoveAll(staging) + + dir := filepath.Join(staging, "bundle") + if _, err := ExportSelected(s, dir, createdBy, sel); err != nil { + return nil, err + } + staged, err := store.Open(dir) + if err != nil { + return nil, err + } + + artifacts := make([]FlatArtifact, 0, len(staged.Manifest.Artifacts)) + for _, art := range staged.Manifest.Artifacts { + content, err := staged.Content(art) + if err != nil { + return nil, err + } + files := make(map[string]string, len(content.Files)) + for rel, raw := range content.Files { + files[rel] = string(raw) + } + artifacts = append(artifacts, FlatArtifact{ + ID: art.ID, Kind: string(art.Kind), Path: art.Path, + Targets: art.Targets, Origin: art.Origin, Tags: art.Tags, Files: files, + }) + } + + var profiles []FlatProfile + names, err := wizard.ListProfiles(staged) + if err != nil { + return nil, err + } + for _, name := range names { + answers, err := wizard.LoadProfile(staged, name) + if err != nil { + return nil, err + } + profiles = append(profiles, FlatProfile{Name: name, Answers: answers}) + } + + library, err := wizard.ListLibrary(staged) + if err != nil { + return nil, err + } + + // Groups aren't individually selectable (only library entries are); a + // group is included only when every one of its member entries was also + // selected, so the document never references an entry it doesn't carry. + selectedIDs := make(map[string]bool, len(sel.LibraryEntryIDs)) + for _, id := range sel.LibraryEntryIDs { + selectedIDs[id] = true + } + allGroups, err := wizard.ListGroups(s) + if err != nil { + return nil, err + } + var groups []wizard.LibraryGroup + for _, g := range allGroups { + complete := len(g.EntryIDs) > 0 + for _, id := range g.EntryIDs { + if !selectedIDs[id] { + complete = false + break + } + } + if complete { + groups = append(groups, g) + } + } + + var sources []domain.SourceRef + if sel.Sources { + sources, err = (&sourceLockReader{root: dir}).read() + if err != nil { + return nil, err + } + } + + cfg := FlatConfig{ + APIVersion: FlatAPIVersion, + Name: s.Manifest.Name, + CreatedAt: time.Now().UTC(), + CreatedBy: createdBy, + Artifacts: artifacts, + Profiles: profiles, + Library: library, + Groups: groups, + Sources: sources, + } + return yaml.Marshal(cfg) +} + +// unpackFlat writes a flat config document into a temp directory shaped +// like a normal bundle (bundle.yaml + loadout.yaml + skills//... from +// the inlined Files), so PlanImport can read it exactly like any other +// bundle — no separate diff/merge logic for the flat format. +func unpackFlat(raw []byte) (root string, cleanup func(), err error) { + var cfg FlatConfig + if err := yaml.Unmarshal(raw, &cfg); err != nil { + return "", nil, fmt.Errorf("parse flat config: %w", err) + } + if cfg.APIVersion != FlatAPIVersion { + return "", nil, fmt.Errorf("not a loadout bundle (unrecognized apiVersion %q)", cfg.APIVersion) + } + + tmp, err := os.MkdirTemp("", "loadout-flat-*") + if err != nil { + return "", nil, err + } + cleanupFn := func() { os.RemoveAll(tmp) } + fail := func(err error) (string, func(), error) { + cleanupFn() + return "", nil, err + } + + artifacts := make([]domain.Artifact, 0, len(cfg.Artifacts)) + for _, fa := range cfg.Artifacts { + for rel, content := range fa.Files { + dest := filepath.Join(tmp, filepath.FromSlash(fa.Path), filepath.FromSlash(rel)) + if err := os.MkdirAll(filepath.Dir(dest), 0o755); err != nil { + return fail(err) + } + if err := os.WriteFile(dest, []byte(content), 0o644); err != nil { + return fail(err) + } + } + artifacts = append(artifacts, domain.Artifact{ + ID: fa.ID, Kind: domain.ArtifactKind(fa.Kind), Path: fa.Path, + Targets: fa.Targets, Origin: fa.Origin, Tags: fa.Tags, + }) + } + manifest := domain.Manifest{APIVersion: domain.APIVersion, Name: cfg.Name, Artifacts: artifacts} + manifestRaw, err := yaml.Marshal(manifest) + if err != nil { + return fail(err) + } + if err := os.WriteFile(filepath.Join(tmp, "loadout.yaml"), manifestRaw, 0o644); err != nil { + return fail(err) + } + + if len(cfg.Profiles) > 0 { + if err := os.MkdirAll(filepath.Join(tmp, "profiles"), 0o755); err != nil { + return fail(err) + } + for _, p := range cfg.Profiles { + raw, err := yaml.Marshal(p.Answers) + if err != nil { + return fail(err) + } + if err := os.WriteFile(filepath.Join(tmp, "profiles", p.Name+".yaml"), raw, 0o644); err != nil { + return fail(err) + } + } + } + + if len(cfg.Library) > 0 { + if err := os.MkdirAll(filepath.Join(tmp, "library"), 0o755); err != nil { + return fail(err) + } + raw, err := yaml.Marshal(struct { + Instructions []wizard.LibraryEntry `yaml:"instructions"` + }{Instructions: cfg.Library}) + if err != nil { + return fail(err) + } + if err := os.WriteFile(filepath.Join(tmp, "library", "instructions.yaml"), raw, 0o644); err != nil { + return fail(err) + } + } + + if len(cfg.Groups) > 0 { + if err := os.MkdirAll(filepath.Join(tmp, "library"), 0o755); err != nil { + return fail(err) + } + raw, err := yaml.Marshal(struct { + Groups []wizard.LibraryGroup `yaml:"groups"` + }{Groups: cfg.Groups}) + if err != nil { + return fail(err) + } + if err := os.WriteFile(filepath.Join(tmp, "library", "groups.yaml"), raw, 0o644); err != nil { + return fail(err) + } + } + + if len(cfg.Sources) > 0 { + raw, err := yaml.Marshal(map[string][]domain.SourceRef{"sources": cfg.Sources}) + if err != nil { + return fail(err) + } + if err := os.WriteFile(filepath.Join(tmp, "sources.lock.yaml"), raw, 0o644); err != nil { + return fail(err) + } + } + + meta := Meta{APIVersion: APIVersion, Name: cfg.Name, CreatedAt: cfg.CreatedAt, CreatedBy: cfg.CreatedBy, Artifacts: len(artifacts)} + metaRaw, err := yaml.Marshal(meta) + if err != nil { + return fail(err) + } + if err := os.WriteFile(filepath.Join(tmp, MetaFile), metaRaw, 0o644); err != nil { + return fail(err) + } + + return tmp, cleanupFn, nil +} + +// ImportFlat validates and diffs a flat config document against the local +// store, exactly like PlanImport does for a directory or .tar.gz bundle — +// it just unpacks the flat document into a temp directory first. +func ImportFlat(s *store.Store, raw []byte) (*ImportPlan, error) { + root, cleanup, err := unpackFlat(raw) + if err != nil { + return nil, err + } + plan, err := PlanImport(s, root) + if err != nil { + if cleanup != nil { + cleanup() + } + return nil, err + } + // PlanImport's directory branch leaves cleanup nil (it doesn't own + // directories it didn't create) — here we did create one, so wire our + // own cleanup into the plan the caller already knows how to Close(). + plan.cleanup = cleanup + return plan, nil +} diff --git a/internal/bundle/flat_test.go b/internal/bundle/flat_test.go new file mode 100644 index 0000000..1d72147 --- /dev/null +++ b/internal/bundle/flat_test.go @@ -0,0 +1,170 @@ +package bundle + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "github.com/AxeForging/loadout/internal/domain" + "github.com/AxeForging/loadout/internal/wizard" +) + +func TestExportFlat_ImportFlat_RoundTrip(t *testing.T) { + src := testStore(t, "team-kit") + if _, err := src.New(domain.KindSkill, "review"); err != nil { + t.Fatal(err) + } + if err := wizard.SaveProfile(src, "acme-backend", wizard.Answers{"toolchain.docker": true}); err != nil { + t.Fatal(err) + } + a, err := wizard.AddToLibrary(src, "always write tests first") + if err != nil { + t.Fatal(err) + } + b, err := wizard.AddToLibrary(src, "no coverage theater") + if err != nil { + t.Fatal(err) + } + if _, err := wizard.SaveGroup(src, "testing-rules", []string{a.ID, b.ID}); err != nil { + t.Fatal(err) + } + + raw, err := ExportFlat(src, "test", Selection{ + ArtifactIDs: []string{"review"}, + ProfileNames: []string{"acme-backend"}, + LibraryEntryIDs: []string{a.ID, b.ID}, + }) + if err != nil { + t.Fatalf("ExportFlat() error = %v", err) + } + + // The whole point of the flat format is human-readable text — file + // content should appear as plain YAML block scalars, never base64. + if !strings.Contains(string(raw), "apiVersion: loadout-config/v1") { + t.Errorf("flat document missing apiVersion:\n%s", raw) + } + if !strings.Contains(string(raw), "name: review") { + t.Errorf("flat document should contain readable skill content, not encoded bytes:\n%s", raw) + } + + fresh := testStore(t, "mine") + plan, err := ImportFlat(fresh, raw) + if err != nil { + t.Fatalf("ImportFlat() error = %v", err) + } + defer plan.Close() + if len(plan.New) != 1 || plan.New[0].ID != "review" { + t.Fatalf("plan.New = %v, want only [review]", plan.New) + } + if len(plan.NewProfiles) != 1 || plan.NewProfiles[0] != "acme-backend" { + t.Fatalf("plan.NewProfiles = %v, want [acme-backend]", plan.NewProfiles) + } + if len(plan.NewLibraryEntries) != 2 { + t.Fatalf("plan.NewLibraryEntries = %v, want 2 entries", plan.NewLibraryEntries) + } + + if _, err := Apply(fresh, plan, false); err != nil { + t.Fatalf("Apply() error = %v", err) + } + if _, err := os.Stat(filepath.Join(fresh.Root, "skills", "review", "SKILL.md")); err != nil { + t.Errorf("skill content not imported: %v", err) + } + loadedAnswers, err := wizard.LoadProfile(fresh, "acme-backend") + if err != nil { + t.Fatal(err) + } + if !loadedAnswers.Bool("toolchain.docker") { + t.Error("profile answers lost across the flat round trip") + } + entries, err := wizard.ListLibrary(fresh) + if err != nil { + t.Fatal(err) + } + if len(entries) != 2 { + t.Errorf("library entries = %v, want 2", entries) + } + groups, err := wizard.ListGroups(fresh) + if err != nil { + t.Fatal(err) + } + if len(groups) != 1 || groups[0].Name != "testing-rules" { + t.Errorf("groups = %v, want [testing-rules]", groups) + } +} + +func TestExportFlat_GroupOnlyIncludedWhenAllMembersSelected(t *testing.T) { + src := testStore(t, "team-kit") + a, err := wizard.AddToLibrary(src, "entry a") + if err != nil { + t.Fatal(err) + } + b, err := wizard.AddToLibrary(src, "entry b") + if err != nil { + t.Fatal(err) + } + if _, err := wizard.SaveGroup(src, "both", []string{a.ID, b.ID}); err != nil { + t.Fatal(err) + } + + // Only entry a selected — the group should be excluded, since it also + // references b, which the document wouldn't carry. + partial, err := ExportFlat(src, "test", Selection{LibraryEntryIDs: []string{a.ID}}) + if err != nil { + t.Fatal(err) + } + if strings.Contains(string(partial), "libraryGroups") { + t.Errorf("group should be excluded when not all members are selected:\n%s", partial) + } + + // Both entries selected — the group should now be included. + full, err := ExportFlat(src, "test", Selection{LibraryEntryIDs: []string{a.ID, b.ID}}) + if err != nil { + t.Fatal(err) + } + if !strings.Contains(string(full), "name: both") { + t.Errorf("group should be included when all members are selected:\n%s", full) + } +} + +func TestOpenBundle_DetectsFlatYAML(t *testing.T) { + src := testStore(t, "team-kit") + if _, err := src.New(domain.KindSkill, "review"); err != nil { + t.Fatal(err) + } + raw, err := ExportFlat(src, "test", Selection{ArtifactIDs: []string{"review"}}) + if err != nil { + t.Fatal(err) + } + path := filepath.Join(t.TempDir(), "config.yaml") + if err := os.WriteFile(path, raw, 0o644); err != nil { + t.Fatal(err) + } + + fresh := testStore(t, "mine") + plan, err := PlanImport(fresh, path) + if err != nil { + t.Fatalf("PlanImport() on a flat YAML file path error = %v", err) + } + defer plan.Close() + if len(plan.New) != 1 || plan.New[0].ID != "review" { + t.Fatalf("plan.New = %v, want only [review]", plan.New) + } +} + +func TestOpenBundle_RejectsUnrecognizedContent(t *testing.T) { + fresh := testStore(t, "mine") + path := filepath.Join(t.TempDir(), "not-a-bundle.txt") + if err := os.WriteFile(path, []byte("just some text, not yaml or gzip"), 0o644); err != nil { + t.Fatal(err) + } + if _, err := PlanImport(fresh, path); err == nil { + t.Fatal("expected an error for unrecognized content, not a panic or silent success") + } +} + +func TestUnpackFlat_RejectsWrongAPIVersion(t *testing.T) { + if _, _, err := unpackFlat([]byte("apiVersion: something-else/v1\n")); err == nil { + t.Fatal("expected an error for a mismatched apiVersion") + } +} diff --git a/internal/cli/bundle.go b/internal/cli/bundle.go index 3857a6e..516f661 100644 --- a/internal/cli/bundle.go +++ b/internal/cli/bundle.go @@ -3,13 +3,41 @@ package cli import ( "context" "fmt" + "os" "strings" "github.com/AxeForging/loadout/internal/build" "github.com/AxeForging/loadout/internal/bundle" + "github.com/AxeForging/loadout/internal/store" + "github.com/AxeForging/loadout/internal/wizard" "github.com/urfave/cli/v3" ) +// allArtifactIDs, allProfileNames and allLibraryEntryIDs resolve "export +// everything" into explicit lists for ExportFlat, which — unlike +// Export/ExportArchive — always takes an explicit Selection. +func allArtifactIDs(s *store.Store) []string { + ids := make([]string, 0, len(s.Manifest.Artifacts)) + for _, a := range s.Manifest.Artifacts { + ids = append(ids, a.ID) + } + return ids +} + +func allProfileNames(s *store.Store) []string { + names, _ := wizard.ListProfiles(s) + return names +} + +func allLibraryEntryIDs(s *store.Store) []string { + entries, _ := wizard.ListLibrary(s) + ids := make([]string, 0, len(entries)) + for _, e := range entries { + ids = append(ids, e.ID) + } + return ids +} + func bundleCmd() *cli.Command { return &cli.Command{ Name: "bundle", @@ -21,6 +49,7 @@ func bundleCmd() *cli.Command { Flags: []cli.Flag{ &cli.StringFlag{Name: "out", Aliases: []string{"o"}, Usage: "Destination path (default: derived from the store name)"}, &cli.BoolFlag{Name: "archive", Usage: "Pack into a single .loadout.tar.gz instead of a directory"}, + &cli.BoolFlag{Name: "flat", Usage: "Write a single self-contained YAML document instead of a directory/archive — small enough to paste into a gist or a doc"}, &cli.StringSliceFlag{Name: "artifacts", Usage: "Only export these artifact IDs (repeatable) — omit to export every artifact"}, &cli.StringSliceFlag{Name: "profiles", Usage: "Only export these saved profile names (repeatable) — omit to export none unless no selection flag is given at all"}, &cli.StringSliceFlag{Name: "library", Usage: "Only export these library entry IDs (repeatable) — omit to export none unless no selection flag is given at all"}, @@ -38,6 +67,36 @@ func bundleCmd() *cli.Command { profileNames := cmd.StringSlice("profiles") libraryIDs := cmd.StringSlice("library") selective := len(artifactIDs) > 0 || len(profileNames) > 0 || len(libraryIDs) > 0 + sel := bundle.Selection{ + ArtifactIDs: artifactIDs, ProfileNames: profileNames, LibraryEntryIDs: libraryIDs, Sources: cmd.Bool("sources"), + } + + if cmd.Bool("flat") { + if out == "" { + out = s.Manifest.Name + ".loadout.yaml" + } + // ExportFlat always takes an explicit Selection (no + // built-in "everything" mode like Export/ + // ExportArchive have) — no selection flag at all + // means resolve "everything" ourselves. + if !selective { + sel = bundle.Selection{ + ArtifactIDs: allArtifactIDs(s), + ProfileNames: allProfileNames(s), + LibraryEntryIDs: allLibraryEntryIDs(s), + Sources: true, + } + } + raw, err := bundle.ExportFlat(s, createdBy, sel) + if err != nil { + return err + } + if err := os.WriteFile(out, raw, 0o644); err != nil { + return err + } + fmt.Printf("Exported to %s\n", out) + return nil + } if cmd.Bool("archive") { if out == "" { @@ -45,9 +104,7 @@ func bundleCmd() *cli.Command { } var meta bundle.Meta if selective { - meta, err = bundle.ExportSelectedArchive(s, out, createdBy, bundle.Selection{ - ArtifactIDs: artifactIDs, ProfileNames: profileNames, LibraryEntryIDs: libraryIDs, Sources: cmd.Bool("sources"), - }) + meta, err = bundle.ExportSelectedArchive(s, out, createdBy, sel) } else { meta, err = bundle.ExportArchive(s, out, createdBy) } @@ -63,9 +120,7 @@ func bundleCmd() *cli.Command { } var meta bundle.Meta if selective { - meta, err = bundle.ExportSelected(s, out, createdBy, bundle.Selection{ - ArtifactIDs: artifactIDs, ProfileNames: profileNames, LibraryEntryIDs: libraryIDs, Sources: cmd.Bool("sources"), - }) + meta, err = bundle.ExportSelected(s, out, createdBy, sel) } else { meta, err = bundle.Export(s, out, createdBy) } @@ -145,6 +200,16 @@ func bundleCmd() *cli.Command { } fmt.Printf(" + %d custom-instruction library %s\n", n, noun) } + for _, name := range plan.NewGroups { + fmt.Printf(" + library group %s\n", name) + } + for _, name := range plan.ConflictGroups { + action := "skip (exists locally with different members)" + if overwrite { + action = "OVERWRITE local version" + } + fmt.Printf(" ! library group %s — %s\n", name, action) + } if len(plan.Identical) > 0 { fmt.Printf(" = %d artifact(s) identical, nothing to do\n", len(plan.Identical)) } diff --git a/internal/web/dist/assets/index-BG1RMQ19.js b/internal/web/dist/assets/index-BG1RMQ19.js deleted file mode 100644 index 4e90e1b..0000000 --- a/internal/web/dist/assets/index-BG1RMQ19.js +++ /dev/null @@ -1,67 +0,0 @@ -var Xy=l=>{throw TypeError(l)};var Xo=(l,i,s)=>i.has(l)||Xy("Cannot "+s);var _=(l,i,s)=>(Xo(l,i,"read from private field"),s?s.call(l):i.get(l)),rt=(l,i,s)=>i.has(l)?Xy("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(l):i.set(l,s),tt=(l,i,s,c)=>(Xo(l,i,"write to private field"),c?c.call(l,s):i.set(l,s),s),yt=(l,i,s)=>(Xo(l,i,"access private method"),s);var rc=(l,i,s,c)=>({set _(o){tt(l,i,o,s)},get _(){return _(l,i,c)}});(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(o){if(o.ep)return;o.ep=!0;const f=s(o);fetch(o.href,f)}})();function c0(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Vo={exports:{}},Es={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Vy;function r0(){if(Vy)return Es;Vy=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(c,o,f){var m=null;if(f!==void 0&&(m=""+f),o.key!==void 0&&(m=""+o.key),"key"in o){f={};for(var v in o)v!=="key"&&(f[v]=o[v])}else f=o;return o=f.ref,{$$typeof:l,type:c,key:m,ref:o!==void 0?o:null,props:f}}return Es.Fragment=i,Es.jsx=s,Es.jsxs=s,Es}var Zy;function o0(){return Zy||(Zy=1,Vo.exports=r0()),Vo.exports}var h=o0(),Zo={exports:{}},dt={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jy;function f0(){if(Jy)return dt;Jy=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),S=Symbol.iterator;function j(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,R={};function M(A,Z,W){this.props=A,this.context=Z,this.refs=R,this.updater=W||N}M.prototype.isReactComponent={},M.prototype.setState=function(A,Z){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,Z,"setState")},M.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function O(){}O.prototype=M.prototype;function Q(A,Z,W){this.props=A,this.context=Z,this.refs=R,this.updater=W||N}var w=Q.prototype=new O;w.constructor=Q,T(w,M.prototype),w.isPureReactComponent=!0;var K=Array.isArray;function B(){}var D={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function F(A,Z,W){var et=W.ref;return{$$typeof:l,type:A,key:Z,ref:et!==void 0?et:null,props:W}}function $(A,Z){return F(A.type,Z,A.props)}function I(A){return typeof A=="object"&&A!==null&&A.$$typeof===l}function nt(A){var Z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(W){return Z[W]})}var at=/\/+/g;function lt(A,Z){return typeof A=="object"&&A!==null&&A.key!=null?nt(""+A.key):Z.toString(36)}function gt(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(B,B):(A.status="pending",A.then(function(Z){A.status==="pending"&&(A.status="fulfilled",A.value=Z)},function(Z){A.status==="pending"&&(A.status="rejected",A.reason=Z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function H(A,Z,W,et,ct){var pt=typeof A;(pt==="undefined"||pt==="boolean")&&(A=null);var _t=!1;if(A===null)_t=!0;else switch(pt){case"bigint":case"string":case"number":_t=!0;break;case"object":switch(A.$$typeof){case l:case i:_t=!0;break;case b:return _t=A._init,H(_t(A._payload),Z,W,et,ct)}}if(_t)return ct=ct(A),_t=et===""?"."+lt(A,0):et,K(ct)?(W="",_t!=null&&(W=_t.replace(at,"$&/")+"/"),H(ct,Z,W,"",function(gn){return gn})):ct!=null&&(I(ct)&&(ct=$(ct,W+(ct.key==null||A&&A.key===ct.key?"":(""+ct.key).replace(at,"$&/")+"/")+_t)),Z.push(ct)),1;_t=0;var kt=et===""?".":et+":";if(K(A))for(var qt=0;qt>>1,At=H[Mt];if(0>>1;Mto(W,ut))eto(ct,W)?(H[Mt]=ct,H[et]=ut,Mt=et):(H[Mt]=W,H[Z]=ut,Mt=Z);else if(eto(ct,ut))H[Mt]=ct,H[et]=ut,Mt=et;else break t}}return V}function o(H,V){var ut=H.sortIndex-V.sortIndex;return ut!==0?ut:H.id-V.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();l.unstable_now=function(){return m.now()-v}}var g=[],y=[],b=1,p=null,S=3,j=!1,N=!1,T=!1,R=!1,M=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function w(H){for(var V=s(y);V!==null;){if(V.callback===null)c(y);else if(V.startTime<=H)c(y),V.sortIndex=V.expirationTime,i(g,V);else break;V=s(y)}}function K(H){if(T=!1,w(H),!N)if(s(g)!==null)N=!0,B||(B=!0,nt());else{var V=s(y);V!==null&>(K,V.startTime-H)}}var B=!1,D=-1,G=5,F=-1;function $(){return R?!0:!(l.unstable_now()-FH&&$());){var Mt=p.callback;if(typeof Mt=="function"){p.callback=null,S=p.priorityLevel;var At=Mt(p.expirationTime<=H);if(H=l.unstable_now(),typeof At=="function"){p.callback=At,w(H),V=!0;break e}p===s(g)&&c(g),w(H)}else c(g);p=s(g)}if(p!==null)V=!0;else{var A=s(y);A!==null&>(K,A.startTime-H),V=!1}}break t}finally{p=null,S=ut,j=!1}V=void 0}}finally{V?nt():B=!1}}}var nt;if(typeof Q=="function")nt=function(){Q(I)};else if(typeof MessageChannel<"u"){var at=new MessageChannel,lt=at.port2;at.port1.onmessage=I,nt=function(){lt.postMessage(null)}}else nt=function(){M(I,0)};function gt(H,V){D=M(function(){H(l.unstable_now())},V)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(H){H.callback=null},l.unstable_forceFrameRate=function(H){0>H||125Mt?(H.sortIndex=ut,i(y,H),s(g)===null&&H===s(y)&&(T?(O(D),D=-1):T=!0,gt(K,ut-Mt))):(H.sortIndex=At,i(g,H),N||j||(N=!0,B||(B=!0,nt()))),H},l.unstable_shouldYield=$,l.unstable_wrapCallback=function(H){var V=S;return function(){var ut=S;S=V;try{return H.apply(this,arguments)}finally{S=ut}}}})(Fo)),Fo}var $y;function h0(){return $y||($y=1,Po.exports=d0()),Po.exports}var $o={exports:{}},ye={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Iy;function m0(){if(Iy)return ye;Iy=1;var l=Ks();function i(g){var y="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),$o.exports=m0(),$o.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var tp;function y0(){if(tp)return _s;tp=1;var l=h0(),i=Ks(),s=Ip();function c(t){var e="https://react.dev/errors/"+t;if(1At||(t.current=Mt[At],Mt[At]=null,At--)}function W(t,e){At++,Mt[At]=t.current,t.current=e}var et=A(null),ct=A(null),pt=A(null),_t=A(null);function kt(t,e){switch(W(pt,e),W(ct,t),W(et,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?my(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=my(e),t=yy(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Z(et),W(et,t)}function qt(){Z(et),Z(ct),Z(pt)}function gn(t){t.memoizedState!==null&&W(_t,t);var e=et.current,n=yy(e,t.type);e!==n&&(W(ct,t),W(et,n))}function vn(t){ct.current===t&&(Z(et),Z(ct)),_t.current===t&&(Z(_t),bs._currentValue=ut)}var Pn,Ci;function un(t){if(Pn===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Pn=e&&e[1]||"",Ci=-1)":-1u||E[a]!==L[u]){var Y=` -`+E[a].replace(" at new "," at ");return t.displayName&&Y.includes("")&&(Y=Y.replace("",t.displayName)),Y}while(1<=a&&0<=u);break}}}finally{Ai=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?un(n):""}function Xs(t,e){switch(t.tag){case 26:case 27:case 5:return un(t.type);case 16:return un("Lazy");case 13:return t.child!==e&&e!==null?un("Suspense Fallback"):un("Suspense");case 19:return un("SuspenseList");case 0:case 15:return Nl(t.type,!1);case 11:return Nl(t.type.render,!1);case 1:return Nl(t.type,!0);case 31:return un("Activity");default:return""}}function xn(t){try{var e="",n=null;do e+=Xs(t,n),n=t,t=t.return;while(t);return e}catch(a){return` -Error generating stack: `+a.message+` -`+a.stack}}var qa=Object.prototype.hasOwnProperty,en=l.unstable_scheduleCallback,wi=l.unstable_cancelCallback,Vs=l.unstable_shouldYield,wc=l.unstable_requestPaint,me=l.unstable_now,Dt=l.unstable_getCurrentPriorityLevel,ue=l.unstable_ImmediatePriority,cn=l.unstable_UserBlockingPriority,El=l.unstable_NormalPriority,Yg=l.unstable_LowPriority,Jf=l.unstable_IdlePriority,Kg=l.log,Xg=l.unstable_setDisableYieldValue,Oi=null,Oe=null;function Fn(t){if(typeof Kg=="function"&&Xg(t),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Oi,t)}catch{}}var ze=Math.clz32?Math.clz32:Jg,Vg=Math.log,Zg=Math.LN2;function Jg(t){return t>>>=0,t===0?32:31-(Vg(t)/Zg|0)|0}var Zs=256,Js=262144,Ps=4194304;function Ha(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Fs(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var u=0,r=t.suspendedLanes,d=t.pingedLanes;t=t.warmLanes;var x=a&134217727;return x!==0?(a=x&~r,a!==0?u=Ha(a):(d&=x,d!==0?u=Ha(d):n||(n=x&~t,n!==0&&(u=Ha(n))))):(x=a&~r,x!==0?u=Ha(x):d!==0?u=Ha(d):n||(n=a&~t,n!==0&&(u=Ha(n)))),u===0?0:e!==0&&e!==u&&(e&r)===0&&(r=u&-u,n=e&-e,r>=n||r===32&&(n&4194048)!==0)?e:u}function zi(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Pg(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pf(){var t=Ps;return Ps<<=1,(Ps&62914560)===0&&(Ps=4194304),t}function Oc(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Di(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Fg(t,e,n,a,u,r){var d=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var x=t.entanglements,E=t.expirationTimes,L=t.hiddenUpdates;for(n=d&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var nv=/[\n"\\]/g;function Xe(t){return t.replace(nv,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function qc(t,e,n,a,u,r,d,x){t.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?t.type=d:t.removeAttribute("type"),e!=null?d==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ke(e)):t.value!==""+Ke(e)&&(t.value=""+Ke(e)):d!=="submit"&&d!=="reset"||t.removeAttribute("value"),e!=null?Hc(t,d,Ke(e)):n!=null?Hc(t,d,Ke(n)):a!=null&&t.removeAttribute("value"),u==null&&r!=null&&(t.defaultChecked=!!r),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?t.name=""+Ke(x):t.removeAttribute("name")}function cd(t,e,n,a,u,r,d,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.type=r),e!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||e!=null)){Bc(t);return}n=n!=null?""+Ke(n):"",e=e!=null?""+Ke(e):n,x||e===t.value||(t.value=e),t.defaultValue=e}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=x?t.checked:!!a,t.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.name=d),Bc(t)}function Hc(t,e,n){e==="number"&&Ws(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Al(t,e,n,a){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kc=!1;if(jn)try{var qi={};Object.defineProperty(qi,"passive",{get:function(){Kc=!0}}),window.addEventListener("test",qi,qi),window.removeEventListener("test",qi,qi)}catch{Kc=!1}var In=null,Xc=null,eu=null;function yd(){if(eu)return eu;var t,e=Xc,n=e.length,a,u="value"in In?In.value:In.textContent,r=u.length;for(t=0;t=Qi),Sd=" ",jd=!1;function Nd(t,e){switch(t){case"keyup":return Av.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ed(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Dl=!1;function Ov(t,e){switch(t){case"compositionend":return Ed(e);case"keypress":return e.which!==32?null:(jd=!0,Sd);case"textInput":return t=e.data,t===Sd&&jd?null:t;default:return null}}function zv(t,e){if(Dl)return t==="compositionend"||!Fc&&Nd(t,e)?(t=yd(),eu=Xc=In=null,Dl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=a}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Od(n)}}function Dd(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Dd(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ud(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ws(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ws(t.document)}return e}function Wc(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Qv=jn&&"documentMode"in document&&11>=document.documentMode,Ul=null,tr=null,Xi=null,er=!1;function Ld(t,e,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;er||Ul==null||Ul!==Ws(a)||(a=Ul,"selectionStart"in a&&Wc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Xi&&Ki(Xi,a)||(Xi=a,a=Ju(tr,"onSelect"),0>=d,u-=d,rn=1<<32-ze(e)+u|n<mt?(St=st,st=null):St=st.sibling;var Tt=q(z,st,U[mt],X);if(Tt===null){st===null&&(st=St);break}t&&st&&Tt.alternate===null&&e(z,st),C=r(Tt,C,mt),Rt===null?ot=Tt:Rt.sibling=Tt,Rt=Tt,st=St}if(mt===U.length)return n(z,st),jt&&En(z,mt),ot;if(st===null){for(;mtmt?(St=st,st=null):St=st.sibling;var ba=q(z,st,Tt.value,X);if(ba===null){st===null&&(st=St);break}t&&st&&ba.alternate===null&&e(z,st),C=r(ba,C,mt),Rt===null?ot=ba:Rt.sibling=ba,Rt=ba,st=St}if(Tt.done)return n(z,st),jt&&En(z,mt),ot;if(st===null){for(;!Tt.done;mt++,Tt=U.next())Tt=J(z,Tt.value,X),Tt!==null&&(C=r(Tt,C,mt),Rt===null?ot=Tt:Rt.sibling=Tt,Rt=Tt);return jt&&En(z,mt),ot}for(st=a(st);!Tt.done;mt++,Tt=U.next())Tt=k(st,z,mt,Tt.value,X),Tt!==null&&(t&&Tt.alternate!==null&&st.delete(Tt.key===null?mt:Tt.key),C=r(Tt,C,mt),Rt===null?ot=Tt:Rt.sibling=Tt,Rt=Tt);return t&&st.forEach(function(u0){return e(z,u0)}),jt&&En(z,mt),ot}function Bt(z,C,U,X){if(typeof U=="object"&&U!==null&&U.type===T&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case j:t:{for(var ot=U.key;C!==null;){if(C.key===ot){if(ot=U.type,ot===T){if(C.tag===7){n(z,C.sibling),X=u(C,U.props.children),X.return=z,z=X;break t}}else if(C.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===G&&Fa(ot)===C.type){n(z,C.sibling),X=u(C,U.props),$i(X,U),X.return=z,z=X;break t}n(z,C);break}else e(z,C);C=C.sibling}U.type===T?(X=Xa(U.props.children,z.mode,X,U.key),X.return=z,z=X):(X=fu(U.type,U.key,U.props,null,z.mode,X),$i(X,U),X.return=z,z=X)}return d(z);case N:t:{for(ot=U.key;C!==null;){if(C.key===ot)if(C.tag===4&&C.stateNode.containerInfo===U.containerInfo&&C.stateNode.implementation===U.implementation){n(z,C.sibling),X=u(C,U.children||[]),X.return=z,z=X;break t}else{n(z,C);break}else e(z,C);C=C.sibling}X=cr(U,z.mode,X),X.return=z,z=X}return d(z);case G:return U=Fa(U),Bt(z,C,U,X)}if(gt(U))return it(z,C,U,X);if(nt(U)){if(ot=nt(U),typeof ot!="function")throw Error(c(150));return U=ot.call(U),ft(z,C,U,X)}if(typeof U.then=="function")return Bt(z,C,vu(U),X);if(U.$$typeof===Q)return Bt(z,C,mu(z,U),X);xu(z,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,C!==null&&C.tag===6?(n(z,C.sibling),X=u(C,U),X.return=z,z=X):(n(z,C),X=ur(U,z.mode,X),X.return=z,z=X),d(z)):n(z,C)}return function(z,C,U,X){try{Fi=0;var ot=Bt(z,C,U,X);return Vl=null,ot}catch(st){if(st===Xl||st===pu)throw st;var Rt=Ue(29,st,null,z.mode);return Rt.lanes=X,Rt.return=z,Rt}finally{}}}var Ia=ih(!0),sh=ih(!1),aa=!1;function br(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sr(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function la(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ia(t,e,n){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Ct&2)!==0){var u=a.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),a.pending=e,e=ou(t),Yd(t,null,n),e}return ru(t,a,e,n),ou(t)}function Ii(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,$f(t,n)}}function jr(t,e){var n=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?u=r=d:r=r.next=d,n=n.next}while(n!==null);r===null?u=r=e:r=r.next=e}else u=r=e;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Nr=!1;function Wi(){if(Nr){var t=Kl;if(t!==null)throw t}}function ts(t,e,n,a){Nr=!1;var u=t.updateQueue;aa=!1;var r=u.firstBaseUpdate,d=u.lastBaseUpdate,x=u.shared.pending;if(x!==null){u.shared.pending=null;var E=x,L=E.next;E.next=null,d===null?r=L:d.next=L,d=E;var Y=t.alternate;Y!==null&&(Y=Y.updateQueue,x=Y.lastBaseUpdate,x!==d&&(x===null?Y.firstBaseUpdate=L:x.next=L,Y.lastBaseUpdate=E))}if(r!==null){var J=u.baseState;d=0,Y=L=E=null,x=r;do{var q=x.lane&-536870913,k=q!==x.lane;if(k?(bt&q)===q:(a&q)===q){q!==0&&q===Yl&&(Nr=!0),Y!==null&&(Y=Y.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});t:{var it=t,ft=x;q=e;var Bt=n;switch(ft.tag){case 1:if(it=ft.payload,typeof it=="function"){J=it.call(Bt,J,q);break t}J=it;break t;case 3:it.flags=it.flags&-65537|128;case 0:if(it=ft.payload,q=typeof it=="function"?it.call(Bt,J,q):it,q==null)break t;J=p({},J,q);break t;case 2:aa=!0}}q=x.callback,q!==null&&(t.flags|=64,k&&(t.flags|=8192),k=u.callbacks,k===null?u.callbacks=[q]:k.push(q))}else k={lane:q,tag:x.tag,payload:x.payload,callback:x.callback,next:null},Y===null?(L=Y=k,E=J):Y=Y.next=k,d|=q;if(x=x.next,x===null){if(x=u.shared.pending,x===null)break;k=x,x=k.next,k.next=null,u.lastBaseUpdate=k,u.shared.pending=null}}while(!0);Y===null&&(E=J),u.baseState=E,u.firstBaseUpdate=L,u.lastBaseUpdate=Y,r===null&&(u.shared.lanes=0),oa|=d,t.lanes=d,t.memoizedState=J}}function uh(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function ch(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;tr?r:8;var d=H.T,x={};H.T=x,Gr(t,!1,e,n);try{var E=u(),L=H.S;if(L!==null&&L(x,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var Y=Fv(E,a);as(t,e,Y,ke(t))}else as(t,e,a,ke(t))}catch(J){as(t,e,{then:function(){},status:"rejected",reason:J},ke())}finally{V.p=r,d!==null&&x.types!==null&&(d.types=x.types),H.T=d}}function nx(){}function kr(t,e,n,a){if(t.tag!==5)throw Error(c(476));var u=kh(t).queue;Hh(t,u,e,ut,n===null?nx:function(){return Qh(t),n(a)})}function kh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ut,baseState:ut,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mn,lastRenderedState:ut},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Qh(t){var e=kh(t);e.next===null&&(e=t.alternate.memoizedState),as(t,e.next.queue,{},ke())}function Qr(){return oe(bs)}function Gh(){return Ft().memoizedState}function Yh(){return Ft().memoizedState}function ax(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=ke();t=la(n);var a=ia(e,t,n);a!==null&&(Me(a,e,n),Ii(a,e,n)),e={cache:pr()},t.payload=e;return}e=e.return}}function lx(t,e,n){var a=ke();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cu(t)?Xh(e,n):(n=ir(t,e,n,a),n!==null&&(Me(n,t,a),Vh(n,e,a)))}function Kh(t,e,n){var a=ke();as(t,e,n,a)}function as(t,e,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cu(t))Xh(e,u);else{var r=t.alternate;if(t.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var d=e.lastRenderedState,x=r(d,n);if(u.hasEagerState=!0,u.eagerState=x,De(x,d))return ru(t,e,u,0),Ht===null&&cu(),!1}catch{}finally{}if(n=ir(t,e,u,a),n!==null)return Me(n,t,a),Vh(n,e,a),!0}return!1}function Gr(t,e,n,a){if(a={lane:2,revertLane:So(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Cu(t)){if(e)throw Error(c(479))}else e=ir(t,n,a,2),e!==null&&Me(e,t,2)}function Cu(t){var e=t.alternate;return t===ht||e!==null&&e===ht}function Xh(t,e){Jl=ju=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Vh(t,e,n){if((n&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,$f(t,n)}}var ls={readContext:oe,use:_u,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt};ls.useEffectEvent=Vt;var Zh={readContext:oe,use:_u,useCallback:function(t,e){return ve().memoizedState=[t,e===void 0?null:e],t},useContext:oe,useEffect:Ah,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Tu(4194308,4,Dh.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Tu(4194308,4,t,e)},useInsertionEffect:function(t,e){Tu(4,2,t,e)},useMemo:function(t,e){var n=ve();e=e===void 0?null:e;var a=t();if(Wa){Fn(!0);try{t()}finally{Fn(!1)}}return n.memoizedState=[a,e],a},useReducer:function(t,e,n){var a=ve();if(n!==void 0){var u=n(e);if(Wa){Fn(!0);try{n(e)}finally{Fn(!1)}}}else u=e;return a.memoizedState=a.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},a.queue=t,t=t.dispatch=lx.bind(null,ht,t),[a.memoizedState,t]},useRef:function(t){var e=ve();return t={current:t},e.memoizedState=t},useState:function(t){t=Ur(t);var e=t.queue,n=Kh.bind(null,ht,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:qr,useDeferredValue:function(t,e){var n=ve();return Hr(n,t,e)},useTransition:function(){var t=Ur(!1);return t=Hh.bind(null,ht,t.queue,!0,!1),ve().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var a=ht,u=ve();if(jt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=e(),Ht===null)throw Error(c(349));(bt&127)!==0||mh(a,e,n)}u.memoizedState=n;var r={value:n,getSnapshot:e};return u.queue=r,Ah(ph.bind(null,a,r,t),[t]),a.flags|=2048,Fl(9,{destroy:void 0},yh.bind(null,a,r,n,e),null),n},useId:function(){var t=ve(),e=Ht.identifierPrefix;if(jt){var n=on,a=rn;n=(a&~(1<<32-ze(a)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Nu++,0<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?d.createElement(u,{is:a.is}):d.createElement(u)}}r[ce]=e,r[je]=a;t:for(d=e.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break t;for(;d.sibling===null;){if(d.return===null||d.return===e)break t;d=d.return}d.sibling.return=d.return,d=d.sibling}e.stateNode=r;t:switch(de(r,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&An(e)}}return Gt(e),no(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&An(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(c(166));if(t=pt.current,Ql(e)){if(t=e.stateNode,n=e.memoizedProps,a=null,u=re,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}t[ce]=e,t=!!(t.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||dy(t.nodeValue,n)),t||ea(e,!0)}else t=Pu(t).createTextNode(a),t[ce]=e,e.stateNode=t}return Gt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(a=Ql(e),n!==null){if(t===null){if(!a)throw Error(c(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[ce]=e}else Va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Gt(e),t=!1}else n=dr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Be(e),e):(Be(e),null);if((e.flags&128)!==0)throw Error(c(558))}return Gt(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=Ql(e),a!==null&&a.dehydrated!==null){if(t===null){if(!u)throw Error(c(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[ce]=e}else Va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Gt(e),u=!1}else u=dr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(Be(e),e):(Be(e),null)}return Be(e),(e.flags&128)!==0?(e.lanes=n,e):(n=a!==null,t=t!==null&&t.memoizedState!==null,n&&(a=e.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==u&&(a.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Du(e,e.updateQueue),Gt(e),null);case 4:return qt(),t===null&&_o(e.stateNode.containerInfo),Gt(e),null;case 10:return Rn(e.type),Gt(e),null;case 19:if(Z(Pt),a=e.memoizedState,a===null)return Gt(e),null;if(u=(e.flags&128)!==0,r=a.rendering,r===null)if(u)ss(a,!1);else{if(Zt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(r=Su(t),r!==null){for(e.flags|=128,ss(a,!1),t=r.updateQueue,e.updateQueue=t,Du(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Kd(n,t),n=n.sibling;return W(Pt,Pt.current&1|2),jt&&En(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&me()>Hu&&(e.flags|=128,u=!0,ss(a,!1),e.lanes=4194304)}else{if(!u)if(t=Su(r),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,Du(e,t),ss(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!jt)return Gt(e),null}else 2*me()-a.renderingStartTime>Hu&&n!==536870912&&(e.flags|=128,u=!0,ss(a,!1),e.lanes=4194304);a.isBackwards?(r.sibling=e.child,e.child=r):(t=a.last,t!==null?t.sibling=r:e.child=r,a.last=r)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=me(),t.sibling=null,n=Pt.current,W(Pt,u?n&1|2:n&1),jt&&En(e,a.treeForkCount),t):(Gt(e),null);case 22:case 23:return Be(e),_r(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(n&536870912)!==0&&(e.flags&128)===0&&(Gt(e),e.subtreeFlags&6&&(e.flags|=8192)):Gt(e),n=e.updateQueue,n!==null&&Du(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==n&&(e.flags|=2048),t!==null&&Z(Pa),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Rn($t),Gt(e),null;case 25:return null;case 30:return null}throw Error(c(156,e.tag))}function rx(t,e){switch(or(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Rn($t),qt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return vn(e),null;case 31:if(e.memoizedState!==null){if(Be(e),e.alternate===null)throw Error(c(340));Va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Be(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));Va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Z(Pt),null;case 4:return qt(),null;case 10:return Rn(e.type),null;case 22:case 23:return Be(e),_r(),t!==null&&Z(Pa),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Rn($t),null;case 25:return null;default:return null}}function gm(t,e){switch(or(e),e.tag){case 3:Rn($t),qt();break;case 26:case 27:case 5:vn(e);break;case 4:qt();break;case 31:e.memoizedState!==null&&Be(e);break;case 13:Be(e);break;case 19:Z(Pt);break;case 10:Rn(e.type);break;case 22:case 23:Be(e),_r(),t!==null&&Z(Pa);break;case 24:Rn($t)}}function us(t,e){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&t)===t){a=void 0;var r=n.create,d=n.inst;a=r(),d.destroy=a}n=n.next}while(n!==u)}}catch(x){zt(e,e.return,x)}}function ca(t,e,n){try{var a=e.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var r=u.next;a=r;do{if((a.tag&t)===t){var d=a.inst,x=d.destroy;if(x!==void 0){d.destroy=void 0,u=e;var E=n,L=x;try{L()}catch(Y){zt(u,E,Y)}}}a=a.next}while(a!==r)}}catch(Y){zt(e,e.return,Y)}}function vm(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{ch(e,n)}catch(a){zt(t,t.return,a)}}}function xm(t,e,n){n.props=tl(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(a){zt(t,e,a)}}function cs(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof n=="function"?t.refCleanup=n(a):n.current=a}}catch(u){zt(t,e,u)}}function fn(t,e){var n=t.ref,a=t.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){zt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){zt(t,e,u)}else n.current=null}function bm(t){var e=t.type,n=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break t;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){zt(t,t.return,u)}}function ao(t,e,n){try{var a=t.stateNode;wx(a,t.type,n,e),a[je]=e}catch(u){zt(t,t.return,u)}}function Sm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ya(t.type)||t.tag===4}function lo(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Sm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ya(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function io(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Sn));else if(a!==4&&(a===27&&ya(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(io(t,e,n),t=t.sibling;t!==null;)io(t,e,n),t=t.sibling}function Uu(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(a!==4&&(a===27&&ya(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Uu(t,e,n),t=t.sibling;t!==null;)Uu(t,e,n),t=t.sibling}function jm(t){var e=t.stateNode,n=t.memoizedProps;try{for(var a=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);de(e,a,n),e[ce]=t,e[je]=n}catch(r){zt(t,t.return,r)}}var wn=!1,te=!1,so=!1,Nm=typeof WeakSet=="function"?WeakSet:Set,le=null;function ox(t,e){if(t=t.containerInfo,Mo=nc,t=Ud(t),Wc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var d=0,x=-1,E=-1,L=0,Y=0,J=t,q=null;e:for(;;){for(var k;J!==n||u!==0&&J.nodeType!==3||(x=d+u),J!==r||a!==0&&J.nodeType!==3||(E=d+a),J.nodeType===3&&(d+=J.nodeValue.length),(k=J.firstChild)!==null;)q=J,J=k;for(;;){if(J===t)break e;if(q===n&&++L===u&&(x=d),q===r&&++Y===a&&(E=d),(k=J.nextSibling)!==null)break;J=q,q=J.parentNode}J=k}n=x===-1||E===-1?null:{start:x,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(Co={focusedElem:t,selectionRange:n},nc=!1,le=e;le!==null;)if(e=le,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,le=t;else for(;le!==null;){switch(e=le,r=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),de(r,a,n),r[ce]=t,ae(r),a=r;break t;case"link":var d=Cy("link","href",u).get(a+(n.href||""));if(d){for(var x=0;xBt&&(d=Bt,Bt=ft,ft=d);var z=zd(x,ft),C=zd(x,Bt);if(z&&C&&(k.rangeCount!==1||k.anchorNode!==z.node||k.anchorOffset!==z.offset||k.focusNode!==C.node||k.focusOffset!==C.offset)){var U=J.createRange();U.setStart(z.node,z.offset),k.removeAllRanges(),ft>Bt?(k.addRange(U),k.extend(C.node,C.offset)):(U.setEnd(C.node,C.offset),k.addRange(U))}}}}for(J=[],k=x;k=k.parentNode;)k.nodeType===1&&J.push({element:k,left:k.scrollLeft,top:k.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xn?32:n,H.T=null,n=mo,mo=null;var r=da,d=Ln;if(ee=0,ei=da=null,Ln=0,(Ct&6)!==0)throw Error(c(331));var x=Ct;if(Ct|=4,Dm(r.current),wm(r,r.current,d,n),Ct=x,ms(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Oi,r)}catch{}return!0}finally{V.p=u,H.T=a,Im(t,e)}}function ty(t,e,n){e=Ze(n,e),e=Vr(t.stateNode,e,2),t=ia(t,e,2),t!==null&&(Di(t,2),dn(t))}function zt(t,e,n){if(t.tag===3)ty(t,t,n);else for(;e!==null;){if(e.tag===3){ty(e,t,n);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(fa===null||!fa.has(a))){t=Ze(n,t),n=em(2),a=ia(e,n,2),a!==null&&(nm(n,a,e,t),Di(a,2),dn(a));break}}e=e.return}}function vo(t,e,n){var a=t.pingCache;if(a===null){a=t.pingCache=new hx;var u=new Set;a.set(e,u)}else u=a.get(e),u===void 0&&(u=new Set,a.set(e,u));u.has(n)||(ro=!0,u.add(n),t=vx.bind(null,t,e,n),e.then(t,t))}function vx(t,e,n){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ht===t&&(bt&n)===n&&(Zt===4||Zt===3&&(bt&62914560)===bt&&300>me()-qu?(Ct&2)===0&&ni(t,0):oo|=n,ti===bt&&(ti=0)),dn(t)}function ey(t,e){e===0&&(e=Pf()),t=Ka(t,e),t!==null&&(Di(t,e),dn(t))}function xx(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ey(t,n)}function bx(t,e){var n=0;switch(t.tag){case 31:case 13:var a=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(e),ey(t,n)}function Sx(t,e){return en(t,e)}var Xu=null,li=null,xo=!1,Vu=!1,bo=!1,ma=0;function dn(t){t!==li&&t.next===null&&(li===null?Xu=li=t:li=li.next=t),Vu=!0,xo||(xo=!0,Nx())}function ms(t,e){if(!bo&&Vu){bo=!0;do for(var n=!1,a=Xu;a!==null;){if(t!==0){var u=a.pendingLanes;if(u===0)var r=0;else{var d=a.suspendedLanes,x=a.pingedLanes;r=(1<<31-ze(42|t)+1)-1,r&=u&~(d&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,iy(a,r))}else r=bt,r=Fs(a,a===Ht?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||zi(a,r)||(n=!0,iy(a,r));a=a.next}while(n);bo=!1}}function jx(){ny()}function ny(){Vu=xo=!1;var t=0;ma!==0&&zx()&&(t=ma);for(var e=me(),n=null,a=Xu;a!==null;){var u=a.next,r=ay(a,e);r===0?(a.next=null,n===null?Xu=u:n.next=u,u===null&&(li=n)):(n=a,(t!==0||(r&3)!==0)&&(Vu=!0)),a=u}ee!==0&&ee!==5||ms(t),ma!==0&&(ma=0)}function ay(t,e){for(var n=t.suspendedLanes,a=t.pingedLanes,u=t.expirationTimes,r=t.pendingLanes&-62914561;0x)break;var Y=E.transferSize,J=E.initiatorType;Y&&hy(J)&&(E=E.responseEnd,d+=Y*(E"u"?null:document;function _y(t,e,n){var a=ii;if(a&&typeof e=="string"&&e){var u=Xe(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ey.has(u)||(Ey.add(u),t={rel:t,crossOrigin:n,href:e},a.querySelector(u)===null&&(e=a.createElement("link"),de(e,"link",t),ae(e),a.head.appendChild(e)))}}function Gx(t){Bn.D(t),_y("dns-prefetch",t,null)}function Yx(t,e){Bn.C(t,e),_y("preconnect",t,e)}function Kx(t,e,n){Bn.L(t,e,n);var a=ii;if(a&&t&&e){var u='link[rel="preload"][as="'+Xe(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Xe(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Xe(n.imageSizes)+'"]')):u+='[href="'+Xe(t)+'"]';var r=u;switch(e){case"style":r=si(t);break;case"script":r=ui(t)}We.has(r)||(t=p({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),We.set(r,t),a.querySelector(u)!==null||e==="style"&&a.querySelector(vs(r))||e==="script"&&a.querySelector(xs(r))||(e=a.createElement("link"),de(e,"link",t),ae(e),a.head.appendChild(e)))}}function Xx(t,e){Bn.m(t,e);var n=ii;if(n&&t){var a=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+Xe(a)+'"][href="'+Xe(t)+'"]',r=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ui(t)}if(!We.has(r)&&(t=p({rel:"modulepreload",href:t},e),We.set(r,t),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(xs(r)))return}a=n.createElement("link"),de(a,"link",t),ae(a),n.head.appendChild(a)}}}function Vx(t,e,n){Bn.S(t,e,n);var a=ii;if(a&&t){var u=Ml(a).hoistableStyles,r=si(t);e=e||"default";var d=u.get(r);if(!d){var x={loading:0,preload:null};if(d=a.querySelector(vs(r)))x.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":e},n),(n=We.get(r))&&Lo(t,n);var E=d=a.createElement("link");ae(E),de(E,"link",t),E._p=new Promise(function(L,Y){E.onload=L,E.onerror=Y}),E.addEventListener("load",function(){x.loading|=1}),E.addEventListener("error",function(){x.loading|=2}),x.loading|=4,$u(d,e,a)}d={type:"stylesheet",instance:d,count:1,state:x},u.set(r,d)}}}function Zx(t,e){Bn.X(t,e);var n=ii;if(n&&t){var a=Ml(n).hoistableScripts,u=ui(t),r=a.get(u);r||(r=n.querySelector(xs(u)),r||(t=p({src:t,async:!0},e),(e=We.get(u))&&Bo(t,e),r=n.createElement("script"),ae(r),de(r,"link",t),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(u,r))}}function Jx(t,e){Bn.M(t,e);var n=ii;if(n&&t){var a=Ml(n).hoistableScripts,u=ui(t),r=a.get(u);r||(r=n.querySelector(xs(u)),r||(t=p({src:t,async:!0,type:"module"},e),(e=We.get(u))&&Bo(t,e),r=n.createElement("script"),ae(r),de(r,"link",t),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(u,r))}}function Ry(t,e,n,a){var u=(u=pt.current)?Fu(u):null;if(!u)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=si(n.href),n=Ml(u).hoistableStyles,a=n.get(e),a||(a={type:"style",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=si(n.href);var r=Ml(u).hoistableStyles,d=r.get(t);if(d||(u=u.ownerDocument||u,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(t,d),(r=u.querySelector(vs(t)))&&!r._p&&(d.instance=r,d.state.loading=5),We.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},We.set(t,n),r||Px(u,t,n,d.state))),e&&a===null)throw Error(c(528,""));return d}if(e&&a!==null)throw Error(c(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ui(n),n=Ml(u).hoistableScripts,a=n.get(e),a||(a={type:"script",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function si(t){return'href="'+Xe(t)+'"'}function vs(t){return'link[rel="stylesheet"]['+t+"]"}function Ty(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function Px(t,e,n,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),de(e,"link",n),ae(e),t.head.appendChild(e))}function ui(t){return'[src="'+Xe(t)+'"]'}function xs(t){return"script[async]"+t}function My(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+Xe(n.href)+'"]');if(a)return e.instance=a,ae(a),a;var u=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),ae(a),de(a,"style",u),$u(a,n.precedence,t),e.instance=a;case"stylesheet":u=si(n.href);var r=t.querySelector(vs(u));if(r)return e.state.loading|=4,e.instance=r,ae(r),r;a=Ty(n),(u=We.get(u))&&Lo(a,u),r=(t.ownerDocument||t).createElement("link"),ae(r);var d=r;return d._p=new Promise(function(x,E){d.onload=x,d.onerror=E}),de(r,"link",a),e.state.loading|=4,$u(r,n.precedence,t),e.instance=r;case"script":return r=ui(n.src),(u=t.querySelector(xs(r)))?(e.instance=u,ae(u),u):(a=n,(u=We.get(r))&&(a=p({},n),Bo(a,u)),t=t.ownerDocument||t,u=t.createElement("script"),ae(u),de(u,"link",a),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,$u(a,n.precedence,t));return e.instance}function $u(t,e,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,r=u,d=0;d title"):null)}function Fx(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function wy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function $x(t,e,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=si(a.href),r=e.querySelector(vs(u));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Wu.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=r,ae(r);return}r=e.ownerDocument||e,a=Ty(a),(u=We.get(u))&&Lo(a,u),r=r.createElement("link"),ae(r);var d=r;d._p=new Promise(function(x,E){d.onload=x,d.onerror=E}),de(r,"link",a),n.instance=r}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Wu.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var qo=0;function Ix(t,e){return t.stylesheets&&t.count===0&&ec(t,t.stylesheets),0qo?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Wu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ec(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var tc=null;function ec(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tc=new Map,e.forEach(Wx,t),tc=null,Wu.call(t))}function Wx(t,e){if(!(e.state.loading&4)){var n=tc.get(t);if(n)var a=n.get(null);else{n=new Map,tc.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),Jo.exports=y0(),Jo.exports}var g0=p0(),Mi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(l){return this.listeners.add(l),this.onSubscribe(),()=>{this.listeners.delete(l),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cl,_a,mi,Qp,v0=(Qp=class extends Mi{constructor(){super();rt(this,cl);rt(this,_a);rt(this,mi);tt(this,mi,i=>{if(typeof window<"u"&&window.addEventListener){const s=()=>i();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){_(this,_a)||this.setEventListener(_(this,mi))}onUnsubscribe(){var i;this.hasListeners()||((i=_(this,_a))==null||i.call(this),tt(this,_a,void 0))}setEventListener(i){var s;tt(this,mi,i),(s=_(this,_a))==null||s.call(this),tt(this,_a,i(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(i){_(this,cl)!==i&&(tt(this,cl,i),this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(s=>{s(i)})}isFocused(){var i;return typeof _(this,cl)=="boolean"?_(this,cl):((i=globalThis.document)==null?void 0:i.visibilityState)!=="hidden"}},cl=new WeakMap,_a=new WeakMap,mi=new WeakMap,Qp),Lf=new v0,x0={setTimeout:(l,i)=>setTimeout(l,i),clearTimeout:l=>clearTimeout(l),setInterval:(l,i)=>setInterval(l,i),clearInterval:l=>clearInterval(l)},Ra,Uf,Gp,b0=(Gp=class{constructor(){rt(this,Ra,x0);rt(this,Uf,!1)}setTimeoutProvider(l){tt(this,Ra,l)}setTimeout(l,i){return _(this,Ra).setTimeout(l,i)}clearTimeout(l){_(this,Ra).clearTimeout(l)}setInterval(l,i){return _(this,Ra).setInterval(l,i)}clearInterval(l){_(this,Ra).clearInterval(l)}},Ra=new WeakMap,Uf=new WeakMap,Gp),ll=new b0;function S0(l){setTimeout(l,0)}var j0=typeof window>"u"||"Deno"in globalThis;function be(){}function N0(l,i){return typeof l=="function"?l(i):l}function hf(l){return typeof l=="number"&&l>=0&&l!==1/0}function Wp(l,i){return Math.max(l+(i||0)-Date.now(),0)}function La(l,i){return typeof l=="function"?l(i):l}function Ge(l,i){return typeof l=="function"?l(i):l}function np(l,i){const{type:s="all",exact:c,fetchStatus:o,predicate:f,queryKey:m,stale:v}=l;if(m){if(c){if(i.queryHash!==Bf(m,i.options))return!1}else if(!Os(i.queryKey,m))return!1}if(s!=="all"){const g=i.isActive();if(s==="active"&&!g||s==="inactive"&&g)return!1}return!(typeof v=="boolean"&&i.isStale()!==v||o&&o!==i.state.fetchStatus||f&&!f(i))}function ap(l,i){const{exact:s,status:c,predicate:o,mutationKey:f}=l;if(f){if(!i.options.mutationKey)return!1;if(s){if(bl(i.options.mutationKey)!==bl(f))return!1}else if(!Os(i.options.mutationKey,f))return!1}return!(c&&i.state.status!==c||o&&!o(i))}function Bf(l,i){return((i==null?void 0:i.queryKeyHashFn)||bl)(l)}function bl(l){return JSON.stringify(l,(i,s)=>mf(s)?Object.keys(s).sort().reduce((c,o)=>(c[o]=s[o],c),{}):s)}function Os(l,i){return l===i?!0:typeof l!=typeof i?!1:l&&i&&typeof l=="object"&&typeof i=="object"?Object.keys(i).every(s=>Os(l[s],i[s])):!1}var E0=Object.prototype.hasOwnProperty;function tg(l,i,s=0){if(l===i)return l;if(s>500)return i;const c=lp(l)&&lp(i);if(!c&&!(mf(l)&&mf(i)))return i;const f=(c?l:Object.keys(l)).length,m=c?i:Object.keys(i),v=m.length,g=c?new Array(v):{};let y=0;for(let b=0;b{ll.setTimeout(i,l)})}function yf(l,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(l,i):s.structuralSharing!==!1?tg(l,i):i}function R0(l,i,s=0){const c=[...l,i];return s&&c.length>s?c.slice(1):c}function T0(l,i,s=0){const c=[i,...l];return s&&c.length>s?c.slice(0,-1):c}var qf=Symbol();function eg(l,i){return!l.queryFn&&(i!=null&&i.initialPromise)?()=>i.initialPromise:!l.queryFn||l.queryFn===qf?()=>Promise.reject(new Error(`Missing queryFn: '${l.queryHash}'`)):l.queryFn}function Hf(l,i){return typeof l=="function"?l(...i):!!l}function M0(l,i,s){let c=!1,o;return Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o??(o=i()),c||(c=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),l}var zs=(()=>{let l=()=>j0;return{isServer(){return l()},setIsServer(i){l=i}}})();function pf(){let l,i;const s=new Promise((o,f)=>{l=o,i=f});s.status="pending",s.catch(()=>{});function c(o){Object.assign(s,o),delete s.resolve,delete s.reject}return s.resolve=o=>{c({status:"fulfilled",value:o}),l(o)},s.reject=o=>{c({status:"rejected",reason:o}),i(o)},s}var C0=S0;function A0(){let l=[],i=0,s=v=>{v()},c=v=>{v()},o=C0;const f=v=>{i?l.push(v):o(()=>{s(v)})},m=()=>{const v=l;l=[],v.length&&o(()=>{c(()=>{v.forEach(g=>{s(g)})})})};return{batch:v=>{let g;i++;try{g=v()}finally{i--,i||m()}return g},batchCalls:v=>(...g)=>{f(()=>{v(...g)})},schedule:f,setNotifyFunction:v=>{s=v},setBatchNotifyFunction:v=>{c=v},setScheduler:v=>{o=v}}}var ne=A0(),yi,Ta,pi,Yp,w0=(Yp=class extends Mi{constructor(){super();rt(this,yi,!0);rt(this,Ta);rt(this,pi);tt(this,pi,i=>{if(typeof window<"u"&&window.addEventListener){const s=()=>i(!0),c=()=>i(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",c)}}})}onSubscribe(){_(this,Ta)||this.setEventListener(_(this,pi))}onUnsubscribe(){var i;this.hasListeners()||((i=_(this,Ta))==null||i.call(this),tt(this,Ta,void 0))}setEventListener(i){var s;tt(this,pi,i),(s=_(this,Ta))==null||s.call(this),tt(this,Ta,i(this.setOnline.bind(this)))}setOnline(i){_(this,yi)!==i&&(tt(this,yi,i),this.listeners.forEach(c=>{c(i)}))}isOnline(){return _(this,yi)}},yi=new WeakMap,Ta=new WeakMap,pi=new WeakMap,Yp),Sc=new w0;function O0(l){return Math.min(1e3*2**l,3e4)}function ng(l){return(l??"online")==="online"?Sc.isOnline():!0}var gf=class extends Error{constructor(l){super("CancelledError"),this.revert=l==null?void 0:l.revert,this.silent=l==null?void 0:l.silent}};function ag(l){let i=!1,s=0,c;const o=pf(),f=()=>o.status!=="pending",m=T=>{var R;if(!f()){const M=new gf(T);S(M),(R=l.onCancel)==null||R.call(l,M)}},v=()=>{i=!0},g=()=>{i=!1},y=()=>Lf.isFocused()&&(l.networkMode==="always"||Sc.isOnline())&&l.canRun(),b=()=>ng(l.networkMode)&&l.canRun(),p=T=>{f()||(c==null||c(),o.resolve(T))},S=T=>{f()||(c==null||c(),o.reject(T))},j=()=>new Promise(T=>{var R;c=M=>{(f()||y())&&T(M)},(R=l.onPause)==null||R.call(l)}).then(()=>{var T;c=void 0,f()||(T=l.onContinue)==null||T.call(l)}),N=()=>{if(f())return;let T;const R=s===0?l.initialPromise:void 0;try{T=R??l.fn()}catch(M){T=Promise.reject(M)}Promise.resolve(T).then(p).catch(M=>{var B;if(f())return;const O=l.retry??(zs.isServer()?0:3),Q=l.retryDelay??O0,w=typeof Q=="function"?Q(s,M):Q,K=O===!0||typeof O=="number"&&sy()?void 0:j()).then(()=>{i?S(M):N()})})};return{promise:o,status:()=>o.status,cancel:m,continue:()=>(c==null||c(),o),cancelRetry:v,continueRetry:g,canStart:b,start:()=>(b()?N():j().then(N),o)}}var rl,Kp,lg=(Kp=class{constructor(){rt(this,rl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hf(this.gcTime)&&tt(this,rl,ll.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(l){this.gcTime=Math.max(this.gcTime||0,l??(zs.isServer()?1/0:300*1e3))}clearGcTimeout(){_(this,rl)!==void 0&&(ll.clearTimeout(_(this,rl)),tt(this,rl,void 0))}},rl=new WeakMap,Kp);function z0(l){return{onFetch:(i,s)=>{var b,p,S,j,N;const c=i.options,o=(S=(p=(b=i.fetchOptions)==null?void 0:b.meta)==null?void 0:p.fetchMore)==null?void 0:S.direction,f=((j=i.state.data)==null?void 0:j.pages)||[],m=((N=i.state.data)==null?void 0:N.pageParams)||[];let v={pages:[],pageParams:[]},g=0;const y=async()=>{let T=!1;const R=Q=>{M0(Q,()=>i.signal,()=>T=!0)},M=eg(i.options,i.fetchOptions),O=async(Q,w,K)=>{if(T)return Promise.reject(i.signal.reason);if(w==null&&Q.pages.length)return Promise.resolve(Q);const D=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:w,direction:K?"backward":"forward",meta:i.options.meta};return R(I),I})(),G=await M(D),{maxPages:F}=i.options,$=K?T0:R0;return{pages:$(Q.pages,G,F),pageParams:$(Q.pageParams,w,F)}};if(o&&f.length){const Q=o==="backward",w=Q?D0:sp,K={pages:f,pageParams:m},B=w(c,K);v=await O(K,B,Q)}else{const Q=l??f.length;do{const w=g===0?m[0]??c.initialPageParam:sp(c,v);if(g>0&&w==null)break;v=await O(v,w),g++}while(g{var T,R;return(R=(T=i.options).persister)==null?void 0:R.call(T,y,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s)}:i.fetchFn=y}}}function sp(l,{pages:i,pageParams:s}){const c=i.length-1;return i.length>0?l.getNextPageParam(i[c],i,s[c],s):void 0}function D0(l,{pages:i,pageParams:s}){var c;return i.length>0?(c=l.getPreviousPageParam)==null?void 0:c.call(l,i[0],i,s[0],s):void 0}var gi,ol,vi,tn,fl,ie,Hs,dl,Qe,ig,qn,Xp,U0=(Xp=class extends lg{constructor(i){super();rt(this,Qe);rt(this,gi);rt(this,ol);rt(this,vi);rt(this,tn);rt(this,fl);rt(this,ie);rt(this,Hs);rt(this,dl);tt(this,dl,!1),tt(this,Hs,i.defaultOptions),this.setOptions(i.options),this.observers=[],tt(this,fl,i.client),tt(this,tn,_(this,fl).getQueryCache()),this.queryKey=i.queryKey,this.queryHash=i.queryHash,tt(this,ol,cp(this.options)),this.state=i.state??_(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return _(this,gi)}get promise(){var i;return(i=_(this,ie))==null?void 0:i.promise}setOptions(i){if(this.options={..._(this,Hs),...i},i!=null&&i._type&&tt(this,gi,i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=cp(this.options);s.data!==void 0&&(this.setState(up(s.data,s.dataUpdatedAt)),tt(this,ol,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,tn).remove(this)}setData(i,s){const c=yf(this.state.data,i,this.options);return yt(this,Qe,qn).call(this,{data:c,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),c}setState(i){yt(this,Qe,qn).call(this,{type:"setState",state:i})}cancel(i){var c,o;const s=(c=_(this,ie))==null?void 0:c.promise;return(o=_(this,ie))==null||o.cancel(i),s?s.then(be).catch(be):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,ol)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Ge(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>La(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!Wp(this.state.dataUpdatedAt,i)}onFocus(){var s;const i=this.observers.find(c=>c.shouldFetchOnWindowFocus());i==null||i.refetch({cancelRefetch:!1}),(s=_(this,ie))==null||s.continue()}onOnline(){var s;const i=this.observers.find(c=>c.shouldFetchOnReconnect());i==null||i.refetch({cancelRefetch:!1}),(s=_(this,ie))==null||s.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),_(this,tn).notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(s=>s!==i),this.observers.length||(_(this,ie)&&(_(this,dl)||yt(this,Qe,ig).call(this)?_(this,ie).cancel({revert:!0}):_(this,ie).cancelRetry()),this.scheduleGc()),_(this,tn).notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||yt(this,Qe,qn).call(this,{type:"invalidate"})}async fetch(i,s){var y,b,p,S,j,N,T,R,M,O,Q;if(this.state.fetchStatus!=="idle"&&((y=_(this,ie))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(_(this,ie))return _(this,ie).continueRetry(),_(this,ie).promise}if(i&&this.setOptions(i),!this.options.queryFn){const w=this.observers.find(K=>K.options.queryFn);w&&this.setOptions(w.options)}const c=new AbortController,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(tt(this,dl,!0),c.signal)})},f=()=>{const w=eg(this.options,s),B=(()=>{const D={client:_(this,fl),queryKey:this.queryKey,meta:this.meta};return o(D),D})();return tt(this,dl,!1),this.options.persister?this.options.persister(w,B,this):w(B)},v=(()=>{const w={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:_(this,fl),state:this.state,fetchFn:f};return o(w),w})(),g=_(this,gi)==="infinite"?z0(this.options.pages):this.options.behavior;g==null||g.onFetch(v,this),tt(this,vi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=v.fetchOptions)==null?void 0:b.meta))&&yt(this,Qe,qn).call(this,{type:"fetch",meta:(p=v.fetchOptions)==null?void 0:p.meta}),tt(this,ie,ag({initialPromise:s==null?void 0:s.initialPromise,fn:v.fetchFn,onCancel:w=>{w instanceof gf&&w.revert&&this.setState({..._(this,vi),fetchStatus:"idle"}),c.abort()},onFail:(w,K)=>{yt(this,Qe,qn).call(this,{type:"failed",failureCount:w,error:K})},onPause:()=>{yt(this,Qe,qn).call(this,{type:"pause"})},onContinue:()=>{yt(this,Qe,qn).call(this,{type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode,canRun:()=>!0}));try{const w=await _(this,ie).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(j=(S=_(this,tn).config).onSuccess)==null||j.call(S,w,this),(T=(N=_(this,tn).config).onSettled)==null||T.call(N,w,this.state.error,this),w}catch(w){if(w instanceof gf){if(w.silent)return _(this,ie).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw yt(this,Qe,qn).call(this,{type:"error",error:w}),(M=(R=_(this,tn).config).onError)==null||M.call(R,w,this),(Q=(O=_(this,tn).config).onSettled)==null||Q.call(O,this.state.data,w,this),w}finally{this.scheduleGc()}}},gi=new WeakMap,ol=new WeakMap,vi=new WeakMap,tn=new WeakMap,fl=new WeakMap,ie=new WeakMap,Hs=new WeakMap,dl=new WeakMap,Qe=new WeakSet,ig=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},qn=function(i){const s=c=>{switch(i.type){case"failed":return{...c,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...sg(c.data,this.options),fetchMeta:i.meta??null};case"success":const o={...c,...up(i.data,i.dataUpdatedAt),dataUpdateCount:c.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return tt(this,vi,i.manual?o:void 0),o;case"error":const f=i.error;return{...c,error:f,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...i.state}}};this.state=s(this.state),ne.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),_(this,tn).notify({query:this,type:"updated",action:i})})},Xp);function sg(l,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ng(i.networkMode)?"fetching":"paused",...l===void 0&&{error:null,status:"pending"}}}function up(l,i){return{data:l,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function cp(l){const i=typeof l.initialData=="function"?l.initialData():l.initialData,s=i!==void 0,c=s?typeof l.initialDataUpdatedAt=="function"?l.initialDataUpdatedAt():l.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Ce,Nt,ks,xe,hl,xi,kn,Ma,Qs,bi,Si,ml,yl,Ca,ji,wt,Cs,vf,xf,bf,Sf,jf,Nf,Ef,ug,Vp,L0=(Vp=class extends Mi{constructor(i,s){super();rt(this,wt);rt(this,Ce);rt(this,Nt);rt(this,ks);rt(this,xe);rt(this,hl);rt(this,xi);rt(this,kn);rt(this,Ma);rt(this,Qs);rt(this,bi);rt(this,Si);rt(this,ml);rt(this,yl);rt(this,Ca);rt(this,ji,new Set);this.options=s,tt(this,Ce,i),tt(this,Ma,null),tt(this,kn,pf()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Nt).addObserver(this),rp(_(this,Nt),this.options)?yt(this,wt,Cs).call(this):this.updateResult(),yt(this,wt,Sf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _f(_(this,Nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _f(_(this,Nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,yt(this,wt,jf).call(this),yt(this,wt,Nf).call(this),_(this,Nt).removeObserver(this)}setOptions(i){const s=this.options,c=_(this,Nt);if(this.options=_(this,Ce).defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ge(this.options.enabled,_(this,Nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");yt(this,wt,Ef).call(this),_(this,Nt).setOptions(this.options),s._defaulted&&!bc(this.options,s)&&_(this,Ce).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Nt),observer:this});const o=this.hasListeners();o&&op(_(this,Nt),c,this.options,s)&&yt(this,wt,Cs).call(this),this.updateResult(),o&&(_(this,Nt)!==c||Ge(this.options.enabled,_(this,Nt))!==Ge(s.enabled,_(this,Nt))||La(this.options.staleTime,_(this,Nt))!==La(s.staleTime,_(this,Nt)))&&yt(this,wt,vf).call(this);const f=yt(this,wt,xf).call(this);o&&(_(this,Nt)!==c||Ge(this.options.enabled,_(this,Nt))!==Ge(s.enabled,_(this,Nt))||f!==_(this,Ca))&&yt(this,wt,bf).call(this,f)}getOptimisticResult(i){const s=_(this,Ce).getQueryCache().build(_(this,Ce),i),c=this.createResult(s,i);return q0(this,c)&&(tt(this,xe,c),tt(this,xi,this.options),tt(this,hl,_(this,Nt).state)),c}getCurrentResult(){return _(this,xe)}trackResult(i,s){return new Proxy(i,{get:(c,o)=>(this.trackProp(o),s==null||s(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,kn).status==="pending"&&_(this,kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(c,o))})}trackProp(i){_(this,ji).add(i)}getCurrentQuery(){return _(this,Nt)}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const s=_(this,Ce).defaultQueryOptions(i),c=_(this,Ce).getQueryCache().build(_(this,Ce),s);return c.fetch().then(()=>this.createResult(c,s))}fetch(i){return yt(this,wt,Cs).call(this,{...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,xe)))}createResult(i,s){var F;const c=_(this,Nt),o=this.options,f=_(this,xe),m=_(this,hl),v=_(this,xi),y=i!==c?i.state:_(this,ks),{state:b}=i;let p={...b},S=!1,j;if(s._optimisticResults){const $=this.hasListeners(),I=!$&&rp(i,s),nt=$&&op(i,c,s,o);(I||nt)&&(p={...p,...sg(b.data,i.options)}),s._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:N,errorUpdatedAt:T,status:R}=p;j=p.data;let M=!1;if(s.placeholderData!==void 0&&j===void 0&&R==="pending"){let $;f!=null&&f.isPlaceholderData&&s.placeholderData===(v==null?void 0:v.placeholderData)?($=f.data,M=!0):$=typeof s.placeholderData=="function"?s.placeholderData((F=_(this,Si))==null?void 0:F.state.data,_(this,Si)):s.placeholderData,$!==void 0&&(R="success",j=yf(f==null?void 0:f.data,$,s),S=!0)}if(s.select&&j!==void 0&&!M)if(f&&j===(m==null?void 0:m.data)&&s.select===_(this,Qs))j=_(this,bi);else try{tt(this,Qs,s.select),j=s.select(j),j=yf(f==null?void 0:f.data,j,s),tt(this,bi,j),tt(this,Ma,null)}catch($){tt(this,Ma,$)}_(this,Ma)&&(N=_(this,Ma),j=_(this,bi),T=Date.now(),R="error");const O=p.fetchStatus==="fetching",Q=R==="pending",w=R==="error",K=Q&&O,B=j!==void 0,G={status:R,fetchStatus:p.fetchStatus,isPending:Q,isSuccess:R==="success",isError:w,isInitialLoading:K,isLoading:K,data:j,dataUpdatedAt:p.dataUpdatedAt,error:N,errorUpdatedAt:T,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:p.dataUpdateCount>y.dataUpdateCount||p.errorUpdateCount>y.errorUpdateCount,isFetching:O,isRefetching:O&&!Q,isLoadingError:w&&!B,isPaused:p.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:w&&B,isStale:kf(i,s),refetch:this.refetch,promise:_(this,kn),isEnabled:Ge(s.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const $=G.data!==void 0,I=G.status==="error"&&!$,nt=gt=>{I?gt.reject(G.error):$&>.resolve(G.data)},at=()=>{const gt=tt(this,kn,G.promise=pf());nt(gt)},lt=_(this,kn);switch(lt.status){case"pending":i.queryHash===c.queryHash&&nt(lt);break;case"fulfilled":(I||G.data!==lt.value)&&at();break;case"rejected":(!I||G.error!==lt.reason)&&at();break}}return G}updateResult(){const i=_(this,xe),s=this.createResult(_(this,Nt),this.options);if(tt(this,hl,_(this,Nt).state),tt(this,xi,this.options),_(this,hl).data!==void 0&&tt(this,Si,_(this,Nt)),bc(s,i))return;tt(this,xe,s);const c=()=>{if(!i)return!0;const{notifyOnChangeProps:o}=this.options,f=typeof o=="function"?o():o;if(f==="all"||!f&&!_(this,ji).size)return!0;const m=new Set(f??_(this,ji));return this.options.throwOnError&&m.add("error"),Object.keys(_(this,xe)).some(v=>{const g=v;return _(this,xe)[g]!==i[g]&&m.has(g)})};yt(this,wt,ug).call(this,{listeners:c()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&yt(this,wt,Sf).call(this)}},Ce=new WeakMap,Nt=new WeakMap,ks=new WeakMap,xe=new WeakMap,hl=new WeakMap,xi=new WeakMap,kn=new WeakMap,Ma=new WeakMap,Qs=new WeakMap,bi=new WeakMap,Si=new WeakMap,ml=new WeakMap,yl=new WeakMap,Ca=new WeakMap,ji=new WeakMap,wt=new WeakSet,Cs=function(i){yt(this,wt,Ef).call(this);let s=_(this,Nt).fetch(this.options,i);return i!=null&&i.throwOnError||(s=s.catch(be)),s},vf=function(){yt(this,wt,jf).call(this);const i=La(this.options.staleTime,_(this,Nt));if(zs.isServer()||_(this,xe).isStale||!hf(i))return;const c=Wp(_(this,xe).dataUpdatedAt,i)+1;tt(this,ml,ll.setTimeout(()=>{_(this,xe).isStale||this.updateResult()},c))},xf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Nt)):this.options.refetchInterval)??!1},bf=function(i){yt(this,wt,Nf).call(this),tt(this,Ca,i),!(zs.isServer()||Ge(this.options.enabled,_(this,Nt))===!1||!hf(_(this,Ca))||_(this,Ca)===0)&&tt(this,yl,ll.setInterval(()=>{(this.options.refetchIntervalInBackground||Lf.isFocused())&&yt(this,wt,Cs).call(this)},_(this,Ca)))},Sf=function(){yt(this,wt,vf).call(this),yt(this,wt,bf).call(this,yt(this,wt,xf).call(this))},jf=function(){_(this,ml)!==void 0&&(ll.clearTimeout(_(this,ml)),tt(this,ml,void 0))},Nf=function(){_(this,yl)!==void 0&&(ll.clearInterval(_(this,yl)),tt(this,yl,void 0))},Ef=function(){const i=_(this,Ce).getQueryCache().build(_(this,Ce),this.options);if(i===_(this,Nt))return;const s=_(this,Nt);tt(this,Nt,i),tt(this,ks,i.state),this.hasListeners()&&(s==null||s.removeObserver(this),i.addObserver(this))},ug=function(i){ne.batch(()=>{i.listeners&&this.listeners.forEach(s=>{s(_(this,xe))}),_(this,Ce).getQueryCache().notify({query:_(this,Nt),type:"observerResultsUpdated"})})},Vp);function B0(l,i){return Ge(i.enabled,l)!==!1&&l.state.data===void 0&&!(l.state.status==="error"&&Ge(i.retryOnMount,l)===!1)}function rp(l,i){return B0(l,i)||l.state.data!==void 0&&_f(l,i,i.refetchOnMount)}function _f(l,i,s){if(Ge(i.enabled,l)!==!1&&La(i.staleTime,l)!=="static"){const c=typeof s=="function"?s(l):s;return c==="always"||c!==!1&&kf(l,i)}return!1}function op(l,i,s,c){return(l!==i||Ge(c.enabled,l)===!1)&&(!s.suspense||l.state.status!=="error")&&kf(l,s)}function kf(l,i){return Ge(i.enabled,l)!==!1&&l.isStaleByTime(La(i.staleTime,l))}function q0(l,i){return!bc(l.getCurrentResult(),i)}var Gs,mn,pe,pl,yn,ja,Zp,H0=(Zp=class extends lg{constructor(i){super();rt(this,yn);rt(this,Gs);rt(this,mn);rt(this,pe);rt(this,pl);tt(this,Gs,i.client),this.mutationId=i.mutationId,tt(this,pe,i.mutationCache),tt(this,mn,[]),this.state=i.state||cg(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){_(this,mn).includes(i)||(_(this,mn).push(i),this.clearGcTimeout(),_(this,pe).notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){tt(this,mn,_(this,mn).filter(s=>s!==i)),this.scheduleGc(),_(this,pe).notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){_(this,mn).length||(this.state.status==="pending"?this.scheduleGc():_(this,pe).remove(this))}continue(){var i;return((i=_(this,pl))==null?void 0:i.continue())??this.execute(this.state.variables)}async execute(i){var m,v,g,y,b,p,S,j,N,T,R,M,O,Q,w,K,B,D;const s=()=>{yt(this,yn,ja).call(this,{type:"continue"})},c={client:_(this,Gs),meta:this.options.meta,mutationKey:this.options.mutationKey};tt(this,pl,ag({fn:()=>this.options.mutationFn?this.options.mutationFn(i,c):Promise.reject(new Error("No mutationFn found")),onFail:(G,F)=>{yt(this,yn,ja).call(this,{type:"failed",failureCount:G,error:F})},onPause:()=>{yt(this,yn,ja).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,pe).canRun(this)}));const o=this.state.status==="pending",f=!_(this,pl).canStart();try{if(o)s();else{yt(this,yn,ja).call(this,{type:"pending",variables:i,isPaused:f}),_(this,pe).config.onMutate&&await _(this,pe).config.onMutate(i,this,c);const F=await((v=(m=this.options).onMutate)==null?void 0:v.call(m,i,c));F!==this.state.context&&yt(this,yn,ja).call(this,{type:"pending",context:F,variables:i,isPaused:f})}const G=await _(this,pl).start();return await((y=(g=_(this,pe).config).onSuccess)==null?void 0:y.call(g,G,i,this.state.context,this,c)),await((p=(b=this.options).onSuccess)==null?void 0:p.call(b,G,i,this.state.context,c)),await((j=(S=_(this,pe).config).onSettled)==null?void 0:j.call(S,G,null,this.state.variables,this.state.context,this,c)),await((T=(N=this.options).onSettled)==null?void 0:T.call(N,G,null,i,this.state.context,c)),yt(this,yn,ja).call(this,{type:"success",data:G}),G}catch(G){try{await((M=(R=_(this,pe).config).onError)==null?void 0:M.call(R,G,i,this.state.context,this,c))}catch(F){Promise.reject(F)}try{await((Q=(O=this.options).onError)==null?void 0:Q.call(O,G,i,this.state.context,c))}catch(F){Promise.reject(F)}try{await((K=(w=_(this,pe).config).onSettled)==null?void 0:K.call(w,void 0,G,this.state.variables,this.state.context,this,c))}catch(F){Promise.reject(F)}try{await((D=(B=this.options).onSettled)==null?void 0:D.call(B,void 0,G,i,this.state.context,c))}catch(F){Promise.reject(F)}throw yt(this,yn,ja).call(this,{type:"error",error:G}),G}finally{_(this,pe).runNext(this)}}},Gs=new WeakMap,mn=new WeakMap,pe=new WeakMap,pl=new WeakMap,yn=new WeakSet,ja=function(i){const s=c=>{switch(i.type){case"failed":return{...c,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...c,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:i.error,failureCount:c.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=s(this.state),ne.batch(()=>{_(this,mn).forEach(c=>{c.onMutationUpdate(i)}),_(this,pe).notify({mutation:this,type:"updated",action:i})})},Zp);function cg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qn,sn,Ys,Jp,k0=(Jp=class extends Mi{constructor(i={}){super();rt(this,Qn);rt(this,sn);rt(this,Ys);this.config=i,tt(this,Qn,new Set),tt(this,sn,new Map),tt(this,Ys,0)}build(i,s,c){const o=new H0({client:i,mutationCache:this,mutationId:++rc(this,Ys)._,options:i.defaultMutationOptions(s),state:c});return this.add(o),o}add(i){_(this,Qn).add(i);const s=oc(i);if(typeof s=="string"){const c=_(this,sn).get(s);c?c.push(i):_(this,sn).set(s,[i])}this.notify({type:"added",mutation:i})}remove(i){if(_(this,Qn).delete(i)){const s=oc(i);if(typeof s=="string"){const c=_(this,sn).get(s);if(c)if(c.length>1){const o=c.indexOf(i);o!==-1&&c.splice(o,1)}else c[0]===i&&_(this,sn).delete(s)}}this.notify({type:"removed",mutation:i})}canRun(i){const s=oc(i);if(typeof s=="string"){const c=_(this,sn).get(s),o=c==null?void 0:c.find(f=>f.state.status==="pending");return!o||o===i}else return!0}runNext(i){var c;const s=oc(i);if(typeof s=="string"){const o=(c=_(this,sn).get(s))==null?void 0:c.find(f=>f!==i&&f.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ne.batch(()=>{_(this,Qn).forEach(i=>{this.notify({type:"removed",mutation:i})}),_(this,Qn).clear(),_(this,sn).clear()})}getAll(){return Array.from(_(this,Qn))}find(i){const s={exact:!0,...i};return this.getAll().find(c=>ap(s,c))}findAll(i={}){return this.getAll().filter(s=>ap(i,s))}notify(i){ne.batch(()=>{this.listeners.forEach(s=>{s(i)})})}resumePausedMutations(){const i=this.getAll().filter(s=>s.state.isPaused);return ne.batch(()=>Promise.all(i.map(s=>s.continue().catch(be))))}},Qn=new WeakMap,sn=new WeakMap,Ys=new WeakMap,Jp);function oc(l){var i;return(i=l.options.scope)==null?void 0:i.id}var Gn,Aa,Ae,Yn,Vn,yc,Rf,Pp,Q0=(Pp=class extends Mi{constructor(s,c){super();rt(this,Vn);rt(this,Gn);rt(this,Aa);rt(this,Ae);rt(this,Yn);tt(this,Gn,s),this.setOptions(c),this.bindMethods(),yt(this,Vn,yc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var o;const c=this.options;this.options=_(this,Gn).defaultMutationOptions(s),bc(this.options,c)||_(this,Gn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Ae),observer:this}),c!=null&&c.mutationKey&&this.options.mutationKey&&bl(c.mutationKey)!==bl(this.options.mutationKey)?this.reset():((o=_(this,Ae))==null?void 0:o.state.status)==="pending"&&_(this,Ae).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=_(this,Ae))==null||s.removeObserver(this)}onMutationUpdate(s){yt(this,Vn,yc).call(this),yt(this,Vn,Rf).call(this,s)}getCurrentResult(){return _(this,Aa)}reset(){var s;(s=_(this,Ae))==null||s.removeObserver(this),tt(this,Ae,void 0),yt(this,Vn,yc).call(this),yt(this,Vn,Rf).call(this)}mutate(s,c){var o;return tt(this,Yn,c),(o=_(this,Ae))==null||o.removeObserver(this),tt(this,Ae,_(this,Gn).getMutationCache().build(_(this,Gn),this.options)),_(this,Ae).addObserver(this),_(this,Ae).execute(s)}},Gn=new WeakMap,Aa=new WeakMap,Ae=new WeakMap,Yn=new WeakMap,Vn=new WeakSet,yc=function(){var c;const s=((c=_(this,Ae))==null?void 0:c.state)??cg();tt(this,Aa,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},Rf=function(s){ne.batch(()=>{var c,o,f,m,v,g,y,b;if(_(this,Yn)&&this.hasListeners()){const p=_(this,Aa).variables,S=_(this,Aa).context,j={client:_(this,Gn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(o=(c=_(this,Yn)).onSuccess)==null||o.call(c,s.data,p,S,j)}catch(N){Promise.reject(N)}try{(m=(f=_(this,Yn)).onSettled)==null||m.call(f,s.data,null,p,S,j)}catch(N){Promise.reject(N)}}else if((s==null?void 0:s.type)==="error"){try{(g=(v=_(this,Yn)).onError)==null||g.call(v,s.error,p,S,j)}catch(N){Promise.reject(N)}try{(b=(y=_(this,Yn)).onSettled)==null||b.call(y,void 0,s.error,p,S,j)}catch(N){Promise.reject(N)}}}this.listeners.forEach(p=>{p(_(this,Aa))})})},Pp),pn,Fp,G0=(Fp=class extends Mi{constructor(i={}){super();rt(this,pn);this.config=i,tt(this,pn,new Map)}build(i,s,c){const o=s.queryKey,f=s.queryHash??Bf(o,s);let m=this.get(f);return m||(m=new U0({client:i,queryKey:o,queryHash:f,options:i.defaultQueryOptions(s),state:c,defaultOptions:i.getQueryDefaults(o)}),this.add(m)),m}add(i){_(this,pn).has(i.queryHash)||(_(this,pn).set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const s=_(this,pn).get(i.queryHash);s&&(i.destroy(),s===i&&_(this,pn).delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){ne.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return _(this,pn).get(i)}getAll(){return[..._(this,pn).values()]}find(i){const s={exact:!0,...i};return this.getAll().find(c=>np(s,c))}findAll(i={}){const s=this.getAll();return Object.keys(i).length>0?s.filter(c=>np(i,c)):s}notify(i){ne.batch(()=>{this.listeners.forEach(s=>{s(i)})})}onFocus(){ne.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){ne.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},pn=new WeakMap,Fp),Jt,wa,Oa,Ni,Ei,za,_i,Ri,$p,Y0=($p=class{constructor(l={}){rt(this,Jt);rt(this,wa);rt(this,Oa);rt(this,Ni);rt(this,Ei);rt(this,za);rt(this,_i);rt(this,Ri);tt(this,Jt,l.queryCache||new G0),tt(this,wa,l.mutationCache||new k0),tt(this,Oa,l.defaultOptions||{}),tt(this,Ni,new Map),tt(this,Ei,new Map),tt(this,za,0)}mount(){rc(this,za)._++,_(this,za)===1&&(tt(this,_i,Lf.subscribe(async l=>{l&&(await this.resumePausedMutations(),_(this,Jt).onFocus())})),tt(this,Ri,Sc.subscribe(async l=>{l&&(await this.resumePausedMutations(),_(this,Jt).onOnline())})))}unmount(){var l,i;rc(this,za)._--,_(this,za)===0&&((l=_(this,_i))==null||l.call(this),tt(this,_i,void 0),(i=_(this,Ri))==null||i.call(this),tt(this,Ri,void 0))}isFetching(l){return _(this,Jt).findAll({...l,fetchStatus:"fetching"}).length}isMutating(l){return _(this,wa).findAll({...l,status:"pending"}).length}getQueryData(l){var s;const i=this.defaultQueryOptions({queryKey:l});return(s=_(this,Jt).get(i.queryHash))==null?void 0:s.state.data}ensureQueryData(l){const i=this.defaultQueryOptions(l),s=_(this,Jt).build(this,i),c=s.state.data;return c===void 0?this.fetchQuery(l):(l.revalidateIfStale&&s.isStaleByTime(La(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(c))}getQueriesData(l){return _(this,Jt).findAll(l).map(({queryKey:i,state:s})=>{const c=s.data;return[i,c]})}setQueryData(l,i,s){const c=this.defaultQueryOptions({queryKey:l}),o=_(this,Jt).get(c.queryHash),f=o==null?void 0:o.state.data,m=N0(i,f);if(m!==void 0)return _(this,Jt).build(this,c).setData(m,{...s,manual:!0})}setQueriesData(l,i,s){return ne.batch(()=>_(this,Jt).findAll(l).map(({queryKey:c})=>[c,this.setQueryData(c,i,s)]))}getQueryState(l){var s;const i=this.defaultQueryOptions({queryKey:l});return(s=_(this,Jt).get(i.queryHash))==null?void 0:s.state}removeQueries(l){const i=_(this,Jt);ne.batch(()=>{i.findAll(l).forEach(s=>{i.remove(s)})})}resetQueries(l,i){const s=_(this,Jt);return ne.batch(()=>(s.findAll(l).forEach(c=>{c.reset()}),this.refetchQueries({type:"active",...l},i)))}cancelQueries(l,i={}){const s={revert:!0,...i},c=ne.batch(()=>_(this,Jt).findAll(l).map(o=>o.cancel(s)));return Promise.all(c).then(be).catch(be)}invalidateQueries(l,i={}){return ne.batch(()=>(_(this,Jt).findAll(l).forEach(s=>{s.invalidate()}),(l==null?void 0:l.refetchType)==="none"?Promise.resolve():this.refetchQueries({...l,type:(l==null?void 0:l.refetchType)??(l==null?void 0:l.type)??"active"},i)))}refetchQueries(l,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},c=ne.batch(()=>_(this,Jt).findAll(l).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let f=o.fetch(void 0,s);return s.throwOnError||(f=f.catch(be)),o.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(c).then(be)}fetchQuery(l){const i=this.defaultQueryOptions(l);i.retry===void 0&&(i.retry=!1);const s=_(this,Jt).build(this,i);return s.isStaleByTime(La(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(l){return this.fetchQuery(l).then(be).catch(be)}fetchInfiniteQuery(l){return l._type="infinite",this.fetchQuery(l)}prefetchInfiniteQuery(l){return this.fetchInfiniteQuery(l).then(be).catch(be)}ensureInfiniteQueryData(l){return l._type="infinite",this.ensureQueryData(l)}resumePausedMutations(){return Sc.isOnline()?_(this,wa).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Jt)}getMutationCache(){return _(this,wa)}getDefaultOptions(){return _(this,Oa)}setDefaultOptions(l){tt(this,Oa,l)}setQueryDefaults(l,i){_(this,Ni).set(bl(l),{queryKey:l,defaultOptions:i})}getQueryDefaults(l){const i=[..._(this,Ni).values()],s={};return i.forEach(c=>{Os(l,c.queryKey)&&Object.assign(s,c.defaultOptions)}),s}setMutationDefaults(l,i){_(this,Ei).set(bl(l),{mutationKey:l,defaultOptions:i})}getMutationDefaults(l){const i=[..._(this,Ei).values()],s={};return i.forEach(c=>{Os(l,c.mutationKey)&&Object.assign(s,c.defaultOptions)}),s}defaultQueryOptions(l){if(l._defaulted)return l;const i={..._(this,Oa).queries,...this.getQueryDefaults(l.queryKey),...l,_defaulted:!0};return i.queryHash||(i.queryHash=Bf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===qf&&(i.enabled=!1),i}defaultMutationOptions(l){return l!=null&&l._defaulted?l:{..._(this,Oa).mutations,...(l==null?void 0:l.mutationKey)&&this.getMutationDefaults(l.mutationKey),...l,_defaulted:!0}}clear(){_(this,Jt).clear(),_(this,wa).clear()}},Jt=new WeakMap,wa=new WeakMap,Oa=new WeakMap,Ni=new WeakMap,Ei=new WeakMap,za=new WeakMap,_i=new WeakMap,Ri=new WeakMap,$p),rg=P.createContext(void 0),Jn=l=>{const i=P.useContext(rg);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},K0=({client:l,children:i})=>(P.useEffect(()=>(l.mount(),()=>{l.unmount()}),[l]),h.jsx(rg.Provider,{value:l,children:i})),og=P.createContext(!1),X0=()=>P.useContext(og);og.Provider;function V0(){let l=!1;return{clearReset:()=>{l=!1},reset:()=>{l=!0},isReset:()=>l}}var Z0=P.createContext(V0()),J0=()=>P.useContext(Z0),P0=(l,i,s)=>{const c=s!=null&&s.state.error&&typeof l.throwOnError=="function"?Hf(l.throwOnError,[s.state.error,s]):l.throwOnError;(l.suspense||l.experimental_prefetchInRender||c)&&(i.isReset()||(l.retryOnMount=!1))},F0=l=>{P.useEffect(()=>{l.clearReset()},[l])},$0=({result:l,errorResetBoundary:i,throwOnError:s,query:c,suspense:o})=>l.isError&&!i.isReset()&&!l.isFetching&&c&&(o&&l.data===void 0||Hf(s,[l.error,c])),I0=l=>{if(l.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),c=l.staleTime;l.staleTime=typeof c=="function"?(...o)=>s(c(...o)):s(c),typeof l.gcTime=="number"&&(l.gcTime=Math.max(l.gcTime,1e3))}},W0=(l,i)=>l.isLoading&&l.isFetching&&!i,tb=(l,i)=>(l==null?void 0:l.suspense)&&i.isPending,fp=(l,i,s)=>i.fetchOptimistic(l).catch(()=>{s.clearReset()});function eb(l,i,s){var j,N,T,R;const c=X0(),o=J0(),f=Jn(),m=f.defaultQueryOptions(l);(N=(j=f.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||N.call(j,m);const v=f.getQueryCache().get(m.queryHash),g=l.subscribed!==!1;m._optimisticResults=c?"isRestoring":g?"optimistic":void 0,I0(m),P0(m,o,v),F0(o);const y=!f.getQueryCache().get(m.queryHash),[b]=P.useState(()=>new i(f,m)),p=b.getOptimisticResult(m),S=!c&&g;if(P.useSyncExternalStore(P.useCallback(M=>{const O=S?b.subscribe(ne.batchCalls(M)):be;return b.updateResult(),O},[b,S]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),P.useEffect(()=>{b.setOptions(m)},[m,b]),tb(m,p))throw fp(m,b,o);if($0({result:p,errorResetBoundary:o,throwOnError:m.throwOnError,query:v,suspense:m.suspense}))throw p.error;if((R=(T=f.getDefaultOptions().queries)==null?void 0:T._experimental_afterQuery)==null||R.call(T,m,p),m.experimental_prefetchInRender&&!zs.isServer()&&W0(p,c)){const M=y?fp(m,b,o):v==null?void 0:v.promise;M==null||M.catch(be).finally(()=>{b.updateResult()})}return m.notifyOnChangeProps?p:b.trackResult(p)}function se(l,i){return eb(l,L0)}function he(l,i){const s=Jn(),[c]=P.useState(()=>new Q0(s,l));P.useEffect(()=>{c.setOptions(l)},[c,l]);const o=P.useSyncExternalStore(P.useCallback(m=>c.subscribe(ne.batchCalls(m)),[c]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f=P.useCallback((m,v)=>{c.mutate(m,v).catch(be)},[c]);if(o.error&&Hf(c.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:f,mutateAsync:o.mutate}}var As=typeof window<"u"?P.useLayoutEffect:P.useEffect;function Io(l){const i=P.useRef({value:l,prev:null}),s=i.current.value;return l!==s&&(i.current={value:l,prev:s}),i.current.prev}function nb(l,i,s={},c={}){P.useEffect(()=>{if(!l.current||c.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([f])=>{i(f)},s);return o.observe(l.current),()=>{o.disconnect()}},[i,s,c.disabled,l])}function ab(l){const i=P.useRef(null);return P.useImperativeHandle(l,()=>i.current,[]),i}const fg=!1;function Ds(l){return l[l.length-1]}function lb(l){return typeof l=="function"}function il(l,i){return lb(l)?l(i):l}const dg=Object.prototype.hasOwnProperty,dp=Object.prototype.propertyIsEnumerable;function hg(l){for(const i in l)if(dg.call(l,i))return!0;return!1}const ib=()=>Object.create(null),al=(l,i)=>sl(l,i,ib);function sl(l,i,s=()=>({}),c=0){if(l===i)return l;if(c>500)return i;const o=i,f=yp(l)&&yp(o);if(!f&&!(jc(l)&&jc(o)))return o;const m=f?l:hp(l);if(!m)return o;const v=f?o:hp(o);if(!v)return o;const g=m.length,y=v.length,b=f?new Array(y):s();let p=0;for(let S=0;S"u")return!0;const s=i.prototype;return!(!mp(s)||!s.hasOwnProperty("isPrototypeOf"))}function mp(l){return Object.prototype.toString.call(l)==="[object Object]"}function yp(l){return Array.isArray(l)&&l.length===Object.keys(l).length}function gl(l,i,s){if(l===i)return!0;if(typeof l!=typeof i)return!1;if(Array.isArray(l)&&Array.isArray(i)){if(l.length!==i.length)return!1;for(let c=0,o=l.length;co||!gl(l[m],i[m],s)))return!1;return o===f}return!1}function Ti(l){let i,s;const c=new Promise((o,f)=>{i=o,s=f});return c.status="pending",c.resolve=o=>{c.status="resolved",c.value=o,i(o),l==null||l(o)},c.reject=o=>{c.status="rejected",s(o)},c}function Us(l){return!!(l&&typeof l=="object"&&typeof l.then=="function")}const sb=/[\x00-\x1f\x7f"<>`{}]/g;function ub(l){return l.replace(sb,i=>"%"+i.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function pp(l){let i;try{i=decodeURI(l)}catch{i=l.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return ub(i)}const cb=["http:","https:","mailto:","tel:"];function Nc(l,i){if(!l)return!1;try{const s=new URL(l);return!i.has(s.protocol)}catch{return!1}}function Rs(l){if(!l)return{path:l,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(l)&&!l.startsWith("//"))return{path:l,handledProtocolRelativeURL:!1};const i=/%25|%5C/gi;let s=0,c="",o;for(;(o=i.exec(l))!==null;)c+=pp(l.slice(s,o.index))+o[0],s=i.lastIndex;c=c+pp(s?l.slice(s):l);let f=!1;return c.startsWith("//")&&(f=!0,c="/"+c.replace(/^\/+/,"")),{path:c,handledProtocolRelativeURL:f}}function rb(l){return/\s|[^\u0000-\u007F]/.test(l)?l.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):l}function ob(l,i){if(l===i)return!0;if(l.length!==i.length)return!1;for(let s=0;s{f.next&&(f.prev?(f.prev.next=f.next,f.next.prev=f.prev,f.next=void 0,c&&(c.next=f,f.prev=c)):(f.next.prev=void 0,s=f.next,f.next=void 0,c&&(f.prev=c,c.next=f)),c=f)};return{get(f){const m=i.get(f);if(m)return o(m),m.value},set(f,m){if(i.size>=l&&s){const g=s;i.delete(g.key),g.next&&(s=g.next,g.next.prev=void 0),g===c&&(c=void 0)}const v=i.get(f);if(v)v.value=m,o(v);else{const g={key:f,value:m,prev:c};c&&(c.next=g),c=g,s||(s=g),i.set(f,g)}},clear(){i.clear(),s=void 0,c=void 0}}}const Da=4,mg=5;function fb(l){const i=l.indexOf("{");if(i===-1)return null;const s=l.indexOf("}",i);return s===-1||i+1>=l.length?null:[i,s]}function yg(l,i,s=new Uint16Array(6)){const c=l.indexOf("/",i),o=c===-1?l.length:c,f=l.substring(i,o);if(!f||!f.includes("$"))return s[0]=0,s[1]=i,s[2]=i,s[3]=o,s[4]=o,s[5]=o,s;if(f==="$"){const v=l.length;return s[0]=2,s[1]=i,s[2]=i,s[3]=v,s[4]=v,s[5]=v,s}if(f.charCodeAt(0)===36)return s[0]=1,s[1]=i,s[2]=i+1,s[3]=o,s[4]=o,s[5]=o,s;const m=fb(f);if(m){const[v,g]=m,y=f.charCodeAt(v+1);if(y===45){if(v+2!V.parse&&V.caseSensitive===at&&V.prefix===lt&&V.suffix===gt));if(H)G=H;else{const V=tf(1,s.fullPath??s.from,at,lt,gt);G=V,V.depth=f,V.parent=o,o.dynamic??(o.dynamic=[]),o.dynamic.push(V)}break}case 3:{const I=O.substring(F,D[1]),nt=O.substring(D[4],$),at=w&&!!(I||nt),lt=I?at?I:I.toLowerCase():void 0,gt=nt?at?nt:nt.toLowerCase():void 0,H=!K&&((T=o.optional)==null?void 0:T.find(V=>!V.parse&&V.caseSensitive===at&&V.prefix===lt&&V.suffix===gt));if(H)G=H;else{const V=tf(3,s.fullPath??s.from,at,lt,gt);G=V,V.parent=o,V.depth=f,o.optional??(o.optional=[]),o.optional.push(V)}break}case 2:{const I=O.substring(F,D[1]),nt=O.substring(D[4],$),at=w&&!!(I||nt),lt=I?at?I:I.toLowerCase():void 0,gt=nt?at?nt:nt.toLowerCase():void 0,H=tf(2,s.fullPath??s.from,at,lt,gt);G=H,H.parent=o,H.depth=f,o.wildcard??(o.wildcard=[]),o.wildcard.push(H)}}o=G}if(K&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const D=ul(s.fullPath??s.from);D.kind=mg,D.parent=o,f++,D.depth=f,o.pathless??(o.pathless=[]),o.pathless.push(D),o=D}const B=(s.path||!s.children)&&!s.isRoot;if(B&&O.endsWith("/")){const D=ul(s.fullPath??s.from);D.kind=Da,D.parent=o,f++,D.depth=f,o.index=D,o=D}o.parse=K??null,o.priority=((M=(R=s.options)==null?void 0:R.params)==null?void 0:M.priority)??0,B&&!o.route&&(o.route=s,o.fullPath=s.fullPath??s.from)}if(s.children)for(const O of s.children)Mc(l,i,O,v,o,f,m)}function Wo(l,i){if(l.parse&&!i.parse)return-1;if(!l.parse&&i.parse)return 1;if(l.parse&&i.parse&&(l.priority||i.priority))return i.priority-l.priority;if(l.prefix&&i.prefix&&l.prefix!==i.prefix){if(l.prefix.startsWith(i.prefix))return-1;if(i.prefix.startsWith(l.prefix))return 1}if(l.suffix&&i.suffix&&l.suffix!==i.suffix){if(l.suffix.endsWith(i.suffix))return-1;if(i.suffix.endsWith(l.suffix))return 1}return l.prefix&&!i.prefix?-1:!l.prefix&&i.prefix?1:l.suffix&&!i.suffix?-1:!l.suffix&&i.suffix?1:l.caseSensitive&&!i.caseSensitive?-1:!l.caseSensitive&&i.caseSensitive?1:0}function Ea(l){var i,s,c;if(l.pathless)for(const o of l.pathless)Ea(o);if(l.static)for(const o of l.static.values())Ea(o);if(l.staticInsensitive)for(const o of l.staticInsensitive.values())Ea(o);if((i=l.dynamic)!=null&&i.length){l.dynamic.sort(Wo);for(const o of l.dynamic)Ea(o)}if((s=l.optional)!=null&&s.length){l.optional.sort(Wo);for(const o of l.optional)Ea(o)}if((c=l.wildcard)!=null&&c.length){l.wildcard.sort(Wo);for(const o of l.wildcard)Ea(o)}}function ul(l){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:l,parent:null,parse:null,priority:0}}function tf(l,i,s,c,o){return{kind:l,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:i,parent:null,parse:null,priority:0,caseSensitive:s,prefix:c,suffix:o}}function db(l,i){const s=ul("/"),c=new Uint16Array(6);for(const o of l)Mc(!1,c,o,1,s,0);Ea(s),i.masksTree=s,i.flatCache=Ls(1e3)}function hb(l,i){l||(l="/");const s=i.flatCache.get(l);if(s)return s;const c=Qf(l,i.masksTree);return i.flatCache.set(l,c),c}function mb(l,i,s,c,o){l||(l="/"),c||(c="/");const f=i?`case\0${l}`:l;let m=o.singleCache.get(f);return m||(m=ul("/"),Mc(i,new Uint16Array(6),{from:l},1,m,0),o.singleCache.set(f,m)),Qf(c,m,s)}function yb(l,i,s=!1){const c=s?l:`nofuzz\0${l}`,o=i.matchCache.get(c);if(o!==void 0)return o;l||(l="/");let f;try{f=Qf(l,i.segmentTree,s)}catch(m){if(m instanceof URIError)f=null;else throw m}return f&&(f.branch=gg(f.route)),i.matchCache.set(c,f),f}function pb(l){return l==="/"?l:l.replace(/\/{1,}$/,"")}function gb(l,i=!1,s){const c=ul(l.fullPath),o=new Uint16Array(6),f={},m={};let v=0;return Mc(i,o,l,1,c,0,g=>{if(s==null||s(g,v),g.id in f&&Xn(),f[g.id]=g,v!==0&&g.path){const y=pb(g.fullPath);(!m[y]||g.fullPath.endsWith("/"))&&(m[y]=g)}v++}),Ea(c),{processedTree:{segmentTree:c,singleCache:Ls(1e3),matchCache:Ls(1e3),flatCache:null,masksTree:null},routesById:f,routesByPath:m}}function Qf(l,i,s=!1){const c=l.split("/"),o=xb(l,c,i,s);if(!o)return null;const[f]=pg(l,c,o);return{route:o.node.route,rawParams:f}}function pg(l,i,s){var b,p,S,j,N,T,R,M,O,Q;const c=vb(s.node);let o=null;const f=Object.create(null);let m=((b=s.extract)==null?void 0:b.part)??0,v=((p=s.extract)==null?void 0:p.node)??0,g=((S=s.extract)==null?void 0:S.path)??0,y=((j=s.extract)==null?void 0:j.segment)??0;for(;v=0;D--){const G=p.wildcard[D],{prefix:F,suffix:$}=G;if(!(F&&(w||!(G.caseSensitive?K:B??(B=K.toLowerCase())).startsWith(F)))){if($){if(w)continue;const I=i.slice(S).join("/").slice(-$.length);if((G.caseSensitive?I:I.toLowerCase())!==$)continue}v.push({node:G,index:m,skipped:j,depth:N+1,statics:T,dynamics:R,optionals:M,extract:O,rawParams:Q})}}if(p.optional){const D=j|1<=0;F--){const $=p.optional[F];v.push({node:$,index:S,skipped:D,depth:G,statics:T,dynamics:R,optionals:M,extract:O,rawParams:Q})}if(!w)for(let F=p.optional.length-1;F>=0;F--){const $=p.optional[F],{prefix:I,suffix:nt}=$;if(I||nt){const at=$.caseSensitive?K:B??(B=K.toLowerCase());if(I&&!at.startsWith(I)||nt&&!at.endsWith(nt))continue}v.push({node:$,index:S+1,skipped:j,depth:G,statics:T,dynamics:R,optionals:M+fc(m,S),extract:O,rawParams:Q})}}if(!w&&p.dynamic&&K)for(let D=p.dynamic.length-1;D>=0;D--){const G=p.dynamic[D],{prefix:F,suffix:$}=G;if(F||$){const I=G.caseSensitive?K:B??(B=K.toLowerCase());if(F&&!I.startsWith(F)||$&&!I.endsWith($))continue}v.push({node:G,index:S+1,skipped:j,depth:N+1,statics:T,dynamics:R+fc(m,S),optionals:M,extract:O,rawParams:Q})}if(!w&&p.staticInsensitive){const D=p.staticInsensitive.get(B??(B=K.toLowerCase()));D&&v.push({node:D,index:S+1,skipped:j,depth:N+1,statics:T+fc(m,S),dynamics:R,optionals:M,extract:O,rawParams:Q})}if(!w&&p.static){const D=p.static.get(K);D&&v.push({node:D,index:S+1,skipped:j,depth:N+1,statics:T+fc(m,S),dynamics:R,optionals:M,extract:O,rawParams:Q})}if(p.pathless){const D=N+1;for(let G=p.pathless.length-1;G>=0;G--){const F=p.pathless[G];v.push({node:F,index:S,skipped:j,depth:D,statics:T,dynamics:R,optionals:M,extract:O,rawParams:Q})}}}if(y)return y;if(c&&g){let b=g.index;for(let S=0;Sl.statics||i.statics===l.statics&&(i.dynamics>l.dynamics||i.dynamics===l.dynamics&&(i.optionals>l.optionals||i.optionals===l.optionals&&((i.node.kind===Da)>(l.node.kind===Da)||i.node.kind===Da==(l.node.kind===Da)&&i.depth>l.depth))):!0}function pc(l){return Gf(l.filter(i=>i!==void 0).join("/"))}function Gf(l){return l.replace(/\/{2,}/g,"/")}function vg(l){return l==="/"?l:l.replace(/^\/{1,}/,"")}function Kn(l){const i=l.length;return i>1&&l[i-1]==="/"?l.replace(/\/{1,}$/,""):l}function xg(l){return Kn(vg(l))}function Ec(l,i){return l!=null&&l.endsWith("/")&&l!=="/"&&l!==`${i}/`?l.slice(0,-1):l}function Sb(l,i,s){return Ec(l,s)===Ec(i,s)}function jb({base:l,to:i,trailingSlash:s="never",cache:c}){const o=i.startsWith("/"),f=!o&&i===".";let m;if(c){m=o?i:f?l:l+"\0"+i;const y=c.get(m);if(y)return y}let v;if(f)v=l.split("/");else if(o)v=i.split("/");else{for(v=l.split("/");v.length>1&&Ds(v)==="";)v.pop();const y=i.split("/");for(let b=0,p=y.length;b1&&(Ds(v)===""?s==="never"&&v.pop():s==="always"&&v.push(""));const g=Gf(v.join("/"))||"/";return m&&c&&c.set(m,g),g}function Nb(l){const i=new Map(l.map(o=>[encodeURIComponent(o),o])),s=Array.from(i.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),c=new RegExp(s,"g");return o=>o.replace(c,f=>i.get(f)??f)}function ef(l,i,s){const c=i[l];return typeof c!="string"?c:l==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(c)?c:c.split("/").map(o=>xp(o,s)).join("/"):xp(c,s)}function vp({path:l,params:i,decoder:s,...c}){let o=!1;const f=Object.create(null);if(!l||l==="/")return{interpolatedPath:"/",usedParams:f,isMissingParams:o};if(!l.includes("$"))return{interpolatedPath:l,usedParams:f,isMissingParams:o};const m=l.length;let v=0,g,y="";for(;v{i[0]==="?"&&(i=i.substring(1));const s=_b(i);for(const c in s){const o=s[c];if(typeof o=="string")try{s[c]=l(o)}catch{}}return s}}function Cb(l,i){const s=typeof i=="function";function c(o){if(typeof o=="object"&&o!==null)try{return l(o)}catch{}else if(s&&typeof o=="string")try{return i(o),l(o)}catch{}return o}return o=>{const f=Eb(o,c);return f?`?${f}`:""}}const vl="__root__";function Ab(l){if(l.statusCode=l.statusCode||l.code||307,!l._builtLocation&&!l.reloadDocument&&typeof l.href=="string")try{new URL(l.href),l.reloadDocument=!0}catch{}const i=new Headers(l.headers);l.href&&i.get("Location")===null&&i.set("Location",l.href);const s=new Response(null,{status:l.statusCode,headers:i});if(s.options=l,l.throw)throw s;return s}function we(l){return l instanceof Response&&!!l.options}const Tf=l=>{var i;if(!l.rendered)return l.rendered=!0,(i=l.onReady)==null?void 0:i.call(l)},wb=l=>l.stores.matchesId.get().some(i=>{var s;return(s=l.stores.matchStores.get(i))==null?void 0:s.get()._forcePending}),Cc=(l,i)=>!!(l.preload&&!l.router.stores.matchStores.has(i)),xl=(l,i,s=!0)=>{const c={...l.router.options.context??{}},o=s?i:i-1;for(let f=0;f<=o;f++){const m=l.matches[f];if(!m)continue;const v=l.router.getMatch(m.id);v&&Object.assign(c,v.__routeContext,v.__beforeLoadContext)}return c},bp=(l,i)=>{if(!l.matches.length)return;const s=i.routeId,c=l.matches.findIndex(m=>m.routeId===l.router.routeTree.id),o=c>=0?c:0;let f=s?l.matches.findIndex(m=>m.routeId===s):l.firstBadMatchIndex??l.matches.length-1;f<0&&(f=o);for(let m=f;m>=0;m--){const v=l.matches[m];if(l.router.looseRoutesById[v.routeId].options.notFoundComponent)return m}return s?f:o},Ua=(l,i,s)=>{var c,o,f;if(!(!we(s)&&!ge(s)))throw we(s)&&s.redirectHandled&&!s.options.reloadDocument||(i&&((c=i._nonReactive.beforeLoadPromise)==null||c.resolve(),(o=i._nonReactive.loaderPromise)==null||o.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loaderPromise=void 0,i._nonReactive.error=s,l.updateMatch(i.id,m=>({...m,status:we(s)?"redirected":ge(s)?"notFound":m.status==="pending"?"success":m.status,context:xl(l,i.index),isFetching:!1,error:s})),ge(s)&&!s.routeId&&(s.routeId=i.routeId),(f=i._nonReactive.loadPromise)==null||f.resolve()),we(s)&&(l.rendered=!0,s.options._fromLocation=l.location,s.redirectHandled=!0,s=l.router.resolveRedirect(s))),s},bg=(l,i)=>{const s=l.router.getMatch(i);return!!(!s||s._nonReactive.dehydrated)},Sp=(l,i,s)=>{const c=xl(l,s);l.updateMatch(i,o=>({...o,context:c}))},Ts=(l,i,s)=>{var m,v;const{id:c,routeId:o}=l.matches[i],f=l.router.looseRoutesById[o];if(s instanceof Promise)throw s;l.firstBadMatchIndex??(l.firstBadMatchIndex=i),Ua(l,l.router.getMatch(c),s);try{(v=(m=f.options).onError)==null||v.call(m,s)}catch(g){s=g,Ua(l,l.router.getMatch(c),s)}l.updateMatch(c,g=>{var y,b;return(y=g._nonReactive.beforeLoadPromise)==null||y.resolve(),g._nonReactive.beforeLoadPromise=void 0,(b=g._nonReactive.loadPromise)==null||b.resolve(),{...g,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!l.preload&&!we(s)&&!ge(s)&&(l.serialError??(l.serialError=s))},Sg=(l,i,s,c)=>{var f;if(c._nonReactive.pendingTimeout!==void 0)return;const o=s.options.pendingMs??l.router.options.defaultPendingMs;if(l.onReady&&!Cc(l,i)&&(s.options.loader||s.options.beforeLoad||Ng(s))&&typeof o=="number"&&o!==1/0&&(s.options.pendingComponent??((f=l.router.options)==null?void 0:f.defaultPendingComponent))){const m=setTimeout(()=>{Tf(l)},o);c._nonReactive.pendingTimeout=m}},Ob=(l,i,s)=>{const c=l.router.getMatch(i);if(!c._nonReactive.beforeLoadPromise&&!c._nonReactive.loaderPromise)return;Sg(l,i,s,c);const o=()=>{const f=l.router.getMatch(i);f.preload&&(f.status==="redirected"||f.status==="notFound")&&Ua(l,f,f.error)};return c._nonReactive.beforeLoadPromise?c._nonReactive.beforeLoadPromise.then(o):o()},zb=(l,i,s,c)=>{const o=l.router.getMatch(i);let f=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Ti(()=>{f==null||f.resolve(),f=void 0});const{paramsError:m,searchError:v}=o;m&&Ts(l,s,m),v&&Ts(l,s,v),Sg(l,i,c,o);const g=new AbortController;let y=!1;const b=()=>{y||(y=!0,l.updateMatch(i,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:g})))},p=()=>{var w;(w=o._nonReactive.beforeLoadPromise)==null||w.resolve(),o._nonReactive.beforeLoadPromise=void 0,l.updateMatch(i,K=>({...K,isFetching:!1}))};if(!c.options.beforeLoad){l.router.batch(()=>{b(),p()});return}o._nonReactive.beforeLoadPromise=Ti();const S={...xl(l,s,!1),...o.__routeContext},{search:j,params:N,cause:T}=o,R=Cc(l,i),M={search:j,abortController:g,params:N,preload:R,context:S,location:l.location,navigate:w=>l.router.navigate({...w,_fromLocation:l.location}),buildLocation:l.router.buildLocation,cause:R?"preload":T,matches:l.matches,routeId:c.id,...l.router.options.additionalContext},O=w=>{if(w===void 0){l.router.batch(()=>{b(),p()});return}(we(w)||ge(w))&&(b(),Ts(l,s,w)),l.router.batch(()=>{b(),l.updateMatch(i,K=>({...K,__beforeLoadContext:w})),p()})};let Q;try{if(Q=c.options.beforeLoad(M),Us(Q))return b(),Q.catch(w=>{Ts(l,s,w)}).then(O)}catch(w){b(),Ts(l,s,w)}O(Q)},Db=(l,i)=>{const{id:s,routeId:c}=l.matches[i],o=l.router.looseRoutesById[c],f=()=>v(),m=()=>zb(l,s,i,o),v=()=>{if(bg(l,s))return;const g=Ob(l,s,o);return Us(g)?g.then(m):m()};return f()},Ub=(l,i,s)=>{var f,m,v,g,y,b;const c=l.router.getMatch(i);if(!c||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const o={ssr:l.router.options.ssr,matches:l.matches,match:c,params:c.params,loaderData:c.loaderData};return Promise.all([(m=(f=s.options).head)==null?void 0:m.call(f,o),(g=(v=s.options).scripts)==null?void 0:g.call(v,o),(b=(y=s.options).headers)==null?void 0:b.call(y,o)]).then(([p,S,j])=>({meta:p==null?void 0:p.meta,links:p==null?void 0:p.links,headScripts:p==null?void 0:p.scripts,headers:j,scripts:S,styles:p==null?void 0:p.styles}))},jg=(l,i,s,c,o)=>{const f=i[c-1],{params:m,loaderDeps:v,abortController:g,cause:y}=l.router.getMatch(s),b=xl(l,c),p=Cc(l,s);return{params:m,deps:v,preload:!!p,parentMatchPromise:f,abortController:g,context:b,location:l.location,navigate:S=>l.router.navigate({...S,_fromLocation:l.location}),cause:p?"preload":y,route:o,...l.router.options.additionalContext}},jp=async(l,i,s,c,o)=>{var f,m,v,g,y;try{const b=l.router.getMatch(s);try{(!(fg??l.router.isServer)||b.ssr===!0)&&Bs(o);const p=o.options.loader,S=typeof p=="function"?p:p==null?void 0:p.handler,j=S==null?void 0:S(jg(l,i,s,c,o)),N=!!S&&Us(j);if((N||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||b._nonReactive.minPendingPromise)&&l.updateMatch(s,R=>({...R,isFetching:"loader"})),S){const R=N?await j:j;Ua(l,l.router.getMatch(s),R),R!==void 0&&l.updateMatch(s,M=>({...M,loaderData:R}))}o._lazyPromise&&await o._lazyPromise;const T=b._nonReactive.minPendingPromise;T&&await T,o._componentsPromise&&await o._componentsPromise,l.updateMatch(s,R=>({...R,error:void 0,context:xl(l,c),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(p){let S=p;if((S==null?void 0:S.name)==="AbortError"){if(b.abortController.signal.aborted){(f=b._nonReactive.loaderPromise)==null||f.resolve(),b._nonReactive.loaderPromise=void 0;return}l.updateMatch(s,N=>({...N,status:N.status==="pending"?"success":N.status,isFetching:!1,context:xl(l,c)}));return}const j=b._nonReactive.minPendingPromise;j&&await j,ge(p)&&await((v=(m=o.options.notFoundComponent)==null?void 0:m.preload)==null?void 0:v.call(m)),Ua(l,l.router.getMatch(s),p);try{(y=(g=o.options).onError)==null||y.call(g,p)}catch(N){S=N,Ua(l,l.router.getMatch(s),N)}!we(S)&&!ge(S)&&await Bs(o,["errorComponent"]),l.updateMatch(s,N=>({...N,error:S,context:xl(l,c),status:"error",isFetching:!1}))}}catch(b){const p=l.router.getMatch(s);p&&(p._nonReactive.loaderPromise=void 0),Ua(l,p,b)}},Lb=async(l,i,s)=>{var j,N,T,R;async function c(M,O,Q,w,K){const B=Date.now()-O.updatedAt,D=M?K.options.preloadStaleTime??l.router.options.defaultPreloadStaleTime??3e4:K.options.staleTime??l.router.options.defaultStaleTime??0,G=K.options.shouldReload,F=typeof G=="function"?G(jg(l,i,o,s,K)):G,{status:$,invalid:I}=w,nt=B>=D&&(!!l.forceStaleReload||w.cause==="enter"||Q!==void 0&&Q!==w.id);m=$==="success"&&(I||(F??nt)),M&&K.options.preload===!1||(m&&!l.sync&&b?(v=!0,(async()=>{var at,lt;try{await jp(l,i,o,s,K);const gt=l.router.getMatch(o);(at=gt._nonReactive.loaderPromise)==null||at.resolve(),(lt=gt._nonReactive.loadPromise)==null||lt.resolve(),gt._nonReactive.loaderPromise=void 0,gt._nonReactive.loadPromise=void 0}catch(gt){we(gt)&&await l.router.navigate(gt.options)}})()):$!=="success"||m?await jp(l,i,o,s,K):Sp(l,o,s))}const{id:o,routeId:f}=l.matches[s];let m=!1,v=!1;const g=l.router.looseRoutesById[f],y=g.options.loader,b=((typeof y=="function"||y==null?void 0:y.staleReloadMode)??l.router.options.defaultStaleReloadMode)!=="blocking";if(bg(l,o)){if(!l.router.getMatch(o))return l.matches[s];Sp(l,o,s)}else{const M=l.router.getMatch(o),O=l.router.stores.matchesId.get()[s],Q=((j=O&&l.router.stores.matchStores.get(O)||null)==null?void 0:j.routeId)===f?O:(N=l.router.stores.matches.get().find(K=>K.routeId===f))==null?void 0:N.id,w=Cc(l,o);if(M._nonReactive.loaderPromise){if(M.status==="success"&&!l.sync&&!M.preload&&b)return M;await M._nonReactive.loaderPromise;const K=l.router.getMatch(o),B=K._nonReactive.error||K.error;B&&Ua(l,K,B),K.status==="pending"&&await c(w,M,Q,K,g)}else{const K=w&&!l.router.stores.matchStores.has(o),B=l.router.getMatch(o);B._nonReactive.loaderPromise=Ti(),K!==B.preload&&l.updateMatch(o,D=>({...D,preload:K})),await c(w,M,Q,B,g)}}const p=l.router.getMatch(o);v||((T=p._nonReactive.loaderPromise)==null||T.resolve(),(R=p._nonReactive.loadPromise)==null||R.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,v||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const S=v?p.isFetching:!1;return S!==p.isFetching||p.invalid!==!1?(l.updateMatch(o,M=>({...M,isFetching:S,invalid:!1})),l.router.getMatch(o)):p};async function Np(l){var S,j;const i=l,s=[];wb(i.router)&&Tf(i);let c;for(let N=0;N({...Q,...O?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:y},isFetching:!1})),b=N,await Bs(R,["notFoundComponent"])}else if(!i.preload){const N=i.matches[0];N.globalNotFound||(j=i.router.getMatch(N.id))!=null&&j.globalNotFound&&i.updateMatch(N.id,T=>({...T,globalNotFound:!1,error:void 0}))}if(i.serialError&&i.firstBadMatchIndex!==void 0){const N=i.router.looseRoutesById[i.matches[i.firstBadMatchIndex].routeId];await Bs(N,["errorComponent"])}for(let N=0;N<=b;N++){const{id:T,routeId:R}=i.matches[N],M=i.router.looseRoutesById[R];try{const O=Ub(i,T,M);if(O){const Q=await O;i.updateMatch(T,w=>({...w,...Q}))}}catch(O){console.error(`Error executing head for route ${R}:`,O)}}const p=Tf(i);if(Us(p)&&await p,y)throw y;if(i.serialError&&!i.preload&&!i.onReady)throw i.serialError;return i.matches}function Ep(l,i){const s=i.map(c=>{var o,f;return(f=(o=l.options[c])==null?void 0:o.preload)==null?void 0:f.call(o)}).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Bs(l,i=gc){!l._lazyLoaded&&l._lazyPromise===void 0&&(l.lazyFn?l._lazyPromise=l.lazyFn().then(c=>{const{id:o,...f}=c.options;Object.assign(l.options,f),l._lazyLoaded=!0,l._lazyPromise=void 0}):l._lazyLoaded=!0);const s=()=>l._componentsLoaded?void 0:i===gc?(()=>{if(l._componentsPromise===void 0){const c=Ep(l,gc);c?l._componentsPromise=c.then(()=>{l._componentsLoaded=!0,l._componentsPromise=void 0}):l._componentsLoaded=!0}return l._componentsPromise})():Ep(l,i);return l._lazyPromise?l._lazyPromise.then(s):s()}function Ng(l){var i;for(const s of gc)if((i=l.options[s])!=null&&i.preload)return!0;return!1}const gc=["component","errorComponent","pendingComponent","notFoundComponent"];function Bb(l){return{input:({url:i})=>{for(const s of l)i=Mf(s,i);return i},output:({url:i})=>{for(let s=l.length-1;s>=0;s--)i=Eg(l[s],i);return i}}}function qb(l){const i=xg(l.basepath),s=`/${i}`,c=l.caseSensitive?s:s.toLowerCase(),o=`${c}/`;return{input:({url:f})=>{const m=l.caseSensitive?f.pathname:f.pathname.toLowerCase();return m===c?f.pathname="/":m.startsWith(o)&&(f.pathname=f.pathname.slice(s.length)),f},output:({url:f})=>(f.pathname=pc(["/",i,f.pathname]),f)}}function Mf(l,i){var c;const s=(c=l==null?void 0:l.input)==null?void 0:c.call(l,{url:i});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return i}function Eg(l,i){var c;const s=(c=l==null?void 0:l.output)==null?void 0:c.call(l,{url:i});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return i}function Hb(l,i){const{createMutableStore:s,createReadonlyStore:c,batch:o,init:f}=i,m=new Map,v=new Map,g=new Map,y=s(l.status),b=s(l.loadedAt),p=s(l.isLoading),S=s(l.isTransitioning),j=s(l.location),N=s(l.resolvedLocation),T=s(l.statusCode),R=s(l.redirect),M=s([]),O=s([]),Q=s([]),w=c(()=>af(m,M.get())),K=c(()=>af(v,O.get())),B=c(()=>af(g,Q.get())),D=c(()=>M.get()[0]),G=c(()=>M.get().some(V=>{var ut;return((ut=m.get(V))==null?void 0:ut.get().status)==="pending"})),F=c(()=>{var V;return{locationHref:j.get().href,resolvedLocationHref:(V=N.get())==null?void 0:V.href,status:y.get()}}),$=c(()=>({status:y.get(),loadedAt:b.get(),isLoading:p.get(),isTransitioning:S.get(),matches:w.get(),location:j.get(),resolvedLocation:N.get(),statusCode:T.get(),redirect:R.get()})),I=Ls(64);function nt(V){let ut=I.get(V);return ut||(ut=c(()=>{const Mt=M.get();for(const At of Mt){const A=m.get(At);if(A&&A.routeId===V)return A.get()}}),I.set(V,ut)),ut}const at={status:y,loadedAt:b,isLoading:p,isTransitioning:S,location:j,resolvedLocation:N,statusCode:T,redirect:R,matchesId:M,pendingIds:O,cachedIds:Q,matches:w,pendingMatches:K,cachedMatches:B,firstId:D,hasPending:G,matchRouteDeps:F,matchStores:m,pendingMatchStores:v,cachedMatchStores:g,__store:$,getRouteMatchStore:nt,setMatches:lt,setPending:gt,setCached:H};lt(l.matches),f==null||f(at);function lt(V){lf(V,m,M,s,o)}function gt(V){lf(V,v,O,s,o)}function H(V){lf(V,g,Q,s,o)}return at}function af(l,i){const s=[];for(const c of i){const o=l.get(c);o&&s.push(o.get())}return s}function lf(l,i,s,c,o){const f=l.map(v=>v.id),m=new Set(f);o(()=>{for(const v of i.keys())m.has(v)||i.delete(v);for(const v of l){const g=i.get(v.id);if(!g){const y=c(v);y.routeId=v.routeId,i.set(v.id,y);continue}g.routeId=v.routeId,g.get()!==v&&g.set(v)}ob(s.get(),f)||s.set(f)})}var Ba="__TSR_index",_p="popstate",Rp="beforeunload";function kb(l){let i=l.getLocation();const s=new Set,c=m=>{i=l.getLocation(),s.forEach(v=>v({location:i,action:m}))},o=m=>{l.notifyOnIndexChange??!0?c(m):i=l.getLocation()},f=async({task:m,navigateOpts:v,...g})=>{var p,S;if((v==null?void 0:v.ignoreBlocker)??!1){m();return}const y=((p=l.getBlockers)==null?void 0:p.call(l))??[],b=g.type==="PUSH"||g.type==="REPLACE";if(typeof document<"u"&&y.length&&b)for(const j of y){const N=_c(g.path,g.state);if(await j.blockerFn({currentLocation:i,nextLocation:N,action:g.type})){(S=l.onBlocked)==null||S.call(l);return}}m()};return{get location(){return i},get length(){return l.getLength()},subscribers:s,subscribe:m=>(s.add(m),()=>{s.delete(m)}),push:(m,v,g)=>{const y=i.state[Ba];v=Tp(y+1,v),f({task:()=>{l.pushState(m,v),c({type:"PUSH"})},navigateOpts:g,type:"PUSH",path:m,state:v})},replace:(m,v,g)=>{const y=i.state[Ba];v=Tp(y,v),f({task:()=>{l.replaceState(m,v),c({type:"REPLACE"})},navigateOpts:g,type:"REPLACE",path:m,state:v})},go:(m,v)=>{f({task:()=>{l.go(m),o({type:"GO",index:m})},navigateOpts:v,type:"GO"})},back:m=>{f({task:()=>{l.back((m==null?void 0:m.ignoreBlocker)??!1),o({type:"BACK"})},navigateOpts:m,type:"BACK"})},forward:m=>{f({task:()=>{l.forward((m==null?void 0:m.ignoreBlocker)??!1),o({type:"FORWARD"})},navigateOpts:m,type:"FORWARD"})},canGoBack:()=>i.state[Ba]!==0,createHref:m=>l.createHref(m),block:m=>{var g;if(!l.setBlockers)return()=>{};const v=((g=l.getBlockers)==null?void 0:g.call(l))??[];return l.setBlockers([...v,m]),()=>{var b,p;const y=((b=l.getBlockers)==null?void 0:b.call(l))??[];(p=l.setBlockers)==null||p.call(l,y.filter(S=>S!==m))}},flush:()=>{var m;return(m=l.flush)==null?void 0:m.call(l)},destroy:()=>{var m;return(m=l.destroy)==null?void 0:m.call(l)},notify:c}}function Tp(l,i){i||(i={});const s=Yf();return{...i,key:s,__TSR_key:s,[Ba]:l}}function Qb(l){var G,F;const i=typeof document<"u"?window:void 0,s=i.history.pushState,c=i.history.replaceState;let o=[];const f=()=>o,m=$=>o=$,v=($=>$),g=(()=>_c(`${i.location.pathname}${i.location.search}${i.location.hash}`,i.history.state));if(!((G=i.history.state)!=null&&G.__TSR_key)&&!((F=i.history.state)!=null&&F.key)){const $=Yf();i.history.replaceState({[Ba]:0,key:$,__TSR_key:$},"")}let y=g(),b,p=!1,S=!1,j=!1,N=!1;const T=()=>y;let R,M;const O=()=>{R&&(D._ignoreSubscribers=!0,(R.isPush?i.history.pushState:i.history.replaceState)(R.state,"",R.href),D._ignoreSubscribers=!1,R=void 0,M=void 0,b=void 0)},Q=($,I,nt)=>{const at=v(I);M||(b=y),y=_c(I,nt),R={href:at,state:nt,isPush:(R==null?void 0:R.isPush)||$==="push"},M||(M=Promise.resolve().then(()=>O()))},w=$=>{y=g(),D.notify({type:$})},K=async()=>{if(S){S=!1;return}const $=g(),I=$.state[Ba]-y.state[Ba],nt=I===1,at=I===-1,lt=!nt&&!at||p;p=!1;const gt=lt?"GO":at?"BACK":"FORWARD",H=lt?{type:"GO",index:I}:{type:at?"BACK":"FORWARD"};if(j)j=!1;else{const V=f();if(typeof document<"u"&&V.length){for(const ut of V)if(await ut.blockerFn({currentLocation:y,nextLocation:$,action:gt})){S=!0,i.history.go(1),D.notify(H);return}}}y=g(),D.notify(H)},B=$=>{if(N){N=!1;return}let I=!1;const nt=f();if(typeof document<"u"&&nt.length)for(const at of nt){const lt=at.enableBeforeUnload??!0;if(lt===!0){I=!0;break}if(typeof lt=="function"&<()===!0){I=!0;break}}if(I)return $.preventDefault(),$.returnValue=""},D=kb({getLocation:T,getLength:()=>i.history.length,pushState:($,I)=>Q("push",$,I),replaceState:($,I)=>Q("replace",$,I),back:$=>($&&(j=!0),N=!0,i.history.back()),forward:$=>{$&&(j=!0),N=!0,i.history.forward()},go:$=>{p=!0,i.history.go($)},createHref:$=>v($),flush:O,destroy:()=>{i.history.pushState=s,i.history.replaceState=c,i.removeEventListener(Rp,B,{capture:!0}),i.removeEventListener(_p,K)},onBlocked:()=>{b&&y!==b&&(y=b)},getBlockers:f,setBlockers:m,notifyOnIndexChange:!1});return i.addEventListener(Rp,B,{capture:!0}),i.addEventListener(_p,K),i.history.pushState=function(...$){const I=s.apply(i.history,$);return D._ignoreSubscribers||w("PUSH"),I},i.history.replaceState=function(...$){const I=c.apply(i.history,$);return D._ignoreSubscribers||w("REPLACE"),I},D}function Gb(l){let i=l.replace(/[\x00-\x1f\x7f]/g,"");return i.startsWith("//")&&(i="/"+i.replace(/^\/+/,"")),i}function _c(l,i){const s=Gb(l),c=s.indexOf("#"),o=s.indexOf("?"),f=Yf();return{href:s,pathname:s.substring(0,c>0?o>0?Math.min(c,o):c:o>0?o:s.length),hash:c>-1?s.substring(c):"",search:o>-1?s.slice(o,c===-1?void 0:c):"",state:i||{[Ba]:0,key:f,__TSR_key:f}}}function Yf(){return(Math.random()+1).toString(36).substring(7)}function di(l,i){const s=i,c=l;return{fromLocation:s,toLocation:c,pathChanged:(s==null?void 0:s.pathname)!==c.pathname,hrefChanged:(s==null?void 0:s.href)!==c.href,hashChanged:(s==null?void 0:s.hash)!==c.hash}}const Cf=new WeakMap;var Yb=class{constructor(l,i){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=s=>s(),this.update=s=>{var b;const c=this.options,o=this.basepath??(c==null?void 0:c.basepath)??"/",f=this.basepath===void 0,m=c==null?void 0:c.rewrite;if(this.options={...c,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Nb(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Qb()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=Ls(1e3),p=this.buildRouteTree(),this.setRoutes(p)}if(!this.stores&&this.latestLocation){const p=this.getStoreConfig(this);this.batch=p.batch,this.stores=Hb(Xb(this.latestLocation),p),nS(this)}let v=!1;const g=this.options.basepath??"/",y=this.options.rewrite;if(f||o!==g||m!==y){this.basepath=g;const p=[],S=xg(g);S&&S!=="/"&&p.push(qb({basepath:g})),y&&p.push(y),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Bb(p),this.history&&this.updateLatestLocation(),v=!0}v&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((b=window.CSS)==null?void 0:b.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=gb(this.routeTree,this.options.caseSensitive,(c,o)=>{c.init({originalIndex:o})});return this.options.routeMasks&&db(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,c)=>{const o={eventType:s,fn:c};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=s=>{this.subscribers.forEach(c=>{c.eventType===s.type&&c.fn(s)})},this.parseLocation=(s,c)=>{const o=({pathname:g,search:y,hash:b,href:p,state:S})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(g)){const M=this.options.parseSearch(y),O=this.options.stringifySearch(M);return{href:g+O+b,publicHref:g+O+b,pathname:Rs(g).path,external:!1,searchStr:O,search:al(c==null?void 0:c.search,M),hash:Rs(b.slice(1)).path,state:sl(c==null?void 0:c.state,S)}}const j=new URL(p,this.origin),N=Mf(this.rewrite,j),T=this.options.parseSearch(N.search),R=this.options.stringifySearch(T);return N.search=R,{href:N.href.replace(N.origin,""),publicHref:p,pathname:Rs(N.pathname).path,external:!!this.rewrite&&N.origin!==this.origin,searchStr:R,search:al(c==null?void 0:c.search,T),hash:Rs(N.hash.slice(1)).path,state:sl(c==null?void 0:c.state,S)}},f=o(s),{__tempLocation:m,__tempKey:v}=f.state;if(m&&(!v||v===this.tempLocationKey)){const g=o(m);return g.state.key=f.state.key,g.state.__TSR_key=f.state.__TSR_key,delete g.state.__tempLocation,{...g,maskedLocation:f}}return f},this.resolvePathWithBase=(s,c)=>jb({base:s,to:c.includes("//")?Gf(c):c,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,c,o)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:c},o):this.matchRoutesInternal(s,c),this.getMatchedRoutes=s=>Vb({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const c=this.getMatch(s);c&&(c.abortController.abort(),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{var o;if(this.stores.pendingMatchStores.has(s))return;const c=(o=this.stores.matchStores.get(s))==null?void 0:o.get();c&&(c.status==="pending"||c.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const c=(f={})=>{var I,nt;const m=f._fromLocation||this.pendingBuiltLocation||this.latestLocation,v=this.matchRoutesLightweight(m);f.from;const g=f.unsafeRelative==="path"?m.pathname:f.from??v.fullPath,y=f.to?`${f.to}`:void 0,b=v.search,p=Object.assign(Object.create(null),v.params),S=(y==null?void 0:y.charCodeAt(0))===47?"/":this.resolvePathWithBase(g,"."),j=y?this.resolvePathWithBase(S,y):S,N=f.params===!1||f.params===null?Object.create(null):(f.params??!0)===!0?p:Object.assign(p,il(f.params,p)),T=this.routesByPath[Kn(j)];let R;if(T)R=this.getRouteBranch(T);else if(j.includes("$"))R=[];else{const at=this.getMatchedRoutes(j);R=at.matchedRoutes,this.options.notFoundRoute&&(!at.foundRoute||at.foundRoute.path!=="/"&&at.routeParams["**"])&&(R=[...R,this.options.notFoundRoute])}if(R.length&&hg(N))for(const at of R){const lt=((I=at.options.params)==null?void 0:I.stringify)??at.options.stringifyParams;if(lt)try{Object.assign(N,lt(N))}catch{}}const M=s.leaveParams?j:Rs(vp({path:j,params:N,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let O=b;if(s._includeValidateSearch&&((nt=this.options.search)!=null&&nt.strict)){const at={};R.forEach(lt=>{if(lt.options.validateSearch)try{Object.assign(at,vc(lt.options.validateSearch,{...at,...O}))}catch{}}),O=at}O=Zb({search:O,dest:f,destRoutes:R,_includeValidateSearch:s._includeValidateSearch}),O=al(b,O);const Q=this.options.stringifySearch(O),w=f.hash===!0?m.hash:f.hash?il(f.hash,m.hash):void 0,K=w?`#${w}`:"";let B=f.state===!0?m.state:f.state?il(f.state,m.state):{};B=sl(m.state,B);const D=`${M}${Q}${K}`;let G,F,$=!1;if(this.rewrite){const at=new URL(D,this.origin),lt=Eg(this.rewrite,at);G=at.href.replace(at.origin,""),lt.origin!==this.origin?(F=lt.href,$=!0):F=lt.pathname+lt.search+lt.hash}else G=rb(D),F=G;return{publicHref:F,href:G,pathname:M,search:O,searchStr:Q,state:B,hash:w??"",external:$,unmaskOnReload:f.unmaskOnReload}},o=(f={},m)=>{const v=c(f);let g=m?c(m):void 0;if(!g){const y=Object.create(null);if(this.options.routeMasks){const b=hb(v.pathname,this.processedTree);if(b){Object.assign(y,b.rawParams);const{from:p,params:S,...j}=b.route,N=S===!1||S===null?Object.create(null):(S??!0)===!0?y:Object.assign(y,il(S,y));m={from:s.from,...j,params:N},g=c(m)}}}return g&&(v.maskedLocation=g),v};return s.mask?o(s,{from:s.from,...s.mask}):o(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:c,...o})=>{let f;const m=()=>{const y=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];y.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const b=gl(o.state,this.latestLocation.state);return y.forEach(p=>{delete o.state[p]}),b},v=Kn(this.latestLocation.href)===Kn(o.href);let g=this.commitLocationPromise;if(this.commitLocationPromise=Ti(()=>{g==null||g.resolve(),g=void 0}),v&&m())this.load();else{let{maskedLocation:y,hashScrollIntoView:b,...p}=o;y&&(p={...y,state:{...y.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=b??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,f=o.replace?"REPLACE":"PUSH",this.history[f==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:c})}return this._scroll.next=o.resetScroll??!0,this.history.subscribers.size||this.load(f?{action:{type:f}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:c,hashScrollIntoView:o,viewTransition:f,ignoreBlocker:m,href:v,...g}={})=>{if(v){const p=this.history.location.state.__TSR_index,S=_c(v,{__TSR_index:s?p:p+1}),j=new URL(S.pathname,this.origin);g.to=Mf(this.rewrite,j).pathname,g.search=this.options.parseSearch(S.search),g.hash=S.hash.slice(1)}const y=this.buildLocation({...g,_includeValidateSearch:!0});this.pendingBuiltLocation=y;const b=this.commitLocation({...y,viewTransition:f,replace:s,resetScroll:c,hashScrollIntoView:o,ignoreBlocker:m});return queueMicrotask(()=>{this.pendingBuiltLocation===y&&(this.pendingBuiltLocation=void 0)}),b},this.navigate=async({to:s,reloadDocument:c,href:o,publicHref:f,...m})=>{var g,y;let v=!1;if(o)try{new URL(`${o}`),v=!0}catch{}if(v&&!c&&(c=!0),c){if(s!==void 0||!o){const p=this.buildLocation({to:s,...m});o=o??p.publicHref,f=f??p.publicHref}const b=!v&&f?f:o;if(Nc(b,this.protocolAllowlist))return;if(!m.ignoreBlocker){const p=((y=(g=this.history).getBlockers)==null?void 0:y.call(g))??[];for(const S of p)if(S!=null&&S.blockerFn&&await S.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}m.replace?window.location.replace(b):window.location.href=b;return}return this.buildAndCommitLocation({...m,href:o,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),c=this.stores.cachedMatches.get().filter(o=>!s.some(f=>f.id===o.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(c)})},this.load=async s=>{var y;const c=(y=s==null?void 0:s.action)==null?void 0:y.type;let o,f,m;const v=this.stores.resolvedLocation.get()??this.stores.location.get();for(m=new Promise(b=>{this.startTransition(async()=>{var p;try{this.beforeLoad(),c?Cf.set(this.latestLocation,c):Cf.delete(this.latestLocation);const S=this.latestLocation,j=di(S,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...j}),this.emit({type:"onBeforeLoad",...j}),await Np({router:this,sync:s==null?void 0:s.sync,forceStaleReload:v.href===S.href,matches:this.stores.pendingMatches.get(),location:S,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var O,Q;let N=null,T=null,R=null,M=null;this.batch(()=>{const w=this.stores.pendingMatches.get(),K=w.length,B=this.stores.matches.get();N=K?B.filter(F=>!this.stores.pendingMatchStores.has(F.id)):null;const D=new Set;for(const F of this.stores.pendingMatchStores.values())F.routeId&&D.add(F.routeId);const G=new Set;for(const F of this.stores.matchStores.values())F.routeId&&G.add(F.routeId);T=K?B.filter(F=>!D.has(F.routeId)):null,R=K?w.filter(F=>!G.has(F.routeId)):null,M=K?w.filter(F=>G.has(F.routeId)):B,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),K&&(this.stores.setMatches(w),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...N.filter(F=>F.status!=="error"&&F.status!=="notFound"&&F.status!=="redirected")]),this.clearExpiredCache())});for(const[w,K]of[[T,"onLeave"],[R,"onEnter"],[M,"onStay"]])if(w)for(const B of w)(Q=(O=this.looseRoutesById[B.routeId].options)[K])==null||Q.call(O,B)})})}})}catch(S){we(S)?(o=S,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):ge(S)&&(f=S);const j=o?o.status:f?404:this.stores.matches.get().some(N=>N.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(j),this.stores.redirect.set(o)})}this.latestLoadPromise===m&&((p=this.commitLocationPromise)==null||p.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),b()})}),this.latestLoadPromise=m,await m;this.latestLoadPromise&&m!==this.latestLoadPromise;)await this.latestLoadPromise;let g;this.hasNotFoundMatch()?g=404:this.stores.matches.get().some(b=>b.status==="error")&&(g=500),g!==void 0&&this.stores.statusCode.set(g)},this.startViewTransition=s=>{const c=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,c&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof c=="object"&&this.isViewTransitionTypesSupported){const f=this.latestLocation,m=this.stores.resolvedLocation.get(),v=typeof c.types=="function"?c.types(di(f,m)):c.types;if(v===!1){s();return}o={update:s,types:v}}else o=s;document.startViewTransition(o)}else s()},this.updateMatch=(s,c)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStores.get(s);if(o){o.set(c);return}const f=this.stores.matchStores.get(s);if(f){f.set(c);return}const m=this.stores.cachedMatchStores.get(s);if(m){const v=c(m.get());v.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(g=>g.filter(y=>y!==s)):m.set(v)}})},this.getMatch=s=>{var c,o,f;return((c=this.stores.cachedMatchStores.get(s))==null?void 0:c.get())??((o=this.stores.pendingMatchStores.get(s))==null?void 0:o.get())??((f=this.stores.matchStores.get(s))==null?void 0:f.get())},this.invalidate=s=>{const c=o=>{var f;return((f=s==null?void 0:s.filter)==null?void 0:f.call(s,o))??!0?{...o,invalid:!0,...s!=null&&s.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(c)),this.stores.setCached(this.stores.cachedMatches.get().map(c)),this.stores.setPending(this.stores.pendingMatches.get().map(c))}),this.shouldViewTransition=!1,this.load({sync:s==null?void 0:s.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const c=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const o=s.options._builtLocation??this.buildLocation(s.options),f=this.getParsedLocationHref(o);s.options.href=f,s.headers.set("Location",f)}else if(c)try{const o=new URL(c);if(this.origin&&o.origin===this.origin){const f=o.pathname+o.search+o.hash;s.options.href=f,s.headers.set("Location",f)}}catch{}if(s.options.href&&!s.options._builtLocation&&Nc(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const c=s==null?void 0:s.filter;c!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(o=>!c(o))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),c=o=>{const f=this.looseRoutesById[o.routeId];if(!f.options.loader)return!0;const m=(o.preload?f.options.preloadGcTime??this.options.defaultPreloadGcTime:f.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:s-o.updatedAt>=m};this.clearCache({filter:c})},this.loadRouteChunk=Bs,this.preloadRoute=async s=>{const c=s._builtLocation??this.buildLocation(s);let o=this.matchRoutes(c,{throwOnError:!0,preload:!0,dest:s});const f=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),m=new Set([...f,...this.stores.cachedIds.get()]),v=o.filter(g=>!m.has(g.id));if(v.length){const g=this.stores.cachedMatches.get();this.stores.setCached([...g,...v])}try{return o=await Np({router:this,matches:o,location:c,preload:!0,updateMatch:(g,y)=>{f.has(g)?o=o.map(b=>b.id===g?y(b):b):this.updateMatch(g,y)}}),o}catch(g){if(we(g))return g.options.reloadDocument?void 0:await this.preloadRoute({...g.options,_fromLocation:c});ge(g)||console.error(g);return}},this.matchRoute=(s,c)=>{const o={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},f=this.buildLocation(o);if(c!=null&&c.pending&&this.stores.status.get()!=="pending")return!1;const m=((c==null?void 0:c.pending)===void 0?!this.stores.isLoading.get():c.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),v=mb(f.pathname,(c==null?void 0:c.caseSensitive)??!1,(c==null?void 0:c.fuzzy)??!1,m.pathname,this.processedTree);return!v||s.params&&!gl(v.rawParams,s.params,{partial:!0})?!1:(c==null?void 0:c.includeSearch)??!0?gl(m.search,f.search,{partial:!0})?v.rawParams:!1:v.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=i,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...l,caseSensitive:l.caseSensitive??!1,notFoundMode:l.notFoundMode??"fuzzy",stringifySearch:l.stringifySearch??Tb,parseSearch:l.parseSearch??Rb,protocolAllowlist:l.protocolAllowlist??cb}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:l,routesByPath:i,processedTree:s}){this.routesById=l,this.routesByPath=i,this.processedTree=s;const c=this.options.notFoundRoute;c&&(c.init({originalIndex:99999999999}),this.routesById[c.id]=c)}getRouteBranch(l){let i=this.routeBranchCache.get(l);return i||(i=gg(l),this.routeBranchCache.set(l,i)),i}get looseRoutesById(){return this.routesById}getParentContext(l){return l!=null&&l.id?l.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(l,i){var b,p;const s=this.getMatchedRoutes(l.pathname),{foundRoute:c,routeParams:o}=s;let{matchedRoutes:f}=s,m=!1;(c?c.path!=="/"&&o["**"]:Kn(l.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:m=!0);const v=m?Pb(this.options.notFoundMode,f):void 0,g=new Array(f.length),y=new Map;for(const S of this.stores.matchStores.values())S.routeId&&y.set(S.routeId,S.get());for(let S=0;Sthis.navigate({...w,_fromLocation:l}),buildLocation:this.buildLocation,cause:j.cause,abortController:j.abortController,preload:!!j.preload,matches:g,routeId:N.id};j.__routeContext=N.options.context(Q)??void 0}j.context={...O,...j.__routeContext,...j.__beforeLoadContext}}}return g}matchRoutesLightweight(l){var p;const i=Ds(this.stores.matchesId.get()),s=this.lightweightCache.get(l);if(s&&s[0]===i)return s[1];const{matchedRoutes:c,routeParams:o}=this.getMatchedRoutes(l.pathname),f=Ds(c),m={...l.search};for(const S of c)try{Object.assign(m,vc(S.options.validateSearch,m))}catch{}const v=i&&((p=this.stores.matchStores.get(i))==null?void 0:p.get()),g=v&&v.routeId===f.id&&v.pathname===l.pathname;let y;if(g)y=v.params;else{const S=Object.assign(Object.create(null),o);for(const j of c)try{Mp(j,S)}catch{}y=S}const b={matchedRoutes:c,fullPath:f.fullPath,search:m,params:y};return this.lightweightCache.set(l,[i,b]),b}},Rc=class extends Error{},Kb=class extends Error{};function Xb(l){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:l,matches:[],statusCode:200}}function vc(l,i){if(l==null)return{};if("~standard"in l){const s=l["~standard"].validate(i);if(s instanceof Promise)throw new Rc("Async validation not supported");if(s.issues)throw new Rc(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in l?l.parse(i):typeof l=="function"?l(i):{}}function Vb({pathname:l,routesById:i,processedTree:s}){const c=Object.create(null),o=Kn(l);let f;const m=yb(o,s,!0);return m&&(f=m.route,Object.assign(c,m.rawParams)),{matchedRoutes:(m==null?void 0:m.branch)||[i.__root__],routeParams:c,foundRoute:f}}function Zb({search:l,dest:i,destRoutes:s,_includeValidateSearch:c}){return Jb(s)(l,i,c??!1)}function Jb(l){var f;let i,s;const c=[];for(const m of l){const v=m.options;if("search"in v)(f=v.search)!=null&&f.middlewares&&c.push(...v.search.middlewares);else if(v.preSearchFilters||v.postSearchFilters){const y=({search:b,next:p})=>{const S=p(v.preSearchFilters?v.preSearchFilters.reduce((j,N)=>N(j),b):b);return v.postSearchFilters?v.postSearchFilters.reduce((j,N)=>N(j),S):S};c.push(y)}const g=v.validateSearch;if(g){const y=({search:b,next:p,meta:S})=>{const j=p(b);if(s)try{const N=vc(g,j);if(S&&N)for(const T in N)T in j||(S.defaulted||(S.defaulted=new Map)).set(T,N[T]);return{...j,...N}}catch{}return j};c.push(y)}}const o=(m,v,g)=>{if(m>=c.length){if(!i.search)return{};if(i.search===!0)return v;const b=il(i.search,v);return g&&(g.explicit=b),b}const y=(b,p)=>{if(p){const S=g||{};return{search:o(m+1,b,S),meta:S}}return o(m+1,b,g)};return c[m]({search:v,next:y,meta:g})};return function(v,g,y){return i=g,s=y,o(0,v)}}function Pb(l,i){if(l!=="root")for(let s=i.length-1;s>=0;s--){const c=i[s];if(c.children)return c.id}return vl}function Mp(l,i){var c;const s=((c=l.options.params)==null?void 0:c.parse)??l.options.parseParams;if(s){const o=s(i);if(o===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(i,o)}}function Fb(){try{return sessionStorage}catch{return}}const $b="tsr-scroll-restoration-v1_3",hi=Fb();function Ib(){try{return JSON.parse((hi==null?void 0:hi.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function Wb(){try{hi==null||hi.setItem($b,JSON.stringify(Na))}catch{}}const Na=Ib(),Cp="data-scroll-restoration-id",tS=l=>l.state.__TSR_key||l.href;function eS(l){const i=l.getAttribute(Cp);if(i)return`[${Cp}="${i}"]`;let s="",c=l,o;for(;o=c.parentNode;){let f=1,m=c;for(;m=m.previousElementSibling;)f++;const v=`${c.localName}:nth-child(${f})`;s=s?`${v} > ${s}`:v,c=o}return s}let hc=!1;const oi="window";function Af(l){try{return typeof l=="function"?l():document.querySelector(l)}catch{}}function Ap(l){const i=[];for(const s of l){if(s===oi)continue;const c=Af(s);c&&i.push(c)}return i}function nS(l,i){const s=l.options.scrollRestoration,c=l._scroll;s&&(c.restoring=!0);const o=l.options.getScrollRestorationKey||tS,f=new Map,m=(y,b,p)=>{const S=f.get(y)||{};S.scrollX=b,S.scrollY=p,f.set(y,S)},v=y=>{if(!(hc||!c.restoring))if(y.target===document)m(oi,scrollX,scrollY);else{const b=y.target;m(b,b.scrollLeft,b.scrollTop)}},g=y=>{if(!c.restoring)return;const b=Na[y]||(Na[y]={});for(const[p,S]of f)p===oi?b[oi]=S:p.isConnected&&(b[eS(p)]=S)};s&&!c.restoration&&(c.restoration=!0,hc=!1,history.scrollRestoration="manual",document.addEventListener("scroll",v,!0),l.subscribe("onBeforeLoad",y=>{y.fromLocation&&g(o(y.fromLocation)),f.clear()}),addEventListener("pagehide",()=>{g(o(l.stores.resolvedLocation.get()??l.stores.location.get())),Wb()})),!c.reset&&(c.reset=!0,l.subscribe("onRendered",y=>{var R;const b=l.options.scrollRestorationBehavior,p=l.options.scrollToTopSelectors,S=c.next;let j;if(f.clear(),S||(c.next=!0),typeof l.options.scrollRestoration=="function"&&!l.options.scrollRestoration({location:l.latestLocation}))return;const N=o(y.toLocation),T=y.fromLocation&&o(y.fromLocation);if(c.restoring&&T&&T!==N){const M=Na[T];if(M){let O=Na[N];for(const Q in M){if(Q===oi){if(S)continue}else{const w=Af(Q);if(!w||S&&p&&(j??(j=Ap(p)),j.includes(w)))continue}O||(O=Na[N]={}),O[Q]??(O[Q]=M[Q])}}}hc=!0;try{const M=y.toLocation.hash,O=y.toLocation.state.__hashScrollIntoViewOptions??!0;let Q=!1;if(S){const w=Cf.get(y.toLocation),K=M&&O&&(w==="PUSH"||w==="REPLACE"),B=c.restoring?Na[N]:void 0;if(B)for(const D in B){const{scrollX:G,scrollY:F}=B[D];if(D===oi){if(K)continue;scrollTo({top:F,left:G,behavior:b}),Q=!0}else{const $=Af(D);$&&($.scrollLeft=G,$.scrollTop=F)}}if(!Q&&!M){const D={top:0,left:0,behavior:b};if(scrollTo(D),p){j??(j=Ap(p));for(const G of j)G.scrollTo(D)}}}!Q&&M&&O&&((R=document.getElementById(M))==null||R.scrollIntoView(O))}finally{hc=!1}}))}const aS="Error preloading route! ☝️";var _g=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(l){if(this.init=i=>{var g,y;this.originalIndex=i.originalIndex;const s=this.options,c=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(y=(g=this.options).getParentRoute)==null?void 0:y.call(g),c?this._path=vl:this.parentRoute||Xn();let o=c?vl:s==null?void 0:s.path;o&&o!=="/"&&(o=vg(o));const f=(s==null?void 0:s.id)||o;let m=c?vl:pc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,f]);o==="__root__"&&(o="/"),m!=="__root__"&&(m=pc(["/",m]));const v=m==="__root__"?"/":pc([this.parentRoute.fullPath,o]);this._path=o,this._id=m,this._fullPath=v,this._to=Kn(v)},this.addChildren=i=>this._addFileChildren(i),this._addFileChildren=i=>(Array.isArray(i)&&(this.children=i),typeof i=="object"&&i!==null&&(this.children=Object.values(i)),this),this._addFileTypes=()=>this,this.updateLoader=i=>(Object.assign(this.options,i),this),this.update=i=>(Object.assign(this.options,i),this),this.lazy=i=>(this.lazyFn=i,this),this.redirect=i=>Ab({from:this.fullPath,...i}),this.options=l||{},this.isRoot=!(l!=null&&l.getParentRoute),l!=null&&l.id&&(l!=null&&l.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},lS=class extends _g{constructor(l){super(l)}};function Kf(l){const i=l.errorComponent??Xf;return h.jsx(iS,{getResetKey:l.getResetKey,onCatch:l.onCatch,children:({error:s,reset:c})=>s?P.createElement(i,{error:s,reset:c}):l.children})}var iS=class extends P.Component{constructor(...l){super(...l),this.state={error:null}}static getDerivedStateFromProps(l,i){const s=l.getResetKey();return i.error&&i.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(l){return{error:l}}reset(){this.setState({error:null})}componentDidCatch(l,i){this.props.onCatch&&this.props.onCatch(l,i)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Xf({error:l}){const[i,s]=P.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(c=>!c),children:i?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),i?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:l.message?h.jsx("code",{children:l.message}):null})}):null]})}function sS({children:l,fallback:i=null}){return Rg()?h.jsx(ws.Fragment,{children:l}):h.jsx(ws.Fragment,{children:i})}function Rg(){return ws.useSyncExternalStore(uS,()=>!0,()=>!1)}function uS(){return()=>{}}var Tg=P.createContext(null);function Ye(l){return P.useContext(Tg)}var Ac=P.createContext(void 0),cS=P.createContext(void 0),Xt=(l=>(l[l.None=0]="None",l[l.Mutable=1]="Mutable",l[l.Watching=2]="Watching",l[l.RecursedCheck=4]="RecursedCheck",l[l.Recursed=8]="Recursed",l[l.Dirty=16]="Dirty",l[l.Pending=32]="Pending",l))(Xt||{});function rS({update:l,notify:i,unwatched:s}){return{link:c,unlink:o,propagate:f,checkDirty:m,shallowPropagate:v};function c(y,b,p){const S=b.depsTail;if(S!==void 0&&S.dep===y)return;const j=S!==void 0?S.nextDep:b.deps;if(j!==void 0&&j.dep===y){j.version=p,b.depsTail=j;return}const N=y.subsTail;if(N!==void 0&&N.version===p&&N.sub===b)return;const T=b.depsTail=y.subsTail={version:p,dep:y,sub:b,prevDep:S,nextDep:j,prevSub:N,nextSub:void 0};j!==void 0&&(j.prevDep=T),S!==void 0?S.nextDep=T:b.deps=T,N!==void 0?N.nextSub=T:y.subs=T}function o(y,b=y.sub){const p=y.dep,S=y.prevDep,j=y.nextDep,N=y.nextSub,T=y.prevSub;return j!==void 0?j.prevDep=S:b.depsTail=S,S!==void 0?S.nextDep=j:b.deps=j,N!==void 0?N.prevSub=T:p.subsTail=T,T!==void 0?T.nextSub=N:(p.subs=N)===void 0&&s(p),j}function f(y){let b=y.nextSub,p;t:do{const S=y.sub;let j=S.flags;if(j&60?j&12?j&4?!(j&48)&&g(y,S)?(S.flags=j|40,j&=1):j=0:S.flags=j&-9|32:j=0:S.flags=j|32,j&2&&i(S),j&1){const N=S.subs;if(N!==void 0){const T=(y=N).nextSub;T!==void 0&&(p={value:b,prev:p},b=T);continue}}if((y=b)!==void 0){b=y.nextSub;continue}for(;p!==void 0;)if(y=p.value,p=p.prev,y!==void 0){b=y.nextSub;continue t}break}while(!0)}function m(y,b){let p,S=0,j=!1;t:do{const N=y.dep,T=N.flags;if(b.flags&16)j=!0;else if((T&17)===17){if(l(N)){const R=N.subs;R.nextSub!==void 0&&v(R),j=!0}}else if((T&33)===33){(y.nextSub!==void 0||y.prevSub!==void 0)&&(p={value:y,prev:p}),y=N.deps,b=N,++S;continue}if(!j){const R=y.nextDep;if(R!==void 0){y=R;continue}}for(;S--;){const R=b.subs,M=R.nextSub!==void 0;if(M?(y=p.value,p=p.prev):y=R,j){if(l(b)){M&&v(R),b=y.sub;continue}j=!1}else b.flags&=-33;b=y.sub;const O=y.nextDep;if(O!==void 0){y=O;continue t}}return j}while(!0)}function v(y){do{const b=y.sub,p=b.flags;(p&48)===32&&(b.flags=p|16,(p&6)===2&&i(b))}while((y=y.nextSub)!==void 0)}function g(y,b){let p=b.depsTail;for(;p!==void 0;){if(p===y)return!0;p=p.prevDep}return!1}}function oS(l,i,s){var f,m,v;const c=typeof l=="object",o=c?l:void 0;return{next:(f=c?l.next:l)==null?void 0:f.bind(o),error:(m=c?l.error:i)==null?void 0:m.bind(o),complete:(v=c?l.complete:s)==null?void 0:v.bind(o)}}const wf=[];let xc=0;const{link:wp,unlink:fS,propagate:dS,checkDirty:Mg,shallowPropagate:Op}=rS({update(l){return l._update()},notify(l){wf[Of++]=l,l.flags&=~Xt.Watching},unwatched(l){l.depsTail!==void 0&&(l.depsTail=void 0,l.flags=Xt.Mutable|Xt.Dirty,Tc(l))}});let mc=0,Of=0,hn,zf=0;function Cg(l){try{++zf,l()}finally{--zf||Ag()}}function Tc(l){const i=l.depsTail;let s=i!==void 0?i.nextDep:l.deps;for(;s!==void 0;)s=fS(s,l)}function Ag(){if(!(zf>0)){for(;mc{var y;o.get(),v.current?(y=m.next)==null||y.call(m,o._snapshot):v.current=!0});return{unsubscribe:()=>{g.stop()}}},_update(f){const m=hn,v=(i==null?void 0:i.compare)??Object.is;if(s)hn=o,++xc,o.depsTail=void 0;else if(f===void 0)return!1;s&&(o.flags=Xt.Mutable|Xt.RecursedCheck);try{const g=o._snapshot,y=typeof f=="function"?f(g):f===void 0&&s?c(g):f;return g===void 0||!v(g,y)?(o._snapshot=y,!0):!1}finally{hn=m,s&&(o.flags&=~Xt.RecursedCheck),Tc(o)}}};return s?(o.flags=Xt.Mutable|Xt.Dirty,o.get=function(){const f=o.flags;if(f&Xt.Dirty||f&Xt.Pending&&Mg(o.deps,o)){if(o._update()){const m=o.subs;m!==void 0&&Op(m)}}else f&Xt.Pending&&(o.flags=f&~Xt.Pending);return hn!==void 0&&wp(o,hn,xc),o._snapshot}):o.set=function(f){if(o._update(f)){const m=o.subs;m!==void 0&&(dS(m),Op(m),Ag())}},o}function hS(l){const i=()=>{const c=hn;hn=s,++xc,s.depsTail=void 0,s.flags=Xt.Watching|Xt.RecursedCheck;try{return l()}finally{hn=c,s.flags&=~Xt.RecursedCheck,Tc(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Xt.Watching|Xt.RecursedCheck,notify(){const c=this.flags;c&Xt.Dirty||c&Xt.Pending&&Mg(this.deps,this)?i():this.flags=Xt.Watching},stop(){this.flags=Xt.None,this.depsTail=void 0,Tc(this)}};return i(),s}var sf={exports:{}},uf={},cf={exports:{}},rf={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Dp;function mS(){if(Dp)return rf;Dp=1;var l=Ks();function i(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}var s=typeof Object.is=="function"?Object.is:i,c=l.useState,o=l.useEffect,f=l.useLayoutEffect,m=l.useDebugValue;function v(p,S){var j=S(),N=c({inst:{value:j,getSnapshot:S}}),T=N[0].inst,R=N[1];return f(function(){T.value=j,T.getSnapshot=S,g(T)&&R({inst:T})},[p,j,S]),o(function(){return g(T)&&R({inst:T}),p(function(){g(T)&&R({inst:T})})},[p]),m(j),j}function g(p){var S=p.getSnapshot;p=p.value;try{var j=S();return!s(p,j)}catch{return!0}}function y(p,S){return S()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:v;return rf.useSyncExternalStore=l.useSyncExternalStore!==void 0?l.useSyncExternalStore:b,rf}var Up;function yS(){return Up||(Up=1,cf.exports=mS()),cf.exports}/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Lp;function pS(){if(Lp)return uf;Lp=1;var l=Ks(),i=yS();function s(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var c=typeof Object.is=="function"?Object.is:s,o=i.useSyncExternalStore,f=l.useRef,m=l.useEffect,v=l.useMemo,g=l.useDebugValue;return uf.useSyncExternalStoreWithSelector=function(y,b,p,S,j){var N=f(null);if(N.current===null){var T={hasValue:!1,value:null};N.current=T}else T=N.current;N=v(function(){function M(B){if(!O){if(O=!0,Q=B,B=S(B),j!==void 0&&T.hasValue){var D=T.value;if(j(D,B))return w=D}return w=B}if(D=w,c(Q,B))return D;var G=S(B);return j!==void 0&&j(D,G)?(Q=B,D):(Q=B,w=G)}var O=!1,Q,w,K=p===void 0?null:p;return[function(){return M(b())},K===null?void 0:function(){return M(K())}]},[b,p,S,j]);var R=o(y,N[0],N[1]);return m(function(){T.hasValue=!0,T.value=R},[R]),g(R),R},uf}var Bp;function gS(){return Bp||(Bp=1,sf.exports=pS()),sf.exports}var vS=gS();function xS(l,i){return l===i}function Se(l,i,s=xS){const c=P.useCallback(m=>{if(!l)return()=>{};const{unsubscribe:v}=l.subscribe(m);return v},[l]),o=P.useCallback(()=>l==null?void 0:l.get(),[l]);return vS.useSyncExternalStoreWithSelector(c,o,o,i,s)}var of={get(){},subscribe(){return{unsubscribe(){}}}};function wg(l,i){const s=P.useRef();return c=>{const o=l!=null&&l.select?l.select(c):c;return(l==null?void 0:l.structuralSharing)??i.options.defaultStructuralSharing?s.current=sl(s.current,o):o}}function Sl(l){const i=Ye(),s=P.useContext(l.from?cS:Ac),c=l.from?i.stores.getRouteMatchStore(l.from):i.stores.matchStores.get(s),o=wg(l,i),f=Se(c??of,m=>m?o(m):of);if(f!==of)return f;(l.shouldThrow??!0)&&Xn()}function Og(l){return Sl({from:l.from,strict:l.strict,structuralSharing:l.structuralSharing,select:i=>l.select?l.select(i.loaderData):i.loaderData})}function zg(l){const{select:i,...s}=l;return Sl({...s,select:c=>i?i(c.loaderDeps):c.loaderDeps})}function Vf(l){return Sl({from:l.from,shouldThrow:l.shouldThrow,structuralSharing:l.structuralSharing,strict:l.strict,select:i=>{const s=l.strict===!1?i.params:i._strictParams;return l.select?l.select(s):s}})}function Dg(l){return Sl({from:l.from,strict:l.strict,shouldThrow:l.shouldThrow,structuralSharing:l.structuralSharing,select:i=>l.select?l.select(i.search):i.search})}function Ug(l){const i=Ye();return P.useCallback(s=>i.navigate({...s,from:s.from??(l==null?void 0:l.from)}),[l==null?void 0:l.from,i])}function Lg(l){return Sl({...l,select:i=>l.select?l.select(i.context):i.context})}var bS=Ip();function SS(l,i){const s=Ye(),c=ab(i),{activeProps:o,inactiveProps:f,activeOptions:m,to:v,preload:g,preloadDelay:y,preloadIntentProximity:b,hashScrollIntoView:p,replace:S,startTransition:j,resetScroll:N,viewTransition:T,children:R,target:M,disabled:O,style:Q,className:w,onClick:K,onBlur:B,onFocus:D,onMouseEnter:G,onMouseLeave:F,onTouchStart:$,ignoreBlocker:I,params:nt,search:at,hash:lt,state:gt,mask:H,reloadDocument:V,unsafeRelative:ut,from:Mt,_fromLocation:At,...A}=l,Z=Rg(),W=P.useMemo(()=>l,[s,l.from,l._fromLocation,l.hash,l.to,l.search,l.params,l.state,l.mask,l.unsafeRelative]),et=Se(s.stores.location,Dt=>Dt,(Dt,ue)=>Dt.href===ue.href),ct=P.useMemo(()=>{const Dt={_fromLocation:et,...W};return s.buildLocation(Dt)},[s,et,W]),pt=ct.maskedLocation?ct.maskedLocation.publicHref:ct.publicHref,_t=ct.maskedLocation?ct.maskedLocation.external:ct.external,kt=P.useMemo(()=>TS(pt,_t,s.history,O),[O,_t,pt,s.history]),qt=P.useMemo(()=>{if(kt!=null&&kt.external)return Nc(kt.href,s.protocolAllowlist)?void 0:kt.href;if(!MS(v)&&!(typeof v!="string"||v.indexOf(":")===-1))try{return new URL(v),Nc(v,s.protocolAllowlist)?void 0:v}catch{}},[v,kt,s.protocolAllowlist]),gn=P.useMemo(()=>{if(qt)return!1;if(m!=null&&m.exact){if(!Sb(et.pathname,ct.pathname,s.basepath))return!1}else{const Dt=Ec(et.pathname,s.basepath),ue=Ec(ct.pathname,s.basepath);if(!(Dt.startsWith(ue)&&(Dt.length===ue.length||Dt[ue.length]==="/")))return!1}return((m==null?void 0:m.includeSearch)??!0)&&!gl(et.search,ct.search,{partial:!(m!=null&&m.exact),ignoreUndefined:!(m!=null&&m.explicitUndefined)})?!1:m!=null&&m.includeHash?Z&&et.hash===ct.hash:!0},[m==null?void 0:m.exact,m==null?void 0:m.explicitUndefined,m==null?void 0:m.includeHash,m==null?void 0:m.includeSearch,et,qt,Z,ct.hash,ct.pathname,ct.search,s.basepath]),vn=gn?il(o,{})??jS:ff,Pn=gn?ff:il(f,{})??ff,Ci=[w,vn.className,Pn.className].filter(Boolean).join(" "),un=(Q||vn.style||Pn.style)&&{...Q,...vn.style,...Pn.style},[Ai,Nl]=P.useState(!1),Xs=P.useRef(!1),xn=l.reloadDocument||qt?!1:g??s.options.defaultPreload,qa=y??s.options.defaultPreloadDelay??0,en=P.useCallback(()=>{s.preloadRoute({...W,_builtLocation:ct}).catch(Dt=>{console.warn(Dt),console.warn(aS)})},[s,W,ct]);nb(c,P.useCallback(Dt=>{Dt!=null&&Dt.isIntersecting&&en()},[en]),RS,{disabled:!!O||xn!=="viewport"}),P.useEffect(()=>{Xs.current||!O&&xn==="render"&&(en(),Xs.current=!0)},[O,en,xn]);const wi=Dt=>{const ue=Dt.currentTarget.getAttribute("target"),cn=M!==void 0?M:ue;if(!O&&!CS(Dt)&&!Dt.defaultPrevented&&(!cn||cn==="_self")&&Dt.button===0){Dt.preventDefault(),bS.flushSync(()=>{Nl(!0)});const El=s.subscribe("onResolved",()=>{El(),Nl(!1)});s.navigate({...W,replace:S,resetScroll:N,hashScrollIntoView:p,startTransition:j,viewTransition:T,ignoreBlocker:I})}};if(qt)return{...A,ref:c,href:qt,...R&&{children:R},...M&&{target:M},...O&&{disabled:O},...Q&&{style:Q},...w&&{className:w},...K&&{onClick:K},...B&&{onBlur:B},...D&&{onFocus:D},...G&&{onMouseEnter:G},...F&&{onMouseLeave:F},...$&&{onTouchStart:$}};const Vs=Dt=>{if(O||xn!=="intent")return;if(!qa){en();return}const ue=Dt.currentTarget;if(Ms.has(ue))return;const cn=setTimeout(()=>{Ms.delete(ue),en()},qa);Ms.set(ue,cn)},wc=Dt=>{O||xn!=="intent"||en()},me=Dt=>{if(O||!xn||!qa)return;const ue=Dt.currentTarget,cn=Ms.get(ue);cn&&(clearTimeout(cn),Ms.delete(ue))};return{...A,...vn,...Pn,href:kt==null?void 0:kt.href,ref:c,onClick:ri([K,wi]),onBlur:ri([B,me]),onFocus:ri([D,Vs]),onMouseEnter:ri([G,Vs]),onMouseLeave:ri([F,me]),onTouchStart:ri([$,wc]),disabled:!!O,target:M,...un&&{style:un},...Ci&&{className:Ci},...O&&NS,...gn&&ES,...Z&&Ai&&_S}}var ff={},jS={className:"active"},NS={role:"link","aria-disabled":!0},ES={"data-status":"active","aria-current":"page"},_S={"data-transitioning":"transitioning"},Ms=new WeakMap,RS={rootMargin:"100px"},ri=l=>i=>{for(const s of l)if(s){if(i.defaultPrevented)return;s(i)}};function TS(l,i,s,c){if(!c)return i?{href:l,external:!0}:{href:s.createHref(l)||"/",external:!1}}function MS(l){if(typeof l!="string")return!1;const i=l.charCodeAt(0);return i===47?l.charCodeAt(1)!==47:i===46}var Zn=P.forwardRef((l,i)=>{const{_asChild:s,...c}=l,{type:o,...f}=SS(c,i),m=typeof c.children=="function"?c.children({isActive:f["data-status"]==="active"}):c.children;if(!s){const{disabled:v,...g}=f;return P.createElement("a",g,m)}return P.createElement(s,f,m)});function CS(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}var AS=class extends _g{constructor(l){super(l),this.useMatch=i=>Sl({select:i==null?void 0:i.select,from:this.id,structuralSharing:i==null?void 0:i.structuralSharing}),this.useRouteContext=i=>Lg({...i,from:this.id}),this.useSearch=i=>Dg({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useParams=i=>Vf({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useLoaderDeps=i=>zg({...i,from:this.id}),this.useLoaderData=i=>Og({...i,from:this.id}),this.useNavigate=()=>Ug({from:this.fullPath}),this.Link=ws.forwardRef((i,s)=>h.jsx(Zn,{ref:s,from:this.fullPath,...i}))}};function Sa(l){return new AS(l)}var wS=class extends lS{constructor(l){super(l),this.useMatch=i=>Sl({select:i==null?void 0:i.select,from:this.id,structuralSharing:i==null?void 0:i.structuralSharing}),this.useRouteContext=i=>Lg({...i,from:this.id}),this.useSearch=i=>Dg({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useParams=i=>Vf({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useLoaderDeps=i=>zg({...i,from:this.id}),this.useLoaderData=i=>Og({...i,from:this.id}),this.useNavigate=()=>Ug({from:this.fullPath}),this.Link=ws.forwardRef((i,s)=>h.jsx(Zn,{ref:s,from:this.fullPath,...i}))}};function OS(l){return new wS(l)}function zS(l){const i=Ye(),s=`not-found-${Se(i.stores.location,c=>c.pathname)}-${Se(i.stores.status,c=>c)}`;return h.jsx(Kf,{getResetKey:()=>s,onCatch:(c,o)=>{var f;if(ge(c))(f=l.onCatch)==null||f.call(l,c,o);else throw c},errorComponent:({error:c})=>{var o;if(ge(c))return(o=l.fallback)==null?void 0:o.call(l,c);throw c},children:l.children})}function DS(){return h.jsx("p",{children:"Not Found"})}function fi(l){return h.jsx(h.Fragment,{children:l.children})}function Bg(l,i,s){return i.options.notFoundComponent?h.jsx(i.options.notFoundComponent,{...s}):l.options.defaultNotFoundComponent?h.jsx(l.options.defaultNotFoundComponent,{...s}):h.jsx(DS,{})}function US(l){return null}function LS(){return US(Ye()),null}var BS=(l,i)=>l.routeId===i.routeId&&l._displayPending===i._displayPending,qS=(l,i)=>l[0]===i[0]&&l[1]===i[1],qg=P.memo(function({matchId:i}){const s=Ye(),c=s.stores.matchStores.get(i);c||Xn();const o=Se(s.stores.loadedAt,m=>m),f=Se(c,m=>m,BS);return h.jsx(HS,{router:s,matchId:i,resetKey:o,matchState:P.useMemo(()=>{var g;const m=f.routeId,v=(g=s.routesById[m].parentRoute)==null?void 0:g.id;return{routeId:m,ssr:f.ssr,_displayPending:f._displayPending,parentRouteId:v}},[f._displayPending,f.routeId,f.ssr,s.routesById])})});function HS({router:l,matchId:i,resetKey:s,matchState:c}){var N,T;const o=l.routesById[c.routeId],f=o.options.pendingComponent??l.options.defaultPendingComponent,m=f?h.jsx(f,{}):null,v=o.options.errorComponent??l.options.defaultErrorComponent,g=o.options.onCatch??l.options.defaultOnCatch,y=o.isRoot?o.options.notFoundComponent??((N=l.options.notFoundRoute)==null?void 0:N.options.component):o.options.notFoundComponent,b=c.ssr===!1||c.ssr==="data-only",p=(!o.isRoot||o.options.wrapInSuspense||b)&&(o.options.wrapInSuspense??f??(((T=o.options.errorComponent)==null?void 0:T.preload)||b))?P.Suspense:fi,S=v?Kf:fi,j=y?zS:fi;return h.jsxs(o.isRoot?o.options.shellComponent??fi:fi,{children:[h.jsx(Ac.Provider,{value:i,children:h.jsx(p,{fallback:m,children:h.jsx(S,{getResetKey:()=>s,errorComponent:v||Xf,onCatch:(R,M)=>{if(ge(R))throw R.routeId??(R.routeId=c.routeId),R;g==null||g(R,M)},children:h.jsx(j,{fallback:R=>{if(R.routeId??(R.routeId=c.routeId),!y||R.routeId&&R.routeId!==c.routeId||!R.routeId&&!o.isRoot)throw R;return P.createElement(y,R)},children:b||c._displayPending?h.jsx(sS,{fallback:m,children:h.jsx(qp,{matchId:i})}):h.jsx(qp,{matchId:i})})})})}),c.parentRouteId===vl?h.jsxs(h.Fragment,{children:[h.jsx(kS,{}),l.options.scrollRestoration&&fg?h.jsx(LS,{}):null]}):null]})}function kS(){const l=Ye(),i=P.useRef();return As(()=>{const s=l.stores.resolvedLocation.get(),c=i.current;s&&(!c||c.href!==s.href)&&l.emit({type:"onRendered",...di(l.stores.location.get(),c??s)}),i.current=s},[Se(l.stores.resolvedLocation,s=>s==null?void 0:s.state.__TSR_key),l]),null}var qp=P.memo(function({matchId:i}){const s=Ye(),c=(b,p)=>{var S;return((S=s.getMatch(b.id))==null?void 0:S._nonReactive[p])??b._nonReactive[p]},o=s.stores.matchStores.get(i);o||Xn();const f=Se(o,b=>b),m=f.routeId,v=s.routesById[m],g=P.useMemo(()=>{var p;const b=(p=s.routesById[m].options.remountDeps??s.options.defaultRemountDeps)==null?void 0:p({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return b?JSON.stringify(b):void 0},[m,f.loaderDeps,f._strictParams,f._strictSearch,s.options.defaultRemountDeps,s.routesById]),y=P.useMemo(()=>{const b=v.options.component??s.options.defaultComponent;return b?h.jsx(b,{},g):h.jsx(Hg,{})},[g,v.options.component,s.options.defaultComponent]);if(f._displayPending)throw c(f,"displayPendingPromise");if(f._forcePending)throw c(f,"minPendingPromise");if(f.status==="pending"){const b=v.options.pendingMinMs??s.options.defaultPendingMinMs;if(b){const p=s.getMatch(f.id);if(p&&!p._nonReactive.minPendingPromise){const S=Ti();p._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),p._nonReactive.minPendingPromise=void 0},b)}}throw c(f,"loadPromise")}if(f.status==="notFound")return ge(f.error)||Xn(),Bg(s,v,f.error);if(f.status==="redirected")throw we(f.error)||Xn(),c(f,"loadPromise");if(f.status==="error")throw f.error;return y}),Hg=P.memo(function(){const i=Ye(),s=P.useContext(Ac);let c,o=!1,f;{const y=s?i.stores.matchStores.get(s):void 0;[c,o]=Se(y,b=>[b==null?void 0:b.routeId,(b==null?void 0:b.globalNotFound)??!1],qS),f=Se(i.stores.matchesId,b=>b[b.findIndex(p=>p===s)+1])}const m=c?i.routesById[c]:void 0,v=i.options.defaultPendingComponent?h.jsx(i.options.defaultPendingComponent,{}):null;if(o)return m||Xn(),Bg(i,m,void 0);if(!f)return null;const g=h.jsx(qg,{matchId:f});return c===vl?h.jsx(P.Suspense,{fallback:v,children:g}):g});function QS(){const l=Ye(),i=P.useRef({router:l,mounted:!1}),[s,c]=P.useState(!1),o=Se(l.stores.isLoading,p=>p),f=Se(l.stores.hasPending,p=>p),m=Io(o),v=o||s||f,g=Io(v),y=o||f,b=Io(y);return l.startTransition=p=>{c(!0),P.startTransition(()=>{p(),c(!1)})},P.useEffect(()=>{const p=l.history.subscribe(l.load),S=l.buildLocation({to:l.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Kn(l.latestLocation.publicHref)!==Kn(S.publicHref)&&l.commitLocation({...S,replace:!0}),()=>{p()}},[l,l.history]),As(()=>{if(typeof window<"u"&&l.ssr||i.current.router===l&&i.current.mounted)return;i.current={router:l,mounted:!0},(async()=>{try{await l.load()}catch(S){console.error(S)}})()},[l]),As(()=>{m&&!o&&l.emit({type:"onLoad",...di(l.stores.location.get(),l.stores.resolvedLocation.get())})},[m,l,o]),As(()=>{b&&!y&&l.emit({type:"onBeforeRouteMount",...di(l.stores.location.get(),l.stores.resolvedLocation.get())})},[y,b,l]),As(()=>{if(g&&!v){const p=di(l.stores.location.get(),l.stores.resolvedLocation.get());l.emit({type:"onResolved",...p}),Cg(()=>{l.stores.status.set("idle"),l.stores.resolvedLocation.set(l.stores.location.get())})}},[v,g,l]),null}function GS(){const l=Ye(),i=l.routesById[vl].options.pendingComponent??l.options.defaultPendingComponent,s=i?h.jsx(i,{}):null,c=h.jsxs(typeof document<"u"&&l.ssr?fi:P.Suspense,{fallback:s,children:[h.jsx(QS,{}),h.jsx(YS,{})]});return l.options.InnerWrap?h.jsx(l.options.InnerWrap,{children:c}):c}function YS(){const l=Ye(),i=Se(l.stores.firstId,o=>o),s=Se(l.stores.loadedAt,o=>o),c=i?h.jsx(qg,{matchId:i}):null;return h.jsx(Ac.Provider,{value:i,children:l.options.disableGlobalCatchBoundary?c:h.jsx(Kf,{getResetKey:()=>s,errorComponent:Xf,onCatch:void 0,children:c})})}var KS=l=>({createMutableStore:zp,createReadonlyStore:zp,batch:Cg}),XS=l=>new VS(l),VS=class extends Yb{constructor(l){super(l,KS)}};function ZS({router:l,children:i,...s}){hg(s)&&l.update({...l.options,...s,context:{...l.options.context,...s.context}});const c=h.jsx(Tg.Provider,{value:l,children:i});return l.options.Wrap?h.jsx(l.options.Wrap,{children:c}):c}function JS({router:l,...i}){return h.jsx(ZS,{router:l,...i,children:h.jsx(GS,{})})}function PS(l){const i=Ye({warn:(l==null?void 0:l.router)===void 0}),s=(l==null?void 0:l.router)||i;return Se(s.stores.__store,wg(l,s))}async function kg(l){if(!l.ok){let i=`${l.status}`;try{const s=await l.json();s.error&&(i=s.error)}catch{}throw new Error(i)}return l.json()}async function Yt(l,i){const s=await fetch(l,{headers:{"Content-Type":"application/json"},...i});return kg(s)}async function FS(l,i){const s=await fetch(l,{method:"POST",body:i});return kg(s)}async function $S(l,i){const s=await fetch(l,{headers:{"Content-Type":"application/json"},...i});if(!s.ok){let c=`${s.status}`;try{const o=await s.json();o.error&&(c=o.error)}catch{}throw new Error(c)}return s.blob()}const Et={overview:()=>Yt("/api/overview"),status:()=>Yt("/api/status"),artifacts:()=>Yt("/api/artifacts"),artifact:l=>Yt(`/api/artifacts/${l}`),diff:l=>{const i=new URLSearchParams;return l.artifact&&i.set("artifact",l.artifact),l.agent&&i.set("agent",l.agent),Yt(`/api/diff?${i}`)},syncPlan:()=>Yt("/api/sync/plan",{method:"POST",body:"{}"}),syncApply:l=>Yt("/api/sync/apply",{method:"POST",body:JSON.stringify({token:l})}),sources:()=>Yt("/api/sources"),sourcesAdd:l=>Yt("/api/sources/add",{method:"POST",body:JSON.stringify(l)}),sourcesCheck:()=>Yt("/api/sources/check",{method:"POST",body:"{}"}),wizardSchema:()=>Yt("/api/wizard/schema"),wizardPresets:()=>Yt("/api/wizard/presets"),wizardPlan:(l,i)=>Yt("/api/wizard/plan",{method:"POST",body:JSON.stringify({answers:l,preset:i})}),wizardGenerate:(l,i)=>Yt("/api/wizard/generate",{method:"POST",body:JSON.stringify({answers:l,preset:i})}),profiles:()=>Yt("/api/profiles"),profile:l=>Yt(`/api/profiles/${l}`),saveProfile:(l,i)=>Yt("/api/profiles",{method:"POST",body:JSON.stringify({name:l,answers:i})}),deleteProfile:l=>Yt(`/api/profiles/${l}`,{method:"DELETE"}),libraryInstructions:()=>Yt("/api/library/instructions"),libraryAdd:l=>Yt("/api/library/instructions",{method:"POST",body:JSON.stringify({text:l})}),libraryRemove:l=>Yt(`/api/library/instructions/${l}`,{method:"DELETE"}),libraryGroups:()=>Yt("/api/library/groups"),libraryGroupSave:(l,i)=>Yt("/api/library/groups",{method:"POST",body:JSON.stringify({name:l,entryIds:i})}),libraryGroupRemove:l=>Yt(`/api/library/groups/${l}`,{method:"DELETE"}),bundleExportSelected:l=>$S("/api/bundle/export",{method:"POST",body:JSON.stringify(l)}),bundleImportPlan:l=>{const i=new FormData;return i.set("bundle",l),FS("/api/bundle/import/plan",i)},bundleImportApply:(l,i)=>Yt("/api/bundle/import/apply",{method:"POST",body:JSON.stringify({token:l,overwrite:i})})};function IS(){var y;const l=Jn(),[i,s]=P.useState(null),[c,o]=P.useState(null),f=se({queryKey:["overview"],queryFn:Et.overview}),m=he({mutationFn:Et.syncPlan,onSuccess:b=>{s(b),o(null)}}),v=he({mutationFn:b=>Et.syncApply(b),onSuccess:b=>{o(b.applied),s(null),l.invalidateQueries()}}),g=((y=f.data)==null?void 0:y.pending)??0;return g===0&&!i&&c===null?null:h.jsx("div",{className:"fixed inset-x-0 bottom-0 z-10",children:h.jsx("div",{className:"mx-auto max-w-6xl px-6 pb-5",children:h.jsx("div",{className:"dock-up rounded-xs border border-line-strong bg-raised shadow-[0_-12px_48px_oklch(0.08_0.01_60/0.7)]",children:c!==null&&!i?h.jsxs("div",{className:"flex items-center justify-between px-5 py-3",children:[h.jsxs("p",{className:"stamp text-sm text-sync",children:[h.jsx("span",{className:"mr-2 font-mono text-[10px]",children:"■"}),"Applied ",c," change",c===1?"":"s",". Agents are up to date."]}),h.jsx("button",{onClick:()=>o(null),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"dismiss"})]}):i?h.jsxs("div",{className:"px-5 py-4",children:[h.jsxs("div",{className:"flex items-baseline justify-between",children:[h.jsxs("p",{className:"font-display text-sm font-semibold uppercase tracking-wider text-ink",children:["Requisition — ",i.changes.length," change",i.changes.length===1?"":"s"]}),h.jsxs("p",{className:"font-mono text-[11px] text-ink-faint",children:["plan ",h.jsx("span",{className:"text-ember",children:i.token.slice(0,8)})]})]}),h.jsx("ul",{className:"mt-3 max-h-44 space-y-1 overflow-y-auto pr-1",children:i.changes.map((b,p)=>h.jsxs("li",{className:"rise flex items-center gap-3 font-mono text-xs",style:{"--i":Math.min(p,10)},children:[h.jsx("span",{className:`w-16 whitespace-nowrap ${b.op==="create"?"text-sync":"text-warn"}`,children:b.op==="create"?"+ new":"~ "+b.op}),h.jsx("span",{className:"text-ink-dim",children:b.agent}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:b.relPath}),h.jsx("span",{className:"text-ink-faint",children:b.artifact})]},p))}),h.jsxs("div",{className:"mt-4 flex items-center gap-3 border-t border-line pt-3",children:[h.jsx("button",{onClick:()=>v.mutate(i.token),disabled:v.isPending,className:"btn-ember",children:v.isPending?"Applying…":`Apply ${i.changes.length}`}),h.jsx("button",{onClick:()=>s(null),className:"px-2 py-1.5 text-sm text-ink-dim transition-colors hover:text-ink",children:"Cancel — write nothing"}),v.isError?h.jsx("span",{className:"text-xs text-danger",children:String(v.error)}):null]})]}):h.jsxs("div",{className:"flex items-center justify-between px-5 py-3",children:[h.jsxs("p",{className:"text-sm text-ink-dim",children:[h.jsx("span",{"aria-hidden":!0,className:"ember-pulse mr-2.5 inline-block h-2 w-2 bg-ember align-baseline"}),h.jsx("span",{className:"tnum font-medium text-ink",children:g})," pending change",g===1?"":"s"," across your agents"]}),h.jsx("button",{onClick:()=>m.mutate(),disabled:m.isPending,className:"btn-outline",children:m.isPending?"Planning…":"Review & apply"})]})})})})}const Qg=[{to:"/",label:"Overview"},{to:"/store",label:"Store"},{to:"/agents",label:"Agents"},{to:"/sources",label:"Sources"},{to:"/builder",label:"Builder"},{to:"/library",label:"Library"},{to:"/export",label:"Export"}],Hp=36;function WS(l){return l==="/"?0:Qg.findIndex(s=>s.to!=="/"&&l.startsWith(s.to))}function t1(){const l=[{x:1,y:1,ember:!0},{x:12,y:1,ember:!1},{x:1,y:12,ember:!1},{x:12,y:12,ember:!0}];return h.jsx("svg",{viewBox:"0 0 22 22",className:"h-6 w-6","aria-hidden":!0,children:l.map((i,s)=>h.jsx("rect",{x:i.x,y:i.y,width:"9",height:"9",className:"stamp",style:{animationDelay:`${120+s*90}ms`},fill:i.ember?"var(--color-ember)":"var(--color-line-strong)"},s))})}function e1(){const l=PS({select:s=>s.location.pathname}),i=WS(l);return h.jsxs("div",{className:"min-h-screen",children:[h.jsxs("div",{className:"mx-auto flex max-w-6xl gap-14 px-6 pb-40 pt-10",children:[h.jsx("aside",{className:"w-48 shrink-0",children:h.jsxs("div",{className:"sticky top-10",children:[h.jsxs(Zn,{to:"/",className:"flex select-none items-center gap-3",children:[h.jsx(t1,{}),h.jsxs("span",{children:[h.jsxs("span",{className:"block font-display text-xl font-bold leading-none tracking-wide text-ink",children:["LOAD",h.jsx("span",{className:"text-ember",children:"OUT"})]}),h.jsx("span",{className:"mt-1 block font-mono text-[10px] tracking-[0.18em] text-ink-faint",children:"AGENTIC GEAR KIT"})]})]}),h.jsxs("nav",{className:"relative mt-12",children:[h.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-1 left-0 w-px bg-line"}),h.jsx("span",{"aria-hidden":!0,className:"absolute left-0 w-[2px] bg-ember transition-transform",style:{height:Hp-12,transform:`translateY(${(i<0?0:i)*Hp+6}px)`,opacity:i<0?0:1,transitionDuration:"450ms",transitionTimingFunction:"var(--ease-out-expo)"}}),h.jsx("div",{className:"flex flex-col",children:Qg.map((s,c)=>{const o=c===i;return h.jsxs(Zn,{to:s.to,className:`group flex h-9 items-center gap-3 pl-5 text-sm transition-colors ${o?"text-ink":"text-ink-dim hover:text-ink"}`,children:[h.jsx("span",{className:`font-mono text-[10px] tnum transition-colors ${o?"text-ember":"text-ink-faint group-hover:text-ink-dim"}`,children:String(c+1).padStart(2,"0")}),h.jsx("span",{className:o?"font-medium":"",children:s.label})]},s.to)})})]}),h.jsx("div",{className:"mt-14 border-t border-line pt-4",children:h.jsxs("p",{className:"font-mono text-[11px] leading-relaxed text-ink-faint",children:["nothing is written",h.jsx("br",{}),"without asking."]})})]})}),h.jsx("main",{className:"min-w-0 flex-1",children:h.jsx("div",{className:"page",children:h.jsx(Hg,{})},l)})]}),h.jsx(IS,{})]})}function jl({crate:l,title:i,sub:s}){return h.jsxs("header",{className:"mb-10",children:[h.jsx("p",{className:"crate",children:l}),h.jsx("h1",{className:"wipe mt-2 font-display text-[1.9rem] font-semibold leading-tight text-ink",children:i}),s?h.jsx("p",{className:"rise mt-2 max-w-[65ch] text-sm leading-relaxed text-ink-dim",style:{"--i":2},children:s}):null]})}function n1(){const l=Jn(),i=P.useRef(null),[s,c]=P.useState(null),[o,f]=P.useState(null),[m,v]=P.useState(!1),[g,y]=P.useState(null),b=he({mutationFn:N=>Et.bundleImportPlan(N),onSuccess:N=>{f(N),v(!1),y(null)}}),p=he({mutationFn:()=>Et.bundleImportApply(o.token,m),onSuccess:N=>{y(N),f(null),c(null),i.current&&(i.current.value=""),l.invalidateQueries()}}),S=o?o.new.length+o.sources.length+(m?o.conflicts.length:0):0;function j(N){var R;const T=(R=N.target.files)==null?void 0:R[0];T&&(c(T.name),y(null),b.mutate(T))}return h.jsxs("div",{className:"mt-6 border-t border-line pt-5",children:[h.jsx("p",{className:"font-display text-xs font-semibold uppercase tracking-wider text-ink-dim",children:"Import a bundle"}),h.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:["Received a ",h.jsx("code",{className:"font-mono text-xs text-ink",children:".loadout.tar.gz"})," from a teammate? Upload it here to review and merge it into this store."]}),g?h.jsxs("div",{className:"rise mt-4 flex items-center justify-between",children:[h.jsxs("p",{className:"stamp text-sm text-sync",children:[h.jsx("span",{className:"mr-2 font-mono text-[10px]",children:"■"}),"Imported ",g.applied.length," artifact",g.applied.length===1?"":"s",g.sourcesAdded>0?`, ${g.sourcesAdded} new source${g.sourcesAdded===1?"":"s"}`:"",". Run a sync to install into your agents."]}),h.jsx("button",{onClick:()=>y(null),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"dismiss"})]}):o?h.jsxs("div",{className:"rise mt-4 border border-line-strong bg-raised p-4",children:[h.jsxs("div",{className:"flex items-baseline justify-between",children:[h.jsxs("p",{className:"font-display text-sm font-semibold uppercase tracking-wider text-ink",children:[o.meta.name," — ",S," change",S===1?"":"s"]}),h.jsxs("p",{className:"font-mono text-[11px] text-ink-faint",children:["by ",o.meta.createdBy||"unknown"]})]}),h.jsxs("ul",{className:"mt-3 max-h-44 space-y-1 overflow-y-auto pr-1 font-mono text-xs",children:[o.new.map(N=>h.jsxs("li",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"w-20 text-sync",children:"+ new"}),h.jsx("span",{className:"text-ink",children:N.id}),h.jsx("span",{className:"text-ink-faint",children:N.kind})]},`new-${N.id}`)),o.conflicts.map(N=>h.jsxs("li",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"w-20 text-warn",children:m?"! overwrite":"! skip"}),h.jsx("span",{className:"text-ink",children:N.id}),h.jsx("span",{className:"text-ink-faint",children:N.kind})]},`conflict-${N.id}`)),o.sources.map(N=>h.jsxs("li",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"w-20 text-sync",children:"+ source"}),h.jsx("span",{className:"text-ink",children:N.name})]},`source-${N.name}`))]}),o.identical.length>0?h.jsxs("p",{className:"mt-2 font-mono text-xs text-ink-faint",children:["= ",o.identical.length," artifact",o.identical.length===1?"":"s"," identical, nothing to do"]}):null,o.conflicts.length>0?h.jsxs("label",{className:"mt-3 flex items-center gap-2 text-xs text-ink-dim",children:[h.jsx("input",{type:"checkbox",checked:m,onChange:N=>v(N.target.checked)}),"Overwrite ",o.conflicts.length," conflicting artifact",o.conflicts.length===1?"":"s"," with the bundle's version"]}):null,h.jsxs("div",{className:"mt-4 flex items-center gap-3 border-t border-line pt-3",children:[h.jsx("button",{onClick:()=>p.mutate(),disabled:p.isPending||S===0,className:"btn-ember",children:p.isPending?"Importing…":`Import ${S}`}),h.jsx("button",{onClick:()=>{f(null),c(null),i.current&&(i.current.value="")},className:"px-2 py-1.5 text-sm text-ink-dim transition-colors hover:text-ink",children:"Cancel — write nothing"}),p.isError?h.jsx("span",{className:"text-xs text-danger",children:String(p.error)}):null]})]}):h.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[h.jsxs("label",{className:"btn-outline inline-flex cursor-pointer items-center gap-2",children:[h.jsx("span",{"aria-hidden":!0,className:"font-mono text-ember",children:"↑"}),s??"Choose bundle…",h.jsx("input",{ref:i,type:"file",accept:".tar.gz,.tgz,application/gzip",className:"hidden",onChange:j})]}),b.isPending?h.jsx("span",{className:"text-xs text-ink-faint",children:"Reviewing…"}):b.isError?h.jsx("span",{className:"text-xs text-danger",children:String(b.error)}):null]})]})}const a1={"in-sync":{color:"text-sync",mark:"■",dim:"bg-sync"},missing:{color:"text-warn",mark:"□",dim:"bg-warn"},"drifted-local":{color:"text-warn",mark:"◧",dim:"bg-warn"},"drifted-store":{color:"text-drift",mark:"◨",dim:"bg-drift"},conflict:{color:"text-danger",mark:"✕",dim:"bg-danger"},"n/a":{color:"text-ink-faint",mark:"·",dim:"bg-ink-faint"}};function Zf(l){return a1[l]??{color:"text-ink-dim",mark:"■",dim:"bg-ink-dim"}}function Gg({state:l}){const i=Zf(l);return h.jsxs("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs ${i.color}`,children:[h.jsx("span",{"aria-hidden":!0,className:"text-[10px] leading-none",children:i.mark}),l]})}const l1={skill:"M6 1 L7.4 4.6 L11 6 L7.4 7.4 L6 11 L4.6 7.4 L1 6 L4.6 4.6 Z",instruction:"M1 2.5 H11 M1 6 H8.5 M1 9.5 H10",command:"M2 2.5 L6 6 L2 9.5 M7 9.5 H11",hook:"M8.5 1 V6 A3 3 0 0 1 2.5 6 V4.5",settings:"M1 4 H11 M1 8 H11 M4 2.5 V5.5 M8 6.5 V9.5"};function qs({kind:l,className:i=""}){const s=l1[l];return s?h.jsx("svg",{viewBox:"0 0 12 12",className:`h-3 w-3 ${i}`,"aria-hidden":!0,children:h.jsx("path",{d:s,fill:l==="skill"?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"square"})}):h.jsx("svg",{viewBox:"0 0 12 12",className:`h-3 w-3 ${i}`,"aria-hidden":!0,children:h.jsx("rect",{x:"2",y:"2",width:"8",height:"8",fill:"none",stroke:"currentColor"})})}function i1({kind:l}){return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-xs border border-line px-1.5 py-0.5 font-mono text-[11px] text-ink-dim",children:[h.jsx(qs,{kind:l,className:"text-ink-faint"}),l]})}const kp=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function s1(l,i=700){const[s,c]=P.useState(()=>kp()?l:0),o=P.useRef(0);return P.useEffect(()=>{if(kp()){c(l);return}const f=performance.now(),m=v=>{const g=Math.min(1,(v-f)/i),y=1-Math.pow(2,-10*g);c(Math.round(l*(g===1?1:y))),g<1&&(o.current=requestAnimationFrame(m))};return o.current=requestAnimationFrame(m),()=>cancelAnimationFrame(o.current)},[l,i]),s}function u1({value:l,className:i=""}){const s=s1(l);return h.jsx("span",{className:`tnum ${i}`,children:s})}const c1=["conflict","drifted-local","drifted-store","missing","in-sync"],r1={"in-sync":"var(--color-sync-dim)",missing:"var(--color-warn-dim)","drifted-local":"var(--color-warn-dim)","drifted-store":"var(--color-drift-dim)",conflict:"var(--color-danger-dim)"},o1={"in-sync":"var(--color-sync)",missing:"var(--color-warn)","drifted-local":"var(--color-warn)","drifted-store":"var(--color-drift)",conflict:"var(--color-danger)"};function f1(){const l=se({queryKey:["overview"],queryFn:Et.overview});if(l.isLoading)return h.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"});if(l.isError)return h.jsxs("p",{className:"text-sm text-danger",children:["Cannot reach loadout: ",String(l.error)]});const i=l.data,s=i.agents.filter(f=>f.installed),c=c1.filter(f=>(i.states[f]??0)>0),o=c.reduce((f,m)=>f+(i.states[m]??0),0);return h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / overview",title:i.store.name,sub:`${i.store.artifacts} artifact${i.store.artifacts===1?"":"s"} in the store · ${s.length} of ${i.agents.length} agents installed on this machine`}),i.store.artifacts===0?h.jsxs("div",{className:"rise brk max-w-[65ch] border border-line p-6","data-active":"true",children:[h.jsx("div",{className:"flex items-center gap-2.5 text-ink-faint",children:["skill","instruction","command","hook","settings"].map(f=>h.jsx(qs,{kind:f,className:"h-3.5 w-3.5"},f))}),h.jsx("p",{className:"mt-4 font-display text-lg font-medium text-ink",children:"The rack is empty."}),h.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:["Fill it with the"," ",h.jsx(Zn,{to:"/builder",className:"text-ember transition-colors hover:text-ember-bright",children:"Builder"})," ","— it interviews you about your stack, conventions and testing strategy, then generates skills, instructions and commands for every agent. Or scaffold by hand with"," ",h.jsx("code",{className:"font-mono text-xs text-ink",children:"loadout new"}),"."]})]}):h.jsxs("section",{children:[h.jsx("h2",{className:"crate",children:"readiness board"}),o>0?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"mt-4 flex h-2.5 gap-[3px]",role:"img","aria-label":"sync state distribution",children:c.map((f,m)=>h.jsx("div",{className:"grow-x relative min-w-[6px]",style:{flexGrow:i.states[f],"--i":m,background:r1[f]},children:h.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px]",style:{background:o1[f]}})},f))}),h.jsx("div",{className:"mt-4 flex flex-wrap gap-x-10 gap-y-3",children:c.map((f,m)=>h.jsxs("span",{className:"rise flex items-baseline gap-2.5",style:{"--i":m+2},children:[h.jsx(u1,{value:i.states[f],className:`font-display text-[1.7rem] font-semibold leading-none ${Zf(f).color}`}),h.jsx(Gg,{state:f})]},f))})]}):h.jsx("p",{className:"mt-3 text-sm text-ink-dim",children:"No installed agents to compare against yet."})]}),h.jsxs("section",{className:"mt-14",children:[h.jsx("h2",{className:"crate",children:"agents on this machine"}),h.jsx("ul",{className:"mt-4 divide-y divide-line border-y border-line",children:i.agents.map((f,m)=>h.jsxs("li",{className:"rise flex items-center gap-4 py-3",style:{"--i":m},children:[h.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 flex-none ${f.installed?"bg-sync":"border border-line-strong"}`}),h.jsx("span",{className:"w-36 font-mono text-sm text-ink",children:f.id}),h.jsx("span",{className:"w-32 text-sm text-ink-dim",children:f.name}),f.installed?h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-ink-faint",children:f.home}):h.jsx("span",{className:"flex-1 text-xs text-ink-faint",children:"not installed"})]},f.id))})]}),h.jsxs("section",{className:"mt-14 max-w-[65ch]",children:[h.jsx("h2",{className:"crate",children:"share"}),h.jsxs("p",{className:"mt-4 text-sm leading-relaxed text-ink-dim",children:["Export the whole store as one bundle a teammate can import on any machine. They run"," ",h.jsx("code",{className:"font-mono text-xs text-ink",children:"loadout bundle import"})," and then sync."]}),h.jsxs("a",{href:"/api/bundle/export",className:"btn-ghost mt-4 inline-flex items-center gap-2",download:!0,children:[h.jsx("span",{"aria-hidden":!0,className:"font-mono text-ember",children:"↓"}),i.store.name,".loadout.tar.gz"]}),h.jsx(Zn,{to:"/export",className:"mt-2 block text-xs text-ink-faint transition-colors hover:text-ink",children:"or pick exactly what to share →"}),h.jsx(n1,{})]})]})}function d1(){const l=se({queryKey:["artifacts"],queryFn:Et.artifacts}),[i,s]=P.useState(null),c=l.data??[],o=[...new Set(c.map(m=>m.kind))],f=i?c.filter(m=>m.kind===i):c;return h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / store",title:"Canonical store",sub:"Every artifact here is the single source of truth — agents receive rendered copies on sync."}),l.isLoading?h.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"}):c.length===0?h.jsxs("p",{className:"max-w-[65ch] text-sm text-ink-dim",children:["Nothing here yet. The"," ",h.jsx(Zn,{to:"/builder",className:"text-ember transition-colors hover:text-ember-bright",children:"Builder"})," ","generates a full kit from your conventions."]}):h.jsxs(h.Fragment,{children:[o.length>1?h.jsxs("div",{className:"rise mb-5 flex flex-wrap items-center gap-2",children:[h.jsxs("button",{className:"chip font-mono text-xs","data-on":i===null,onClick:()=>s(null),children:["all ",h.jsx("span",{className:"tnum text-ink-faint",children:c.length})]}),o.map(m=>h.jsxs("button",{className:"chip inline-flex items-center gap-1.5 font-mono text-xs","data-on":i===m,onClick:()=>s(i===m?null:m),children:[h.jsx(qs,{kind:m}),m," ",h.jsx("span",{className:"tnum text-ink-faint",children:c.filter(v=>v.kind===m).length})]},m))]}):null,h.jsx("ul",{className:"divide-y divide-line border-y border-line",children:f.map((m,v)=>{var g;return h.jsx("li",{className:"wipe",style:{"--i":Math.min(v,12)},children:h.jsxs(Zn,{to:"/store/$artifactId",params:{artifactId:m.id},className:"brk group flex items-center gap-4 py-3 pl-1 pr-2 transition-colors hover:bg-surface/50",children:[h.jsx(qs,{kind:m.kind,className:"flex-none text-ink-faint transition-colors group-hover:text-ember"}),h.jsx("span",{className:"w-56 truncate font-mono text-sm text-ink transition-colors group-hover:text-ember-bright",children:m.id}),h.jsx("span",{className:"font-mono text-[11px] text-ink-dim",children:m.kind}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-ink-faint",children:m.path}),(g=m.origin)!=null&&g.startsWith("source:")?h.jsx("span",{className:"font-mono text-[11px] text-drift",children:m.origin}):null,h.jsx("span",{"aria-hidden":!0,className:"font-mono text-xs text-ink-faint opacity-0 transition-all duration-200 group-hover:translate-x-0.5 group-hover:text-ember group-hover:opacity-100",children:"▸"})]})},m.id)})},i??"all")]})]})}function h1(){const{artifactId:l}=Vf({from:"/store/$artifactId"}),i=se({queryKey:["artifact",l],queryFn:()=>Et.artifact(l)}),[s,c]=P.useState(null);if(i.isLoading)return h.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"});if(i.isError)return h.jsx("p",{className:"text-sm text-danger",children:String(i.error)});const{artifact:o,files:f}=i.data,m=Object.keys(f).sort(),v=s&&f[s]!==void 0?s:m[0],g=v?f[v].split(` -`).length:0;return h.jsxs("div",{children:[h.jsxs("nav",{className:"crate",children:[h.jsx(Zn,{to:"/store",className:"transition-colors hover:text-ink",children:"store"}),h.jsx("span",{"aria-hidden":!0,className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"normal-case tracking-normal text-ink-dim",children:o.id})]}),h.jsxs("header",{className:"wipe mb-7 mt-3 flex items-center gap-3",children:[h.jsx("h1",{className:"font-display text-[1.9rem] font-semibold leading-tight text-ink",children:o.id}),h.jsx(i1,{kind:o.kind}),o.origin&&o.origin!=="local"?h.jsx("span",{className:"font-mono text-[11px] text-drift",children:o.origin}):null]}),h.jsxs("div",{className:"rise border border-line",style:{"--i":2},children:[h.jsxs("div",{className:"flex flex-wrap items-center border-b border-line bg-surface/60",children:[m.map(y=>h.jsxs("button",{onClick:()=>c(y),className:`relative px-3.5 py-2 font-mono text-xs transition-colors ${y===v?"text-ink":"text-ink-faint hover:text-ink-dim"}`,children:[y,h.jsx("span",{"aria-hidden":!0,className:"absolute inset-x-2 bottom-0 h-[2px] bg-ember transition-transform duration-200",style:{transform:y===v?"scaleX(1)":"scaleX(0)",transformOrigin:"left center",transitionTimingFunction:"var(--ease-out-quart)"}})]},y)),h.jsxs("span",{className:"ml-auto px-3.5 font-mono text-[11px] text-ink-faint tnum",children:[g," lines"]})]}),h.jsx("pre",{className:"page max-h-[65vh] overflow-auto p-5 font-mono text-[13px] leading-relaxed text-ink-dim",children:v?f[v]:"(empty)"},v)]}),h.jsxs("p",{className:"mt-4 max-w-[65ch] text-xs text-ink-faint",children:["Edit this file in the store on disk (",h.jsx("span",{className:"font-mono",children:o.path}),") — the web UI never modifies artifacts silently."]})]})}function m1(){var b,p;const l=se({queryKey:["status"],queryFn:Et.status}),[i,s]=P.useState(null),c=se({queryKey:["diff",i],queryFn:()=>Et.diff(i),enabled:i!==null}),o=((b=l.data)==null?void 0:b.rows)??[],f=((p=l.data)==null?void 0:p.skips)??[],m=[...new Set(o.map(S=>S.agent))],v=[];{const S=new Map;for(const j of o){let N=S.get(j.artifact);N||(N={id:j.artifact,kind:j.kind,cells:{}},S.set(j.artifact,N),v.push(N)),N.cells[j.agent]=j.state}}const g=[...new Set(o.map(S=>S.state))],y=`minmax(200px, 300px) repeat(${Math.max(m.length,1)}, minmax(104px, 148px))`;return h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / agents",title:"Drift matrix",sub:"Every artifact × every installed agent. Select a drifted cell to see the exact diff before anything moves."}),l.isLoading?h.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"}):o.length===0?h.jsx("p",{className:"max-w-[65ch] text-sm text-ink-dim",children:"No rows — either the store is empty or no supported agent is installed."}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("div",{className:"min-w-fit",children:[h.jsxs("div",{className:"grid items-end gap-x-2 border-b border-line-strong pb-2",style:{gridTemplateColumns:y},children:[h.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"artifact ▸ agent"}),m.map(S=>h.jsx("span",{className:"text-center font-mono text-xs text-ink-dim",children:S},S))]}),v.map((S,j)=>h.jsxs("div",{className:"wipe grid items-center gap-x-2 border-b border-line",style:{gridTemplateColumns:y,"--i":Math.min(j,12)},children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5 py-2 pr-3",children:[h.jsx(qs,{kind:S.kind,className:"flex-none text-ink-faint"}),h.jsx("span",{className:"truncate font-mono text-sm text-ink",children:S.id})]}),m.map(N=>{const T=S.cells[N]??"n/a",R=Zf(T),M=T!=="in-sync"&&T!=="n/a",O=(i==null?void 0:i.artifact)===S.id&&(i==null?void 0:i.agent)===N;return h.jsx("button",{onClick:()=>M?s(O?null:{artifact:S.id,agent:N}):void 0,disabled:!M,"aria-label":`${S.id} on ${N}: ${T}`,title:`${T}${M?" — view diff":""}`,"data-active":O,className:`brk mx-auto my-1 flex h-8 w-full max-w-[9rem] items-center justify-center font-mono text-sm transition-colors ${R.color} ${M?"cursor-pointer hover:bg-surface":""} ${O?"bg-surface":""}`,children:h.jsx("span",{"aria-hidden":!0,children:R.mark})},N)})]},S.id)),h.jsx("div",{className:"mt-4 flex flex-wrap gap-x-7 gap-y-2",children:g.map(S=>h.jsx(Gg,{state:S},S))})]})}),h.jsx("div",{className:"expander","data-open":i!==null,children:h.jsx("div",{children:i?h.jsxs("section",{className:"mt-8 border border-line bg-surface/40",children:[h.jsxs("div",{className:"flex items-baseline justify-between border-b border-line px-4 py-2.5",children:[h.jsxs("h2",{className:"font-display text-sm font-semibold text-ink",children:[i.artifact," ",h.jsx("span",{className:"text-ink-faint",children:"→"})," ",i.agent]}),h.jsx("button",{onClick:()=>s(null),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"close"})]}),h.jsx("div",{className:"px-4 py-3",children:c.isLoading?h.jsx("p",{className:"text-sm text-ink-faint",children:"Computing diff…"}):(c.data??[]).length===0?h.jsx("p",{className:"text-sm text-ink-dim",children:"Nothing to change — the drift is local-only (the agent file was edited; syncing would not overwrite it unless the store changes too)."}):(c.data??[]).map(S=>h.jsxs("div",{className:"mb-3 last:mb-0",children:[h.jsx("p",{className:"font-mono text-xs text-ink-faint",children:S.relPath}),h.jsx("pre",{className:"mt-1.5 overflow-x-auto border border-line bg-bg-deep/60 p-4 font-mono text-xs leading-relaxed",children:S.diff.split(` -`).map((j,N)=>h.jsx("span",{className:j.startsWith("+")?"block text-sync":j.startsWith("-")?"block text-danger":"block text-ink-faint",children:j||" "},N))})]},S.relPath))})]}):null})}),f.length>0?h.jsxs("p",{className:"mt-6 font-mono text-xs text-ink-faint",children:["skipped: ",f.map(S=>`${S.agent} (${S.reason})`).join(" · ")]}):null]})}function y1(){const l=Jn(),i=se({queryKey:["sources"],queryFn:Et.sources}),s=he({mutationFn:Et.sourcesCheck}),c={};for(const o of s.data??[])c[o.name]=o;return h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / sources",title:"External sources",sub:"Skill repos pinned in sources.lock.yaml — adding clones and imports once; checking is ls-remote only; applying updates stays in the CLI (loadout update) where the diff is reviewed."}),h.jsx(p1,{onAdded:()=>void l.invalidateQueries({queryKey:["sources"]})}),i.isLoading?h.jsx("p",{className:"mt-10 text-sm text-ink-faint",children:"Loading…"}):(i.data??[]).length===0?h.jsxs("p",{className:"mt-10 max-w-[65ch] text-sm text-ink-dim",children:["No sources registered yet — add one above, or track a skills repo from the CLI with"," ",h.jsx("code",{className:"font-mono text-xs text-ink",children:"loadout source add "}),". Pins land in the store so your whole team resolves the same versions."]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"mb-4 mt-10 flex items-center gap-3",children:[h.jsx("button",{onClick:()=>s.mutate(),disabled:s.isPending,className:"btn-ghost",children:s.isPending?"Checking remotes…":"Check remotes"}),h.jsx("span",{className:"text-xs text-ink-faint",children:"read-only — nothing is fetched or applied"})]}),h.jsx("ul",{className:"divide-y divide-line border-y border-line",children:(i.data??[]).map((o,f)=>{const m=c[o.name];return h.jsxs("li",{className:"wipe flex items-center gap-4 py-3",style:{"--i":f},children:[h.jsx("span",{className:"w-40 truncate font-mono text-sm text-ink",children:o.name}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-ink-faint",children:o.url}),h.jsxs("span",{className:"font-mono text-xs text-ink-dim",children:[o.ref||"default"," ",h.jsx("span",{className:"text-ink-faint",children:"@"})," ",o.commit.slice(0,10)]}),h.jsx("span",{className:"w-44 text-right font-mono text-xs",children:m?m.error?h.jsx("span",{className:"stamp inline-block text-danger",title:m.error,children:"✕ error"}):m.hasUpdate?h.jsx("span",{className:"stamp inline-block text-drift",children:"◨ update available"}):h.jsx("span",{className:"stamp inline-block text-sync",children:"■ up-to-date"}):h.jsx("span",{className:"text-ink-faint",children:"unchecked"})})]},o.name)})}),(s.data??[]).some(o=>o.hasUpdate)?h.jsxs("p",{className:"rise mt-4 text-sm text-ink-dim",children:["Updates available — run"," ",h.jsx("code",{className:"font-mono text-xs text-ember",children:"loadout update"})," to review the changelog and per-skill diff before anything moves."]}):null]})]})}function p1({onAdded:l}){const[i,s]=P.useState(""),[c,o]=P.useState(""),[f,m]=P.useState(""),[v,g]=P.useState(""),[y,b]=P.useState(!1),p=he({mutationFn:()=>Et.sourcesAdd({url:i.trim(),name:c.trim()||void 0,ref:f.trim()||void 0,subdir:v.trim()||void 0}),onSuccess:()=>{s(""),o(""),m(""),g(""),l()}});return h.jsxs("div",{className:"rise brk border border-line p-5","data-active":"false",children:[h.jsx("h2",{className:"font-display text-sm font-semibold uppercase tracking-wider text-ink",children:"Add a source"}),h.jsxs("div",{className:"mt-3.5 flex flex-wrap items-center gap-3",children:[h.jsx("input",{type:"text",value:i,onChange:S=>s(S.target.value),onKeyDown:S=>{S.key==="Enter"&&i.trim()!==""&&!p.isPending&&p.mutate()},placeholder:"git@github.com:team/skills.git","aria-label":"Repository URL",className:"field w-full max-w-md flex-1"}),h.jsx("button",{onClick:()=>p.mutate(),disabled:p.isPending||i.trim()==="",className:"btn-ember",children:p.isPending?"Cloning…":"Add source"}),h.jsx("button",{onClick:()=>b(S=>!S),"aria-expanded":y,className:"font-mono text-xs text-ink-faint transition-colors hover:text-ink",children:y?"− options":"+ options"})]}),h.jsx("div",{className:"expander","data-open":y,children:h.jsx("div",{children:h.jsxs("div",{className:"flex flex-wrap items-end gap-3 pt-4",children:[h.jsx(df,{label:"Name",value:c,onChange:o,placeholder:"repo basename"}),h.jsx(df,{label:"Ref",value:f,onChange:m,placeholder:"default branch"}),h.jsx(df,{label:"Subdir",value:v,onChange:g,placeholder:"whole repo"})]})})}),h.jsxs("p",{className:"mt-3 text-xs text-ink-faint",children:["Clones the repo, imports every skill it finds, and pins the commit — same as"," ",h.jsx("code",{className:"font-mono",children:"loadout source add"}),". Private repos use your existing git credentials; nothing is stored."]}),p.isError?h.jsx("p",{className:"stamp mt-2 text-xs text-danger",children:String(p.error)}):p.isSuccess?h.jsxs("p",{className:"stamp mt-2 text-xs text-sync",children:["■ pinned ",p.data.ref.name," @ ",p.data.ref.commit.slice(0,10)," — imported"," ",(p.data.added??[]).length," skill",(p.data.added??[]).length===1?"":"s",(p.data.skipped??[]).length>0?`, skipped ${(p.data.skipped??[]).length} (already exist)`:"",". Run ",h.jsx("code",{className:"font-mono",children:"loadout sync"})," to install."]}):null]})}function df({label:l,value:i,onChange:s,placeholder:c}){return h.jsxs("label",{className:"flex flex-col gap-1.5",children:[h.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:[l," ",h.jsx("span",{className:"normal-case tracking-normal",children:"(optional)"})]}),h.jsx("input",{type:"text",value:i,onChange:o=>s(o.target.value),placeholder:c,className:"field w-44"})]})}const g1=3e3;function Df(){const[l,i]=P.useState(null),s=P.useRef(null);P.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);function c(f){return s.current&&clearTimeout(s.current),l===f?(i(null),!0):(i(f),s.current=setTimeout(()=>i(null),g1),!1)}function o(f){i(m=>m===f?null:m)}return{confirmingId:l,requestConfirm:c,cancelIfArmed:o}}function v1({text:l,onSave:i,onEmptyCommit:s}){const[c,o]=P.useState(!1),[f,m]=P.useState(l);function v(){m(l),o(!0)}function g(){const b=f.trim();b===""?s==null||s():b!==l&&i(b),o(!1)}function y(){o(!1)}return c?h.jsx("input",{type:"text",autoFocus:!0,value:f,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),y())},onBlur:g,className:"field min-w-0 flex-1"}):h.jsx("button",{type:"button",onClick:v,className:"min-w-0 flex-1 whitespace-normal break-words text-left transition-colors hover:text-ember",children:l})}function x1({value:l,onChange:i}){const[s,c]=P.useState(""),{confirmingId:o,requestConfirm:f,cancelIfArmed:m}=Df(),v=Jn(),g=se({queryKey:["library"],queryFn:Et.libraryInstructions}),y=se({queryKey:["library-groups"],queryFn:Et.libraryGroups}),b=he({mutationFn:M=>Et.libraryAdd(M),onSuccess:()=>void v.invalidateQueries({queryKey:["library"]})}),p=he({mutationFn:M=>Et.libraryRemove(M),onSuccess:()=>void v.invalidateQueries({queryKey:["library"]})}),S=new Set((g.data??[]).map(M=>M.text));function j(M){N([M])}function N(M){const O=new Set(l),Q=[];for(const w of M){const K=w.trim();K!==""&&!O.has(K)&&(O.add(K),Q.push(K))}Q.length>0&&i([...l,...Q])}function T(M){i(l.filter((O,Q)=>Q!==M))}function R(M){f(M)&&p.mutate(M)}return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:s,onChange:M=>c(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),j(s),c(""))},placeholder:"type an instruction, press Enter",className:"field w-full max-w-md"}),h.jsx("button",{type:"button",onClick:()=>{j(s),c("")},disabled:s.trim()==="",className:"btn-ghost",children:"Add"})]}),l.length>0?h.jsx("ul",{className:"mt-3 space-y-1 border-y border-line py-2",children:l.map((M,O)=>h.jsxs("li",{className:"rise flex items-start gap-3 py-0.5 font-mono text-sm text-ink",style:{"--i":O},children:[h.jsx(v1,{text:M,onSave:Q=>i(l.map((w,K)=>K===O?Q:w)),onEmptyCommit:()=>T(O)}),h.jsx("button",{type:"button",onClick:()=>b.mutate(M),disabled:b.isPending||S.has(M),className:"shrink-0 text-xs text-ink-faint transition-colors hover:text-ink",children:S.has(M)?"■ saved":"save"}),h.jsx("button",{type:"button",onClick:()=>T(O),"aria-label":`remove ${M}`,className:"shrink-0 text-xs text-ink-faint transition-colors hover:text-danger",children:"×"})]},`${M}-${O}`))}):null,(g.data??[]).length>0?h.jsxs("div",{className:"mt-4",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"from your library"}),h.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(g.data??[]).map(M=>{const O=l.includes(M.text);return h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsxs("button",{type:"button",onClick:()=>j(M.text),"data-on":O,className:"chip",children:[O?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,M.text]}),h.jsx("button",{type:"button",onClick:()=>R(M.id),onBlur:()=>m(M.id),"aria-label":o===M.id?`confirm delete ${M.text} from library`:`delete ${M.text} from library`,className:o===M.id?"font-medium text-danger":"text-xs text-ink-faint transition-colors hover:text-danger",children:o===M.id?"confirm ×":"×"})]},M.id)})})]}):null,(y.data??[]).length>0?h.jsxs("div",{className:"mt-3",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"groups"}),h.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(y.data??[]).map(M=>{const O=M.entryIds.map(w=>{var K;return(K=(g.data??[]).find(B=>B.id===w))==null?void 0:K.text}).filter(w=>!!w),Q=O.length>0&&O.every(w=>l.includes(w));return h.jsxs("button",{type:"button",onClick:()=>N(O),"data-on":Q,className:"chip",children:[Q?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,M.name," (",O.length,")"]},M.name)})})]}):null]})}function b1(){const l=se({queryKey:["wizard-schema"],queryFn:Et.wizardSchema}),i=se({queryKey:["wizard-presets"],queryFn:Et.wizardPresets}),s=se({queryKey:["profiles"],queryFn:Et.profiles}),[c,o]=P.useState({}),[f,m]=P.useState(void 0),[v,g]=P.useState(void 0),[y,b]=P.useState(0),p=Jn(),S=he({mutationFn:()=>Et.wizardPlan(c,f)}),j=he({mutationFn:()=>Et.wizardGenerate(c,f),onSuccess:()=>void p.invalidateQueries()}),N=he({mutationFn:w=>Et.profile(w),onSuccess:(w,K)=>{o(w),g(K),m(void 0)}}),T=l.data??[],R=y===T.length,M=(w,K)=>o(B=>({...B,[w]:K})),O=()=>{b(T.length),S.mutate()},Q=w=>w.questions.filter(K=>c[K.id]!==void 0).length;return l.isLoading?h.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"}):h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / builder",title:"Build your kit",sub:"Answer once — loadout generates conventions, testing standards, SDD commands and continuity artifacts for every agent. Nothing is written until you confirm the review."}),h.jsxs("div",{className:"rise mb-3 flex flex-wrap items-center gap-x-3 gap-y-2",children:[h.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"start from"}),(i.data??[]).map(w=>h.jsx("button",{onClick:()=>{m(f===w?void 0:w),g(void 0)},"data-on":f===w,className:"chip font-mono text-xs",children:w},w)),h.jsx("span",{className:"text-xs text-ink-faint",children:"your answers below override the preset"})]}),(s.data??[]).length>0?h.jsxs("div",{className:"rise mb-10 flex flex-wrap items-center gap-x-3 gap-y-2",style:{"--i":1},children:[h.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"or a saved profile"}),(s.data??[]).map(w=>h.jsx("button",{onClick:()=>N.mutate(w),"data-on":v===w,className:"chip font-mono text-xs",children:w},w)),h.jsx("span",{className:"text-xs text-ink-faint",children:"loads that team's or org's answers — one org, one project type, one profile"})]}):h.jsx("div",{className:"mb-10"}),h.jsxs("div",{className:"flex gap-12",children:[h.jsxs("ol",{className:"relative w-48 shrink-0",children:[h.jsx("span",{"aria-hidden":!0,className:"absolute bottom-4 left-[11px] top-4 w-px bg-line"}),T.map((w,K)=>{const B=K===y&&!R,D=Q(w);return h.jsx("li",{className:"relative",children:h.jsxs("button",{onClick:()=>b(K),className:`group flex w-full items-center gap-3.5 py-2 text-left text-sm transition-colors ${B?"text-ink":"text-ink-dim hover:text-ink"}`,children:[h.jsx("span",{className:`z-[1] flex h-6 w-6 flex-none items-center justify-center border font-mono text-[10px] tnum transition-colors ${B?"border-ember bg-ember-faint text-ember-bright":D>0?"border-line-strong bg-raised text-ink-dim":"border-line bg-bg text-ink-faint"}`,children:String(K+1).padStart(2,"0")}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:`block truncate ${B?"font-medium":""}`,children:w.title.split("—")[0].trim()}),h.jsxs("span",{className:"block font-mono text-[10px] text-ink-faint tnum",children:[D,"/",w.questions.length," answered"]})]})]})},w.id)}),h.jsx("li",{className:"relative",children:h.jsxs("button",{onClick:O,className:`group flex w-full items-center gap-3.5 py-2 text-left text-sm transition-colors ${R?"text-ember-bright":"text-ember hover:text-ember-bright"}`,children:[h.jsx("span",{className:`z-[1] flex h-6 w-6 flex-none items-center justify-center border font-mono text-xs transition-colors ${R?"border-ember bg-ember text-bg-deep":"border-ember-dim bg-bg text-ember"}`,children:"▸"}),h.jsx("span",{className:R?"font-medium":"",children:"Review"})]})})]}),h.jsx("div",{className:"min-w-0 flex-1",children:R?h.jsx(N1,{plan:S,generate:j,answers:c,onBack:()=>b(Math.max(0,T.length-1))}):T[y]?h.jsx(S1,{section:T[y],answers:c,set:M,onNext:()=>y+1=T.length},T[y].id):null})]})]})}function S1({section:l,answers:i,set:s,onNext:c,isLast:o}){return h.jsxs("div",{className:"page",children:[h.jsx("h2",{className:"font-display text-lg font-semibold text-ink",children:l.title}),h.jsx("div",{className:"mt-7 space-y-8",children:l.questions.map((f,m)=>h.jsx("div",{className:"rise",style:{"--i":m+1},children:h.jsx(j1,{q:f,value:i[f.id],onChange:v=>s(f.id,v)})},f.id))}),h.jsxs("button",{onClick:c,className:"btn-outline mt-10",children:[o?"Go to review":"Next section"," ",h.jsx("span",{"aria-hidden":!0,children:"→"})]})]})}function j1({q:l,value:i,onChange:s}){const c=i??l.default,o=P.useMemo(()=>l.type!=="multi"?new Set:new Set(Array.isArray(c)?c:[]),[l.type,c]);return h.jsxs("fieldset",{className:"min-w-0",children:[h.jsx("legend",{className:"text-sm font-medium text-ink",children:l.prompt}),h.jsx("div",{className:"mt-3",children:l.type==="bool"?h.jsx("div",{className:"flex gap-2",children:[!0,!1].map(f=>h.jsx("button",{onClick:()=>s(f),"data-on":c===f,className:"chip",children:f?"yes":"no"},String(f)))}):l.type==="text"?h.jsx("input",{type:"text",value:typeof c=="string"?c:"",onChange:f=>s(f.target.value),placeholder:"free text",className:"field w-full max-w-md"}):l.type==="list"?h.jsx(x1,{value:Array.isArray(c)?c:[],onChange:s}):h.jsx("div",{className:"flex flex-wrap gap-2",children:(l.options??[]).map(f=>{const m=l.type==="select"?c===f.value:o.has(f.value);return h.jsxs("button",{onClick:()=>{if(l.type==="select")s(f.value);else{const v=new Set(o);v.has(f.value)?v.delete(f.value):v.add(f.value),s([...v])}},"data-on":m,className:"chip",children:[m?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 font-mono text-[9px] align-middle",children:"■"}):null,f.label]},f.value)})})})]})}function N1({plan:l,generate:i,answers:s,onBack:c}){const o=Jn(),[f,m]=P.useState(""),v=he({mutationFn:g=>Et.saveProfile(g,s),onSuccess:()=>{m(""),o.invalidateQueries({queryKey:["profiles"]})}});return i.isSuccess?h.jsxs("div",{className:"page max-w-[65ch]",children:[h.jsxs("h2",{className:"stamp font-display text-lg font-semibold text-sync",children:["■ ",i.data.created.length," artifacts in the store"]}),h.jsx("ul",{className:"mt-3 space-y-1",children:i.data.created.map((g,y)=>h.jsxs("li",{className:"rise font-mono text-sm text-ink-dim",style:{"--i":y},children:[h.jsx("span",{className:"mr-2 text-sync",children:"+"}),g]},g))}),h.jsx("p",{className:"mt-5 text-sm leading-relaxed text-ink-dim",children:"They are not installed anywhere yet — the pending-changes bar below will offer the gated sync, or review each file under Store first."})]}):h.jsxs("div",{className:"page max-w-[65ch]",children:[h.jsx("h2",{className:"font-display text-lg font-semibold text-ink",children:"Review"}),l.isPending?h.jsx("p",{className:"mt-3 text-sm text-ink-faint",children:"Planning…"}):l.isError?h.jsx("p",{className:"mt-3 text-sm text-danger",children:String(l.error)}):l.data?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"mt-3 text-sm text-ink-dim",children:["The builder will create"," ",h.jsx("span",{className:"tnum font-medium text-ink",children:l.data.create.length})," artifact",l.data.create.length===1?"":"s"," in the store:"]}),l.data.create.length>0?h.jsx("ul",{className:"mt-3 space-y-1 border-y border-line py-3",children:l.data.create.map((g,y)=>h.jsxs("li",{className:"rise font-mono text-sm text-ink",style:{"--i":y},children:[h.jsx("span",{className:"mr-2 text-sync",children:"+"}),g]},g))}):h.jsx("p",{className:"mt-2 font-mono text-sm text-ink-faint",children:"nothing — everything already exists"}),l.data.skip.length>0?h.jsxs("p",{className:"mt-3 font-mono text-xs text-ink-faint",children:["kept untouched (already exist): ",l.data.skip.join(" · ")]}):null,h.jsxs("div",{className:"mt-7 flex items-center gap-3",children:[h.jsx("button",{onClick:()=>i.mutate(),disabled:i.isPending||l.data.create.length===0,className:"btn-ember",children:i.isPending?"Writing…":`Write ${l.data.create.length} to store`}),h.jsx("button",{onClick:c,className:"px-2 py-1.5 text-sm text-ink-dim transition-colors hover:text-ink",children:"Back"}),i.isError?h.jsx("span",{className:"text-xs text-danger",children:String(i.error)}):null]}),h.jsxs("div",{className:"mt-10 border-t border-line pt-5",children:[h.jsx("h3",{className:"crate",children:"save these answers as a profile"}),h.jsx("p",{className:"mt-2 text-xs text-ink-faint",children:"Reuse this exact stack + conventions next time — for another repo, or share it with your team."}),h.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[h.jsx("input",{type:"text",value:f,onChange:g=>m(g.target.value),placeholder:"acme-frontend",className:"field w-48"}),h.jsx("button",{onClick:()=>v.mutate(f),disabled:v.isPending||f.trim()==="",className:"btn-ghost",children:v.isPending?"Saving…":"Save as profile"}),v.isSuccess?h.jsx("span",{className:"stamp text-xs text-sync",children:"■ saved"}):v.isError?h.jsx("span",{className:"text-xs text-danger",children:String(v.error)}):null]})]})]}):null]})}function E1(){const l=Jn(),i=se({queryKey:["library"],queryFn:Et.libraryInstructions}),s=se({queryKey:["library-groups"],queryFn:Et.libraryGroups}),[c,o]=P.useState(""),[f,m]=P.useState(""),[v,g]=P.useState(new Set),[y,b]=P.useState(""),p=he({mutationFn:B=>Et.libraryAdd(B),onSuccess:()=>void l.invalidateQueries({queryKey:["library"]})}),S=he({mutationFn:B=>Et.libraryRemove(B),onSuccess:()=>void l.invalidateQueries({queryKey:["library"]})}),j=he({mutationFn:()=>Et.libraryGroupSave(y,[...v]),onSuccess:()=>{b(""),g(new Set),l.invalidateQueries({queryKey:["library-groups"]})}}),N=he({mutationFn:B=>Et.libraryGroupRemove(B),onSuccess:()=>void l.invalidateQueries({queryKey:["library-groups"]})}),T=Df(),R=Df(),M=i.data??[],O=P.useMemo(()=>{const B=f.trim().toLowerCase();return B?M.filter(D=>D.text.toLowerCase().includes(B)):M},[M,f]);function Q(B){g(D=>{const G=new Set(D);return G.has(B)?G.delete(B):G.add(B),G})}function w(B){var D;return((D=M.find(G=>G.id===B))==null?void 0:D.text)??B}function K(){const B=c.trim();B!==""&&(p.mutate(B),o(""))}return h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / library",title:"Instruction library",sub:"Every custom instruction you've saved, in one place — search it, delete what's stale, and group entries so a whole set can be added to a wizard run in one click."}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("input",{type:"text",value:c,onChange:B=>o(B.target.value),onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),K())},placeholder:"add a new instruction, press Enter",className:"field w-full max-w-md"}),h.jsx("button",{type:"button",onClick:K,disabled:c.trim()==="",className:"btn-ghost",children:"Add"}),h.jsx("input",{type:"text",value:f,onChange:B=>m(B.target.value),placeholder:"search…",className:"field w-full max-w-xs"})]}),M.length===0?h.jsx("p",{className:"mt-6 text-sm text-ink-faint",children:"No saved instructions yet."}):O.length===0?h.jsxs("p",{className:"mt-6 text-sm text-ink-faint",children:['Nothing matches "',f,'".']}):h.jsx("ul",{className:"mt-4 space-y-1 border-y border-line py-2",children:O.map(B=>h.jsxs("li",{className:"flex items-start gap-3 py-1 font-mono text-sm text-ink",children:[h.jsx("span",{className:"min-w-0 flex-1 whitespace-normal break-words",children:B.text}),h.jsx("button",{type:"button",onClick:()=>{T.requestConfirm(B.id)&&S.mutate(B.id)},onBlur:()=>T.cancelIfArmed(B.id),"aria-label":T.confirmingId===B.id?`confirm delete ${B.text}`:`delete ${B.text}`,className:T.confirmingId===B.id?"shrink-0 font-medium text-danger":"shrink-0 text-xs text-ink-faint transition-colors hover:text-danger",children:T.confirmingId===B.id?"confirm ×":"×"})]},B.id))}),h.jsxs("section",{className:"mt-10 border-t border-line pt-6",children:[h.jsx("h2",{className:"crate",children:"create a group"}),h.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:"Select entries below, name the group, save it — then apply the whole set from the wizard in one click."}),M.length===0?h.jsx("p",{className:"mt-3 text-sm text-ink-faint",children:"Add some instructions first."}):h.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:O.map(B=>h.jsxs("button",{type:"button",onClick:()=>Q(B.id),"data-on":v.has(B.id),className:"chip",children:[v.has(B.id)?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,B.text]},B.id))}),h.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[h.jsx("input",{type:"text",value:y,onChange:B=>b(B.target.value),placeholder:"group-name",className:"field w-48"}),h.jsx("button",{type:"button",onClick:()=>j.mutate(),disabled:j.isPending||y.trim()===""||v.size===0,className:"btn-ghost",children:j.isPending?"Saving…":`Save group (${v.size})`}),j.isError?h.jsx("span",{className:"text-xs text-danger",children:String(j.error)}):null]})]}),h.jsxs("section",{className:"mt-10 border-t border-line pt-6",children:[h.jsx("h2",{className:"crate",children:"groups"}),(s.data??[]).length===0?h.jsx("p",{className:"mt-2 text-sm text-ink-faint",children:"No groups yet."}):h.jsx("ul",{className:"mt-3 space-y-3",children:(s.data??[]).map(B=>h.jsxs("li",{className:"border border-line-strong bg-raised p-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"font-mono text-sm text-ink",children:[B.name," ",h.jsxs("span",{className:"text-ink-faint",children:["(",B.entryIds.length,")"]})]}),h.jsx("button",{type:"button",onClick:()=>{R.requestConfirm(B.name)&&N.mutate(B.name)},onBlur:()=>R.cancelIfArmed(B.name),"aria-label":R.confirmingId===B.name?`confirm delete group ${B.name}`:`delete group ${B.name}`,className:R.confirmingId===B.name?"shrink-0 font-medium text-danger":"shrink-0 text-xs text-ink-faint transition-colors hover:text-danger",children:R.confirmingId===B.name?"confirm ×":"×"})]}),h.jsx("ul",{className:"mt-2 space-y-1 font-mono text-xs text-ink-dim",children:B.entryIds.map(D=>h.jsx("li",{className:"break-words",children:w(D)},D))})]},B.name))})]})]})}function _1(){const l=se({queryKey:["artifacts"],queryFn:Et.artifacts}),i=se({queryKey:["profiles"],queryFn:Et.profiles}),s=se({queryKey:["library"],queryFn:Et.libraryInstructions}),c=se({queryKey:["library-groups"],queryFn:Et.libraryGroups}),[o,f]=P.useState(new Set),[m,v]=P.useState(new Set),[g,y]=P.useState(new Set),[b,p]=P.useState(!1),S=P.useMemo(()=>{const R=new Map;for(const M of l.data??[]){const O=R.get(M.kind)??[];O.push(M),R.set(M.kind,O)}return R},[l.data]);function j(R,M,O){const Q=new Set(R);Q.has(O)?Q.delete(O):Q.add(O),M(Q)}const N=he({mutationFn:()=>Et.bundleExportSelected({artifactIds:[...o],profileNames:[...m],libraryEntryIds:[...g],sources:b}),onSuccess:R=>{const M=URL.createObjectURL(R),O=document.createElement("a");O.href=M,O.download="export.loadout.tar.gz",O.click(),URL.revokeObjectURL(M)}}),T=o.size+m.size+g.size;return h.jsxs("div",{children:[h.jsx(jl,{crate:"armory / export",title:"Export a bundle",sub:"Pick exactly what to share — artifacts, profiles, custom instructions — then download a .loadout.tar.gz a teammate can import."}),h.jsxs("section",{children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"crate",children:"artifacts"}),(l.data??[]).length>0?h.jsx("button",{type:"button",onClick:()=>f(new Set((l.data??[]).map(R=>R.id))),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"select all"}):null]}),[...S.entries()].map(([R,M])=>h.jsxs("div",{className:"mt-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:R}),h.jsx("button",{type:"button",onClick:()=>{const O=new Set(o);M.forEach(Q=>O.add(Q.id)),f(O)},className:"font-mono text-[10px] text-ink-faint transition-colors hover:text-ink",children:"select all"})]}),h.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:M.map(O=>h.jsxs("button",{type:"button",onClick:()=>j(o,f,O.id),"data-on":o.has(O.id),className:"chip",children:[o.has(O.id)?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,O.id]},O.id))})]},R)),l.data&&l.data.length===0?h.jsx("p",{className:"mt-3 text-sm text-ink-faint",children:"No artifacts in the store."}):null]}),h.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[h.jsx("h2",{className:"crate",children:"profiles"}),(i.data??[]).length===0?h.jsx("p",{className:"mt-2 text-sm text-ink-faint",children:"No saved profiles."}):h.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(i.data??[]).map(R=>h.jsxs("button",{type:"button",onClick:()=>j(m,v,R),"data-on":m.has(R),className:"chip",children:[m.has(R)?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,R]},R))})]}),h.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[h.jsx("h2",{className:"crate",children:"custom instructions"}),(s.data??[]).length===0?h.jsx("p",{className:"mt-2 text-sm text-ink-faint",children:"No saved instructions."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(s.data??[]).map(R=>h.jsxs("button",{type:"button",onClick:()=>j(g,y,R.id),"data-on":g.has(R.id),className:"chip",children:[g.has(R.id)?h.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,R.text]},R.id))}),(c.data??[]).length>0?h.jsxs("div",{className:"mt-3",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"groups"}),h.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(c.data??[]).map(R=>h.jsxs("button",{type:"button",onClick:()=>{const M=new Set(g);R.entryIds.forEach(O=>M.add(O)),y(M)},className:"chip",children:[R.name," (",R.entryIds.length,")"]},R.name))})]}):null]})]}),h.jsx("section",{className:"mt-8 border-t border-line pt-6",children:h.jsxs("label",{className:"flex items-center gap-2 text-sm text-ink-dim",children:[h.jsx("input",{type:"checkbox",checked:b,onChange:R=>p(R.target.checked)}),"Include tracked sources (sources.lock.yaml)"]})}),h.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[h.jsx("button",{type:"button",onClick:()=>N.mutate(),disabled:N.isPending||T===0,className:"btn-ember",children:N.isPending?"Exporting…":`Export ${T} item${T===1?"":"s"}`}),N.isError?h.jsx("span",{className:"text-xs text-danger",children:String(N.error)}):null,N.isSuccess?h.jsx("span",{className:"stamp text-xs text-sync",children:"■ downloaded"}):null]})]})}const Hn=OS({component:e1}),R1=[Sa({getParentRoute:()=>Hn,path:"/",component:f1}),Sa({getParentRoute:()=>Hn,path:"/store",component:d1}),Sa({getParentRoute:()=>Hn,path:"/store/$artifactId",component:h1}),Sa({getParentRoute:()=>Hn,path:"/agents",component:m1}),Sa({getParentRoute:()=>Hn,path:"/sources",component:y1}),Sa({getParentRoute:()=>Hn,path:"/builder",component:b1}),Sa({getParentRoute:()=>Hn,path:"/library",component:E1}),Sa({getParentRoute:()=>Hn,path:"/export",component:_1})],T1=XS({routeTree:Hn.addChildren(R1)}),M1=new Y0({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});g0.createRoot(document.getElementById("root")).render(h.jsx(P.StrictMode,{children:h.jsx(K0,{client:M1,children:h.jsx(JS,{router:T1})})})); diff --git a/internal/web/dist/assets/index-CjI71I4Y.css b/internal/web/dist/assets/index-cb9OH8YE.css similarity index 65% rename from internal/web/dist/assets/index-CjI71I4Y.css rename to internal/web/dist/assets/index-cb9OH8YE.css index fee9e34..8b3584b 100644 --- a/internal/web/dist/assets/index-CjI71I4Y.css +++ b/internal/web/dist/assets/index-cb9OH8YE.css @@ -1 +1 @@ -/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/chakra-petch-thai-500-normal-DeexCGiz.woff2)format("woff2"),url(/assets/chakra-petch-thai-500-normal-CJG_V2_m.woff)format("woff");unicode-range:U+2D7,U+303,U+331,U+E01-E5B,U+200C-200D,U+25CC}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(data:font/woff2;base64,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)format("woff2"),url(/assets/chakra-petch-vietnamese-500-normal-BVzUBLGs.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/chakra-petch-latin-ext-500-normal-gA6791b0.woff2)format("woff2"),url(/assets/chakra-petch-latin-ext-500-normal-BCHeNDEx.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/chakra-petch-latin-500-normal-BR1ody1F.woff2)format("woff2"),url(/assets/chakra-petch-latin-500-normal-CnUQnZ4D.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/chakra-petch-thai-600-normal-C620THcd.woff2)format("woff2"),url(/assets/chakra-petch-thai-600-normal-BiM5MXH8.woff)format("woff");unicode-range:U+2D7,U+303,U+331,U+E01-E5B,U+200C-200D,U+25CC}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(data:font/woff2;base64,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)format("woff2"),url(/assets/chakra-petch-vietnamese-600-normal-Pvj4qcw_.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/chakra-petch-latin-ext-600-normal-CdGvbdDU.woff2)format("woff2"),url(/assets/chakra-petch-latin-ext-600-normal-nL80L4xU.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/chakra-petch-latin-600-normal-DVQm9bgb.woff2)format("woff2"),url(/assets/chakra-petch-latin-600-normal-DQKfcdKo.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/chakra-petch-thai-700-normal-B7WL5pBr.woff2)format("woff2"),url(/assets/chakra-petch-thai-700-normal-vZLZ_5L8.woff)format("woff");unicode-range:U+2D7,U+303,U+331,U+E01-E5B,U+200C-200D,U+25CC}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(data:font/woff2;base64,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)format("woff2"),url(/assets/chakra-petch-vietnamese-700-normal-gQuUA8Wu.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/chakra-petch-latin-ext-700-normal-DAkvJhej.woff2)format("woff2"),url(/assets/chakra-petch-latin-ext-700-normal-BeviJPUl.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/chakra-petch-latin-700-normal-CnDBPjkL.woff2)format("woff2"),url(/assets/chakra-petch-latin-700-normal-D1s_c2du.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/schibsted-grotesk-latin-ext-400-normal-DHVTfbSM.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-ext-400-normal-DUPvg9bQ.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/schibsted-grotesk-latin-400-normal-DPhJBilQ.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-400-normal-BkiRe4WW.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/schibsted-grotesk-latin-ext-500-normal-Ch1izu81.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-ext-500-normal-BjmYCtCC.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/schibsted-grotesk-latin-500-normal-rf9C4Thp.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-500-normal-Ba39e-CX.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/schibsted-grotesk-latin-ext-700-normal-o210KhU4.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-ext-700-normal-DDW2aNyx.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/schibsted-grotesk-latin-700-normal-BkH0uJ1o.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-700-normal-Dz-okVa0.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/red-hat-mono-latin-ext-400-normal-CTgQ0k1t.woff2)format("woff2"),url(/assets/red-hat-mono-latin-ext-400-normal-CQ9iMEKY.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/red-hat-mono-latin-400-normal-C-lyubUB.woff2)format("woff2"),url(/assets/red-hat-mono-latin-400-normal-CG-MPK9d.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/red-hat-mono-latin-ext-500-normal-DzmeEbMl.woff2)format("woff2"),url(/assets/red-hat-mono-latin-ext-500-normal-C50_0SE6.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/red-hat-mono-latin-500-normal-CjZS5o_4.woff2)format("woff2"),url(/assets/red-hat-mono-latin-500-normal-C00uZsq5.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Schibsted Grotesk", system-ui, sans-serif;--font-mono:"Red Hat Mono", ui-monospace, monospace;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-xs:.125rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-display:"Chakra Petch", ui-sans-serif, sans-serif;--color-bg:oklch(15.5% .009 60);--color-bg-deep:oklch(12.5% .008 60);--color-surface:oklch(19% .011 60);--color-raised:oklch(22.5% .012 60);--color-line:oklch(28.5% .014 60);--color-line-strong:oklch(38% .016 60);--color-ink:oklch(93% .008 75);--color-ink-dim:oklch(67% .014 70);--color-ink-faint:oklch(50% .014 70);--color-ember:oklch(74% .14 55);--color-ember-bright:oklch(80% .15 60);--color-ember-dim:oklch(40% .07 55);--color-ember-faint:oklch(24% .03 55);--color-sync:oklch(74% .1 150);--color-sync-dim:oklch(34% .045 150);--color-warn:oklch(79% .11 85);--color-warn-dim:oklch(35% .05 85);--color-drift:oklch(74% .08 235);--color-drift-dim:oklch(33% .04 235);--color-danger:oklch(68% .15 25);--color-danger-dim:oklch(32% .06 25)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-x-0{inset-inline:0}.inset-x-2{inset-inline:calc(var(--spacing) * 2)}.inset-y-0{inset-block:0}.inset-y-1{inset-block:var(--spacing)}.top-4{top:calc(var(--spacing) * 4)}.top-10{top:calc(var(--spacing) * 10)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-\[11px\]{left:11px}.z-10{z-index:10}.z-\[1\]{z-index:1}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mt-14{margin-top:calc(var(--spacing) * 14)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-7{margin-bottom:calc(var(--spacing) * 7)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\[2px\]{height:2px}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-\[65vh\]{max-height:65vh}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-6{width:calc(var(--spacing) * 6)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-\[2px\]{width:2px}.w-\[3px\]{width:3px}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[9rem\]{max-width:9rem}.max-w-\[65ch\]{max-width:65ch}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[6px\]{min-width:6px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-14{gap:calc(var(--spacing) * 14)}.gap-\[3px\]{gap:3px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-7{column-gap:calc(var(--spacing) * 7)}.gap-x-10{column-gap:calc(var(--spacing) * 10)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--color-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-ember{border-color:var(--color-ember)}.border-ember-dim{border-color:var(--color-ember-dim)}.border-line{border-color:var(--color-line)}.border-line-strong{border-color:var(--color-line-strong)}.bg-bg{background-color:var(--color-bg)}.bg-bg-deep\/60{background-color:#09060499}@supports (color:color-mix(in lab,red,red)){.bg-bg-deep\/60{background-color:color-mix(in oklab,var(--color-bg-deep) 60%,transparent)}}.bg-danger{background-color:var(--color-danger)}.bg-drift{background-color:var(--color-drift)}.bg-ember{background-color:var(--color-ember)}.bg-ember-faint{background-color:var(--color-ember-faint)}.bg-ink-dim{background-color:var(--color-ink-dim)}.bg-ink-faint{background-color:var(--color-ink-faint)}.bg-line{background-color:var(--color-line)}.bg-raised{background-color:var(--color-raised)}.bg-surface{background-color:var(--color-surface)}.bg-surface\/40{background-color:#18130f66}@supports (color:color-mix(in lab,red,red)){.bg-surface\/40{background-color:color-mix(in oklab,var(--color-surface) 40%,transparent)}}.bg-surface\/60{background-color:#18130f99}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--color-surface) 60%,transparent)}}.bg-sync{background-color:var(--color-sync)}.bg-warn{background-color:var(--color-warn)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-40{padding-bottom:calc(var(--spacing) * 40)}.pl-1{padding-left:var(--spacing)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-baseline{vertical-align:baseline}.align-middle{vertical-align:middle}.font-display{font-family:var(--font-display)}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[1\.7rem\]{font-size:1.7rem}.text-\[1\.9rem\]{font-size:1.9rem}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.text-bg-deep{color:var(--color-bg-deep)}.text-danger{color:var(--color-danger)}.text-drift{color:var(--color-drift)}.text-ember{color:var(--color-ember)}.text-ember-bright{color:var(--color-ember-bright)}.text-ink{color:var(--color-ink)}.text-ink-dim{color:var(--color-ink-dim)}.text-ink-faint{color:var(--color-ink-faint)}.text-sync{color:var(--color-sync)}.text-warn{color:var(--color-warn)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-\[0_-12px_48px_oklch\(0\.08_0\.01_60\/0\.7\)\]{--tw-shadow:0 -12px 48px var(--tw-shadow-color,oklch(8% .01 60/.7));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:text-ember:is(:where(.group):hover *){color:var(--color-ember)}.group-hover\:text-ember-bright:is(:where(.group):hover *){color:var(--color-ember-bright)}.group-hover\:text-ink-dim:is(:where(.group):hover *){color:var(--color-ink-dim)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\:bg-surface:hover{background-color:var(--color-surface)}.hover\:bg-surface\/50:hover{background-color:#18130f80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-surface\/50:hover{background-color:color-mix(in oklab,var(--color-surface) 50%,transparent)}}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-ember:hover{color:var(--color-ember)}.hover\:text-ember-bright:hover{color:var(--color-ember-bright)}.hover\:text-ink:hover{color:var(--color-ink)}.hover\:text-ink-dim:hover{color:var(--color-ink-dim)}}}:root{--ease-out-quart:cubic-bezier(.25, 1, .5, 1);--ease-out-expo:cubic-bezier(.16, 1, .3, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--grid-line:oklch(32% .014 60/.1)}html{background:var(--color-bg);color:var(--color-ink);font-family:var(--font-sans);color-scheme:dark;font-size:15px}body{background:radial-gradient(70rem 40rem at -8% -12%,oklch(24% .035 55/.55),transparent 62%),linear-gradient(var(--grid-line) 1px,transparent 1px),linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);background-size:auto,46px 46px,46px 46px;background-attachment:fixed;min-height:100vh}::selection{background:var(--color-ember-dim);color:var(--color-ink)}:focus-visible{outline:1px solid var(--color-ember);outline-offset:2px}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--color-line);background-clip:content-box;border:3px solid #0000;border-radius:6px}::-webkit-scrollbar-thumb:hover{background:var(--color-line-strong);background-clip:content-box;border:3px solid #0000}@keyframes rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes wipe{0%{opacity:0;clip-path:inset(0 100% 0 0);transform:translateY(4px)}to{opacity:1;clip-path:inset(0 -2% 0 0);transform:translateY(0)}}@keyframes page-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes grow-x{0%{transform:scaleX(0)}to{transform:scaleX(1)}}@keyframes stamp{0%{opacity:0;transform:scale(1.25)}to{opacity:1;transform:scale(1)}}@keyframes ember-pulse{0%,to{opacity:1}50%{opacity:.35}}@keyframes dock-up{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}.rise{animation:rise .45s var(--ease-out-expo) both;animation-delay:calc(var(--i,0) * 35ms)}.wipe{animation:wipe .55s var(--ease-out-expo) both;animation-delay:calc(var(--i,0) * 35ms)}.page{animation:page-in .45s var(--ease-out-expo) both}.grow-x{transform-origin:0;animation:grow-x .7s var(--ease-out-expo) both;animation-delay:calc(var(--i,0) * 60ms)}.stamp{animation:stamp .3s var(--ease-out-quart) both}.ember-pulse{animation:ember-pulse 2.2s var(--ease-in-out) infinite}.dock-up{animation:dock-up .4s var(--ease-out-expo) both}.expander{transition:grid-template-rows .4s var(--ease-out-quart);grid-template-rows:0fr;display:grid}.expander[data-open=true]{grid-template-rows:1fr}.expander>*{min-width:0;overflow:hidden}.brk{position:relative}.brk:before,.brk:after{content:"";border:1px solid var(--color-ember);opacity:0;pointer-events:none;width:8px;height:8px;transition:opacity .15s linear,transform .25s var(--ease-out-quart);position:absolute}.brk:before{border-bottom:0;border-right:0;top:0;left:0;transform:translate(4px,4px)}.brk:after{border-top:0;border-left:0;bottom:0;right:0;transform:translate(-4px,-4px)}.brk:hover:before,.brk:hover:after,.brk[data-active=true]:before,.brk[data-active=true]:after{opacity:1;transform:translate(0)}.crate{font-family:var(--font-mono);letter-spacing:.22em;text-transform:uppercase;color:var(--color-ink-faint);align-items:center;gap:10px;font-size:11px;display:flex}.crate:before{content:"";background:var(--color-ember-dim);flex:none;width:14px;height:1px}.btn-ember{background:var(--color-ember);color:var(--color-bg-deep);font-family:var(--font-display);transition:background .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.42rem 1.1rem;font-size:.875rem;font-weight:600}.btn-ember:hover{background:var(--color-ember-bright)}.btn-ember:active{transform:scale(.97)}.btn-ember:disabled{opacity:.45;pointer-events:none}.btn-outline{border:1px solid var(--color-ember-dim);color:var(--color-ember);font-family:var(--font-display);transition:border-color .15s linear,color .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.42rem 1.1rem;font-size:.875rem;font-weight:500}.btn-outline:hover{border-color:var(--color-ember);color:var(--color-ember-bright)}.btn-outline:active{transform:scale(.97)}.btn-outline:disabled{opacity:.45;pointer-events:none}.btn-ghost{border:1px solid var(--color-line-strong);color:var(--color-ink-dim);font-family:var(--font-display);transition:border-color .15s linear,color .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.42rem .9rem;font-size:.875rem}.btn-ghost:hover{border-color:var(--color-ember-dim);color:var(--color-ink)}.btn-ghost:active{transform:scale(.97)}.btn-ghost:disabled{opacity:.45;pointer-events:none}.chip{border:1px solid var(--color-line);color:var(--color-ink-dim);transition:border-color .15s linear,color .15s linear,background .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.2rem .75rem;font-size:.85rem}.chip:hover{border-color:var(--color-line-strong);color:var(--color-ink)}.chip:active{transform:scale(.96)}.chip[data-on=true]{border-color:var(--color-ember-dim);background:var(--color-ember-faint);color:var(--color-ember-bright)}.field{border:1px solid var(--color-line);font-family:var(--font-mono);color:var(--color-ink);background:#130e0b;border-radius:2px;outline:none;padding:.42rem .75rem;font-size:.875rem;transition:border-color .15s linear}.field::placeholder{color:var(--color-ink-faint)}.field:focus{border-color:var(--color-ember-dim);outline:none}.tnum{font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-delay:0s!important}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0} +/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/chakra-petch-thai-500-normal-DeexCGiz.woff2)format("woff2"),url(/assets/chakra-petch-thai-500-normal-CJG_V2_m.woff)format("woff");unicode-range:U+2D7,U+303,U+331,U+E01-E5B,U+200C-200D,U+25CC}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(data:font/woff2;base64,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)format("woff2"),url(/assets/chakra-petch-vietnamese-500-normal-BVzUBLGs.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/chakra-petch-latin-ext-500-normal-gA6791b0.woff2)format("woff2"),url(/assets/chakra-petch-latin-ext-500-normal-BCHeNDEx.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/chakra-petch-latin-500-normal-BR1ody1F.woff2)format("woff2"),url(/assets/chakra-petch-latin-500-normal-CnUQnZ4D.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/chakra-petch-thai-600-normal-C620THcd.woff2)format("woff2"),url(/assets/chakra-petch-thai-600-normal-BiM5MXH8.woff)format("woff");unicode-range:U+2D7,U+303,U+331,U+E01-E5B,U+200C-200D,U+25CC}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(data:font/woff2;base64,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)format("woff2"),url(/assets/chakra-petch-vietnamese-600-normal-Pvj4qcw_.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/chakra-petch-latin-ext-600-normal-CdGvbdDU.woff2)format("woff2"),url(/assets/chakra-petch-latin-ext-600-normal-nL80L4xU.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/chakra-petch-latin-600-normal-DVQm9bgb.woff2)format("woff2"),url(/assets/chakra-petch-latin-600-normal-DQKfcdKo.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/chakra-petch-thai-700-normal-B7WL5pBr.woff2)format("woff2"),url(/assets/chakra-petch-thai-700-normal-vZLZ_5L8.woff)format("woff");unicode-range:U+2D7,U+303,U+331,U+E01-E5B,U+200C-200D,U+25CC}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(data:font/woff2;base64,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)format("woff2"),url(/assets/chakra-petch-vietnamese-700-normal-gQuUA8Wu.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/chakra-petch-latin-ext-700-normal-DAkvJhej.woff2)format("woff2"),url(/assets/chakra-petch-latin-ext-700-normal-BeviJPUl.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Chakra Petch;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/chakra-petch-latin-700-normal-CnDBPjkL.woff2)format("woff2"),url(/assets/chakra-petch-latin-700-normal-D1s_c2du.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/schibsted-grotesk-latin-ext-400-normal-DHVTfbSM.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-ext-400-normal-DUPvg9bQ.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/schibsted-grotesk-latin-400-normal-DPhJBilQ.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-400-normal-BkiRe4WW.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/schibsted-grotesk-latin-ext-500-normal-Ch1izu81.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-ext-500-normal-BjmYCtCC.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/schibsted-grotesk-latin-500-normal-rf9C4Thp.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-500-normal-Ba39e-CX.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/schibsted-grotesk-latin-ext-700-normal-o210KhU4.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-ext-700-normal-DDW2aNyx.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Schibsted Grotesk;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/schibsted-grotesk-latin-700-normal-BkH0uJ1o.woff2)format("woff2"),url(/assets/schibsted-grotesk-latin-700-normal-Dz-okVa0.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/red-hat-mono-latin-ext-400-normal-CTgQ0k1t.woff2)format("woff2"),url(/assets/red-hat-mono-latin-ext-400-normal-CQ9iMEKY.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/red-hat-mono-latin-400-normal-C-lyubUB.woff2)format("woff2"),url(/assets/red-hat-mono-latin-400-normal-CG-MPK9d.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/red-hat-mono-latin-ext-500-normal-DzmeEbMl.woff2)format("woff2"),url(/assets/red-hat-mono-latin-ext-500-normal-C50_0SE6.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Red Hat Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/red-hat-mono-latin-500-normal-CjZS5o_4.woff2)format("woff2"),url(/assets/red-hat-mono-latin-500-normal-C00uZsq5.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Schibsted Grotesk", system-ui, sans-serif;--font-mono:"Red Hat Mono", ui-monospace, monospace;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-xs:.125rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-display:"Chakra Petch", ui-sans-serif, sans-serif;--color-bg:oklch(15.5% .009 60);--color-bg-deep:oklch(12.5% .008 60);--color-surface:oklch(19% .011 60);--color-raised:oklch(22.5% .012 60);--color-line:oklch(28.5% .014 60);--color-line-strong:oklch(38% .016 60);--color-ink:oklch(93% .008 75);--color-ink-dim:oklch(67% .014 70);--color-ink-faint:oklch(50% .014 70);--color-ember:oklch(74% .14 55);--color-ember-bright:oklch(80% .15 60);--color-ember-dim:oklch(40% .07 55);--color-ember-faint:oklch(24% .03 55);--color-sync:oklch(74% .1 150);--color-sync-dim:oklch(34% .045 150);--color-warn:oklch(79% .11 85);--color-warn-dim:oklch(35% .05 85);--color-drift:oklch(74% .08 235);--color-drift-dim:oklch(33% .04 235);--color-danger:oklch(68% .15 25);--color-danger-dim:oklch(32% .06 25)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-x-0{inset-inline:0}.inset-x-2{inset-inline:calc(var(--spacing) * 2)}.inset-y-0{inset-block:0}.inset-y-1{inset-block:var(--spacing)}.top-4{top:calc(var(--spacing) * 4)}.top-10{top:calc(var(--spacing) * 10)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-\[11px\]{left:11px}.z-10{z-index:10}.z-\[1\]{z-index:1}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mt-14{margin-top:calc(var(--spacing) * 14)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-7{margin-bottom:calc(var(--spacing) * 7)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\[2px\]{height:2px}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-\[65vh\]{max-height:65vh}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-6{width:calc(var(--spacing) * 6)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-\[2px\]{width:2px}.w-\[3px\]{width:3px}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[9rem\]{max-width:9rem}.max-w-\[65ch\]{max-width:65ch}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[6px\]{min-width:6px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-14{gap:calc(var(--spacing) * 14)}.gap-\[3px\]{gap:3px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-7{column-gap:calc(var(--spacing) * 7)}.gap-x-10{column-gap:calc(var(--spacing) * 10)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--color-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-ember{border-color:var(--color-ember)}.border-ember-dim{border-color:var(--color-ember-dim)}.border-line{border-color:var(--color-line)}.border-line-strong{border-color:var(--color-line-strong)}.bg-bg{background-color:var(--color-bg)}.bg-bg-deep\/60{background-color:#09060499}@supports (color:color-mix(in lab,red,red)){.bg-bg-deep\/60{background-color:color-mix(in oklab,var(--color-bg-deep) 60%,transparent)}}.bg-danger{background-color:var(--color-danger)}.bg-drift{background-color:var(--color-drift)}.bg-ember{background-color:var(--color-ember)}.bg-ember-faint{background-color:var(--color-ember-faint)}.bg-ink-dim{background-color:var(--color-ink-dim)}.bg-ink-faint{background-color:var(--color-ink-faint)}.bg-line{background-color:var(--color-line)}.bg-raised{background-color:var(--color-raised)}.bg-surface{background-color:var(--color-surface)}.bg-surface\/40{background-color:#18130f66}@supports (color:color-mix(in lab,red,red)){.bg-surface\/40{background-color:color-mix(in oklab,var(--color-surface) 40%,transparent)}}.bg-surface\/60{background-color:#18130f99}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--color-surface) 60%,transparent)}}.bg-sync{background-color:var(--color-sync)}.bg-warn{background-color:var(--color-warn)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-40{padding-bottom:calc(var(--spacing) * 40)}.pl-1{padding-left:var(--spacing)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-baseline{vertical-align:baseline}.align-middle{vertical-align:middle}.font-display{font-family:var(--font-display)}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[1\.7rem\]{font-size:1.7rem}.text-\[1\.9rem\]{font-size:1.9rem}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.text-bg-deep{color:var(--color-bg-deep)}.text-danger{color:var(--color-danger)}.text-drift{color:var(--color-drift)}.text-ember{color:var(--color-ember)}.text-ember-bright{color:var(--color-ember-bright)}.text-ink{color:var(--color-ink)}.text-ink-dim{color:var(--color-ink-dim)}.text-ink-faint{color:var(--color-ink-faint)}.text-sync{color:var(--color-sync)}.text-warn{color:var(--color-warn)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-\[0_-12px_48px_oklch\(0\.08_0\.01_60\/0\.7\)\]{--tw-shadow:0 -12px 48px var(--tw-shadow-color,oklch(8% .01 60/.7));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:text-ember:is(:where(.group):hover *){color:var(--color-ember)}.group-hover\:text-ember-bright:is(:where(.group):hover *){color:var(--color-ember-bright)}.group-hover\:text-ink-dim:is(:where(.group):hover *){color:var(--color-ink-dim)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\:bg-surface:hover{background-color:var(--color-surface)}.hover\:bg-surface\/50:hover{background-color:#18130f80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-surface\/50:hover{background-color:color-mix(in oklab,var(--color-surface) 50%,transparent)}}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-ember:hover{color:var(--color-ember)}.hover\:text-ember-bright:hover{color:var(--color-ember-bright)}.hover\:text-ink:hover{color:var(--color-ink)}.hover\:text-ink-dim:hover{color:var(--color-ink-dim)}}}:root{--ease-out-quart:cubic-bezier(.25, 1, .5, 1);--ease-out-expo:cubic-bezier(.16, 1, .3, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--grid-line:oklch(32% .014 60/.1)}html{background:var(--color-bg);color:var(--color-ink);font-family:var(--font-sans);color-scheme:dark;font-size:15px}body{background:radial-gradient(70rem 40rem at -8% -12%,oklch(24% .035 55/.55),transparent 62%),linear-gradient(var(--grid-line) 1px,transparent 1px),linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);background-size:auto,46px 46px,46px 46px;background-attachment:fixed;min-height:100vh}::selection{background:var(--color-ember-dim);color:var(--color-ink)}:focus-visible{outline:1px solid var(--color-ember);outline-offset:2px}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--color-line);background-clip:content-box;border:3px solid #0000;border-radius:6px}::-webkit-scrollbar-thumb:hover{background:var(--color-line-strong);background-clip:content-box;border:3px solid #0000}@keyframes rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes wipe{0%{opacity:0;clip-path:inset(0 100% 0 0);transform:translateY(4px)}to{opacity:1;clip-path:inset(0 -2% 0 0);transform:translateY(0)}}@keyframes page-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes grow-x{0%{transform:scaleX(0)}to{transform:scaleX(1)}}@keyframes stamp{0%{opacity:0;transform:scale(1.25)}to{opacity:1;transform:scale(1)}}@keyframes ember-pulse{0%,to{opacity:1}50%{opacity:.35}}@keyframes dock-up{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}.rise{animation:rise .45s var(--ease-out-expo) both;animation-delay:calc(var(--i,0) * 35ms)}.wipe{animation:wipe .55s var(--ease-out-expo) both;animation-delay:calc(var(--i,0) * 35ms)}.page{animation:page-in .45s var(--ease-out-expo) both}.grow-x{transform-origin:0;animation:grow-x .7s var(--ease-out-expo) both;animation-delay:calc(var(--i,0) * 60ms)}.stamp{animation:stamp .3s var(--ease-out-quart) both}.ember-pulse{animation:ember-pulse 2.2s var(--ease-in-out) infinite}.dock-up{animation:dock-up .4s var(--ease-out-expo) both}.expander{transition:grid-template-rows .4s var(--ease-out-quart);grid-template-rows:0fr;display:grid}.expander[data-open=true]{grid-template-rows:1fr}.expander>*{min-width:0;overflow:hidden}.brk{position:relative}.brk:before,.brk:after{content:"";border:1px solid var(--color-ember);opacity:0;pointer-events:none;width:8px;height:8px;transition:opacity .15s linear,transform .25s var(--ease-out-quart);position:absolute}.brk:before{border-bottom:0;border-right:0;top:0;left:0;transform:translate(4px,4px)}.brk:after{border-top:0;border-left:0;bottom:0;right:0;transform:translate(-4px,-4px)}.brk:hover:before,.brk:hover:after,.brk[data-active=true]:before,.brk[data-active=true]:after{opacity:1;transform:translate(0)}.crate{font-family:var(--font-mono);letter-spacing:.22em;text-transform:uppercase;color:var(--color-ink-faint);align-items:center;gap:10px;font-size:11px;display:flex}.crate:before{content:"";background:var(--color-ember-dim);flex:none;width:14px;height:1px}.btn-ember{background:var(--color-ember);color:var(--color-bg-deep);font-family:var(--font-display);transition:background .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.42rem 1.1rem;font-size:.875rem;font-weight:600}.btn-ember:hover{background:var(--color-ember-bright)}.btn-ember:active{transform:scale(.97)}.btn-ember:disabled{opacity:.45;pointer-events:none}.btn-outline{border:1px solid var(--color-ember-dim);color:var(--color-ember);font-family:var(--font-display);transition:border-color .15s linear,color .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.42rem 1.1rem;font-size:.875rem;font-weight:500}.btn-outline:hover{border-color:var(--color-ember);color:var(--color-ember-bright)}.btn-outline:active{transform:scale(.97)}.btn-outline:disabled{opacity:.45;pointer-events:none}.btn-ghost{border:1px solid var(--color-line-strong);color:var(--color-ink-dim);font-family:var(--font-display);transition:border-color .15s linear,color .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.42rem .9rem;font-size:.875rem}.btn-ghost:hover{border-color:var(--color-ember-dim);color:var(--color-ink)}.btn-ghost:active{transform:scale(.97)}.btn-ghost:disabled{opacity:.45;pointer-events:none}.chip{border:1px solid var(--color-line);color:var(--color-ink-dim);transition:border-color .15s linear,color .15s linear,background .15s linear,transform .1s var(--ease-out-quart);border-radius:2px;padding:.2rem .75rem;font-size:.85rem}.chip:hover{border-color:var(--color-line-strong);color:var(--color-ink)}.chip:active{transform:scale(.96)}.chip[data-on=true]{border-color:var(--color-ember-dim);background:var(--color-ember-faint);color:var(--color-ember-bright)}.field{border:1px solid var(--color-line);font-family:var(--font-mono);color:var(--color-ink);background:#130e0b;border-radius:2px;outline:none;padding:.42rem .75rem;font-size:.875rem;transition:border-color .15s linear}.field::placeholder{color:var(--color-ink-faint)}.field:focus{border-color:var(--color-ember-dim);outline:none}.tnum{font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-delay:0s!important}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0} diff --git a/internal/web/dist/assets/index-zCJlhxCm.js b/internal/web/dist/assets/index-zCJlhxCm.js new file mode 100644 index 0000000..4018330 --- /dev/null +++ b/internal/web/dist/assets/index-zCJlhxCm.js @@ -0,0 +1,67 @@ +var Xy=l=>{throw TypeError(l)};var Xo=(l,i,s)=>i.has(l)||Xy("Cannot "+s);var R=(l,i,s)=>(Xo(l,i,"read from private field"),s?s.call(l):i.get(l)),rt=(l,i,s)=>i.has(l)?Xy("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(l):i.set(l,s),nt=(l,i,s,c)=>(Xo(l,i,"write to private field"),c?c.call(l,s):i.set(l,s),s),yt=(l,i,s)=>(Xo(l,i,"access private method"),s);var rc=(l,i,s,c)=>({set _(o){nt(l,i,o,s)},get _(){return R(l,i,c)}});(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(o){if(o.ep)return;o.ep=!0;const f=s(o);fetch(o.href,f)}})();function c0(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Vo={exports:{}},Es={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vy;function r0(){if(Vy)return Es;Vy=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(c,o,f){var m=null;if(f!==void 0&&(m=""+f),o.key!==void 0&&(m=""+o.key),"key"in o){f={};for(var v in o)v!=="key"&&(f[v]=o[v])}else f=o;return o=f.ref,{$$typeof:l,type:c,key:m,ref:o!==void 0?o:null,props:f}}return Es.Fragment=i,Es.jsx=s,Es.jsxs=s,Es}var Zy;function o0(){return Zy||(Zy=1,Vo.exports=r0()),Vo.exports}var d=o0(),Zo={exports:{}},dt={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jy;function f0(){if(Jy)return dt;Jy=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),S=Symbol.iterator;function j(M){return M===null||typeof M!="object"?null:(M=S&&M[S]||M["@@iterator"],typeof M=="function"?M:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function C(M,J,et){this.props=M,this.context=J,this.refs=w,this.updater=et||N}C.prototype.isReactComponent={},C.prototype.setState=function(M,J){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,J,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function D(){}D.prototype=C.prototype;function G(M,J,et){this.props=M,this.context=J,this.refs=w,this.updater=et||N}var A=G.prototype=new D;A.constructor=G,_(A,C.prototype),A.isPureReactComponent=!0;var q=Array.isArray;function U(){}var z={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function I(M,J,et){var lt=et.ref;return{$$typeof:l,type:M,key:J,ref:lt!==void 0?lt:null,props:et}}function $(M,J){return I(M.type,J,M.props)}function X(M){return typeof M=="object"&&M!==null&&M.$$typeof===l}function tt(M){var J={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(et){return J[et]})}var W=/\/+/g;function at(M,J){return typeof M=="object"&&M!==null&&M.key!=null?tt(""+M.key):J.toString(36)}function gt(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(U,U):(M.status="pending",M.then(function(J){M.status==="pending"&&(M.status="fulfilled",M.value=J)},function(J){M.status==="pending"&&(M.status="rejected",M.reason=J)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function k(M,J,et,lt,ct){var pt=typeof M;(pt==="undefined"||pt==="boolean")&&(M=null);var Rt=!1;if(M===null)Rt=!0;else switch(pt){case"bigint":case"string":case"number":Rt=!0;break;case"object":switch(M.$$typeof){case l:case i:Rt=!0;break;case b:return Rt=M._init,k(Rt(M._payload),J,et,lt,ct)}}if(Rt)return ct=ct(M),Rt=lt===""?"."+at(M,0):lt,q(ct)?(et="",Rt!=null&&(et=Rt.replace(W,"$&/")+"/"),k(ct,J,et,"",function(gn){return gn})):ct!=null&&(X(ct)&&(ct=$(ct,et+(ct.key==null||M&&M.key===ct.key?"":(""+ct.key).replace(W,"$&/")+"/")+Rt)),J.push(ct)),1;Rt=0;var Qt=lt===""?".":lt+":";if(q(M))for(var qt=0;qt>>1,At=k[Mt];if(0>>1;Mto(et,ut))lto(ct,et)?(k[Mt]=ct,k[lt]=ut,Mt=lt):(k[Mt]=et,k[J]=ut,Mt=J);else if(lto(ct,ut))k[Mt]=ct,k[lt]=ut,Mt=lt;else break t}}return Z}function o(k,Z){var ut=k.sortIndex-Z.sortIndex;return ut!==0?ut:k.id-Z.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();l.unstable_now=function(){return m.now()-v}}var g=[],y=[],b=1,p=null,S=3,j=!1,N=!1,_=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function A(k){for(var Z=s(y);Z!==null;){if(Z.callback===null)c(y);else if(Z.startTime<=k)c(y),Z.sortIndex=Z.expirationTime,i(g,Z);else break;Z=s(y)}}function q(k){if(_=!1,A(k),!N)if(s(g)!==null)N=!0,U||(U=!0,tt());else{var Z=s(y);Z!==null&>(q,Z.startTime-k)}}var U=!1,z=-1,Y=5,I=-1;function $(){return w?!0:!(l.unstable_now()-Ik&&$());){var Mt=p.callback;if(typeof Mt=="function"){p.callback=null,S=p.priorityLevel;var At=Mt(p.expirationTime<=k);if(k=l.unstable_now(),typeof At=="function"){p.callback=At,A(k),Z=!0;break e}p===s(g)&&c(g),A(k)}else c(g);p=s(g)}if(p!==null)Z=!0;else{var M=s(y);M!==null&>(q,M.startTime-k),Z=!1}}break t}finally{p=null,S=ut,j=!1}Z=void 0}}finally{Z?tt():U=!1}}}var tt;if(typeof G=="function")tt=function(){G(X)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,at=W.port2;W.port1.onmessage=X,tt=function(){at.postMessage(null)}}else tt=function(){C(X,0)};function gt(k,Z){z=C(function(){k(l.unstable_now())},Z)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(k){k.callback=null},l.unstable_forceFrameRate=function(k){0>k||125Mt?(k.sortIndex=ut,i(y,k),s(g)===null&&k===s(y)&&(_?(D(z),z=-1):_=!0,gt(q,ut-Mt))):(k.sortIndex=At,i(g,k),N||j||(N=!0,U||(U=!0,tt()))),k},l.unstable_shouldYield=$,l.unstable_wrapCallback=function(k){var Z=S;return function(){var ut=S;S=Z;try{return k.apply(this,arguments)}finally{S=ut}}}})(Fo)),Fo}var Iy;function h0(){return Iy||(Iy=1,Po.exports=d0()),Po.exports}var Io={exports:{}},ye={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $y;function m0(){if($y)return ye;$y=1;var l=Ks();function i(g){var y="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),Io.exports=m0(),Io.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tp;function y0(){if(tp)return Rs;tp=1;var l=h0(),i=Ks(),s=$p();function c(t){var e="https://react.dev/errors/"+t;if(1At||(t.current=Mt[At],Mt[At]=null,At--)}function et(t,e){At++,Mt[At]=t.current,t.current=e}var lt=M(null),ct=M(null),pt=M(null),Rt=M(null);function Qt(t,e){switch(et(pt,e),et(ct,t),et(lt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?my(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=my(e),t=yy(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(lt),et(lt,t)}function qt(){J(lt),J(ct),J(pt)}function gn(t){t.memoizedState!==null&&et(Rt,t);var e=lt.current,n=yy(e,t.type);e!==n&&(et(ct,t),et(lt,n))}function vn(t){ct.current===t&&(J(lt),J(ct)),Rt.current===t&&(J(Rt),bs._currentValue=ut)}var Pn,Ci;function un(t){if(Pn===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Pn=e&&e[1]||"",Ci=-1)":-1u||E[a]!==B[u]){var K=` +`+E[a].replace(" at new "," at ");return t.displayName&&K.includes("")&&(K=K.replace("",t.displayName)),K}while(1<=a&&0<=u);break}}}finally{Ai=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?un(n):""}function Xs(t,e){switch(t.tag){case 26:case 27:case 5:return un(t.type);case 16:return un("Lazy");case 13:return t.child!==e&&e!==null?un("Suspense Fallback"):un("Suspense");case 19:return un("SuspenseList");case 0:case 15:return Nl(t.type,!1);case 11:return Nl(t.type.render,!1);case 1:return Nl(t.type,!0);case 31:return un("Activity");default:return""}}function xn(t){try{var e="",n=null;do e+=Xs(t,n),n=t,t=t.return;while(t);return e}catch(a){return` +Error generating stack: `+a.message+` +`+a.stack}}var qa=Object.prototype.hasOwnProperty,en=l.unstable_scheduleCallback,wi=l.unstable_cancelCallback,Vs=l.unstable_shouldYield,wc=l.unstable_requestPaint,me=l.unstable_now,Dt=l.unstable_getCurrentPriorityLevel,ce=l.unstable_ImmediatePriority,cn=l.unstable_UserBlockingPriority,El=l.unstable_NormalPriority,Gg=l.unstable_LowPriority,Jf=l.unstable_IdlePriority,Kg=l.log,Xg=l.unstable_setDisableYieldValue,Oi=null,Oe=null;function Fn(t){if(typeof Kg=="function"&&Xg(t),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Oi,t)}catch{}}var ze=Math.clz32?Math.clz32:Jg,Vg=Math.log,Zg=Math.LN2;function Jg(t){return t>>>=0,t===0?32:31-(Vg(t)/Zg|0)|0}var Zs=256,Js=262144,Ps=4194304;function Ha(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Fs(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var u=0,r=t.suspendedLanes,h=t.pingedLanes;t=t.warmLanes;var x=a&134217727;return x!==0?(a=x&~r,a!==0?u=Ha(a):(h&=x,h!==0?u=Ha(h):n||(n=x&~t,n!==0&&(u=Ha(n))))):(x=a&~r,x!==0?u=Ha(x):h!==0?u=Ha(h):n||(n=a&~t,n!==0&&(u=Ha(n)))),u===0?0:e!==0&&e!==u&&(e&r)===0&&(r=u&-u,n=e&-e,r>=n||r===32&&(n&4194048)!==0)?e:u}function zi(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Pg(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pf(){var t=Ps;return Ps<<=1,(Ps&62914560)===0&&(Ps=4194304),t}function Oc(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Di(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Fg(t,e,n,a,u,r){var h=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var x=t.entanglements,E=t.expirationTimes,B=t.hiddenUpdates;for(n=h&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var nv=/[\n"\\]/g;function Xe(t){return t.replace(nv,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function qc(t,e,n,a,u,r,h,x){t.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.type=h:t.removeAttribute("type"),e!=null?h==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ke(e)):t.value!==""+Ke(e)&&(t.value=""+Ke(e)):h!=="submit"&&h!=="reset"||t.removeAttribute("value"),e!=null?Hc(t,h,Ke(e)):n!=null?Hc(t,h,Ke(n)):a!=null&&t.removeAttribute("value"),u==null&&r!=null&&(t.defaultChecked=!!r),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?t.name=""+Ke(x):t.removeAttribute("name")}function cd(t,e,n,a,u,r,h,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.type=r),e!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||e!=null)){Bc(t);return}n=n!=null?""+Ke(n):"",e=e!=null?""+Ke(e):n,x||e===t.value||(t.value=e),t.defaultValue=e}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=x?t.checked:!!a,t.defaultChecked=!!a,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.name=h),Bc(t)}function Hc(t,e,n){e==="number"&&Ws(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Al(t,e,n,a){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kc=!1;if(jn)try{var qi={};Object.defineProperty(qi,"passive",{get:function(){Kc=!0}}),window.addEventListener("test",qi,qi),window.removeEventListener("test",qi,qi)}catch{Kc=!1}var $n=null,Xc=null,eu=null;function yd(){if(eu)return eu;var t,e=Xc,n=e.length,a,u="value"in $n?$n.value:$n.textContent,r=u.length;for(t=0;t=Qi),Sd=" ",jd=!1;function Nd(t,e){switch(t){case"keyup":return Av.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ed(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Dl=!1;function Ov(t,e){switch(t){case"compositionend":return Ed(e);case"keypress":return e.which!==32?null:(jd=!0,Sd);case"textInput":return t=e.data,t===Sd&&jd?null:t;default:return null}}function zv(t,e){if(Dl)return t==="compositionend"||!Fc&&Nd(t,e)?(t=yd(),eu=Xc=$n=null,Dl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=a}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Od(n)}}function Dd(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Dd(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ld(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ws(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ws(t.document)}return e}function Wc(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Qv=jn&&"documentMode"in document&&11>=document.documentMode,Ll=null,tr=null,Xi=null,er=!1;function Ud(t,e,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;er||Ll==null||Ll!==Ws(a)||(a=Ll,"selectionStart"in a&&Wc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Xi&&Ki(Xi,a)||(Xi=a,a=Ju(tr,"onSelect"),0>=h,u-=h,rn=1<<32-ze(e)+u|n<mt?(jt=st,st=null):jt=st.sibling;var Tt=H(O,st,L[mt],V);if(Tt===null){st===null&&(st=jt);break}t&&st&&Tt.alternate===null&&e(O,st),T=r(Tt,T,mt),_t===null?ot=Tt:_t.sibling=Tt,_t=Tt,st=jt}if(mt===L.length)return n(O,st),Nt&&En(O,mt),ot;if(st===null){for(;mtmt?(jt=st,st=null):jt=st.sibling;var ba=H(O,st,Tt.value,V);if(ba===null){st===null&&(st=jt);break}t&&st&&ba.alternate===null&&e(O,st),T=r(ba,T,mt),_t===null?ot=ba:_t.sibling=ba,_t=ba,st=jt}if(Tt.done)return n(O,st),Nt&&En(O,mt),ot;if(st===null){for(;!Tt.done;mt++,Tt=L.next())Tt=P(O,Tt.value,V),Tt!==null&&(T=r(Tt,T,mt),_t===null?ot=Tt:_t.sibling=Tt,_t=Tt);return Nt&&En(O,mt),ot}for(st=a(st);!Tt.done;mt++,Tt=L.next())Tt=Q(st,O,mt,Tt.value,V),Tt!==null&&(t&&Tt.alternate!==null&&st.delete(Tt.key===null?mt:Tt.key),T=r(Tt,T,mt),_t===null?ot=Tt:_t.sibling=Tt,_t=Tt);return t&&st.forEach(function(u0){return e(O,u0)}),Nt&&En(O,mt),ot}function Bt(O,T,L,V){if(typeof L=="object"&&L!==null&&L.type===_&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case j:t:{for(var ot=L.key;T!==null;){if(T.key===ot){if(ot=L.type,ot===_){if(T.tag===7){n(O,T.sibling),V=u(T,L.props.children),V.return=O,O=V;break t}}else if(T.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===Y&&Fa(ot)===T.type){n(O,T.sibling),V=u(T,L.props),Ii(V,L),V.return=O,O=V;break t}n(O,T);break}else e(O,T);T=T.sibling}L.type===_?(V=Xa(L.props.children,O.mode,V,L.key),V.return=O,O=V):(V=fu(L.type,L.key,L.props,null,O.mode,V),Ii(V,L),V.return=O,O=V)}return h(O);case N:t:{for(ot=L.key;T!==null;){if(T.key===ot)if(T.tag===4&&T.stateNode.containerInfo===L.containerInfo&&T.stateNode.implementation===L.implementation){n(O,T.sibling),V=u(T,L.children||[]),V.return=O,O=V;break t}else{n(O,T);break}else e(O,T);T=T.sibling}V=cr(L,O.mode,V),V.return=O,O=V}return h(O);case Y:return L=Fa(L),Bt(O,T,L,V)}if(gt(L))return it(O,T,L,V);if(tt(L)){if(ot=tt(L),typeof ot!="function")throw Error(c(150));return L=ot.call(L),ft(O,T,L,V)}if(typeof L.then=="function")return Bt(O,T,vu(L),V);if(L.$$typeof===G)return Bt(O,T,mu(O,L),V);xu(O,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,T!==null&&T.tag===6?(n(O,T.sibling),V=u(T,L),V.return=O,O=V):(n(O,T),V=ur(L,O.mode,V),V.return=O,O=V),h(O)):n(O,T)}return function(O,T,L,V){try{Fi=0;var ot=Bt(O,T,L,V);return Vl=null,ot}catch(st){if(st===Xl||st===pu)throw st;var _t=Le(29,st,null,O.mode);return _t.lanes=V,_t.return=O,_t}finally{}}}var $a=ih(!0),sh=ih(!1),aa=!1;function br(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sr(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function la(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ia(t,e,n){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Ct&2)!==0){var u=a.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),a.pending=e,e=ou(t),Gd(t,null,n),e}return ru(t,a,e,n),ou(t)}function $i(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,If(t,n)}}function jr(t,e){var n=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?u=r=h:r=r.next=h,n=n.next}while(n!==null);r===null?u=r=e:r=r.next=e}else u=r=e;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Nr=!1;function Wi(){if(Nr){var t=Kl;if(t!==null)throw t}}function ts(t,e,n,a){Nr=!1;var u=t.updateQueue;aa=!1;var r=u.firstBaseUpdate,h=u.lastBaseUpdate,x=u.shared.pending;if(x!==null){u.shared.pending=null;var E=x,B=E.next;E.next=null,h===null?r=B:h.next=B,h=E;var K=t.alternate;K!==null&&(K=K.updateQueue,x=K.lastBaseUpdate,x!==h&&(x===null?K.firstBaseUpdate=B:x.next=B,K.lastBaseUpdate=E))}if(r!==null){var P=u.baseState;h=0,K=B=E=null,x=r;do{var H=x.lane&-536870913,Q=H!==x.lane;if(Q?(St&H)===H:(a&H)===H){H!==0&&H===Gl&&(Nr=!0),K!==null&&(K=K.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});t:{var it=t,ft=x;H=e;var Bt=n;switch(ft.tag){case 1:if(it=ft.payload,typeof it=="function"){P=it.call(Bt,P,H);break t}P=it;break t;case 3:it.flags=it.flags&-65537|128;case 0:if(it=ft.payload,H=typeof it=="function"?it.call(Bt,P,H):it,H==null)break t;P=p({},P,H);break t;case 2:aa=!0}}H=x.callback,H!==null&&(t.flags|=64,Q&&(t.flags|=8192),Q=u.callbacks,Q===null?u.callbacks=[H]:Q.push(H))}else Q={lane:H,tag:x.tag,payload:x.payload,callback:x.callback,next:null},K===null?(B=K=Q,E=P):K=K.next=Q,h|=H;if(x=x.next,x===null){if(x=u.shared.pending,x===null)break;Q=x,x=Q.next,Q.next=null,u.lastBaseUpdate=Q,u.shared.pending=null}}while(!0);K===null&&(E=P),u.baseState=E,u.firstBaseUpdate=B,u.lastBaseUpdate=K,r===null&&(u.shared.lanes=0),oa|=h,t.lanes=h,t.memoizedState=P}}function uh(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function ch(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;tr?r:8;var h=k.T,x={};k.T=x,Yr(t,!1,e,n);try{var E=u(),B=k.S;if(B!==null&&B(x,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var K=Fv(E,a);as(t,e,K,ke(t))}else as(t,e,a,ke(t))}catch(P){as(t,e,{then:function(){},status:"rejected",reason:P},ke())}finally{Z.p=r,h!==null&&x.types!==null&&(h.types=x.types),k.T=h}}function nx(){}function kr(t,e,n,a){if(t.tag!==5)throw Error(c(476));var u=kh(t).queue;Hh(t,u,e,ut,n===null?nx:function(){return Qh(t),n(a)})}function kh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ut,baseState:ut,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mn,lastRenderedState:ut},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Qh(t){var e=kh(t);e.next===null&&(e=t.alternate.memoizedState),as(t,e.next.queue,{},ke())}function Qr(){return fe(bs)}function Yh(){return Ft().memoizedState}function Gh(){return Ft().memoizedState}function ax(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=ke();t=la(n);var a=ia(e,t,n);a!==null&&(Me(a,e,n),$i(a,e,n)),e={cache:pr()},t.payload=e;return}e=e.return}}function lx(t,e,n){var a=ke();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cu(t)?Xh(e,n):(n=ir(t,e,n,a),n!==null&&(Me(n,t,a),Vh(n,e,a)))}function Kh(t,e,n){var a=ke();as(t,e,n,a)}function as(t,e,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cu(t))Xh(e,u);else{var r=t.alternate;if(t.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var h=e.lastRenderedState,x=r(h,n);if(u.hasEagerState=!0,u.eagerState=x,De(x,h))return ru(t,e,u,0),Ht===null&&cu(),!1}catch{}finally{}if(n=ir(t,e,u,a),n!==null)return Me(n,t,a),Vh(n,e,a),!0}return!1}function Yr(t,e,n,a){if(a={lane:2,revertLane:So(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Cu(t)){if(e)throw Error(c(479))}else e=ir(t,n,a,2),e!==null&&Me(e,t,2)}function Cu(t){var e=t.alternate;return t===ht||e!==null&&e===ht}function Xh(t,e){Jl=ju=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Vh(t,e,n){if((n&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,If(t,n)}}var ls={readContext:fe,use:Ru,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt};ls.useEffectEvent=Vt;var Zh={readContext:fe,use:Ru,useCallback:function(t,e){return ve().memoizedState=[t,e===void 0?null:e],t},useContext:fe,useEffect:Ah,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Tu(4194308,4,Dh.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Tu(4194308,4,t,e)},useInsertionEffect:function(t,e){Tu(4,2,t,e)},useMemo:function(t,e){var n=ve();e=e===void 0?null:e;var a=t();if(Wa){Fn(!0);try{t()}finally{Fn(!1)}}return n.memoizedState=[a,e],a},useReducer:function(t,e,n){var a=ve();if(n!==void 0){var u=n(e);if(Wa){Fn(!0);try{n(e)}finally{Fn(!1)}}}else u=e;return a.memoizedState=a.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},a.queue=t,t=t.dispatch=lx.bind(null,ht,t),[a.memoizedState,t]},useRef:function(t){var e=ve();return t={current:t},e.memoizedState=t},useState:function(t){t=Lr(t);var e=t.queue,n=Kh.bind(null,ht,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:qr,useDeferredValue:function(t,e){var n=ve();return Hr(n,t,e)},useTransition:function(){var t=Lr(!1);return t=Hh.bind(null,ht,t.queue,!0,!1),ve().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var a=ht,u=ve();if(Nt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=e(),Ht===null)throw Error(c(349));(St&127)!==0||mh(a,e,n)}u.memoizedState=n;var r={value:n,getSnapshot:e};return u.queue=r,Ah(ph.bind(null,a,r,t),[t]),a.flags|=2048,Fl(9,{destroy:void 0},yh.bind(null,a,r,n,e),null),n},useId:function(){var t=ve(),e=Ht.identifierPrefix;if(Nt){var n=on,a=rn;n=(a&~(1<<32-ze(a)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Nu++,0<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?h.createElement("select",{is:a.is}):h.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?h.createElement(u,{is:a.is}):h.createElement(u)}}r[re]=e,r[je]=a;t:for(h=e.child;h!==null;){if(h.tag===5||h.tag===6)r.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break t;for(;h.sibling===null;){if(h.return===null||h.return===e)break t;h=h.return}h.sibling.return=h.return,h=h.sibling}e.stateNode=r;t:switch(he(r,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&An(e)}}return Gt(e),no(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&An(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(c(166));if(t=pt.current,Ql(e)){if(t=e.stateNode,n=e.memoizedProps,a=null,u=oe,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}t[re]=e,t=!!(t.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||dy(t.nodeValue,n)),t||ea(e,!0)}else t=Pu(t).createTextNode(a),t[re]=e,e.stateNode=t}return Gt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(a=Ql(e),n!==null){if(t===null){if(!a)throw Error(c(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[re]=e}else Va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Gt(e),t=!1}else n=dr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Be(e),e):(Be(e),null);if((e.flags&128)!==0)throw Error(c(558))}return Gt(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=Ql(e),a!==null&&a.dehydrated!==null){if(t===null){if(!u)throw Error(c(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[re]=e}else Va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Gt(e),u=!1}else u=dr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(Be(e),e):(Be(e),null)}return Be(e),(e.flags&128)!==0?(e.lanes=n,e):(n=a!==null,t=t!==null&&t.memoizedState!==null,n&&(a=e.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==u&&(a.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Du(e,e.updateQueue),Gt(e),null);case 4:return qt(),t===null&&Ro(e.stateNode.containerInfo),Gt(e),null;case 10:return _n(e.type),Gt(e),null;case 19:if(J(Pt),a=e.memoizedState,a===null)return Gt(e),null;if(u=(e.flags&128)!==0,r=a.rendering,r===null)if(u)ss(a,!1);else{if(Zt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(r=Su(t),r!==null){for(e.flags|=128,ss(a,!1),t=r.updateQueue,e.updateQueue=t,Du(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Kd(n,t),n=n.sibling;return et(Pt,Pt.current&1|2),Nt&&En(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&me()>Hu&&(e.flags|=128,u=!0,ss(a,!1),e.lanes=4194304)}else{if(!u)if(t=Su(r),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,Du(e,t),ss(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Nt)return Gt(e),null}else 2*me()-a.renderingStartTime>Hu&&n!==536870912&&(e.flags|=128,u=!0,ss(a,!1),e.lanes=4194304);a.isBackwards?(r.sibling=e.child,e.child=r):(t=a.last,t!==null?t.sibling=r:e.child=r,a.last=r)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=me(),t.sibling=null,n=Pt.current,et(Pt,u?n&1|2:n&1),Nt&&En(e,a.treeForkCount),t):(Gt(e),null);case 22:case 23:return Be(e),Rr(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(n&536870912)!==0&&(e.flags&128)===0&&(Gt(e),e.subtreeFlags&6&&(e.flags|=8192)):Gt(e),n=e.updateQueue,n!==null&&Du(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==n&&(e.flags|=2048),t!==null&&J(Pa),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),_n(It),Gt(e),null;case 25:return null;case 30:return null}throw Error(c(156,e.tag))}function rx(t,e){switch(or(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return _n(It),qt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return vn(e),null;case 31:if(e.memoizedState!==null){if(Be(e),e.alternate===null)throw Error(c(340));Va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Be(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));Va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return J(Pt),null;case 4:return qt(),null;case 10:return _n(e.type),null;case 22:case 23:return Be(e),Rr(),t!==null&&J(Pa),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return _n(It),null;case 25:return null;default:return null}}function gm(t,e){switch(or(e),e.tag){case 3:_n(It),qt();break;case 26:case 27:case 5:vn(e);break;case 4:qt();break;case 31:e.memoizedState!==null&&Be(e);break;case 13:Be(e);break;case 19:J(Pt);break;case 10:_n(e.type);break;case 22:case 23:Be(e),Rr(),t!==null&&J(Pa);break;case 24:_n(It)}}function us(t,e){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&t)===t){a=void 0;var r=n.create,h=n.inst;a=r(),h.destroy=a}n=n.next}while(n!==u)}}catch(x){zt(e,e.return,x)}}function ca(t,e,n){try{var a=e.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var r=u.next;a=r;do{if((a.tag&t)===t){var h=a.inst,x=h.destroy;if(x!==void 0){h.destroy=void 0,u=e;var E=n,B=x;try{B()}catch(K){zt(u,E,K)}}}a=a.next}while(a!==r)}}catch(K){zt(e,e.return,K)}}function vm(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{ch(e,n)}catch(a){zt(t,t.return,a)}}}function xm(t,e,n){n.props=tl(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(a){zt(t,e,a)}}function cs(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof n=="function"?t.refCleanup=n(a):n.current=a}}catch(u){zt(t,e,u)}}function fn(t,e){var n=t.ref,a=t.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){zt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){zt(t,e,u)}else n.current=null}function bm(t){var e=t.type,n=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break t;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){zt(t,t.return,u)}}function ao(t,e,n){try{var a=t.stateNode;wx(a,t.type,n,e),a[je]=e}catch(u){zt(t,t.return,u)}}function Sm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ya(t.type)||t.tag===4}function lo(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Sm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ya(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function io(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Sn));else if(a!==4&&(a===27&&ya(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(io(t,e,n),t=t.sibling;t!==null;)io(t,e,n),t=t.sibling}function Lu(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(a!==4&&(a===27&&ya(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Lu(t,e,n),t=t.sibling;t!==null;)Lu(t,e,n),t=t.sibling}function jm(t){var e=t.stateNode,n=t.memoizedProps;try{for(var a=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);he(e,a,n),e[re]=t,e[je]=n}catch(r){zt(t,t.return,r)}}var wn=!1,te=!1,so=!1,Nm=typeof WeakSet=="function"?WeakSet:Set,ie=null;function ox(t,e){if(t=t.containerInfo,Mo=nc,t=Ld(t),Wc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var h=0,x=-1,E=-1,B=0,K=0,P=t,H=null;e:for(;;){for(var Q;P!==n||u!==0&&P.nodeType!==3||(x=h+u),P!==r||a!==0&&P.nodeType!==3||(E=h+a),P.nodeType===3&&(h+=P.nodeValue.length),(Q=P.firstChild)!==null;)H=P,P=Q;for(;;){if(P===t)break e;if(H===n&&++B===u&&(x=h),H===r&&++K===a&&(E=h),(Q=P.nextSibling)!==null)break;P=H,H=P.parentNode}P=Q}n=x===-1||E===-1?null:{start:x,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(Co={focusedElem:t,selectionRange:n},nc=!1,ie=e;ie!==null;)if(e=ie,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ie=t;else for(;ie!==null;){switch(e=ie,r=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),he(r,a,n),r[re]=t,le(r),a=r;break t;case"link":var h=Cy("link","href",u).get(a+(n.href||""));if(h){for(var x=0;xBt&&(h=Bt,Bt=ft,ft=h);var O=zd(x,ft),T=zd(x,Bt);if(O&&T&&(Q.rangeCount!==1||Q.anchorNode!==O.node||Q.anchorOffset!==O.offset||Q.focusNode!==T.node||Q.focusOffset!==T.offset)){var L=P.createRange();L.setStart(O.node,O.offset),Q.removeAllRanges(),ft>Bt?(Q.addRange(L),Q.extend(T.node,T.offset)):(L.setEnd(T.node,T.offset),Q.addRange(L))}}}}for(P=[],Q=x;Q=Q.parentNode;)Q.nodeType===1&&P.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xn?32:n,k.T=null,n=mo,mo=null;var r=da,h=Un;if(ee=0,ei=da=null,Un=0,(Ct&6)!==0)throw Error(c(331));var x=Ct;if(Ct|=4,Dm(r.current),wm(r,r.current,h,n),Ct=x,ms(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Oi,r)}catch{}return!0}finally{Z.p=u,k.T=a,$m(t,e)}}function ty(t,e,n){e=Ze(n,e),e=Vr(t.stateNode,e,2),t=ia(t,e,2),t!==null&&(Di(t,2),dn(t))}function zt(t,e,n){if(t.tag===3)ty(t,t,n);else for(;e!==null;){if(e.tag===3){ty(e,t,n);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(fa===null||!fa.has(a))){t=Ze(n,t),n=em(2),a=ia(e,n,2),a!==null&&(nm(n,a,e,t),Di(a,2),dn(a));break}}e=e.return}}function vo(t,e,n){var a=t.pingCache;if(a===null){a=t.pingCache=new hx;var u=new Set;a.set(e,u)}else u=a.get(e),u===void 0&&(u=new Set,a.set(e,u));u.has(n)||(ro=!0,u.add(n),t=vx.bind(null,t,e,n),e.then(t,t))}function vx(t,e,n){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ht===t&&(St&n)===n&&(Zt===4||Zt===3&&(St&62914560)===St&&300>me()-qu?(Ct&2)===0&&ni(t,0):oo|=n,ti===St&&(ti=0)),dn(t)}function ey(t,e){e===0&&(e=Pf()),t=Ka(t,e),t!==null&&(Di(t,e),dn(t))}function xx(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ey(t,n)}function bx(t,e){var n=0;switch(t.tag){case 31:case 13:var a=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(e),ey(t,n)}function Sx(t,e){return en(t,e)}var Xu=null,li=null,xo=!1,Vu=!1,bo=!1,ma=0;function dn(t){t!==li&&t.next===null&&(li===null?Xu=li=t:li=li.next=t),Vu=!0,xo||(xo=!0,Nx())}function ms(t,e){if(!bo&&Vu){bo=!0;do for(var n=!1,a=Xu;a!==null;){if(t!==0){var u=a.pendingLanes;if(u===0)var r=0;else{var h=a.suspendedLanes,x=a.pingedLanes;r=(1<<31-ze(42|t)+1)-1,r&=u&~(h&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,iy(a,r))}else r=St,r=Fs(a,a===Ht?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||zi(a,r)||(n=!0,iy(a,r));a=a.next}while(n);bo=!1}}function jx(){ny()}function ny(){Vu=xo=!1;var t=0;ma!==0&&zx()&&(t=ma);for(var e=me(),n=null,a=Xu;a!==null;){var u=a.next,r=ay(a,e);r===0?(a.next=null,n===null?Xu=u:n.next=u,u===null&&(li=n)):(n=a,(t!==0||(r&3)!==0)&&(Vu=!0)),a=u}ee!==0&&ee!==5||ms(t),ma!==0&&(ma=0)}function ay(t,e){for(var n=t.suspendedLanes,a=t.pingedLanes,u=t.expirationTimes,r=t.pendingLanes&-62914561;0x)break;var K=E.transferSize,P=E.initiatorType;K&&hy(P)&&(E=E.responseEnd,h+=K*(E"u"?null:document;function Ry(t,e,n){var a=ii;if(a&&typeof e=="string"&&e){var u=Xe(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ey.has(u)||(Ey.add(u),t={rel:t,crossOrigin:n,href:e},a.querySelector(u)===null&&(e=a.createElement("link"),he(e,"link",t),le(e),a.head.appendChild(e)))}}function Yx(t){Bn.D(t),Ry("dns-prefetch",t,null)}function Gx(t,e){Bn.C(t,e),Ry("preconnect",t,e)}function Kx(t,e,n){Bn.L(t,e,n);var a=ii;if(a&&t&&e){var u='link[rel="preload"][as="'+Xe(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Xe(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Xe(n.imageSizes)+'"]')):u+='[href="'+Xe(t)+'"]';var r=u;switch(e){case"style":r=si(t);break;case"script":r=ui(t)}We.has(r)||(t=p({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),We.set(r,t),a.querySelector(u)!==null||e==="style"&&a.querySelector(vs(r))||e==="script"&&a.querySelector(xs(r))||(e=a.createElement("link"),he(e,"link",t),le(e),a.head.appendChild(e)))}}function Xx(t,e){Bn.m(t,e);var n=ii;if(n&&t){var a=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+Xe(a)+'"][href="'+Xe(t)+'"]',r=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ui(t)}if(!We.has(r)&&(t=p({rel:"modulepreload",href:t},e),We.set(r,t),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(xs(r)))return}a=n.createElement("link"),he(a,"link",t),le(a),n.head.appendChild(a)}}}function Vx(t,e,n){Bn.S(t,e,n);var a=ii;if(a&&t){var u=Ml(a).hoistableStyles,r=si(t);e=e||"default";var h=u.get(r);if(!h){var x={loading:0,preload:null};if(h=a.querySelector(vs(r)))x.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":e},n),(n=We.get(r))&&Uo(t,n);var E=h=a.createElement("link");le(E),he(E,"link",t),E._p=new Promise(function(B,K){E.onload=B,E.onerror=K}),E.addEventListener("load",function(){x.loading|=1}),E.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Iu(h,e,a)}h={type:"stylesheet",instance:h,count:1,state:x},u.set(r,h)}}}function Zx(t,e){Bn.X(t,e);var n=ii;if(n&&t){var a=Ml(n).hoistableScripts,u=ui(t),r=a.get(u);r||(r=n.querySelector(xs(u)),r||(t=p({src:t,async:!0},e),(e=We.get(u))&&Bo(t,e),r=n.createElement("script"),le(r),he(r,"link",t),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(u,r))}}function Jx(t,e){Bn.M(t,e);var n=ii;if(n&&t){var a=Ml(n).hoistableScripts,u=ui(t),r=a.get(u);r||(r=n.querySelector(xs(u)),r||(t=p({src:t,async:!0,type:"module"},e),(e=We.get(u))&&Bo(t,e),r=n.createElement("script"),le(r),he(r,"link",t),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(u,r))}}function _y(t,e,n,a){var u=(u=pt.current)?Fu(u):null;if(!u)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=si(n.href),n=Ml(u).hoistableStyles,a=n.get(e),a||(a={type:"style",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=si(n.href);var r=Ml(u).hoistableStyles,h=r.get(t);if(h||(u=u.ownerDocument||u,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(t,h),(r=u.querySelector(vs(t)))&&!r._p&&(h.instance=r,h.state.loading=5),We.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},We.set(t,n),r||Px(u,t,n,h.state))),e&&a===null)throw Error(c(528,""));return h}if(e&&a!==null)throw Error(c(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ui(n),n=Ml(u).hoistableScripts,a=n.get(e),a||(a={type:"script",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function si(t){return'href="'+Xe(t)+'"'}function vs(t){return'link[rel="stylesheet"]['+t+"]"}function Ty(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function Px(t,e,n,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),he(e,"link",n),le(e),t.head.appendChild(e))}function ui(t){return'[src="'+Xe(t)+'"]'}function xs(t){return"script[async]"+t}function My(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+Xe(n.href)+'"]');if(a)return e.instance=a,le(a),a;var u=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),le(a),he(a,"style",u),Iu(a,n.precedence,t),e.instance=a;case"stylesheet":u=si(n.href);var r=t.querySelector(vs(u));if(r)return e.state.loading|=4,e.instance=r,le(r),r;a=Ty(n),(u=We.get(u))&&Uo(a,u),r=(t.ownerDocument||t).createElement("link"),le(r);var h=r;return h._p=new Promise(function(x,E){h.onload=x,h.onerror=E}),he(r,"link",a),e.state.loading|=4,Iu(r,n.precedence,t),e.instance=r;case"script":return r=ui(n.src),(u=t.querySelector(xs(r)))?(e.instance=u,le(u),u):(a=n,(u=We.get(r))&&(a=p({},n),Bo(a,u)),t=t.ownerDocument||t,u=t.createElement("script"),le(u),he(u,"link",a),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,Iu(a,n.precedence,t));return e.instance}function Iu(t,e,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,r=u,h=0;h title"):null)}function Fx(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function wy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ix(t,e,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=si(a.href),r=e.querySelector(vs(u));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Wu.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=r,le(r);return}r=e.ownerDocument||e,a=Ty(a),(u=We.get(u))&&Uo(a,u),r=r.createElement("link"),le(r);var h=r;h._p=new Promise(function(x,E){h.onload=x,h.onerror=E}),he(r,"link",a),n.instance=r}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Wu.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var qo=0;function $x(t,e){return t.stylesheets&&t.count===0&&ec(t,t.stylesheets),0qo?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Wu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ec(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var tc=null;function ec(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tc=new Map,e.forEach(Wx,t),tc=null,Wu.call(t))}function Wx(t,e){if(!(e.state.loading&4)){var n=tc.get(t);if(n)var a=n.get(null);else{n=new Map,tc.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),Jo.exports=y0(),Jo.exports}var g0=p0(),Mi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(l){return this.listeners.add(l),this.onSubscribe(),()=>{this.listeners.delete(l),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cl,Ra,mi,Qp,v0=(Qp=class extends Mi{constructor(){super();rt(this,cl);rt(this,Ra);rt(this,mi);nt(this,mi,i=>{if(typeof window<"u"&&window.addEventListener){const s=()=>i();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){R(this,Ra)||this.setEventListener(R(this,mi))}onUnsubscribe(){var i;this.hasListeners()||((i=R(this,Ra))==null||i.call(this),nt(this,Ra,void 0))}setEventListener(i){var s;nt(this,mi,i),(s=R(this,Ra))==null||s.call(this),nt(this,Ra,i(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(i){R(this,cl)!==i&&(nt(this,cl,i),this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(s=>{s(i)})}isFocused(){var i;return typeof R(this,cl)=="boolean"?R(this,cl):((i=globalThis.document)==null?void 0:i.visibilityState)!=="hidden"}},cl=new WeakMap,Ra=new WeakMap,mi=new WeakMap,Qp),Uf=new v0,x0={setTimeout:(l,i)=>setTimeout(l,i),clearTimeout:l=>clearTimeout(l),setInterval:(l,i)=>setInterval(l,i),clearInterval:l=>clearInterval(l)},_a,Lf,Yp,b0=(Yp=class{constructor(){rt(this,_a,x0);rt(this,Lf,!1)}setTimeoutProvider(l){nt(this,_a,l)}setTimeout(l,i){return R(this,_a).setTimeout(l,i)}clearTimeout(l){R(this,_a).clearTimeout(l)}setInterval(l,i){return R(this,_a).setInterval(l,i)}clearInterval(l){R(this,_a).clearInterval(l)}},_a=new WeakMap,Lf=new WeakMap,Yp),ll=new b0;function S0(l){setTimeout(l,0)}var j0=typeof window>"u"||"Deno"in globalThis;function be(){}function N0(l,i){return typeof l=="function"?l(i):l}function hf(l){return typeof l=="number"&&l>=0&&l!==1/0}function Wp(l,i){return Math.max(l+(i||0)-Date.now(),0)}function Ua(l,i){return typeof l=="function"?l(i):l}function Ye(l,i){return typeof l=="function"?l(i):l}function np(l,i){const{type:s="all",exact:c,fetchStatus:o,predicate:f,queryKey:m,stale:v}=l;if(m){if(c){if(i.queryHash!==Bf(m,i.options))return!1}else if(!Os(i.queryKey,m))return!1}if(s!=="all"){const g=i.isActive();if(s==="active"&&!g||s==="inactive"&&g)return!1}return!(typeof v=="boolean"&&i.isStale()!==v||o&&o!==i.state.fetchStatus||f&&!f(i))}function ap(l,i){const{exact:s,status:c,predicate:o,mutationKey:f}=l;if(f){if(!i.options.mutationKey)return!1;if(s){if(bl(i.options.mutationKey)!==bl(f))return!1}else if(!Os(i.options.mutationKey,f))return!1}return!(c&&i.state.status!==c||o&&!o(i))}function Bf(l,i){return((i==null?void 0:i.queryKeyHashFn)||bl)(l)}function bl(l){return JSON.stringify(l,(i,s)=>mf(s)?Object.keys(s).sort().reduce((c,o)=>(c[o]=s[o],c),{}):s)}function Os(l,i){return l===i?!0:typeof l!=typeof i?!1:l&&i&&typeof l=="object"&&typeof i=="object"?Object.keys(i).every(s=>Os(l[s],i[s])):!1}var E0=Object.prototype.hasOwnProperty;function tg(l,i,s=0){if(l===i)return l;if(s>500)return i;const c=lp(l)&&lp(i);if(!c&&!(mf(l)&&mf(i)))return i;const f=(c?l:Object.keys(l)).length,m=c?i:Object.keys(i),v=m.length,g=c?new Array(v):{};let y=0;for(let b=0;b{ll.setTimeout(i,l)})}function yf(l,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(l,i):s.structuralSharing!==!1?tg(l,i):i}function _0(l,i,s=0){const c=[...l,i];return s&&c.length>s?c.slice(1):c}function T0(l,i,s=0){const c=[i,...l];return s&&c.length>s?c.slice(0,-1):c}var qf=Symbol();function eg(l,i){return!l.queryFn&&(i!=null&&i.initialPromise)?()=>i.initialPromise:!l.queryFn||l.queryFn===qf?()=>Promise.reject(new Error(`Missing queryFn: '${l.queryHash}'`)):l.queryFn}function Hf(l,i){return typeof l=="function"?l(...i):!!l}function M0(l,i,s){let c=!1,o;return Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o??(o=i()),c||(c=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),l}var zs=(()=>{let l=()=>j0;return{isServer(){return l()},setIsServer(i){l=i}}})();function pf(){let l,i;const s=new Promise((o,f)=>{l=o,i=f});s.status="pending",s.catch(()=>{});function c(o){Object.assign(s,o),delete s.resolve,delete s.reject}return s.resolve=o=>{c({status:"fulfilled",value:o}),l(o)},s.reject=o=>{c({status:"rejected",reason:o}),i(o)},s}var C0=S0;function A0(){let l=[],i=0,s=v=>{v()},c=v=>{v()},o=C0;const f=v=>{i?l.push(v):o(()=>{s(v)})},m=()=>{const v=l;l=[],v.length&&o(()=>{c(()=>{v.forEach(g=>{s(g)})})})};return{batch:v=>{let g;i++;try{g=v()}finally{i--,i||m()}return g},batchCalls:v=>(...g)=>{f(()=>{v(...g)})},schedule:f,setNotifyFunction:v=>{s=v},setBatchNotifyFunction:v=>{c=v},setScheduler:v=>{o=v}}}var ne=A0(),yi,Ta,pi,Gp,w0=(Gp=class extends Mi{constructor(){super();rt(this,yi,!0);rt(this,Ta);rt(this,pi);nt(this,pi,i=>{if(typeof window<"u"&&window.addEventListener){const s=()=>i(!0),c=()=>i(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",c)}}})}onSubscribe(){R(this,Ta)||this.setEventListener(R(this,pi))}onUnsubscribe(){var i;this.hasListeners()||((i=R(this,Ta))==null||i.call(this),nt(this,Ta,void 0))}setEventListener(i){var s;nt(this,pi,i),(s=R(this,Ta))==null||s.call(this),nt(this,Ta,i(this.setOnline.bind(this)))}setOnline(i){R(this,yi)!==i&&(nt(this,yi,i),this.listeners.forEach(c=>{c(i)}))}isOnline(){return R(this,yi)}},yi=new WeakMap,Ta=new WeakMap,pi=new WeakMap,Gp),Sc=new w0;function O0(l){return Math.min(1e3*2**l,3e4)}function ng(l){return(l??"online")==="online"?Sc.isOnline():!0}var gf=class extends Error{constructor(l){super("CancelledError"),this.revert=l==null?void 0:l.revert,this.silent=l==null?void 0:l.silent}};function ag(l){let i=!1,s=0,c;const o=pf(),f=()=>o.status!=="pending",m=_=>{var w;if(!f()){const C=new gf(_);S(C),(w=l.onCancel)==null||w.call(l,C)}},v=()=>{i=!0},g=()=>{i=!1},y=()=>Uf.isFocused()&&(l.networkMode==="always"||Sc.isOnline())&&l.canRun(),b=()=>ng(l.networkMode)&&l.canRun(),p=_=>{f()||(c==null||c(),o.resolve(_))},S=_=>{f()||(c==null||c(),o.reject(_))},j=()=>new Promise(_=>{var w;c=C=>{(f()||y())&&_(C)},(w=l.onPause)==null||w.call(l)}).then(()=>{var _;c=void 0,f()||(_=l.onContinue)==null||_.call(l)}),N=()=>{if(f())return;let _;const w=s===0?l.initialPromise:void 0;try{_=w??l.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(p).catch(C=>{var U;if(f())return;const D=l.retry??(zs.isServer()?0:3),G=l.retryDelay??O0,A=typeof G=="function"?G(s,C):G,q=D===!0||typeof D=="number"&&sy()?void 0:j()).then(()=>{i?S(C):N()})})};return{promise:o,status:()=>o.status,cancel:m,continue:()=>(c==null||c(),o),cancelRetry:v,continueRetry:g,canStart:b,start:()=>(b()?N():j().then(N),o)}}var rl,Kp,lg=(Kp=class{constructor(){rt(this,rl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hf(this.gcTime)&&nt(this,rl,ll.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(l){this.gcTime=Math.max(this.gcTime||0,l??(zs.isServer()?1/0:300*1e3))}clearGcTimeout(){R(this,rl)!==void 0&&(ll.clearTimeout(R(this,rl)),nt(this,rl,void 0))}},rl=new WeakMap,Kp);function z0(l){return{onFetch:(i,s)=>{var b,p,S,j,N;const c=i.options,o=(S=(p=(b=i.fetchOptions)==null?void 0:b.meta)==null?void 0:p.fetchMore)==null?void 0:S.direction,f=((j=i.state.data)==null?void 0:j.pages)||[],m=((N=i.state.data)==null?void 0:N.pageParams)||[];let v={pages:[],pageParams:[]},g=0;const y=async()=>{let _=!1;const w=G=>{M0(G,()=>i.signal,()=>_=!0)},C=eg(i.options,i.fetchOptions),D=async(G,A,q)=>{if(_)return Promise.reject(i.signal.reason);if(A==null&&G.pages.length)return Promise.resolve(G);const z=(()=>{const X={client:i.client,queryKey:i.queryKey,pageParam:A,direction:q?"backward":"forward",meta:i.options.meta};return w(X),X})(),Y=await C(z),{maxPages:I}=i.options,$=q?T0:_0;return{pages:$(G.pages,Y,I),pageParams:$(G.pageParams,A,I)}};if(o&&f.length){const G=o==="backward",A=G?D0:sp,q={pages:f,pageParams:m},U=A(c,q);v=await D(q,U,G)}else{const G=l??f.length;do{const A=g===0?m[0]??c.initialPageParam:sp(c,v);if(g>0&&A==null)break;v=await D(v,A),g++}while(g{var _,w;return(w=(_=i.options).persister)==null?void 0:w.call(_,y,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s)}:i.fetchFn=y}}}function sp(l,{pages:i,pageParams:s}){const c=i.length-1;return i.length>0?l.getNextPageParam(i[c],i,s[c],s):void 0}function D0(l,{pages:i,pageParams:s}){var c;return i.length>0?(c=l.getPreviousPageParam)==null?void 0:c.call(l,i[0],i,s[0],s):void 0}var gi,ol,vi,tn,fl,se,Hs,dl,Qe,ig,qn,Xp,L0=(Xp=class extends lg{constructor(i){super();rt(this,Qe);rt(this,gi);rt(this,ol);rt(this,vi);rt(this,tn);rt(this,fl);rt(this,se);rt(this,Hs);rt(this,dl);nt(this,dl,!1),nt(this,Hs,i.defaultOptions),this.setOptions(i.options),this.observers=[],nt(this,fl,i.client),nt(this,tn,R(this,fl).getQueryCache()),this.queryKey=i.queryKey,this.queryHash=i.queryHash,nt(this,ol,cp(this.options)),this.state=i.state??R(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return R(this,gi)}get promise(){var i;return(i=R(this,se))==null?void 0:i.promise}setOptions(i){if(this.options={...R(this,Hs),...i},i!=null&&i._type&&nt(this,gi,i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=cp(this.options);s.data!==void 0&&(this.setState(up(s.data,s.dataUpdatedAt)),nt(this,ol,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,tn).remove(this)}setData(i,s){const c=yf(this.state.data,i,this.options);return yt(this,Qe,qn).call(this,{data:c,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),c}setState(i){yt(this,Qe,qn).call(this,{type:"setState",state:i})}cancel(i){var c,o;const s=(c=R(this,se))==null?void 0:c.promise;return(o=R(this,se))==null||o.cancel(i),s?s.then(be).catch(be):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return R(this,ol)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Ye(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Ua(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!Wp(this.state.dataUpdatedAt,i)}onFocus(){var s;const i=this.observers.find(c=>c.shouldFetchOnWindowFocus());i==null||i.refetch({cancelRefetch:!1}),(s=R(this,se))==null||s.continue()}onOnline(){var s;const i=this.observers.find(c=>c.shouldFetchOnReconnect());i==null||i.refetch({cancelRefetch:!1}),(s=R(this,se))==null||s.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),R(this,tn).notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(s=>s!==i),this.observers.length||(R(this,se)&&(R(this,dl)||yt(this,Qe,ig).call(this)?R(this,se).cancel({revert:!0}):R(this,se).cancelRetry()),this.scheduleGc()),R(this,tn).notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||yt(this,Qe,qn).call(this,{type:"invalidate"})}async fetch(i,s){var y,b,p,S,j,N,_,w,C,D,G;if(this.state.fetchStatus!=="idle"&&((y=R(this,se))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(R(this,se))return R(this,se).continueRetry(),R(this,se).promise}if(i&&this.setOptions(i),!this.options.queryFn){const A=this.observers.find(q=>q.options.queryFn);A&&this.setOptions(A.options)}const c=new AbortController,o=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(nt(this,dl,!0),c.signal)})},f=()=>{const A=eg(this.options,s),U=(()=>{const z={client:R(this,fl),queryKey:this.queryKey,meta:this.meta};return o(z),z})();return nt(this,dl,!1),this.options.persister?this.options.persister(A,U,this):A(U)},v=(()=>{const A={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:R(this,fl),state:this.state,fetchFn:f};return o(A),A})(),g=R(this,gi)==="infinite"?z0(this.options.pages):this.options.behavior;g==null||g.onFetch(v,this),nt(this,vi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=v.fetchOptions)==null?void 0:b.meta))&&yt(this,Qe,qn).call(this,{type:"fetch",meta:(p=v.fetchOptions)==null?void 0:p.meta}),nt(this,se,ag({initialPromise:s==null?void 0:s.initialPromise,fn:v.fetchFn,onCancel:A=>{A instanceof gf&&A.revert&&this.setState({...R(this,vi),fetchStatus:"idle"}),c.abort()},onFail:(A,q)=>{yt(this,Qe,qn).call(this,{type:"failed",failureCount:A,error:q})},onPause:()=>{yt(this,Qe,qn).call(this,{type:"pause"})},onContinue:()=>{yt(this,Qe,qn).call(this,{type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode,canRun:()=>!0}));try{const A=await R(this,se).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(j=(S=R(this,tn).config).onSuccess)==null||j.call(S,A,this),(_=(N=R(this,tn).config).onSettled)==null||_.call(N,A,this.state.error,this),A}catch(A){if(A instanceof gf){if(A.silent)return R(this,se).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw yt(this,Qe,qn).call(this,{type:"error",error:A}),(C=(w=R(this,tn).config).onError)==null||C.call(w,A,this),(G=(D=R(this,tn).config).onSettled)==null||G.call(D,this.state.data,A,this),A}finally{this.scheduleGc()}}},gi=new WeakMap,ol=new WeakMap,vi=new WeakMap,tn=new WeakMap,fl=new WeakMap,se=new WeakMap,Hs=new WeakMap,dl=new WeakMap,Qe=new WeakSet,ig=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},qn=function(i){const s=c=>{switch(i.type){case"failed":return{...c,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...sg(c.data,this.options),fetchMeta:i.meta??null};case"success":const o={...c,...up(i.data,i.dataUpdatedAt),dataUpdateCount:c.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return nt(this,vi,i.manual?o:void 0),o;case"error":const f=i.error;return{...c,error:f,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...i.state}}};this.state=s(this.state),ne.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),R(this,tn).notify({query:this,type:"updated",action:i})})},Xp);function sg(l,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ng(i.networkMode)?"fetching":"paused",...l===void 0&&{error:null,status:"pending"}}}function up(l,i){return{data:l,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function cp(l){const i=typeof l.initialData=="function"?l.initialData():l.initialData,s=i!==void 0,c=s?typeof l.initialDataUpdatedAt=="function"?l.initialDataUpdatedAt():l.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Ce,Et,ks,xe,hl,xi,kn,Ma,Qs,bi,Si,ml,yl,Ca,ji,wt,Cs,vf,xf,bf,Sf,jf,Nf,Ef,ug,Vp,U0=(Vp=class extends Mi{constructor(i,s){super();rt(this,wt);rt(this,Ce);rt(this,Et);rt(this,ks);rt(this,xe);rt(this,hl);rt(this,xi);rt(this,kn);rt(this,Ma);rt(this,Qs);rt(this,bi);rt(this,Si);rt(this,ml);rt(this,yl);rt(this,Ca);rt(this,ji,new Set);this.options=s,nt(this,Ce,i),nt(this,Ma,null),nt(this,kn,pf()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Et).addObserver(this),rp(R(this,Et),this.options)?yt(this,wt,Cs).call(this):this.updateResult(),yt(this,wt,Sf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rf(R(this,Et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rf(R(this,Et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,yt(this,wt,jf).call(this),yt(this,wt,Nf).call(this),R(this,Et).removeObserver(this)}setOptions(i){const s=this.options,c=R(this,Et);if(this.options=R(this,Ce).defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ye(this.options.enabled,R(this,Et))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");yt(this,wt,Ef).call(this),R(this,Et).setOptions(this.options),s._defaulted&&!bc(this.options,s)&&R(this,Ce).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Et),observer:this});const o=this.hasListeners();o&&op(R(this,Et),c,this.options,s)&&yt(this,wt,Cs).call(this),this.updateResult(),o&&(R(this,Et)!==c||Ye(this.options.enabled,R(this,Et))!==Ye(s.enabled,R(this,Et))||Ua(this.options.staleTime,R(this,Et))!==Ua(s.staleTime,R(this,Et)))&&yt(this,wt,vf).call(this);const f=yt(this,wt,xf).call(this);o&&(R(this,Et)!==c||Ye(this.options.enabled,R(this,Et))!==Ye(s.enabled,R(this,Et))||f!==R(this,Ca))&&yt(this,wt,bf).call(this,f)}getOptimisticResult(i){const s=R(this,Ce).getQueryCache().build(R(this,Ce),i),c=this.createResult(s,i);return q0(this,c)&&(nt(this,xe,c),nt(this,xi,this.options),nt(this,hl,R(this,Et).state)),c}getCurrentResult(){return R(this,xe)}trackResult(i,s){return new Proxy(i,{get:(c,o)=>(this.trackProp(o),s==null||s(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&R(this,kn).status==="pending"&&R(this,kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(c,o))})}trackProp(i){R(this,ji).add(i)}getCurrentQuery(){return R(this,Et)}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const s=R(this,Ce).defaultQueryOptions(i),c=R(this,Ce).getQueryCache().build(R(this,Ce),s);return c.fetch().then(()=>this.createResult(c,s))}fetch(i){return yt(this,wt,Cs).call(this,{...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,xe)))}createResult(i,s){var I;const c=R(this,Et),o=this.options,f=R(this,xe),m=R(this,hl),v=R(this,xi),y=i!==c?i.state:R(this,ks),{state:b}=i;let p={...b},S=!1,j;if(s._optimisticResults){const $=this.hasListeners(),X=!$&&rp(i,s),tt=$&&op(i,c,s,o);(X||tt)&&(p={...p,...sg(b.data,i.options)}),s._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:N,errorUpdatedAt:_,status:w}=p;j=p.data;let C=!1;if(s.placeholderData!==void 0&&j===void 0&&w==="pending"){let $;f!=null&&f.isPlaceholderData&&s.placeholderData===(v==null?void 0:v.placeholderData)?($=f.data,C=!0):$=typeof s.placeholderData=="function"?s.placeholderData((I=R(this,Si))==null?void 0:I.state.data,R(this,Si)):s.placeholderData,$!==void 0&&(w="success",j=yf(f==null?void 0:f.data,$,s),S=!0)}if(s.select&&j!==void 0&&!C)if(f&&j===(m==null?void 0:m.data)&&s.select===R(this,Qs))j=R(this,bi);else try{nt(this,Qs,s.select),j=s.select(j),j=yf(f==null?void 0:f.data,j,s),nt(this,bi,j),nt(this,Ma,null)}catch($){nt(this,Ma,$)}R(this,Ma)&&(N=R(this,Ma),j=R(this,bi),_=Date.now(),w="error");const D=p.fetchStatus==="fetching",G=w==="pending",A=w==="error",q=G&&D,U=j!==void 0,Y={status:w,fetchStatus:p.fetchStatus,isPending:G,isSuccess:w==="success",isError:A,isInitialLoading:q,isLoading:q,data:j,dataUpdatedAt:p.dataUpdatedAt,error:N,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:p.dataUpdateCount>y.dataUpdateCount||p.errorUpdateCount>y.errorUpdateCount,isFetching:D,isRefetching:D&&!G,isLoadingError:A&&!U,isPaused:p.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:A&&U,isStale:kf(i,s),refetch:this.refetch,promise:R(this,kn),isEnabled:Ye(s.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const $=Y.data!==void 0,X=Y.status==="error"&&!$,tt=gt=>{X?gt.reject(Y.error):$&>.resolve(Y.data)},W=()=>{const gt=nt(this,kn,Y.promise=pf());tt(gt)},at=R(this,kn);switch(at.status){case"pending":i.queryHash===c.queryHash&&tt(at);break;case"fulfilled":(X||Y.data!==at.value)&&W();break;case"rejected":(!X||Y.error!==at.reason)&&W();break}}return Y}updateResult(){const i=R(this,xe),s=this.createResult(R(this,Et),this.options);if(nt(this,hl,R(this,Et).state),nt(this,xi,this.options),R(this,hl).data!==void 0&&nt(this,Si,R(this,Et)),bc(s,i))return;nt(this,xe,s);const c=()=>{if(!i)return!0;const{notifyOnChangeProps:o}=this.options,f=typeof o=="function"?o():o;if(f==="all"||!f&&!R(this,ji).size)return!0;const m=new Set(f??R(this,ji));return this.options.throwOnError&&m.add("error"),Object.keys(R(this,xe)).some(v=>{const g=v;return R(this,xe)[g]!==i[g]&&m.has(g)})};yt(this,wt,ug).call(this,{listeners:c()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&yt(this,wt,Sf).call(this)}},Ce=new WeakMap,Et=new WeakMap,ks=new WeakMap,xe=new WeakMap,hl=new WeakMap,xi=new WeakMap,kn=new WeakMap,Ma=new WeakMap,Qs=new WeakMap,bi=new WeakMap,Si=new WeakMap,ml=new WeakMap,yl=new WeakMap,Ca=new WeakMap,ji=new WeakMap,wt=new WeakSet,Cs=function(i){yt(this,wt,Ef).call(this);let s=R(this,Et).fetch(this.options,i);return i!=null&&i.throwOnError||(s=s.catch(be)),s},vf=function(){yt(this,wt,jf).call(this);const i=Ua(this.options.staleTime,R(this,Et));if(zs.isServer()||R(this,xe).isStale||!hf(i))return;const c=Wp(R(this,xe).dataUpdatedAt,i)+1;nt(this,ml,ll.setTimeout(()=>{R(this,xe).isStale||this.updateResult()},c))},xf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Et)):this.options.refetchInterval)??!1},bf=function(i){yt(this,wt,Nf).call(this),nt(this,Ca,i),!(zs.isServer()||Ye(this.options.enabled,R(this,Et))===!1||!hf(R(this,Ca))||R(this,Ca)===0)&&nt(this,yl,ll.setInterval(()=>{(this.options.refetchIntervalInBackground||Uf.isFocused())&&yt(this,wt,Cs).call(this)},R(this,Ca)))},Sf=function(){yt(this,wt,vf).call(this),yt(this,wt,bf).call(this,yt(this,wt,xf).call(this))},jf=function(){R(this,ml)!==void 0&&(ll.clearTimeout(R(this,ml)),nt(this,ml,void 0))},Nf=function(){R(this,yl)!==void 0&&(ll.clearInterval(R(this,yl)),nt(this,yl,void 0))},Ef=function(){const i=R(this,Ce).getQueryCache().build(R(this,Ce),this.options);if(i===R(this,Et))return;const s=R(this,Et);nt(this,Et,i),nt(this,ks,i.state),this.hasListeners()&&(s==null||s.removeObserver(this),i.addObserver(this))},ug=function(i){ne.batch(()=>{i.listeners&&this.listeners.forEach(s=>{s(R(this,xe))}),R(this,Ce).getQueryCache().notify({query:R(this,Et),type:"observerResultsUpdated"})})},Vp);function B0(l,i){return Ye(i.enabled,l)!==!1&&l.state.data===void 0&&!(l.state.status==="error"&&Ye(i.retryOnMount,l)===!1)}function rp(l,i){return B0(l,i)||l.state.data!==void 0&&Rf(l,i,i.refetchOnMount)}function Rf(l,i,s){if(Ye(i.enabled,l)!==!1&&Ua(i.staleTime,l)!=="static"){const c=typeof s=="function"?s(l):s;return c==="always"||c!==!1&&kf(l,i)}return!1}function op(l,i,s,c){return(l!==i||Ye(c.enabled,l)===!1)&&(!s.suspense||l.state.status!=="error")&&kf(l,s)}function kf(l,i){return Ye(i.enabled,l)!==!1&&l.isStaleByTime(Ua(i.staleTime,l))}function q0(l,i){return!bc(l.getCurrentResult(),i)}var Ys,mn,pe,pl,yn,ja,Zp,H0=(Zp=class extends lg{constructor(i){super();rt(this,yn);rt(this,Ys);rt(this,mn);rt(this,pe);rt(this,pl);nt(this,Ys,i.client),this.mutationId=i.mutationId,nt(this,pe,i.mutationCache),nt(this,mn,[]),this.state=i.state||cg(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){R(this,mn).includes(i)||(R(this,mn).push(i),this.clearGcTimeout(),R(this,pe).notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){nt(this,mn,R(this,mn).filter(s=>s!==i)),this.scheduleGc(),R(this,pe).notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){R(this,mn).length||(this.state.status==="pending"?this.scheduleGc():R(this,pe).remove(this))}continue(){var i;return((i=R(this,pl))==null?void 0:i.continue())??this.execute(this.state.variables)}async execute(i){var m,v,g,y,b,p,S,j,N,_,w,C,D,G,A,q,U,z;const s=()=>{yt(this,yn,ja).call(this,{type:"continue"})},c={client:R(this,Ys),meta:this.options.meta,mutationKey:this.options.mutationKey};nt(this,pl,ag({fn:()=>this.options.mutationFn?this.options.mutationFn(i,c):Promise.reject(new Error("No mutationFn found")),onFail:(Y,I)=>{yt(this,yn,ja).call(this,{type:"failed",failureCount:Y,error:I})},onPause:()=>{yt(this,yn,ja).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,pe).canRun(this)}));const o=this.state.status==="pending",f=!R(this,pl).canStart();try{if(o)s();else{yt(this,yn,ja).call(this,{type:"pending",variables:i,isPaused:f}),R(this,pe).config.onMutate&&await R(this,pe).config.onMutate(i,this,c);const I=await((v=(m=this.options).onMutate)==null?void 0:v.call(m,i,c));I!==this.state.context&&yt(this,yn,ja).call(this,{type:"pending",context:I,variables:i,isPaused:f})}const Y=await R(this,pl).start();return await((y=(g=R(this,pe).config).onSuccess)==null?void 0:y.call(g,Y,i,this.state.context,this,c)),await((p=(b=this.options).onSuccess)==null?void 0:p.call(b,Y,i,this.state.context,c)),await((j=(S=R(this,pe).config).onSettled)==null?void 0:j.call(S,Y,null,this.state.variables,this.state.context,this,c)),await((_=(N=this.options).onSettled)==null?void 0:_.call(N,Y,null,i,this.state.context,c)),yt(this,yn,ja).call(this,{type:"success",data:Y}),Y}catch(Y){try{await((C=(w=R(this,pe).config).onError)==null?void 0:C.call(w,Y,i,this.state.context,this,c))}catch(I){Promise.reject(I)}try{await((G=(D=this.options).onError)==null?void 0:G.call(D,Y,i,this.state.context,c))}catch(I){Promise.reject(I)}try{await((q=(A=R(this,pe).config).onSettled)==null?void 0:q.call(A,void 0,Y,this.state.variables,this.state.context,this,c))}catch(I){Promise.reject(I)}try{await((z=(U=this.options).onSettled)==null?void 0:z.call(U,void 0,Y,i,this.state.context,c))}catch(I){Promise.reject(I)}throw yt(this,yn,ja).call(this,{type:"error",error:Y}),Y}finally{R(this,pe).runNext(this)}}},Ys=new WeakMap,mn=new WeakMap,pe=new WeakMap,pl=new WeakMap,yn=new WeakSet,ja=function(i){const s=c=>{switch(i.type){case"failed":return{...c,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...c,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:i.error,failureCount:c.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=s(this.state),ne.batch(()=>{R(this,mn).forEach(c=>{c.onMutationUpdate(i)}),R(this,pe).notify({mutation:this,type:"updated",action:i})})},Zp);function cg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qn,sn,Gs,Jp,k0=(Jp=class extends Mi{constructor(i={}){super();rt(this,Qn);rt(this,sn);rt(this,Gs);this.config=i,nt(this,Qn,new Set),nt(this,sn,new Map),nt(this,Gs,0)}build(i,s,c){const o=new H0({client:i,mutationCache:this,mutationId:++rc(this,Gs)._,options:i.defaultMutationOptions(s),state:c});return this.add(o),o}add(i){R(this,Qn).add(i);const s=oc(i);if(typeof s=="string"){const c=R(this,sn).get(s);c?c.push(i):R(this,sn).set(s,[i])}this.notify({type:"added",mutation:i})}remove(i){if(R(this,Qn).delete(i)){const s=oc(i);if(typeof s=="string"){const c=R(this,sn).get(s);if(c)if(c.length>1){const o=c.indexOf(i);o!==-1&&c.splice(o,1)}else c[0]===i&&R(this,sn).delete(s)}}this.notify({type:"removed",mutation:i})}canRun(i){const s=oc(i);if(typeof s=="string"){const c=R(this,sn).get(s),o=c==null?void 0:c.find(f=>f.state.status==="pending");return!o||o===i}else return!0}runNext(i){var c;const s=oc(i);if(typeof s=="string"){const o=(c=R(this,sn).get(s))==null?void 0:c.find(f=>f!==i&&f.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ne.batch(()=>{R(this,Qn).forEach(i=>{this.notify({type:"removed",mutation:i})}),R(this,Qn).clear(),R(this,sn).clear()})}getAll(){return Array.from(R(this,Qn))}find(i){const s={exact:!0,...i};return this.getAll().find(c=>ap(s,c))}findAll(i={}){return this.getAll().filter(s=>ap(i,s))}notify(i){ne.batch(()=>{this.listeners.forEach(s=>{s(i)})})}resumePausedMutations(){const i=this.getAll().filter(s=>s.state.isPaused);return ne.batch(()=>Promise.all(i.map(s=>s.continue().catch(be))))}},Qn=new WeakMap,sn=new WeakMap,Gs=new WeakMap,Jp);function oc(l){var i;return(i=l.options.scope)==null?void 0:i.id}var Yn,Aa,Ae,Gn,Vn,yc,_f,Pp,Q0=(Pp=class extends Mi{constructor(s,c){super();rt(this,Vn);rt(this,Yn);rt(this,Aa);rt(this,Ae);rt(this,Gn);nt(this,Yn,s),this.setOptions(c),this.bindMethods(),yt(this,Vn,yc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var o;const c=this.options;this.options=R(this,Yn).defaultMutationOptions(s),bc(this.options,c)||R(this,Yn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,Ae),observer:this}),c!=null&&c.mutationKey&&this.options.mutationKey&&bl(c.mutationKey)!==bl(this.options.mutationKey)?this.reset():((o=R(this,Ae))==null?void 0:o.state.status)==="pending"&&R(this,Ae).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=R(this,Ae))==null||s.removeObserver(this)}onMutationUpdate(s){yt(this,Vn,yc).call(this),yt(this,Vn,_f).call(this,s)}getCurrentResult(){return R(this,Aa)}reset(){var s;(s=R(this,Ae))==null||s.removeObserver(this),nt(this,Ae,void 0),yt(this,Vn,yc).call(this),yt(this,Vn,_f).call(this)}mutate(s,c){var o;return nt(this,Gn,c),(o=R(this,Ae))==null||o.removeObserver(this),nt(this,Ae,R(this,Yn).getMutationCache().build(R(this,Yn),this.options)),R(this,Ae).addObserver(this),R(this,Ae).execute(s)}},Yn=new WeakMap,Aa=new WeakMap,Ae=new WeakMap,Gn=new WeakMap,Vn=new WeakSet,yc=function(){var c;const s=((c=R(this,Ae))==null?void 0:c.state)??cg();nt(this,Aa,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},_f=function(s){ne.batch(()=>{var c,o,f,m,v,g,y,b;if(R(this,Gn)&&this.hasListeners()){const p=R(this,Aa).variables,S=R(this,Aa).context,j={client:R(this,Yn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(o=(c=R(this,Gn)).onSuccess)==null||o.call(c,s.data,p,S,j)}catch(N){Promise.reject(N)}try{(m=(f=R(this,Gn)).onSettled)==null||m.call(f,s.data,null,p,S,j)}catch(N){Promise.reject(N)}}else if((s==null?void 0:s.type)==="error"){try{(g=(v=R(this,Gn)).onError)==null||g.call(v,s.error,p,S,j)}catch(N){Promise.reject(N)}try{(b=(y=R(this,Gn)).onSettled)==null||b.call(y,void 0,s.error,p,S,j)}catch(N){Promise.reject(N)}}}this.listeners.forEach(p=>{p(R(this,Aa))})})},Pp),pn,Fp,Y0=(Fp=class extends Mi{constructor(i={}){super();rt(this,pn);this.config=i,nt(this,pn,new Map)}build(i,s,c){const o=s.queryKey,f=s.queryHash??Bf(o,s);let m=this.get(f);return m||(m=new L0({client:i,queryKey:o,queryHash:f,options:i.defaultQueryOptions(s),state:c,defaultOptions:i.getQueryDefaults(o)}),this.add(m)),m}add(i){R(this,pn).has(i.queryHash)||(R(this,pn).set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const s=R(this,pn).get(i.queryHash);s&&(i.destroy(),s===i&&R(this,pn).delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){ne.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return R(this,pn).get(i)}getAll(){return[...R(this,pn).values()]}find(i){const s={exact:!0,...i};return this.getAll().find(c=>np(s,c))}findAll(i={}){const s=this.getAll();return Object.keys(i).length>0?s.filter(c=>np(i,c)):s}notify(i){ne.batch(()=>{this.listeners.forEach(s=>{s(i)})})}onFocus(){ne.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){ne.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},pn=new WeakMap,Fp),Jt,wa,Oa,Ni,Ei,za,Ri,_i,Ip,G0=(Ip=class{constructor(l={}){rt(this,Jt);rt(this,wa);rt(this,Oa);rt(this,Ni);rt(this,Ei);rt(this,za);rt(this,Ri);rt(this,_i);nt(this,Jt,l.queryCache||new Y0),nt(this,wa,l.mutationCache||new k0),nt(this,Oa,l.defaultOptions||{}),nt(this,Ni,new Map),nt(this,Ei,new Map),nt(this,za,0)}mount(){rc(this,za)._++,R(this,za)===1&&(nt(this,Ri,Uf.subscribe(async l=>{l&&(await this.resumePausedMutations(),R(this,Jt).onFocus())})),nt(this,_i,Sc.subscribe(async l=>{l&&(await this.resumePausedMutations(),R(this,Jt).onOnline())})))}unmount(){var l,i;rc(this,za)._--,R(this,za)===0&&((l=R(this,Ri))==null||l.call(this),nt(this,Ri,void 0),(i=R(this,_i))==null||i.call(this),nt(this,_i,void 0))}isFetching(l){return R(this,Jt).findAll({...l,fetchStatus:"fetching"}).length}isMutating(l){return R(this,wa).findAll({...l,status:"pending"}).length}getQueryData(l){var s;const i=this.defaultQueryOptions({queryKey:l});return(s=R(this,Jt).get(i.queryHash))==null?void 0:s.state.data}ensureQueryData(l){const i=this.defaultQueryOptions(l),s=R(this,Jt).build(this,i),c=s.state.data;return c===void 0?this.fetchQuery(l):(l.revalidateIfStale&&s.isStaleByTime(Ua(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(c))}getQueriesData(l){return R(this,Jt).findAll(l).map(({queryKey:i,state:s})=>{const c=s.data;return[i,c]})}setQueryData(l,i,s){const c=this.defaultQueryOptions({queryKey:l}),o=R(this,Jt).get(c.queryHash),f=o==null?void 0:o.state.data,m=N0(i,f);if(m!==void 0)return R(this,Jt).build(this,c).setData(m,{...s,manual:!0})}setQueriesData(l,i,s){return ne.batch(()=>R(this,Jt).findAll(l).map(({queryKey:c})=>[c,this.setQueryData(c,i,s)]))}getQueryState(l){var s;const i=this.defaultQueryOptions({queryKey:l});return(s=R(this,Jt).get(i.queryHash))==null?void 0:s.state}removeQueries(l){const i=R(this,Jt);ne.batch(()=>{i.findAll(l).forEach(s=>{i.remove(s)})})}resetQueries(l,i){const s=R(this,Jt);return ne.batch(()=>(s.findAll(l).forEach(c=>{c.reset()}),this.refetchQueries({type:"active",...l},i)))}cancelQueries(l,i={}){const s={revert:!0,...i},c=ne.batch(()=>R(this,Jt).findAll(l).map(o=>o.cancel(s)));return Promise.all(c).then(be).catch(be)}invalidateQueries(l,i={}){return ne.batch(()=>(R(this,Jt).findAll(l).forEach(s=>{s.invalidate()}),(l==null?void 0:l.refetchType)==="none"?Promise.resolve():this.refetchQueries({...l,type:(l==null?void 0:l.refetchType)??(l==null?void 0:l.type)??"active"},i)))}refetchQueries(l,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},c=ne.batch(()=>R(this,Jt).findAll(l).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let f=o.fetch(void 0,s);return s.throwOnError||(f=f.catch(be)),o.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(c).then(be)}fetchQuery(l){const i=this.defaultQueryOptions(l);i.retry===void 0&&(i.retry=!1);const s=R(this,Jt).build(this,i);return s.isStaleByTime(Ua(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(l){return this.fetchQuery(l).then(be).catch(be)}fetchInfiniteQuery(l){return l._type="infinite",this.fetchQuery(l)}prefetchInfiniteQuery(l){return this.fetchInfiniteQuery(l).then(be).catch(be)}ensureInfiniteQueryData(l){return l._type="infinite",this.ensureQueryData(l)}resumePausedMutations(){return Sc.isOnline()?R(this,wa).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,Jt)}getMutationCache(){return R(this,wa)}getDefaultOptions(){return R(this,Oa)}setDefaultOptions(l){nt(this,Oa,l)}setQueryDefaults(l,i){R(this,Ni).set(bl(l),{queryKey:l,defaultOptions:i})}getQueryDefaults(l){const i=[...R(this,Ni).values()],s={};return i.forEach(c=>{Os(l,c.queryKey)&&Object.assign(s,c.defaultOptions)}),s}setMutationDefaults(l,i){R(this,Ei).set(bl(l),{mutationKey:l,defaultOptions:i})}getMutationDefaults(l){const i=[...R(this,Ei).values()],s={};return i.forEach(c=>{Os(l,c.mutationKey)&&Object.assign(s,c.defaultOptions)}),s}defaultQueryOptions(l){if(l._defaulted)return l;const i={...R(this,Oa).queries,...this.getQueryDefaults(l.queryKey),...l,_defaulted:!0};return i.queryHash||(i.queryHash=Bf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===qf&&(i.enabled=!1),i}defaultMutationOptions(l){return l!=null&&l._defaulted?l:{...R(this,Oa).mutations,...(l==null?void 0:l.mutationKey)&&this.getMutationDefaults(l.mutationKey),...l,_defaulted:!0}}clear(){R(this,Jt).clear(),R(this,wa).clear()}},Jt=new WeakMap,wa=new WeakMap,Oa=new WeakMap,Ni=new WeakMap,Ei=new WeakMap,za=new WeakMap,Ri=new WeakMap,_i=new WeakMap,Ip),rg=F.createContext(void 0),Jn=l=>{const i=F.useContext(rg);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},K0=({client:l,children:i})=>(F.useEffect(()=>(l.mount(),()=>{l.unmount()}),[l]),d.jsx(rg.Provider,{value:l,children:i})),og=F.createContext(!1),X0=()=>F.useContext(og);og.Provider;function V0(){let l=!1;return{clearReset:()=>{l=!1},reset:()=>{l=!0},isReset:()=>l}}var Z0=F.createContext(V0()),J0=()=>F.useContext(Z0),P0=(l,i,s)=>{const c=s!=null&&s.state.error&&typeof l.throwOnError=="function"?Hf(l.throwOnError,[s.state.error,s]):l.throwOnError;(l.suspense||l.experimental_prefetchInRender||c)&&(i.isReset()||(l.retryOnMount=!1))},F0=l=>{F.useEffect(()=>{l.clearReset()},[l])},I0=({result:l,errorResetBoundary:i,throwOnError:s,query:c,suspense:o})=>l.isError&&!i.isReset()&&!l.isFetching&&c&&(o&&l.data===void 0||Hf(s,[l.error,c])),$0=l=>{if(l.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),c=l.staleTime;l.staleTime=typeof c=="function"?(...o)=>s(c(...o)):s(c),typeof l.gcTime=="number"&&(l.gcTime=Math.max(l.gcTime,1e3))}},W0=(l,i)=>l.isLoading&&l.isFetching&&!i,tb=(l,i)=>(l==null?void 0:l.suspense)&&i.isPending,fp=(l,i,s)=>i.fetchOptimistic(l).catch(()=>{s.clearReset()});function eb(l,i,s){var j,N,_,w;const c=X0(),o=J0(),f=Jn(),m=f.defaultQueryOptions(l);(N=(j=f.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||N.call(j,m);const v=f.getQueryCache().get(m.queryHash),g=l.subscribed!==!1;m._optimisticResults=c?"isRestoring":g?"optimistic":void 0,$0(m),P0(m,o,v),F0(o);const y=!f.getQueryCache().get(m.queryHash),[b]=F.useState(()=>new i(f,m)),p=b.getOptimisticResult(m),S=!c&&g;if(F.useSyncExternalStore(F.useCallback(C=>{const D=S?b.subscribe(ne.batchCalls(C)):be;return b.updateResult(),D},[b,S]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),F.useEffect(()=>{b.setOptions(m)},[m,b]),tb(m,p))throw fp(m,b,o);if(I0({result:p,errorResetBoundary:o,throwOnError:m.throwOnError,query:v,suspense:m.suspense}))throw p.error;if((w=(_=f.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||w.call(_,m,p),m.experimental_prefetchInRender&&!zs.isServer()&&W0(p,c)){const C=y?fp(m,b,o):v==null?void 0:v.promise;C==null||C.catch(be).finally(()=>{b.updateResult()})}return m.notifyOnChangeProps?p:b.trackResult(p)}function ue(l,i){return eb(l,U0)}function ae(l,i){const s=Jn(),[c]=F.useState(()=>new Q0(s,l));F.useEffect(()=>{c.setOptions(l)},[c,l]);const o=F.useSyncExternalStore(F.useCallback(m=>c.subscribe(ne.batchCalls(m)),[c]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f=F.useCallback((m,v)=>{c.mutate(m,v).catch(be)},[c]);if(o.error&&Hf(c.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:f,mutateAsync:o.mutate}}var As=typeof window<"u"?F.useLayoutEffect:F.useEffect;function $o(l){const i=F.useRef({value:l,prev:null}),s=i.current.value;return l!==s&&(i.current={value:l,prev:s}),i.current.prev}function nb(l,i,s={},c={}){F.useEffect(()=>{if(!l.current||c.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([f])=>{i(f)},s);return o.observe(l.current),()=>{o.disconnect()}},[i,s,c.disabled,l])}function ab(l){const i=F.useRef(null);return F.useImperativeHandle(l,()=>i.current,[]),i}const fg=!1;function Ds(l){return l[l.length-1]}function lb(l){return typeof l=="function"}function il(l,i){return lb(l)?l(i):l}const dg=Object.prototype.hasOwnProperty,dp=Object.prototype.propertyIsEnumerable;function hg(l){for(const i in l)if(dg.call(l,i))return!0;return!1}const ib=()=>Object.create(null),al=(l,i)=>sl(l,i,ib);function sl(l,i,s=()=>({}),c=0){if(l===i)return l;if(c>500)return i;const o=i,f=yp(l)&&yp(o);if(!f&&!(jc(l)&&jc(o)))return o;const m=f?l:hp(l);if(!m)return o;const v=f?o:hp(o);if(!v)return o;const g=m.length,y=v.length,b=f?new Array(y):s();let p=0;for(let S=0;S"u")return!0;const s=i.prototype;return!(!mp(s)||!s.hasOwnProperty("isPrototypeOf"))}function mp(l){return Object.prototype.toString.call(l)==="[object Object]"}function yp(l){return Array.isArray(l)&&l.length===Object.keys(l).length}function gl(l,i,s){if(l===i)return!0;if(typeof l!=typeof i)return!1;if(Array.isArray(l)&&Array.isArray(i)){if(l.length!==i.length)return!1;for(let c=0,o=l.length;co||!gl(l[m],i[m],s)))return!1;return o===f}return!1}function Ti(l){let i,s;const c=new Promise((o,f)=>{i=o,s=f});return c.status="pending",c.resolve=o=>{c.status="resolved",c.value=o,i(o),l==null||l(o)},c.reject=o=>{c.status="rejected",s(o)},c}function Ls(l){return!!(l&&typeof l=="object"&&typeof l.then=="function")}const sb=/[\x00-\x1f\x7f"<>`{}]/g;function ub(l){return l.replace(sb,i=>"%"+i.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function pp(l){let i;try{i=decodeURI(l)}catch{i=l.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return ub(i)}const cb=["http:","https:","mailto:","tel:"];function Nc(l,i){if(!l)return!1;try{const s=new URL(l);return!i.has(s.protocol)}catch{return!1}}function _s(l){if(!l)return{path:l,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(l)&&!l.startsWith("//"))return{path:l,handledProtocolRelativeURL:!1};const i=/%25|%5C/gi;let s=0,c="",o;for(;(o=i.exec(l))!==null;)c+=pp(l.slice(s,o.index))+o[0],s=i.lastIndex;c=c+pp(s?l.slice(s):l);let f=!1;return c.startsWith("//")&&(f=!0,c="/"+c.replace(/^\/+/,"")),{path:c,handledProtocolRelativeURL:f}}function rb(l){return/\s|[^\u0000-\u007F]/.test(l)?l.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):l}function ob(l,i){if(l===i)return!0;if(l.length!==i.length)return!1;for(let s=0;s{f.next&&(f.prev?(f.prev.next=f.next,f.next.prev=f.prev,f.next=void 0,c&&(c.next=f,f.prev=c)):(f.next.prev=void 0,s=f.next,f.next=void 0,c&&(f.prev=c,c.next=f)),c=f)};return{get(f){const m=i.get(f);if(m)return o(m),m.value},set(f,m){if(i.size>=l&&s){const g=s;i.delete(g.key),g.next&&(s=g.next,g.next.prev=void 0),g===c&&(c=void 0)}const v=i.get(f);if(v)v.value=m,o(v);else{const g={key:f,value:m,prev:c};c&&(c.next=g),c=g,s||(s=g),i.set(f,g)}},clear(){i.clear(),s=void 0,c=void 0}}}const Da=4,mg=5;function fb(l){const i=l.indexOf("{");if(i===-1)return null;const s=l.indexOf("}",i);return s===-1||i+1>=l.length?null:[i,s]}function yg(l,i,s=new Uint16Array(6)){const c=l.indexOf("/",i),o=c===-1?l.length:c,f=l.substring(i,o);if(!f||!f.includes("$"))return s[0]=0,s[1]=i,s[2]=i,s[3]=o,s[4]=o,s[5]=o,s;if(f==="$"){const v=l.length;return s[0]=2,s[1]=i,s[2]=i,s[3]=v,s[4]=v,s[5]=v,s}if(f.charCodeAt(0)===36)return s[0]=1,s[1]=i,s[2]=i+1,s[3]=o,s[4]=o,s[5]=o,s;const m=fb(f);if(m){const[v,g]=m,y=f.charCodeAt(v+1);if(y===45){if(v+2!Z.parse&&Z.caseSensitive===W&&Z.prefix===at&&Z.suffix===gt));if(k)Y=k;else{const Z=tf(1,s.fullPath??s.from,W,at,gt);Y=Z,Z.depth=f,Z.parent=o,o.dynamic??(o.dynamic=[]),o.dynamic.push(Z)}break}case 3:{const X=D.substring(I,z[1]),tt=D.substring(z[4],$),W=A&&!!(X||tt),at=X?W?X:X.toLowerCase():void 0,gt=tt?W?tt:tt.toLowerCase():void 0,k=!q&&((_=o.optional)==null?void 0:_.find(Z=>!Z.parse&&Z.caseSensitive===W&&Z.prefix===at&&Z.suffix===gt));if(k)Y=k;else{const Z=tf(3,s.fullPath??s.from,W,at,gt);Y=Z,Z.parent=o,Z.depth=f,o.optional??(o.optional=[]),o.optional.push(Z)}break}case 2:{const X=D.substring(I,z[1]),tt=D.substring(z[4],$),W=A&&!!(X||tt),at=X?W?X:X.toLowerCase():void 0,gt=tt?W?tt:tt.toLowerCase():void 0,k=tf(2,s.fullPath??s.from,W,at,gt);Y=k,k.parent=o,k.depth=f,o.wildcard??(o.wildcard=[]),o.wildcard.push(k)}}o=Y}if(q&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const z=ul(s.fullPath??s.from);z.kind=mg,z.parent=o,f++,z.depth=f,o.pathless??(o.pathless=[]),o.pathless.push(z),o=z}const U=(s.path||!s.children)&&!s.isRoot;if(U&&D.endsWith("/")){const z=ul(s.fullPath??s.from);z.kind=Da,z.parent=o,f++,z.depth=f,o.index=z,o=z}o.parse=q??null,o.priority=((C=(w=s.options)==null?void 0:w.params)==null?void 0:C.priority)??0,U&&!o.route&&(o.route=s,o.fullPath=s.fullPath??s.from)}if(s.children)for(const D of s.children)Mc(l,i,D,v,o,f,m)}function Wo(l,i){if(l.parse&&!i.parse)return-1;if(!l.parse&&i.parse)return 1;if(l.parse&&i.parse&&(l.priority||i.priority))return i.priority-l.priority;if(l.prefix&&i.prefix&&l.prefix!==i.prefix){if(l.prefix.startsWith(i.prefix))return-1;if(i.prefix.startsWith(l.prefix))return 1}if(l.suffix&&i.suffix&&l.suffix!==i.suffix){if(l.suffix.endsWith(i.suffix))return-1;if(i.suffix.endsWith(l.suffix))return 1}return l.prefix&&!i.prefix?-1:!l.prefix&&i.prefix?1:l.suffix&&!i.suffix?-1:!l.suffix&&i.suffix?1:l.caseSensitive&&!i.caseSensitive?-1:!l.caseSensitive&&i.caseSensitive?1:0}function Ea(l){var i,s,c;if(l.pathless)for(const o of l.pathless)Ea(o);if(l.static)for(const o of l.static.values())Ea(o);if(l.staticInsensitive)for(const o of l.staticInsensitive.values())Ea(o);if((i=l.dynamic)!=null&&i.length){l.dynamic.sort(Wo);for(const o of l.dynamic)Ea(o)}if((s=l.optional)!=null&&s.length){l.optional.sort(Wo);for(const o of l.optional)Ea(o)}if((c=l.wildcard)!=null&&c.length){l.wildcard.sort(Wo);for(const o of l.wildcard)Ea(o)}}function ul(l){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:l,parent:null,parse:null,priority:0}}function tf(l,i,s,c,o){return{kind:l,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:i,parent:null,parse:null,priority:0,caseSensitive:s,prefix:c,suffix:o}}function db(l,i){const s=ul("/"),c=new Uint16Array(6);for(const o of l)Mc(!1,c,o,1,s,0);Ea(s),i.masksTree=s,i.flatCache=Us(1e3)}function hb(l,i){l||(l="/");const s=i.flatCache.get(l);if(s)return s;const c=Qf(l,i.masksTree);return i.flatCache.set(l,c),c}function mb(l,i,s,c,o){l||(l="/"),c||(c="/");const f=i?`case\0${l}`:l;let m=o.singleCache.get(f);return m||(m=ul("/"),Mc(i,new Uint16Array(6),{from:l},1,m,0),o.singleCache.set(f,m)),Qf(c,m,s)}function yb(l,i,s=!1){const c=s?l:`nofuzz\0${l}`,o=i.matchCache.get(c);if(o!==void 0)return o;l||(l="/");let f;try{f=Qf(l,i.segmentTree,s)}catch(m){if(m instanceof URIError)f=null;else throw m}return f&&(f.branch=gg(f.route)),i.matchCache.set(c,f),f}function pb(l){return l==="/"?l:l.replace(/\/{1,}$/,"")}function gb(l,i=!1,s){const c=ul(l.fullPath),o=new Uint16Array(6),f={},m={};let v=0;return Mc(i,o,l,1,c,0,g=>{if(s==null||s(g,v),g.id in f&&Xn(),f[g.id]=g,v!==0&&g.path){const y=pb(g.fullPath);(!m[y]||g.fullPath.endsWith("/"))&&(m[y]=g)}v++}),Ea(c),{processedTree:{segmentTree:c,singleCache:Us(1e3),matchCache:Us(1e3),flatCache:null,masksTree:null},routesById:f,routesByPath:m}}function Qf(l,i,s=!1){const c=l.split("/"),o=xb(l,c,i,s);if(!o)return null;const[f]=pg(l,c,o);return{route:o.node.route,rawParams:f}}function pg(l,i,s){var b,p,S,j,N,_,w,C,D,G;const c=vb(s.node);let o=null;const f=Object.create(null);let m=((b=s.extract)==null?void 0:b.part)??0,v=((p=s.extract)==null?void 0:p.node)??0,g=((S=s.extract)==null?void 0:S.path)??0,y=((j=s.extract)==null?void 0:j.segment)??0;for(;v=0;z--){const Y=p.wildcard[z],{prefix:I,suffix:$}=Y;if(!(I&&(A||!(Y.caseSensitive?q:U??(U=q.toLowerCase())).startsWith(I)))){if($){if(A)continue;const X=i.slice(S).join("/").slice(-$.length);if((Y.caseSensitive?X:X.toLowerCase())!==$)continue}v.push({node:Y,index:m,skipped:j,depth:N+1,statics:_,dynamics:w,optionals:C,extract:D,rawParams:G})}}if(p.optional){const z=j|1<=0;I--){const $=p.optional[I];v.push({node:$,index:S,skipped:z,depth:Y,statics:_,dynamics:w,optionals:C,extract:D,rawParams:G})}if(!A)for(let I=p.optional.length-1;I>=0;I--){const $=p.optional[I],{prefix:X,suffix:tt}=$;if(X||tt){const W=$.caseSensitive?q:U??(U=q.toLowerCase());if(X&&!W.startsWith(X)||tt&&!W.endsWith(tt))continue}v.push({node:$,index:S+1,skipped:j,depth:Y,statics:_,dynamics:w,optionals:C+fc(m,S),extract:D,rawParams:G})}}if(!A&&p.dynamic&&q)for(let z=p.dynamic.length-1;z>=0;z--){const Y=p.dynamic[z],{prefix:I,suffix:$}=Y;if(I||$){const X=Y.caseSensitive?q:U??(U=q.toLowerCase());if(I&&!X.startsWith(I)||$&&!X.endsWith($))continue}v.push({node:Y,index:S+1,skipped:j,depth:N+1,statics:_,dynamics:w+fc(m,S),optionals:C,extract:D,rawParams:G})}if(!A&&p.staticInsensitive){const z=p.staticInsensitive.get(U??(U=q.toLowerCase()));z&&v.push({node:z,index:S+1,skipped:j,depth:N+1,statics:_+fc(m,S),dynamics:w,optionals:C,extract:D,rawParams:G})}if(!A&&p.static){const z=p.static.get(q);z&&v.push({node:z,index:S+1,skipped:j,depth:N+1,statics:_+fc(m,S),dynamics:w,optionals:C,extract:D,rawParams:G})}if(p.pathless){const z=N+1;for(let Y=p.pathless.length-1;Y>=0;Y--){const I=p.pathless[Y];v.push({node:I,index:S,skipped:j,depth:z,statics:_,dynamics:w,optionals:C,extract:D,rawParams:G})}}}if(y)return y;if(c&&g){let b=g.index;for(let S=0;Sl.statics||i.statics===l.statics&&(i.dynamics>l.dynamics||i.dynamics===l.dynamics&&(i.optionals>l.optionals||i.optionals===l.optionals&&((i.node.kind===Da)>(l.node.kind===Da)||i.node.kind===Da==(l.node.kind===Da)&&i.depth>l.depth))):!0}function pc(l){return Yf(l.filter(i=>i!==void 0).join("/"))}function Yf(l){return l.replace(/\/{2,}/g,"/")}function vg(l){return l==="/"?l:l.replace(/^\/{1,}/,"")}function Kn(l){const i=l.length;return i>1&&l[i-1]==="/"?l.replace(/\/{1,}$/,""):l}function xg(l){return Kn(vg(l))}function Ec(l,i){return l!=null&&l.endsWith("/")&&l!=="/"&&l!==`${i}/`?l.slice(0,-1):l}function Sb(l,i,s){return Ec(l,s)===Ec(i,s)}function jb({base:l,to:i,trailingSlash:s="never",cache:c}){const o=i.startsWith("/"),f=!o&&i===".";let m;if(c){m=o?i:f?l:l+"\0"+i;const y=c.get(m);if(y)return y}let v;if(f)v=l.split("/");else if(o)v=i.split("/");else{for(v=l.split("/");v.length>1&&Ds(v)==="";)v.pop();const y=i.split("/");for(let b=0,p=y.length;b1&&(Ds(v)===""?s==="never"&&v.pop():s==="always"&&v.push(""));const g=Yf(v.join("/"))||"/";return m&&c&&c.set(m,g),g}function Nb(l){const i=new Map(l.map(o=>[encodeURIComponent(o),o])),s=Array.from(i.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),c=new RegExp(s,"g");return o=>o.replace(c,f=>i.get(f)??f)}function ef(l,i,s){const c=i[l];return typeof c!="string"?c:l==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(c)?c:c.split("/").map(o=>xp(o,s)).join("/"):xp(c,s)}function vp({path:l,params:i,decoder:s,...c}){let o=!1;const f=Object.create(null);if(!l||l==="/")return{interpolatedPath:"/",usedParams:f,isMissingParams:o};if(!l.includes("$"))return{interpolatedPath:l,usedParams:f,isMissingParams:o};const m=l.length;let v=0,g,y="";for(;v{i[0]==="?"&&(i=i.substring(1));const s=Rb(i);for(const c in s){const o=s[c];if(typeof o=="string")try{s[c]=l(o)}catch{}}return s}}function Cb(l,i){const s=typeof i=="function";function c(o){if(typeof o=="object"&&o!==null)try{return l(o)}catch{}else if(s&&typeof o=="string")try{return i(o),l(o)}catch{}return o}return o=>{const f=Eb(o,c);return f?`?${f}`:""}}const vl="__root__";function Ab(l){if(l.statusCode=l.statusCode||l.code||307,!l._builtLocation&&!l.reloadDocument&&typeof l.href=="string")try{new URL(l.href),l.reloadDocument=!0}catch{}const i=new Headers(l.headers);l.href&&i.get("Location")===null&&i.set("Location",l.href);const s=new Response(null,{status:l.statusCode,headers:i});if(s.options=l,l.throw)throw s;return s}function we(l){return l instanceof Response&&!!l.options}const Tf=l=>{var i;if(!l.rendered)return l.rendered=!0,(i=l.onReady)==null?void 0:i.call(l)},wb=l=>l.stores.matchesId.get().some(i=>{var s;return(s=l.stores.matchStores.get(i))==null?void 0:s.get()._forcePending}),Cc=(l,i)=>!!(l.preload&&!l.router.stores.matchStores.has(i)),xl=(l,i,s=!0)=>{const c={...l.router.options.context??{}},o=s?i:i-1;for(let f=0;f<=o;f++){const m=l.matches[f];if(!m)continue;const v=l.router.getMatch(m.id);v&&Object.assign(c,v.__routeContext,v.__beforeLoadContext)}return c},bp=(l,i)=>{if(!l.matches.length)return;const s=i.routeId,c=l.matches.findIndex(m=>m.routeId===l.router.routeTree.id),o=c>=0?c:0;let f=s?l.matches.findIndex(m=>m.routeId===s):l.firstBadMatchIndex??l.matches.length-1;f<0&&(f=o);for(let m=f;m>=0;m--){const v=l.matches[m];if(l.router.looseRoutesById[v.routeId].options.notFoundComponent)return m}return s?f:o},La=(l,i,s)=>{var c,o,f;if(!(!we(s)&&!ge(s)))throw we(s)&&s.redirectHandled&&!s.options.reloadDocument||(i&&((c=i._nonReactive.beforeLoadPromise)==null||c.resolve(),(o=i._nonReactive.loaderPromise)==null||o.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loaderPromise=void 0,i._nonReactive.error=s,l.updateMatch(i.id,m=>({...m,status:we(s)?"redirected":ge(s)?"notFound":m.status==="pending"?"success":m.status,context:xl(l,i.index),isFetching:!1,error:s})),ge(s)&&!s.routeId&&(s.routeId=i.routeId),(f=i._nonReactive.loadPromise)==null||f.resolve()),we(s)&&(l.rendered=!0,s.options._fromLocation=l.location,s.redirectHandled=!0,s=l.router.resolveRedirect(s))),s},bg=(l,i)=>{const s=l.router.getMatch(i);return!!(!s||s._nonReactive.dehydrated)},Sp=(l,i,s)=>{const c=xl(l,s);l.updateMatch(i,o=>({...o,context:c}))},Ts=(l,i,s)=>{var m,v;const{id:c,routeId:o}=l.matches[i],f=l.router.looseRoutesById[o];if(s instanceof Promise)throw s;l.firstBadMatchIndex??(l.firstBadMatchIndex=i),La(l,l.router.getMatch(c),s);try{(v=(m=f.options).onError)==null||v.call(m,s)}catch(g){s=g,La(l,l.router.getMatch(c),s)}l.updateMatch(c,g=>{var y,b;return(y=g._nonReactive.beforeLoadPromise)==null||y.resolve(),g._nonReactive.beforeLoadPromise=void 0,(b=g._nonReactive.loadPromise)==null||b.resolve(),{...g,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!l.preload&&!we(s)&&!ge(s)&&(l.serialError??(l.serialError=s))},Sg=(l,i,s,c)=>{var f;if(c._nonReactive.pendingTimeout!==void 0)return;const o=s.options.pendingMs??l.router.options.defaultPendingMs;if(l.onReady&&!Cc(l,i)&&(s.options.loader||s.options.beforeLoad||Ng(s))&&typeof o=="number"&&o!==1/0&&(s.options.pendingComponent??((f=l.router.options)==null?void 0:f.defaultPendingComponent))){const m=setTimeout(()=>{Tf(l)},o);c._nonReactive.pendingTimeout=m}},Ob=(l,i,s)=>{const c=l.router.getMatch(i);if(!c._nonReactive.beforeLoadPromise&&!c._nonReactive.loaderPromise)return;Sg(l,i,s,c);const o=()=>{const f=l.router.getMatch(i);f.preload&&(f.status==="redirected"||f.status==="notFound")&&La(l,f,f.error)};return c._nonReactive.beforeLoadPromise?c._nonReactive.beforeLoadPromise.then(o):o()},zb=(l,i,s,c)=>{const o=l.router.getMatch(i);let f=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Ti(()=>{f==null||f.resolve(),f=void 0});const{paramsError:m,searchError:v}=o;m&&Ts(l,s,m),v&&Ts(l,s,v),Sg(l,i,c,o);const g=new AbortController;let y=!1;const b=()=>{y||(y=!0,l.updateMatch(i,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:g})))},p=()=>{var A;(A=o._nonReactive.beforeLoadPromise)==null||A.resolve(),o._nonReactive.beforeLoadPromise=void 0,l.updateMatch(i,q=>({...q,isFetching:!1}))};if(!c.options.beforeLoad){l.router.batch(()=>{b(),p()});return}o._nonReactive.beforeLoadPromise=Ti();const S={...xl(l,s,!1),...o.__routeContext},{search:j,params:N,cause:_}=o,w=Cc(l,i),C={search:j,abortController:g,params:N,preload:w,context:S,location:l.location,navigate:A=>l.router.navigate({...A,_fromLocation:l.location}),buildLocation:l.router.buildLocation,cause:w?"preload":_,matches:l.matches,routeId:c.id,...l.router.options.additionalContext},D=A=>{if(A===void 0){l.router.batch(()=>{b(),p()});return}(we(A)||ge(A))&&(b(),Ts(l,s,A)),l.router.batch(()=>{b(),l.updateMatch(i,q=>({...q,__beforeLoadContext:A})),p()})};let G;try{if(G=c.options.beforeLoad(C),Ls(G))return b(),G.catch(A=>{Ts(l,s,A)}).then(D)}catch(A){b(),Ts(l,s,A)}D(G)},Db=(l,i)=>{const{id:s,routeId:c}=l.matches[i],o=l.router.looseRoutesById[c],f=()=>v(),m=()=>zb(l,s,i,o),v=()=>{if(bg(l,s))return;const g=Ob(l,s,o);return Ls(g)?g.then(m):m()};return f()},Lb=(l,i,s)=>{var f,m,v,g,y,b;const c=l.router.getMatch(i);if(!c||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const o={ssr:l.router.options.ssr,matches:l.matches,match:c,params:c.params,loaderData:c.loaderData};return Promise.all([(m=(f=s.options).head)==null?void 0:m.call(f,o),(g=(v=s.options).scripts)==null?void 0:g.call(v,o),(b=(y=s.options).headers)==null?void 0:b.call(y,o)]).then(([p,S,j])=>({meta:p==null?void 0:p.meta,links:p==null?void 0:p.links,headScripts:p==null?void 0:p.scripts,headers:j,scripts:S,styles:p==null?void 0:p.styles}))},jg=(l,i,s,c,o)=>{const f=i[c-1],{params:m,loaderDeps:v,abortController:g,cause:y}=l.router.getMatch(s),b=xl(l,c),p=Cc(l,s);return{params:m,deps:v,preload:!!p,parentMatchPromise:f,abortController:g,context:b,location:l.location,navigate:S=>l.router.navigate({...S,_fromLocation:l.location}),cause:p?"preload":y,route:o,...l.router.options.additionalContext}},jp=async(l,i,s,c,o)=>{var f,m,v,g,y;try{const b=l.router.getMatch(s);try{(!(fg??l.router.isServer)||b.ssr===!0)&&Bs(o);const p=o.options.loader,S=typeof p=="function"?p:p==null?void 0:p.handler,j=S==null?void 0:S(jg(l,i,s,c,o)),N=!!S&&Ls(j);if((N||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||b._nonReactive.minPendingPromise)&&l.updateMatch(s,w=>({...w,isFetching:"loader"})),S){const w=N?await j:j;La(l,l.router.getMatch(s),w),w!==void 0&&l.updateMatch(s,C=>({...C,loaderData:w}))}o._lazyPromise&&await o._lazyPromise;const _=b._nonReactive.minPendingPromise;_&&await _,o._componentsPromise&&await o._componentsPromise,l.updateMatch(s,w=>({...w,error:void 0,context:xl(l,c),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(p){let S=p;if((S==null?void 0:S.name)==="AbortError"){if(b.abortController.signal.aborted){(f=b._nonReactive.loaderPromise)==null||f.resolve(),b._nonReactive.loaderPromise=void 0;return}l.updateMatch(s,N=>({...N,status:N.status==="pending"?"success":N.status,isFetching:!1,context:xl(l,c)}));return}const j=b._nonReactive.minPendingPromise;j&&await j,ge(p)&&await((v=(m=o.options.notFoundComponent)==null?void 0:m.preload)==null?void 0:v.call(m)),La(l,l.router.getMatch(s),p);try{(y=(g=o.options).onError)==null||y.call(g,p)}catch(N){S=N,La(l,l.router.getMatch(s),N)}!we(S)&&!ge(S)&&await Bs(o,["errorComponent"]),l.updateMatch(s,N=>({...N,error:S,context:xl(l,c),status:"error",isFetching:!1}))}}catch(b){const p=l.router.getMatch(s);p&&(p._nonReactive.loaderPromise=void 0),La(l,p,b)}},Ub=async(l,i,s)=>{var j,N,_,w;async function c(C,D,G,A,q){const U=Date.now()-D.updatedAt,z=C?q.options.preloadStaleTime??l.router.options.defaultPreloadStaleTime??3e4:q.options.staleTime??l.router.options.defaultStaleTime??0,Y=q.options.shouldReload,I=typeof Y=="function"?Y(jg(l,i,o,s,q)):Y,{status:$,invalid:X}=A,tt=U>=z&&(!!l.forceStaleReload||A.cause==="enter"||G!==void 0&&G!==A.id);m=$==="success"&&(X||(I??tt)),C&&q.options.preload===!1||(m&&!l.sync&&b?(v=!0,(async()=>{var W,at;try{await jp(l,i,o,s,q);const gt=l.router.getMatch(o);(W=gt._nonReactive.loaderPromise)==null||W.resolve(),(at=gt._nonReactive.loadPromise)==null||at.resolve(),gt._nonReactive.loaderPromise=void 0,gt._nonReactive.loadPromise=void 0}catch(gt){we(gt)&&await l.router.navigate(gt.options)}})()):$!=="success"||m?await jp(l,i,o,s,q):Sp(l,o,s))}const{id:o,routeId:f}=l.matches[s];let m=!1,v=!1;const g=l.router.looseRoutesById[f],y=g.options.loader,b=((typeof y=="function"||y==null?void 0:y.staleReloadMode)??l.router.options.defaultStaleReloadMode)!=="blocking";if(bg(l,o)){if(!l.router.getMatch(o))return l.matches[s];Sp(l,o,s)}else{const C=l.router.getMatch(o),D=l.router.stores.matchesId.get()[s],G=((j=D&&l.router.stores.matchStores.get(D)||null)==null?void 0:j.routeId)===f?D:(N=l.router.stores.matches.get().find(q=>q.routeId===f))==null?void 0:N.id,A=Cc(l,o);if(C._nonReactive.loaderPromise){if(C.status==="success"&&!l.sync&&!C.preload&&b)return C;await C._nonReactive.loaderPromise;const q=l.router.getMatch(o),U=q._nonReactive.error||q.error;U&&La(l,q,U),q.status==="pending"&&await c(A,C,G,q,g)}else{const q=A&&!l.router.stores.matchStores.has(o),U=l.router.getMatch(o);U._nonReactive.loaderPromise=Ti(),q!==U.preload&&l.updateMatch(o,z=>({...z,preload:q})),await c(A,C,G,U,g)}}const p=l.router.getMatch(o);v||((_=p._nonReactive.loaderPromise)==null||_.resolve(),(w=p._nonReactive.loadPromise)==null||w.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,v||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const S=v?p.isFetching:!1;return S!==p.isFetching||p.invalid!==!1?(l.updateMatch(o,C=>({...C,isFetching:S,invalid:!1})),l.router.getMatch(o)):p};async function Np(l){var S,j;const i=l,s=[];wb(i.router)&&Tf(i);let c;for(let N=0;N({...G,...D?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:y},isFetching:!1})),b=N,await Bs(w,["notFoundComponent"])}else if(!i.preload){const N=i.matches[0];N.globalNotFound||(j=i.router.getMatch(N.id))!=null&&j.globalNotFound&&i.updateMatch(N.id,_=>({..._,globalNotFound:!1,error:void 0}))}if(i.serialError&&i.firstBadMatchIndex!==void 0){const N=i.router.looseRoutesById[i.matches[i.firstBadMatchIndex].routeId];await Bs(N,["errorComponent"])}for(let N=0;N<=b;N++){const{id:_,routeId:w}=i.matches[N],C=i.router.looseRoutesById[w];try{const D=Lb(i,_,C);if(D){const G=await D;i.updateMatch(_,A=>({...A,...G}))}}catch(D){console.error(`Error executing head for route ${w}:`,D)}}const p=Tf(i);if(Ls(p)&&await p,y)throw y;if(i.serialError&&!i.preload&&!i.onReady)throw i.serialError;return i.matches}function Ep(l,i){const s=i.map(c=>{var o,f;return(f=(o=l.options[c])==null?void 0:o.preload)==null?void 0:f.call(o)}).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Bs(l,i=gc){!l._lazyLoaded&&l._lazyPromise===void 0&&(l.lazyFn?l._lazyPromise=l.lazyFn().then(c=>{const{id:o,...f}=c.options;Object.assign(l.options,f),l._lazyLoaded=!0,l._lazyPromise=void 0}):l._lazyLoaded=!0);const s=()=>l._componentsLoaded?void 0:i===gc?(()=>{if(l._componentsPromise===void 0){const c=Ep(l,gc);c?l._componentsPromise=c.then(()=>{l._componentsLoaded=!0,l._componentsPromise=void 0}):l._componentsLoaded=!0}return l._componentsPromise})():Ep(l,i);return l._lazyPromise?l._lazyPromise.then(s):s()}function Ng(l){var i;for(const s of gc)if((i=l.options[s])!=null&&i.preload)return!0;return!1}const gc=["component","errorComponent","pendingComponent","notFoundComponent"];function Bb(l){return{input:({url:i})=>{for(const s of l)i=Mf(s,i);return i},output:({url:i})=>{for(let s=l.length-1;s>=0;s--)i=Eg(l[s],i);return i}}}function qb(l){const i=xg(l.basepath),s=`/${i}`,c=l.caseSensitive?s:s.toLowerCase(),o=`${c}/`;return{input:({url:f})=>{const m=l.caseSensitive?f.pathname:f.pathname.toLowerCase();return m===c?f.pathname="/":m.startsWith(o)&&(f.pathname=f.pathname.slice(s.length)),f},output:({url:f})=>(f.pathname=pc(["/",i,f.pathname]),f)}}function Mf(l,i){var c;const s=(c=l==null?void 0:l.input)==null?void 0:c.call(l,{url:i});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return i}function Eg(l,i){var c;const s=(c=l==null?void 0:l.output)==null?void 0:c.call(l,{url:i});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return i}function Hb(l,i){const{createMutableStore:s,createReadonlyStore:c,batch:o,init:f}=i,m=new Map,v=new Map,g=new Map,y=s(l.status),b=s(l.loadedAt),p=s(l.isLoading),S=s(l.isTransitioning),j=s(l.location),N=s(l.resolvedLocation),_=s(l.statusCode),w=s(l.redirect),C=s([]),D=s([]),G=s([]),A=c(()=>af(m,C.get())),q=c(()=>af(v,D.get())),U=c(()=>af(g,G.get())),z=c(()=>C.get()[0]),Y=c(()=>C.get().some(Z=>{var ut;return((ut=m.get(Z))==null?void 0:ut.get().status)==="pending"})),I=c(()=>{var Z;return{locationHref:j.get().href,resolvedLocationHref:(Z=N.get())==null?void 0:Z.href,status:y.get()}}),$=c(()=>({status:y.get(),loadedAt:b.get(),isLoading:p.get(),isTransitioning:S.get(),matches:A.get(),location:j.get(),resolvedLocation:N.get(),statusCode:_.get(),redirect:w.get()})),X=Us(64);function tt(Z){let ut=X.get(Z);return ut||(ut=c(()=>{const Mt=C.get();for(const At of Mt){const M=m.get(At);if(M&&M.routeId===Z)return M.get()}}),X.set(Z,ut)),ut}const W={status:y,loadedAt:b,isLoading:p,isTransitioning:S,location:j,resolvedLocation:N,statusCode:_,redirect:w,matchesId:C,pendingIds:D,cachedIds:G,matches:A,pendingMatches:q,cachedMatches:U,firstId:z,hasPending:Y,matchRouteDeps:I,matchStores:m,pendingMatchStores:v,cachedMatchStores:g,__store:$,getRouteMatchStore:tt,setMatches:at,setPending:gt,setCached:k};at(l.matches),f==null||f(W);function at(Z){lf(Z,m,C,s,o)}function gt(Z){lf(Z,v,D,s,o)}function k(Z){lf(Z,g,G,s,o)}return W}function af(l,i){const s=[];for(const c of i){const o=l.get(c);o&&s.push(o.get())}return s}function lf(l,i,s,c,o){const f=l.map(v=>v.id),m=new Set(f);o(()=>{for(const v of i.keys())m.has(v)||i.delete(v);for(const v of l){const g=i.get(v.id);if(!g){const y=c(v);y.routeId=v.routeId,i.set(v.id,y);continue}g.routeId=v.routeId,g.get()!==v&&g.set(v)}ob(s.get(),f)||s.set(f)})}var Ba="__TSR_index",Rp="popstate",_p="beforeunload";function kb(l){let i=l.getLocation();const s=new Set,c=m=>{i=l.getLocation(),s.forEach(v=>v({location:i,action:m}))},o=m=>{l.notifyOnIndexChange??!0?c(m):i=l.getLocation()},f=async({task:m,navigateOpts:v,...g})=>{var p,S;if((v==null?void 0:v.ignoreBlocker)??!1){m();return}const y=((p=l.getBlockers)==null?void 0:p.call(l))??[],b=g.type==="PUSH"||g.type==="REPLACE";if(typeof document<"u"&&y.length&&b)for(const j of y){const N=Rc(g.path,g.state);if(await j.blockerFn({currentLocation:i,nextLocation:N,action:g.type})){(S=l.onBlocked)==null||S.call(l);return}}m()};return{get location(){return i},get length(){return l.getLength()},subscribers:s,subscribe:m=>(s.add(m),()=>{s.delete(m)}),push:(m,v,g)=>{const y=i.state[Ba];v=Tp(y+1,v),f({task:()=>{l.pushState(m,v),c({type:"PUSH"})},navigateOpts:g,type:"PUSH",path:m,state:v})},replace:(m,v,g)=>{const y=i.state[Ba];v=Tp(y,v),f({task:()=>{l.replaceState(m,v),c({type:"REPLACE"})},navigateOpts:g,type:"REPLACE",path:m,state:v})},go:(m,v)=>{f({task:()=>{l.go(m),o({type:"GO",index:m})},navigateOpts:v,type:"GO"})},back:m=>{f({task:()=>{l.back((m==null?void 0:m.ignoreBlocker)??!1),o({type:"BACK"})},navigateOpts:m,type:"BACK"})},forward:m=>{f({task:()=>{l.forward((m==null?void 0:m.ignoreBlocker)??!1),o({type:"FORWARD"})},navigateOpts:m,type:"FORWARD"})},canGoBack:()=>i.state[Ba]!==0,createHref:m=>l.createHref(m),block:m=>{var g;if(!l.setBlockers)return()=>{};const v=((g=l.getBlockers)==null?void 0:g.call(l))??[];return l.setBlockers([...v,m]),()=>{var b,p;const y=((b=l.getBlockers)==null?void 0:b.call(l))??[];(p=l.setBlockers)==null||p.call(l,y.filter(S=>S!==m))}},flush:()=>{var m;return(m=l.flush)==null?void 0:m.call(l)},destroy:()=>{var m;return(m=l.destroy)==null?void 0:m.call(l)},notify:c}}function Tp(l,i){i||(i={});const s=Gf();return{...i,key:s,__TSR_key:s,[Ba]:l}}function Qb(l){var Y,I;const i=typeof document<"u"?window:void 0,s=i.history.pushState,c=i.history.replaceState;let o=[];const f=()=>o,m=$=>o=$,v=($=>$),g=(()=>Rc(`${i.location.pathname}${i.location.search}${i.location.hash}`,i.history.state));if(!((Y=i.history.state)!=null&&Y.__TSR_key)&&!((I=i.history.state)!=null&&I.key)){const $=Gf();i.history.replaceState({[Ba]:0,key:$,__TSR_key:$},"")}let y=g(),b,p=!1,S=!1,j=!1,N=!1;const _=()=>y;let w,C;const D=()=>{w&&(z._ignoreSubscribers=!0,(w.isPush?i.history.pushState:i.history.replaceState)(w.state,"",w.href),z._ignoreSubscribers=!1,w=void 0,C=void 0,b=void 0)},G=($,X,tt)=>{const W=v(X);C||(b=y),y=Rc(X,tt),w={href:W,state:tt,isPush:(w==null?void 0:w.isPush)||$==="push"},C||(C=Promise.resolve().then(()=>D()))},A=$=>{y=g(),z.notify({type:$})},q=async()=>{if(S){S=!1;return}const $=g(),X=$.state[Ba]-y.state[Ba],tt=X===1,W=X===-1,at=!tt&&!W||p;p=!1;const gt=at?"GO":W?"BACK":"FORWARD",k=at?{type:"GO",index:X}:{type:W?"BACK":"FORWARD"};if(j)j=!1;else{const Z=f();if(typeof document<"u"&&Z.length){for(const ut of Z)if(await ut.blockerFn({currentLocation:y,nextLocation:$,action:gt})){S=!0,i.history.go(1),z.notify(k);return}}}y=g(),z.notify(k)},U=$=>{if(N){N=!1;return}let X=!1;const tt=f();if(typeof document<"u"&&tt.length)for(const W of tt){const at=W.enableBeforeUnload??!0;if(at===!0){X=!0;break}if(typeof at=="function"&&at()===!0){X=!0;break}}if(X)return $.preventDefault(),$.returnValue=""},z=kb({getLocation:_,getLength:()=>i.history.length,pushState:($,X)=>G("push",$,X),replaceState:($,X)=>G("replace",$,X),back:$=>($&&(j=!0),N=!0,i.history.back()),forward:$=>{$&&(j=!0),N=!0,i.history.forward()},go:$=>{p=!0,i.history.go($)},createHref:$=>v($),flush:D,destroy:()=>{i.history.pushState=s,i.history.replaceState=c,i.removeEventListener(_p,U,{capture:!0}),i.removeEventListener(Rp,q)},onBlocked:()=>{b&&y!==b&&(y=b)},getBlockers:f,setBlockers:m,notifyOnIndexChange:!1});return i.addEventListener(_p,U,{capture:!0}),i.addEventListener(Rp,q),i.history.pushState=function(...$){const X=s.apply(i.history,$);return z._ignoreSubscribers||A("PUSH"),X},i.history.replaceState=function(...$){const X=c.apply(i.history,$);return z._ignoreSubscribers||A("REPLACE"),X},z}function Yb(l){let i=l.replace(/[\x00-\x1f\x7f]/g,"");return i.startsWith("//")&&(i="/"+i.replace(/^\/+/,"")),i}function Rc(l,i){const s=Yb(l),c=s.indexOf("#"),o=s.indexOf("?"),f=Gf();return{href:s,pathname:s.substring(0,c>0?o>0?Math.min(c,o):c:o>0?o:s.length),hash:c>-1?s.substring(c):"",search:o>-1?s.slice(o,c===-1?void 0:c):"",state:i||{[Ba]:0,key:f,__TSR_key:f}}}function Gf(){return(Math.random()+1).toString(36).substring(7)}function di(l,i){const s=i,c=l;return{fromLocation:s,toLocation:c,pathChanged:(s==null?void 0:s.pathname)!==c.pathname,hrefChanged:(s==null?void 0:s.href)!==c.href,hashChanged:(s==null?void 0:s.hash)!==c.hash}}const Cf=new WeakMap;var Gb=class{constructor(l,i){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=s=>s(),this.update=s=>{var b;const c=this.options,o=this.basepath??(c==null?void 0:c.basepath)??"/",f=this.basepath===void 0,m=c==null?void 0:c.rewrite;if(this.options={...c,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Nb(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Qb()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=Us(1e3),p=this.buildRouteTree(),this.setRoutes(p)}if(!this.stores&&this.latestLocation){const p=this.getStoreConfig(this);this.batch=p.batch,this.stores=Hb(Xb(this.latestLocation),p),nS(this)}let v=!1;const g=this.options.basepath??"/",y=this.options.rewrite;if(f||o!==g||m!==y){this.basepath=g;const p=[],S=xg(g);S&&S!=="/"&&p.push(qb({basepath:g})),y&&p.push(y),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Bb(p),this.history&&this.updateLatestLocation(),v=!0}v&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((b=window.CSS)==null?void 0:b.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=gb(this.routeTree,this.options.caseSensitive,(c,o)=>{c.init({originalIndex:o})});return this.options.routeMasks&&db(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,c)=>{const o={eventType:s,fn:c};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=s=>{this.subscribers.forEach(c=>{c.eventType===s.type&&c.fn(s)})},this.parseLocation=(s,c)=>{const o=({pathname:g,search:y,hash:b,href:p,state:S})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(g)){const C=this.options.parseSearch(y),D=this.options.stringifySearch(C);return{href:g+D+b,publicHref:g+D+b,pathname:_s(g).path,external:!1,searchStr:D,search:al(c==null?void 0:c.search,C),hash:_s(b.slice(1)).path,state:sl(c==null?void 0:c.state,S)}}const j=new URL(p,this.origin),N=Mf(this.rewrite,j),_=this.options.parseSearch(N.search),w=this.options.stringifySearch(_);return N.search=w,{href:N.href.replace(N.origin,""),publicHref:p,pathname:_s(N.pathname).path,external:!!this.rewrite&&N.origin!==this.origin,searchStr:w,search:al(c==null?void 0:c.search,_),hash:_s(N.hash.slice(1)).path,state:sl(c==null?void 0:c.state,S)}},f=o(s),{__tempLocation:m,__tempKey:v}=f.state;if(m&&(!v||v===this.tempLocationKey)){const g=o(m);return g.state.key=f.state.key,g.state.__TSR_key=f.state.__TSR_key,delete g.state.__tempLocation,{...g,maskedLocation:f}}return f},this.resolvePathWithBase=(s,c)=>jb({base:s,to:c.includes("//")?Yf(c):c,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,c,o)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:c},o):this.matchRoutesInternal(s,c),this.getMatchedRoutes=s=>Vb({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const c=this.getMatch(s);c&&(c.abortController.abort(),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{var o;if(this.stores.pendingMatchStores.has(s))return;const c=(o=this.stores.matchStores.get(s))==null?void 0:o.get();c&&(c.status==="pending"||c.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const c=(f={})=>{var X,tt;const m=f._fromLocation||this.pendingBuiltLocation||this.latestLocation,v=this.matchRoutesLightweight(m);f.from;const g=f.unsafeRelative==="path"?m.pathname:f.from??v.fullPath,y=f.to?`${f.to}`:void 0,b=v.search,p=Object.assign(Object.create(null),v.params),S=(y==null?void 0:y.charCodeAt(0))===47?"/":this.resolvePathWithBase(g,"."),j=y?this.resolvePathWithBase(S,y):S,N=f.params===!1||f.params===null?Object.create(null):(f.params??!0)===!0?p:Object.assign(p,il(f.params,p)),_=this.routesByPath[Kn(j)];let w;if(_)w=this.getRouteBranch(_);else if(j.includes("$"))w=[];else{const W=this.getMatchedRoutes(j);w=W.matchedRoutes,this.options.notFoundRoute&&(!W.foundRoute||W.foundRoute.path!=="/"&&W.routeParams["**"])&&(w=[...w,this.options.notFoundRoute])}if(w.length&&hg(N))for(const W of w){const at=((X=W.options.params)==null?void 0:X.stringify)??W.options.stringifyParams;if(at)try{Object.assign(N,at(N))}catch{}}const C=s.leaveParams?j:_s(vp({path:j,params:N,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let D=b;if(s._includeValidateSearch&&((tt=this.options.search)!=null&&tt.strict)){const W={};w.forEach(at=>{if(at.options.validateSearch)try{Object.assign(W,vc(at.options.validateSearch,{...W,...D}))}catch{}}),D=W}D=Zb({search:D,dest:f,destRoutes:w,_includeValidateSearch:s._includeValidateSearch}),D=al(b,D);const G=this.options.stringifySearch(D),A=f.hash===!0?m.hash:f.hash?il(f.hash,m.hash):void 0,q=A?`#${A}`:"";let U=f.state===!0?m.state:f.state?il(f.state,m.state):{};U=sl(m.state,U);const z=`${C}${G}${q}`;let Y,I,$=!1;if(this.rewrite){const W=new URL(z,this.origin),at=Eg(this.rewrite,W);Y=W.href.replace(W.origin,""),at.origin!==this.origin?(I=at.href,$=!0):I=at.pathname+at.search+at.hash}else Y=rb(z),I=Y;return{publicHref:I,href:Y,pathname:C,search:D,searchStr:G,state:U,hash:A??"",external:$,unmaskOnReload:f.unmaskOnReload}},o=(f={},m)=>{const v=c(f);let g=m?c(m):void 0;if(!g){const y=Object.create(null);if(this.options.routeMasks){const b=hb(v.pathname,this.processedTree);if(b){Object.assign(y,b.rawParams);const{from:p,params:S,...j}=b.route,N=S===!1||S===null?Object.create(null):(S??!0)===!0?y:Object.assign(y,il(S,y));m={from:s.from,...j,params:N},g=c(m)}}}return g&&(v.maskedLocation=g),v};return s.mask?o(s,{from:s.from,...s.mask}):o(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:c,...o})=>{let f;const m=()=>{const y=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];y.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const b=gl(o.state,this.latestLocation.state);return y.forEach(p=>{delete o.state[p]}),b},v=Kn(this.latestLocation.href)===Kn(o.href);let g=this.commitLocationPromise;if(this.commitLocationPromise=Ti(()=>{g==null||g.resolve(),g=void 0}),v&&m())this.load();else{let{maskedLocation:y,hashScrollIntoView:b,...p}=o;y&&(p={...y,state:{...y.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=b??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,f=o.replace?"REPLACE":"PUSH",this.history[f==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:c})}return this._scroll.next=o.resetScroll??!0,this.history.subscribers.size||this.load(f?{action:{type:f}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:c,hashScrollIntoView:o,viewTransition:f,ignoreBlocker:m,href:v,...g}={})=>{if(v){const p=this.history.location.state.__TSR_index,S=Rc(v,{__TSR_index:s?p:p+1}),j=new URL(S.pathname,this.origin);g.to=Mf(this.rewrite,j).pathname,g.search=this.options.parseSearch(S.search),g.hash=S.hash.slice(1)}const y=this.buildLocation({...g,_includeValidateSearch:!0});this.pendingBuiltLocation=y;const b=this.commitLocation({...y,viewTransition:f,replace:s,resetScroll:c,hashScrollIntoView:o,ignoreBlocker:m});return queueMicrotask(()=>{this.pendingBuiltLocation===y&&(this.pendingBuiltLocation=void 0)}),b},this.navigate=async({to:s,reloadDocument:c,href:o,publicHref:f,...m})=>{var g,y;let v=!1;if(o)try{new URL(`${o}`),v=!0}catch{}if(v&&!c&&(c=!0),c){if(s!==void 0||!o){const p=this.buildLocation({to:s,...m});o=o??p.publicHref,f=f??p.publicHref}const b=!v&&f?f:o;if(Nc(b,this.protocolAllowlist))return;if(!m.ignoreBlocker){const p=((y=(g=this.history).getBlockers)==null?void 0:y.call(g))??[];for(const S of p)if(S!=null&&S.blockerFn&&await S.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}m.replace?window.location.replace(b):window.location.href=b;return}return this.buildAndCommitLocation({...m,href:o,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),c=this.stores.cachedMatches.get().filter(o=>!s.some(f=>f.id===o.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(c)})},this.load=async s=>{var y;const c=(y=s==null?void 0:s.action)==null?void 0:y.type;let o,f,m;const v=this.stores.resolvedLocation.get()??this.stores.location.get();for(m=new Promise(b=>{this.startTransition(async()=>{var p;try{this.beforeLoad(),c?Cf.set(this.latestLocation,c):Cf.delete(this.latestLocation);const S=this.latestLocation,j=di(S,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...j}),this.emit({type:"onBeforeLoad",...j}),await Np({router:this,sync:s==null?void 0:s.sync,forceStaleReload:v.href===S.href,matches:this.stores.pendingMatches.get(),location:S,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var D,G;let N=null,_=null,w=null,C=null;this.batch(()=>{const A=this.stores.pendingMatches.get(),q=A.length,U=this.stores.matches.get();N=q?U.filter(I=>!this.stores.pendingMatchStores.has(I.id)):null;const z=new Set;for(const I of this.stores.pendingMatchStores.values())I.routeId&&z.add(I.routeId);const Y=new Set;for(const I of this.stores.matchStores.values())I.routeId&&Y.add(I.routeId);_=q?U.filter(I=>!z.has(I.routeId)):null,w=q?A.filter(I=>!Y.has(I.routeId)):null,C=q?A.filter(I=>Y.has(I.routeId)):U,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),q&&(this.stores.setMatches(A),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...N.filter(I=>I.status!=="error"&&I.status!=="notFound"&&I.status!=="redirected")]),this.clearExpiredCache())});for(const[A,q]of[[_,"onLeave"],[w,"onEnter"],[C,"onStay"]])if(A)for(const U of A)(G=(D=this.looseRoutesById[U.routeId].options)[q])==null||G.call(D,U)})})}})}catch(S){we(S)?(o=S,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):ge(S)&&(f=S);const j=o?o.status:f?404:this.stores.matches.get().some(N=>N.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(j),this.stores.redirect.set(o)})}this.latestLoadPromise===m&&((p=this.commitLocationPromise)==null||p.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),b()})}),this.latestLoadPromise=m,await m;this.latestLoadPromise&&m!==this.latestLoadPromise;)await this.latestLoadPromise;let g;this.hasNotFoundMatch()?g=404:this.stores.matches.get().some(b=>b.status==="error")&&(g=500),g!==void 0&&this.stores.statusCode.set(g)},this.startViewTransition=s=>{const c=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,c&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof c=="object"&&this.isViewTransitionTypesSupported){const f=this.latestLocation,m=this.stores.resolvedLocation.get(),v=typeof c.types=="function"?c.types(di(f,m)):c.types;if(v===!1){s();return}o={update:s,types:v}}else o=s;document.startViewTransition(o)}else s()},this.updateMatch=(s,c)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStores.get(s);if(o){o.set(c);return}const f=this.stores.matchStores.get(s);if(f){f.set(c);return}const m=this.stores.cachedMatchStores.get(s);if(m){const v=c(m.get());v.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(g=>g.filter(y=>y!==s)):m.set(v)}})},this.getMatch=s=>{var c,o,f;return((c=this.stores.cachedMatchStores.get(s))==null?void 0:c.get())??((o=this.stores.pendingMatchStores.get(s))==null?void 0:o.get())??((f=this.stores.matchStores.get(s))==null?void 0:f.get())},this.invalidate=s=>{const c=o=>{var f;return((f=s==null?void 0:s.filter)==null?void 0:f.call(s,o))??!0?{...o,invalid:!0,...s!=null&&s.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(c)),this.stores.setCached(this.stores.cachedMatches.get().map(c)),this.stores.setPending(this.stores.pendingMatches.get().map(c))}),this.shouldViewTransition=!1,this.load({sync:s==null?void 0:s.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const c=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const o=s.options._builtLocation??this.buildLocation(s.options),f=this.getParsedLocationHref(o);s.options.href=f,s.headers.set("Location",f)}else if(c)try{const o=new URL(c);if(this.origin&&o.origin===this.origin){const f=o.pathname+o.search+o.hash;s.options.href=f,s.headers.set("Location",f)}}catch{}if(s.options.href&&!s.options._builtLocation&&Nc(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const c=s==null?void 0:s.filter;c!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(o=>!c(o))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),c=o=>{const f=this.looseRoutesById[o.routeId];if(!f.options.loader)return!0;const m=(o.preload?f.options.preloadGcTime??this.options.defaultPreloadGcTime:f.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:s-o.updatedAt>=m};this.clearCache({filter:c})},this.loadRouteChunk=Bs,this.preloadRoute=async s=>{const c=s._builtLocation??this.buildLocation(s);let o=this.matchRoutes(c,{throwOnError:!0,preload:!0,dest:s});const f=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),m=new Set([...f,...this.stores.cachedIds.get()]),v=o.filter(g=>!m.has(g.id));if(v.length){const g=this.stores.cachedMatches.get();this.stores.setCached([...g,...v])}try{return o=await Np({router:this,matches:o,location:c,preload:!0,updateMatch:(g,y)=>{f.has(g)?o=o.map(b=>b.id===g?y(b):b):this.updateMatch(g,y)}}),o}catch(g){if(we(g))return g.options.reloadDocument?void 0:await this.preloadRoute({...g.options,_fromLocation:c});ge(g)||console.error(g);return}},this.matchRoute=(s,c)=>{const o={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},f=this.buildLocation(o);if(c!=null&&c.pending&&this.stores.status.get()!=="pending")return!1;const m=((c==null?void 0:c.pending)===void 0?!this.stores.isLoading.get():c.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),v=mb(f.pathname,(c==null?void 0:c.caseSensitive)??!1,(c==null?void 0:c.fuzzy)??!1,m.pathname,this.processedTree);return!v||s.params&&!gl(v.rawParams,s.params,{partial:!0})?!1:(c==null?void 0:c.includeSearch)??!0?gl(m.search,f.search,{partial:!0})?v.rawParams:!1:v.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=i,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...l,caseSensitive:l.caseSensitive??!1,notFoundMode:l.notFoundMode??"fuzzy",stringifySearch:l.stringifySearch??Tb,parseSearch:l.parseSearch??_b,protocolAllowlist:l.protocolAllowlist??cb}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:l,routesByPath:i,processedTree:s}){this.routesById=l,this.routesByPath=i,this.processedTree=s;const c=this.options.notFoundRoute;c&&(c.init({originalIndex:99999999999}),this.routesById[c.id]=c)}getRouteBranch(l){let i=this.routeBranchCache.get(l);return i||(i=gg(l),this.routeBranchCache.set(l,i)),i}get looseRoutesById(){return this.routesById}getParentContext(l){return l!=null&&l.id?l.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(l,i){var b,p;const s=this.getMatchedRoutes(l.pathname),{foundRoute:c,routeParams:o}=s;let{matchedRoutes:f}=s,m=!1;(c?c.path!=="/"&&o["**"]:Kn(l.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:m=!0);const v=m?Pb(this.options.notFoundMode,f):void 0,g=new Array(f.length),y=new Map;for(const S of this.stores.matchStores.values())S.routeId&&y.set(S.routeId,S.get());for(let S=0;Sthis.navigate({...A,_fromLocation:l}),buildLocation:this.buildLocation,cause:j.cause,abortController:j.abortController,preload:!!j.preload,matches:g,routeId:N.id};j.__routeContext=N.options.context(G)??void 0}j.context={...D,...j.__routeContext,...j.__beforeLoadContext}}}return g}matchRoutesLightweight(l){var p;const i=Ds(this.stores.matchesId.get()),s=this.lightweightCache.get(l);if(s&&s[0]===i)return s[1];const{matchedRoutes:c,routeParams:o}=this.getMatchedRoutes(l.pathname),f=Ds(c),m={...l.search};for(const S of c)try{Object.assign(m,vc(S.options.validateSearch,m))}catch{}const v=i&&((p=this.stores.matchStores.get(i))==null?void 0:p.get()),g=v&&v.routeId===f.id&&v.pathname===l.pathname;let y;if(g)y=v.params;else{const S=Object.assign(Object.create(null),o);for(const j of c)try{Mp(j,S)}catch{}y=S}const b={matchedRoutes:c,fullPath:f.fullPath,search:m,params:y};return this.lightweightCache.set(l,[i,b]),b}},_c=class extends Error{},Kb=class extends Error{};function Xb(l){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:l,matches:[],statusCode:200}}function vc(l,i){if(l==null)return{};if("~standard"in l){const s=l["~standard"].validate(i);if(s instanceof Promise)throw new _c("Async validation not supported");if(s.issues)throw new _c(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in l?l.parse(i):typeof l=="function"?l(i):{}}function Vb({pathname:l,routesById:i,processedTree:s}){const c=Object.create(null),o=Kn(l);let f;const m=yb(o,s,!0);return m&&(f=m.route,Object.assign(c,m.rawParams)),{matchedRoutes:(m==null?void 0:m.branch)||[i.__root__],routeParams:c,foundRoute:f}}function Zb({search:l,dest:i,destRoutes:s,_includeValidateSearch:c}){return Jb(s)(l,i,c??!1)}function Jb(l){var f;let i,s;const c=[];for(const m of l){const v=m.options;if("search"in v)(f=v.search)!=null&&f.middlewares&&c.push(...v.search.middlewares);else if(v.preSearchFilters||v.postSearchFilters){const y=({search:b,next:p})=>{const S=p(v.preSearchFilters?v.preSearchFilters.reduce((j,N)=>N(j),b):b);return v.postSearchFilters?v.postSearchFilters.reduce((j,N)=>N(j),S):S};c.push(y)}const g=v.validateSearch;if(g){const y=({search:b,next:p,meta:S})=>{const j=p(b);if(s)try{const N=vc(g,j);if(S&&N)for(const _ in N)_ in j||(S.defaulted||(S.defaulted=new Map)).set(_,N[_]);return{...j,...N}}catch{}return j};c.push(y)}}const o=(m,v,g)=>{if(m>=c.length){if(!i.search)return{};if(i.search===!0)return v;const b=il(i.search,v);return g&&(g.explicit=b),b}const y=(b,p)=>{if(p){const S=g||{};return{search:o(m+1,b,S),meta:S}}return o(m+1,b,g)};return c[m]({search:v,next:y,meta:g})};return function(v,g,y){return i=g,s=y,o(0,v)}}function Pb(l,i){if(l!=="root")for(let s=i.length-1;s>=0;s--){const c=i[s];if(c.children)return c.id}return vl}function Mp(l,i){var c;const s=((c=l.options.params)==null?void 0:c.parse)??l.options.parseParams;if(s){const o=s(i);if(o===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(i,o)}}function Fb(){try{return sessionStorage}catch{return}}const Ib="tsr-scroll-restoration-v1_3",hi=Fb();function $b(){try{return JSON.parse((hi==null?void 0:hi.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function Wb(){try{hi==null||hi.setItem(Ib,JSON.stringify(Na))}catch{}}const Na=$b(),Cp="data-scroll-restoration-id",tS=l=>l.state.__TSR_key||l.href;function eS(l){const i=l.getAttribute(Cp);if(i)return`[${Cp}="${i}"]`;let s="",c=l,o;for(;o=c.parentNode;){let f=1,m=c;for(;m=m.previousElementSibling;)f++;const v=`${c.localName}:nth-child(${f})`;s=s?`${v} > ${s}`:v,c=o}return s}let hc=!1;const oi="window";function Af(l){try{return typeof l=="function"?l():document.querySelector(l)}catch{}}function Ap(l){const i=[];for(const s of l){if(s===oi)continue;const c=Af(s);c&&i.push(c)}return i}function nS(l,i){const s=l.options.scrollRestoration,c=l._scroll;s&&(c.restoring=!0);const o=l.options.getScrollRestorationKey||tS,f=new Map,m=(y,b,p)=>{const S=f.get(y)||{};S.scrollX=b,S.scrollY=p,f.set(y,S)},v=y=>{if(!(hc||!c.restoring))if(y.target===document)m(oi,scrollX,scrollY);else{const b=y.target;m(b,b.scrollLeft,b.scrollTop)}},g=y=>{if(!c.restoring)return;const b=Na[y]||(Na[y]={});for(const[p,S]of f)p===oi?b[oi]=S:p.isConnected&&(b[eS(p)]=S)};s&&!c.restoration&&(c.restoration=!0,hc=!1,history.scrollRestoration="manual",document.addEventListener("scroll",v,!0),l.subscribe("onBeforeLoad",y=>{y.fromLocation&&g(o(y.fromLocation)),f.clear()}),addEventListener("pagehide",()=>{g(o(l.stores.resolvedLocation.get()??l.stores.location.get())),Wb()})),!c.reset&&(c.reset=!0,l.subscribe("onRendered",y=>{var w;const b=l.options.scrollRestorationBehavior,p=l.options.scrollToTopSelectors,S=c.next;let j;if(f.clear(),S||(c.next=!0),typeof l.options.scrollRestoration=="function"&&!l.options.scrollRestoration({location:l.latestLocation}))return;const N=o(y.toLocation),_=y.fromLocation&&o(y.fromLocation);if(c.restoring&&_&&_!==N){const C=Na[_];if(C){let D=Na[N];for(const G in C){if(G===oi){if(S)continue}else{const A=Af(G);if(!A||S&&p&&(j??(j=Ap(p)),j.includes(A)))continue}D||(D=Na[N]={}),D[G]??(D[G]=C[G])}}}hc=!0;try{const C=y.toLocation.hash,D=y.toLocation.state.__hashScrollIntoViewOptions??!0;let G=!1;if(S){const A=Cf.get(y.toLocation),q=C&&D&&(A==="PUSH"||A==="REPLACE"),U=c.restoring?Na[N]:void 0;if(U)for(const z in U){const{scrollX:Y,scrollY:I}=U[z];if(z===oi){if(q)continue;scrollTo({top:I,left:Y,behavior:b}),G=!0}else{const $=Af(z);$&&($.scrollLeft=Y,$.scrollTop=I)}}if(!G&&!C){const z={top:0,left:0,behavior:b};if(scrollTo(z),p){j??(j=Ap(p));for(const Y of j)Y.scrollTo(z)}}}!G&&C&&D&&((w=document.getElementById(C))==null||w.scrollIntoView(D))}finally{hc=!1}}))}const aS="Error preloading route! ☝️";var Rg=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(l){if(this.init=i=>{var g,y;this.originalIndex=i.originalIndex;const s=this.options,c=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(y=(g=this.options).getParentRoute)==null?void 0:y.call(g),c?this._path=vl:this.parentRoute||Xn();let o=c?vl:s==null?void 0:s.path;o&&o!=="/"&&(o=vg(o));const f=(s==null?void 0:s.id)||o;let m=c?vl:pc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,f]);o==="__root__"&&(o="/"),m!=="__root__"&&(m=pc(["/",m]));const v=m==="__root__"?"/":pc([this.parentRoute.fullPath,o]);this._path=o,this._id=m,this._fullPath=v,this._to=Kn(v)},this.addChildren=i=>this._addFileChildren(i),this._addFileChildren=i=>(Array.isArray(i)&&(this.children=i),typeof i=="object"&&i!==null&&(this.children=Object.values(i)),this),this._addFileTypes=()=>this,this.updateLoader=i=>(Object.assign(this.options,i),this),this.update=i=>(Object.assign(this.options,i),this),this.lazy=i=>(this.lazyFn=i,this),this.redirect=i=>Ab({from:this.fullPath,...i}),this.options=l||{},this.isRoot=!(l!=null&&l.getParentRoute),l!=null&&l.id&&(l!=null&&l.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},lS=class extends Rg{constructor(l){super(l)}};function Kf(l){const i=l.errorComponent??Xf;return d.jsx(iS,{getResetKey:l.getResetKey,onCatch:l.onCatch,children:({error:s,reset:c})=>s?F.createElement(i,{error:s,reset:c}):l.children})}var iS=class extends F.Component{constructor(...l){super(...l),this.state={error:null}}static getDerivedStateFromProps(l,i){const s=l.getResetKey();return i.error&&i.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(l){return{error:l}}reset(){this.setState({error:null})}componentDidCatch(l,i){this.props.onCatch&&this.props.onCatch(l,i)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Xf({error:l}){const[i,s]=F.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(c=>!c),children:i?"Hide Error":"Show Error"})]}),d.jsx("div",{style:{height:".25rem"}}),i?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:l.message?d.jsx("code",{children:l.message}):null})}):null]})}function sS({children:l,fallback:i=null}){return _g()?d.jsx(ws.Fragment,{children:l}):d.jsx(ws.Fragment,{children:i})}function _g(){return ws.useSyncExternalStore(uS,()=>!0,()=>!1)}function uS(){return()=>{}}var Tg=F.createContext(null);function Ge(l){return F.useContext(Tg)}var Ac=F.createContext(void 0),cS=F.createContext(void 0),Xt=(l=>(l[l.None=0]="None",l[l.Mutable=1]="Mutable",l[l.Watching=2]="Watching",l[l.RecursedCheck=4]="RecursedCheck",l[l.Recursed=8]="Recursed",l[l.Dirty=16]="Dirty",l[l.Pending=32]="Pending",l))(Xt||{});function rS({update:l,notify:i,unwatched:s}){return{link:c,unlink:o,propagate:f,checkDirty:m,shallowPropagate:v};function c(y,b,p){const S=b.depsTail;if(S!==void 0&&S.dep===y)return;const j=S!==void 0?S.nextDep:b.deps;if(j!==void 0&&j.dep===y){j.version=p,b.depsTail=j;return}const N=y.subsTail;if(N!==void 0&&N.version===p&&N.sub===b)return;const _=b.depsTail=y.subsTail={version:p,dep:y,sub:b,prevDep:S,nextDep:j,prevSub:N,nextSub:void 0};j!==void 0&&(j.prevDep=_),S!==void 0?S.nextDep=_:b.deps=_,N!==void 0?N.nextSub=_:y.subs=_}function o(y,b=y.sub){const p=y.dep,S=y.prevDep,j=y.nextDep,N=y.nextSub,_=y.prevSub;return j!==void 0?j.prevDep=S:b.depsTail=S,S!==void 0?S.nextDep=j:b.deps=j,N!==void 0?N.prevSub=_:p.subsTail=_,_!==void 0?_.nextSub=N:(p.subs=N)===void 0&&s(p),j}function f(y){let b=y.nextSub,p;t:do{const S=y.sub;let j=S.flags;if(j&60?j&12?j&4?!(j&48)&&g(y,S)?(S.flags=j|40,j&=1):j=0:S.flags=j&-9|32:j=0:S.flags=j|32,j&2&&i(S),j&1){const N=S.subs;if(N!==void 0){const _=(y=N).nextSub;_!==void 0&&(p={value:b,prev:p},b=_);continue}}if((y=b)!==void 0){b=y.nextSub;continue}for(;p!==void 0;)if(y=p.value,p=p.prev,y!==void 0){b=y.nextSub;continue t}break}while(!0)}function m(y,b){let p,S=0,j=!1;t:do{const N=y.dep,_=N.flags;if(b.flags&16)j=!0;else if((_&17)===17){if(l(N)){const w=N.subs;w.nextSub!==void 0&&v(w),j=!0}}else if((_&33)===33){(y.nextSub!==void 0||y.prevSub!==void 0)&&(p={value:y,prev:p}),y=N.deps,b=N,++S;continue}if(!j){const w=y.nextDep;if(w!==void 0){y=w;continue}}for(;S--;){const w=b.subs,C=w.nextSub!==void 0;if(C?(y=p.value,p=p.prev):y=w,j){if(l(b)){C&&v(w),b=y.sub;continue}j=!1}else b.flags&=-33;b=y.sub;const D=y.nextDep;if(D!==void 0){y=D;continue t}}return j}while(!0)}function v(y){do{const b=y.sub,p=b.flags;(p&48)===32&&(b.flags=p|16,(p&6)===2&&i(b))}while((y=y.nextSub)!==void 0)}function g(y,b){let p=b.depsTail;for(;p!==void 0;){if(p===y)return!0;p=p.prevDep}return!1}}function oS(l,i,s){var f,m,v;const c=typeof l=="object",o=c?l:void 0;return{next:(f=c?l.next:l)==null?void 0:f.bind(o),error:(m=c?l.error:i)==null?void 0:m.bind(o),complete:(v=c?l.complete:s)==null?void 0:v.bind(o)}}const wf=[];let xc=0;const{link:wp,unlink:fS,propagate:dS,checkDirty:Mg,shallowPropagate:Op}=rS({update(l){return l._update()},notify(l){wf[Of++]=l,l.flags&=~Xt.Watching},unwatched(l){l.depsTail!==void 0&&(l.depsTail=void 0,l.flags=Xt.Mutable|Xt.Dirty,Tc(l))}});let mc=0,Of=0,hn,zf=0;function Cg(l){try{++zf,l()}finally{--zf||Ag()}}function Tc(l){const i=l.depsTail;let s=i!==void 0?i.nextDep:l.deps;for(;s!==void 0;)s=fS(s,l)}function Ag(){if(!(zf>0)){for(;mc{var y;o.get(),v.current?(y=m.next)==null||y.call(m,o._snapshot):v.current=!0});return{unsubscribe:()=>{g.stop()}}},_update(f){const m=hn,v=(i==null?void 0:i.compare)??Object.is;if(s)hn=o,++xc,o.depsTail=void 0;else if(f===void 0)return!1;s&&(o.flags=Xt.Mutable|Xt.RecursedCheck);try{const g=o._snapshot,y=typeof f=="function"?f(g):f===void 0&&s?c(g):f;return g===void 0||!v(g,y)?(o._snapshot=y,!0):!1}finally{hn=m,s&&(o.flags&=~Xt.RecursedCheck),Tc(o)}}};return s?(o.flags=Xt.Mutable|Xt.Dirty,o.get=function(){const f=o.flags;if(f&Xt.Dirty||f&Xt.Pending&&Mg(o.deps,o)){if(o._update()){const m=o.subs;m!==void 0&&Op(m)}}else f&Xt.Pending&&(o.flags=f&~Xt.Pending);return hn!==void 0&&wp(o,hn,xc),o._snapshot}):o.set=function(f){if(o._update(f)){const m=o.subs;m!==void 0&&(dS(m),Op(m),Ag())}},o}function hS(l){const i=()=>{const c=hn;hn=s,++xc,s.depsTail=void 0,s.flags=Xt.Watching|Xt.RecursedCheck;try{return l()}finally{hn=c,s.flags&=~Xt.RecursedCheck,Tc(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Xt.Watching|Xt.RecursedCheck,notify(){const c=this.flags;c&Xt.Dirty||c&Xt.Pending&&Mg(this.deps,this)?i():this.flags=Xt.Watching},stop(){this.flags=Xt.None,this.depsTail=void 0,Tc(this)}};return i(),s}var sf={exports:{}},uf={},cf={exports:{}},rf={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Dp;function mS(){if(Dp)return rf;Dp=1;var l=Ks();function i(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}var s=typeof Object.is=="function"?Object.is:i,c=l.useState,o=l.useEffect,f=l.useLayoutEffect,m=l.useDebugValue;function v(p,S){var j=S(),N=c({inst:{value:j,getSnapshot:S}}),_=N[0].inst,w=N[1];return f(function(){_.value=j,_.getSnapshot=S,g(_)&&w({inst:_})},[p,j,S]),o(function(){return g(_)&&w({inst:_}),p(function(){g(_)&&w({inst:_})})},[p]),m(j),j}function g(p){var S=p.getSnapshot;p=p.value;try{var j=S();return!s(p,j)}catch{return!0}}function y(p,S){return S()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:v;return rf.useSyncExternalStore=l.useSyncExternalStore!==void 0?l.useSyncExternalStore:b,rf}var Lp;function yS(){return Lp||(Lp=1,cf.exports=mS()),cf.exports}/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Up;function pS(){if(Up)return uf;Up=1;var l=Ks(),i=yS();function s(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var c=typeof Object.is=="function"?Object.is:s,o=i.useSyncExternalStore,f=l.useRef,m=l.useEffect,v=l.useMemo,g=l.useDebugValue;return uf.useSyncExternalStoreWithSelector=function(y,b,p,S,j){var N=f(null);if(N.current===null){var _={hasValue:!1,value:null};N.current=_}else _=N.current;N=v(function(){function C(U){if(!D){if(D=!0,G=U,U=S(U),j!==void 0&&_.hasValue){var z=_.value;if(j(z,U))return A=z}return A=U}if(z=A,c(G,U))return z;var Y=S(U);return j!==void 0&&j(z,Y)?(G=U,z):(G=U,A=Y)}var D=!1,G,A,q=p===void 0?null:p;return[function(){return C(b())},q===null?void 0:function(){return C(q())}]},[b,p,S,j]);var w=o(y,N[0],N[1]);return m(function(){_.hasValue=!0,_.value=w},[w]),g(w),w},uf}var Bp;function gS(){return Bp||(Bp=1,sf.exports=pS()),sf.exports}var vS=gS();function xS(l,i){return l===i}function Se(l,i,s=xS){const c=F.useCallback(m=>{if(!l)return()=>{};const{unsubscribe:v}=l.subscribe(m);return v},[l]),o=F.useCallback(()=>l==null?void 0:l.get(),[l]);return vS.useSyncExternalStoreWithSelector(c,o,o,i,s)}var of={get(){},subscribe(){return{unsubscribe(){}}}};function wg(l,i){const s=F.useRef();return c=>{const o=l!=null&&l.select?l.select(c):c;return(l==null?void 0:l.structuralSharing)??i.options.defaultStructuralSharing?s.current=sl(s.current,o):o}}function Sl(l){const i=Ge(),s=F.useContext(l.from?cS:Ac),c=l.from?i.stores.getRouteMatchStore(l.from):i.stores.matchStores.get(s),o=wg(l,i),f=Se(c??of,m=>m?o(m):of);if(f!==of)return f;(l.shouldThrow??!0)&&Xn()}function Og(l){return Sl({from:l.from,strict:l.strict,structuralSharing:l.structuralSharing,select:i=>l.select?l.select(i.loaderData):i.loaderData})}function zg(l){const{select:i,...s}=l;return Sl({...s,select:c=>i?i(c.loaderDeps):c.loaderDeps})}function Vf(l){return Sl({from:l.from,shouldThrow:l.shouldThrow,structuralSharing:l.structuralSharing,strict:l.strict,select:i=>{const s=l.strict===!1?i.params:i._strictParams;return l.select?l.select(s):s}})}function Dg(l){return Sl({from:l.from,strict:l.strict,shouldThrow:l.shouldThrow,structuralSharing:l.structuralSharing,select:i=>l.select?l.select(i.search):i.search})}function Lg(l){const i=Ge();return F.useCallback(s=>i.navigate({...s,from:s.from??(l==null?void 0:l.from)}),[l==null?void 0:l.from,i])}function Ug(l){return Sl({...l,select:i=>l.select?l.select(i.context):i.context})}var bS=$p();function SS(l,i){const s=Ge(),c=ab(i),{activeProps:o,inactiveProps:f,activeOptions:m,to:v,preload:g,preloadDelay:y,preloadIntentProximity:b,hashScrollIntoView:p,replace:S,startTransition:j,resetScroll:N,viewTransition:_,children:w,target:C,disabled:D,style:G,className:A,onClick:q,onBlur:U,onFocus:z,onMouseEnter:Y,onMouseLeave:I,onTouchStart:$,ignoreBlocker:X,params:tt,search:W,hash:at,state:gt,mask:k,reloadDocument:Z,unsafeRelative:ut,from:Mt,_fromLocation:At,...M}=l,J=_g(),et=F.useMemo(()=>l,[s,l.from,l._fromLocation,l.hash,l.to,l.search,l.params,l.state,l.mask,l.unsafeRelative]),lt=Se(s.stores.location,Dt=>Dt,(Dt,ce)=>Dt.href===ce.href),ct=F.useMemo(()=>{const Dt={_fromLocation:lt,...et};return s.buildLocation(Dt)},[s,lt,et]),pt=ct.maskedLocation?ct.maskedLocation.publicHref:ct.publicHref,Rt=ct.maskedLocation?ct.maskedLocation.external:ct.external,Qt=F.useMemo(()=>TS(pt,Rt,s.history,D),[D,Rt,pt,s.history]),qt=F.useMemo(()=>{if(Qt!=null&&Qt.external)return Nc(Qt.href,s.protocolAllowlist)?void 0:Qt.href;if(!MS(v)&&!(typeof v!="string"||v.indexOf(":")===-1))try{return new URL(v),Nc(v,s.protocolAllowlist)?void 0:v}catch{}},[v,Qt,s.protocolAllowlist]),gn=F.useMemo(()=>{if(qt)return!1;if(m!=null&&m.exact){if(!Sb(lt.pathname,ct.pathname,s.basepath))return!1}else{const Dt=Ec(lt.pathname,s.basepath),ce=Ec(ct.pathname,s.basepath);if(!(Dt.startsWith(ce)&&(Dt.length===ce.length||Dt[ce.length]==="/")))return!1}return((m==null?void 0:m.includeSearch)??!0)&&!gl(lt.search,ct.search,{partial:!(m!=null&&m.exact),ignoreUndefined:!(m!=null&&m.explicitUndefined)})?!1:m!=null&&m.includeHash?J&<.hash===ct.hash:!0},[m==null?void 0:m.exact,m==null?void 0:m.explicitUndefined,m==null?void 0:m.includeHash,m==null?void 0:m.includeSearch,lt,qt,J,ct.hash,ct.pathname,ct.search,s.basepath]),vn=gn?il(o,{})??jS:ff,Pn=gn?ff:il(f,{})??ff,Ci=[A,vn.className,Pn.className].filter(Boolean).join(" "),un=(G||vn.style||Pn.style)&&{...G,...vn.style,...Pn.style},[Ai,Nl]=F.useState(!1),Xs=F.useRef(!1),xn=l.reloadDocument||qt?!1:g??s.options.defaultPreload,qa=y??s.options.defaultPreloadDelay??0,en=F.useCallback(()=>{s.preloadRoute({...et,_builtLocation:ct}).catch(Dt=>{console.warn(Dt),console.warn(aS)})},[s,et,ct]);nb(c,F.useCallback(Dt=>{Dt!=null&&Dt.isIntersecting&&en()},[en]),_S,{disabled:!!D||xn!=="viewport"}),F.useEffect(()=>{Xs.current||!D&&xn==="render"&&(en(),Xs.current=!0)},[D,en,xn]);const wi=Dt=>{const ce=Dt.currentTarget.getAttribute("target"),cn=C!==void 0?C:ce;if(!D&&!CS(Dt)&&!Dt.defaultPrevented&&(!cn||cn==="_self")&&Dt.button===0){Dt.preventDefault(),bS.flushSync(()=>{Nl(!0)});const El=s.subscribe("onResolved",()=>{El(),Nl(!1)});s.navigate({...et,replace:S,resetScroll:N,hashScrollIntoView:p,startTransition:j,viewTransition:_,ignoreBlocker:X})}};if(qt)return{...M,ref:c,href:qt,...w&&{children:w},...C&&{target:C},...D&&{disabled:D},...G&&{style:G},...A&&{className:A},...q&&{onClick:q},...U&&{onBlur:U},...z&&{onFocus:z},...Y&&{onMouseEnter:Y},...I&&{onMouseLeave:I},...$&&{onTouchStart:$}};const Vs=Dt=>{if(D||xn!=="intent")return;if(!qa){en();return}const ce=Dt.currentTarget;if(Ms.has(ce))return;const cn=setTimeout(()=>{Ms.delete(ce),en()},qa);Ms.set(ce,cn)},wc=Dt=>{D||xn!=="intent"||en()},me=Dt=>{if(D||!xn||!qa)return;const ce=Dt.currentTarget,cn=Ms.get(ce);cn&&(clearTimeout(cn),Ms.delete(ce))};return{...M,...vn,...Pn,href:Qt==null?void 0:Qt.href,ref:c,onClick:ri([q,wi]),onBlur:ri([U,me]),onFocus:ri([z,Vs]),onMouseEnter:ri([Y,Vs]),onMouseLeave:ri([I,me]),onTouchStart:ri([$,wc]),disabled:!!D,target:C,...un&&{style:un},...Ci&&{className:Ci},...D&&NS,...gn&&ES,...J&&Ai&&RS}}var ff={},jS={className:"active"},NS={role:"link","aria-disabled":!0},ES={"data-status":"active","aria-current":"page"},RS={"data-transitioning":"transitioning"},Ms=new WeakMap,_S={rootMargin:"100px"},ri=l=>i=>{for(const s of l)if(s){if(i.defaultPrevented)return;s(i)}};function TS(l,i,s,c){if(!c)return i?{href:l,external:!0}:{href:s.createHref(l)||"/",external:!1}}function MS(l){if(typeof l!="string")return!1;const i=l.charCodeAt(0);return i===47?l.charCodeAt(1)!==47:i===46}var Zn=F.forwardRef((l,i)=>{const{_asChild:s,...c}=l,{type:o,...f}=SS(c,i),m=typeof c.children=="function"?c.children({isActive:f["data-status"]==="active"}):c.children;if(!s){const{disabled:v,...g}=f;return F.createElement("a",g,m)}return F.createElement(s,f,m)});function CS(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}var AS=class extends Rg{constructor(l){super(l),this.useMatch=i=>Sl({select:i==null?void 0:i.select,from:this.id,structuralSharing:i==null?void 0:i.structuralSharing}),this.useRouteContext=i=>Ug({...i,from:this.id}),this.useSearch=i=>Dg({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useParams=i=>Vf({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useLoaderDeps=i=>zg({...i,from:this.id}),this.useLoaderData=i=>Og({...i,from:this.id}),this.useNavigate=()=>Lg({from:this.fullPath}),this.Link=ws.forwardRef((i,s)=>d.jsx(Zn,{ref:s,from:this.fullPath,...i}))}};function Sa(l){return new AS(l)}var wS=class extends lS{constructor(l){super(l),this.useMatch=i=>Sl({select:i==null?void 0:i.select,from:this.id,structuralSharing:i==null?void 0:i.structuralSharing}),this.useRouteContext=i=>Ug({...i,from:this.id}),this.useSearch=i=>Dg({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useParams=i=>Vf({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useLoaderDeps=i=>zg({...i,from:this.id}),this.useLoaderData=i=>Og({...i,from:this.id}),this.useNavigate=()=>Lg({from:this.fullPath}),this.Link=ws.forwardRef((i,s)=>d.jsx(Zn,{ref:s,from:this.fullPath,...i}))}};function OS(l){return new wS(l)}function zS(l){const i=Ge(),s=`not-found-${Se(i.stores.location,c=>c.pathname)}-${Se(i.stores.status,c=>c)}`;return d.jsx(Kf,{getResetKey:()=>s,onCatch:(c,o)=>{var f;if(ge(c))(f=l.onCatch)==null||f.call(l,c,o);else throw c},errorComponent:({error:c})=>{var o;if(ge(c))return(o=l.fallback)==null?void 0:o.call(l,c);throw c},children:l.children})}function DS(){return d.jsx("p",{children:"Not Found"})}function fi(l){return d.jsx(d.Fragment,{children:l.children})}function Bg(l,i,s){return i.options.notFoundComponent?d.jsx(i.options.notFoundComponent,{...s}):l.options.defaultNotFoundComponent?d.jsx(l.options.defaultNotFoundComponent,{...s}):d.jsx(DS,{})}function LS(l){return null}function US(){return LS(Ge()),null}var BS=(l,i)=>l.routeId===i.routeId&&l._displayPending===i._displayPending,qS=(l,i)=>l[0]===i[0]&&l[1]===i[1],qg=F.memo(function({matchId:i}){const s=Ge(),c=s.stores.matchStores.get(i);c||Xn();const o=Se(s.stores.loadedAt,m=>m),f=Se(c,m=>m,BS);return d.jsx(HS,{router:s,matchId:i,resetKey:o,matchState:F.useMemo(()=>{var g;const m=f.routeId,v=(g=s.routesById[m].parentRoute)==null?void 0:g.id;return{routeId:m,ssr:f.ssr,_displayPending:f._displayPending,parentRouteId:v}},[f._displayPending,f.routeId,f.ssr,s.routesById])})});function HS({router:l,matchId:i,resetKey:s,matchState:c}){var N,_;const o=l.routesById[c.routeId],f=o.options.pendingComponent??l.options.defaultPendingComponent,m=f?d.jsx(f,{}):null,v=o.options.errorComponent??l.options.defaultErrorComponent,g=o.options.onCatch??l.options.defaultOnCatch,y=o.isRoot?o.options.notFoundComponent??((N=l.options.notFoundRoute)==null?void 0:N.options.component):o.options.notFoundComponent,b=c.ssr===!1||c.ssr==="data-only",p=(!o.isRoot||o.options.wrapInSuspense||b)&&(o.options.wrapInSuspense??f??(((_=o.options.errorComponent)==null?void 0:_.preload)||b))?F.Suspense:fi,S=v?Kf:fi,j=y?zS:fi;return d.jsxs(o.isRoot?o.options.shellComponent??fi:fi,{children:[d.jsx(Ac.Provider,{value:i,children:d.jsx(p,{fallback:m,children:d.jsx(S,{getResetKey:()=>s,errorComponent:v||Xf,onCatch:(w,C)=>{if(ge(w))throw w.routeId??(w.routeId=c.routeId),w;g==null||g(w,C)},children:d.jsx(j,{fallback:w=>{if(w.routeId??(w.routeId=c.routeId),!y||w.routeId&&w.routeId!==c.routeId||!w.routeId&&!o.isRoot)throw w;return F.createElement(y,w)},children:b||c._displayPending?d.jsx(sS,{fallback:m,children:d.jsx(qp,{matchId:i})}):d.jsx(qp,{matchId:i})})})})}),c.parentRouteId===vl?d.jsxs(d.Fragment,{children:[d.jsx(kS,{}),l.options.scrollRestoration&&fg?d.jsx(US,{}):null]}):null]})}function kS(){const l=Ge(),i=F.useRef();return As(()=>{const s=l.stores.resolvedLocation.get(),c=i.current;s&&(!c||c.href!==s.href)&&l.emit({type:"onRendered",...di(l.stores.location.get(),c??s)}),i.current=s},[Se(l.stores.resolvedLocation,s=>s==null?void 0:s.state.__TSR_key),l]),null}var qp=F.memo(function({matchId:i}){const s=Ge(),c=(b,p)=>{var S;return((S=s.getMatch(b.id))==null?void 0:S._nonReactive[p])??b._nonReactive[p]},o=s.stores.matchStores.get(i);o||Xn();const f=Se(o,b=>b),m=f.routeId,v=s.routesById[m],g=F.useMemo(()=>{var p;const b=(p=s.routesById[m].options.remountDeps??s.options.defaultRemountDeps)==null?void 0:p({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return b?JSON.stringify(b):void 0},[m,f.loaderDeps,f._strictParams,f._strictSearch,s.options.defaultRemountDeps,s.routesById]),y=F.useMemo(()=>{const b=v.options.component??s.options.defaultComponent;return b?d.jsx(b,{},g):d.jsx(Hg,{})},[g,v.options.component,s.options.defaultComponent]);if(f._displayPending)throw c(f,"displayPendingPromise");if(f._forcePending)throw c(f,"minPendingPromise");if(f.status==="pending"){const b=v.options.pendingMinMs??s.options.defaultPendingMinMs;if(b){const p=s.getMatch(f.id);if(p&&!p._nonReactive.minPendingPromise){const S=Ti();p._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),p._nonReactive.minPendingPromise=void 0},b)}}throw c(f,"loadPromise")}if(f.status==="notFound")return ge(f.error)||Xn(),Bg(s,v,f.error);if(f.status==="redirected")throw we(f.error)||Xn(),c(f,"loadPromise");if(f.status==="error")throw f.error;return y}),Hg=F.memo(function(){const i=Ge(),s=F.useContext(Ac);let c,o=!1,f;{const y=s?i.stores.matchStores.get(s):void 0;[c,o]=Se(y,b=>[b==null?void 0:b.routeId,(b==null?void 0:b.globalNotFound)??!1],qS),f=Se(i.stores.matchesId,b=>b[b.findIndex(p=>p===s)+1])}const m=c?i.routesById[c]:void 0,v=i.options.defaultPendingComponent?d.jsx(i.options.defaultPendingComponent,{}):null;if(o)return m||Xn(),Bg(i,m,void 0);if(!f)return null;const g=d.jsx(qg,{matchId:f});return c===vl?d.jsx(F.Suspense,{fallback:v,children:g}):g});function QS(){const l=Ge(),i=F.useRef({router:l,mounted:!1}),[s,c]=F.useState(!1),o=Se(l.stores.isLoading,p=>p),f=Se(l.stores.hasPending,p=>p),m=$o(o),v=o||s||f,g=$o(v),y=o||f,b=$o(y);return l.startTransition=p=>{c(!0),F.startTransition(()=>{p(),c(!1)})},F.useEffect(()=>{const p=l.history.subscribe(l.load),S=l.buildLocation({to:l.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Kn(l.latestLocation.publicHref)!==Kn(S.publicHref)&&l.commitLocation({...S,replace:!0}),()=>{p()}},[l,l.history]),As(()=>{if(typeof window<"u"&&l.ssr||i.current.router===l&&i.current.mounted)return;i.current={router:l,mounted:!0},(async()=>{try{await l.load()}catch(S){console.error(S)}})()},[l]),As(()=>{m&&!o&&l.emit({type:"onLoad",...di(l.stores.location.get(),l.stores.resolvedLocation.get())})},[m,l,o]),As(()=>{b&&!y&&l.emit({type:"onBeforeRouteMount",...di(l.stores.location.get(),l.stores.resolvedLocation.get())})},[y,b,l]),As(()=>{if(g&&!v){const p=di(l.stores.location.get(),l.stores.resolvedLocation.get());l.emit({type:"onResolved",...p}),Cg(()=>{l.stores.status.set("idle"),l.stores.resolvedLocation.set(l.stores.location.get())})}},[v,g,l]),null}function YS(){const l=Ge(),i=l.routesById[vl].options.pendingComponent??l.options.defaultPendingComponent,s=i?d.jsx(i,{}):null,c=d.jsxs(typeof document<"u"&&l.ssr?fi:F.Suspense,{fallback:s,children:[d.jsx(QS,{}),d.jsx(GS,{})]});return l.options.InnerWrap?d.jsx(l.options.InnerWrap,{children:c}):c}function GS(){const l=Ge(),i=Se(l.stores.firstId,o=>o),s=Se(l.stores.loadedAt,o=>o),c=i?d.jsx(qg,{matchId:i}):null;return d.jsx(Ac.Provider,{value:i,children:l.options.disableGlobalCatchBoundary?c:d.jsx(Kf,{getResetKey:()=>s,errorComponent:Xf,onCatch:void 0,children:c})})}var KS=l=>({createMutableStore:zp,createReadonlyStore:zp,batch:Cg}),XS=l=>new VS(l),VS=class extends Gb{constructor(l){super(l,KS)}};function ZS({router:l,children:i,...s}){hg(s)&&l.update({...l.options,...s,context:{...l.options.context,...s.context}});const c=d.jsx(Tg.Provider,{value:l,children:i});return l.options.Wrap?d.jsx(l.options.Wrap,{children:c}):c}function JS({router:l,...i}){return d.jsx(ZS,{router:l,...i,children:d.jsx(YS,{})})}function PS(l){const i=Ge({warn:(l==null?void 0:l.router)===void 0}),s=(l==null?void 0:l.router)||i;return Se(s.stores.__store,wg(l,s))}async function kg(l){if(!l.ok){let i=`${l.status}`;try{const s=await l.json();s.error&&(i=s.error)}catch{}throw new Error(i)}return l.json()}async function kt(l,i){const s=await fetch(l,{headers:{"Content-Type":"application/json"},...i});return kg(s)}async function FS(l,i){const s=await fetch(l,{method:"POST",body:i});return kg(s)}async function IS(l,i){const s=await fetch(l,{headers:{"Content-Type":"application/json"},...i});if(!s.ok){let c=`${s.status}`;try{const o=await s.json();o.error&&(c=o.error)}catch{}throw new Error(c)}return s.blob()}const bt={overview:()=>kt("/api/overview"),status:()=>kt("/api/status"),artifacts:()=>kt("/api/artifacts"),artifact:l=>kt(`/api/artifacts/${l}`),diff:l=>{const i=new URLSearchParams;return l.artifact&&i.set("artifact",l.artifact),l.agent&&i.set("agent",l.agent),kt(`/api/diff?${i}`)},syncPlan:()=>kt("/api/sync/plan",{method:"POST",body:"{}"}),syncApply:l=>kt("/api/sync/apply",{method:"POST",body:JSON.stringify({token:l})}),sources:()=>kt("/api/sources"),sourcesAdd:l=>kt("/api/sources/add",{method:"POST",body:JSON.stringify(l)}),sourcesCheck:()=>kt("/api/sources/check",{method:"POST",body:"{}"}),wizardSchema:()=>kt("/api/wizard/schema"),wizardPresets:()=>kt("/api/wizard/presets"),wizardPlan:(l,i)=>kt("/api/wizard/plan",{method:"POST",body:JSON.stringify({answers:l,preset:i})}),wizardGenerate:(l,i)=>kt("/api/wizard/generate",{method:"POST",body:JSON.stringify({answers:l,preset:i})}),profiles:()=>kt("/api/profiles"),profile:l=>kt(`/api/profiles/${l}`),saveProfile:(l,i)=>kt("/api/profiles",{method:"POST",body:JSON.stringify({name:l,answers:i})}),deleteProfile:l=>kt(`/api/profiles/${l}`,{method:"DELETE"}),libraryInstructions:()=>kt("/api/library/instructions"),libraryAdd:l=>kt("/api/library/instructions",{method:"POST",body:JSON.stringify({text:l})}),libraryRemove:l=>kt(`/api/library/instructions/${l}`,{method:"DELETE"}),libraryGroups:()=>kt("/api/library/groups"),libraryGroupSave:(l,i)=>kt("/api/library/groups",{method:"POST",body:JSON.stringify({name:l,entryIds:i})}),libraryGroupRemove:l=>kt(`/api/library/groups/${l}`,{method:"DELETE"}),bundleExportSelected:l=>IS("/api/bundle/export",{method:"POST",body:JSON.stringify(l)}),bundleExportFlat:l=>kt("/api/bundle/export/flat",{method:"POST",body:JSON.stringify(l)}),bundleImportPlan:l=>{const i=new FormData;return i.set("bundle",l),FS("/api/bundle/import/plan",i)},bundleImportPlanYAML:l=>kt("/api/bundle/import/plan",{method:"POST",body:JSON.stringify({yaml:l})}),bundleImportApply:(l,i)=>kt("/api/bundle/import/apply",{method:"POST",body:JSON.stringify({token:l,overwrite:i})})};function $S(){var y;const l=Jn(),[i,s]=F.useState(null),[c,o]=F.useState(null),f=ue({queryKey:["overview"],queryFn:bt.overview}),m=ae({mutationFn:bt.syncPlan,onSuccess:b=>{s(b),o(null)}}),v=ae({mutationFn:b=>bt.syncApply(b),onSuccess:b=>{o(b.applied),s(null),l.invalidateQueries()}}),g=((y=f.data)==null?void 0:y.pending)??0;return g===0&&!i&&c===null?null:d.jsx("div",{className:"fixed inset-x-0 bottom-0 z-10",children:d.jsx("div",{className:"mx-auto max-w-6xl px-6 pb-5",children:d.jsx("div",{className:"dock-up rounded-xs border border-line-strong bg-raised shadow-[0_-12px_48px_oklch(0.08_0.01_60/0.7)]",children:c!==null&&!i?d.jsxs("div",{className:"flex items-center justify-between px-5 py-3",children:[d.jsxs("p",{className:"stamp text-sm text-sync",children:[d.jsx("span",{className:"mr-2 font-mono text-[10px]",children:"■"}),"Applied ",c," change",c===1?"":"s",". Agents are up to date."]}),d.jsx("button",{onClick:()=>o(null),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"dismiss"})]}):i?d.jsxs("div",{className:"px-5 py-4",children:[d.jsxs("div",{className:"flex items-baseline justify-between",children:[d.jsxs("p",{className:"font-display text-sm font-semibold uppercase tracking-wider text-ink",children:["Requisition — ",i.changes.length," change",i.changes.length===1?"":"s"]}),d.jsxs("p",{className:"font-mono text-[11px] text-ink-faint",children:["plan ",d.jsx("span",{className:"text-ember",children:i.token.slice(0,8)})]})]}),d.jsx("ul",{className:"mt-3 max-h-44 space-y-1 overflow-y-auto pr-1",children:i.changes.map((b,p)=>d.jsxs("li",{className:"rise flex items-center gap-3 font-mono text-xs",style:{"--i":Math.min(p,10)},children:[d.jsx("span",{className:`w-16 whitespace-nowrap ${b.op==="create"?"text-sync":"text-warn"}`,children:b.op==="create"?"+ new":"~ "+b.op}),d.jsx("span",{className:"text-ink-dim",children:b.agent}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:b.relPath}),d.jsx("span",{className:"text-ink-faint",children:b.artifact})]},p))}),d.jsxs("div",{className:"mt-4 flex items-center gap-3 border-t border-line pt-3",children:[d.jsx("button",{onClick:()=>v.mutate(i.token),disabled:v.isPending,className:"btn-ember",children:v.isPending?"Applying…":`Apply ${i.changes.length}`}),d.jsx("button",{onClick:()=>s(null),className:"px-2 py-1.5 text-sm text-ink-dim transition-colors hover:text-ink",children:"Cancel — write nothing"}),v.isError?d.jsx("span",{className:"text-xs text-danger",children:String(v.error)}):null]})]}):d.jsxs("div",{className:"flex items-center justify-between px-5 py-3",children:[d.jsxs("p",{className:"text-sm text-ink-dim",children:[d.jsx("span",{"aria-hidden":!0,className:"ember-pulse mr-2.5 inline-block h-2 w-2 bg-ember align-baseline"}),d.jsx("span",{className:"tnum font-medium text-ink",children:g})," pending change",g===1?"":"s"," across your agents"]}),d.jsx("button",{onClick:()=>m.mutate(),disabled:m.isPending,className:"btn-outline",children:m.isPending?"Planning…":"Review & apply"})]})})})})}const Qg=[{to:"/",label:"Overview"},{to:"/store",label:"Store"},{to:"/agents",label:"Agents"},{to:"/sources",label:"Sources"},{to:"/builder",label:"Builder"},{to:"/library",label:"Library"},{to:"/export",label:"Export"}],Hp=36;function WS(l){return l==="/"?0:Qg.findIndex(s=>s.to!=="/"&&l.startsWith(s.to))}function t1(){const l=[{x:1,y:1,ember:!0},{x:12,y:1,ember:!1},{x:1,y:12,ember:!1},{x:12,y:12,ember:!0}];return d.jsx("svg",{viewBox:"0 0 22 22",className:"h-6 w-6","aria-hidden":!0,children:l.map((i,s)=>d.jsx("rect",{x:i.x,y:i.y,width:"9",height:"9",className:"stamp",style:{animationDelay:`${120+s*90}ms`},fill:i.ember?"var(--color-ember)":"var(--color-line-strong)"},s))})}function e1(){const l=PS({select:s=>s.location.pathname}),i=WS(l);return d.jsxs("div",{className:"min-h-screen",children:[d.jsxs("div",{className:"mx-auto flex max-w-6xl gap-14 px-6 pb-40 pt-10",children:[d.jsx("aside",{className:"w-48 shrink-0",children:d.jsxs("div",{className:"sticky top-10",children:[d.jsxs(Zn,{to:"/",className:"flex select-none items-center gap-3",children:[d.jsx(t1,{}),d.jsxs("span",{children:[d.jsxs("span",{className:"block font-display text-xl font-bold leading-none tracking-wide text-ink",children:["LOAD",d.jsx("span",{className:"text-ember",children:"OUT"})]}),d.jsx("span",{className:"mt-1 block font-mono text-[10px] tracking-[0.18em] text-ink-faint",children:"AGENTIC GEAR KIT"})]})]}),d.jsxs("nav",{className:"relative mt-12",children:[d.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-1 left-0 w-px bg-line"}),d.jsx("span",{"aria-hidden":!0,className:"absolute left-0 w-[2px] bg-ember transition-transform",style:{height:Hp-12,transform:`translateY(${(i<0?0:i)*Hp+6}px)`,opacity:i<0?0:1,transitionDuration:"450ms",transitionTimingFunction:"var(--ease-out-expo)"}}),d.jsx("div",{className:"flex flex-col",children:Qg.map((s,c)=>{const o=c===i;return d.jsxs(Zn,{to:s.to,className:`group flex h-9 items-center gap-3 pl-5 text-sm transition-colors ${o?"text-ink":"text-ink-dim hover:text-ink"}`,children:[d.jsx("span",{className:`font-mono text-[10px] tnum transition-colors ${o?"text-ember":"text-ink-faint group-hover:text-ink-dim"}`,children:String(c+1).padStart(2,"0")}),d.jsx("span",{className:o?"font-medium":"",children:s.label})]},s.to)})})]}),d.jsx("div",{className:"mt-14 border-t border-line pt-4",children:d.jsxs("p",{className:"font-mono text-[11px] leading-relaxed text-ink-faint",children:["nothing is written",d.jsx("br",{}),"without asking."]})})]})}),d.jsx("main",{className:"min-w-0 flex-1",children:d.jsx("div",{className:"page",children:d.jsx(Hg,{})},l)})]}),d.jsx($S,{})]})}function jl({crate:l,title:i,sub:s}){return d.jsxs("header",{className:"mb-10",children:[d.jsx("p",{className:"crate",children:l}),d.jsx("h1",{className:"wipe mt-2 font-display text-[1.9rem] font-semibold leading-tight text-ink",children:i}),s?d.jsx("p",{className:"rise mt-2 max-w-[65ch] text-sm leading-relaxed text-ink-dim",style:{"--i":2},children:s}):null]})}function n1(){const l=Jn(),i=F.useRef(null),[s,c]=F.useState(null),[o,f]=F.useState(null),[m,v]=F.useState(!1),[g,y]=F.useState(null),[b,p]=F.useState("file"),[S,j]=F.useState(""),N=ae({mutationFn:q=>bt.bundleImportPlan(q),onSuccess:q=>{f(q),v(!1),y(null)}}),_=ae({mutationFn:q=>bt.bundleImportPlanYAML(q),onSuccess:q=>{f(q),v(!1),y(null)}}),w=ae({mutationFn:()=>bt.bundleImportApply(o.token,m),onSuccess:q=>{y(q),f(null),c(null),j(""),i.current&&(i.current.value=""),l.invalidateQueries()}}),C=o?o.new.length+o.sources.length+(m?o.conflicts.length:0):0;function D(q){var z;const U=(z=q.target.files)==null?void 0:z[0];U&&(c(U.name),y(null),N.mutate(U))}function G(){S.trim()&&(y(null),_.mutate(S))}function A(){f(null),c(null),j(""),i.current&&(i.current.value="")}return d.jsxs("div",{className:"mt-6 border-t border-line pt-5",children:[d.jsx("p",{className:"font-display text-xs font-semibold uppercase tracking-wider text-ink-dim",children:"Import a bundle"}),d.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:["Received a ",d.jsx("code",{className:"font-mono text-xs text-ink",children:".loadout.tar.gz"})," or a single YAML export from a teammate? Upload the file or paste the YAML here to review and merge it into this store."]}),g?d.jsxs("div",{className:"rise mt-4 flex items-center justify-between",children:[d.jsxs("p",{className:"stamp text-sm text-sync",children:[d.jsx("span",{className:"mr-2 font-mono text-[10px]",children:"■"}),"Imported ",g.applied.length," artifact",g.applied.length===1?"":"s",g.sourcesAdded>0?`, ${g.sourcesAdded} new source${g.sourcesAdded===1?"":"s"}`:"",". Run a sync to install into your agents."]}),d.jsx("button",{onClick:()=>y(null),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"dismiss"})]}):o?d.jsxs("div",{className:"rise mt-4 border border-line-strong bg-raised p-4",children:[d.jsxs("div",{className:"flex items-baseline justify-between",children:[d.jsxs("p",{className:"font-display text-sm font-semibold uppercase tracking-wider text-ink",children:[o.meta.name," — ",C," change",C===1?"":"s"]}),d.jsxs("p",{className:"font-mono text-[11px] text-ink-faint",children:["by ",o.meta.createdBy||"unknown"]})]}),d.jsxs("ul",{className:"mt-3 max-h-44 space-y-1 overflow-y-auto pr-1 font-mono text-xs",children:[o.new.map(q=>d.jsxs("li",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"w-20 text-sync",children:"+ new"}),d.jsx("span",{className:"text-ink",children:q.id}),d.jsx("span",{className:"text-ink-faint",children:q.kind})]},`new-${q.id}`)),o.conflicts.map(q=>d.jsxs("li",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"w-20 text-warn",children:m?"! overwrite":"! skip"}),d.jsx("span",{className:"text-ink",children:q.id}),d.jsx("span",{className:"text-ink-faint",children:q.kind})]},`conflict-${q.id}`)),o.sources.map(q=>d.jsxs("li",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"w-20 text-sync",children:"+ source"}),d.jsx("span",{className:"text-ink",children:q.name})]},`source-${q.name}`))]}),o.identical.length>0?d.jsxs("p",{className:"mt-2 font-mono text-xs text-ink-faint",children:["= ",o.identical.length," artifact",o.identical.length===1?"":"s"," identical, nothing to do"]}):null,o.conflicts.length>0?d.jsxs("label",{className:"mt-3 flex items-center gap-2 text-xs text-ink-dim",children:[d.jsx("input",{type:"checkbox",checked:m,onChange:q=>v(q.target.checked)}),"Overwrite ",o.conflicts.length," conflicting artifact",o.conflicts.length===1?"":"s"," with the bundle's version"]}):null,d.jsxs("div",{className:"mt-4 flex items-center gap-3 border-t border-line pt-3",children:[d.jsx("button",{onClick:()=>w.mutate(),disabled:w.isPending||C===0,className:"btn-ember",children:w.isPending?"Importing…":`Import ${C}`}),d.jsx("button",{onClick:A,className:"px-2 py-1.5 text-sm text-ink-dim transition-colors hover:text-ink",children:"Cancel — write nothing"}),w.isError?d.jsx("span",{className:"text-xs text-danger",children:String(w.error)}):null]})]}):d.jsxs("div",{className:"mt-4",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"button",onClick:()=>p("file"),"data-on":b==="file",className:"chip",children:"choose file"}),d.jsx("button",{type:"button",onClick:()=>p("paste"),"data-on":b==="paste",className:"chip",children:"paste YAML"})]}),b==="file"?d.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[d.jsxs("label",{className:"btn-outline inline-flex cursor-pointer items-center gap-2",children:[d.jsx("span",{"aria-hidden":!0,className:"font-mono text-ember",children:"↑"}),s??"Choose bundle…",d.jsx("input",{ref:i,type:"file",accept:".tar.gz,.tgz,application/gzip",className:"hidden",onChange:D})]}),N.isPending?d.jsx("span",{className:"text-xs text-ink-faint",children:"Reviewing…"}):N.isError?d.jsx("span",{className:"text-xs text-danger",children:String(N.error)}):null]}):d.jsxs("div",{className:"mt-3",children:[d.jsx("textarea",{value:S,onChange:q=>j(q.target.value),placeholder:"Paste a loadout-config/v1 YAML document…",rows:8,className:"w-full resize-y overflow-x-auto border border-line bg-bg-deep/60 p-4 font-mono text-xs leading-relaxed"}),d.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[d.jsx("button",{type:"button",onClick:G,disabled:_.isPending||!S.trim(),className:"btn-outline",children:_.isPending?"Reviewing…":"Review"}),_.isError?d.jsx("span",{className:"text-xs text-danger",children:String(_.error)}):null]})]})]})]})}const a1={"in-sync":{color:"text-sync",mark:"■",dim:"bg-sync"},missing:{color:"text-warn",mark:"□",dim:"bg-warn"},"drifted-local":{color:"text-warn",mark:"◧",dim:"bg-warn"},"drifted-store":{color:"text-drift",mark:"◨",dim:"bg-drift"},conflict:{color:"text-danger",mark:"✕",dim:"bg-danger"},"n/a":{color:"text-ink-faint",mark:"·",dim:"bg-ink-faint"}};function Zf(l){return a1[l]??{color:"text-ink-dim",mark:"■",dim:"bg-ink-dim"}}function Yg({state:l}){const i=Zf(l);return d.jsxs("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs ${i.color}`,children:[d.jsx("span",{"aria-hidden":!0,className:"text-[10px] leading-none",children:i.mark}),l]})}const l1={skill:"M6 1 L7.4 4.6 L11 6 L7.4 7.4 L6 11 L4.6 7.4 L1 6 L4.6 4.6 Z",instruction:"M1 2.5 H11 M1 6 H8.5 M1 9.5 H10",command:"M2 2.5 L6 6 L2 9.5 M7 9.5 H11",hook:"M8.5 1 V6 A3 3 0 0 1 2.5 6 V4.5",settings:"M1 4 H11 M1 8 H11 M4 2.5 V5.5 M8 6.5 V9.5"};function qs({kind:l,className:i=""}){const s=l1[l];return s?d.jsx("svg",{viewBox:"0 0 12 12",className:`h-3 w-3 ${i}`,"aria-hidden":!0,children:d.jsx("path",{d:s,fill:l==="skill"?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"square"})}):d.jsx("svg",{viewBox:"0 0 12 12",className:`h-3 w-3 ${i}`,"aria-hidden":!0,children:d.jsx("rect",{x:"2",y:"2",width:"8",height:"8",fill:"none",stroke:"currentColor"})})}function i1({kind:l}){return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-xs border border-line px-1.5 py-0.5 font-mono text-[11px] text-ink-dim",children:[d.jsx(qs,{kind:l,className:"text-ink-faint"}),l]})}const kp=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function s1(l,i=700){const[s,c]=F.useState(()=>kp()?l:0),o=F.useRef(0);return F.useEffect(()=>{if(kp()){c(l);return}const f=performance.now(),m=v=>{const g=Math.min(1,(v-f)/i),y=1-Math.pow(2,-10*g);c(Math.round(l*(g===1?1:y))),g<1&&(o.current=requestAnimationFrame(m))};return o.current=requestAnimationFrame(m),()=>cancelAnimationFrame(o.current)},[l,i]),s}function u1({value:l,className:i=""}){const s=s1(l);return d.jsx("span",{className:`tnum ${i}`,children:s})}const c1=["conflict","drifted-local","drifted-store","missing","in-sync"],r1={"in-sync":"var(--color-sync-dim)",missing:"var(--color-warn-dim)","drifted-local":"var(--color-warn-dim)","drifted-store":"var(--color-drift-dim)",conflict:"var(--color-danger-dim)"},o1={"in-sync":"var(--color-sync)",missing:"var(--color-warn)","drifted-local":"var(--color-warn)","drifted-store":"var(--color-drift)",conflict:"var(--color-danger)"};function f1(){const l=ue({queryKey:["overview"],queryFn:bt.overview});if(l.isLoading)return d.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"});if(l.isError)return d.jsxs("p",{className:"text-sm text-danger",children:["Cannot reach loadout: ",String(l.error)]});const i=l.data,s=i.agents.filter(f=>f.installed),c=c1.filter(f=>(i.states[f]??0)>0),o=c.reduce((f,m)=>f+(i.states[m]??0),0);return d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / overview",title:i.store.name,sub:`${i.store.artifacts} artifact${i.store.artifacts===1?"":"s"} in the store · ${s.length} of ${i.agents.length} agents installed on this machine`}),i.store.artifacts===0?d.jsxs("div",{className:"rise brk max-w-[65ch] border border-line p-6","data-active":"true",children:[d.jsx("div",{className:"flex items-center gap-2.5 text-ink-faint",children:["skill","instruction","command","hook","settings"].map(f=>d.jsx(qs,{kind:f,className:"h-3.5 w-3.5"},f))}),d.jsx("p",{className:"mt-4 font-display text-lg font-medium text-ink",children:"The rack is empty."}),d.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:["Fill it with the"," ",d.jsx(Zn,{to:"/builder",className:"text-ember transition-colors hover:text-ember-bright",children:"Builder"})," ","— it interviews you about your stack, conventions and testing strategy, then generates skills, instructions and commands for every agent. Or scaffold by hand with"," ",d.jsx("code",{className:"font-mono text-xs text-ink",children:"loadout new"}),"."]})]}):d.jsxs("section",{children:[d.jsx("h2",{className:"crate",children:"readiness board"}),o>0?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-4 flex h-2.5 gap-[3px]",role:"img","aria-label":"sync state distribution",children:c.map((f,m)=>d.jsx("div",{className:"grow-x relative min-w-[6px]",style:{flexGrow:i.states[f],"--i":m,background:r1[f]},children:d.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px]",style:{background:o1[f]}})},f))}),d.jsx("div",{className:"mt-4 flex flex-wrap gap-x-10 gap-y-3",children:c.map((f,m)=>d.jsxs("span",{className:"rise flex items-baseline gap-2.5",style:{"--i":m+2},children:[d.jsx(u1,{value:i.states[f],className:`font-display text-[1.7rem] font-semibold leading-none ${Zf(f).color}`}),d.jsx(Yg,{state:f})]},f))})]}):d.jsx("p",{className:"mt-3 text-sm text-ink-dim",children:"No installed agents to compare against yet."})]}),d.jsxs("section",{className:"mt-14",children:[d.jsx("h2",{className:"crate",children:"agents on this machine"}),d.jsx("ul",{className:"mt-4 divide-y divide-line border-y border-line",children:i.agents.map((f,m)=>d.jsxs("li",{className:"rise flex items-center gap-4 py-3",style:{"--i":m},children:[d.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 flex-none ${f.installed?"bg-sync":"border border-line-strong"}`}),d.jsx("span",{className:"w-36 font-mono text-sm text-ink",children:f.id}),d.jsx("span",{className:"w-32 text-sm text-ink-dim",children:f.name}),f.installed?d.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-ink-faint",children:f.home}):d.jsx("span",{className:"flex-1 text-xs text-ink-faint",children:"not installed"})]},f.id))})]}),d.jsxs("section",{className:"mt-14 max-w-[65ch]",children:[d.jsx("h2",{className:"crate",children:"share"}),d.jsxs("p",{className:"mt-4 text-sm leading-relaxed text-ink-dim",children:["Export the whole store as one bundle a teammate can import on any machine. They run"," ",d.jsx("code",{className:"font-mono text-xs text-ink",children:"loadout bundle import"})," and then sync."]}),d.jsxs("a",{href:"/api/bundle/export",className:"btn-ghost mt-4 inline-flex items-center gap-2",download:!0,children:[d.jsx("span",{"aria-hidden":!0,className:"font-mono text-ember",children:"↓"}),i.store.name,".loadout.tar.gz"]}),d.jsx(Zn,{to:"/export",className:"mt-2 block text-xs text-ink-faint transition-colors hover:text-ink",children:"or pick exactly what to share →"}),d.jsx(n1,{})]})]})}function d1(){const l=ue({queryKey:["artifacts"],queryFn:bt.artifacts}),[i,s]=F.useState(null),c=l.data??[],o=[...new Set(c.map(m=>m.kind))],f=i?c.filter(m=>m.kind===i):c;return d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / store",title:"Canonical store",sub:"Every artifact here is the single source of truth — agents receive rendered copies on sync."}),l.isLoading?d.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"}):c.length===0?d.jsxs("p",{className:"max-w-[65ch] text-sm text-ink-dim",children:["Nothing here yet. The"," ",d.jsx(Zn,{to:"/builder",className:"text-ember transition-colors hover:text-ember-bright",children:"Builder"})," ","generates a full kit from your conventions."]}):d.jsxs(d.Fragment,{children:[o.length>1?d.jsxs("div",{className:"rise mb-5 flex flex-wrap items-center gap-2",children:[d.jsxs("button",{className:"chip font-mono text-xs","data-on":i===null,onClick:()=>s(null),children:["all ",d.jsx("span",{className:"tnum text-ink-faint",children:c.length})]}),o.map(m=>d.jsxs("button",{className:"chip inline-flex items-center gap-1.5 font-mono text-xs","data-on":i===m,onClick:()=>s(i===m?null:m),children:[d.jsx(qs,{kind:m}),m," ",d.jsx("span",{className:"tnum text-ink-faint",children:c.filter(v=>v.kind===m).length})]},m))]}):null,d.jsx("ul",{className:"divide-y divide-line border-y border-line",children:f.map((m,v)=>{var g;return d.jsx("li",{className:"wipe",style:{"--i":Math.min(v,12)},children:d.jsxs(Zn,{to:"/store/$artifactId",params:{artifactId:m.id},className:"brk group flex items-center gap-4 py-3 pl-1 pr-2 transition-colors hover:bg-surface/50",children:[d.jsx(qs,{kind:m.kind,className:"flex-none text-ink-faint transition-colors group-hover:text-ember"}),d.jsx("span",{className:"w-56 truncate font-mono text-sm text-ink transition-colors group-hover:text-ember-bright",children:m.id}),d.jsx("span",{className:"font-mono text-[11px] text-ink-dim",children:m.kind}),d.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-ink-faint",children:m.path}),(g=m.origin)!=null&&g.startsWith("source:")?d.jsx("span",{className:"font-mono text-[11px] text-drift",children:m.origin}):null,d.jsx("span",{"aria-hidden":!0,className:"font-mono text-xs text-ink-faint opacity-0 transition-all duration-200 group-hover:translate-x-0.5 group-hover:text-ember group-hover:opacity-100",children:"▸"})]})},m.id)})},i??"all")]})]})}function h1(){const{artifactId:l}=Vf({from:"/store/$artifactId"}),i=ue({queryKey:["artifact",l],queryFn:()=>bt.artifact(l)}),[s,c]=F.useState(null);if(i.isLoading)return d.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"});if(i.isError)return d.jsx("p",{className:"text-sm text-danger",children:String(i.error)});const{artifact:o,files:f}=i.data,m=Object.keys(f).sort(),v=s&&f[s]!==void 0?s:m[0],g=v?f[v].split(` +`).length:0;return d.jsxs("div",{children:[d.jsxs("nav",{className:"crate",children:[d.jsx(Zn,{to:"/store",className:"transition-colors hover:text-ink",children:"store"}),d.jsx("span",{"aria-hidden":!0,className:"text-ink-faint",children:"/"}),d.jsx("span",{className:"normal-case tracking-normal text-ink-dim",children:o.id})]}),d.jsxs("header",{className:"wipe mb-7 mt-3 flex items-center gap-3",children:[d.jsx("h1",{className:"font-display text-[1.9rem] font-semibold leading-tight text-ink",children:o.id}),d.jsx(i1,{kind:o.kind}),o.origin&&o.origin!=="local"?d.jsx("span",{className:"font-mono text-[11px] text-drift",children:o.origin}):null]}),d.jsxs("div",{className:"rise border border-line",style:{"--i":2},children:[d.jsxs("div",{className:"flex flex-wrap items-center border-b border-line bg-surface/60",children:[m.map(y=>d.jsxs("button",{onClick:()=>c(y),className:`relative px-3.5 py-2 font-mono text-xs transition-colors ${y===v?"text-ink":"text-ink-faint hover:text-ink-dim"}`,children:[y,d.jsx("span",{"aria-hidden":!0,className:"absolute inset-x-2 bottom-0 h-[2px] bg-ember transition-transform duration-200",style:{transform:y===v?"scaleX(1)":"scaleX(0)",transformOrigin:"left center",transitionTimingFunction:"var(--ease-out-quart)"}})]},y)),d.jsxs("span",{className:"ml-auto px-3.5 font-mono text-[11px] text-ink-faint tnum",children:[g," lines"]})]}),d.jsx("pre",{className:"page max-h-[65vh] overflow-auto p-5 font-mono text-[13px] leading-relaxed text-ink-dim",children:v?f[v]:"(empty)"},v)]}),d.jsxs("p",{className:"mt-4 max-w-[65ch] text-xs text-ink-faint",children:["Edit this file in the store on disk (",d.jsx("span",{className:"font-mono",children:o.path}),") — the web UI never modifies artifacts silently."]})]})}function m1(){var b,p;const l=ue({queryKey:["status"],queryFn:bt.status}),[i,s]=F.useState(null),c=ue({queryKey:["diff",i],queryFn:()=>bt.diff(i),enabled:i!==null}),o=((b=l.data)==null?void 0:b.rows)??[],f=((p=l.data)==null?void 0:p.skips)??[],m=[...new Set(o.map(S=>S.agent))],v=[];{const S=new Map;for(const j of o){let N=S.get(j.artifact);N||(N={id:j.artifact,kind:j.kind,cells:{}},S.set(j.artifact,N),v.push(N)),N.cells[j.agent]=j.state}}const g=[...new Set(o.map(S=>S.state))],y=`minmax(200px, 300px) repeat(${Math.max(m.length,1)}, minmax(104px, 148px))`;return d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / agents",title:"Drift matrix",sub:"Every artifact × every installed agent. Select a drifted cell to see the exact diff before anything moves."}),l.isLoading?d.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"}):o.length===0?d.jsx("p",{className:"max-w-[65ch] text-sm text-ink-dim",children:"No rows — either the store is empty or no supported agent is installed."}):d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("div",{className:"min-w-fit",children:[d.jsxs("div",{className:"grid items-end gap-x-2 border-b border-line-strong pb-2",style:{gridTemplateColumns:y},children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"artifact ▸ agent"}),m.map(S=>d.jsx("span",{className:"text-center font-mono text-xs text-ink-dim",children:S},S))]}),v.map((S,j)=>d.jsxs("div",{className:"wipe grid items-center gap-x-2 border-b border-line",style:{gridTemplateColumns:y,"--i":Math.min(j,12)},children:[d.jsxs("span",{className:"flex min-w-0 items-center gap-2.5 py-2 pr-3",children:[d.jsx(qs,{kind:S.kind,className:"flex-none text-ink-faint"}),d.jsx("span",{className:"truncate font-mono text-sm text-ink",children:S.id})]}),m.map(N=>{const _=S.cells[N]??"n/a",w=Zf(_),C=_!=="in-sync"&&_!=="n/a",D=(i==null?void 0:i.artifact)===S.id&&(i==null?void 0:i.agent)===N;return d.jsx("button",{onClick:()=>C?s(D?null:{artifact:S.id,agent:N}):void 0,disabled:!C,"aria-label":`${S.id} on ${N}: ${_}`,title:`${_}${C?" — view diff":""}`,"data-active":D,className:`brk mx-auto my-1 flex h-8 w-full max-w-[9rem] items-center justify-center font-mono text-sm transition-colors ${w.color} ${C?"cursor-pointer hover:bg-surface":""} ${D?"bg-surface":""}`,children:d.jsx("span",{"aria-hidden":!0,children:w.mark})},N)})]},S.id)),d.jsx("div",{className:"mt-4 flex flex-wrap gap-x-7 gap-y-2",children:g.map(S=>d.jsx(Yg,{state:S},S))})]})}),d.jsx("div",{className:"expander","data-open":i!==null,children:d.jsx("div",{children:i?d.jsxs("section",{className:"mt-8 border border-line bg-surface/40",children:[d.jsxs("div",{className:"flex items-baseline justify-between border-b border-line px-4 py-2.5",children:[d.jsxs("h2",{className:"font-display text-sm font-semibold text-ink",children:[i.artifact," ",d.jsx("span",{className:"text-ink-faint",children:"→"})," ",i.agent]}),d.jsx("button",{onClick:()=>s(null),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"close"})]}),d.jsx("div",{className:"px-4 py-3",children:c.isLoading?d.jsx("p",{className:"text-sm text-ink-faint",children:"Computing diff…"}):(c.data??[]).length===0?d.jsx("p",{className:"text-sm text-ink-dim",children:"Nothing to change — the drift is local-only (the agent file was edited; syncing would not overwrite it unless the store changes too)."}):(c.data??[]).map(S=>d.jsxs("div",{className:"mb-3 last:mb-0",children:[d.jsx("p",{className:"font-mono text-xs text-ink-faint",children:S.relPath}),d.jsx("pre",{className:"mt-1.5 overflow-x-auto border border-line bg-bg-deep/60 p-4 font-mono text-xs leading-relaxed",children:S.diff.split(` +`).map((j,N)=>d.jsx("span",{className:j.startsWith("+")?"block text-sync":j.startsWith("-")?"block text-danger":"block text-ink-faint",children:j||" "},N))})]},S.relPath))})]}):null})}),f.length>0?d.jsxs("p",{className:"mt-6 font-mono text-xs text-ink-faint",children:["skipped: ",f.map(S=>`${S.agent} (${S.reason})`).join(" · ")]}):null]})}function y1(){const l=Jn(),i=ue({queryKey:["sources"],queryFn:bt.sources}),s=ae({mutationFn:bt.sourcesCheck}),c={};for(const o of s.data??[])c[o.name]=o;return d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / sources",title:"External sources",sub:"Skill repos pinned in sources.lock.yaml — adding clones and imports once; checking is ls-remote only; applying updates stays in the CLI (loadout update) where the diff is reviewed."}),d.jsx(p1,{onAdded:()=>void l.invalidateQueries({queryKey:["sources"]})}),i.isLoading?d.jsx("p",{className:"mt-10 text-sm text-ink-faint",children:"Loading…"}):(i.data??[]).length===0?d.jsxs("p",{className:"mt-10 max-w-[65ch] text-sm text-ink-dim",children:["No sources registered yet — add one above, or track a skills repo from the CLI with"," ",d.jsx("code",{className:"font-mono text-xs text-ink",children:"loadout source add "}),". Pins land in the store so your whole team resolves the same versions."]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mb-4 mt-10 flex items-center gap-3",children:[d.jsx("button",{onClick:()=>s.mutate(),disabled:s.isPending,className:"btn-ghost",children:s.isPending?"Checking remotes…":"Check remotes"}),d.jsx("span",{className:"text-xs text-ink-faint",children:"read-only — nothing is fetched or applied"})]}),d.jsx("ul",{className:"divide-y divide-line border-y border-line",children:(i.data??[]).map((o,f)=>{const m=c[o.name];return d.jsxs("li",{className:"wipe flex items-center gap-4 py-3",style:{"--i":f},children:[d.jsx("span",{className:"w-40 truncate font-mono text-sm text-ink",children:o.name}),d.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-ink-faint",children:o.url}),d.jsxs("span",{className:"font-mono text-xs text-ink-dim",children:[o.ref||"default"," ",d.jsx("span",{className:"text-ink-faint",children:"@"})," ",o.commit.slice(0,10)]}),d.jsx("span",{className:"w-44 text-right font-mono text-xs",children:m?m.error?d.jsx("span",{className:"stamp inline-block text-danger",title:m.error,children:"✕ error"}):m.hasUpdate?d.jsx("span",{className:"stamp inline-block text-drift",children:"◨ update available"}):d.jsx("span",{className:"stamp inline-block text-sync",children:"■ up-to-date"}):d.jsx("span",{className:"text-ink-faint",children:"unchecked"})})]},o.name)})}),(s.data??[]).some(o=>o.hasUpdate)?d.jsxs("p",{className:"rise mt-4 text-sm text-ink-dim",children:["Updates available — run"," ",d.jsx("code",{className:"font-mono text-xs text-ember",children:"loadout update"})," to review the changelog and per-skill diff before anything moves."]}):null]})]})}function p1({onAdded:l}){const[i,s]=F.useState(""),[c,o]=F.useState(""),[f,m]=F.useState(""),[v,g]=F.useState(""),[y,b]=F.useState(!1),p=ae({mutationFn:()=>bt.sourcesAdd({url:i.trim(),name:c.trim()||void 0,ref:f.trim()||void 0,subdir:v.trim()||void 0}),onSuccess:()=>{s(""),o(""),m(""),g(""),l()}});return d.jsxs("div",{className:"rise brk border border-line p-5","data-active":"false",children:[d.jsx("h2",{className:"font-display text-sm font-semibold uppercase tracking-wider text-ink",children:"Add a source"}),d.jsxs("div",{className:"mt-3.5 flex flex-wrap items-center gap-3",children:[d.jsx("input",{type:"text",value:i,onChange:S=>s(S.target.value),onKeyDown:S=>{S.key==="Enter"&&i.trim()!==""&&!p.isPending&&p.mutate()},placeholder:"git@github.com:team/skills.git","aria-label":"Repository URL",className:"field w-full max-w-md flex-1"}),d.jsx("button",{onClick:()=>p.mutate(),disabled:p.isPending||i.trim()==="",className:"btn-ember",children:p.isPending?"Cloning…":"Add source"}),d.jsx("button",{onClick:()=>b(S=>!S),"aria-expanded":y,className:"font-mono text-xs text-ink-faint transition-colors hover:text-ink",children:y?"− options":"+ options"})]}),d.jsx("div",{className:"expander","data-open":y,children:d.jsx("div",{children:d.jsxs("div",{className:"flex flex-wrap items-end gap-3 pt-4",children:[d.jsx(df,{label:"Name",value:c,onChange:o,placeholder:"repo basename"}),d.jsx(df,{label:"Ref",value:f,onChange:m,placeholder:"default branch"}),d.jsx(df,{label:"Subdir",value:v,onChange:g,placeholder:"whole repo"})]})})}),d.jsxs("p",{className:"mt-3 text-xs text-ink-faint",children:["Clones the repo, imports every skill it finds, and pins the commit — same as"," ",d.jsx("code",{className:"font-mono",children:"loadout source add"}),". Private repos use your existing git credentials; nothing is stored."]}),p.isError?d.jsx("p",{className:"stamp mt-2 text-xs text-danger",children:String(p.error)}):p.isSuccess?d.jsxs("p",{className:"stamp mt-2 text-xs text-sync",children:["■ pinned ",p.data.ref.name," @ ",p.data.ref.commit.slice(0,10)," — imported"," ",(p.data.added??[]).length," skill",(p.data.added??[]).length===1?"":"s",(p.data.skipped??[]).length>0?`, skipped ${(p.data.skipped??[]).length} (already exist)`:"",". Run ",d.jsx("code",{className:"font-mono",children:"loadout sync"})," to install."]}):null]})}function df({label:l,value:i,onChange:s,placeholder:c}){return d.jsxs("label",{className:"flex flex-col gap-1.5",children:[d.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:[l," ",d.jsx("span",{className:"normal-case tracking-normal",children:"(optional)"})]}),d.jsx("input",{type:"text",value:i,onChange:o=>s(o.target.value),placeholder:c,className:"field w-44"})]})}const g1=3e3;function Df(){const[l,i]=F.useState(null),s=F.useRef(null);F.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);function c(f){return s.current&&clearTimeout(s.current),l===f?(i(null),!0):(i(f),s.current=setTimeout(()=>i(null),g1),!1)}function o(f){i(m=>m===f?null:m)}return{confirmingId:l,requestConfirm:c,cancelIfArmed:o}}function v1({text:l,onSave:i,onEmptyCommit:s}){const[c,o]=F.useState(!1),[f,m]=F.useState(l);function v(){m(l),o(!0)}function g(){const b=f.trim();b===""?s==null||s():b!==l&&i(b),o(!1)}function y(){o(!1)}return c?d.jsx("input",{type:"text",autoFocus:!0,value:f,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),y())},onBlur:g,className:"field min-w-0 flex-1"}):d.jsx("button",{type:"button",onClick:v,className:"min-w-0 flex-1 whitespace-normal break-words text-left transition-colors hover:text-ember",children:l})}function x1({value:l,onChange:i}){const[s,c]=F.useState(""),{confirmingId:o,requestConfirm:f,cancelIfArmed:m}=Df(),v=Jn(),g=ue({queryKey:["library"],queryFn:bt.libraryInstructions}),y=ue({queryKey:["library-groups"],queryFn:bt.libraryGroups}),b=ae({mutationFn:C=>bt.libraryAdd(C),onSuccess:()=>void v.invalidateQueries({queryKey:["library"]})}),p=ae({mutationFn:C=>bt.libraryRemove(C),onSuccess:()=>void v.invalidateQueries({queryKey:["library"]})}),S=new Set((g.data??[]).map(C=>C.text));function j(C){N([C])}function N(C){const D=new Set(l),G=[];for(const A of C){const q=A.trim();q!==""&&!D.has(q)&&(D.add(q),G.push(q))}G.length>0&&i([...l,...G])}function _(C){i(l.filter((D,G)=>G!==C))}function w(C){f(C)&&p.mutate(C)}return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",value:s,onChange:C=>c(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),j(s),c(""))},placeholder:"type an instruction, press Enter",className:"field w-full max-w-md"}),d.jsx("button",{type:"button",onClick:()=>{j(s),c("")},disabled:s.trim()==="",className:"btn-ghost",children:"Add"})]}),l.length>0?d.jsx("ul",{className:"mt-3 space-y-1 border-y border-line py-2",children:l.map((C,D)=>d.jsxs("li",{className:"rise flex items-start gap-3 py-0.5 font-mono text-sm text-ink",style:{"--i":D},children:[d.jsx(v1,{text:C,onSave:G=>i(l.map((A,q)=>q===D?G:A)),onEmptyCommit:()=>_(D)}),d.jsx("button",{type:"button",onClick:()=>b.mutate(C),disabled:b.isPending||S.has(C),className:"shrink-0 text-xs text-ink-faint transition-colors hover:text-ink",children:S.has(C)?"■ saved":"save"}),d.jsx("button",{type:"button",onClick:()=>_(D),"aria-label":`remove ${C}`,className:"shrink-0 text-xs text-ink-faint transition-colors hover:text-danger",children:"×"})]},`${C}-${D}`))}):null,(g.data??[]).length>0?d.jsxs("div",{className:"mt-4",children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"from your library"}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(g.data??[]).map(C=>{const D=l.includes(C.text);return d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsxs("button",{type:"button",onClick:()=>j(C.text),"data-on":D,className:"chip",children:[D?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,C.text]}),d.jsx("button",{type:"button",onClick:()=>w(C.id),onBlur:()=>m(C.id),"aria-label":o===C.id?`confirm delete ${C.text} from library`:`delete ${C.text} from library`,className:o===C.id?"font-medium text-danger":"text-xs text-ink-faint transition-colors hover:text-danger",children:o===C.id?"confirm ×":"×"})]},C.id)})})]}):null,(y.data??[]).length>0?d.jsxs("div",{className:"mt-3",children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"groups"}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(y.data??[]).map(C=>{const D=C.entryIds.map(A=>{var q;return(q=(g.data??[]).find(U=>U.id===A))==null?void 0:q.text}).filter(A=>!!A),G=D.length>0&&D.every(A=>l.includes(A));return d.jsxs("button",{type:"button",onClick:()=>N(D),"data-on":G,className:"chip",children:[G?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,C.name," (",D.length,")"]},C.name)})})]}):null]})}function b1(){const l=ue({queryKey:["wizard-schema"],queryFn:bt.wizardSchema}),i=ue({queryKey:["wizard-presets"],queryFn:bt.wizardPresets}),s=ue({queryKey:["profiles"],queryFn:bt.profiles}),[c,o]=F.useState({}),[f,m]=F.useState(void 0),[v,g]=F.useState(void 0),[y,b]=F.useState(0),p=Jn(),S=ae({mutationFn:()=>bt.wizardPlan(c,f)}),j=ae({mutationFn:()=>bt.wizardGenerate(c,f),onSuccess:()=>void p.invalidateQueries()}),N=ae({mutationFn:A=>bt.profile(A),onSuccess:(A,q)=>{o(A),g(q),m(void 0)}}),_=l.data??[],w=y===_.length,C=(A,q)=>o(U=>({...U,[A]:q})),D=()=>{b(_.length),S.mutate()},G=A=>A.questions.filter(q=>c[q.id]!==void 0).length;return l.isLoading?d.jsx("p",{className:"text-sm text-ink-faint",children:"Loading…"}):d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / builder",title:"Build your kit",sub:"Answer once — loadout generates conventions, testing standards, SDD commands and continuity artifacts for every agent. Nothing is written until you confirm the review."}),d.jsxs("div",{className:"rise mb-3 flex flex-wrap items-center gap-x-3 gap-y-2",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"start from"}),(i.data??[]).map(A=>d.jsx("button",{onClick:()=>{m(f===A?void 0:A),g(void 0)},"data-on":f===A,className:"chip font-mono text-xs",children:A},A)),d.jsx("span",{className:"text-xs text-ink-faint",children:"your answers below override the preset"})]}),(s.data??[]).length>0?d.jsxs("div",{className:"rise mb-10 flex flex-wrap items-center gap-x-3 gap-y-2",style:{"--i":1},children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"or a saved profile"}),(s.data??[]).map(A=>d.jsx("button",{onClick:()=>N.mutate(A),"data-on":v===A,className:"chip font-mono text-xs",children:A},A)),d.jsx("span",{className:"text-xs text-ink-faint",children:"loads that team's or org's answers — one org, one project type, one profile"})]}):d.jsx("div",{className:"mb-10"}),d.jsxs("div",{className:"flex gap-12",children:[d.jsxs("ol",{className:"relative w-48 shrink-0",children:[d.jsx("span",{"aria-hidden":!0,className:"absolute bottom-4 left-[11px] top-4 w-px bg-line"}),_.map((A,q)=>{const U=q===y&&!w,z=G(A);return d.jsx("li",{className:"relative",children:d.jsxs("button",{onClick:()=>b(q),className:`group flex w-full items-center gap-3.5 py-2 text-left text-sm transition-colors ${U?"text-ink":"text-ink-dim hover:text-ink"}`,children:[d.jsx("span",{className:`z-[1] flex h-6 w-6 flex-none items-center justify-center border font-mono text-[10px] tnum transition-colors ${U?"border-ember bg-ember-faint text-ember-bright":z>0?"border-line-strong bg-raised text-ink-dim":"border-line bg-bg text-ink-faint"}`,children:String(q+1).padStart(2,"0")}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:`block truncate ${U?"font-medium":""}`,children:A.title.split("—")[0].trim()}),d.jsxs("span",{className:"block font-mono text-[10px] text-ink-faint tnum",children:[z,"/",A.questions.length," answered"]})]})]})},A.id)}),d.jsx("li",{className:"relative",children:d.jsxs("button",{onClick:D,className:`group flex w-full items-center gap-3.5 py-2 text-left text-sm transition-colors ${w?"text-ember-bright":"text-ember hover:text-ember-bright"}`,children:[d.jsx("span",{className:`z-[1] flex h-6 w-6 flex-none items-center justify-center border font-mono text-xs transition-colors ${w?"border-ember bg-ember text-bg-deep":"border-ember-dim bg-bg text-ember"}`,children:"▸"}),d.jsx("span",{className:w?"font-medium":"",children:"Review"})]})})]}),d.jsx("div",{className:"min-w-0 flex-1",children:w?d.jsx(N1,{plan:S,generate:j,answers:c,onBack:()=>b(Math.max(0,_.length-1))}):_[y]?d.jsx(S1,{section:_[y],answers:c,set:C,onNext:()=>y+1<_.length?b(y+1):D(),isLast:y+1>=_.length},_[y].id):null})]})]})}function S1({section:l,answers:i,set:s,onNext:c,isLast:o}){return d.jsxs("div",{className:"page",children:[d.jsx("h2",{className:"font-display text-lg font-semibold text-ink",children:l.title}),d.jsx("div",{className:"mt-7 space-y-8",children:l.questions.map((f,m)=>d.jsx("div",{className:"rise",style:{"--i":m+1},children:d.jsx(j1,{q:f,value:i[f.id],onChange:v=>s(f.id,v)})},f.id))}),d.jsxs("button",{onClick:c,className:"btn-outline mt-10",children:[o?"Go to review":"Next section"," ",d.jsx("span",{"aria-hidden":!0,children:"→"})]})]})}function j1({q:l,value:i,onChange:s}){const c=i??l.default,o=F.useMemo(()=>l.type!=="multi"?new Set:new Set(Array.isArray(c)?c:[]),[l.type,c]);return d.jsxs("fieldset",{className:"min-w-0",children:[d.jsx("legend",{className:"text-sm font-medium text-ink",children:l.prompt}),d.jsx("div",{className:"mt-3",children:l.type==="bool"?d.jsx("div",{className:"flex gap-2",children:[!0,!1].map(f=>d.jsx("button",{onClick:()=>s(f),"data-on":c===f,className:"chip",children:f?"yes":"no"},String(f)))}):l.type==="text"?d.jsx("input",{type:"text",value:typeof c=="string"?c:"",onChange:f=>s(f.target.value),placeholder:"free text",className:"field w-full max-w-md"}):l.type==="list"?d.jsx(x1,{value:Array.isArray(c)?c:[],onChange:s}):d.jsx("div",{className:"flex flex-wrap gap-2",children:(l.options??[]).map(f=>{const m=l.type==="select"?c===f.value:o.has(f.value);return d.jsxs("button",{onClick:()=>{if(l.type==="select")s(f.value);else{const v=new Set(o);v.has(f.value)?v.delete(f.value):v.add(f.value),s([...v])}},"data-on":m,className:"chip",children:[m?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 font-mono text-[9px] align-middle",children:"■"}):null,f.label]},f.value)})})})]})}function N1({plan:l,generate:i,answers:s,onBack:c}){const o=Jn(),[f,m]=F.useState(""),v=ae({mutationFn:g=>bt.saveProfile(g,s),onSuccess:()=>{m(""),o.invalidateQueries({queryKey:["profiles"]})}});return i.isSuccess?d.jsxs("div",{className:"page max-w-[65ch]",children:[d.jsxs("h2",{className:"stamp font-display text-lg font-semibold text-sync",children:["■ ",i.data.created.length," artifacts in the store"]}),d.jsx("ul",{className:"mt-3 space-y-1",children:i.data.created.map((g,y)=>d.jsxs("li",{className:"rise font-mono text-sm text-ink-dim",style:{"--i":y},children:[d.jsx("span",{className:"mr-2 text-sync",children:"+"}),g]},g))}),d.jsx("p",{className:"mt-5 text-sm leading-relaxed text-ink-dim",children:"They are not installed anywhere yet — the pending-changes bar below will offer the gated sync, or review each file under Store first."})]}):d.jsxs("div",{className:"page max-w-[65ch]",children:[d.jsx("h2",{className:"font-display text-lg font-semibold text-ink",children:"Review"}),l.isPending?d.jsx("p",{className:"mt-3 text-sm text-ink-faint",children:"Planning…"}):l.isError?d.jsx("p",{className:"mt-3 text-sm text-danger",children:String(l.error)}):l.data?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"mt-3 text-sm text-ink-dim",children:["The builder will create"," ",d.jsx("span",{className:"tnum font-medium text-ink",children:l.data.create.length})," artifact",l.data.create.length===1?"":"s"," in the store:"]}),l.data.create.length>0?d.jsx("ul",{className:"mt-3 space-y-1 border-y border-line py-3",children:l.data.create.map((g,y)=>d.jsxs("li",{className:"rise font-mono text-sm text-ink",style:{"--i":y},children:[d.jsx("span",{className:"mr-2 text-sync",children:"+"}),g]},g))}):d.jsx("p",{className:"mt-2 font-mono text-sm text-ink-faint",children:"nothing — everything already exists"}),l.data.skip.length>0?d.jsxs("p",{className:"mt-3 font-mono text-xs text-ink-faint",children:["kept untouched (already exist): ",l.data.skip.join(" · ")]}):null,d.jsxs("div",{className:"mt-7 flex items-center gap-3",children:[d.jsx("button",{onClick:()=>i.mutate(),disabled:i.isPending||l.data.create.length===0,className:"btn-ember",children:i.isPending?"Writing…":`Write ${l.data.create.length} to store`}),d.jsx("button",{onClick:c,className:"px-2 py-1.5 text-sm text-ink-dim transition-colors hover:text-ink",children:"Back"}),i.isError?d.jsx("span",{className:"text-xs text-danger",children:String(i.error)}):null]}),d.jsxs("div",{className:"mt-10 border-t border-line pt-5",children:[d.jsx("h3",{className:"crate",children:"save these answers as a profile"}),d.jsx("p",{className:"mt-2 text-xs text-ink-faint",children:"Reuse this exact stack + conventions next time — for another repo, or share it with your team."}),d.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[d.jsx("input",{type:"text",value:f,onChange:g=>m(g.target.value),placeholder:"acme-frontend",className:"field w-48"}),d.jsx("button",{onClick:()=>v.mutate(f),disabled:v.isPending||f.trim()==="",className:"btn-ghost",children:v.isPending?"Saving…":"Save as profile"}),v.isSuccess?d.jsx("span",{className:"stamp text-xs text-sync",children:"■ saved"}):v.isError?d.jsx("span",{className:"text-xs text-danger",children:String(v.error)}):null]})]})]}):null]})}function E1(){const l=Jn(),i=ue({queryKey:["library"],queryFn:bt.libraryInstructions}),s=ue({queryKey:["library-groups"],queryFn:bt.libraryGroups}),[c,o]=F.useState(""),[f,m]=F.useState(""),[v,g]=F.useState(new Set),[y,b]=F.useState(""),p=ae({mutationFn:U=>bt.libraryAdd(U),onSuccess:()=>void l.invalidateQueries({queryKey:["library"]})}),S=ae({mutationFn:U=>bt.libraryRemove(U),onSuccess:()=>void l.invalidateQueries({queryKey:["library"]})}),j=ae({mutationFn:()=>bt.libraryGroupSave(y,[...v]),onSuccess:()=>{b(""),g(new Set),l.invalidateQueries({queryKey:["library-groups"]})}}),N=ae({mutationFn:U=>bt.libraryGroupRemove(U),onSuccess:()=>void l.invalidateQueries({queryKey:["library-groups"]})}),_=Df(),w=Df(),C=i.data??[],D=F.useMemo(()=>{const U=f.trim().toLowerCase();return U?C.filter(z=>z.text.toLowerCase().includes(U)):C},[C,f]);function G(U){g(z=>{const Y=new Set(z);return Y.has(U)?Y.delete(U):Y.add(U),Y})}function A(U){var z;return((z=C.find(Y=>Y.id===U))==null?void 0:z.text)??U}function q(){const U=c.trim();U!==""&&(p.mutate(U),o(""))}return d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / library",title:"Instruction library",sub:"Every custom instruction you've saved, in one place — search it, delete what's stale, and group entries so a whole set can be added to a wizard run in one click."}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("input",{type:"text",value:c,onChange:U=>o(U.target.value),onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),q())},placeholder:"add a new instruction, press Enter",className:"field w-full max-w-md"}),d.jsx("button",{type:"button",onClick:q,disabled:c.trim()==="",className:"btn-ghost",children:"Add"}),d.jsx("input",{type:"text",value:f,onChange:U=>m(U.target.value),placeholder:"search…",className:"field w-full max-w-xs"})]}),C.length===0?d.jsx("p",{className:"mt-6 text-sm text-ink-faint",children:"No saved instructions yet."}):D.length===0?d.jsxs("p",{className:"mt-6 text-sm text-ink-faint",children:['Nothing matches "',f,'".']}):d.jsx("ul",{className:"mt-4 space-y-1 border-y border-line py-2",children:D.map(U=>d.jsxs("li",{className:"flex items-start gap-3 py-1 font-mono text-sm text-ink",children:[d.jsx("span",{className:"min-w-0 flex-1 whitespace-normal break-words",children:U.text}),d.jsx("button",{type:"button",onClick:()=>{_.requestConfirm(U.id)&&S.mutate(U.id)},onBlur:()=>_.cancelIfArmed(U.id),"aria-label":_.confirmingId===U.id?`confirm delete ${U.text}`:`delete ${U.text}`,className:_.confirmingId===U.id?"shrink-0 font-medium text-danger":"shrink-0 text-xs text-ink-faint transition-colors hover:text-danger",children:_.confirmingId===U.id?"confirm ×":"×"})]},U.id))}),d.jsxs("section",{className:"mt-10 border-t border-line pt-6",children:[d.jsx("h2",{className:"crate",children:"create a group"}),d.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:"Select entries below, name the group, save it — then apply the whole set from the wizard in one click."}),C.length===0?d.jsx("p",{className:"mt-3 text-sm text-ink-faint",children:"Add some instructions first."}):d.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:D.map(U=>d.jsxs("button",{type:"button",onClick:()=>G(U.id),"data-on":v.has(U.id),className:"chip",children:[v.has(U.id)?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,U.text]},U.id))}),d.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[d.jsx("input",{type:"text",value:y,onChange:U=>b(U.target.value),placeholder:"group-name",className:"field w-48"}),d.jsx("button",{type:"button",onClick:()=>j.mutate(),disabled:j.isPending||y.trim()===""||v.size===0,className:"btn-ghost",children:j.isPending?"Saving…":`Save group (${v.size})`}),j.isError?d.jsx("span",{className:"text-xs text-danger",children:String(j.error)}):null]})]}),d.jsxs("section",{className:"mt-10 border-t border-line pt-6",children:[d.jsx("h2",{className:"crate",children:"groups"}),(s.data??[]).length===0?d.jsx("p",{className:"mt-2 text-sm text-ink-faint",children:"No groups yet."}):d.jsx("ul",{className:"mt-3 space-y-3",children:(s.data??[]).map(U=>d.jsxs("li",{className:"border border-line-strong bg-raised p-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("span",{className:"font-mono text-sm text-ink",children:[U.name," ",d.jsxs("span",{className:"text-ink-faint",children:["(",U.entryIds.length,")"]})]}),d.jsx("button",{type:"button",onClick:()=>{w.requestConfirm(U.name)&&N.mutate(U.name)},onBlur:()=>w.cancelIfArmed(U.name),"aria-label":w.confirmingId===U.name?`confirm delete group ${U.name}`:`delete group ${U.name}`,className:w.confirmingId===U.name?"shrink-0 font-medium text-danger":"shrink-0 text-xs text-ink-faint transition-colors hover:text-danger",children:w.confirmingId===U.name?"confirm ×":"×"})]}),d.jsx("ul",{className:"mt-2 space-y-1 font-mono text-xs text-ink-dim",children:U.entryIds.map(z=>d.jsx("li",{className:"break-words",children:A(z)},z))})]},U.name))})]})]})}function R1(){const l=ue({queryKey:["artifacts"],queryFn:bt.artifacts}),i=ue({queryKey:["profiles"],queryFn:bt.profiles}),s=ue({queryKey:["library"],queryFn:bt.libraryInstructions}),c=ue({queryKey:["library-groups"],queryFn:bt.libraryGroups}),[o,f]=F.useState(new Set),[m,v]=F.useState(new Set),[g,y]=F.useState(new Set),[b,p]=F.useState(!1),[S,j]=F.useState("archive"),[N,_]=F.useState(null),[w,C]=F.useState(!1),D=F.useMemo(()=>{const X=new Map;for(const tt of l.data??[]){const W=X.get(tt.kind)??[];W.push(tt),X.set(tt.kind,W)}return X},[l.data]);function G(X,tt,W){const at=new Set(X);at.has(W)?at.delete(W):at.add(W),tt(at)}function A(){return{artifactIds:[...o],profileNames:[...m],libraryEntryIds:[...g],sources:b}}const q=ae({mutationFn:()=>bt.bundleExportSelected(A()),onSuccess:X=>{const tt=URL.createObjectURL(X),W=document.createElement("a");W.href=tt,W.download="export.loadout.tar.gz",W.click(),URL.revokeObjectURL(tt)}}),U=ae({mutationFn:()=>bt.bundleExportFlat(A()),onSuccess:X=>{_(X.yaml),C(!1)}}),z=S==="flat"?U:q;async function Y(){N&&(await navigator.clipboard.writeText(N),C(!0))}function I(){if(!N)return;const X=URL.createObjectURL(new Blob([N],{type:"text/yaml"})),tt=document.createElement("a");tt.href=X,tt.download="export.loadout.yaml",tt.click(),URL.revokeObjectURL(X)}const $=o.size+m.size+g.size;return d.jsxs("div",{children:[d.jsx(jl,{crate:"armory / export",title:"Export a bundle",sub:"Pick exactly what to share — artifacts, profiles, custom instructions — then download a .loadout.tar.gz a teammate can import."}),d.jsxs("section",{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"crate",children:"artifacts"}),(l.data??[]).length>0?d.jsx("button",{type:"button",onClick:()=>f(new Set((l.data??[]).map(X=>X.id))),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"select all"}):null]}),[...D.entries()].map(([X,tt])=>d.jsxs("div",{className:"mt-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:X}),d.jsx("button",{type:"button",onClick:()=>{const W=new Set(o);tt.forEach(at=>W.add(at.id)),f(W)},className:"font-mono text-[10px] text-ink-faint transition-colors hover:text-ink",children:"select all"})]}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:tt.map(W=>d.jsxs("button",{type:"button",onClick:()=>G(o,f,W.id),"data-on":o.has(W.id),className:"chip",children:[o.has(W.id)?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,W.id]},W.id))})]},X)),l.data&&l.data.length===0?d.jsx("p",{className:"mt-3 text-sm text-ink-faint",children:"No artifacts in the store."}):null]}),d.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[d.jsx("h2",{className:"crate",children:"profiles"}),(i.data??[]).length===0?d.jsx("p",{className:"mt-2 text-sm text-ink-faint",children:"No saved profiles."}):d.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(i.data??[]).map(X=>d.jsxs("button",{type:"button",onClick:()=>G(m,v,X),"data-on":m.has(X),className:"chip",children:[m.has(X)?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,X]},X))})]}),d.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[d.jsx("h2",{className:"crate",children:"custom instructions"}),(s.data??[]).length===0?d.jsx("p",{className:"mt-2 text-sm text-ink-faint",children:"No saved instructions."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(s.data??[]).map(X=>d.jsxs("button",{type:"button",onClick:()=>G(g,y,X.id),"data-on":g.has(X.id),className:"chip",children:[g.has(X.id)?d.jsx("span",{"aria-hidden":!0,className:"mr-1.5 align-middle font-mono text-[9px]",children:"■"}):null,X.text]},X.id))}),(c.data??[]).length>0?d.jsxs("div",{className:"mt-3",children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-ink-faint",children:"groups"}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(c.data??[]).map(X=>d.jsxs("button",{type:"button",onClick:()=>{const tt=new Set(g);X.entryIds.forEach(W=>tt.add(W)),y(tt)},className:"chip",children:[X.name," (",X.entryIds.length,")"]},X.name))})]}):null]})]}),d.jsx("section",{className:"mt-8 border-t border-line pt-6",children:d.jsxs("label",{className:"flex items-center gap-2 text-sm text-ink-dim",children:[d.jsx("input",{type:"checkbox",checked:b,onChange:X=>p(X.target.checked)}),"Include tracked sources (sources.lock.yaml)"]})}),d.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[d.jsx("h2",{className:"crate",children:"format"}),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d.jsx("button",{type:"button",onClick:()=>{j("archive"),_(null)},"data-on":S==="archive",className:"chip",children:".tar.gz archive"}),d.jsx("button",{type:"button",onClick:()=>{j("flat"),_(null)},"data-on":S==="flat",className:"chip",children:"single YAML file"})]}),S==="flat"?d.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ink-dim",children:"One self-contained document — small enough to paste into a gist, a doc, or a chat."}):null]}),d.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[d.jsx("button",{type:"button",onClick:()=>z.mutate(),disabled:z.isPending||$===0,className:"btn-ember",children:z.isPending?"Exporting…":`Export ${$} item${$===1?"":"s"}`}),z.isError?d.jsx("span",{className:"text-xs text-danger",children:String(z.error)}):null,S==="archive"&&z.isSuccess?d.jsx("span",{className:"stamp text-xs text-sync",children:"■ downloaded"}):null]}),S==="flat"&&N?d.jsxs("div",{className:"rise mt-4 border border-line-strong bg-raised p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"font-display text-xs font-semibold uppercase tracking-wider text-ink-dim",children:"export.loadout.yaml"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{type:"button",onClick:()=>void Y(),className:"text-xs text-ink-faint transition-colors hover:text-ink",children:w?"copied ✓":"copy"}),d.jsx("button",{type:"button",onClick:I,className:"text-xs text-ink-faint transition-colors hover:text-ink",children:"download"})]})]}),d.jsx("textarea",{readOnly:!0,value:N,rows:16,className:"mt-3 w-full resize-y overflow-x-auto border border-line bg-bg-deep/60 p-4 font-mono text-xs leading-relaxed"})]}):null]})}const Hn=OS({component:e1}),_1=[Sa({getParentRoute:()=>Hn,path:"/",component:f1}),Sa({getParentRoute:()=>Hn,path:"/store",component:d1}),Sa({getParentRoute:()=>Hn,path:"/store/$artifactId",component:h1}),Sa({getParentRoute:()=>Hn,path:"/agents",component:m1}),Sa({getParentRoute:()=>Hn,path:"/sources",component:y1}),Sa({getParentRoute:()=>Hn,path:"/builder",component:b1}),Sa({getParentRoute:()=>Hn,path:"/library",component:E1}),Sa({getParentRoute:()=>Hn,path:"/export",component:R1})],T1=XS({routeTree:Hn.addChildren(_1)}),M1=new G0({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});g0.createRoot(document.getElementById("root")).render(d.jsx(F.StrictMode,{children:d.jsx(K0,{client:M1,children:d.jsx(JS,{router:T1})})})); diff --git a/internal/web/dist/index.html b/internal/web/dist/index.html index 898e41a..3b02913 100644 --- a/internal/web/dist/index.html +++ b/internal/web/dist/index.html @@ -6,8 +6,8 @@ loadout - - + +
diff --git a/internal/web/server.go b/internal/web/server.go index 141c577..d58c411 100644 --- a/internal/web/server.go +++ b/internal/web/server.go @@ -98,6 +98,7 @@ func (s *Server) routes() { s.mux.HandleFunc("POST /api/wizard/generate", s.handleWizardGenerate) s.mux.HandleFunc("GET /api/bundle/export", s.handleBundleExport) s.mux.HandleFunc("POST /api/bundle/export", s.handleBundleExportSelected) + s.mux.HandleFunc("POST /api/bundle/export/flat", s.handleBundleExportFlat) s.mux.HandleFunc("POST /api/bundle/import/plan", s.handleBundleImportPlan) s.mux.HandleFunc("POST /api/bundle/import/apply", s.handleBundleImportApply) s.mux.Handle("/", spaHandler()) @@ -672,11 +673,63 @@ func (s *Server) handleBundleExportSelected(w http.ResponseWriter, r *http.Reque http.ServeFile(w, r, tmp.Path) } +// handleBundleExportFlat renders a Selection as a single self-contained +// YAML document and returns it as JSON text (not a file download) — the +// primary use case is pasting it into a gist or a doc, not always saving a +// file. +func (s *Server) handleBundleExportFlat(w http.ResponseWriter, r *http.Request) { + var req struct { + ArtifactIDs []string `json:"artifactIds"` + ProfileNames []string `json:"profileNames"` + LibraryEntryIDs []string `json:"libraryEntryIds"` + Sources bool `json:"sources"` + } + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + writeErr(w, http.StatusBadRequest, fmt.Errorf("invalid request body: %w", err)) + return + } + sel := bundle.Selection{ + ArtifactIDs: req.ArtifactIDs, ProfileNames: req.ProfileNames, + LibraryEntryIDs: req.LibraryEntryIDs, Sources: req.Sources, + } + raw, err := bundle.ExportFlat(s.opts.Engine.Store, "loadout web", sel) + if err != nil { + writeErr(w, http.StatusBadRequest, err) + return + } + writeJSON(w, http.StatusOK, map[string]string{"yaml": string(raw)}) +} + // maxBundleUploadSize caps a bundle upload at 50MB, rejected before it is // buffered in full. const maxBundleUploadSize = 50 << 20 func (s *Server) handleBundleImportPlan(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.Header.Get("Content-Type"), "application/json") { + var req struct { + YAML string `json:"yaml"` + } + if err := json.NewDecoder(r.Body).Decode(&req); err != nil || strings.TrimSpace(req.YAML) == "" { + writeErr(w, http.StatusBadRequest, fmt.Errorf(`invalid request body: expected {"yaml": "..."}`)) + return + } + tmp, err := os.CreateTemp("", "loadout-upload-*.yaml") + if err != nil { + writeErr(w, http.StatusInternalServerError, err) + return + } + tempFile := tmp.Name() + if _, err := tmp.WriteString(req.YAML); err != nil { + tmp.Close() + _ = os.Remove(tempFile) + writeErr(w, http.StatusInternalServerError, err) + return + } + tmp.Close() + s.planBundleImport(w, tempFile) + return + } + r.Body = http.MaxBytesReader(w, r.Body, maxBundleUploadSize) if err := r.ParseMultipartForm(maxBundleUploadSize); err != nil { writeErr(w, http.StatusRequestEntityTooLarge, fmt.Errorf("upload too large or malformed (max %dMB): %w", maxBundleUploadSize>>20, err)) @@ -702,7 +755,14 @@ func (s *Server) handleBundleImportPlan(w http.ResponseWriter, r *http.Request) return } tmp.Close() + s.planBundleImport(w, tempFile) +} +// planBundleImport calls PlanImport on an already-materialized bundle file +// (a multipart upload or a paste-text flat YAML written to a temp file), +// stashes the plan under a token, and writes the plan JSON. Shared by both +// intake paths in handleBundleImportPlan. +func (s *Server) planBundleImport(w http.ResponseWriter, tempFile string) { plan, err := bundle.PlanImport(s.opts.Engine.Store, tempFile) if err != nil { _ = os.Remove(tempFile) @@ -742,6 +802,12 @@ func (s *Server) handleBundleImportPlan(w http.ResponseWriter, r *http.Request) if plan.NewLibraryEntries == nil { plan.NewLibraryEntries = []wizard.LibraryEntry{} } + if plan.NewGroups == nil { + plan.NewGroups = []string{} + } + if plan.ConflictGroups == nil { + plan.ConflictGroups = []string{} + } writeJSON(w, http.StatusOK, map[string]any{ "token": token, "meta": plan.Meta, @@ -752,6 +818,8 @@ func (s *Server) handleBundleImportPlan(w http.ResponseWriter, r *http.Request) "newProfiles": plan.NewProfiles, "conflictProfiles": plan.ConflictProfiles, "newLibraryEntries": plan.NewLibraryEntries, + "newGroups": plan.NewGroups, + "conflictGroups": plan.ConflictGroups, }) } @@ -780,6 +848,10 @@ func (s *Server) handleBundleImportApply(w http.ResponseWriter, r *http.Request) profilesAdded += len(pending.plan.ConflictProfiles) } libraryEntriesAdded := len(pending.plan.NewLibraryEntries) + groupsAdded := len(pending.plan.NewGroups) + if req.Overwrite { + groupsAdded += len(pending.plan.ConflictGroups) + } applied, err := bundle.Apply(s.opts.Engine.Store, pending.plan, req.Overwrite) if err != nil { writeErr(w, http.StatusInternalServerError, err) @@ -793,6 +865,7 @@ func (s *Server) handleBundleImportApply(w http.ResponseWriter, r *http.Request) "sourcesAdded": sourcesAdded, "profilesAdded": profilesAdded, "libraryEntriesAdded": libraryEntriesAdded, + "groupsAdded": groupsAdded, }) } diff --git a/internal/web/server_test.go b/internal/web/server_test.go index c699647..2084d64 100644 --- a/internal/web/server_test.go +++ b/internal/web/server_test.go @@ -494,6 +494,86 @@ func TestAPI_BundleExportSelected_UnknownArtifactRejected(t *testing.T) { } } +func TestAPI_BundleExportFlat(t *testing.T) { + srv, _ := newTestServer(t) + h := srv.Handler() + + body, _ := json.Marshal(map[string]any{"artifactIds": []string{"demo"}}) + req := httptest.NewRequest("POST", "/api/bundle/export/flat", bytes.NewReader(body)) + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if rec.Code != http.StatusOK { + t.Fatalf("export flat = %d: %s", rec.Code, rec.Body) + } + var got map[string]string + if err := json.Unmarshal(rec.Body.Bytes(), &got); err != nil { + t.Fatal(err) + } + if !strings.Contains(got["yaml"], "apiVersion: loadout-config/v1") { + t.Errorf("flat export missing apiVersion:\n%s", got["yaml"]) + } + if !strings.Contains(got["yaml"], "id: demo") { + t.Errorf("flat export missing the selected artifact:\n%s", got["yaml"]) + } +} + +func TestAPI_BundleImportPlan_AcceptsPasteYAML(t *testing.T) { + source, _ := newTestServer(t) // seeds "demo" + raw, err := bundle.ExportFlat(source.opts.Engine.Store, "test", bundle.Selection{ArtifactIDs: []string{"demo"}}) + if err != nil { + t.Fatal(err) + } + + // Import into a different, empty store — newTestServer's own store + // already has "demo" seeded, which would make this a no-op "identical" + // import instead of exercising the "new" path. + srv := newTestServerWithSources(t) + h := srv.Handler() + + body, _ := json.Marshal(map[string]string{"yaml": string(raw)}) + req := httptest.NewRequest("POST", "/api/bundle/import/plan", bytes.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if rec.Code != http.StatusOK { + t.Fatalf("import plan (paste YAML) = %d: %s", rec.Code, rec.Body) + } + var out map[string]any + if err := json.Unmarshal(rec.Body.Bytes(), &out); err != nil { + t.Fatal(err) + } + token, _ := out["token"].(string) + if token == "" { + t.Fatal("expected a plan token") + } + newArtifacts, _ := out["new"].([]any) + if len(newArtifacts) != 1 { + t.Fatalf("plan.new = %v, want one artifact", out["new"]) + } + + applyBody, _ := json.Marshal(map[string]any{"token": token}) + applyReq := httptest.NewRequest("POST", "/api/bundle/import/apply", bytes.NewReader(applyBody)) + applyRec := httptest.NewRecorder() + h.ServeHTTP(applyRec, applyReq) + if applyRec.Code != http.StatusOK { + t.Fatalf("import apply (paste YAML plan) = %d: %s", applyRec.Code, applyRec.Body) + } +} + +func TestAPI_BundleImportPlan_RejectsEmptyPasteYAML(t *testing.T) { + srv, _ := newTestServer(t) + h := srv.Handler() + + body, _ := json.Marshal(map[string]string{"yaml": " "}) + req := httptest.NewRequest("POST", "/api/bundle/import/plan", bytes.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if rec.Code != http.StatusBadRequest { + t.Fatalf("import plan with empty yaml = %d, want 400", rec.Code) + } +} + func TestSPA_FallbackServesIndexForClientRoutes(t *testing.T) { srv, _ := newTestServer(t) for _, path := range []string{"/", "/agents", "/store/some-artifact"} { diff --git a/web/src/api.ts b/web/src/api.ts index 7d00e08..1ddbda1 100644 --- a/web/src/api.ts +++ b/web/src/api.ts @@ -184,11 +184,18 @@ export const api = { request<{ removed: boolean }>(`/api/library/groups/${name}`, { method: "DELETE" }), bundleExportSelected: (sel: ExportSelection) => requestBlob("/api/bundle/export", { method: "POST", body: JSON.stringify(sel) }), + bundleExportFlat: (sel: ExportSelection) => + request<{ yaml: string }>("/api/bundle/export/flat", { method: "POST", body: JSON.stringify(sel) }), bundleImportPlan: (file: File) => { const form = new FormData(); form.set("bundle", file); return requestUpload("/api/bundle/import/plan", form); }, + bundleImportPlanYAML: (yaml: string) => + request("/api/bundle/import/plan", { + method: "POST", + body: JSON.stringify({ yaml }), + }), bundleImportApply: (token: string, overwrite: boolean) => request("/api/bundle/import/apply", { method: "POST", diff --git a/web/src/components/BundleImport.test.tsx b/web/src/components/BundleImport.test.tsx index 2ba2a07..bd6c251 100644 --- a/web/src/components/BundleImport.test.tsx +++ b/web/src/components/BundleImport.test.tsx @@ -1,10 +1,12 @@ -import { describe, expect, it, vi } from "vitest"; -import { render, screen, waitFor } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import { cleanup, render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { BundleImport } from "./BundleImport"; import { api, type BundleImportPlan } from "../api"; +afterEach(cleanup); + vi.mock("../api", async () => { const actual = await vi.importActual("../api"); return { @@ -12,6 +14,7 @@ vi.mock("../api", async () => { api: { ...actual.api, bundleImportPlan: vi.fn(), + bundleImportPlanYAML: vi.fn(), bundleImportApply: vi.fn(), }, }; @@ -82,4 +85,28 @@ describe("BundleImport", () => { expect(screen.getByText("extra")).toBeInTheDocument(); expect(screen.getByText("Import 1")).toBeInTheDocument(); }); + + it("switches to the paste-YAML tab and reviews a pasted document", async () => { + vi.mocked(api.bundleImportPlanYAML).mockResolvedValue(samplePlan); + renderWithClient(); + + await userEvent.click(screen.getByText("paste YAML")); + expect(screen.queryByText("Choose bundle…")).not.toBeInTheDocument(); + + await userEvent.type( + screen.getByPlaceholderText(/Paste a loadout-config\/v1 YAML document/), + "apiVersion: loadout-config/v1", + ); + await userEvent.click(screen.getByText("Review")); + + await waitFor(() => expect(screen.getByText(/team-kit/)).toBeInTheDocument()); + expect(api.bundleImportPlanYAML).toHaveBeenCalledWith("apiVersion: loadout-config/v1"); + }); + + it("the Review button is disabled until something is pasted", async () => { + renderWithClient(); + await userEvent.click(screen.getByText("paste YAML")); + + expect(screen.getByText("Review")).toBeDisabled(); + }); }); diff --git a/web/src/components/BundleImport.tsx b/web/src/components/BundleImport.tsx index 14c3c89..fb25359 100644 --- a/web/src/components/BundleImport.tsx +++ b/web/src/components/BundleImport.tsx @@ -2,10 +2,11 @@ import { useRef, useState } from "react"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { api, type BundleImportPlan, type BundleImportResult } from "../api"; -// The receiving half of "share": pick a teammate's .loadout.tar.gz, review -// the merge plan (new / conflicting / identical / sources), choose a -// conflict policy, then confirm — mirrors SyncDock's plan → apply ritual, -// just fed by an uploaded file instead of the local diff. +// The receiving half of "share": pick a teammate's .loadout.tar.gz or paste +// a single-file YAML export, review the merge plan (new / conflicting / +// identical / sources), choose a conflict policy, then confirm — mirrors +// SyncDock's plan → apply ritual, just fed by an uploaded file or pasted +// text instead of the local diff. export function BundleImport() { const queryClient = useQueryClient(); const fileInput = useRef(null); @@ -13,6 +14,8 @@ export function BundleImport() { const [plan, setPlan] = useState(null); const [overwrite, setOverwrite] = useState(false); const [result, setResult] = useState(null); + const [intake, setIntake] = useState<"file" | "paste">("file"); + const [pastedYaml, setPastedYaml] = useState(""); const planMutation = useMutation({ mutationFn: (file: File) => api.bundleImportPlan(file), @@ -22,12 +25,21 @@ export function BundleImport() { setResult(null); }, }); + const planYamlMutation = useMutation({ + mutationFn: (yaml: string) => api.bundleImportPlanYAML(yaml), + onSuccess: (p) => { + setPlan(p); + setOverwrite(false); + setResult(null); + }, + }); const applyMutation = useMutation({ mutationFn: () => api.bundleImportApply(plan!.token, overwrite), onSuccess: (res) => { setResult(res); setPlan(null); setFileName(null); + setPastedYaml(""); if (fileInput.current) fileInput.current.value = ""; void queryClient.invalidateQueries(); }, @@ -43,14 +55,28 @@ export function BundleImport() { planMutation.mutate(file); } + function reviewPastedYaml() { + if (!pastedYaml.trim()) return; + setResult(null); + planYamlMutation.mutate(pastedYaml); + } + + function cancelPlan() { + setPlan(null); + setFileName(null); + setPastedYaml(""); + if (fileInput.current) fileInput.current.value = ""; + } + return (

Import a bundle

- Received a .loadout.tar.gz from a - teammate? Upload it here to review and merge it into this store. + Received a .loadout.tar.gz or a single + YAML export from a teammate? Upload the file or paste the YAML here to review and merge it + into this store.

{result ? ( @@ -131,11 +157,7 @@ export function BundleImport() { {applyMutation.isPending ? "Importing…" : `Import ${changes}`}
) : ( -
- - {planMutation.isPending ? ( - Reviewing… - ) : planMutation.isError ? ( - {String(planMutation.error)} - ) : null} +
+
+ + +
+ + {intake === "file" ? ( +
+ + {planMutation.isPending ? ( + Reviewing… + ) : planMutation.isError ? ( + {String(planMutation.error)} + ) : null} +
+ ) : ( +
+