From bbcf10e999f1adf4bc464369aa549116a6648e59 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 20:05:55 +0530 Subject: [PATCH 01/25] EC2 VMs: runner image, QEMU command line, cloud-init seed and pinned cloud image catalog --- cli/internal/runtime/docker.go | 48 ++-- cli/internal/runtime/netns.go | 18 +- cli/internal/runtime/oneshot.go | 34 +++ cli/internal/svc/ec2/vm/hc-vm-ctl | 5 + cli/internal/svc/ec2/vm/hc-vm-fetch | 21 ++ cli/internal/svc/ec2/vm/hc-vm-run | 51 +++++ cli/internal/svc/ec2/vm/images.go | 96 ++++++++ cli/internal/svc/ec2/vm/qemu.go | 78 +++++++ cli/internal/svc/ec2/vm/runner.Dockerfile | 19 ++ cli/internal/svc/ec2/vm/seed.go | 62 ++++++ cli/internal/svc/ec2/vm/vm.go | 99 +++++++++ cli/internal/svc/ec2/vm/vm_test.go | 253 ++++++++++++++++++++++ 12 files changed, 758 insertions(+), 26 deletions(-) create mode 100644 cli/internal/runtime/oneshot.go create mode 100644 cli/internal/svc/ec2/vm/hc-vm-ctl create mode 100644 cli/internal/svc/ec2/vm/hc-vm-fetch create mode 100644 cli/internal/svc/ec2/vm/hc-vm-run create mode 100644 cli/internal/svc/ec2/vm/images.go create mode 100644 cli/internal/svc/ec2/vm/qemu.go create mode 100644 cli/internal/svc/ec2/vm/runner.Dockerfile create mode 100644 cli/internal/svc/ec2/vm/seed.go create mode 100644 cli/internal/svc/ec2/vm/vm.go create mode 100644 cli/internal/svc/ec2/vm/vm_test.go diff --git a/cli/internal/runtime/docker.go b/cli/internal/runtime/docker.go index 9098a603..dab2408d 100644 --- a/cli/internal/runtime/docker.go +++ b/cli/internal/runtime/docker.go @@ -74,27 +74,29 @@ type Mount struct { } type RunSpec struct { - Name string - Image string - Cmd []string - Entrypoint []string - Env map[string]string - Labels map[string]string - NanoCPUs int64 - MemoryMB int64 - Ports []Port - Mounts []Mount - Network string - IP string - Aliases []string - Restart string // "", "unless-stopped", "always" - WorkingDir string - User string // run as this user (e.g. "0"); empty uses the image's default - Hostname string - DNS []string // upstream servers for Docker's embedded DNS - ExtraHosts []string // "name:ip" entries for /etc/hosts ("host-gateway" is the Docker host) - CapAdd []string // extra Linux capabilities (e.g. NET_ADMIN) - Start bool + Name string + Image string + Cmd []string + Entrypoint []string + Env map[string]string + Labels map[string]string + NanoCPUs int64 + MemoryMB int64 + Ports []Port + Mounts []Mount + Network string + IP string + Aliases []string + Restart string // "", "unless-stopped", "always" + WorkingDir string + User string // run as this user (e.g. "0"); empty uses the image's default + Hostname string + DNS []string // upstream servers for Docker's embedded DNS + ExtraHosts []string // "name:ip" entries for /etc/hosts ("host-gateway" is the Docker host) + CapAdd []string // extra Linux capabilities (e.g. NET_ADMIN) + Devices []string // host devices passed through (e.g. /dev/kvm) + SecurityOpt []string // e.g. seccomp=unconfined + Start bool } // HostAlias makes the Docker host reachable from containers as host.docker.internal @@ -159,6 +161,10 @@ func (d *Docker) Run(ctx context.Context, s RunSpec) (string, error) { hc.CPUPeriod, hc.CPUQuota = 100000, s.NanoCPUs/10000 } hc.CapAdd = s.CapAdd + hc.SecurityOpt = s.SecurityOpt + for _, dev := range s.Devices { + hc.Devices = append(hc.Devices, docker.Device{PathOnHost: dev, PathInContainer: dev, CgroupPermissions: "rwm"}) + } if s.Restart != "" { hc.RestartPolicy = docker.RestartPolicy{Name: s.Restart} } diff --git a/cli/internal/runtime/netns.go b/cli/internal/runtime/netns.go index f44b8042..e3024273 100644 --- a/cli/internal/runtime/netns.go +++ b/cli/internal/runtime/netns.go @@ -14,16 +14,24 @@ import ( // BuildImage builds tag from a single Dockerfile unless the image already exists. func (d *Docker) BuildImage(ctx context.Context, tag, dockerfile string) error { + return d.BuildImageFiles(ctx, tag, map[string][]byte{"Dockerfile": []byte(dockerfile)}) +} + +// BuildImageFiles builds tag from a build context (path -> content, including +// the Dockerfile) unless the image already exists. +func (d *Docker) BuildImageFiles(ctx context.Context, tag string, files map[string][]byte) error { if _, err := d.C.InspectImage(tag); err == nil { return nil } var buf bytes.Buffer tw := tar.NewWriter(&buf) - if err := tw.WriteHeader(&tar.Header{Name: "Dockerfile", Mode: 0o644, Size: int64(len(dockerfile)), ModTime: time.Now()}); err != nil { - return err - } - if _, err := tw.Write([]byte(dockerfile)); err != nil { - return err + for name, content := range files { + if err := tw.WriteHeader(&tar.Header{Name: name, Mode: 0o644, Size: int64(len(content)), ModTime: time.Now()}); err != nil { + return err + } + if _, err := tw.Write(content); err != nil { + return err + } } if err := tw.Close(); err != nil { return err diff --git a/cli/internal/runtime/oneshot.go b/cli/internal/runtime/oneshot.go new file mode 100644 index 00000000..d684b2c8 --- /dev/null +++ b/cli/internal/runtime/oneshot.go @@ -0,0 +1,34 @@ +package runtime + +import ( + "context" + "fmt" + "strings" + "time" +) + +// RunOnce runs a short-lived container to completion and returns its output. +// A non-zero exit is an error (with the output in it). The container is removed. +func (d *Docker) RunOnce(ctx context.Context, s RunSpec) (string, error) { + s.Start = false + if s.Labels == nil { + s.Labels = Labels("ec2", "helper", nil) + } + id, err := d.Run(ctx, s) + if err != nil { + return "", err + } + defer func() { _ = d.Remove(id) }() + if err := d.C.StartContainerWithContext(id, nil, ctx); err != nil { + return "", fmt.Errorf("start container: %w", err) + } + code, err := d.C.WaitContainerWithContext(id, ctx) + out, _ := d.Logs(id, 200, time.Time{}) + if err != nil { + return out, err + } + if code != 0 { + return out, fmt.Errorf("exit %d: %s", code, strings.TrimSpace(out)) + } + return out, nil +} diff --git a/cli/internal/svc/ec2/vm/hc-vm-ctl b/cli/internal/svc/ec2/vm/hc-vm-ctl new file mode 100644 index 00000000..e47413ab --- /dev/null +++ b/cli/internal/svc/ec2/vm/hc-vm-ctl @@ -0,0 +1,5 @@ +#!/bin/sh +# Sends QMP commands to the VM's QEMU: hc-vm-ctl system_powerdown|system_reset|quit +set -eu +[ -S /run/qmp.sock ] || { echo "the virtual machine is not running" >&2; exit 1; } +printf '{"execute":"qmp_capabilities"}\n{"execute":"%s"}\n' "$1" | socat -t 2 - UNIX-CONNECT:/run/qmp.sock diff --git a/cli/internal/svc/ec2/vm/hc-vm-fetch b/cli/internal/svc/ec2/vm/hc-vm-fetch new file mode 100644 index 00000000..08034267 --- /dev/null +++ b/cli/internal/svc/ec2/vm/hc-vm-fetch @@ -0,0 +1,21 @@ +#!/bin/sh +# Downloads a cloud image into the image cache and verifies its checksum. +# hc-vm-fetch +# The file appears in /images only once it is complete and verified. +set -eu +url=$1; file=$2; sum=$3 +dest=/images/$file +[ -f "$dest" ] && exit 0 +tmp=$dest.part +curl -fSL --retry 3 --retry-delay 5 --connect-timeout 30 -o "$tmp" "$url" +case ${#sum} in + 64) got=$(sha256sum "$tmp" | cut -d' ' -f1) ;; + 128) got=$(sha512sum "$tmp" | cut -d' ' -f1) ;; + *) echo "unsupported checksum length" >&2; rm -f "$tmp"; exit 2 ;; +esac +if [ "$got" != "$sum" ]; then + echo "checksum mismatch for $url: expected $sum, got $got" >&2 + rm -f "$tmp" + exit 3 +fi +mv "$tmp" "$dest" diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run new file mode 100644 index 00000000..95a3f3c7 --- /dev/null +++ b/cli/internal/svc/ec2/vm/hc-vm-run @@ -0,0 +1,51 @@ +#!/bin/sh +# Entrypoint of a VM container: prepares the instance's disk, the cloud-init +# seed and the guest's network (passt), then becomes QEMU. +# +# /images image cache volume (read-only): the base cloud images +# /vm the instance's disk volume: disk.qcow2, seed.iso, efivars.fd +# /hc/seed cloud-init NoCloud files, written by HomeCloud before the first start +# +# Environment: HC_VM_BASE (file in /images), HC_VM_DISK_GB, HC_VM_ARCH +# (aarch64|x86_64), HC_VM_DNS (comma separated resolvers for the guest). +# The arguments are the QEMU command line. +set -eu + +disk=/vm/disk.qcow2 +if [ ! -f "$disk" ]; then + echo "[homecloud] creating disk ($HC_VM_DISK_GB GiB) from $HC_VM_BASE" + qemu-img create -q -f qcow2 -b "/images/$HC_VM_BASE" -F qcow2 "$disk.tmp" "${HC_VM_DISK_GB}G" + mv "$disk.tmp" "$disk" +fi + +# The seed is rebuilt on every start so changed user data applies to the next boot. +if [ -d /hc/seed ]; then + rm -f /vm/seed.iso + genisoimage -quiet -output /vm/seed.iso -volid cidata -joliet -rock /hc/seed/* >/dev/null 2>&1 +fi + +if [ "$HC_VM_ARCH" = "aarch64" ] && [ ! -f /vm/efivars.fd ]; then + cp /usr/share/AAVMF/AAVMF_VARS.fd /vm/efivars.fd +fi + +# passt gives the guest this container's address, gateway and routes, and +# forwards every inbound TCP and UDP port to it. +# +# The guest resolves through HC_VM_DNS (the VPC's resolver address, base+2 as in +# AWS); passt relays those queries to Docker's resolver in this container's +# namespace (127.0.0.11), so names resolve as they do for container instances. +dns="" +if [ -n "${HC_VM_DNS:-}" ]; then dns="-D $HC_VM_DNS --dns-forward $HC_VM_DNS --dns-host 127.0.0.11"; fi +rm -f /run/passt.sock /run/qmp.sock +# shellcheck disable=SC2086 +passt -f -s /run/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & +n=0 +while [ ! -S /run/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done +if [ ! -S /run/passt.sock ]; then + echo "[homecloud] passt did not start:" >&2 + cat /run/passt.log >&2 + exit 1 +fi + +echo "[homecloud] starting the virtual machine" +exec "$@" diff --git a/cli/internal/svc/ec2/vm/images.go b/cli/internal/svc/ec2/vm/images.go new file mode 100644 index 00000000..f5bb8171 --- /dev/null +++ b/cli/internal/svc/ec2/vm/images.go @@ -0,0 +1,96 @@ +package vm + +import ( + "fmt" + "regexp" + "strings" +) + +// Base is an official cloud image, pinned to a release and verified by +// checksum after download. Bump the release, URLs and checksums together (the +// checksum files next to the images list them; ParseChecksums reads them and +// TestCatalogMatchesPublishedChecksums, with HC_TEST_NET=1, compares). +type Base struct { + Key string // stable key, used in cache file names + Release string + DefaultUser string + Files map[Arch]File +} + +// File is one architecture's image. +type File struct { + URL string + // Sum is the hex SHA-256 (64 digits) or SHA-512 (128 digits) of the file. + Sum string +} + +// Name of the image file in the cache: unique per release, architecture and content. +func (b Base) CacheName(a Arch) string { + f := b.Files[a] + return fmt.Sprintf("%s-%s-%s-%.12s.qcow2", b.Key, a.Deb(), b.Release, f.Sum) +} + +// For returns the image for an architecture. +func (b Base) For(a Arch) (File, error) { + f, ok := b.Files[a] + if !ok { + return File{}, fmt.Errorf("no %s image for %s", b.Key, a) + } + return f, nil +} + +// Bases are the VM images HomeCloud can launch, by key. +var Bases = map[string]Base{ + "ubuntu-24.04": { + Key: "ubuntu-24.04", Release: "20260926", DefaultUser: "ubuntu", + Files: map[Arch]File{ + ArchAArch64: { + URL: "https://cloud-images.ubuntu.com/releases/noble/release-20260926/ubuntu-24.04-server-cloudimg-arm64.img", + Sum: "1d6bffe64b848468ac97f821d369a4846d983de1800ccf6b5ec8853e85cefc55", + }, + ArchX8664: { + URL: "https://cloud-images.ubuntu.com/releases/noble/release-20260926/ubuntu-24.04-server-cloudimg-amd64.img", + Sum: "6a81c37564db9b1ee84e141922625e1d7c5b389b99bb3c572e0243607d5bb4d2", + }, + }, + }, + "debian-12": { + Key: "debian-12", Release: "20260923-2610", DefaultUser: "debian", + Files: map[Arch]File{ + ArchAArch64: { + URL: "https://cloud.debian.org/images/cloud/bookworm/20260923-2610/debian-12-genericcloud-arm64-20260923-2610.qcow2", + Sum: "89a752d5c7d8e88bee39a57d88d496cca574f7d1e8df5df7a169825435f99feb11ed13ab27ec7bee96fe1584be4ff9479358fbca6cc859efa109f4aba18724c8", + }, + ArchX8664: { + URL: "https://cloud.debian.org/images/cloud/bookworm/20260923-2610/debian-12-genericcloud-amd64-20260923-2610.qcow2", + Sum: "3d94c9dd66d8a283fde060b8810373b7ae04038b956ee00d553d1ae564f6fbdeaa2fd6e7404e87e53348b5a9509170f3ea7c0731ba737590c5c4cb8d559a47f8", + }, + }, + }, +} + +var sumRE = regexp.MustCompile(`^(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{128})$`) + +// ValidSum reports whether s is a SHA-256 or SHA-512 hex digest. +func ValidSum(s string) bool { return sumRE.MatchString(s) } + +// ParseChecksums reads a SHA256SUMS or SHA512SUMS file (" " or +// " *", one per line; "# comments" and blank lines are skipped) +// into digests by file name. +func ParseChecksums(text string) (map[string]string, error) { + out := map[string]string{} + for n, line := range strings.Split(text, "\n") { + line = strings.TrimSpace(line) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + sum, name, ok := strings.Cut(line, " ") + name = strings.TrimSpace(name) + name = strings.TrimPrefix(name, "*") // binary mode marker + if !ok || name == "" || !ValidSum(sum) { + return nil, fmt.Errorf("checksums line %d: %q is not \" \"", n+1, line) + } + out[name] = strings.ToLower(sum) + } + return out, nil +} diff --git a/cli/internal/svc/ec2/vm/qemu.go b/cli/internal/svc/ec2/vm/qemu.go new file mode 100644 index 00000000..36d28a95 --- /dev/null +++ b/cli/internal/svc/ec2/vm/qemu.go @@ -0,0 +1,78 @@ +package vm + +import ( + "crypto/sha256" + "fmt" + "strconv" +) + +// Machine is a guest's hardware. +type Machine struct { + Name string // instance ID + Arch Arch + KVM bool // hardware acceleration; otherwise TCG emulation + VCPUs int + MemoryMB int64 +} + +// MAC is a stable, locally administered address derived from the instance ID. +func (m Machine) MAC() string { + sum := sha256.Sum256([]byte(m.Name)) + return fmt.Sprintf("52:54:00:%02x:%02x:%02x", sum[0], sum[1], sum[2]) +} + +// Args is the QEMU command line (without the binary). The runner's entrypoint +// prepares /vm/disk.qcow2, /vm/seed.iso, /vm/efivars.fd and the passt socket +// before it starts QEMU. +// +// The guest's serial console goes to QEMU's stdout, i.e. the container's log, +// which is what GetConsoleOutput returns. QMP listens on /run/qmp.sock for the +// power controls (hc-vm-ctl). +func (m Machine) Args() []string { + vcpus := max(1, m.VCPUs) + args := []string{ + "-name", m.Name, + "-nodefaults", "-no-user-config", + } + switch m.Arch { + case ArchAArch64: + args = append(args, "-machine", "virt,gic-version=max") + default: + args = append(args, "-machine", "q35") + } + if m.KVM { + args = append(args, "-accel", "kvm", "-cpu", "host") + } else if m.Arch == ArchAArch64 { + // pauth-impdef makes pointer authentication cheap to emulate. + args = append(args, "-accel", "tcg,thread=multi", "-cpu", "max,pauth-impdef=on") + } else { + args = append(args, "-accel", "tcg,thread=multi", "-cpu", "max") + } + args = append(args, "-smp", strconv.Itoa(vcpus), "-m", strconv.FormatInt(m.MemoryMB, 10)) + if m.Arch == ArchAArch64 { + args = append(args, + "-drive", "if=pflash,format=raw,unit=0,readonly=on,file=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd", + "-drive", "if=pflash,format=raw,unit=1,file="+DiskDir+"/efivars.fd", + ) + } + args = append(args, + // Root disk and the cloud-init seed (label cidata, found by NoCloud). + "-drive", "file="+DiskDir+"/disk.qcow2,if=none,id=root,format=qcow2", + "-device", "virtio-blk-pci,drive=root,bootindex=1", + "-drive", "file="+DiskDir+"/seed.iso,if=none,id=seed,format=raw,readonly=on", + "-device", "virtio-blk-pci,drive=seed", + // The NIC is wired to passt inside the container (see hc-vm-run). + "-netdev", "stream,id=net0,addr.type=unix,addr.path=/run/passt.sock,server=off", + "-device", "virtio-net-pci,netdev=net0,mac="+m.MAC()+",romfile=", + "-device", "virtio-rng-pci", + "-display", "none", "-monitor", "none", + "-chardev", "stdio,id=ser0,signal=off", "-serial", "chardev:ser0", + "-qmp", "unix:/run/qmp.sock,server=on,wait=off", + ) + return args +} + +// Command is the container command: the QEMU binary and its arguments. +func (m Machine) Command() []string { + return append([]string{m.Arch.QEMU()}, m.Args()...) +} diff --git a/cli/internal/svc/ec2/vm/runner.Dockerfile b/cli/internal/svc/ec2/vm/runner.Dockerfile new file mode 100644 index 00000000..f61df111 --- /dev/null +++ b/cli/internal/svc/ec2/vm/runner.Dockerfile @@ -0,0 +1,19 @@ +FROM debian:trixie-slim@sha256:a99cfc517144bc59b1978475ec53b46ecabec7e43635402ee5b77cc54cd1b20a +# The guest architecture is the Docker host's: aarch64 guests use UEFI (AAVMF) +# firmware, x86_64 guests use SeaBIOS (bundled with QEMU). +RUN set -eu; \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + arm64) pkgs="qemu-system-arm qemu-efi-aarch64" ;; \ + amd64) pkgs="qemu-system-x86" ;; \ + *) echo "unsupported architecture $arch" >&2; exit 1 ;; \ + esac; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + $pkgs qemu-utils passt genisoimage socat curl ca-certificates; \ + rm -rf /var/lib/apt/lists/* +COPY hc-vm-run /usr/local/bin/hc-vm-run +COPY hc-vm-fetch /usr/local/bin/hc-vm-fetch +COPY hc-vm-ctl /usr/local/bin/hc-vm-ctl +RUN chmod 0755 /usr/local/bin/hc-vm-* +ENTRYPOINT ["/usr/local/bin/hc-vm-run"] diff --git a/cli/internal/svc/ec2/vm/seed.go b/cli/internal/svc/ec2/vm/seed.go new file mode 100644 index 00000000..e06a5df8 --- /dev/null +++ b/cli/internal/svc/ec2/vm/seed.go @@ -0,0 +1,62 @@ +package vm + +import ( + "encoding/json" + "strings" +) + +// Seed is what cloud-init reads from the NoCloud datasource (an ISO with the +// label "cidata"). Guests can also reach the instance metadata service, but +// NoCloud comes first in the images' datasource lists, so cloud-init settles on +// the seed and never probes the network for a datasource. +type Seed struct { + InstanceID string + Hostname string + // PublicKey is authorized for the image's default user. + PublicKey string + // UserData is passed through untouched: a script (#!), a #cloud-config + // document or any other format cloud-init understands. + UserData string +} + +// Files returns the seed's files by name (meta-data, user-data). +func (s Seed) Files() map[string][]byte { + // JSON is valid YAML and quotes everything safely. + q := func(v string) string { b, _ := json.Marshal(v); return string(b) } + var meta strings.Builder + meta.WriteString("instance-id: " + q(s.InstanceID) + "\n") + meta.WriteString("local-hostname: " + q(s.Hostname) + "\n") + meta.WriteString("hostname: " + q(s.Hostname) + "\n") + if k := strings.TrimSpace(s.PublicKey); k != "" { + meta.WriteString("public-keys:\n - " + q(k) + "\n") + } + user := s.UserData + if strings.TrimSpace(user) == "" { + user = "#cloud-config\n{}\n" + } + return map[string][]byte{"meta-data": []byte(meta.String()), "user-data": []byte(user)} +} + +// ReadyMarkers are what the guest prints on its serial console when it is up. +var ( + // CloudInitDone is printed by cloud-init's final stage. + CloudInitDone = "finished at" + // LoginPrompt is what getty prints; it is the fallback for images + // without cloud-init. + LoginPrompt = " login: " +) + +// Ready inspects a boot's console output. done is true once cloud-init +// finished; prompt is true once a login prompt appeared (guests that never run +// cloud-init's final stage still get there). +func Ready(console string) (done, prompt bool) { + for _, line := range strings.Split(console, "\n") { + if strings.Contains(line, "Cloud-init v.") && strings.Contains(line, CloudInitDone) { + done = true + } + if strings.Contains(line, LoginPrompt) { + prompt = true + } + } + return done, prompt +} diff --git a/cli/internal/svc/ec2/vm/vm.go b/cli/internal/svc/ec2/vm/vm.go new file mode 100644 index 00000000..8fb9f951 --- /dev/null +++ b/cli/internal/svc/ec2/vm/vm.go @@ -0,0 +1,99 @@ +// Package vm holds what EC2 needs to run an instance as a virtual machine: +// the runner image (QEMU, passt and helper scripts, built locally), the +// cloud image catalog, the QEMU command line and the cloud-init seed. It has no +// dependency on the rest of HomeCloud so each piece can be tested on its own. +// +// A VM instance is a QEMU process inside a Docker container (the "VM +// container") attached to the instance's VPC network with its private +// address, so everything that works per container keeps working: addresses, +// DNS, the metadata service, security groups and published ports. passt gives +// the guest the container's address, gateway and routes and forwards every +// inbound port to it. +package vm + +import ( + "crypto/sha256" + _ "embed" + "encoding/hex" + "fmt" + "sort" +) + +// Arch is the guest architecture, which is the Docker host's. +type Arch string + +const ( + ArchAArch64 Arch = "aarch64" + ArchX8664 Arch = "x86_64" +) + +// ArchOf maps a Docker or EC2 architecture name to a guest architecture. +func ArchOf(name string) (Arch, error) { + switch name { + case "aarch64", "arm64": + return ArchAArch64, nil + case "x86_64", "amd64": + return ArchX8664, nil + } + return "", fmt.Errorf("virtual machines are not supported on %q hosts (need aarch64 or x86_64)", name) +} + +// Cloud image file names use Debian-style architecture names. +func (a Arch) Deb() string { + if a == ArchAArch64 { + return "arm64" + } + return "amd64" +} + +// QEMU is the qemu-system binary for the architecture. +func (a Arch) QEMU() string { return "qemu-system-" + string(a) } + +//go:embed runner.Dockerfile +var runnerDockerfile string + +//go:embed hc-vm-run +var runScript string + +//go:embed hc-vm-fetch +var fetchScript string + +//go:embed hc-vm-ctl +var ctlScript string + +// RunnerContext is the build context of the runner image. +func RunnerContext() map[string][]byte { + return map[string][]byte{ + "Dockerfile": []byte(runnerDockerfile), + "hc-vm-run": []byte(runScript), + "hc-vm-fetch": []byte(fetchScript), + "hc-vm-ctl": []byte(ctlScript), + } +} + +// RunnerTag names the runner image by the hash of its build context, so a +// change to the Dockerfile or scripts builds a new image. +func RunnerTag() string { + files := RunnerContext() + names := make([]string, 0, len(files)) + for n := range files { + names = append(names, n) + } + sort.Strings(names) + h := sha256.New() + for _, n := range names { + fmt.Fprintf(h, "%s\x00%d\x00", n, len(files[n])) + h.Write(files[n]) + } + return "homecloud/vm-runner:" + hex.EncodeToString(h.Sum(nil))[:12] +} + +// Paths inside the VM container. +const ( + ImagesDir = "/images" // image cache volume (read-only) + DiskDir = "/vm" // the instance's root volume + SeedDir = "/hc/seed" // cloud-init NoCloud files +) + +// MinRootGB is the smallest root disk: it must hold the cloud image. +const MinRootGB = 4 diff --git a/cli/internal/svc/ec2/vm/vm_test.go b/cli/internal/svc/ec2/vm/vm_test.go new file mode 100644 index 00000000..e5a8265f --- /dev/null +++ b/cli/internal/svc/ec2/vm/vm_test.go @@ -0,0 +1,253 @@ +package vm + +import ( + "io" + "net/http" + "os" + "path" + "strings" + "testing" + "time" +) + +func joined(args []string) string { return strings.Join(args, " ") } + +func TestQEMUAArch64Emulated(t *testing.T) { + m := Machine{Name: "i-0abc", Arch: ArchAArch64, VCPUs: 2, MemoryMB: 4096} + c := m.Command() + if c[0] != "qemu-system-aarch64" { + t.Fatalf("binary %q", c[0]) + } + s := joined(c) + for _, want := range []string{ + "-machine virt,gic-version=max", + "-accel tcg,thread=multi -cpu max,pauth-impdef=on", + "-smp 2 -m 4096", + "if=pflash,format=raw,unit=0,readonly=on,file=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd", + "if=pflash,format=raw,unit=1,file=/vm/efivars.fd", + "file=/vm/disk.qcow2,if=none,id=root,format=qcow2", + "virtio-blk-pci,drive=root,bootindex=1", + "file=/vm/seed.iso,if=none,id=seed,format=raw,readonly=on", + "-netdev stream,id=net0,addr.type=unix,addr.path=/run/passt.sock,server=off", + "virtio-net-pci,netdev=net0,mac=" + m.MAC(), + "-chardev stdio,id=ser0,signal=off -serial chardev:ser0", + "-qmp unix:/run/qmp.sock,server=on,wait=off", + "-nodefaults", + } { + if !strings.Contains(s, want) { + t.Errorf("command line lacks %q:\n%s", want, s) + } + } + if strings.Contains(s, "kvm") { + t.Errorf("emulated machine mentions kvm: %s", s) + } +} + +func TestQEMUX86KVM(t *testing.T) { + m := Machine{Name: "i-1", Arch: ArchX8664, KVM: true, VCPUs: 4, MemoryMB: 16384} + c := m.Command() + if c[0] != "qemu-system-x86_64" { + t.Fatalf("binary %q", c[0]) + } + s := joined(c) + for _, want := range []string{"-machine q35", "-accel kvm -cpu host", "-smp 4 -m 16384"} { + if !strings.Contains(s, want) { + t.Errorf("command line lacks %q:\n%s", want, s) + } + } + if strings.Contains(s, "pflash") || strings.Contains(s, "tcg") { + t.Errorf("x86 KVM machine has firmware drives or TCG: %s", s) + } +} + +func TestQEMUDefaultsAndMAC(t *testing.T) { + // Fractional instance types round up to a vCPU in the caller; zero must not produce -smp 0. + if s := joined(Machine{Name: "a", Arch: ArchX8664, MemoryMB: 512}.Args()); !strings.Contains(s, "-smp 1 ") { + t.Errorf("no vCPU count: %s", s) + } + a, b := Machine{Name: "i-a"}.MAC(), Machine{Name: "i-b"}.MAC() + if a == b || a != (Machine{Name: "i-a"}).MAC() { + t.Errorf("MAC not stable per instance: %s %s", a, b) + } + if !strings.HasPrefix(a, "52:54:00:") || len(a) != 17 { + t.Errorf("MAC %q", a) + } +} + +func TestSeedFiles(t *testing.T) { + f := Seed{InstanceID: "i-0abc", Hostname: "ip-10-0-1-5", PublicKey: "ssh-ed25519 AAAA test\n", UserData: "#!/bin/sh\necho hi\n"}.Files() + meta := string(f["meta-data"]) + for _, want := range []string{ + `instance-id: "i-0abc"`, `local-hostname: "ip-10-0-1-5"`, `hostname: "ip-10-0-1-5"`, + "public-keys:\n - \"ssh-ed25519 AAAA test\"\n", + } { + if !strings.Contains(meta, want) { + t.Errorf("meta-data lacks %q:\n%s", want, meta) + } + } + if string(f["user-data"]) != "#!/bin/sh\necho hi\n" { + t.Errorf("user data changed: %q", f["user-data"]) + } + // #cloud-config passes through too. + cc := "#cloud-config\nwrite_files:\n- path: /x\n content: y\n" + if got := string(Seed{UserData: cc}.Files()["user-data"]); got != cc { + t.Errorf("cloud-config changed: %q", got) + } +} + +func TestSeedWithoutKeyOrUserData(t *testing.T) { + f := Seed{InstanceID: "i-1", Hostname: "h"}.Files() + if strings.Contains(string(f["meta-data"]), "public-keys") { + t.Errorf("empty key produced public-keys:\n%s", f["meta-data"]) + } + if !strings.HasPrefix(string(f["user-data"]), "#cloud-config") { + t.Errorf("empty user data must still be a valid document: %q", f["user-data"]) + } + // A key with quotes cannot break the YAML. + m := string(Seed{InstanceID: "i", Hostname: "h", PublicKey: `ssh-rsa A"B\C x`}.Files()["meta-data"]) + if !strings.Contains(m, `"ssh-rsa A\"B\\C x"`) { + t.Errorf("key not escaped:\n%s", m) + } +} + +func TestReady(t *testing.T) { + boot := "[ 32.2] cloud-init[464]: Cloud-init v. 22.4.2 running 'modules:final' at Wed\n" + if d, p := Ready(boot); d || p { + t.Errorf("running is not ready: %v %v", d, p) + } + done := boot + "2026-09-30T14:31:25Z [ 32.8] cloud-init[464]: Cloud-init v. 22.4.2 finished at Wed, 30 Sep 2026 14:31:25 +0000. Datasource DataSourceNoCloud [seed=/dev/vdb][dsmode=net]. Up 32.80 seconds\n" + if d, _ := Ready(done); !d { + t.Error("finished marker not recognised") + } + if _, p := Ready("Debian GNU/Linux 12 exp1 ttyAMA0\n\nexp1 login: "); !p { + t.Error("login prompt not recognised") + } +} + +func TestRunnerTagFollowsContent(t *testing.T) { + a := RunnerTag() + if !strings.HasPrefix(a, "homecloud/vm-runner:") || len(a) != len("homecloud/vm-runner:")+12 { + t.Fatalf("tag %q", a) + } + if a != RunnerTag() { + t.Error("tag not stable") + } + old := runScript + runScript += "\n# changed\n" + defer func() { runScript = old }() + if RunnerTag() == a { + t.Error("tag did not change with the entrypoint") + } + ctx := RunnerContext() + for _, f := range []string{"Dockerfile", "hc-vm-run", "hc-vm-fetch", "hc-vm-ctl"} { + if len(ctx[f]) == 0 { + t.Errorf("build context lacks %s", f) + } + } + if !strings.Contains(runnerDockerfile, "@sha256:") { + t.Error("runner base image must be pinned by digest") + } +} + +func TestParseChecksums(t *testing.T) { + sha256 := strings.Repeat("ab", 32) + sha512 := strings.Repeat("cd", 64) + got, err := ParseChecksums("# header\n" + sha256 + " *ubuntu.img\n\n" + sha512 + " debian.qcow2\n" + strings.ToUpper(sha256) + " upper.img\n") + if err != nil { + t.Fatal(err) + } + if got["ubuntu.img"] != sha256 || got["debian.qcow2"] != sha512 || got["upper.img"] != sha256 || len(got) != 3 { + t.Errorf("parsed %v", got) + } + for _, bad := range []string{"zz file\n", sha256 + "\n", sha256[:60] + " file\n", sha256 + " \n"} { + if _, err := ParseChecksums(bad); err == nil { + t.Errorf("accepted %q", bad) + } + } +} + +func TestCatalogIsPinned(t *testing.T) { + for key, b := range Bases { + if b.Key != key || b.Release == "" || b.DefaultUser == "" { + t.Errorf("%s: incomplete %+v", key, b) + } + for _, arch := range []Arch{ArchAArch64, ArchX8664} { + f, err := b.For(arch) + if err != nil { + t.Errorf("%s: %v", key, err) + continue + } + if !strings.HasPrefix(f.URL, "https://") { + t.Errorf("%s/%s: URL %q is not https", key, arch, f.URL) + } + if !ValidSum(f.Sum) { + t.Errorf("%s/%s: checksum %q", key, arch, f.Sum) + } + if !strings.Contains(f.URL, "-"+arch.Deb()) { + t.Errorf("%s/%s: URL %q is for another architecture", key, arch, f.URL) + } + if !strings.Contains(f.URL, strings.TrimPrefix(b.Release, "release-")) { + t.Errorf("%s/%s: URL %q is not pinned to release %s", key, arch, f.URL, b.Release) + } + if n := b.CacheName(arch); !strings.HasSuffix(n, ".qcow2") || strings.ContainsAny(n, "/ ") { + t.Errorf("cache name %q", n) + } + } + if b.CacheName(ArchAArch64) == b.CacheName(ArchX8664) { + t.Errorf("%s: both architectures share a cache file", key) + } + } + if _, err := (Base{Key: "x"}).For(ArchX8664); err == nil { + t.Error("missing architecture accepted") + } +} + +func TestArchOf(t *testing.T) { + for in, want := range map[string]Arch{"arm64": ArchAArch64, "aarch64": ArchAArch64, "x86_64": ArchX8664, "amd64": ArchX8664} { + if got, err := ArchOf(in); err != nil || got != want { + t.Errorf("%s: %v %v", in, got, err) + } + } + if _, err := ArchOf("riscv64"); err == nil { + t.Error("riscv64 accepted") + } +} + +// TestCatalogMatchesPublishedChecksums compares the pinned checksums with the +// vendors' published files (a pin goes stale when a release is withdrawn). It +// needs the network: HC_TEST_NET=1. +func TestCatalogMatchesPublishedChecksums(t *testing.T) { + if os.Getenv("HC_TEST_NET") != "1" { + t.Skip("set HC_TEST_NET=1 to check the pinned checksums against the vendors' files") + } + c := http.Client{Timeout: time.Minute} + sums := map[string]map[string]string{} + for key, b := range Bases { + for arch, f := range b.Files { + dir := f.URL[:strings.LastIndex(f.URL, "/")+1] + file := path.Base(f.URL) + name := "SHA256SUMS" + if len(f.Sum) == 128 { + name = "SHA512SUMS" + } + if sums[dir+name] == nil { + resp, err := c.Get(dir + name) + if err != nil { + t.Fatal(err) + } + body, _ := io.ReadAll(resp.Body) + resp.Body.Close() + if resp.StatusCode != 200 { + t.Errorf("%s: %s", dir+name, resp.Status) + continue + } + if sums[dir+name], err = ParseChecksums(string(body)); err != nil { + t.Fatalf("%s: %v", dir+name, err) + } + } + if got := sums[dir+name][file]; got != f.Sum { + t.Errorf("%s/%s: pinned %s, published %q", key, arch, f.Sum, got) + } + } + } +} From 49b4ff929c1bbf676f31d6b60ccdafa6cf3d79f4 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 20:13:39 +0530 Subject: [PATCH 02/25] EC2: launch AMIs marked as VM images as QEMU virtual machines in a container on the VPC network --- .github/workflows/ci.yml | 26 + CHANGELOG.md | 8 + README.md | 17 +- cli/internal/svc/ec2/aws.go | 38 +- cli/internal/svc/ec2/catalog.go | 22 + cli/internal/svc/ec2/ec2.go | 126 +++-- cli/internal/svc/ec2/imds.go | 17 +- cli/internal/svc/ec2/sg_filter_live_test.go | 3 +- cli/internal/svc/ec2/terminal.go | 3 + cli/internal/svc/ec2/vm.go | 531 ++++++++++++++++++++ cli/internal/svc/ec2/vm_live_test.go | 372 ++++++++++++++ cli/internal/svc/ec2/volumes.go | 9 + docs/architecture.md | 17 +- docs/aws-compat.md | 3 +- 14 files changed, 1146 insertions(+), 46 deletions(-) create mode 100644 cli/internal/svc/ec2/vm.go create mode 100644 cli/internal/svc/ec2/vm_live_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54fee7b5..94929a68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,32 @@ jobs: GOOS=${p%/*} GOARCH=${p#*/} CGO_ENABLED=0 go build -o /dev/null . done + vm: + # Boots a real virtual machine (the Ubuntu cloud image under QEMU/KVM inside a + # Docker container) through the EC2 API and checks SSH, cloud-init user data, + # the metadata service, stop/start, security groups and cleanup. Only this + # test runs here; the rest of the suite is in the go job. + runs-on: ubuntu-latest + timeout-minutes: 45 + defaults: + run: + working-directory: cli + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: cli/go.mod + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + ls -l /dev/kvm + - name: VM instances + run: go test -count=1 -timeout 40m -v -run 'TestVMInstanceLifecycle' ./internal/svc/ec2 + env: + HC_TEST_VM: "1" + console: runs-on: ubuntu-latest defaults: diff --git a/CHANGELOG.md b/CHANGELOG.md index b1b374e6..e50357b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +### EC2 +- VM instances: `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` boot the official cloud image as a QEMU virtual machine with its own kernel, systemd and cloud-init. The VM runs inside a container attached to the instance's VPC network with its private IP, so DNS, the metadata service, security groups and published ports work as for container instances; passt gives the guest the container's address and forwards inbound ports. Key pairs, user data (scripts and `#cloud-config`), the root block device size, stop/start/reboot, console output and terminate work through the same EC2 API, CLI, console and Terraform. +- Guests use KVM when the Docker host has `/dev/kvm` and are emulated (slower) otherwise; instances report `virtualization: "kvm"` or `"emulated"`. `DescribeImages` and `DescribeInstances` report `Hypervisor: kvm` for VM images and instances. Cloud images are pinned to a release, verified by checksum and downloaded once into a Docker volume; the runner image is built locally on first use. +- Not available for VM instances yet: extra volumes, snapshots and images of VM disks, the browser terminal, run-command, CloudWatch metrics, backup. +- CI boots a VM with KVM on every change. + ## 0.3.0 (2026-09-30) Every service in the console now speaks the AWS protocols, security groups filter traffic inside a VPC, and there's a demo console on the website. diff --git a/README.md b/README.md index fb99f99b..0dd1d81c 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ A web console modeled on the one you know, with a page for every service. It is | Service | AWS equivalent | What you get | | --- | --- | --- | -| **Compute** | EC2, EBS, AMIs | Instances with CPU/memory limits from `t3.nano` to `r5.large`, 10 base images (Ubuntu, Debian, Amazon Linux, Rocky, Fedora, Alpine, …), user data, key pairs, start/stop/reboot/resize, volumes and snapshots, capture an instance as a new image, run-command, a shell in the browser, and an instance metadata service (IMDSv1/v2) that hands role credentials to SDKs inside instances | +| **Compute** | EC2, EBS, AMIs | Instances with CPU/memory limits from `t3.nano` to `r5.large`, 10 container images (Ubuntu, Debian, Amazon Linux, Rocky, Fedora, Alpine, …) and 2 **VM images** (Ubuntu 24.04 and Debian 12 cloud images booted as real virtual machines, see below), user data, key pairs, start/stop/reboot/resize, volumes and snapshots, capture an instance as a new image, run-command, a shell in the browser, and an instance metadata service (IMDSv1/v2) that hands role credentials to SDKs inside instances | | **Auto Scaling** | EC2 Auto Scaling | Groups that keep a desired number of instances across subnets, replace unhealthy ones, register them with load balancers and scale on CPU or memory targets | | **Shared files** | EFS | File systems that any number of instances mount at the same time | | **Containers** | ECS (Fargate), ECR | Versioned task definitions with secrets injected from Secrets Manager, services that keep N tasks running with rolling deployments and load-balancer registration, one-off tasks, and a private image registry you `docker push` to | @@ -94,6 +94,19 @@ A web console modeled on the one you know, with a page for every service. It is Everything runs as containers on Docker, labelled so HomeCloud never touches containers it didn't create. See **[docs/architecture.md](docs/architecture.md)** for how each service is built, **[docs/aws-compat.md](docs/aws-compat.md)** for the AWS APIs it speaks and **[docs/api.md](docs/api.md)** for the native API reference. +### VM instances + +Most instances are containers, but `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` boot the official cloud image as a real virtual machine (its own kernel, systemd and cloud-init) under QEMU, inside a container attached to your VPC like any other instance. The same API, CLI, console and Terraform apply: + +```bash +aws ec2 create-key-pair --key-name dev --query KeyMaterial --output text > dev.pem && chmod 600 dev.pem +aws ec2 run-instances --image-id ami-ubuntu-24-04-vm --instance-type t3.small --key-name dev \ + --security-group-ids sg-... --user-data file://setup.sh +ssh -i dev.pem -p ubuntu@localhost # after an `ssh` ingress rule opens tcp/22 +``` + +The guest has the instance's private IP, the VPC's DNS and the metadata service, and security groups filter its traffic. It runs with KVM acceleration when the Docker host has `/dev/kvm` (Linux) and is emulated otherwise, for example on Docker Desktop and OrbStack for Mac: it works but boots in about a minute. Cloud images (about 600 MB) are downloaded once on first use and cached in a Docker volume. Volumes, snapshots and images of VM disks, the browser terminal and run-command are not available for VM instances yet; see [docs/architecture.md](docs/architecture.md). + --- ## 🚀 Quick start @@ -206,7 +219,7 @@ homecloud upgrade # verified update from GitHub releases * ✅ **Workflows:** Step Functions * ✅ **Infrastructure as code:** CloudFormation-style stacks * ✅ **AWS compatibility:** the AWS CLI, SDKs and Terraform work against HomeCloud for IAM/STS, EC2/VPC, S3, Lambda, DynamoDB, SQS, SNS, Secrets Manager, SSM, KMS, CloudWatch, EventBridge, Step Functions, Elastic Load Balancing, Auto Scaling, ECS and ECR -* 🔄 **Next:** AWS APIs for RDS, API Gateway, Route 53, ACM, EFS, ElastiCache and CloudFormation; stricter security groups and resource policies; VM-backed instances (QEMU/KVM); multi-node clusters +* 🔄 **Next:** AWS APIs for RDS, API Gateway, Route 53, ACM, EFS, ElastiCache and CloudFormation; stricter security groups and resource policies; volumes, snapshots and a browser terminal for VM instances; multi-node clusters * 🔄 **Phase 4:** Edge compute and hardware integrations 📍 **[See the open issues](https://github.com/solinode/homecloud/issues)** for everything planned, with a checklist per item. diff --git a/cli/internal/svc/ec2/aws.go b/cli/internal/svc/ec2/aws.go index 144ef035..8f00cae9 100644 --- a/cli/internal/svc/ec2/aws.go +++ b/cli/internal/svc/ec2/aws.go @@ -393,6 +393,15 @@ func (s *Service) awsDescribeAccountAttributes(q *awsapi.Req) (any, error) { // ---- images and instance types ---- +// hypervisor is what the EC2 API reports: instances that run as containers keep +// the "xen" of the real service's older families; virtual machines are QEMU/KVM. +func hypervisor(vm bool) string { + if vm { + return "kvm" + } + return "xen" +} + func (s *Service) awsName(im Image) string { if im.AWSName == "" { return im.Name @@ -418,9 +427,12 @@ func (s *Service) allImages() []Image { out := []Image{} for _, im := range catalog { im.Owner, im.State = "homecloud", "available" - out = append(out, im) + out = append(out, im.normalized()) + } + for _, im := range store.List[Image](s.env.Store, cImages) { + out = append(out, im.normalized()) } - return append(out, store.List[Image](s.env.Store, cImages)...) + return out } func (s *Service) imageXML(im Image) map[string]any { @@ -433,7 +445,7 @@ func (s *Service) imageXML(im Image) map[string]any { "imageId": im.ID, "imageLocation": owner + "/" + s.awsName(im), "imageState": im.State, "imageOwnerId": owner, "creationDate": created, "isPublic": im.Owner == "homecloud", "architecture": hostArch(s), "imageType": "machine", "platformDetails": "Linux/UNIX", "usageOperation": "RunInstances", "name": s.awsName(im), "description": im.Description, - "rootDeviceType": "ebs", "rootDeviceName": "/dev/xvda", "virtualizationType": "hvm", "hypervisor": "xen", "enaSupport": true, + "rootDeviceType": "ebs", "rootDeviceName": "/dev/xvda", "virtualizationType": "hvm", "hypervisor": hypervisor(im.IsVM()), "enaSupport": true, "bootMode": "uefi-preferred", "tagSet": tagSet(im.Tags), "productCodes": awsapi.Items{}, "blockDeviceMapping": awsapi.Items{map[string]any{"deviceName": "/dev/xvda", "ebs": map[string]any{"volumeSize": 8, "deleteOnTermination": true, "volumeType": "gp3", "encrypted": false}}}, @@ -465,7 +477,7 @@ func (s *Service) awsDescribeImages(q *awsapi.Req) (any, error) { a := attrs{}.set("image-id", im.ID).set("name", s.awsName(im)).set("owner-id", owner).set("owner-alias", alias). set("state", im.State).set("architecture", hostArch(s)).set("virtualization-type", "hvm").set("root-device-type", "ebs"). set("root-device-name", "/dev/xvda").set("image-type", "machine").set("is-public", strconv.FormatBool(im.Owner == "homecloud")). - set("platform-details", "Linux/UNIX").set("description", im.Description).set("hypervisor", "xen"). + set("platform-details", "Linux/UNIX").set("description", im.Description).set("hypervisor", hypervisor(im.IsVM())). set("block-device-mapping.volume-type", "gp3").set("ena-support", "true").tags(im.Tags) if !match(fs, a) { continue @@ -628,7 +640,7 @@ func (s *Service) instanceXML(i Instance) map[string]any { "launchTime": i.LaunchTime, "placement": map[string]any{"availabilityZone": i.AvailabilityZone, "groupName": "", "tenancy": "default"}, "monitoring": map[string]any{"state": monitoring}, "architecture": hostArch(s), "rootDeviceType": "ebs", "rootDeviceName": "/dev/xvda", "blockDeviceMapping": bdm, "virtualizationType": "hvm", "clientToken": i.ClientToken, "tagSet": tagSet(s.tagsOf(i.ID, i.Name, i.Tags)), - "hypervisor": "xen", "ebsOptimized": i.EBSOptimized, "enaSupport": true, "sourceDestCheck": !i.SourceDestCheckOff, + "hypervisor": hypervisor(i.IsVM()), "ebsOptimized": i.EBSOptimized, "enaSupport": true, "sourceDestCheck": !i.SourceDestCheckOff, "groupSet": s.groupSet(i.SecurityGroups), "platformDetails": "Linux/UNIX", "usageOperation": "RunInstances", "usageOperationUpdateTime": i.LaunchTime, "bootMode": "uefi", "currentInstanceBootMode": "uefi", "cpuOptions": map[string]any{"coreCount": max(1, vcpus/2), "threadsPerCore": min(2, vcpus)}, @@ -852,8 +864,20 @@ func (s *Service) awsRunInstances(q *awsapi.Req) (any, error) { HopLimit: q.ParamInt("MetadataOptions.HttpPutResponseHopLimit", 0), InstanceMetadataTags: q.Param("MetadataOptions.InstanceMetadataTags")} for _, m := range q.Structs("BlockDeviceMapping") { dev := m["DeviceName"] - if dev == "" || m["NoDevice"] != "" || m["VirtualName"] != "" || dev == "/dev/xvda" || dev == "/dev/sda1" || dev == "/dev/sda" { - continue // the root device is the instance's own disk + if dev == "/dev/xvda" || dev == "/dev/sda1" || dev == "/dev/sda" { + // The root device is the instance's own disk. Container instances have + // no separate root volume; VM instances size and keep theirs by it. + if m["NoDevice"] == "" && m["VirtualName"] == "" { + root := VolumeSpec{Device: dev, VolumeType: m["Ebs.VolumeType"], Iops: atoi(m["Ebs.Iops"]), Throughput: atoi(m["Ebs.Throughput"]), + SizeGB: atoi(m["Ebs.VolumeSize"]), Encrypted: m["Ebs.Encrypted"] == "true", KMSKeyID: m["Ebs.KmsKeyId"]} + del := m["Ebs.DeleteOnTermination"] != "false" + root.DeleteOnTermination = &del + in.RootVolume = &root + } + continue + } + if dev == "" || m["NoDevice"] != "" || m["VirtualName"] != "" { + continue } if !deviceRE.MatchString(dev) { return nil, invalid("Invalid device name %s", dev) diff --git a/cli/internal/svc/ec2/catalog.go b/cli/internal/svc/ec2/catalog.go index e38890cc..b04ce5d2 100644 --- a/cli/internal/svc/ec2/catalog.go +++ b/cli/internal/svc/ec2/catalog.go @@ -55,6 +55,23 @@ type Image struct { AWSName string `json:"-"` // OwnerID is the catalog image's owner in the EC2 API (the vendor's AWS account). OwnerID string `json:"-"` + // VMBase names the cloud image (vm.Bases) a VM image boots; empty for images + // that run as containers. Ref is empty for VM images. + VMBase string `json:"vm_base,omitempty"` + // Virtualization is "vm" (QEMU guest with its own kernel) or "container". + Virtualization string `json:"virtualization"` +} + +// IsVM reports whether the image boots a virtual machine. +func (im Image) IsVM() bool { return im.VMBase != "" } + +// normalized fills derived fields. +func (im Image) normalized() Image { + im.Virtualization = "container" + if im.IsVM() { + im.Virtualization = "vm" + } + return im } var catalog = []Image{ @@ -64,6 +81,11 @@ var catalog = []Image{ AWSName: "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-{deb}-server-20240101", OwnerID: ownerCanonical}, {ID: "ami-debian-12", Name: "Debian 12", Description: "Debian GNU/Linux 12 (bookworm)", Ref: "debian:12", Platform: "linux", KeepAlive: true, AWSName: "debian-12-{deb}-20240101-0000", OwnerID: ownerDebian}, + // Virtual machine images: official cloud images booted under QEMU (see the vm package). + {ID: "ami-ubuntu-24-04-vm", Name: "Ubuntu Server 24.04 LTS (VM)", Description: "Canonical Ubuntu 24.04 (Noble Numbat) cloud image, booted as a virtual machine with its own kernel and cloud-init", Platform: "linux", VMBase: "ubuntu-24.04", + AWSName: "homecloud/vm/ubuntu-noble-24.04-{deb}-server-20260926", OwnerID: ownerCanonical}, + {ID: "ami-debian-12-vm", Name: "Debian 12 (VM)", Description: "Debian GNU/Linux 12 (bookworm) cloud image, booted as a virtual machine with its own kernel and cloud-init", Platform: "linux", VMBase: "debian-12", + AWSName: "homecloud/vm/debian-12-{deb}-20260923-2610", OwnerID: ownerDebian}, {ID: "ami-amazonlinux-2023", Name: "Amazon Linux 2023", Description: "Amazon Linux 2023 base image", Ref: "amazonlinux:2023", Platform: "linux", KeepAlive: true, AWSName: "al2023-ami-2023.0.20240101.0-kernel-6.1-{rpm}"}, {ID: "ami-rocky-9", Name: "Rocky Linux 9", Description: "Enterprise Linux compatible", Ref: "rockylinux:9", Platform: "linux", KeepAlive: true}, diff --git a/cli/internal/svc/ec2/ec2.go b/cli/internal/svc/ec2/ec2.go index 5bcb8955..3688ad4b 100644 --- a/cli/internal/svc/ec2/ec2.go +++ b/cli/internal/svc/ec2/ec2.go @@ -116,8 +116,19 @@ type Instance struct { // differs from the AMI (a volume attach recreates the container from a // snapshot of its disk). RootImage string `json:"root_image,omitempty"` + + // Virtual machine instances (an AMI with a VMBase): "kvm" when the guest + // runs with hardware acceleration, "emulated" when the Docker host has no + // /dev/kvm and QEMU emulates the CPU (slow). Empty for container instances. + Virtualization string `json:"virtualization,omitempty"` + VMBase string `json:"vm_base,omitempty"` // key of the cloud image (vm.Bases) + VMUser string `json:"vm_user,omitempty"` // the image's default login user + VMDiskGB int `json:"vm_disk_gb,omitempty"` // root disk size } +// IsVM reports whether the instance is a virtual machine. +func (i Instance) IsVM() bool { return i.Virtualization != "" } + type Volume struct { ID string `json:"id"` Name string `json:"name"` @@ -159,6 +170,12 @@ type Service struct { // Roles resolves instance profiles and issues their role's credentials (IAM). Roles Roles imds *imds + // IMDSContainer names the metadata service container (default homecloud-imds). + // Tests running beside a real installation use their own. + IMDSContainer string + // VMImageVolume is the Docker volume caching downloaded cloud images. + VMImageVolume string + vm vmState } // Roles is what EC2 needs from IAM for instance profiles. @@ -323,7 +340,11 @@ type RunInput struct { Tags core.Tags `json:"tags"` Volumes []VolumeSpec `json:"volumes"` FileSystems []FSMount `json:"file_systems"` - // KeyName puts a key pair's public key in root's authorized_keys. + // RootVolume sizes the root disk of a VM instance (default 8 GiB) and + // whether it is deleted on termination. Container instances ignore it. + RootVolume *VolumeSpec `json:"root_volume,omitempty"` + // KeyName puts a key pair's public key in root's authorized_keys (the + // default user's, for VM images). KeyName string `json:"key_name"` // IAMInstanceProfile (name or ARN) gives the instance its role's credentials // through the metadata service. The caller must be allowed iam:PassRole. @@ -370,14 +391,14 @@ func (s *Service) image(id string) (Image, error) { for _, im := range catalog { if im.ID == id { im.Owner, im.State = "homecloud", "available" - return im, nil + return im.normalized(), nil } } im, err := store.Get[Image](s.env.Store, cImages, id) if err != nil { return im, core.NotFound("image", id) } - return im, nil + return im.normalized(), nil } // checkTags rejects user tags in the reserved hc: namespace (used by HomeCloud @@ -436,6 +457,12 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) { if err != nil { return nil, err } + var vmPlan vmPlan + if img.IsVM() { + if vmPlan, err = s.planVM(in, img); err != nil { + return nil, err + } + } var key KeyPair if in.KeyName != "" { if key, err = s.keyPair(in.KeyName); err != nil { @@ -535,6 +562,12 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) { Monitoring: in.Attrs.Monitoring, EBSOptimized: in.Attrs.EBSOptimized, ReservationID: reservation, LaunchIndex: n, ClientToken: in.Attrs.ClientToken, LaunchTemplateID: in.Attrs.LaunchTemplateID, LaunchTemplateVersion: in.Attrs.LaunchTemplateVersion, } + vols := in.Volumes + if img.IsVM() { + inst.Virtualization, inst.VMBase, inst.VMUser, inst.VMDiskGB = vmPlan.virtualization, img.VMBase, vmPlan.user, vmPlan.diskGB + inst.ImageRef = "" // a VM image has no Docker image + vols = append([]VolumeSpec{vmPlan.root}, vols...) + } if inst.ShutdownBehavior == "" { inst.ShutdownBehavior = "stop" } @@ -546,7 +579,7 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) { s.releaseVolumes(inst) s.vpc.Release(id) } - for _, v := range in.Volumes { + for _, v := range vols { del := v.VolumeID == "" if v.DeleteOnTermination != nil { del = *v.DeleteOnTermination @@ -585,7 +618,11 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) { return launched, err } launched = append(launched, inst) - go s.launch(inst, pl.Network) + if inst.IsVM() { + go s.launchVM(inst, pl.Network) + } else { + go s.launch(inst, pl.Network) + } } return launched, nil } @@ -608,6 +645,9 @@ func checkMetadata(m MetadataOptions) error { // runSpec is the container of an instance. func (s *Service) runSpec(inst Instance, network string) runtime.RunSpec { + if inst.IsVM() { + return s.vmRunSpec(inst, network) + } mounts := []runtime.Mount{} for _, v := range inst.Volumes { mounts = append(mounts, runtime.Mount{Volume: volumeName(v.VolumeID), Target: v.MountPath}) @@ -685,27 +725,30 @@ func (s *Service) bootFiles(inst Instance) (map[string][]byte, error) { return files, nil } +// failLaunch terminates an instance whose launch failed and releases what it claimed. +func (s *Service) failLaunch(inst Instance, err error) { + log.Printf("ec2: launch %s failed: %v", inst.ID, err) + already := false + _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error { + if x.State == "terminated" { // terminated while launching: already cleaned up + already = true + return nil + } + n := core.Now() + x.State, x.StateReason, x.TerminatedAt = "terminated", "Server.LaunchFailure: "+err.Error(), &n + return nil + }) + if !already { + s.releaseVolumes(inst) + s.vpc.Release(inst.ID) + } +} + // launch creates and boots the instance's container in the background. func (s *Service) launch(inst Instance, network string) { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) defer cancel() - fail := func(err error) { - log.Printf("ec2: launch %s failed: %v", inst.ID, err) - already := false - _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error { - if x.State == "terminated" { // terminated while launching: already cleaned up - already = true - return nil - } - n := core.Now() - x.State, x.StateReason, x.TerminatedAt = "terminated", "Server.LaunchFailure: "+err.Error(), &n - return nil - }) - if !already { - s.releaseVolumes(inst) - s.vpc.Release(inst.ID) - } - } + fail := func(err error) { s.failLaunch(inst, err) } cid, err := s.env.Docker.Run(ctx, s.runSpec(inst, network)) if err != nil { fail(err) @@ -800,6 +843,9 @@ func (s *Service) reboot(c *httpx.Ctx) (any, error) { return s.RebootInstance(c. // StartInstance starts a stopped instance. func (s *Service) StartInstance(id string) (any, error) { return s.transition(id, []string{"stopped"}, func(i Instance) error { + if i.IsVM() { + return s.vmStart(i) + } if err := s.env.Docker.Start(i.ContainerID); err != nil { return err } @@ -817,12 +863,20 @@ func (s *Service) StopInstance(id string, force bool) (any, error) { if force { timeout = 0 } - return s.transition(id, []string{"running"}, func(i Instance) error { return s.env.Docker.Stop(i.ContainerID, timeout) }, "stopping", "stopped") + return s.transition(id, []string{"running"}, func(i Instance) error { + if i.IsVM() { + return s.vmStop(i, force) + } + return s.env.Docker.Stop(i.ContainerID, timeout) + }, "stopping", "stopped") } // RebootInstance restarts a running instance. func (s *Service) RebootInstance(id string) (any, error) { return s.transition(id, []string{"running"}, func(i Instance) error { + if i.IsVM() { + return s.vmReboot(i) + } if err := s.env.Docker.Restart(i.ContainerID); err != nil { return err } @@ -980,6 +1034,19 @@ func (s *Service) ChangeType(id, typ string) (Instance, error) { if i.State != "stopped" || i.ContainerID == "" { return i, core.Errf(http.StatusConflict, "IncorrectInstanceState", "the instance %s must be stopped to change its type", i.ID) } + if i.IsVM() { + // The guest's CPU and memory are QEMU arguments: rebuild the container. + if _, err := store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error { + x.InstanceType, x.VCPUs, x.MemoryMB = it.Name, it.VCPUs, it.MemoryMB + return nil + }); err != nil { + return i, err + } + if err := s.recreateVM(i.ID); err != nil { + return i, fmt.Errorf("resize virtual machine: %w", err) + } + return s.get(i.ID) + } mem := it.MemoryMB * 1024 * 1024 if err := s.env.Docker.C.UpdateContainer(i.ContainerID, docker.UpdateContainerOptions{ Memory: int(mem), MemorySwap: int(mem * 2), CPUPeriod: 100000, CPUQuota: int(min(it.VCPUs, s.hostCPU) * 100000), @@ -1053,6 +1120,9 @@ func (s *Service) runCommand(c *httpx.Ctx) (any, error) { if i.State != "running" { return nil, core.Errf(http.StatusConflict, "InvalidInstanceState", "instance %s is %s", i.ID, i.State) } + if i.IsVM() { + return nil, errVMUnsupported("running commands inside") + } if in.Timeout <= 0 || in.Timeout > 600 { in.Timeout = 60 } @@ -1074,12 +1144,7 @@ func (s *Service) runCommand(c *httpx.Ctx) (any, error) { // ---- images ---- func (s *Service) listImages(c *httpx.Ctx) (any, error) { - out := []Image{} - for _, im := range catalog { - im.Owner, im.State = "homecloud", "available" - out = append(out, im) - } - return append(out, store.List[Image](s.env.Store, cImages)...), nil + return s.allImages(), nil } func (s *Service) getImage(c *httpx.Ctx) (any, error) { return s.image(c.Param("id")) } @@ -1130,6 +1195,9 @@ func (s *Service) CreateImage(instanceID, name, description string, tags core.Ta if i.ContainerID == "" || i.State == "terminated" { return Image{}, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s has no disk to capture", i.ID) } + if i.IsVM() { + return Image{}, errVMUnsupported("creating images from") + } if name == "" { name = i.ID + "-image" } diff --git a/cli/internal/svc/ec2/imds.go b/cli/internal/svc/ec2/imds.go index f5d8ff7c..aa6251f0 100644 --- a/cli/internal/svc/ec2/imds.go +++ b/cli/internal/svc/ec2/imds.go @@ -77,6 +77,13 @@ func (m *imds) forget(id string) { } } +func (s *Service) imdsName() string { + if s.IMDSContainer != "" { + return s.IMDSContainer + } + return imdsContainer +} + func (s *Service) initIMDS() { if s.imds == nil { s.imds = &imds{s: s, key: core.RandHex(40), tokens: map[string]imdsToken{}, creds: map[string]cachedCred{}} @@ -118,13 +125,13 @@ func (s *Service) RunIMDS(ctx context.Context) { // VPCCreated attaches the metadata helper to a new VPC. func (s *Service) VPCCreated(v vpc.VPC) { - _ = s.env.Docker.ConnectIP(v.Network, imdsContainer, vpc.MetadataAddress(v.CIDR)) + _ = s.env.Docker.ConnectIP(v.Network, s.imdsName(), vpc.MetadataAddress(v.CIDR)) } // NetworkChanged re-routes the metadata address in a VPC's running instances // after its network was recreated. func (s *Service) NetworkChanged(v vpc.VPC) { - _ = s.env.Docker.ConnectIP(v.Network, imdsContainer, vpc.MetadataAddress(v.CIDR)) + _ = s.env.Docker.ConnectIP(v.Network, s.imdsName(), vpc.MetadataAddress(v.CIDR)) for _, i := range store.List[Instance](s.env.Store, cInstances) { if i.VpcID == v.ID && i.State == "running" && i.ContainerID != "" { s.metadataRoute(context.Background(), i.ContainerID, i.VpcID) @@ -171,7 +178,7 @@ http { // it to every VPC network. func (s *Service) ensureIMDS(ctx context.Context) error { conf := []byte(s.imdsConfig()) - c, err := s.env.Docker.Inspect(imdsContainer) + c, err := s.env.Docker.Inspect(s.imdsName()) if err == nil && c.State.Running { // Reload only when the configuration (the secret) changed. res, err := s.env.Docker.Exec(ctx, c.ID, []string{"cat", "/etc/nginx/nginx.conf"}, nil) @@ -188,7 +195,7 @@ func (s *Service) ensureIMDS(ctx context.Context) error { _ = s.env.Docker.Remove(c.ID) } id, err := s.env.Docker.Run(ctx, runtime.RunSpec{ - Name: imdsContainer, Image: imdsImage, + Name: s.imdsName(), Image: imdsImage, Entrypoint: []string{"/bin/sh", "-c"}, Cmd: []string{"ip addr add " + imdsIP + "/32 dev lo 2>/dev/null; exec nginx -g 'daemon off;'"}, Labels: runtime.Labels("ec2", "server", map[string]string{"homecloud.name": "instance metadata service"}), @@ -208,7 +215,7 @@ func (s *Service) ensureIMDS(ctx context.Context) error { } } for _, v := range s.vpc.List() { - if err := s.env.Docker.ConnectIP(v.Network, imdsContainer, vpc.MetadataAddress(v.CIDR)); err != nil { + if err := s.env.Docker.ConnectIP(v.Network, s.imdsName(), vpc.MetadataAddress(v.CIDR)); err != nil { log.Printf("ec2: attach metadata service to %s: %v", v.ID, err) } } diff --git a/cli/internal/svc/ec2/sg_filter_live_test.go b/cli/internal/svc/ec2/sg_filter_live_test.go index da690228..0c2beaca 100644 --- a/cli/internal/svc/ec2/sg_filter_live_test.go +++ b/cli/internal/svc/ec2/sg_filter_live_test.go @@ -24,6 +24,7 @@ type filterEnv struct { vpcID string subnet string defSG string + ec2 *ec2.Service } func newFilterEnv(t *testing.T) *filterEnv { @@ -64,7 +65,7 @@ func newFilterEnv(t *testing.T) *filterEnv { } t.Cleanup(func() { _ = v.DeleteVPC(vpcID) }) sn := h.AWSJSON(t, "ec2", "create-subnet", "--vpc-id", vpcID, "--cidr-block", fmt.Sprintf("10.%d.1.0/24", second))["Subnet"].(map[string]any)["SubnetId"].(string) - return &filterEnv{t: t, h: h, vpc: v, vpcID: vpcID, subnet: sn, defSG: v.DefaultSecurityGroup(vpcID)} + return &filterEnv{t: t, h: h, vpc: v, ec2: e, vpcID: vpcID, subnet: sn, defSG: v.DefaultSecurityGroup(vpcID)} } func (f *filterEnv) group(t *testing.T, name string) string { diff --git a/cli/internal/svc/ec2/terminal.go b/cli/internal/svc/ec2/terminal.go index 9ebc9f55..56546e11 100644 --- a/cli/internal/svc/ec2/terminal.go +++ b/cli/internal/svc/ec2/terminal.go @@ -23,6 +23,9 @@ func (s *Service) terminal(c *httpx.Ctx) (any, error) { if i.State != "running" { return nil, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s is %s", i.ID, i.State) } + if i.IsVM() { + return nil, errVMUnsupported("the browser terminal for") + } c.MarkWritten() ws := websocket.Server{Handler: func(conn *websocket.Conn) { defer conn.Close() diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go new file mode 100644 index 00000000..298c679c --- /dev/null +++ b/cli/internal/svc/ec2/vm.go @@ -0,0 +1,531 @@ +package ec2 + +import ( + "context" + "fmt" + "log" + "math" + "net/http" + "os" + "strconv" + "strings" + "sync" + "time" + + docker "github.com/fsouza/go-dockerclient" + "github.com/homecloudhq/homecloud/cli/internal/core" + "github.com/homecloudhq/homecloud/cli/internal/runtime" + "github.com/homecloudhq/homecloud/cli/internal/store" + "github.com/homecloudhq/homecloud/cli/internal/svc" + "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm" + "github.com/homecloudhq/homecloud/cli/internal/svc/vpc" +) + +// VM instances. +// +// An AMI with a VMBase boots an official cloud image under QEMU. The guest +// runs inside a Docker container (the "VM container", built from the runner +// image in the vm package) attached to the instance's VPC network with its +// private address, so addresses, DNS, the metadata service, security groups +// (iptables in the container's namespace) and published ports work as they do +// for container instances. Inside the container passt hands the guest the +// container's address, gateway and routes and forwards every inbound port to +// it. The root disk is a qcow2 overlay on the cached base image, kept in the +// instance's root volume (an EBS volume record at /dev/xvda, mounted at /vm). +// The guest uses hardware acceleration when the Docker host has /dev/kvm and +// is otherwise emulated. +// +// Stage 1 covers the instance lifecycle. Extra volumes, snapshots and images +// of VM disks, a browser terminal, run-command, CloudWatch metrics and backup +// are not available for VM instances yet. + +const defaultVMImageVolume = "hc-vm-images" + +type vmState struct { + runnerMu sync.Mutex + runnerTag string // built and ready + runnerErr error + runnerFailed time.Time + + kvmOnce sync.Once + kvm bool + + fetchMu sync.Mutex // one download at a time +} + +// vmPlan is what Launch works out once for every instance of a VM launch. +type vmPlan struct { + virtualization string // kvm | emulated + user string + diskGB int + root VolumeSpec +} + +func errVMUnsupported(what string) error { + return core.Errf(http.StatusBadRequest, "UnsupportedOperation", "%s VM instances is not supported yet", what) +} + +func atoi(s string) int { n, _ := strconv.Atoi(s); return n } + +func (s *Service) vmImageVolume() string { + if s.VMImageVolume != "" { + return s.VMImageVolume + } + return defaultVMImageVolume +} + +// planVM validates a launch of a VM image and decides how it runs. +func (s *Service) planVM(in RunInput, img Image) (vmPlan, error) { + var p vmPlan + if s.env.Docker == nil { + return p, core.Errf(http.StatusServiceUnavailable, "Unsupported", "virtual machine instances need Docker") + } + arch, err := vm.ArchOf(hostArch(s)) + if err != nil { + return p, core.Errf(http.StatusBadRequest, "Unsupported", "%v", err) + } + base, ok := vm.Bases[img.VMBase] + if !ok { + return p, core.Errf(http.StatusBadRequest, "InvalidAMIID.Unavailable", "the image %s has no cloud image %q", img.ID, img.VMBase) + } + if _, err := base.For(arch); err != nil { + return p, core.Errf(http.StatusBadRequest, "InvalidAMIID.Unavailable", "the image %s is not available for %s hosts: %v", img.ID, arch, err) + } + if len(in.FileSystems) > 0 { + return p, errVMUnsupported("mounting file systems in") + } + if len(in.Volumes) > 0 { + return p, errVMUnsupported("attaching volumes at launch to") + } + if err := s.vmRunnerFailure(); err != nil { + return p, core.Errf(http.StatusServiceUnavailable, "Unsupported", "virtual machine instances are unavailable: %v", err) + } + p.user, p.diskGB = base.DefaultUser, 8 + p.root = VolumeSpec{Device: "/dev/xvda", MountPath: vm.DiskDir} + del := true + p.root.DeleteOnTermination = &del + if r := in.RootVolume; r != nil { + if r.SizeGB > 0 { + p.diskGB = r.SizeGB + } + if r.DeleteOnTermination != nil { + del := *r.DeleteOnTermination + p.root.DeleteOnTermination = &del + } + p.root.VolumeType, p.root.Iops, p.root.Throughput, p.root.Encrypted, p.root.KMSKeyID = r.VolumeType, r.Iops, r.Throughput, r.Encrypted, r.KMSKeyID + } + if p.diskGB < vm.MinRootGB || p.diskGB > 16384 { + return p, core.Errf(http.StatusBadRequest, "InvalidParameterValue", "the root volume of a VM image must be between %d and 16384 GiB", vm.MinRootGB) + } + p.root.SizeGB = p.diskGB + p.virtualization = "emulated" + if s.vmKVM() { + p.virtualization = "kvm" + } + return p, nil +} + +// vmKVM reports whether the Docker host offers /dev/kvm. It is probed once by +// creating a container with the device (HC_VM_ACCEL=kvm|tcg overrides). +func (s *Service) vmKVM() bool { + s.vm.kvmOnce.Do(func() { + switch os.Getenv("HC_VM_ACCEL") { + case "kvm": + s.vm.kvm = true + return + case "tcg": + log.Printf("ec2: HC_VM_ACCEL=tcg: VM instances run emulated (TCG), which is slow") + return + } + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + _, err := s.env.Docker.RunOnce(ctx, runtime.RunSpec{ + Image: helperImage, Entrypoint: []string{"/bin/sh", "-c"}, Cmd: []string{"test -r /dev/kvm && test -w /dev/kvm"}, + Devices: []string{"/dev/kvm"}, Network: "none", + }) + if err != nil { + log.Printf("ec2: /dev/kvm is not usable on the Docker host (%v): VM instances run emulated (TCG), which is slow", err) + return + } + s.vm.kvm = true + }) + return s.vm.kvm +} + +// vmRunnerFailure is the error of a runner image build that failed recently. +func (s *Service) vmRunnerFailure() error { + s.vm.runnerMu.Lock() + defer s.vm.runnerMu.Unlock() + if s.vm.runnerErr != nil && time.Since(s.vm.runnerFailed) < time.Minute { + return s.vm.runnerErr + } + return nil +} + +// vmRunner builds the runner image on first use (locally, tagged by content +// hash) and returns its tag. Only VM launches wait for the build; nothing else +// does. A failed build is remembered for a minute so launches fail fast +// with the reason. +func (s *Service) vmRunner(ctx context.Context) (string, error) { + s.vm.runnerMu.Lock() + defer s.vm.runnerMu.Unlock() + tag := vm.RunnerTag() + if s.vm.runnerTag == tag { + return tag, nil + } + if s.vm.runnerErr != nil && time.Since(s.vm.runnerFailed) < time.Minute { + return "", s.vm.runnerErr + } + bctx, cancel := context.WithTimeout(ctx, 20*time.Minute) + defer cancel() + log.Printf("ec2: building the VM runner image %s (first VM launch)", tag) + if err := s.env.Docker.BuildImageFiles(bctx, tag, vm.RunnerContext()); err != nil { + s.vm.runnerErr = fmt.Errorf("building the VM runner image failed: %w", err) + s.vm.runnerFailed = time.Now() + return "", s.vm.runnerErr + } + s.vm.runnerTag, s.vm.runnerErr = tag, nil + return tag, nil +} + +// vmEnsureBase downloads the instance's cloud image into the image cache +// volume unless it is there, verified by checksum. +func (s *Service) vmEnsureBase(ctx context.Context, runner string, base vm.Base, arch vm.Arch) error { + f, err := base.For(arch) + if err != nil { + return err + } + s.vm.fetchMu.Lock() + defer s.vm.fetchMu.Unlock() + vol := s.vmImageVolume() + if err := s.env.Docker.CreateVolume(vol, runtime.Labels("ec2", "vm-images", nil)); err != nil { + return err + } + fctx, cancel := context.WithTimeout(ctx, 45*time.Minute) + defer cancel() + if _, err := s.env.Docker.RunOnce(fctx, runtime.RunSpec{ + Image: runner, Entrypoint: []string{"/usr/local/bin/hc-vm-fetch"}, Cmd: []string{f.URL, base.CacheName(arch), f.Sum}, + Mounts: []runtime.Mount{{Volume: vol, Target: vm.ImagesDir}}, + }); err != nil { + return fmt.Errorf("download %s: %w", f.URL, err) + } + return nil +} + +// vmMachine is the guest hardware of an instance. +func (s *Service) vmMachine(inst Instance) vm.Machine { + arch, _ := vm.ArchOf(hostArch(s)) + return vm.Machine{Name: inst.ID, Arch: arch, KVM: inst.Virtualization == "kvm", + VCPUs: max(1, int(math.Ceil(inst.VCPUs))), MemoryMB: inst.MemoryMB} +} + +// vmRunSpec is the VM container of an instance. +func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec { + mach := s.vmMachine(inst) + base := vm.Bases[inst.VMBase] + dns := "" + if v, err := s.vpc.GetVPC(inst.VpcID); err == nil { + dns = vpc.DNSAddress(v.CIDR) + } + mounts := []runtime.Mount{{Volume: s.vmImageVolume(), Target: vm.ImagesDir, ReadOnly: true}} + for _, v := range inst.Volumes { + mounts = append(mounts, runtime.Mount{Volume: volumeName(v.VolumeID), Target: v.MountPath}) + } + spec := runtime.RunSpec{ + DNS: s.dns(inst.VpcID), + Name: svc.ContainerName("ec2", inst.ID), + Image: vm.RunnerTag(), + Cmd: mach.Command(), + Labels: runtime.Labels("ec2", inst.ID, map[string]string{"homecloud.name": inst.Name, "homecloud.virtualization": inst.Virtualization}), + // QEMU's own threads and the guest's memory map need a little more than the guest sees. + NanoCPUs: int64(min(float64(mach.VCPUs)+0.5, s.hostCPU) * 1e9), + MemoryMB: inst.MemoryMB + 512, + Ports: s.portsFor(inst), + Mounts: mounts, + Network: network, + IP: inst.PrivateIP, + Aliases: append([]string{inst.ID, inst.PrivateDNS}, nonEmpty(inst.Name)...), + Hostname: strings.TrimSuffix(inst.PrivateDNS, ".internal"), + Env: map[string]string{ + "HC_VM_BASE": base.CacheName(mach.Arch), "HC_VM_DISK_GB": strconv.Itoa(inst.VMDiskGB), "HC_VM_ARCH": string(mach.Arch), "HC_VM_DNS": dns, + }, + ExtraHosts: []string{runtime.HostAlias}, + // passt isolates itself with a user namespace, which Docker's default + // seccomp profile only allows with CAP_SYS_ADMIN. + SecurityOpt: []string{"seccomp=unconfined"}, + } + if mach.KVM { + spec.Devices = []string{"/dev/kvm"} + } + return spec +} + +// vmSeed is the cloud-init seed of an instance, as files to copy into its container. +func (s *Service) vmSeed(inst Instance) map[string][]byte { + seed := vm.Seed{InstanceID: inst.ID, Hostname: strings.TrimSuffix(inst.PrivateDNS, ".internal"), UserData: inst.UserData} + if inst.KeyName != "" { + if k, err := s.keyPair(inst.KeyName); err == nil { + seed.PublicKey = k.PublicKey + } + } + out := map[string][]byte{} + for name, b := range seed.Files() { + out[strings.TrimPrefix(vm.SeedDir, "/")+"/"+name] = b + } + return out +} + +func (s *Service) vmPending(id string) bool { + i, err := store.Get[Instance](s.env.Store, cInstances, id) + return err == nil && i.State == "pending" +} + +// launchVM prepares and boots a VM instance in the background. +func (s *Service) launchVM(inst Instance, network string) { + defer core.Recover("ec2 launch vm " + inst.ID) + ctx, cancel := context.WithTimeout(context.Background(), 90*time.Minute) + defer cancel() + fail := func(err error) { s.failLaunch(inst, err) } + runner, err := s.vmRunner(ctx) + if err != nil { + fail(err) + return + } + arch, _ := vm.ArchOf(hostArch(s)) + if err := s.vmEnsureBase(ctx, runner, vm.Bases[inst.VMBase], arch); err != nil { + fail(err) + return + } + if !s.vmPending(inst.ID) { + return // terminated while the image downloaded + } + if inst.Virtualization == "emulated" { + log.Printf("ec2: %s runs emulated (no /dev/kvm): booting takes a while", inst.ID) + } + cid, err := s.env.Docker.Run(ctx, s.vmRunSpec(inst, network)) + if err != nil { + fail(err) + return + } + if err := s.env.Docker.CopyIn(ctx, cid, "/", s.vmSeed(inst), 0o644); err != nil { + _ = s.env.Docker.Remove(cid) + fail(fmt.Errorf("write cloud-init seed: %w", err)) + return + } + since := time.Now().Add(-2 * time.Second) + if err := s.env.Docker.Start(cid); err != nil { + _ = s.env.Docker.Remove(cid) + fail(err) + return + } + gone := false + _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error { + if x.State != "pending" { + gone = true + return nil + } + x.ContainerID = cid + return nil + }) + if gone { // terminated while launching + go s.env.Docker.Remove(cid) + return + } + inst.ContainerID = cid + s.metadataRoute(ctx, cid, inst.VpcID) + s.vpc.ProtectNow(ctx, s.member(inst, cid)) + if err := s.vmWaitReady(inst, since); err != nil { + if out, _ := s.env.Docker.Logs(cid, 30, time.Time{}); out != "" { + err = fmt.Errorf("%w: %s", err, tail(out, 1500)) + } + _ = s.env.Docker.Remove(cid) + fail(err) + return + } + _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error { + if x.State != "pending" { // terminated meanwhile + return nil + } + x.State, x.StateReason = "running", "" + x.PublicPorts = s.env.Docker.PublishedPorts(cid) + return nil + }) + s.syncPortsAsync(inst.ID) // groups may have changed while launching +} + +func tail(s string, n int) string { + s = strings.TrimSpace(s) + if len(s) > n { + s = s[len(s)-n:] + } + return s +} + +// vmBootTimeout is how long a guest gets to finish booting before the instance +// is reported running anyway (images without cloud-init never print the marker). +func vmBootTimeout(inst Instance) time.Duration { + if inst.Virtualization == "kvm" { + return 10 * time.Minute + } + return 30 * time.Minute +} + +// vmWaitReady returns once the guest has booted (cloud-init finished, or a +// login prompt has been up for a while), the wait timed out (logged; the guest +// may simply not print the markers) or the VM container stopped, which is an +// error. It gives up quietly when the instance is terminated or stopped. +func (s *Service) vmWaitReady(inst Instance, since time.Time) error { + deadline := time.Now().Add(vmBootTimeout(inst)) + var promptSince time.Time + for { + st := s.env.Docker.State(inst.ContainerID) + if st != "running" { + return fmt.Errorf("the virtual machine stopped while booting (container %s)", st) + } + if cur, err := store.Get[Instance](s.env.Store, cInstances, inst.ID); err != nil || cur.State == "terminated" || cur.State == "shutting-down" || cur.State == "stopping" || cur.State == "stopped" { + return nil + } + out, _ := s.env.Docker.Logs(inst.ContainerID, 0, since) + done, prompt := vm.Ready(out) + if done { + return nil + } + if prompt { + if promptSince.IsZero() { + promptSince = time.Now() + } else if time.Since(promptSince) > 90*time.Second { + return nil // a login prompt and no cloud-init final message + } + } + if time.Now().After(deadline) { + log.Printf("ec2: %s: no boot-complete marker on the console after %s; reporting it running", inst.ID, vmBootTimeout(inst)) + return nil + } + time.Sleep(3 * time.Second) + } +} + +// vmShutdownTimeout is how long the guest gets to power off after the ACPI request. +func vmShutdownTimeout(inst Instance) time.Duration { + if inst.Virtualization == "kvm" { + return 2 * time.Minute + } + return 4 * time.Minute +} + +// vmPowerOff asks the guest to shut down (ACPI power button through QMP) and +// waits for QEMU, and with it the container, to exit. It reports whether that +// happened in time. +func (s *Service) vmPowerOff(inst Instance) bool { + if s.env.Docker.State(inst.ContainerID) != "running" { + return true + } + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + if _, err := s.env.Docker.Exec(ctx, inst.ContainerID, []string{"/usr/local/bin/hc-vm-ctl", "system_powerdown"}, nil); err != nil { + log.Printf("ec2: power down %s: %v", inst.ID, err) + } + cancel() + deadline := time.Now().Add(vmShutdownTimeout(inst)) + for time.Now().Before(deadline) { + if s.env.Docker.State(inst.ContainerID) != "running" { + return true + } + time.Sleep(time.Second) + } + return false +} + +// vmStop shuts the guest down gracefully, then kills the container if it is +// still there; force skips the graceful part. +func (s *Service) vmStop(inst Instance, force bool) error { + if !force && !s.vmPowerOff(inst) { + log.Printf("ec2: %s did not power off in %s; killing it", inst.ID, vmShutdownTimeout(inst)) + } + return s.env.Docker.Stop(inst.ContainerID, 0) +} + +// vmStart boots a stopped VM (same disk) and waits for the guest to be up. +func (s *Service) vmStart(inst Instance) error { + since := time.Now().Add(-2 * time.Second) + if err := s.env.Docker.Start(inst.ContainerID); err != nil { + return err + } + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + s.metadataRoute(ctx, inst.ContainerID, inst.VpcID) + s.vpc.ProtectNow(ctx, s.member(inst, inst.ContainerID)) + return s.vmWaitReady(inst, since) +} + +// vmReboot restarts the guest: a graceful shutdown, then the same container starts again. +func (s *Service) vmReboot(inst Instance) error { + setBusy(inst.ID, true) // the container is down for a while: not "stopped" + defer setBusy(inst.ID, false) + if err := s.vmStop(inst, false); err != nil { + return err + } + return s.vmStart(inst) +} + +// recreateVM rebuilds the VM container of an instance from its current +// settings (instance type, ports). +func (s *Service) recreateVM(id string) error { return s.recreate(id) } + +// rebuildVM replaces an instance's VM container with one built from the +// instance's current settings. Nothing is snapshotted: the disk lives in the +// root volume. A running guest is shut down and boots again, as after a reboot. +// The caller holds recreateMu and has marked the instance busy. +func (s *Service) rebuildVM(i Instance) error { + v, err := s.vpc.GetVPC(i.VpcID) + if err != nil { + return err + } + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) + defer cancel() + running := s.env.Docker.State(i.ContainerID) == "running" + if running { + if err := s.vmStop(i, false); err != nil { + return fmt.Errorf("stop: %w", err) + } + } + name := svc.ContainerName("ec2", i.ID) + if err := s.env.Docker.C.RenameContainer(dockerRename(i.ContainerID, name+"-old", ctx)); err != nil { + return fmt.Errorf("rename: %w", err) + } + undo := func(cause error) error { + _ = s.env.Docker.C.RenameContainer(dockerRename(i.ContainerID, name, ctx)) + if running { + _ = s.env.Docker.Start(i.ContainerID) + } + return cause + } + cid, err := s.env.Docker.Run(ctx, s.vmRunSpec(i, v.Network)) + if err != nil { + return undo(fmt.Errorf("recreate: %w", err)) + } + if err := s.env.Docker.CopyIn(ctx, cid, "/", s.vmSeed(i), 0o644); err != nil { + _ = s.env.Docker.Remove(cid) + return undo(fmt.Errorf("write cloud-init seed: %w", err)) + } + _ = s.env.Docker.Remove(i.ContainerID) + if running { + if err := s.env.Docker.Start(cid); err != nil { + log.Printf("ec2: start recreated %s: %v", i.ID, err) + } else { + s.metadataRoute(ctx, cid, i.VpcID) + s.vpc.ProtectNow(ctx, s.member(i, cid)) + } + } + _, err = store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error { + x.ContainerID = cid + if running { + x.PublicPorts = s.env.Docker.PublishedPorts(cid) + } + return nil + }) + return err +} + +func dockerRename(id, name string, ctx context.Context) docker.RenameContainerOptions { + return docker.RenameContainerOptions{ID: id, Name: name, Context: ctx} +} diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go new file mode 100644 index 00000000..430c0531 --- /dev/null +++ b/cli/internal/svc/ec2/vm_live_test.go @@ -0,0 +1,372 @@ +package ec2_test + +import ( + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "net" + "net/http" + "os" + "strconv" + "strings" + "testing" + "time" + + docker "github.com/fsouza/go-dockerclient" + "github.com/homecloudhq/homecloud/cli/internal/svc/ec2" + "golang.org/x/crypto/ssh" +) + +// The VM instance test boots a real Ubuntu cloud image under QEMU in a Docker +// container. It needs Docker, downloads the image once (about 600 MB, into the +// Docker volume hc-test-vm-images, reused by later runs) and is slow when the +// Docker host has no /dev/kvm (the guest is emulated). Run it with +// +// HC_TEST_VM=1 go test -timeout 60m -run TestVMInstance ./internal/svc/ec2 +// +// (DOCKER_HOST=unix://$HOME/.orbstack/run/docker.sock on macOS with OrbStack). + +const ( + vmTestImage = "ami-ubuntu-24-04-vm" + vmTestUser = "ubuntu" + vmTestBudget = 40 * time.Minute // per wait for a guest to boot; TCG is slow +) + +type vmInstance struct { + State string `json:"state"` + ContainerID string `json:"container_id"` + PrivateIP string `json:"private_ip"` + Virtualization string `json:"virtualization"` + VMUser string `json:"vm_user"` + PublicPorts map[string]int `json:"public_ports"` + StateReason string `json:"state_reason"` +} + +func (f *filterEnv) vmGet(id string) vmInstance { + var i vmInstance + _ = json.Unmarshal(f.h.Native(f.t, "GET", "/api/v1/ec2/instances/"+id, nil), &i) + return i +} + +func (f *filterEnv) vmWaitState(t *testing.T, id, state string) vmInstance { + t.Helper() + var i vmInstance + waitFor(t, id+" "+state, vmTestBudget, func() bool { + i = f.vmGet(id) + if i.State == "terminated" && state != "terminated" { + t.Fatalf("%s terminated: %s", id, i.StateReason) + } + return i.State == state + }) + return i +} + +// startIMDS runs the instance metadata service for this test: its own helper +// container (so a real installation's is left alone) and an HTTP endpoint the +// containers reach through host.docker.internal. +func (f *filterEnv) startIMDS(t *testing.T) { + t.Helper() + ln, err := net.Listen("tcp", "0.0.0.0:0") + if err != nil { + t.Fatal(err) + } + mux := http.NewServeMux() + mux.Handle(ec2.IMDSPath, f.ec2.IMDSHandler()) + srv := &http.Server{Handler: mux} + go srv.Serve(ln) + f.h.Env.ContainerAPI = fmt.Sprintf("http://host.docker.internal:%d", ln.Addr().(*net.TCPAddr).Port) + f.ec2.IMDSContainer = fmt.Sprintf("hc-test-imds-%d", time.Now().UnixNano()%1e9) + ctx, cancel := context.WithCancel(context.Background()) + done := make(chan struct{}) + go func() { f.ec2.RunIMDS(ctx); close(done) }() + t.Cleanup(func() { + cancel() + <-done + _ = srv.Close() + _ = f.h.Env.Docker.Remove(f.ec2.IMDSContainer) + }) + // The helper attaches to the VPC, then instances can route to it. + v, err := f.vpc.GetVPC(f.vpcID) + if err != nil { + t.Fatal(err) + } + waitFor(t, "metadata service", 5*time.Minute, func() bool { + c, err := f.h.Env.Docker.Inspect(f.ec2.IMDSContainer) + if err != nil || !c.State.Running { + return false + } + n, ok := c.NetworkSettings.Networks[v.Network] + return ok && n.IPAddress != "" + }) +} + +// sshDial connects to the guest through its published SSH port on the Docker host. +func sshDial(t *testing.T, port int, signer ssh.Signer, user string) *ssh.Client { + t.Helper() + var c *ssh.Client + waitFor(t, "ssh on published port", 10*time.Minute, func() bool { + var err error + c, err = ssh.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port), &ssh.ClientConfig{ + User: user, Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, HostKeyCallback: ssh.InsecureIgnoreHostKey(), Timeout: 15 * time.Second, + }) + return err == nil + }) + t.Cleanup(func() { c.Close() }) + return c +} + +func sshRun(t *testing.T, c *ssh.Client, cmd string) string { + t.Helper() + s, err := c.NewSession() + if err != nil { + t.Fatal(err) + } + defer s.Close() + out, err := s.CombinedOutput(cmd) + if err != nil { + t.Fatalf("ssh %q: %v\n%s", cmd, err, out) + } + return strings.TrimSpace(string(out)) +} + +// banner reports whether from (a container instance) reads an SSH banner from ip:22. +func (f *filterEnv) banner(t *testing.T, from node, ip string) bool { + cid := f.container(from) + if cid == "" { + return false + } + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + res, err := f.h.Env.Docker.Exec(ctx, cid, []string{"/bin/sh", "-c", "echo | nc -w 4 " + ip + " 22"}, nil) + return err == nil && strings.Contains(res.Stdout, "SSH-2.0") +} + +func (f *filterEnv) bannerEventually(t *testing.T, want bool, from node, ip, what string) { + t.Helper() + end := time.Now().Add(vmTestBudget) + for time.Now().Before(end) { + if f.banner(t, from, ip) == want { + return + } + time.Sleep(2 * time.Second) + } + t.Fatalf("%s: SSH banner from %s to %s reachable = %v, want %v", what, from.id, ip, !want, want) +} + +func TestVMInstanceLifecycle(t *testing.T) { + if os.Getenv("HC_TEST_VM") != "1" { + t.Skip("set HC_TEST_VM=1 to boot a real VM (slow; downloads a cloud image)") + } + f := newFilterEnv(t) + h := f.h + f.ec2.VMImageVolume = "hc-test-vm-images" + f.startIMDS(t) + + // A key pair, and a security group that lets SSH in from anywhere (published on the host). + key := h.AWSJSON(t, "ec2", "create-key-pair", "--key-name", "vmtest", "--key-type", "ed25519") + signer, err := ssh.ParsePrivateKey([]byte(key["KeyMaterial"].(string))) + if err != nil { + t.Fatal(err) + } + sg := f.group(t, "vm-ssh") + h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "0.0.0.0/0") + + // A container instance in the VPC to probe the guest from. + helper := f.launchImage(t, "ami-alpine-3-20", f.group(t, "probe")) + + userData := "#!/bin/sh\necho hc-userdata-ran > /var/tmp/userdata.txt\n" + run := h.AWSJSON(t, "ec2", "run-instances", "--image-id", vmTestImage, "--instance-type", "t3.micro", "--key-name", "vmtest", + "--subnet-id", f.subnet, "--security-group-ids", sg, "--user-data", userData, + "--block-device-mappings", `[{"DeviceName":"/dev/xvda","Ebs":{"VolumeSize":10,"DeleteOnTermination":true}}]`, + "--tag-specifications", `ResourceType=instance,Tags=[{Key=Name,Value=vm-test}]`) + inst := run["Instances"].([]any)[0].(map[string]any) + id, ip := inst["InstanceId"].(string), inst["PrivateIpAddress"].(string) + if inst["Hypervisor"] != "kvm" || inst["VirtualizationType"] != "hvm" { + t.Errorf("run-instances reports hypervisor %v, virtualization %v", inst["Hypervisor"], inst["VirtualizationType"]) + } + terminated := false + t.Cleanup(func() { + if !terminated { + _, _ = h.AWSErr(t, "ec2", "terminate-instances", "--instance-ids", id) + } + }) + i := f.vmWaitState(t, id, "running") + t.Logf("%s is running (%s, guest %s) after boot", id, i.Virtualization, ip) + if i.Virtualization != "kvm" && i.Virtualization != "emulated" || i.VMUser != vmTestUser { + t.Fatalf("instance reports virtualization %q, user %q", i.Virtualization, i.VMUser) + } + if i.PublicPorts["22/tcp"] == 0 { + t.Fatalf("ssh not published: %v", i.PublicPorts) + } + // The root volume is an EBS volume attached at /dev/xvda with the requested size. + desc := h.AWSJSON(t, "ec2", "describe-volumes", "--filters", "Name=attachment.instance-id,Values="+id)["Volumes"].([]any) + if len(desc) != 1 || desc[0].(map[string]any)["Size"].(float64) != 10 { + t.Fatalf("root volume: %v", desc) + } + volID := desc[0].(map[string]any)["VolumeId"].(string) + + // Log in through the published port and inspect the guest. + c := sshDial(t, i.PublicPorts["22/tcp"], signer, vmTestUser) + if got, want := sshRun(t, c, "hostname"), "ip-"+strings.ReplaceAll(ip, ".", "-"); got != want { + t.Errorf("hostname %q, want %q", got, want) + } + // cloud-init may still be running user data when it finishes the boot marker; it is done by now. + waitFor(t, "user data file", 2*time.Minute, func() bool { + s, err := c.NewSession() + if err != nil { + return false + } + defer s.Close() + out, err := s.CombinedOutput("cat /var/tmp/userdata.txt") + return err == nil && strings.TrimSpace(string(out)) == "hc-userdata-ran" + }) + if got := sshRun(t, c, "curl -s -m 10 http://169.254.169.254/latest/meta-data/instance-id"); got != id { + t.Errorf("instance-id from the metadata service inside the guest = %q, want %q", got, id) + } + if got := sshRun(t, c, "ip -4 -o addr show scope global"); !strings.Contains(got, ip+"/") { + t.Errorf("guest addresses %q lack the instance's private address %s", got, ip) + } + if got := sshRun(t, c, "uname -m"); got != "aarch64" && got != "x86_64" { + t.Errorf("uname -m = %q", got) + } + if got, _ := strconv.Atoi(sshRun(t, c, "df -BG --output=size / | tail -1 | tr -d ' G'")); got < 9 { + t.Errorf("root file system is %dG, want the 10 GiB volume grown into", got) + } + if got := sshRun(t, c, "getent hosts example.com >/dev/null && echo dns-ok"); got != "dns-ok" { + t.Errorf("DNS inside the guest: %q", got) + } + sshRun(t, c, "echo persisted > /home/"+vmTestUser+"/keep.txt && sync") + + // The serial console is the instance's console output. + out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string) + if raw, err := base64.StdEncoding.DecodeString(out); err != nil || !strings.Contains(string(raw), "Cloud-init v.") { + t.Errorf("console output lacks cloud-init lines (%v): %.300s", err, out) + } + // Commands inside a VM are not available yet, with a clear error. + if msg, err := h.AWSErr(t, "ec2", "create-image", "--instance-id", id, "--name", "vm-img"); err == nil || !strings.Contains(msg, "not supported yet") { + t.Errorf("create-image of a VM: %v %s", err, msg) + } + c.Close() + + // Stop and start keep the disk. + h.AWS(t, "ec2", "stop-instances", "--instance-ids", id) + f.vmWaitState(t, id, "stopped") + if h.Env.Docker.State(i.ContainerID) == "running" { + t.Error("container still running after stop") + } + h.AWS(t, "ec2", "start-instances", "--instance-ids", id) + i = f.vmWaitState(t, id, "running") + c = sshDial(t, i.PublicPorts["22/tcp"], signer, vmTestUser) + if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt && cat /var/tmp/userdata.txt"); got != "persisted\nhc-userdata-ran" { + t.Errorf("after stop/start: %q", got) + } + if got := sshRun(t, c, "curl -s -m 10 http://169.254.169.254/latest/meta-data/instance-id"); got != id { + t.Errorf("after start, instance-id from metadata = %q", got) + } + c.Close() + + // Security groups apply to the guest. With the world-open rule the probe reaches SSH. + f.bannerEventually(t, true, helper, ip, "world-open rule") + // Revoking it unpublishes the port; the container is rebuilt, so the guest reboots. + h.AWS(t, "ec2", "revoke-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "0.0.0.0/0") + waitFor(t, "port unpublished", 10*time.Minute, func() bool { g := f.vmGet(id); return g.State == "running" && len(g.PublicPorts) == 0 }) + // A rule for the probe's address only lets it in, once the guest is back up. + h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32") + f.bannerEventually(t, true, helper, ip, "rule for the probe") + // Revoking that rule closes SSH for the running guest (nothing to unpublish, no reboot). + h.AWS(t, "ec2", "revoke-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32") + f.bannerEventually(t, false, helper, ip, "rule revoked") + for n := 0; n < 3; n++ { + if f.banner(t, helper, ip) { + t.Fatal("SSH reachable without a rule") + } + } + h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32") + f.bannerEventually(t, true, helper, ip, "rule for the probe again") + // A loopback-only rule publishes the port again (another rebuild); the disk survived. + h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "127.0.0.1/32") + waitFor(t, "loopback port published", 10*time.Minute, func() bool { return f.vmGet(id).PublicPorts["22/tcp"] > 0 }) + c = sshDial(t, f.vmGet(id).PublicPorts["22/tcp"], signer, vmTestUser) + if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt"); got != "persisted" { + t.Errorf("after the rebuild: %q", got) + } + c.Close() + + // Terminate removes the container and the root volume. + cid := f.vmGet(id).ContainerID + h.AWS(t, "ec2", "terminate-instances", "--instance-ids", id) + terminated = true + f.vmWaitState(t, id, "terminated") + if st := h.Env.Docker.State(cid); st != "missing" { + t.Errorf("container is %s after terminate", st) + } + if _, err := h.Env.Docker.C.InspectVolume("hc-" + volID); err == nil { + t.Errorf("root volume %s still exists after terminate", volID) + } else if !errors.Is(err, docker.ErrNoSuchVolume) { + t.Errorf("inspect volume: %v", err) + } + if out := h.AWS(t, "ec2", "describe-volumes", "--filters", "Name=volume-id,Values="+volID); strings.Contains(out, volID) { + t.Errorf("volume record %s remains: %s", volID, out) + } +} + +// launchImage starts a container instance of a catalog image in the test VPC. +func (f *filterEnv) launchImage(t *testing.T, image string, sgs ...string) node { + t.Helper() + args := []string{"ec2", "run-instances", "--image-id", image, "--subnet-id", f.subnet} + if len(sgs) > 0 { + args = append(args, "--security-group-ids") + args = append(args, sgs...) + } + i := f.h.AWSJSON(t, args...)["Instances"].([]any)[0].(map[string]any) + n := node{id: i["InstanceId"].(string), ip: i["PrivateIpAddress"].(string)} + t.Cleanup(func() { _, _ = f.h.AWSErr(t, "ec2", "terminate-instances", "--instance-ids", n.id) }) + waitFor(t, n.id+" running", 3*time.Minute, func() bool { return f.container(n) != "" }) + return n +} + +// The VM AMIs are in the catalog and marked as virtual machines. +func TestVMImagesInCatalog(t *testing.T) { + h := liveHarness(t) + out := h.AWSJSON(t, "ec2", "describe-images", "--image-ids", vmTestImage, "ami-ubuntu-24-04")["Images"].([]any) + if len(out) != 2 { + t.Fatalf("images: %v", out) + } + for _, im := range out { + m := im.(map[string]any) + isVM := m["ImageId"] == vmTestImage + want := "xen" + if isVM { + want = "kvm" + if !strings.HasSuffix(m["Description"].(string), "with its own kernel and cloud-init") && !strings.Contains(m["Description"].(string), "virtual machine") { + t.Errorf("VM image description %q does not say it is a virtual machine", m["Description"]) + } + if !strings.Contains(m["Name"].(string), "/vm/") { + t.Errorf("VM image name %q is not distinct from the container image's", m["Name"]) + } + } + if m["Hypervisor"] != want || m["VirtualizationType"] != "hvm" { + t.Errorf("%v: hypervisor %v, virtualization %v", m["ImageId"], m["Hypervisor"], m["VirtualizationType"]) + } + } + var imgs []struct { + ID string `json:"id"` + Name string `json:"name"` + Virtualization string `json:"virtualization"` + } + if err := json.Unmarshal(h.Native(t, "GET", "/api/v1/ec2/images", nil), &imgs); err != nil { + t.Fatal(err) + } + seen := map[string]string{} + for _, im := range imgs { + seen[im.ID] = im.Virtualization + if im.Virtualization == "vm" && !strings.HasSuffix(im.Name, "(VM)") { + t.Errorf("VM image %s named %q", im.ID, im.Name) + } + } + if seen[vmTestImage] != "vm" || seen["ami-debian-12-vm"] != "vm" || seen["ami-ubuntu-24-04"] != "container" || seen["ami-nginx"] != "container" { + t.Errorf("virtualization by image: %v", seen) + } +} diff --git a/cli/internal/svc/ec2/volumes.go b/cli/internal/svc/ec2/volumes.go index 99b4eceb..82e5e248 100644 --- a/cli/internal/svc/ec2/volumes.go +++ b/cli/internal/svc/ec2/volumes.go @@ -207,6 +207,9 @@ func (s *Service) AttachVolume(volumeID, instanceID, device string) (Volume, err if i.State != "running" && i.State != "stopped" { return Volume{}, core.Errf(http.StatusBadRequest, "IncorrectState", "Instance '%s' is not 'running' or 'stopped'.", i.ID) } + if i.IsVM() { + return Volume{}, errVMUnsupported("attaching volumes to") + } for _, a := range i.Volumes { if a.Device == device { return Volume{}, core.Errf(http.StatusBadRequest, "InvalidParameterValue", "Attachment point %s is already in use", device) @@ -277,6 +280,9 @@ func (s *Service) DetachVolume(volumeID, instanceID, device string, force bool) if err != nil { return v, err } + if i.IsVM() { + return v, errVMUnsupported("detaching volumes from") + } v, err = store.Update(s.env.Store, cVolumes, v.ID, func(x *Volume) error { x.AttachState = "detaching"; return nil }) if err != nil { return v, err @@ -360,6 +366,9 @@ func (s *Service) recreate(id string) error { if i.ContainerID == "" || i.State == "terminated" { return nil } + if i.IsVM() { + return s.rebuildVM(i) + } v, err := s.vpc.GetVPC(i.VpcID) if err != nil { return err diff --git a/docs/architecture.md b/docs/architecture.md index d2b1d52e..0adcf678 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -55,6 +55,21 @@ The data directory defaults to `~/.homecloud` (override with `--data-dir` or `HO **EC2.** An instance is a container with CPU quota and memory limits taken from its instance type. OS images (Ubuntu, Debian, …) boot a small init script that runs user data once and then idles, so the instance behaves like a VM that stays up; application images (e.g. `ami-nginx`) run their own entrypoint. Instance metadata is written to `/var/lib/homecloud/instance.json`. Volumes are named Docker volumes. "Create image" commits the container into `homecloud/ami:`. The browser terminal is a WebSocket bridged to `docker exec` with a TTY. +**EC2 VM instances.** The catalog also has VM images (`ami-ubuntu-24-04-vm`, `ami-debian-12-vm`, marked "(VM)", `virtualization: "vm"`, EC2 hypervisor `kvm`): the official cloud images for the Docker host's architecture, pinned to a release and verified by SHA-256/512 after download, kept in a HomeCloud-managed Docker volume (`hc-vm-images`) so each is downloaded once. Launching one starts a **VM container**: a Docker container, built locally on first use from `cli/internal/svc/ec2/vm/runner.Dockerfile` (Debian pinned by digest with QEMU, passt, UEFI firmware, genisoimage, tagged by content hash), that runs a single QEMU process. The container is attached to the instance's VPC network with the instance's private IP exactly like a container instance, so everything that is per container keeps working unchanged: VPC addressing, DNS, the metadata service (a route in the container's namespace), security groups (iptables in the container's namespace, which see the guest's traffic because the guest lives behind the container's sockets) and published ports. + +| | Container instance | VM instance | +|---|---|---| +| Kernel, init | the host's; a small init script or the image's entrypoint | the guest's own; systemd, cloud-init | +| Root disk | writable layer of the container | qcow2 overlay on the cached cloud image, in the root EBS volume (`/dev/xvda`, sized by the root block device mapping, default 8 GiB) | +| Networking | the container's veth | the same veth; passt gives the guest the container's address, gateway and routes and forwards every inbound TCP and UDP port to it | +| Login | `docker exec` (terminal, run-command) | SSH with the key pair (the image's default user `ubuntu` or `debian`) | +| User data, key | boot script, `/root/.ssh/authorized_keys` | cloud-init NoCloud seed ISO (`cidata`): instance ID, hostname, the key pair's public key, user data as sent (script, `#cloud-config`, ...) | +| Console output | container log | the guest's serial console (the container log) | +| Stop, reboot | container stop, restart | ACPI power button through QMP, then a kill after a timeout; reboot is stop + start of the same container | +| Terminate | container and volumes removed | container removed; root volume removed unless `DeleteOnTermination` is false | + +The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. The VM container runs with Docker's default seccomp profile relaxed (`seccomp=unconfined`) because passt isolates itself with a user namespace; it gets no extra capabilities, and `/dev/kvm` only when accelerated. + **Security groups.** Ingress and egress rules are enforced between the resources of a VPC, not only at the host boundary. Every resource that has security groups (an EC2 instance, an ECS task, an RDS or ElastiCache node, a load balancer, a Lambda environment with a VPC configuration) gets an iptables ruleset rendered from its groups and loaded into *its own network namespace*: ingress is default-deny, a packet is accepted when a rule of one of the resource's groups matches its protocol, port range (ICMP type and code) and source, and replies to accepted connections always flow back (connection tracking, so rules are stateful in both directions). A source is a CIDR or a referenced group ("from sg-app" = from every resource that has sg-app), which HomeCloud resolves to the group members' current addresses inside the VPC. A resource with no groups is in the VPC's default group, which (as in AWS) allows all inbound traffic from its own members. Egress is not filtered while a resource's groups still contain the default allow-all rule; once it is revoked, only the egress rules (plus DNS and the instance metadata service, which are always reachable) let traffic out. A load balancer is a member of its own groups, so its traffic to a target is judged by the target's groups (the target's group must allow the balancer's group), and health checks obey them too. Listener ports of internet-facing balancers, publicly accessible databases and Lambda emulator ports are published on the host whatever the groups say, so traffic from outside the VPC to them is accepted and the groups filter only what comes from inside it. The rules are loaded by a short-lived helper container that joins the target's namespace with `NET_ADMIN` (`docker run --net container: --cap-add NET_ADMIN`). That is portable: it behaves the same on Linux Docker, Docker Desktop and OrbStack, where containers live in a VM and the host has no view of their firewall, it needs no host root, and the resource itself gets no extra capability and cannot alter its own rules. The helper image (`homecloud/sgfw`) is built locally the first time from a Dockerfile in the repository (Alpine pinned by digest plus the `iptables` package), so the first launch after an upgrade needs network access to build it. Rules live in the namespace, which Docker rebuilds whenever a container starts, so HomeCloud re-applies them on launch, on every container start (it watches Docker's start events, which covers reboot, restart policies and re-creation), when a group's rules change, when a resource's groups change, and when a resource that a group rule refers to appears or disappears; a pass every few seconds catches the rest. Each application is one atomic `iptables-restore`, so a change never opens a gap. @@ -112,7 +127,7 @@ Published versions are immutable snapshots of `$LATEST` (configuration and a cop ## Limits and differences from AWS -- Instances are containers, not VMs: they share the host kernel, and their "disk" is the container's writable layer. VM-backed instances (QEMU/KVM) are on the roadmap. +- Instances are containers unless their AMI is a VM image (see **EC2 VM instances** above): container instances share the host kernel, and their "disk" is the container's writable layer. VM instances are QEMU guests with their own kernel and disk, but only the lifecycle is covered so far: extra volumes, snapshots and images of a VM disk, the browser terminal, run-command, CloudWatch metrics, backup and native macOS acceleration are not available for them yet, and they are emulated (slow) on Docker hosts without `/dev/kvm`. - Security groups filter traffic between resources of a VPC (see Security groups above) and decide which ports are published on the host. Published ports are still fixed at container creation: an instance whose published ports no longer match its groups is recreated from a snapshot of its disk (ID, private IP, volumes and tags are kept, the same host ports are reused for ports that stay open, processes restart), while changes to filtering apply live, with no restart. Limits of the filtering: - Covered: EC2 instances, ECS tasks, RDS and ElastiCache nodes, load balancers, and Lambda environments of functions with a VPC configuration. EFS mount targets carry security groups in the API, but a file system is a Docker volume mounted into the instance and there is no network path to filter, so they are recorded only. - Ingress sources that can be matched are IPv4 CIDRs and groups of the same VPC. Prefix lists and IPv6 ranges are recorded but match nothing (VPC networks are IPv4 only), and groups of a peer VPC do not exist (there is no peering). Network ACLs are recorded, not enforced. diff --git a/docs/aws-compat.md b/docs/aws-compat.md index fb61f3c3..0cd5e508 100644 --- a/docs/aws-compat.md +++ b/docs/aws-compat.md @@ -92,7 +92,7 @@ connection to HomeCloud itself is TLS, so behind a TLS-terminating proxy it is f | EventBridge | events | awsJson 1.1 | Buses, rules with full pattern syntax, targets with transforms | | EventBridge Scheduler | scheduler | restJson1 | Schedules and groups | | Elastic Load Balancing v2 | elasticloadbalancing | awsQuery | Application load balancers, target groups (instance and ip), listeners (HTTP/HTTPS with ACM certificates), rules (path and host conditions; forward, redirect and fixed-response actions), attributes, tags | -| EC2 | ec2 | ec2 Query | Instances, security groups, key pairs, volumes and snapshots, VPC networking, launch templates, Elastic IPs (see notes) | +| EC2 | ec2 | ec2 Query | Instances (containers, or virtual machines from the `(VM)` AMIs), security groups, key pairs, volumes and snapshots, VPC networking, launch templates, Elastic IPs (see notes) | | EC2 Auto Scaling | autoscaling | awsQuery | Groups from EC2 launch templates, target-tracking policies (average CPU), target group attachment, tags, suspend/resume, scaling activities | | Elastic Container Registry | ecr | awsJson 1.1 | Repositories, images (list, describe, batch get/delete), `get-login-password` for `docker login` against the HomeCloud registry, lifecycle and repository policies (stored, not enforced), tag mutability and scan settings (stored), tags | | Elastic Container Service | ecs | awsJson 1.1 | Clusters, task definitions (one container per task; images, ports, environment, Secrets Manager and SSM secrets, `awslogs` to CloudWatch Logs, task role credentials), services (Fargate/awsvpc, ELBv2 target group, rolling deployments with deployment status), RunTask/StopTask, capacity providers (FARGATE), tags | @@ -109,6 +109,7 @@ connection to HomeCloud itself is TLS, so behind a TLS-terminating proxy it is f Notes: - Terraform's S3 support prefixes the endpoint host with the account ID, so use `http://localhost:PORT`, not an IP address. +- EC2 VM instances: the AMIs `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` (named `homecloud/vm/...`, so an `aws_ami` lookup for the usual `ubuntu/images/...` names still finds the container images) boot the official cloud image as a QEMU virtual machine; `DescribeImages` and `DescribeInstances` report `VirtualizationType: hvm` and `Hypervisor: kvm` for them (`xen` for container images). `RunInstances` takes the same parameters: `KeyName` authorizes the key for the image's default user (`ubuntu`, `debian`), `UserData` goes to cloud-init unchanged (scripts, `#cloud-config`), and the root `BlockDeviceMappings` entry (`/dev/xvda`, `/dev/sda1` or `/dev/sda`) sets the root disk size (default 8 GiB, at least 4) and `DeleteOnTermination`. The root disk shows up in `DescribeVolumes` and `DescribeInstances` as an attached volume at `/dev/xvda`. `GetConsoleOutput` returns the guest's serial console. Instances stay `pending` until the guest has booted. Guests are emulated, and slow, when the Docker host has no `/dev/kvm`; the native API's `virtualization` field says `kvm` or `emulated`. Not supported yet, with an `UnsupportedOperation` error: attaching or detaching volumes, extra block devices or file systems at launch, `CreateImage`, the browser terminal and run-command. Snapshots, backups and CloudWatch metrics of VM disks are not covered either. - EC2 Elastic IPs (`AllocateAddress`, `DescribeAddresses`, `AssociateAddress`, `DisassociateAddress`, `ReleaseAddress`) are records, not routed addresses. An allocation (`eipalloc-...`) reserves a stable address from the pool in the `elastic_ip_pool` config setting (default `203.0.113.0/24`, a documentation range), and an association (`eipassoc-...`) makes an instance report it as its public IP in `DescribeInstances`, network interfaces and the instance metadata service. It follows the instance across stop and start and is released from it when the instance is terminated. Only `vpc` addresses, one Elastic IP per instance (a second association replaces the first) and instance or primary-interface targets are supported, and bringing your own address is not. Traffic to an instance still arrives on the host ports published by its security groups at the HomeCloud host (`public_host`), not on the Elastic IP. - Security groups are enforced inside the VPC. Ingress rules (protocol, ports or ICMP type/code, and an IPv4 CIDR or a referenced group) decide which resources may open connections to an instance, ECS task, RDS or ElastiCache node, load balancer or VPC-attached Lambda environment; anything else is dropped, replies to allowed connections flow back, and a resource with no group is in the VPC's default group, which allows traffic from its own members. Egress rules are enforced once the default allow-all egress rule has been revoked (DNS and the metadata service always stay reachable). A load balancer's traffic to its targets, health checks included, is judged by the targets' groups. Rules are programmed live into each container's network namespace when rules or group membership change, when resources start, restart or terminate, and when the members of a referenced group change; see [architecture.md](architecture.md#limits-and-differences-from-aws) for the mechanism and its limits (prefix lists and IPv6 sources match nothing, EFS mount targets are recorded only, network ACLs are not enforced). Rules that publish host ports (`0.0.0.0/0` or `127.0.0.1/32`, TCP/UDP, up to 32 ports) still recreate an instance's container when its published ports change (processes restart, disk, volumes and IP are kept); filtering changes never restart anything. Requests use the query API's `IpPermissions.N.Groups` member (`UserIdGroupPairs` is accepted too) for group sources. - Route 53 records are rendered into CoreDNS zone files and picked up within a few seconds; `GetChange` reports `INSYNC` immediately. Public zones answer on the host's DNS port and inside VPCs, private zones only inside their associated VPCs. Each zone has a default apex NS and SOA (shown in listings, not deletable). Alias targets are load balancer DNS names (`.elb.internal`, as returned by ELBv2) and follow the balancer's address. Not supported: routing policies (weighted, latency, failover, geolocation, multivalue; `SetIdentifier` is rejected), health checks, DNSSEC, traffic policies, delegation sets, other alias targets (CloudFront, S3 websites), and `SPF`/`NAPTR`/`DS` records. Names are absolute with or without the trailing dot; a wildcard is returned as `\052`. A public zone's name server is `ns.`. From e415462e7d254b400b665f2b76259d13d2912230 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 20:37:59 +0530 Subject: [PATCH 03/25] VM instances: user-mode networking fallback when passt is unavailable, tests, CI job and docs --- cli/internal/svc/ec2/vm.go | 11 +++++ cli/internal/svc/ec2/vm/hc-vm-run | 31 ++++++++++---- cli/internal/svc/ec2/vm_internal_test.go | 49 +++++++++++++++++++++++ cli/internal/svc/ec2/vm_live_test.go | 42 ++++++++++++++----- cli/internal/svc/vpc/ingressports_test.go | 43 ++++++++++++++++++++ cli/internal/svc/vpc/vpc.go | 31 ++++++++++++++ 6 files changed, 189 insertions(+), 18 deletions(-) create mode 100644 cli/internal/svc/ec2/vm_internal_test.go create mode 100644 cli/internal/svc/vpc/ingressports_test.go diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go index 298c679c..1faebb9d 100644 --- a/cli/internal/svc/ec2/vm.go +++ b/cli/internal/svc/ec2/vm.go @@ -248,6 +248,8 @@ func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec { Hostname: strings.TrimSuffix(inst.PrivateDNS, ".internal"), Env: map[string]string{ "HC_VM_BASE": base.CacheName(mach.Arch), "HC_VM_DISK_GB": strconv.Itoa(inst.VMDiskGB), "HC_VM_ARCH": string(mach.Arch), "HC_VM_DNS": dns, + // Used only when passt is unavailable (or HC_VM_NET=user is set for the server). + "HC_VM_NET": os.Getenv("HC_VM_NET"), "HC_VM_HOSTFWD": hostFwd(s.vpc.IngressPorts(inst.SecurityGroups, 64)), }, ExtraHosts: []string{runtime.HostAlias}, // passt isolates itself with a user namespace, which Docker's default @@ -260,6 +262,15 @@ func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec { return spec } +// hostFwd renders ports as QEMU user-mode networking forwards. +func hostFwd(ports []runtime.Port) string { + var b strings.Builder + for _, p := range ports { + fmt.Fprintf(&b, ",hostfwd=%s::%d-:%d", p.Protocol, p.ContainerPort, p.ContainerPort) + } + return b.String() +} + // vmSeed is the cloud-init seed of an instance, as files to copy into its container. func (s *Service) vmSeed(inst Instance) map[string][]byte { seed := vm.Seed{InstanceID: inst.ID, Hostname: strings.TrimSuffix(inst.PrivateDNS, ".internal"), UserData: inst.UserData} diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run index 95a3f3c7..893907a8 100644 --- a/cli/internal/svc/ec2/vm/hc-vm-run +++ b/cli/internal/svc/ec2/vm/hc-vm-run @@ -37,14 +37,29 @@ fi dns="" if [ -n "${HC_VM_DNS:-}" ]; then dns="-D $HC_VM_DNS --dns-forward $HC_VM_DNS --dns-host 127.0.0.11"; fi rm -f /run/passt.sock /run/qmp.sock -# shellcheck disable=SC2086 -passt -f -s /run/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & -n=0 -while [ ! -S /run/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done -if [ ! -S /run/passt.sock ]; then - echo "[homecloud] passt did not start:" >&2 - cat /run/passt.log >&2 - exit 1 +if [ "${HC_VM_NET:-}" != "user" ]; then + # shellcheck disable=SC2086 + passt -f -s /run/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & + n=0 + while [ ! -S /run/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done + if [ ! -S /run/passt.sock ]; then + echo "[homecloud] passt did not start; falling back to user-mode networking:" >&2 + cat /run/passt.log >&2 + HC_VM_NET=user + fi +fi +if [ "${HC_VM_NET:-}" = "user" ]; then + # QEMU's user-mode networking: the guest sits behind NAT at 10.0.2.15 and + # only the ports HC_VM_HOSTFWD lists (",hostfwd=tcp::22-:22,...", the ports + # the security groups allow when the container was created) reach it. + n=$# + while [ "$n" -gt 0 ]; do + a=$1; shift; n=$((n-1)) + case "$a" in + stream,id=net0,*) a="user,id=net0${HC_VM_HOSTFWD:-}" ;; + esac + set -- "$@" "$a" + done fi echo "[homecloud] starting the virtual machine" diff --git a/cli/internal/svc/ec2/vm_internal_test.go b/cli/internal/svc/ec2/vm_internal_test.go new file mode 100644 index 00000000..807a3822 --- /dev/null +++ b/cli/internal/svc/ec2/vm_internal_test.go @@ -0,0 +1,49 @@ +package ec2 + +import ( + "testing" + + "github.com/homecloudhq/homecloud/cli/internal/runtime" +) + +func TestHostFwd(t *testing.T) { + if got := hostFwd(nil); got != "" { + t.Errorf("no ports: %q", got) + } + got := hostFwd([]runtime.Port{{ContainerPort: 22, Protocol: "tcp"}, {ContainerPort: 53, Protocol: "udp"}}) + if want := ",hostfwd=tcp::22-:22,hostfwd=udp::53-:53"; got != want { + t.Errorf("hostFwd = %q, want %q", got, want) + } +} + +func TestVMImagesAreMarked(t *testing.T) { + seen := 0 + for _, im := range catalog { + n := im.normalized() + if !im.IsVM() { + if n.Virtualization != "container" || im.Ref == "" { + t.Errorf("%s: container image %+v", im.ID, n) + } + continue + } + seen++ + if n.Virtualization != "vm" || im.Ref != "" || im.KeepAlive { + t.Errorf("%s: VM image %+v", im.ID, n) + } + if len(im.Name) < 5 || im.Name[len(im.Name)-4:] != "(VM)" { + t.Errorf("%s: name %q does not end in (VM)", im.ID, im.Name) + } + if im.AWSName == "" || im.OwnerID == "" { + t.Errorf("%s: no AWS name or owner", im.ID) + } + } + if seen < 2 { + t.Errorf("only %d VM images in the catalog", seen) + } +} + +func TestErrVMUnsupported(t *testing.T) { + if err := errVMUnsupported("attaching volumes to"); err == nil || err.Error() != "UnsupportedOperation: attaching volumes to VM instances is not supported yet" { + t.Errorf("%v", err) + } +} diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go index 430c0531..f250f193 100644 --- a/cli/internal/svc/ec2/vm_live_test.go +++ b/cli/internal/svc/ec2/vm_live_test.go @@ -2,7 +2,6 @@ package ec2_test import ( "context" - "encoding/base64" "encoding/json" "errors" "fmt" @@ -28,11 +27,15 @@ import ( // // (DOCKER_HOST=unix://$HOME/.orbstack/run/docker.sock on macOS with OrbStack). -const ( - vmTestImage = "ami-ubuntu-24-04-vm" - vmTestUser = "ubuntu" - vmTestBudget = 40 * time.Minute // per wait for a guest to boot; TCG is slow -) +const vmTestBudget = 40 * time.Minute // per wait for a guest to boot; TCG is slow + +// The Ubuntu image is the default; HC_TEST_VM_IMAGE=debian boots Debian instead (faster to boot emulated). +var vmTestImage, vmTestUser = func() (string, string) { + if os.Getenv("HC_TEST_VM_IMAGE") == "debian" { + return "ami-debian-12-vm", "debian" + } + return "ami-ubuntu-24-04-vm", "ubuntu" +}() type vmInstance struct { State string `json:"state"` @@ -77,7 +80,6 @@ func (f *filterEnv) startIMDS(t *testing.T) { srv := &http.Server{Handler: mux} go srv.Serve(ln) f.h.Env.ContainerAPI = fmt.Sprintf("http://host.docker.internal:%d", ln.Addr().(*net.TCPAddr).Port) - f.ec2.IMDSContainer = fmt.Sprintf("hc-test-imds-%d", time.Now().UnixNano()%1e9) ctx, cancel := context.WithCancel(context.Background()) done := make(chan struct{}) go func() { f.ec2.RunIMDS(ctx); close(done) }() @@ -162,6 +164,19 @@ func TestVMInstanceLifecycle(t *testing.T) { f := newFilterEnv(t) h := f.h f.ec2.VMImageVolume = "hc-test-vm-images" + // Our own metadata service container, named before anything can attach the + // default one (a real installation's) to the test VPC. + f.ec2.IMDSContainer = fmt.Sprintf("hc-test-imds-%d", time.Now().UnixNano()%1e9) + // Published ports need a VPC with an internet gateway (otherwise its network is internal). + f.vpc.NetworkChanged = f.ec2.NetworkChanged + igw := h.AWSJSON(t, "ec2", "create-internet-gateway")["InternetGateway"].(map[string]any)["InternetGatewayId"].(string) + h.AWS(t, "ec2", "attach-internet-gateway", "--internet-gateway-id", igw, "--vpc-id", f.vpcID) + rtb := h.AWSJSON(t, "ec2", "describe-route-tables", "--filters", "Name=vpc-id,Values="+f.vpcID)["RouteTables"].([]any)[0].(map[string]any)["RouteTableId"].(string) + h.AWS(t, "ec2", "create-route", "--route-table-id", rtb, "--destination-cidr-block", "0.0.0.0/0", "--gateway-id", igw) + t.Cleanup(func() { + _, _ = h.AWSErr(t, "ec2", "detach-internet-gateway", "--internet-gateway-id", igw, "--vpc-id", f.vpcID) + _, _ = h.AWSErr(t, "ec2", "delete-internet-gateway", "--internet-gateway-id", igw) + }) f.startIMDS(t) // A key pair, and a security group that lets SSH in from anywhere (published on the host). @@ -198,6 +213,10 @@ func TestVMInstanceLifecycle(t *testing.T) { t.Fatalf("instance reports virtualization %q, user %q", i.Virtualization, i.VMUser) } if i.PublicPorts["22/tcp"] == 0 { + ci, _ := h.Env.Docker.Inspect(i.ContainerID) + if ci != nil { + t.Logf("port bindings %v, network ports %v", ci.HostConfig.PortBindings, ci.NetworkSettings.Ports) + } t.Fatalf("ssh not published: %v", i.PublicPorts) } // The root volume is an EBS volume attached at /dev/xvda with the requested size. @@ -240,15 +259,16 @@ func TestVMInstanceLifecycle(t *testing.T) { sshRun(t, c, "echo persisted > /home/"+vmTestUser+"/keep.txt && sync") // The serial console is the instance's console output. - out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string) - if raw, err := base64.StdEncoding.DecodeString(out); err != nil || !strings.Contains(string(raw), "Cloud-init v.") { - t.Errorf("console output lacks cloud-init lines (%v): %.300s", err, out) + // (The AWS CLI decodes the base64 output itself.) + if out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string); !strings.Contains(out, "Cloud-init v.") || !strings.Contains(out, "finished at") { + t.Errorf("console output lacks cloud-init lines: %.300s", out) } // Commands inside a VM are not available yet, with a clear error. if msg, err := h.AWSErr(t, "ec2", "create-image", "--instance-id", id, "--name", "vm-img"); err == nil || !strings.Contains(msg, "not supported yet") { t.Errorf("create-image of a VM: %v %s", err, msg) } c.Close() + t.Logf("guest checks passed") // Stop and start keep the disk. h.AWS(t, "ec2", "stop-instances", "--instance-ids", id) @@ -266,6 +286,7 @@ func TestVMInstanceLifecycle(t *testing.T) { t.Errorf("after start, instance-id from metadata = %q", got) } c.Close() + t.Logf("stop/start kept the disk") // Security groups apply to the guest. With the world-open rule the probe reaches SSH. f.bannerEventually(t, true, helper, ip, "world-open rule") @@ -293,6 +314,7 @@ func TestVMInstanceLifecycle(t *testing.T) { t.Errorf("after the rebuild: %q", got) } c.Close() + t.Logf("security group rules and the rebuild verified") // Terminate removes the container and the root volume. cid := f.vmGet(id).ContainerID diff --git a/cli/internal/svc/vpc/ingressports_test.go b/cli/internal/svc/vpc/ingressports_test.go new file mode 100644 index 00000000..3c89b9fe --- /dev/null +++ b/cli/internal/svc/vpc/ingressports_test.go @@ -0,0 +1,43 @@ +package vpc + +import ( + "strconv" + "testing" + + "github.com/homecloudhq/homecloud/cli/internal/store" + "github.com/homecloudhq/homecloud/cli/internal/svc/svctest" +) + +func TestIngressPorts(t *testing.T) { + s := &Service{env: svctest.Env(t)} + put := func(id string, rules ...Rule) { + if err := store.Put(s.env.Store, cSGs, id, SecurityGroup{ID: id, Ingress: rules}); err != nil { + t.Fatal(err) + } + } + put("sg-a", + Rule{Protocol: "tcp", FromPort: 22, ToPort: 22, CIDR: "10.0.0.0/8"}, // any source counts + Rule{Protocol: "udp", FromPort: 53, ToPort: 53, SourceGroup: "sg-b"}, + Rule{Protocol: "tcp", FromPort: 8000, ToPort: 8002, CIDR: "0.0.0.0/0"}, + Rule{Protocol: "icmp", FromPort: -1, ToPort: -1, CIDR: "0.0.0.0/0"}, // not a port + Rule{Protocol: "-1", FromPort: 0, ToPort: 65535, CIDR: "0.0.0.0/0"}, // all traffic: too many ports + ) + put("sg-b", Rule{Protocol: "tcp", FromPort: 22, ToPort: 22, CIDR: "0.0.0.0/0"}, Rule{Protocol: "tcp", FromPort: 1000, ToPort: 2000, CIDR: "0.0.0.0/0"}) + + var list []string + for _, p := range s.IngressPorts([]string{"sg-a", "sg-b", "sg-missing"}, 64) { + list = append(list, p.Protocol+":"+strconv.Itoa(p.ContainerPort)) + } + want := []string{"tcp:22", "udp:53", "tcp:8000", "tcp:8001", "tcp:8002"} + if len(list) != len(want) { + t.Fatalf("ports %v, want %v (the 1001-port range and all-traffic rule exceed the limit, 22 is listed once)", list, want) + } + for i := range want { + if list[i] != want[i] { + t.Fatalf("ports %v, want %v", list, want) + } + } + if n := len(s.IngressPorts([]string{"sg-a"}, 2)); n != 2 { + t.Errorf("limit 2 returned %d ports", n) + } +} diff --git a/cli/internal/svc/vpc/vpc.go b/cli/internal/svc/vpc/vpc.go index dc1bd5b2..e698a0f3 100644 --- a/cli/internal/svc/vpc/vpc.go +++ b/cli/internal/svc/vpc/vpc.go @@ -391,6 +391,37 @@ func (s *Service) PublishedPorts(ids []string) []runtime.Port { return out } +// IngressPorts lists the TCP and UDP ports the ingress rules of the given +// groups open, whatever their source, up to limit ports. It is for +// listeners that must be created per port (a VM without passt); a rule for +// more ports than remain under the limit, or for all protocols, is skipped. +func (s *Service) IngressPorts(ids []string, limit int) []runtime.Port { + seen := map[string]bool{} + var out []runtime.Port + for _, id := range ids { + g, err := store.Get[SecurityGroup](s.env.Store, cSGs, id) + if err != nil { + continue + } + for _, r := range g.Ingress { + if (r.Protocol != "tcp" && r.Protocol != "udp") || r.FromPort < 1 || r.ToPort > 65535 || r.FromPort > r.ToPort { + continue + } + if r.ToPort-r.FromPort+1 > limit-len(out) { + continue + } + for p := r.FromPort; p <= r.ToPort; p++ { + k := fmt.Sprintf("%d/%s", p, r.Protocol) + if !seen[k] { + seen[k] = true + out = append(out, runtime.Port{ContainerPort: p, Protocol: r.Protocol}) + } + } + } + } + return out +} + func (s *Service) GetVPC(id string) (VPC, error) { return store.Get[VPC](s.env.Store, cVPCs, id) } // List returns every VPC. From e4f9244a367fe288526158f734041c1d2ff9957f Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 21:15:45 +0530 Subject: [PATCH 04/25] VM instances: detect a passt that exits after binding, keep the cloud image cache out of backups, shorter shutdown wait --- cli/internal/svc/ec2/ports.go | 2 +- cli/internal/svc/ec2/vm.go | 27 ++++++++++++++++++++++++--- cli/internal/svc/ec2/vm/hc-vm-run | 8 ++++++-- cli/internal/svc/ec2/vm_live_test.go | 3 ++- cli/internal/system/backup.go | 3 +++ docs/architecture.md | 6 +++++- 6 files changed, 41 insertions(+), 8 deletions(-) diff --git a/cli/internal/svc/ec2/ports.go b/cli/internal/svc/ec2/ports.go index 4a5d97ca..6fe8b6f0 100644 --- a/cli/internal/svc/ec2/ports.go +++ b/cli/internal/svc/ec2/ports.go @@ -98,7 +98,7 @@ func (s *Service) portsMatch(inst Instance) bool { return false } } - return true + return s.vmFwdMatches(inst) } // groupChanged applies a changed security group to the instances using it. diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go index 1faebb9d..92534dd8 100644 --- a/cli/internal/svc/ec2/vm.go +++ b/cli/internal/svc/ec2/vm.go @@ -262,6 +262,26 @@ func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec { return spec } +// vmFwdMatches reports whether a VM container forwards the ports its groups +// allow. That only matters with user-mode networking (HC_VM_NET=user), where +// QEMU forwards a fixed list of ports given at creation; with passt every +// port reaches the guest and nothing needs rebuilding. +func (s *Service) vmFwdMatches(inst Instance) bool { + if !inst.IsVM() || os.Getenv("HC_VM_NET") != "user" { + return true + } + c, err := s.env.Docker.Inspect(inst.ContainerID) + if err != nil || c.Config == nil { + return true + } + for _, e := range c.Config.Env { + if v, ok := strings.CutPrefix(e, "HC_VM_HOSTFWD="); ok { + return v == hostFwd(s.vpc.IngressPorts(inst.SecurityGroups, 64)) + } + } + return true +} + // hostFwd renders ports as QEMU user-mode networking forwards. func hostFwd(ports []runtime.Port) string { var b strings.Builder @@ -419,9 +439,9 @@ func (s *Service) vmWaitReady(inst Instance, since time.Time) error { // vmShutdownTimeout is how long the guest gets to power off after the ACPI request. func vmShutdownTimeout(inst Instance) time.Duration { if inst.Virtualization == "kvm" { - return 2 * time.Minute + return 90 * time.Second } - return 4 * time.Minute + return 3 * time.Minute } // vmPowerOff asks the guest to shut down (ACPI power button through QMP) and @@ -450,7 +470,8 @@ func (s *Service) vmPowerOff(inst Instance) bool { // still there; force skips the graceful part. func (s *Service) vmStop(inst Instance, force bool) error { if !force && !s.vmPowerOff(inst) { - log.Printf("ec2: %s did not power off in %s; killing it", inst.ID, vmShutdownTimeout(inst)) + out, _ := s.env.Docker.Logs(inst.ContainerID, 12, time.Time{}) + log.Printf("ec2: %s did not power off in %s; killing it. Console: %s", inst.ID, vmShutdownTimeout(inst), tail(out, 1500)) } return s.env.Docker.Stop(inst.ContainerID, 0) } diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run index 893907a8..a80a7ba6 100644 --- a/cli/internal/svc/ec2/vm/hc-vm-run +++ b/cli/internal/svc/ec2/vm/hc-vm-run @@ -7,7 +7,8 @@ # /hc/seed cloud-init NoCloud files, written by HomeCloud before the first start # # Environment: HC_VM_BASE (file in /images), HC_VM_DISK_GB, HC_VM_ARCH -# (aarch64|x86_64), HC_VM_DNS (comma separated resolvers for the guest). +# (aarch64|x86_64), HC_VM_DNS (the resolver address the guest is given), +# HC_VM_NET=user and HC_VM_HOSTFWD (user-mode networking, see below). # The arguments are the QEMU command line. set -eu @@ -40,9 +41,12 @@ rm -f /run/passt.sock /run/qmp.sock if [ "${HC_VM_NET:-}" != "user" ]; then # shellcheck disable=SC2086 passt -f -s /run/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & + pid=$! n=0 while [ ! -S /run/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done - if [ ! -S /run/passt.sock ]; then + # passt binds its socket first and isolates itself afterwards; it can still exit then. + sleep 0.5 + if [ ! -S /run/passt.sock ] || ! kill -0 "$pid" 2>/dev/null; then echo "[homecloud] passt did not start; falling back to user-mode networking:" >&2 cat /run/passt.log >&2 HC_VM_NET=user diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go index f250f193..0cb78081 100644 --- a/cli/internal/svc/ec2/vm_live_test.go +++ b/cli/internal/svc/ec2/vm_live_test.go @@ -244,7 +244,8 @@ func TestVMInstanceLifecycle(t *testing.T) { if got := sshRun(t, c, "curl -s -m 10 http://169.254.169.254/latest/meta-data/instance-id"); got != id { t.Errorf("instance-id from the metadata service inside the guest = %q, want %q", got, id) } - if got := sshRun(t, c, "ip -4 -o addr show scope global"); !strings.Contains(got, ip+"/") { + // (With HC_VM_NET=user, the fallback, the guest sits behind NAT at 10.0.2.15.) + if got := sshRun(t, c, "ip -4 -o addr show scope global"); os.Getenv("HC_VM_NET") != "user" && !strings.Contains(got, ip+"/") { t.Errorf("guest addresses %q lack the instance's private address %s", got, ip) } if got := sshRun(t, c, "uname -m"); got != "aarch64" && got != "x86_64" { diff --git a/cli/internal/system/backup.go b/cli/internal/system/backup.go index edd1afd2..376c8916 100644 --- a/cli/internal/system/backup.go +++ b/cli/internal/system/backup.go @@ -127,6 +127,9 @@ func (b *Backup) Write(ctx context.Context, w io.Writer, volumes bool, logf func if acct := v.Labels[core.LabelAccount]; acct != b.AccountID && (acct != "" || b.OwnVolumesOnly) { continue // another installation's volume } + if v.Labels[core.LabelService] == "ec2" && v.Labels[core.LabelResource] == "vm-images" { + continue // the cloud image cache: downloaded again when a VM needs it + } lb, _ := json.Marshal(v.Labels) if err := addBytes(tw, "volumes/"+v.Name+".json", lb); err != nil { return err diff --git a/docs/architecture.md b/docs/architecture.md index 0adcf678..09cbbacb 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -68,7 +68,11 @@ The data directory defaults to `~/.homecloud` (override with `--data-dir` or `HO | Stop, reboot | container stop, restart | ACPI power button through QMP, then a kill after a timeout; reboot is stop + start of the same container | | Terminate | container and volumes removed | container removed; root volume removed unless `DeleteOnTermination` is false | -The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. The VM container runs with Docker's default seccomp profile relaxed (`seccomp=unconfined`) because passt isolates itself with a user namespace; it gets no extra capabilities, and `/dev/kvm` only when accelerated. +The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. The VM container runs with Docker's default seccomp profile relaxed (`seccomp=unconfined`) because passt isolates itself with a user namespace; it gets no extra capabilities, and `/dev/kvm` only when accelerated. If passt cannot start (for example a host whose security modules forbid the user namespace), or when the server runs with `HC_VM_NET=user`, the container falls back to QEMU's user-mode networking: the guest then sits behind NAT at 10.0.2.15, still reaches the metadata service and DNS, and only the TCP/UDP ports that the instance's security groups open (at most 64, whatever their source) are forwarded to it; a rule that opens another port takes effect when the container is rebuilt. + +CloudWatch's `HC/EC2` metrics and `homecloud backup` see the VM container: CPU, memory and I/O are QEMU's (not the guest's own numbers), and a backup copies the root volume's qcow2 file, which points at the cached cloud image (the cache volume itself is left out of backups). + +Adding the rest of EBS, snapshots and images to VM instances later needs no new mechanism: extra volumes become virtio disks (`-drive` entries appended to the command line, the volume mounted at `/vm/` in the VM container like the root volume), the root volume's qcow2 file is what a snapshot copies, and run-command and the terminal go through the SSH key or a guest agent instead of `docker exec`. **Security groups.** Ingress and egress rules are enforced between the resources of a VPC, not only at the host boundary. Every resource that has security groups (an EC2 instance, an ECS task, an RDS or ElastiCache node, a load balancer, a Lambda environment with a VPC configuration) gets an iptables ruleset rendered from its groups and loaded into *its own network namespace*: ingress is default-deny, a packet is accepted when a rule of one of the resource's groups matches its protocol, port range (ICMP type and code) and source, and replies to accepted connections always flow back (connection tracking, so rules are stateful in both directions). A source is a CIDR or a referenced group ("from sg-app" = from every resource that has sg-app), which HomeCloud resolves to the group members' current addresses inside the VPC. A resource with no groups is in the VPC's default group, which (as in AWS) allows all inbound traffic from its own members. Egress is not filtered while a resource's groups still contain the default allow-all rule; once it is revoked, only the egress rules (plus DNS and the instance metadata service, which are always reachable) let traffic out. A load balancer is a member of its own groups, so its traffic to a target is judged by the target's groups (the target's group must allow the balancer's group), and health checks obey them too. Listener ports of internet-facing balancers, publicly accessible databases and Lambda emulator ports are published on the host whatever the groups say, so traffic from outside the VPC to them is accepted and the groups filter only what comes from inside it. From 06ecd6fe838d0e901b32ff6a1d20898235a4df83 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 22:04:11 +0530 Subject: [PATCH 05/25] Temporary: probe which container settings let passt start --- .github/workflows/passt-probe.yml | 11 +++++++++++ scripts/passt-probe.sh | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/passt-probe.yml create mode 100644 scripts/passt-probe.sh diff --git a/.github/workflows/passt-probe.yml b/.github/workflows/passt-probe.yml new file mode 100644 index 00000000..d936234e --- /dev/null +++ b/.github/workflows/passt-probe.yml @@ -0,0 +1,11 @@ +name: passt-probe +on: + push: + branches: [ec2-vm-instances] +jobs: + probe: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Probe + run: bash scripts/passt-probe.sh diff --git a/scripts/passt-probe.sh b/scripts/passt-probe.sh new file mode 100644 index 00000000..a8980a6c --- /dev/null +++ b/scripts/passt-probe.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Temporary: which container security settings let passt start? +uname -r; cat /etc/os-release | head -2 +sysctl kernel.apparmor_restrict_unprivileged_userns kernel.unprivileged_userns_clone user.max_user_namespaces 2>&1 +docker info --format '{{.SecurityOptions}}' +docker version --format '{{.Server.Version}}' +docker build -q -t probe -f cli/internal/svc/ec2/vm/runner.Dockerfile cli/internal/svc/ec2/vm +docker network create probenet >/dev/null +run() { + echo "=== $*" + docker run --rm --network probenet --entrypoint bash "$@" probe -c 'passt -f -s /tmp/p.sock -t all -u all >/tmp/passt.log 2>&1 & pid=$!; sleep 1.5; if kill -0 $pid 2>/dev/null; then echo "PASST ALIVE"; else echo "PASST DEAD"; cat /tmp/passt.log; fi; grep -E "^Cap(Eff|Bnd)" /proc/self/status' 2>&1 +} +# options come before the image: reorder by putting them in "$@" +run +run --security-opt seccomp=unconfined +run --security-opt seccomp=unconfined --security-opt apparmor=unconfined +run --security-opt apparmor=unconfined +run --cap-add SYS_ADMIN +run --cap-add SYS_ADMIN --security-opt apparmor=unconfined +run --cap-add SYS_ADMIN --security-opt seccomp=unconfined +run --cap-add SYS_ADMIN --security-opt seccomp=unconfined --security-opt apparmor=unconfined +run --privileged +docker network rm probenet >/dev/null From 9b2e53cf5c8c9a2d802bd4381bef1c217a9e9246 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 22:05:36 +0530 Subject: [PATCH 06/25] Temporary: probe passt with raised nofile --- cli/internal/svc/ec2/ec2.go | 3 +++ cli/internal/svc/ec2/vm.go | 37 +++++++++++++++++++++++++++- cli/internal/svc/ec2/vm_live_test.go | 13 +++++++--- scripts/passt-probe.sh | 25 +++++++++---------- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/cli/internal/svc/ec2/ec2.go b/cli/internal/svc/ec2/ec2.go index 3688ad4b..0fc0a6a4 100644 --- a/cli/internal/svc/ec2/ec2.go +++ b/cli/internal/svc/ec2/ec2.go @@ -124,6 +124,9 @@ type Instance struct { VMBase string `json:"vm_base,omitempty"` // key of the cloud image (vm.Bases) VMUser string `json:"vm_user,omitempty"` // the image's default login user VMDiskGB int `json:"vm_disk_gb,omitempty"` // root disk size + // VMNetwork is "passt" (the guest has the instance's address) or "user" + // (passt could not start: the guest is behind NAT with forwarded ports). + VMNetwork string `json:"vm_network,omitempty"` } // IsVM reports whether the instance is a virtual machine. diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go index 92534dd8..2dd4b227 100644 --- a/cli/internal/svc/ec2/vm.go +++ b/cli/internal/svc/ec2/vm.go @@ -267,7 +267,7 @@ func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec { // QEMU forwards a fixed list of ports given at creation; with passt every // port reaches the guest and nothing needs rebuilding. func (s *Service) vmFwdMatches(inst Instance) bool { - if !inst.IsVM() || os.Getenv("HC_VM_NET") != "user" { + if !inst.IsVM() || (os.Getenv("HC_VM_NET") != "user" && inst.VMNetwork != "user") { return true } c, err := s.env.Docker.Inspect(inst.ContainerID) @@ -373,10 +373,16 @@ func (s *Service) launchVM(inst Instance, network string) { fail(err) return } + netMode := "passt" + if why := s.vmPasstFailure(cid); why != "" { + netMode = "user" + log.Printf("ec2: %s: passt could not start, so the guest uses user-mode networking behind NAT (no private address of its own; only ports allowed at launch are forwarded): %s", inst.ID, why) + } _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error { if x.State != "pending" { // terminated meanwhile return nil } + x.VMNetwork = netMode x.State, x.StateReason = "running", "" x.PublicPorts = s.env.Docker.PublishedPorts(cid) return nil @@ -384,6 +390,35 @@ func (s *Service) launchVM(inst Instance, network string) { s.syncPortsAsync(inst.ID) // groups may have changed while launching } +// vmPasstFailure returns why passt did not start in the VM container (what the +// entrypoint printed before falling back to user-mode networking), or "". +func (s *Service) vmPasstFailure(cid string) string { + out, err := s.env.Docker.Logs(cid, 0, time.Time{}) + if err != nil { + return "" + } + const marker = "[homecloud] passt did not start" + i := strings.Index(out, marker) + if i < 0 { + return "" + } + out = out[i:] + if j := strings.Index(out, "[homecloud] starting"); j > 0 { + out = out[:j] + } + var lines []string + for _, l := range strings.Split(out, "\n") { + if l = strings.TrimSpace(l); l != "" { + // drop the docker log timestamp + if _, rest, ok := strings.Cut(l, " "); ok && strings.HasSuffix(l[:strings.IndexByte(l, ' ')], "Z") { + l = rest + } + lines = append(lines, l) + } + } + return strings.Join(lines, "; ") +} + func tail(s string, n int) string { s = strings.TrimSpace(s) if len(s) > n { diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go index 0cb78081..760ff11d 100644 --- a/cli/internal/svc/ec2/vm_live_test.go +++ b/cli/internal/svc/ec2/vm_live_test.go @@ -27,7 +27,7 @@ import ( // // (DOCKER_HOST=unix://$HOME/.orbstack/run/docker.sock on macOS with OrbStack). -const vmTestBudget = 40 * time.Minute // per wait for a guest to boot; TCG is slow +const vmTestBudget = 12 * time.Minute // per wait for a guest to boot or a rebuild; emulated boots take up to about 5 minutes // The Ubuntu image is the default; HC_TEST_VM_IMAGE=debian boots Debian instead (faster to boot emulated). var vmTestImage, vmTestUser = func() (string, string) { @@ -43,6 +43,7 @@ type vmInstance struct { PrivateIP string `json:"private_ip"` Virtualization string `json:"virtualization"` VMUser string `json:"vm_user"` + VMNetwork string `json:"vm_network"` PublicPorts map[string]int `json:"public_ports"` StateReason string `json:"state_reason"` } @@ -108,7 +109,7 @@ func (f *filterEnv) startIMDS(t *testing.T) { func sshDial(t *testing.T, port int, signer ssh.Signer, user string) *ssh.Client { t.Helper() var c *ssh.Client - waitFor(t, "ssh on published port", 10*time.Minute, func() bool { + waitFor(t, "ssh on published port", vmTestBudget, func() bool { var err error c, err = ssh.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port), &ssh.ClientConfig{ User: user, Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, HostKeyCallback: ssh.InsecureIgnoreHostKey(), Timeout: 15 * time.Second, @@ -212,6 +213,10 @@ func TestVMInstanceLifecycle(t *testing.T) { if i.Virtualization != "kvm" && i.Virtualization != "emulated" || i.VMUser != vmTestUser { t.Fatalf("instance reports virtualization %q, user %q", i.Virtualization, i.VMUser) } + if os.Getenv("HC_VM_NET") != "user" && i.VMNetwork != "passt" { + logs, _ := h.Env.Docker.Logs(i.ContainerID, 40, time.Time{}) + t.Fatalf("passt did not run (vm_network=%q): the guest has no private address of its own. Container log:\n%s", i.VMNetwork, logs) + } if i.PublicPorts["22/tcp"] == 0 { ci, _ := h.Env.Docker.Inspect(i.ContainerID) if ci != nil { @@ -293,7 +298,7 @@ func TestVMInstanceLifecycle(t *testing.T) { f.bannerEventually(t, true, helper, ip, "world-open rule") // Revoking it unpublishes the port; the container is rebuilt, so the guest reboots. h.AWS(t, "ec2", "revoke-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "0.0.0.0/0") - waitFor(t, "port unpublished", 10*time.Minute, func() bool { g := f.vmGet(id); return g.State == "running" && len(g.PublicPorts) == 0 }) + waitFor(t, "port unpublished", vmTestBudget, func() bool { g := f.vmGet(id); return g.State == "running" && len(g.PublicPorts) == 0 }) // A rule for the probe's address only lets it in, once the guest is back up. h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32") f.bannerEventually(t, true, helper, ip, "rule for the probe") @@ -309,7 +314,7 @@ func TestVMInstanceLifecycle(t *testing.T) { f.bannerEventually(t, true, helper, ip, "rule for the probe again") // A loopback-only rule publishes the port again (another rebuild); the disk survived. h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "127.0.0.1/32") - waitFor(t, "loopback port published", 10*time.Minute, func() bool { return f.vmGet(id).PublicPorts["22/tcp"] > 0 }) + waitFor(t, "loopback port published", vmTestBudget, func() bool { return f.vmGet(id).PublicPorts["22/tcp"] > 0 }) c = sshDial(t, f.vmGet(id).PublicPorts["22/tcp"], signer, vmTestUser) if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt"); got != "persisted" { t.Errorf("after the rebuild: %q", got) diff --git a/scripts/passt-probe.sh b/scripts/passt-probe.sh index a8980a6c..73d2288a 100644 --- a/scripts/passt-probe.sh +++ b/scripts/passt-probe.sh @@ -1,23 +1,20 @@ #!/bin/bash -# Temporary: which container security settings let passt start? -uname -r; cat /etc/os-release | head -2 -sysctl kernel.apparmor_restrict_unprivileged_userns kernel.unprivileged_userns_clone user.max_user_namespaces 2>&1 +# Temporary: which container settings let passt start? +uname -r +sysctl kernel.apparmor_restrict_unprivileged_userns fs.nr_open 2>&1 docker info --format '{{.SecurityOptions}}' -docker version --format '{{.Server.Version}}' docker build -q -t probe -f cli/internal/svc/ec2/vm/runner.Dockerfile cli/internal/svc/ec2/vm docker network create probenet >/dev/null run() { echo "=== $*" - docker run --rm --network probenet --entrypoint bash "$@" probe -c 'passt -f -s /tmp/p.sock -t all -u all >/tmp/passt.log 2>&1 & pid=$!; sleep 1.5; if kill -0 $pid 2>/dev/null; then echo "PASST ALIVE"; else echo "PASST DEAD"; cat /tmp/passt.log; fi; grep -E "^Cap(Eff|Bnd)" /proc/self/status' 2>&1 + docker run --rm --network probenet --entrypoint bash "$@" probe -c 'echo "nofile $(ulimit -Sn) $(ulimit -Hn)"; passt -f -s /tmp/p.sock -t all -u all >/tmp/passt.log 2>&1 & pid=$!; sleep 1.5; if kill -0 $pid 2>/dev/null; then echo "PASST ALIVE"; else echo "PASST DEAD"; cat /tmp/passt.log; fi' 2>&1 } -# options come before the image: reorder by putting them in "$@" +U="--ulimit nofile=1048576:1048576" run -run --security-opt seccomp=unconfined -run --security-opt seccomp=unconfined --security-opt apparmor=unconfined -run --security-opt apparmor=unconfined -run --cap-add SYS_ADMIN -run --cap-add SYS_ADMIN --security-opt apparmor=unconfined -run --cap-add SYS_ADMIN --security-opt seccomp=unconfined -run --cap-add SYS_ADMIN --security-opt seccomp=unconfined --security-opt apparmor=unconfined -run --privileged +run $U +run $U --security-opt seccomp=unconfined +run $U --security-opt seccomp=unconfined --security-opt apparmor=unconfined +run $U --cap-add SYS_ADMIN +run $U --cap-add SYS_ADMIN --security-opt apparmor=unconfined +run --ulimit nofile=4194304:4194304 --security-opt seccomp=unconfined docker network rm probenet >/dev/null From 338ae8499e3cefcc404a2d572bbe6df5a08c8e0e Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 22:15:57 +0530 Subject: [PATCH 07/25] VM instances: make passt work with Docker defaults on Ubuntu (raise the open-file limit, unconfine AppArmor), report and log the network mode, rebuild on rule changes in the fallback, shorter test waits --- .github/workflows/passt-probe.yml | 11 ----------- cli/internal/runtime/docker.go | 4 ++++ cli/internal/svc/ec2/vm.go | 14 ++++++++++---- cli/internal/svc/ec2/vm/hc-vm-run | 5 +++++ docs/architecture.md | 2 +- scripts/passt-probe.sh | 20 -------------------- 6 files changed, 20 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/passt-probe.yml delete mode 100644 scripts/passt-probe.sh diff --git a/.github/workflows/passt-probe.yml b/.github/workflows/passt-probe.yml deleted file mode 100644 index d936234e..00000000 --- a/.github/workflows/passt-probe.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: passt-probe -on: - push: - branches: [ec2-vm-instances] -jobs: - probe: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Probe - run: bash scripts/passt-probe.sh diff --git a/cli/internal/runtime/docker.go b/cli/internal/runtime/docker.go index dab2408d..e5de0b5d 100644 --- a/cli/internal/runtime/docker.go +++ b/cli/internal/runtime/docker.go @@ -96,6 +96,7 @@ type RunSpec struct { CapAdd []string // extra Linux capabilities (e.g. NET_ADMIN) Devices []string // host devices passed through (e.g. /dev/kvm) SecurityOpt []string // e.g. seccomp=unconfined + NoFile int64 // raise the open-file limit (soft and hard) to this; 0 keeps the default Start bool } @@ -162,6 +163,9 @@ func (d *Docker) Run(ctx context.Context, s RunSpec) (string, error) { } hc.CapAdd = s.CapAdd hc.SecurityOpt = s.SecurityOpt + if s.NoFile > 0 { + hc.Ulimits = []docker.ULimit{{Name: "nofile", Soft: s.NoFile, Hard: s.NoFile}} + } for _, dev := range s.Devices { hc.Devices = append(hc.Devices, docker.Device{PathOnHost: dev, PathInContainer: dev, CgroupPermissions: "rwm"}) } diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go index 2dd4b227..6c13cc88 100644 --- a/cli/internal/svc/ec2/vm.go +++ b/cli/internal/svc/ec2/vm.go @@ -252,9 +252,13 @@ func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec { "HC_VM_NET": os.Getenv("HC_VM_NET"), "HC_VM_HOSTFWD": hostFwd(s.vpc.IngressPorts(inst.SecurityGroups, 64)), }, ExtraHosts: []string{runtime.HostAlias}, - // passt isolates itself with a user namespace, which Docker's default - // seccomp profile only allows with CAP_SYS_ADMIN. - SecurityOpt: []string{"seccomp=unconfined"}, + // passt sandboxes itself (user, mount and pid namespaces, pivot_root), + // which Docker's default seccomp profile and, on Ubuntu, its + // docker-default AppArmor profile forbid; the container gets no extra + // capability. It also opens a socket for each forwarded port, so it + // needs more than the 65536 open files some hosts allow by default. + SecurityOpt: []string{"seccomp=unconfined", "apparmor=unconfined"}, + NoFile: 1048576, } if mach.KVM { spec.Devices = []string{"/dev/kvm"} @@ -374,7 +378,9 @@ func (s *Service) launchVM(inst Instance, network string) { return } netMode := "passt" - if why := s.vmPasstFailure(cid); why != "" { + if os.Getenv("HC_VM_NET") == "user" { + netMode = "user" + } else if why := s.vmPasstFailure(cid); why != "" { netMode = "user" log.Printf("ec2: %s: passt could not start, so the guest uses user-mode networking behind NAT (no private address of its own; only ports allowed at launch are forwarded): %s", inst.ID, why) } diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run index a80a7ba6..0233958c 100644 --- a/cli/internal/svc/ec2/vm/hc-vm-run +++ b/cli/internal/svc/ec2/vm/hc-vm-run @@ -49,6 +49,11 @@ if [ "${HC_VM_NET:-}" != "user" ]; then if [ ! -S /run/passt.sock ] || ! kill -0 "$pid" 2>/dev/null; then echo "[homecloud] passt did not start; falling back to user-mode networking:" >&2 cat /run/passt.log >&2 + if grep -q "Too many open files" /run/passt.log; then + echo "hint: the open-file limit ($(ulimit -Hn)) is too low for passt's port forwarding" >&2 + elif grep -qE "sandbox|user namespace|remount|pivot_root" /run/passt.log; then + echo "hint: the container's seccomp or AppArmor profile blocks passt's sandbox (it needs seccomp=unconfined and apparmor=unconfined)" >&2 + fi HC_VM_NET=user fi fi diff --git a/docs/architecture.md b/docs/architecture.md index 09cbbacb..9205bdd5 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -68,7 +68,7 @@ The data directory defaults to `~/.homecloud` (override with `--data-dir` or `HO | Stop, reboot | container stop, restart | ACPI power button through QMP, then a kill after a timeout; reboot is stop + start of the same container | | Terminate | container and volumes removed | container removed; root volume removed unless `DeleteOnTermination` is false | -The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. The VM container runs with Docker's default seccomp profile relaxed (`seccomp=unconfined`) because passt isolates itself with a user namespace; it gets no extra capabilities, and `/dev/kvm` only when accelerated. If passt cannot start (for example a host whose security modules forbid the user namespace), or when the server runs with `HC_VM_NET=user`, the container falls back to QEMU's user-mode networking: the guest then sits behind NAT at 10.0.2.15, still reaches the metadata service and DNS, and only the TCP/UDP ports that the instance's security groups open (at most 64, whatever their source) are forwarded to it; a rule that opens another port takes effect when the container is rebuilt. +The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. **Security trade-off.** passt sandboxes itself (user, mount and pid namespaces, `pivot_root`, then runs as `nobody`). Docker's default seccomp profile blocks that, and on Ubuntu hosts so does the `docker-default` AppArmor profile (it denies the remount and `pivot_root`; verified on Ubuntu 24.04 with `kernel.apparmor_restrict_unprivileged_userns=1`), so the VM container runs with `seccomp=unconfined` and `apparmor=unconfined`. A narrower AppArmor profile would have to be loaded on the host, which HomeCloud (a Docker client) cannot do. The container still gets only Docker's default capabilities, no `SYS_ADMIN`, no privileged mode and no host devices except `/dev/kvm` when accelerated; the trust is that of a root process in a container without MAC confinement running QEMU and passt, so use VM images only where you would accept that. passt also opens a socket per forwarded port, so the VM container's open-file limit is raised to 1048576 (Docker's default on some hosts is 65536 or 1024, which made passt fail with "Too many open files"). Instances report `vm_network: "passt"` or `"user"`. If passt cannot start (for example a host whose security modules forbid the user namespace), or when the server runs with `HC_VM_NET=user`, the container falls back to QEMU's user-mode networking: the guest then sits behind NAT at 10.0.2.15, still reaches the metadata service and DNS, and only the TCP/UDP ports that the instance's security groups open (at most 64, whatever their source) are forwarded to it; a rule that opens another port rebuilds the container (the guest reboots), for the automatic fallback too; the server logs why passt failed. CloudWatch's `HC/EC2` metrics and `homecloud backup` see the VM container: CPU, memory and I/O are QEMU's (not the guest's own numbers), and a backup copies the root volume's qcow2 file, which points at the cached cloud image (the cache volume itself is left out of backups). diff --git a/scripts/passt-probe.sh b/scripts/passt-probe.sh deleted file mode 100644 index 73d2288a..00000000 --- a/scripts/passt-probe.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Temporary: which container settings let passt start? -uname -r -sysctl kernel.apparmor_restrict_unprivileged_userns fs.nr_open 2>&1 -docker info --format '{{.SecurityOptions}}' -docker build -q -t probe -f cli/internal/svc/ec2/vm/runner.Dockerfile cli/internal/svc/ec2/vm -docker network create probenet >/dev/null -run() { - echo "=== $*" - docker run --rm --network probenet --entrypoint bash "$@" probe -c 'echo "nofile $(ulimit -Sn) $(ulimit -Hn)"; passt -f -s /tmp/p.sock -t all -u all >/tmp/passt.log 2>&1 & pid=$!; sleep 1.5; if kill -0 $pid 2>/dev/null; then echo "PASST ALIVE"; else echo "PASST DEAD"; cat /tmp/passt.log; fi' 2>&1 -} -U="--ulimit nofile=1048576:1048576" -run -run $U -run $U --security-opt seccomp=unconfined -run $U --security-opt seccomp=unconfined --security-opt apparmor=unconfined -run $U --cap-add SYS_ADMIN -run $U --cap-add SYS_ADMIN --security-opt apparmor=unconfined -run --ulimit nofile=4194304:4194304 --security-opt seccomp=unconfined -docker network rm probenet >/dev/null From 9f79fd6899d156681a0f9c97c1c82f6a91056d61 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 22:30:22 +0530 Subject: [PATCH 08/25] Temporary: probe passt socket binding --- .github/workflows/passt-probe.yml | 16 ++++++++++++++++ scripts/passt-probe.sh | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/passt-probe.yml create mode 100644 scripts/passt-probe.sh diff --git a/.github/workflows/passt-probe.yml b/.github/workflows/passt-probe.yml new file mode 100644 index 00000000..f239d33d --- /dev/null +++ b/.github/workflows/passt-probe.yml @@ -0,0 +1,16 @@ +name: passt-probe +on: + push: + branches: [ec2-vm-instances] +jobs: + probe: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Probe + run: bash scripts/passt-probe.sh diff --git a/scripts/passt-probe.sh b/scripts/passt-probe.sh new file mode 100644 index 00000000..1d48ee65 --- /dev/null +++ b/scripts/passt-probe.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Temporary: why does passt fail to bind /run/passt.sock? +uname -r +docker build -q -t probe -f cli/internal/svc/ec2/vm/runner.Dockerfile cli/internal/svc/ec2/vm +docker network create probenet >/dev/null +run() { + echo "=== $*" + docker run --rm --network probenet --entrypoint bash "$@" probe -c ' + id; ls -ld /run /tmp; touch /run/x && echo run-writable; grep -E "^Cap" /proc/self/status + for sock in /run/passt.sock /tmp/p.sock; do + rm -f $sock + passt -f -s $sock -t all -u all >/tmp/passt.log 2>&1 & pid=$!; sleep 1.5 + if kill -0 $pid 2>/dev/null; then echo "$sock: PASST ALIVE"; else echo "$sock: PASST DEAD"; cat /tmp/passt.log; fi + kill $pid 2>/dev/null; wait $pid 2>/dev/null + done' 2>&1 +} +U="--ulimit nofile=1048576:1048576 --security-opt seccomp=unconfined --security-opt apparmor=unconfined" +run $U +run $U --memory 1536m --cpu-period 100000 --cpu-quota 150000 +run $U --device /dev/kvm +run $U --hostname ip-10-1-1-1 --dns 10.0.0.2 --add-host host.docker.internal:host-gateway +docker network rm probenet >/dev/null From 7e2423c980dabf19108eda665f4f12d289677855 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 22:35:06 +0530 Subject: [PATCH 09/25] VM instances: put passt's socket in /tmp (it binds as nobody, /run is not writable for it on Ubuntu hosts), better fallback hints --- .github/workflows/passt-probe.yml | 16 ---------------- cli/internal/svc/ec2/vm/hc-vm-run | 12 +++++++----- cli/internal/svc/ec2/vm/qemu.go | 2 +- cli/internal/svc/ec2/vm/vm_test.go | 2 +- scripts/passt-probe.sh | 22 ---------------------- 5 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/passt-probe.yml delete mode 100644 scripts/passt-probe.sh diff --git a/.github/workflows/passt-probe.yml b/.github/workflows/passt-probe.yml deleted file mode 100644 index f239d33d..00000000 --- a/.github/workflows/passt-probe.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: passt-probe -on: - push: - branches: [ec2-vm-instances] -jobs: - probe: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Enable KVM - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - name: Probe - run: bash scripts/passt-probe.sh diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run index 0233958c..fa425518 100644 --- a/cli/internal/svc/ec2/vm/hc-vm-run +++ b/cli/internal/svc/ec2/vm/hc-vm-run @@ -37,20 +37,22 @@ fi # namespace (127.0.0.11), so names resolve as they do for container instances. dns="" if [ -n "${HC_VM_DNS:-}" ]; then dns="-D $HC_VM_DNS --dns-forward $HC_VM_DNS --dns-host 127.0.0.11"; fi -rm -f /run/passt.sock /run/qmp.sock +rm -f /tmp/passt.sock /run/qmp.sock if [ "${HC_VM_NET:-}" != "user" ]; then # shellcheck disable=SC2086 - passt -f -s /run/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & + passt -f -s /tmp/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & pid=$! n=0 - while [ ! -S /run/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done - # passt binds its socket first and isolates itself afterwards; it can still exit then. + while [ ! -S /tmp/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done + # passt binds its socket (as nobody: /tmp is world-writable, /run is not) and sandboxes itself; it can still exit then. sleep 0.5 - if [ ! -S /run/passt.sock ] || ! kill -0 "$pid" 2>/dev/null; then + if [ ! -S /tmp/passt.sock ] || ! kill -0 "$pid" 2>/dev/null; then echo "[homecloud] passt did not start; falling back to user-mode networking:" >&2 cat /run/passt.log >&2 if grep -q "Too many open files" /run/passt.log; then echo "hint: the open-file limit ($(ulimit -Hn)) is too low for passt's port forwarding" >&2 + elif grep -q "Failed to bind" /run/passt.log; then + echo "hint: passt binds its socket as user nobody, so the socket directory must be world-writable" >&2 elif grep -qE "sandbox|user namespace|remount|pivot_root" /run/passt.log; then echo "hint: the container's seccomp or AppArmor profile blocks passt's sandbox (it needs seccomp=unconfined and apparmor=unconfined)" >&2 fi diff --git a/cli/internal/svc/ec2/vm/qemu.go b/cli/internal/svc/ec2/vm/qemu.go index 36d28a95..f8d99662 100644 --- a/cli/internal/svc/ec2/vm/qemu.go +++ b/cli/internal/svc/ec2/vm/qemu.go @@ -62,7 +62,7 @@ func (m Machine) Args() []string { "-drive", "file="+DiskDir+"/seed.iso,if=none,id=seed,format=raw,readonly=on", "-device", "virtio-blk-pci,drive=seed", // The NIC is wired to passt inside the container (see hc-vm-run). - "-netdev", "stream,id=net0,addr.type=unix,addr.path=/run/passt.sock,server=off", + "-netdev", "stream,id=net0,addr.type=unix,addr.path=/tmp/passt.sock,server=off", "-device", "virtio-net-pci,netdev=net0,mac="+m.MAC()+",romfile=", "-device", "virtio-rng-pci", "-display", "none", "-monitor", "none", diff --git a/cli/internal/svc/ec2/vm/vm_test.go b/cli/internal/svc/ec2/vm/vm_test.go index e5a8265f..0cb5d547 100644 --- a/cli/internal/svc/ec2/vm/vm_test.go +++ b/cli/internal/svc/ec2/vm/vm_test.go @@ -28,7 +28,7 @@ func TestQEMUAArch64Emulated(t *testing.T) { "file=/vm/disk.qcow2,if=none,id=root,format=qcow2", "virtio-blk-pci,drive=root,bootindex=1", "file=/vm/seed.iso,if=none,id=seed,format=raw,readonly=on", - "-netdev stream,id=net0,addr.type=unix,addr.path=/run/passt.sock,server=off", + "-netdev stream,id=net0,addr.type=unix,addr.path=/tmp/passt.sock,server=off", "virtio-net-pci,netdev=net0,mac=" + m.MAC(), "-chardev stdio,id=ser0,signal=off -serial chardev:ser0", "-qmp unix:/run/qmp.sock,server=on,wait=off", diff --git a/scripts/passt-probe.sh b/scripts/passt-probe.sh deleted file mode 100644 index 1d48ee65..00000000 --- a/scripts/passt-probe.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Temporary: why does passt fail to bind /run/passt.sock? -uname -r -docker build -q -t probe -f cli/internal/svc/ec2/vm/runner.Dockerfile cli/internal/svc/ec2/vm -docker network create probenet >/dev/null -run() { - echo "=== $*" - docker run --rm --network probenet --entrypoint bash "$@" probe -c ' - id; ls -ld /run /tmp; touch /run/x && echo run-writable; grep -E "^Cap" /proc/self/status - for sock in /run/passt.sock /tmp/p.sock; do - rm -f $sock - passt -f -s $sock -t all -u all >/tmp/passt.log 2>&1 & pid=$!; sleep 1.5 - if kill -0 $pid 2>/dev/null; then echo "$sock: PASST ALIVE"; else echo "$sock: PASST DEAD"; cat /tmp/passt.log; fi - kill $pid 2>/dev/null; wait $pid 2>/dev/null - done' 2>&1 -} -U="--ulimit nofile=1048576:1048576 --security-opt seccomp=unconfined --security-opt apparmor=unconfined" -run $U -run $U --memory 1536m --cpu-period 100000 --cpu-quota 150000 -run $U --device /dev/kvm -run $U --hostname ip-10-1-1-1 --dns 10.0.0.2 --add-host host.docker.internal:host-gateway -docker network rm probenet >/dev/null From 48b72abcef7856b1e3eb34ec8b8cb3941a4c95aa Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:08:37 +0530 Subject: [PATCH 10/25] VM test: report the guest's and container's state when SSH cannot connect --- cli/internal/svc/ec2/vm_live_test.go | 46 ++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go index 760ff11d..5e8177df 100644 --- a/cli/internal/svc/ec2/vm_live_test.go +++ b/cli/internal/svc/ec2/vm_live_test.go @@ -106,20 +106,48 @@ func (f *filterEnv) startIMDS(t *testing.T) { } // sshDial connects to the guest through its published SSH port on the Docker host. -func sshDial(t *testing.T, port int, signer ssh.Signer, user string) *ssh.Client { +// On a timeout it reports what the guest and the container look like. +func (f *filterEnv) sshDial(t *testing.T, id string, port int, signer ssh.Signer, user string) *ssh.Client { t.Helper() var c *ssh.Client - waitFor(t, "ssh on published port", vmTestBudget, func() bool { - var err error - c, err = ssh.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port), &ssh.ClientConfig{ + var lastErr error + end := time.Now().Add(6 * time.Minute) + for { + c, lastErr = ssh.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port), &ssh.ClientConfig{ User: user, Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, HostKeyCallback: ssh.InsecureIgnoreHostKey(), Timeout: 15 * time.Second, }) - return err == nil - }) + if lastErr == nil { + break + } + if time.Now().After(end) { + t.Fatalf("ssh to %s on published port %d: %v\n%s", id, port, lastErr, f.vmDiagnose(id)) + } + time.Sleep(2 * time.Second) + } t.Cleanup(func() { c.Close() }) return c } +// vmDiagnose describes a guest that cannot be reached: its console's network +// lines and the listening sockets in the VM container. +func (f *filterEnv) vmDiagnose(id string) string { + i := f.vmGet(id) + var b strings.Builder + fmt.Fprintf(&b, "state %s, network %q, ports %v\n", i.State, i.VMNetwork, i.PublicPorts) + logs, _ := f.h.Env.Docker.Logs(i.ContainerID, 0, time.Time{}) + for _, l := range strings.Split(logs, "\n") { + if strings.Contains(l, "ci-info") || strings.Contains(l, "[homecloud]") || strings.Contains(l, "passt") || strings.Contains(l, "DHCP") || strings.Contains(l, "sshd") || strings.Contains(l, "ssh.service") { + b.WriteString(l + "\n") + } + } + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + if res, err := f.h.Env.Docker.Exec(ctx, i.ContainerID, []string{"/bin/sh", "-c", "cat /proc/net/tcp | head -12; echo; ls -l /tmp; cat /run/passt.log | head"}, nil); err == nil { + b.WriteString(res.Stdout + res.Stderr) + } + return b.String() +} + func sshRun(t *testing.T, c *ssh.Client, cmd string) string { t.Helper() s, err := c.NewSession() @@ -232,7 +260,7 @@ func TestVMInstanceLifecycle(t *testing.T) { volID := desc[0].(map[string]any)["VolumeId"].(string) // Log in through the published port and inspect the guest. - c := sshDial(t, i.PublicPorts["22/tcp"], signer, vmTestUser) + c := f.sshDial(t, id, i.PublicPorts["22/tcp"], signer, vmTestUser) if got, want := sshRun(t, c, "hostname"), "ip-"+strings.ReplaceAll(ip, ".", "-"); got != want { t.Errorf("hostname %q, want %q", got, want) } @@ -284,7 +312,7 @@ func TestVMInstanceLifecycle(t *testing.T) { } h.AWS(t, "ec2", "start-instances", "--instance-ids", id) i = f.vmWaitState(t, id, "running") - c = sshDial(t, i.PublicPorts["22/tcp"], signer, vmTestUser) + c = f.sshDial(t, id, i.PublicPorts["22/tcp"], signer, vmTestUser) if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt && cat /var/tmp/userdata.txt"); got != "persisted\nhc-userdata-ran" { t.Errorf("after stop/start: %q", got) } @@ -315,7 +343,7 @@ func TestVMInstanceLifecycle(t *testing.T) { // A loopback-only rule publishes the port again (another rebuild); the disk survived. h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "127.0.0.1/32") waitFor(t, "loopback port published", vmTestBudget, func() bool { return f.vmGet(id).PublicPorts["22/tcp"] > 0 }) - c = sshDial(t, f.vmGet(id).PublicPorts["22/tcp"], signer, vmTestUser) + c = f.sshDial(t, id, f.vmGet(id).PublicPorts["22/tcp"], signer, vmTestUser) if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt"); got != "persisted" { t.Errorf("after the rebuild: %q", got) } From 04e3c99111d94f02ada768ad82a8695def995ed3 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:10:44 +0530 Subject: [PATCH 11/25] VM guest agent: virtio-serial QGA channel, serial console socket with log tee, vendor-data installs qemu-guest-agent, QGA and /proc parsers --- cli/internal/svc/ec2/vm/hc-vm-run | 2 +- cli/internal/svc/ec2/vm/qemu.go | 23 ++- cli/internal/svc/ec2/vm/qga.go | 266 ++++++++++++++++++++++++++++ cli/internal/svc/ec2/vm/qga_test.go | 170 ++++++++++++++++++ cli/internal/svc/ec2/vm/seed.go | 20 ++- cli/internal/svc/ec2/vm/serial.go | 15 ++ cli/internal/svc/ec2/vm/vm_test.go | 5 +- 7 files changed, 495 insertions(+), 6 deletions(-) create mode 100644 cli/internal/svc/ec2/vm/qga.go create mode 100644 cli/internal/svc/ec2/vm/qga_test.go create mode 100644 cli/internal/svc/ec2/vm/serial.go diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run index fa425518..d942fb04 100644 --- a/cli/internal/svc/ec2/vm/hc-vm-run +++ b/cli/internal/svc/ec2/vm/hc-vm-run @@ -37,7 +37,7 @@ fi # namespace (127.0.0.11), so names resolve as they do for container instances. dns="" if [ -n "${HC_VM_DNS:-}" ]; then dns="-D $HC_VM_DNS --dns-forward $HC_VM_DNS --dns-host 127.0.0.11"; fi -rm -f /tmp/passt.sock /run/qmp.sock +rm -f /tmp/passt.sock /run/qmp.sock /run/serial.sock /run/qga.sock if [ "${HC_VM_NET:-}" != "user" ]; then # shellcheck disable=SC2086 passt -f -s /tmp/passt.sock -t all -u all $dns >/run/passt.log 2>&1 & diff --git a/cli/internal/svc/ec2/vm/qemu.go b/cli/internal/svc/ec2/vm/qemu.go index f8d99662..b6308dc4 100644 --- a/cli/internal/svc/ec2/vm/qemu.go +++ b/cli/internal/svc/ec2/vm/qemu.go @@ -6,6 +6,14 @@ import ( "strconv" ) +// Sockets inside the VM container: the guest's serial console (one client at a +// time), the qemu-guest-agent channel and its virtio-serial port name. +const ( + SerialSocket = "/run/serial.sock" + QGASocket = "/run/qga.sock" + QGAChannel = "org.qemu.guest_agent.0" +) + // Machine is a guest's hardware. type Machine struct { Name string // instance ID @@ -25,8 +33,9 @@ func (m Machine) MAC() string { // prepares /vm/disk.qcow2, /vm/seed.iso, /vm/efivars.fd and the passt socket // before it starts QEMU. // -// The guest's serial console goes to QEMU's stdout, i.e. the container's log, -// which is what GetConsoleOutput returns. QMP listens on /run/qmp.sock for the +// The guest's serial console is served on SerialSocket (the browser terminal) +// and logged to QEMU's stdout, i.e. the container's log, which is what +// GetConsoleOutput returns. The guest agent's channel is QGASocket. QMP listens on /run/qmp.sock for the // power controls (hc-vm-ctl). func (m Machine) Args() []string { vcpus := max(1, m.VCPUs) @@ -66,7 +75,15 @@ func (m Machine) Args() []string { "-device", "virtio-net-pci,netdev=net0,mac="+m.MAC()+",romfile=", "-device", "virtio-rng-pci", "-display", "none", "-monitor", "none", - "-chardev", "stdio,id=ser0,signal=off", "-serial", "chardev:ser0", + // The serial console is a socket the browser terminal attaches to; + // logfile tees everything the guest prints to QEMU's stdout (the + // container's log) whether or not anyone is attached. + "-chardev", "socket,id=ser0,path="+SerialSocket+",server=on,wait=off,logfile=/dev/stdout,logappend=on", + "-serial", "chardev:ser0", + // qemu-guest-agent's channel (run-command, guest metrics). + "-chardev", "socket,id=qga0,path="+QGASocket+",server=on,wait=off", + "-device", "virtio-serial-pci,id=vser0", + "-device", "virtserialport,bus=vser0.0,chardev=qga0,name="+QGAChannel, "-qmp", "unix:/run/qmp.sock,server=on,wait=off", ) return args diff --git a/cli/internal/svc/ec2/vm/qga.go b/cli/internal/svc/ec2/vm/qga.go new file mode 100644 index 00000000..bfaa49f2 --- /dev/null +++ b/cli/internal/svc/ec2/vm/qga.go @@ -0,0 +1,266 @@ +package vm + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "strconv" + "strings" +) + +// The pure parts of talking to qemu-guest-agent (QGA) over the virtio-serial +// socket: request encoding, reply framing, guest-exec results and the parsers +// of the /proc sample the CloudWatch metrics come from. The connection itself +// (a docker exec of socat into the VM container) is in the ec2 package. + +// QGARequest encodes a command as one line. +func QGARequest(cmd string, args any) []byte { + m := map[string]any{"execute": cmd} + if args != nil { + m["arguments"] = args + } + b, _ := json.Marshal(m) + return append(b, '\n') +} + +// QGASync is the handshake that discards whatever a previous client left in +// the channel: the agent answers with 0xFF and the same id (guest-sync-delimited). +func QGASync(id int64) []byte { return QGARequest("guest-sync-delimited", map[string]int64{"id": id}) } + +// QGAReply is a parsed reply line. +type QGAReply struct { + Return json.RawMessage `json:"return"` + Error *struct { + Class string `json:"class"` + Desc string `json:"desc"` + } `json:"error"` + // Synced is set for the reply to guest-sync-delimited (it starts with 0xFF). + Synced bool `json:"-"` +} + +// Err is the agent's error, if the command failed. +func (r QGAReply) Err() error { + if r.Error == nil { + return nil + } + return fmt.Errorf("guest agent: %s: %s", r.Error.Class, r.Error.Desc) +} + +// ParseQGAReply parses one line of the agent's output. ok is false for +// anything that is not a reply (partial or garbled lines are skipped by the caller). +func ParseQGAReply(line []byte) (r QGAReply, ok bool) { + line = bytes.TrimSpace(line) + synced := false + if i := bytes.IndexByte(line, 0xFF); i >= 0 { + synced = true + line = bytes.TrimSpace(line[i+1:]) + } + if len(line) == 0 || line[0] != '{' || json.Unmarshal(line, &r) != nil { + return QGAReply{}, false + } + r.Synced = synced + return r, r.Return != nil || r.Error != nil +} + +// QGAExecRequest starts a program in the guest and captures its output. +func QGAExecRequest(path string, args []string) []byte { + return QGARequest("guest-exec", map[string]any{"path": path, "arg": args, "capture-output": true}) +} + +// QGAExecStatusRequest polls a guest-exec by pid. +func QGAExecStatusRequest(pid int64) []byte { + return QGARequest("guest-exec-status", map[string]int64{"pid": pid}) +} + +// ParseExecPID is the pid in the reply to guest-exec. +func ParseExecPID(ret json.RawMessage) (int64, error) { + var v struct { + PID int64 `json:"pid"` + } + if err := json.Unmarshal(ret, &v); err != nil || v.PID == 0 { + return 0, fmt.Errorf("guest-exec returned no pid: %s", ret) + } + return v.PID, nil +} + +// ExecStatus is the result of guest-exec-status. +type ExecStatus struct { + Exited bool + ExitCode int + Stdout string + Stderr string + Truncated bool +} + +// ParseExecStatus decodes the reply of guest-exec-status. +func ParseExecStatus(ret json.RawMessage) (ExecStatus, error) { + var v struct { + Exited bool `json:"exited"` + ExitCode int `json:"exitcode"` + Signal int `json:"signal"` + OutData string `json:"out-data"` + ErrData string `json:"err-data"` + OutTrunc bool `json:"out-truncated"` + ErrTrunc bool `json:"err-truncated"` + } + if err := json.Unmarshal(ret, &v); err != nil { + return ExecStatus{}, fmt.Errorf("guest-exec-status: %w", err) + } + out, err := base64.StdEncoding.DecodeString(v.OutData) + if err != nil { + return ExecStatus{}, fmt.Errorf("guest-exec-status: out-data: %w", err) + } + errs, err := base64.StdEncoding.DecodeString(v.ErrData) + if err != nil { + return ExecStatus{}, fmt.Errorf("guest-exec-status: err-data: %w", err) + } + st := ExecStatus{Exited: v.Exited, ExitCode: v.ExitCode, Stdout: string(out), Stderr: string(errs), Truncated: v.OutTrunc || v.ErrTrunc} + if v.Signal != 0 && v.ExitCode == 0 { + st.ExitCode = 128 + v.Signal // the shell's convention + } + return st, nil +} + +// ShellCommand is the guest-exec program and arguments that run a shell +// command with a timeout (coreutils timeout when present; it exits 124). +func ShellCommand(command string, timeoutSeconds int) (path string, args []string) { + const wrapper = `if command -v timeout >/dev/null 2>&1; then exec timeout -k 5 "$1" /bin/sh -c "$2"; else exec /bin/sh -c "$2"; fi` + return "/bin/sh", []string{"-c", wrapper, "hc", strconv.Itoa(timeoutSeconds), command} +} + +// StatsCommand samples the guest's /proc for CloudWatch: CPU time twice, a +// second apart (so the utilization needs no state between samples), then memory, +// network, disks and the process count. +const StatsCommand = `cat /proc/stat; echo "==cpu2"; sleep 1; cat /proc/stat; echo "==meminfo"; cat /proc/meminfo; echo "==netdev"; cat /proc/net/dev; echo "==diskstats"; cat /proc/diskstats; echo "==procs"; ls -d /proc/[0-9]* | wc -l` + +// GuestStats is one sample of the guest. +type GuestStats struct { + CPUPercent float64 + MemoryUsed uint64 // bytes: MemTotal - MemAvailable + MemoryTotal uint64 + NetRx uint64 // cumulative bytes over all interfaces but lo + NetTx uint64 + DiskRead uint64 // cumulative bytes over whole block devices + DiskWrite uint64 + Processes uint64 +} + +// MemoryPercent is used memory as a share of the guest's memory. +func (g GuestStats) MemoryPercent() float64 { + if g.MemoryTotal == 0 { + return 0 + } + return float64(g.MemoryUsed) / float64(g.MemoryTotal) * 100 +} + +// ParseGuestStats parses the output of StatsCommand. +func ParseGuestStats(out string) (GuestStats, error) { + secs := map[string]string{} + cur := "cpu1" + var b strings.Builder + flush := func() { secs[cur] = b.String(); b.Reset() } + for _, l := range strings.Split(out, "\n") { + if name, ok := strings.CutPrefix(l, "=="); ok { + flush() + cur = strings.TrimSpace(name) + continue + } + b.WriteString(l + "\n") + } + flush() + + var g GuestStats + t1, i1, ok1 := cpuTimes(secs["cpu1"]) + t2, i2, ok2 := cpuTimes(secs["cpu2"]) + if !ok1 || !ok2 { + return g, fmt.Errorf("no cpu line in the guest's /proc/stat") + } + if t2 > t1 { + busy := float64(t2-t1) - float64(i2-i1) + g.CPUPercent = max(0, min(100, busy/float64(t2-t1)*100)) + } + var avail uint64 + for _, l := range strings.Split(secs["meminfo"], "\n") { + f := strings.Fields(l) + if len(f) < 2 { + continue + } + kb, _ := strconv.ParseUint(f[1], 10, 64) + switch f[0] { + case "MemTotal:": + g.MemoryTotal = kb * 1024 + case "MemAvailable:": + avail = kb * 1024 + } + } + if g.MemoryTotal == 0 { + return g, fmt.Errorf("no MemTotal in the guest's /proc/meminfo") + } + g.MemoryUsed = g.MemoryTotal - min(avail, g.MemoryTotal) + for _, l := range strings.Split(secs["netdev"], "\n") { + name, rest, ok := strings.Cut(l, ":") + if !ok || strings.TrimSpace(name) == "lo" { + continue + } + f := strings.Fields(rest) + if len(f) < 9 { + continue + } + rx, _ := strconv.ParseUint(f[0], 10, 64) + tx, _ := strconv.ParseUint(f[8], 10, 64) + g.NetRx += rx + g.NetTx += tx + } + for _, l := range strings.Split(secs["diskstats"], "\n") { + f := strings.Fields(l) + if len(f) < 10 || !wholeDisk(f[2]) { + continue + } + r, _ := strconv.ParseUint(f[5], 10, 64) // sectors read + w, _ := strconv.ParseUint(f[9], 10, 64) // sectors written + g.DiskRead += r * 512 + g.DiskWrite += w * 512 + } + g.Processes, _ = strconv.ParseUint(strings.TrimSpace(secs["procs"]), 10, 64) + return g, nil +} + +// cpuTimes returns the total and idle (idle + iowait) jiffies of the aggregate cpu line. +func cpuTimes(s string) (total, idle uint64, ok bool) { + for _, l := range strings.Split(s, "\n") { + f := strings.Fields(l) + if len(f) < 5 || f[0] != "cpu" { + continue + } + for i, v := range f[1:] { + if i >= 8 { // guest and guest_nice are already part of user and nice + break + } + n, err := strconv.ParseUint(v, 10, 64) + if err != nil { + return 0, 0, false + } + total += n + if i == 3 || i == 4 { + idle += n + } + } + return total, idle, true + } + return 0, 0, false +} + +// wholeDisk is true for virtio, SCSI/SATA and NVMe disks, not partitions, loop or device-mapper devices. +func wholeDisk(name string) bool { + for _, p := range []string{"vd", "sd", "xvd", "hd"} { + if rest, ok := strings.CutPrefix(name, p); ok && rest != "" { + return strings.Trim(rest, "abcdefghijklmnopqrstuvwxyz") == "" + } + } + if rest, ok := strings.CutPrefix(name, "nvme"); ok { + // nvme0n1 is a disk, nvme0n1p1 a partition + return !strings.Contains(rest, "p") && strings.Contains(rest, "n") + } + return false +} diff --git a/cli/internal/svc/ec2/vm/qga_test.go b/cli/internal/svc/ec2/vm/qga_test.go new file mode 100644 index 00000000..6e7e278b --- /dev/null +++ b/cli/internal/svc/ec2/vm/qga_test.go @@ -0,0 +1,170 @@ +package vm + +import ( + "encoding/base64" + "encoding/json" + "strings" + "testing" +) + +func TestQGARequests(t *testing.T) { + if got := string(QGASync(42)); got != `{"arguments":{"id":42},"execute":"guest-sync-delimited"}`+"\n" { + t.Errorf("sync: %q", got) + } + if got := string(QGAExecStatusRequest(7)); got != `{"arguments":{"pid":7},"execute":"guest-exec-status"}`+"\n" { + t.Errorf("status: %q", got) + } + var m map[string]any + if err := json.Unmarshal(QGAExecRequest("/bin/sh", []string{"-c", "echo \"hi\""}), &m); err != nil { + t.Fatal(err) + } + a := m["arguments"].(map[string]any) + if m["execute"] != "guest-exec" || a["path"] != "/bin/sh" || a["capture-output"] != true || len(a["arg"].([]any)) != 2 { + t.Errorf("exec: %v", m) + } +} + +func TestParseQGAReply(t *testing.T) { + r, ok := ParseQGAReply([]byte("\xff{\"return\": 42}\n")) + if !ok || !r.Synced || string(r.Return) != "42" { + t.Errorf("sync reply: %+v %v", r, ok) + } + r, ok = ParseQGAReply([]byte(`{"return": {"pid": 9}}`)) + if !ok || r.Synced { + t.Fatalf("reply: %+v %v", r, ok) + } + if pid, err := ParseExecPID(r.Return); err != nil || pid != 9 { + t.Errorf("pid %d %v", pid, err) + } + r, ok = ParseQGAReply([]byte(`{"error": {"class": "CommandNotFound", "desc": "nope"}}`)) + if !ok || r.Err() == nil || !strings.Contains(r.Err().Error(), "nope") { + t.Errorf("error reply: %+v %v", r, ok) + } + for _, junk := range []string{"", "garbage", `{"partial"`, `{"x":1}`, "\xff"} { + if _, ok := ParseQGAReply([]byte(junk)); ok { + t.Errorf("%q parsed as a reply", junk) + } + } + if _, err := ParseExecPID(json.RawMessage(`{}`)); err == nil { + t.Error("missing pid accepted") + } +} + +func TestParseExecStatus(t *testing.T) { + b64 := func(s string) string { return base64.StdEncoding.EncodeToString([]byte(s)) } + st, err := ParseExecStatus(json.RawMessage(`{"exited":true,"exitcode":3,"out-data":"` + b64("out\n") + `","err-data":"` + b64("bad\n") + `"}`)) + if err != nil || !st.Exited || st.ExitCode != 3 || st.Stdout != "out\n" || st.Stderr != "bad\n" { + t.Errorf("%+v %v", st, err) + } + st, _ = ParseExecStatus(json.RawMessage(`{"exited":false}`)) + if st.Exited { + t.Errorf("running reported as exited: %+v", st) + } + st, _ = ParseExecStatus(json.RawMessage(`{"exited":true,"signal":9,"out-truncated":true}`)) + if st.ExitCode != 137 || !st.Truncated { + t.Errorf("signal: %+v", st) + } + if _, err := ParseExecStatus(json.RawMessage(`{"exited":true,"out-data":"***"}`)); err == nil { + t.Error("bad base64 accepted") + } +} + +func TestShellCommand(t *testing.T) { + p, args := ShellCommand(`echo "a b"; exit 3`, 30) + if p != "/bin/sh" || len(args) != 5 || args[3] != "30" || args[4] != `echo "a b"; exit 3` || !strings.Contains(args[1], "timeout -k 5") { + t.Errorf("%s %q", p, args) + } +} + +const sampleProc = `cpu 1000 0 500 8000 100 0 0 0 0 0 +cpu0 1000 0 500 8000 100 0 0 0 0 0 +intr 1 +==cpu2 +cpu 1100 0 550 8050 100 0 0 0 0 0 +cpu0 1100 0 550 8050 100 0 0 0 0 0 +==meminfo +MemTotal: 2048000 kB +MemFree: 100000 kB +MemAvailable: 1024000 kB +==netdev +Inter-| Receive | Transmit + face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed + lo: 5000 10 0 0 0 0 0 0 5000 10 0 0 0 0 0 0 + ens3: 1000 5 0 0 0 0 0 0 2000 6 0 0 0 0 0 0 +==diskstats + 252 0 vda 100 0 2000 50 30 0 400 20 0 0 0 0 0 0 0 0 0 + 252 1 vda1 90 0 1800 40 25 0 350 10 0 0 0 0 0 0 0 0 0 + 7 0 loop0 1 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 259 0 nvme0n1 5 0 100 0 5 0 100 0 0 0 0 0 0 0 0 0 0 + 259 1 nvme0n1p1 5 0 100 0 5 0 100 0 0 0 0 0 0 0 0 0 0 +==procs +87 +` + +func TestParseGuestStats(t *testing.T) { + g, err := ParseGuestStats(sampleProc) + if err != nil { + t.Fatal(err) + } + // 200 jiffies passed, 50 of them idle: 150/200 busy... total delta = 100+0+50+50+0 = 200, idle delta 50. + if g.CPUPercent != 75 { + t.Errorf("cpu %v, want 75", g.CPUPercent) + } + if g.MemoryTotal != 2048000*1024 || g.MemoryUsed != 1024000*1024 || g.MemoryPercent() != 50 { + t.Errorf("memory %+v", g) + } + if g.NetRx != 1000 || g.NetTx != 2000 { + t.Errorf("network rx %d tx %d (lo must not count)", g.NetRx, g.NetTx) + } + // vda (2000 sectors read, 400 written) and nvme0n1 (100, 100); partitions and loop devices excluded. + if g.DiskRead != (2000+100)*512 || g.DiskWrite != (400+100)*512 { + t.Errorf("disk read %d write %d", g.DiskRead, g.DiskWrite) + } + if g.Processes != 87 { + t.Errorf("processes %d", g.Processes) + } +} + +func TestParseGuestStatsErrors(t *testing.T) { + if _, err := ParseGuestStats("nothing useful\n"); err == nil { + t.Error("output without /proc/stat accepted") + } + cpu := "cpu 1 0 1 1 0 0 0 0 0 0\n==cpu2\ncpu 2 0 2 2 0 0 0 0 0 0\n" + if _, err := ParseGuestStats(cpu); err == nil || !strings.Contains(err.Error(), "MemTotal") { + t.Errorf("missing meminfo: %v", err) + } + // An idle interval (no jiffies passed) reports 0, not NaN. + g, err := ParseGuestStats("cpu 1 0 1 1 0\n==cpu2\ncpu 1 0 1 1 0\n==meminfo\nMemTotal: 10 kB\n") + if err != nil || g.CPUPercent != 0 || g.MemoryUsed != 10*1024 { + t.Errorf("%+v %v", g, err) + } +} + +func TestWholeDisk(t *testing.T) { + for name, want := range map[string]bool{"vda": true, "vdb": true, "sda": true, "xvda": true, "nvme0n1": true, + "vda1": false, "sda2": false, "nvme0n1p2": false, "loop0": false, "dm-0": false, "sr0": false, "vd": false} { + if got := wholeDisk(name); got != want { + t.Errorf("wholeDisk(%q) = %v", name, got) + } + } +} + +func TestAttachCommands(t *testing.T) { + if s := strings.Join(SerialAttachCommand(), " "); s != "socat -,raw,echo=0 UNIX-CONNECT:/run/serial.sock" { + t.Error(s) + } + if s := strings.Join(QGAAttachCommand(), " "); s != "socat -t 1 - UNIX-CONNECT:/run/qga.sock" { + t.Error(s) + } +} + +func TestSeedInstallsGuestAgent(t *testing.T) { + f := Seed{InstanceID: "i", Hostname: "h", UserData: "#cloud-config\npackages: [htop]\n"}.Files() + v := string(f["vendor-data"]) + if !strings.HasPrefix(v, "#!/bin/sh") || !strings.Contains(v, "qemu-guest-agent") || !strings.Contains(v, "systemctl enable --now qemu-guest-agent") { + t.Errorf("vendor-data:\n%s", v) + } + if !strings.Contains(string(f["user-data"]), "htop") { + t.Error("user data lost") + } +} diff --git a/cli/internal/svc/ec2/vm/seed.go b/cli/internal/svc/ec2/vm/seed.go index e06a5df8..0acd7836 100644 --- a/cli/internal/svc/ec2/vm/seed.go +++ b/cli/internal/svc/ec2/vm/seed.go @@ -34,9 +34,27 @@ func (s Seed) Files() map[string][]byte { if strings.TrimSpace(user) == "" { user = "#cloud-config\n{}\n" } - return map[string][]byte{"meta-data": []byte(meta.String()), "user-data": []byte(user)} + return map[string][]byte{"meta-data": []byte(meta.String()), "user-data": []byte(user), "vendor-data": []byte(VendorData)} } +// VendorData installs and starts qemu-guest-agent, which run-command and the +// CloudWatch guest metrics talk to. It is a script rather than cloud-config +// `packages:` because cloud-init does not merge list keys of vendor-data with +// the user's own cloud-config, which would silently drop the agent whenever +// the user data sets packages or runcmd. The agent is socket-activated by the +// virtio-serial port on most images, hence the explicit start. +const VendorData = `#!/bin/sh +# HomeCloud: the guest agent behind run-command and the instance's metrics. +if ! command -v qemu-ga >/dev/null 2>&1; then + export DEBIAN_FRONTEND=noninteractive + n=0 + until apt-get update -qq && apt-get install -y -qq qemu-guest-agent; do + n=$((n+1)); [ $n -ge 5 ] && break; sleep 5 + done +fi +systemctl enable --now qemu-guest-agent 2>/dev/null || systemctl start qemu-guest-agent 2>/dev/null || true +` + // ReadyMarkers are what the guest prints on its serial console when it is up. var ( // CloudInitDone is printed by cloud-init's final stage. diff --git a/cli/internal/svc/ec2/vm/serial.go b/cli/internal/svc/ec2/vm/serial.go new file mode 100644 index 00000000..daef8961 --- /dev/null +++ b/cli/internal/svc/ec2/vm/serial.go @@ -0,0 +1,15 @@ +package vm + +// SerialAttachCommand is what a docker exec with a TTY runs in the VM +// container to connect the terminal to the guest's serial console. socat puts +// the TTY in raw mode, so keystrokes reach the guest's getty unmodified. QEMU +// serves one client at a time; the next connects when the previous one leaves. +func SerialAttachCommand() []string { + return []string{"socat", "-,raw,echo=0", "UNIX-CONNECT:" + SerialSocket} +} + +// QGAAttachCommand is what a docker exec (stdin open) runs to talk to the guest agent. +// -t 1 lets socat end a second after stdin closes. +func QGAAttachCommand() []string { + return []string{"socat", "-t", "1", "-", "UNIX-CONNECT:" + QGASocket} +} diff --git a/cli/internal/svc/ec2/vm/vm_test.go b/cli/internal/svc/ec2/vm/vm_test.go index 0cb5d547..0e4bb2b2 100644 --- a/cli/internal/svc/ec2/vm/vm_test.go +++ b/cli/internal/svc/ec2/vm/vm_test.go @@ -30,7 +30,10 @@ func TestQEMUAArch64Emulated(t *testing.T) { "file=/vm/seed.iso,if=none,id=seed,format=raw,readonly=on", "-netdev stream,id=net0,addr.type=unix,addr.path=/tmp/passt.sock,server=off", "virtio-net-pci,netdev=net0,mac=" + m.MAC(), - "-chardev stdio,id=ser0,signal=off -serial chardev:ser0", + "-chardev socket,id=ser0,path=/run/serial.sock,server=on,wait=off,logfile=/dev/stdout,logappend=on -serial chardev:ser0", + "-chardev socket,id=qga0,path=/run/qga.sock,server=on,wait=off", + "-device virtio-serial-pci,id=vser0", + "-device virtserialport,bus=vser0.0,chardev=qga0,name=org.qemu.guest_agent.0", "-qmp unix:/run/qmp.sock,server=on,wait=off", "-nodefaults", } { From e2f01ef36e2e3474414675a03d030e9a46a255e6 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:13:08 +0530 Subject: [PATCH 12/25] VM run-command and CloudWatch metrics through qemu-guest-agent, serial console in the browser terminal, live test --- cli/internal/server/server.go | 1 + cli/internal/svc/cloudwatch/metrics.go | 45 +++- cli/internal/svc/ec2/ec2.go | 6 +- cli/internal/svc/ec2/terminal.go | 10 +- cli/internal/svc/ec2/vm.go | 5 +- cli/internal/svc/ec2/vm_access.go | 225 ++++++++++++++++++++ cli/internal/svc/ec2/vm_access_live_test.go | 152 +++++++++++++ cli/internal/svc/ec2/vm_live_test.go | 2 +- 8 files changed, 429 insertions(+), 17 deletions(-) create mode 100644 cli/internal/svc/ec2/vm_access.go create mode 100644 cli/internal/svc/ec2/vm_access_live_test.go diff --git a/cli/internal/server/server.go b/cli/internal/server/server.go index 4f272534..323cd27f 100644 --- a/cli/internal/server/server.go +++ b/cli/internal/server/server.go @@ -178,6 +178,7 @@ func Run(ctx context.Context, cfg core.Config, opts Options) error { } ec2Svc := ec2.New(env, vpcSvc) ec2Svc.Recover() + cw.GuestUsage = ec2Svc.GuestUsage s3Svc := s3.New(env, secSvc) vpcSvc.AfterCreate = func(v vpc.VPC) { s3Svc.ConnectNetwork(v) diff --git a/cli/internal/svc/cloudwatch/metrics.go b/cli/internal/svc/cloudwatch/metrics.go index c83dc64a..f9a47a00 100644 --- a/cli/internal/svc/cloudwatch/metrics.go +++ b/cli/internal/svc/cloudwatch/metrics.go @@ -17,6 +17,7 @@ import ( "github.com/homecloudhq/homecloud/cli/internal/core" "github.com/homecloudhq/homecloud/cli/internal/httpx" + "github.com/homecloudhq/homecloud/cli/internal/runtime" "github.com/homecloudhq/homecloud/cli/internal/svc" ) @@ -110,6 +111,11 @@ type Service struct { Notify Notifier // Deliver sends log subscription payloads to a Lambda function ARN. Deliver func(ctx context.Context, arn string, payload []byte) error + // GuestUsage samples the guest of a virtual-machine EC2 instance (through its + // guest agent), so its metrics describe the guest rather than the QEMU + // container. While it returns an error (agent not up yet) nothing is published. + GuestUsage func(ctx context.Context, instanceID string) (*runtime.Usage, error) + guestBusy sync.Map // container ID -> true while a guest sample is running } func New(env *svc.Env) (*Service, error) { @@ -294,6 +300,35 @@ func (s *Service) collect(ctx context.Context) { continue } res := c.Labels[core.LabelResource] + publish := func(id string, u *runtime.Usage, at time.Time) { + dims := map[string]string{n.dim: res} + s.Put(n.ns, "CPUUtilization", dims, "Percent", round(u.CPUPercent), at) + s.Put(n.ns, "MemoryUtilization", dims, "Percent", round(u.MemoryPercent), at) + s.Put(n.ns, "MemoryUsed", dims, "Bytes", float64(u.MemoryBytes), at) + s.Put(n.ns, "NetworkIn", dims, "Bytes", s.delta(id+"rx", u.NetRxBytes), at) + s.Put(n.ns, "NetworkOut", dims, "Bytes", s.delta(id+"tx", u.NetTxBytes), at) + s.Put(n.ns, "DiskReadBytes", dims, "Bytes", s.delta(id+"br", u.BlockRead), at) + s.Put(n.ns, "DiskWriteBytes", dims, "Bytes", s.delta(id+"bw", u.BlockWrite), at) + s.Put(n.ns, "ProcessCount", dims, "Count", float64(u.Pids), at) + } + if s.GuestUsage != nil && c.Labels[core.LabelService] == "ec2" && c.Labels["homecloud.virtualization"] != "" { + // A guest sample takes a second or more, and much longer while the + // guest agent is not up yet: it runs on its own so it never holds up + // the tick, and one per instance at a time. + if _, busy := s.guestBusy.LoadOrStore(c.ID, true); busy { + continue + } + go func(id string) { + defer core.Recover("cloudwatch guest sample " + res) + defer s.guestBusy.Delete(id) + sctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + if u, err := s.GuestUsage(sctx, res); err == nil { + publish(id, u, time.Now().UTC()) + } + }(c.ID) + continue + } wg.Add(1) sem <- struct{}{} go func(id string) { @@ -305,15 +340,7 @@ func (s *Service) collect(ctx context.Context) { if err != nil { return } - dims := map[string]string{n.dim: res} - s.Put(n.ns, "CPUUtilization", dims, "Percent", round(u.CPUPercent), now) - s.Put(n.ns, "MemoryUtilization", dims, "Percent", round(u.MemoryPercent), now) - s.Put(n.ns, "MemoryUsed", dims, "Bytes", float64(u.MemoryBytes), now) - s.Put(n.ns, "NetworkIn", dims, "Bytes", s.delta(id+"rx", u.NetRxBytes), now) - s.Put(n.ns, "NetworkOut", dims, "Bytes", s.delta(id+"tx", u.NetTxBytes), now) - s.Put(n.ns, "DiskReadBytes", dims, "Bytes", s.delta(id+"br", u.BlockRead), now) - s.Put(n.ns, "DiskWriteBytes", dims, "Bytes", s.delta(id+"bw", u.BlockWrite), now) - s.Put(n.ns, "ProcessCount", dims, "Count", float64(u.Pids), now) + publish(id, u, now) }(c.ID) } wg.Wait() diff --git a/cli/internal/svc/ec2/ec2.go b/cli/internal/svc/ec2/ec2.go index 0fc0a6a4..d169bf78 100644 --- a/cli/internal/svc/ec2/ec2.go +++ b/cli/internal/svc/ec2/ec2.go @@ -1123,12 +1123,12 @@ func (s *Service) runCommand(c *httpx.Ctx) (any, error) { if i.State != "running" { return nil, core.Errf(http.StatusConflict, "InvalidInstanceState", "instance %s is %s", i.ID, i.State) } - if i.IsVM() { - return nil, errVMUnsupported("running commands inside") - } if in.Timeout <= 0 || in.Timeout > 600 { in.Timeout = 60 } + if i.IsVM() { + return s.vmRunCommand(c.R.Context(), i, in.Command, in.Timeout) + } ctx, cancel := context.WithTimeout(c.R.Context(), time.Duration(in.Timeout)*time.Second) defer cancel() start := time.Now() diff --git a/cli/internal/svc/ec2/terminal.go b/cli/internal/svc/ec2/terminal.go index 56546e11..ec80bdb7 100644 --- a/cli/internal/svc/ec2/terminal.go +++ b/cli/internal/svc/ec2/terminal.go @@ -8,6 +8,7 @@ import ( docker "github.com/fsouza/go-dockerclient" "github.com/homecloudhq/homecloud/cli/internal/core" "github.com/homecloudhq/homecloud/cli/internal/httpx" + "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm" "golang.org/x/net/websocket" ) @@ -23,16 +24,21 @@ func (s *Service) terminal(c *httpx.Ctx) (any, error) { if i.State != "running" { return nil, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s is %s", i.ID, i.State) } + cmd := []string{"/bin/sh", "-c", "cd ~ 2>/dev/null; if command -v bash >/dev/null; then exec bash -l; else exec sh -l; fi"} if i.IsVM() { - return nil, errVMUnsupported("the browser terminal for") + // A VM has no docker-exec shell: the terminal is its serial console. + cmd = vm.SerialAttachCommand() } c.MarkWritten() ws := websocket.Server{Handler: func(conn *websocket.Conn) { defer conn.Close() + if i.IsVM() { + _ = websocket.Message.Send(conn, "[homecloud] serial console of "+i.ID+": press Enter for a login prompt (one session at a time).\r\n") + } ex, err := s.env.Docker.C.CreateExec(docker.CreateExecOptions{ Container: i.ContainerID, Tty: true, AttachStdin: true, AttachStdout: true, AttachStderr: true, Env: []string{"TERM=xterm-256color"}, - Cmd: []string{"/bin/sh", "-c", "cd ~ 2>/dev/null; if command -v bash >/dev/null; then exec bash -l; else exec sh -l; fi"}, + Cmd: cmd, }) if err != nil { _ = websocket.Message.Send(conn, "\r\n[homecloud] could not open a shell: "+err.Error()+"\r\n") diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go index 6c13cc88..46b0d9b6 100644 --- a/cli/internal/svc/ec2/vm.go +++ b/cli/internal/svc/ec2/vm.go @@ -36,8 +36,9 @@ import ( // is otherwise emulated. // // Stage 1 covers the instance lifecycle. Extra volumes, snapshots and images -// of VM disks, a browser terminal, run-command, CloudWatch metrics and backup -// are not available for VM instances yet. +// of VM disks and backup are not available for VM instances yet. The browser +// terminal (serial console), run-command and CloudWatch metrics are in +// vm_access.go. const defaultVMImageVolume = "hc-vm-images" diff --git a/cli/internal/svc/ec2/vm_access.go b/cli/internal/svc/ec2/vm_access.go new file mode 100644 index 00000000..87adf082 --- /dev/null +++ b/cli/internal/svc/ec2/vm_access.go @@ -0,0 +1,225 @@ +package ec2 + +import ( + "bufio" + "context" + "errors" + "fmt" + "io" + "net/http" + "strconv" + "sync" + "time" + + docker "github.com/fsouza/go-dockerclient" + "github.com/homecloudhq/homecloud/cli/internal/core" + "github.com/homecloudhq/homecloud/cli/internal/runtime" + "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm" +) + +// Access to a running VM guest: run-command and the CloudWatch metrics go +// through qemu-guest-agent (QGA) on the virtio-serial channel QEMU serves as a +// socket in the VM container; the browser terminal attaches to the serial +// console socket (see terminal.go). +// +// QEMU serves one QGA client at a time, so calls to one guest are serialized. +// Each call is its own `docker exec socat` session that performs the +// guest-sync handshake first (the channel may hold a previous client's leftovers). + +// qgaSlots holds one semaphore per VM container. +var qgaSlots sync.Map + +func qgaSlot(cid string) chan struct{} { + v, _ := qgaSlots.LoadOrStore(cid, make(chan struct{}, 1)) + return v.(chan struct{}) +} + +var errGuestAgent = errors.New("the guest agent is not responding (it is installed by cloud-init on first boot; images without it, or a guest that is still booting, cannot run commands)") + +// qgaCall sends one command to the guest agent and returns its reply. ctx +// bounds the whole call, including waiting for the agent and for other callers. +func (s *Service) qgaCall(ctx context.Context, cid string, req []byte) (vm.QGAReply, error) { + slot := qgaSlot(cid) + select { + case slot <- struct{}{}: + defer func() { <-slot }() + case <-ctx.Done(): + return vm.QGAReply{}, errGuestAgent + } + ectx, cancel := context.WithCancel(ctx) + defer cancel() + ex, err := s.env.Docker.C.CreateExec(docker.CreateExecOptions{ + Container: cid, Cmd: vm.QGAAttachCommand(), AttachStdin: true, AttachStdout: true, AttachStderr: true, Context: ectx, + }) + if err != nil { + return vm.QGAReply{}, err + } + inR, inW := io.Pipe() + outR, outW := io.Pipe() + done := make(chan struct{}) + go func() { + defer close(done) + defer outW.Close() + _ = s.env.Docker.C.StartExec(ex.ID, docker.StartExecOptions{InputStream: inR, OutputStream: outW, ErrorStream: io.Discard, Context: ectx}) + }() + defer func() { + inW.Close() + cancel() + outR.Close() + inR.Close() + select { + case <-done: + case <-time.After(5 * time.Second): + } + }() + lines := make(chan []byte, 16) + go func() { + defer close(lines) + br := bufio.NewReader(outR) + for { + l, err := br.ReadBytes('\n') + if len(l) > 0 { + select { + case lines <- l: + case <-ectx.Done(): + return + } + } + if err != nil { + return + } + } + }() + write := func(b []byte) { go inW.Write(b) } // a stalled connection must not block the loop + + syncID := time.Now().UnixNano() & 0x7fffffff + want := strconv.FormatInt(syncID, 10) + synced := false + write(vm.QGASync(syncID)) + tick := time.NewTicker(2 * time.Second) + defer tick.Stop() + for { + select { + case <-ctx.Done(): + return vm.QGAReply{}, errGuestAgent + case <-tick.C: + if !synced { + write(vm.QGASync(syncID)) + } + case l, ok := <-lines: + if !ok { + return vm.QGAReply{}, errors.New("the connection to the guest agent closed") + } + r, ok := vm.ParseQGAReply(l) + if !ok { + continue + } + if !synced { + if r.Synced && string(r.Return) == want { + synced = true + write(req) + } + continue + } + if r.Synced { + continue + } + return r, r.Err() + } + } +} + +// guestExec runs a shell command in the guest through the agent and waits for +// it, up to timeout (enforced in the guest with timeout(1) and here). +func (s *Service) guestExec(ctx context.Context, inst Instance, command string, timeout time.Duration) (vm.ExecStatus, error) { + path, args := vm.ShellCommand(command, int(timeout.Seconds())) + call := func(req []byte) (vm.QGAReply, error) { + cctx, cancel := context.WithTimeout(ctx, 20*time.Second) + defer cancel() + return s.qgaCall(cctx, inst.ContainerID, req) + } + r, err := call(vm.QGAExecRequest(path, args)) + if err != nil { + return vm.ExecStatus{}, err + } + pid, err := vm.ParseExecPID(r.Return) + if err != nil { + return vm.ExecStatus{}, err + } + // The guest's timeout(1) ends the command at timeout (plus its 5s kill grace). + deadline := time.Now().Add(timeout + 15*time.Second) + for { + r, err := call(vm.QGAExecStatusRequest(pid)) + if err != nil { + return vm.ExecStatus{}, err + } + st, err := vm.ParseExecStatus(r.Return) + if err != nil { + return st, err + } + if st.Exited { + return st, nil + } + if time.Now().After(deadline) || ctx.Err() != nil { + return st, core.Errf(http.StatusGatewayTimeout, "RequestTimeout", "the command did not finish in %s", timeout) + } + select { + case <-ctx.Done(): + case <-time.After(400 * time.Millisecond): + } + } +} + +// vmRunCommand is run-command for VM instances. +func (s *Service) vmRunCommand(ctx context.Context, i Instance, command string, timeoutSeconds int) (any, error) { + timeout := time.Duration(timeoutSeconds) * time.Second + start := time.Now() + st, err := s.guestExec(ctx, i, command, timeout) + if err != nil { + var ce *core.Error + if errors.As(err, &ce) { + return nil, err + } + return nil, core.Errf(http.StatusConflict, "InvalidInstanceState", "%v", err) + } + status := "Success" + switch { + case st.ExitCode == 124 && time.Since(start) >= timeout: + status = "TimedOut" + case st.ExitCode != 0: + status = "Failed" + } + return map[string]any{"command_id": core.NewID("cmd"), "instance_id": i.ID, "status": status, "exit_code": st.ExitCode, + "stdout": st.Stdout, "stderr": st.Stderr, "duration_ms": time.Since(start).Milliseconds()}, nil +} + +// GuestUsage samples a running VM instance's guest through the agent, for the +// CloudWatch collector. Unlike Docker's stats of the VM container (which +// measure QEMU), this is what the guest itself sees. An error means there is +// nothing to publish now (not running, agent not up yet). +func (s *Service) GuestUsage(ctx context.Context, instanceID string) (*runtime.Usage, error) { + i, err := s.get(instanceID) + if err != nil { + return nil, err + } + if !i.IsVM() || i.State != "running" || i.ContainerID == "" { + return nil, fmt.Errorf("%s is not a running VM", instanceID) + } + ctx, cancel := context.WithTimeout(ctx, 25*time.Second) + defer cancel() + st, err := s.guestExec(ctx, i, vm.StatsCommand, 15*time.Second) + if err != nil { + return nil, err + } + if st.ExitCode != 0 { + return nil, fmt.Errorf("guest stats exited %d: %s", st.ExitCode, st.Stderr) + } + g, err := vm.ParseGuestStats(st.Stdout) + if err != nil { + return nil, err + } + return &runtime.Usage{ + CPUPercent: g.CPUPercent, MemoryBytes: g.MemoryUsed, MemoryLimit: g.MemoryTotal, MemoryPercent: g.MemoryPercent(), + NetRxBytes: g.NetRx, NetTxBytes: g.NetTx, BlockRead: g.DiskRead, BlockWrite: g.DiskWrite, Pids: g.Processes, + }, nil +} diff --git a/cli/internal/svc/ec2/vm_access_live_test.go b/cli/internal/svc/ec2/vm_access_live_test.go new file mode 100644 index 00000000..5b338bd6 --- /dev/null +++ b/cli/internal/svc/ec2/vm_access_live_test.go @@ -0,0 +1,152 @@ +package ec2_test + +import ( + "context" + "encoding/json" + "net/http" + "strings" + "testing" + "time" + + "github.com/homecloudhq/homecloud/cli/internal/svc/cloudwatch" + "golang.org/x/net/websocket" +) + +// vmAccessChecks exercises what the guest agent and the serial console give a +// running VM instance: run-command, CloudWatch metrics from the guest and the +// browser terminal. Every wait has a deadline. +func (f *filterEnv) vmAccessChecks(t *testing.T, id string) { + t.Helper() + h := f.h + type cmdResult struct { + Status string `json:"status"` + ExitCode int `json:"exit_code"` + Stdout string `json:"stdout"` + Stderr string `json:"stderr"` + } + runCmd := func(command string, timeout int) (int, cmdResult, string) { + code, body := h.NativeAs(t, h.AccessKeyID, h.SecretKey, "POST", "/api/v1/ec2/instances/"+id+"/commands", + map[string]any{"command": command, "timeout_seconds": timeout}) + var r cmdResult + _ = json.Unmarshal(body, &r) + return code, r, string(body) + } + + // run-command: stdout, stderr and the exit code come from the guest. The + // agent may need a moment after the boot marker. + var r cmdResult + waitFor(t, "run-command through the guest agent", vmTestBudget, func() bool { + code, res, body := runCmd(`echo out-$(hostname); echo err-text >&2; exit 3`, 60) + if code != http.StatusOK { + t.Logf("run-command: %d %s", code, body) + return false + } + r = res + return true + }) + if r.Status != "Failed" || r.ExitCode != 3 || !strings.HasPrefix(r.Stdout, "out-ip-") || strings.TrimSpace(r.Stderr) != "err-text" { + t.Errorf("run-command result: %+v", r) + } + if _, r, body := runCmd(`cat /etc/os-release | head -1; uname -m`, 60); r.Status != "Success" || r.ExitCode != 0 || !strings.Contains(r.Stdout, "NAME=") { + t.Errorf("second run-command: %s", body) + } + start := time.Now() + if _, r, body := runCmd(`sleep 120`, 3); r.Status != "TimedOut" || time.Since(start) > 60*time.Second { + t.Errorf("a command past its timeout: %s (took %s)", body, time.Since(start)) + } + // The same IAM action as container instances: a user without ssm:SendCommand is refused. + akid, secret := h.User(t, "vm-nossm") + if code, body := h.NativeAs(t, akid, secret, "POST", "/api/v1/ec2/instances/"+id+"/commands", map[string]any{"command": "id"}); code != http.StatusForbidden { + t.Errorf("run-command without permission: %d %s", code, body) + } + t.Logf("run-command through the guest agent verified") + + // CloudWatch metrics describe the guest (a QEMU container has a handful of + // processes; a booted Ubuntu has dozens, and its memory is the guest's). + cw, err := cloudwatch.New(h.Env) + if err != nil { + t.Fatal(err) + } + cw.GuestUsage = f.ec2.GuestUsage + ctx, cancel := context.WithCancel(context.Background()) + done := make(chan struct{}) + go func() { cw.Run(ctx); close(done) }() + defer func() { cancel(); <-done }() + dims := map[string]string{"InstanceId": id} + last := func(name string) (float64, bool) { + pts, _ := cw.Statistics("HC/EC2", name, dims, time.Now().Add(-time.Hour), time.Now().Add(time.Minute), time.Minute) + if len(pts) == 0 { + return 0, false + } + return pts[len(pts)-1].Maximum, true + } + waitFor(t, "guest metrics in CloudWatch", 6*time.Minute, func() bool { + _, a := last("CPUUtilization") + _, b := last("MemoryUtilization") + _, c := last("ProcessCount") + return a && b && c + }) + if v, _ := last("ProcessCount"); v < 20 { + t.Errorf("ProcessCount %v: measures the QEMU container, not the guest", v) + } + if v, _ := last("MemoryUsed"); v < 50<<20 || v > 1<<30 { + t.Errorf("MemoryUsed %v bytes: expected the t3.micro guest's (between 50 MiB and 1 GiB)", v) + } + if v, _ := last("MemoryUtilization"); v <= 0 || v >= 100 { + t.Errorf("MemoryUtilization %v", v) + } + if v, ok := last("CPUUtilization"); !ok || v < 0 || v > 100 { + t.Errorf("CPUUtilization %v", v) + } + for _, name := range []string{"NetworkIn", "NetworkOut", "DiskReadBytes", "DiskWriteBytes"} { + if _, ok := last(name); !ok { + t.Errorf("no %s datapoint", name) + } + } + t.Logf("guest metrics published") + + // The browser terminal is the serial console: a login prompt appears. + cfg, err := websocket.NewConfig("ws"+strings.TrimPrefix(h.URL, "http")+"/api/v1/ec2/instances/"+id+"/terminal", h.URL) + if err != nil { + t.Fatal(err) + } + cfg.Header.Set("Authorization", "Bearer "+h.AccessKeyID+":"+h.SecretKey) + conn, err := websocket.DialConfig(cfg) + if err != nil { + t.Fatalf("terminal: %v", err) + } + defer conn.Close() + frames := make(chan string, 256) + go func() { + defer close(frames) + for { + var m string + if websocket.Message.Receive(conn, &m) != nil { + return + } + frames <- m + } + }() + var got strings.Builder + deadline := time.After(3 * time.Minute) + nudge := time.NewTicker(3 * time.Second) + defer nudge.Stop() + for !strings.Contains(got.String(), " login:") { + select { + case m, ok := <-frames: + if !ok { + t.Fatalf("terminal closed before a login prompt; got %q", got.String()) + } + got.WriteString(m) + case <-nudge.C: + _ = websocket.Message.Send(conn, `{"t":"i","d":"\r"}`) + case <-deadline: + t.Fatalf("no login prompt on the serial terminal; got %q", got.String()) + } + } + t.Logf("serial terminal shows the login prompt") + // The log (GetConsoleOutput) still has the boot output with a client attached. + if out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string); !strings.Contains(out, "Cloud-init v.") { + t.Errorf("console output lost the boot log: %.300s", out) + } +} diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go index 760ff11d..4732accb 100644 --- a/cli/internal/svc/ec2/vm_live_test.go +++ b/cli/internal/svc/ec2/vm_live_test.go @@ -269,7 +269,7 @@ func TestVMInstanceLifecycle(t *testing.T) { if out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string); !strings.Contains(out, "Cloud-init v.") || !strings.Contains(out, "finished at") { t.Errorf("console output lacks cloud-init lines: %.300s", out) } - // Commands inside a VM are not available yet, with a clear error. + f.vmAccessChecks(t, id) // run-command, guest metrics and the serial terminal if msg, err := h.AWSErr(t, "ec2", "create-image", "--instance-id", id, "--name", "vm-img"); err == nil || !strings.Contains(msg, "not supported yet") { t.Errorf("create-image of a VM: %v %s", err, msg) } From 932445996f6a4f866704573ad534bf778113db6b Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:13:38 +0530 Subject: [PATCH 13/25] Document VM run-command, serial terminal and guest metrics --- CHANGELOG.md | 3 ++- docs/architecture.md | 8 ++++---- docs/aws-compat.md | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1c35b03..d163d816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ ### EC2 - VM instances: `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` boot the official cloud image as a QEMU virtual machine with its own kernel, systemd and cloud-init. The VM runs inside a container attached to the instance's VPC network with its private IP, so DNS, the metadata service, security groups and published ports work as for container instances; passt gives the guest the container's address and forwards inbound ports. Key pairs, user data (scripts and `#cloud-config`), the root block device size, stop/start/reboot, console output and terminate work through the same EC2 API, CLI, console and Terraform. - Guests use KVM when the Docker host has `/dev/kvm` and are emulated (slower) otherwise; instances report `virtualization: "kvm"` or `"emulated"`. `DescribeImages` and `DescribeInstances` report `Hypervisor: kvm` for VM images and instances. Cloud images are pinned to a release, verified by checksum and downloaded once into a Docker volume; the runner image is built locally on first use. -- Not available for VM instances yet: extra volumes, snapshots and images of VM disks, the browser terminal, run-command, CloudWatch metrics, backup. +- VM instances have run-command (through qemu-guest-agent, installed by cloud-init), the browser terminal (the guest's serial console; log in with a password set by user data) and CloudWatch `HC/EC2` metrics measured inside the guest (CPU, memory, network, disk, process count), all under the same IAM actions as container instances. +- Not available for VM instances yet: extra volumes, snapshots and images of VM disks, backup. - CI boots a VM with KVM on every change. ## 0.3.0 (2026-09-30) diff --git a/docs/architecture.md b/docs/architecture.md index 9205bdd5..ca362500 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -62,7 +62,7 @@ The data directory defaults to `~/.homecloud` (override with `--data-dir` or `HO | Kernel, init | the host's; a small init script or the image's entrypoint | the guest's own; systemd, cloud-init | | Root disk | writable layer of the container | qcow2 overlay on the cached cloud image, in the root EBS volume (`/dev/xvda`, sized by the root block device mapping, default 8 GiB) | | Networking | the container's veth | the same veth; passt gives the guest the container's address, gateway and routes and forwards every inbound TCP and UDP port to it | -| Login | `docker exec` (terminal, run-command) | SSH with the key pair (the image's default user `ubuntu` or `debian`) | +| Login | `docker exec` (terminal, run-command) | SSH with the key pair (the image's default user `ubuntu` or `debian`); the browser terminal is the serial console, run-command goes through the guest agent | | User data, key | boot script, `/root/.ssh/authorized_keys` | cloud-init NoCloud seed ISO (`cidata`): instance ID, hostname, the key pair's public key, user data as sent (script, `#cloud-config`, ...) | | Console output | container log | the guest's serial console (the container log) | | Stop, reboot | container stop, restart | ACPI power button through QMP, then a kill after a timeout; reboot is stop + start of the same container | @@ -70,9 +70,9 @@ The data directory defaults to `~/.homecloud` (override with `--data-dir` or `HO The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. **Security trade-off.** passt sandboxes itself (user, mount and pid namespaces, `pivot_root`, then runs as `nobody`). Docker's default seccomp profile blocks that, and on Ubuntu hosts so does the `docker-default` AppArmor profile (it denies the remount and `pivot_root`; verified on Ubuntu 24.04 with `kernel.apparmor_restrict_unprivileged_userns=1`), so the VM container runs with `seccomp=unconfined` and `apparmor=unconfined`. A narrower AppArmor profile would have to be loaded on the host, which HomeCloud (a Docker client) cannot do. The container still gets only Docker's default capabilities, no `SYS_ADMIN`, no privileged mode and no host devices except `/dev/kvm` when accelerated; the trust is that of a root process in a container without MAC confinement running QEMU and passt, so use VM images only where you would accept that. passt also opens a socket per forwarded port, so the VM container's open-file limit is raised to 1048576 (Docker's default on some hosts is 65536 or 1024, which made passt fail with "Too many open files"). Instances report `vm_network: "passt"` or `"user"`. If passt cannot start (for example a host whose security modules forbid the user namespace), or when the server runs with `HC_VM_NET=user`, the container falls back to QEMU's user-mode networking: the guest then sits behind NAT at 10.0.2.15, still reaches the metadata service and DNS, and only the TCP/UDP ports that the instance's security groups open (at most 64, whatever their source) are forwarded to it; a rule that opens another port rebuilds the container (the guest reboots), for the automatic fallback too; the server logs why passt failed. -CloudWatch's `HC/EC2` metrics and `homecloud backup` see the VM container: CPU, memory and I/O are QEMU's (not the guest's own numbers), and a backup copies the root volume's qcow2 file, which points at the cached cloud image (the cache volume itself is left out of backups). +**Guest agent, run-command, terminal, metrics.** The command line adds a virtio-serial port `org.qemu.guest_agent.0` backed by a socket in the VM container (`/run/qga.sock`), and cloud-init's vendor-data (a script, so it survives a user-data `packages:` or `runcmd:`) installs and starts `qemu-guest-agent`. *Run-command* (`POST /api/v1/ec2/instances/{id}/commands`, `ssm:SendCommand` as for containers) sends `guest-exec` for `/bin/sh -c` (wrapped in the guest's `timeout(1)` so the command is killed at its timeout; status `TimedOut`) and polls `guest-exec-status` for stdout, stderr and the exit code. Each agent call is a `docker exec` of `socat` into the VM container that does the `guest-sync-delimited` handshake first; QEMU serves one agent client at a time, so calls to one guest are serialized. The agent needs the image's network on first boot to install it (images are Debian/Ubuntu); until it is up run-command fails with a clear error. The *browser terminal* cannot be a shell through the agent (`guest-exec` is not interactive), so it attaches to the guest's **serial console**: the serial port is a QEMU socket chardev (`/run/serial.sock`) with `logfile=/dev/stdout`, which tees everything the guest prints into the container log so `GetConsoleOutput` and the boot-ready detection are unchanged whether or not a terminal is attached. The terminal WebSocket runs `docker exec -t ... socat -,raw,echo=0 UNIX-CONNECT:/run/serial.sock`; the user presses Enter and logs in at the guest's getty. Cloud images have no console password, so set one through user data (`chpasswd`) to use it; one serial session at a time. *CloudWatch* metrics of a VM instance come from the guest, not from QEMU: the collector asks the EC2 service for a sample, which runs one `guest-exec` that reads `/proc/stat` twice a second apart (`CPUUtilization`, no state between samples), `/proc/meminfo` (`MemoryUsed` = total - available, `MemoryUtilization`), `/proc/net/dev` without `lo` (`NetworkIn/Out`), `/proc/diskstats` for whole disks (`DiskReadBytes/WriteBytes`) and the process count, published under the same `HC/EC2` namespace and `InstanceId` dimension as containers. `/proc` through `guest-exec` was chosen over `guest-get-cpustats` (new in QGA 7.1, not in every image) and QMP statistics (which only see the virtual devices). Samples run beside the collector's tick, one per instance at a time, and publish nothing while the agent is not up. `homecloud backup` still sees the VM container: a backup copies the root volume's qcow2 file, which points at the cached cloud image (the cache volume itself is left out of backups). -Adding the rest of EBS, snapshots and images to VM instances later needs no new mechanism: extra volumes become virtio disks (`-drive` entries appended to the command line, the volume mounted at `/vm/` in the VM container like the root volume), the root volume's qcow2 file is what a snapshot copies, and run-command and the terminal go through the SSH key or a guest agent instead of `docker exec`. +Adding the rest of EBS, snapshots and images to VM instances later needs no new mechanism: extra volumes become virtio disks (`-drive` entries appended to the command line, the volume mounted at `/vm/` in the VM container like the root volume), the root volume's qcow2 file is what a snapshot copies. **Security groups.** Ingress and egress rules are enforced between the resources of a VPC, not only at the host boundary. Every resource that has security groups (an EC2 instance, an ECS task, an RDS or ElastiCache node, a load balancer, a Lambda environment with a VPC configuration) gets an iptables ruleset rendered from its groups and loaded into *its own network namespace*: ingress is default-deny, a packet is accepted when a rule of one of the resource's groups matches its protocol, port range (ICMP type and code) and source, and replies to accepted connections always flow back (connection tracking, so rules are stateful in both directions). A source is a CIDR or a referenced group ("from sg-app" = from every resource that has sg-app), which HomeCloud resolves to the group members' current addresses inside the VPC. A resource with no groups is in the VPC's default group, which (as in AWS) allows all inbound traffic from its own members. Egress is not filtered while a resource's groups still contain the default allow-all rule; once it is revoked, only the egress rules (plus DNS and the instance metadata service, which are always reachable) let traffic out. A load balancer is a member of its own groups, so its traffic to a target is judged by the target's groups (the target's group must allow the balancer's group), and health checks obey them too. Listener ports of internet-facing balancers, publicly accessible databases and Lambda emulator ports are published on the host whatever the groups say, so traffic from outside the VPC to them is accepted and the groups filter only what comes from inside it. @@ -131,7 +131,7 @@ Published versions are immutable snapshots of `$LATEST` (configuration and a cop ## Limits and differences from AWS -- Instances are containers unless their AMI is a VM image (see **EC2 VM instances** above): container instances share the host kernel, and their "disk" is the container's writable layer. VM instances are QEMU guests with their own kernel and disk, but only the lifecycle is covered so far: extra volumes, snapshots and images of a VM disk, the browser terminal, run-command, CloudWatch metrics, backup and native macOS acceleration are not available for them yet, and they are emulated (slow) on Docker hosts without `/dev/kvm`. +- Instances are containers unless their AMI is a VM image (see **EC2 VM instances** above): container instances share the host kernel, and their "disk" is the container's writable layer. VM instances are QEMU guests with their own kernel and disk, but the covered part is the lifecycle, run-command, the serial terminal and guest metrics: extra volumes, snapshots and images of a VM disk, backup and native macOS acceleration are not available for them yet, and they are emulated (slow) on Docker hosts without `/dev/kvm`. - Security groups filter traffic between resources of a VPC (see Security groups above) and decide which ports are published on the host. Published ports are still fixed at container creation: an instance whose published ports no longer match its groups is recreated from a snapshot of its disk (ID, private IP, volumes and tags are kept, the same host ports are reused for ports that stay open, processes restart), while changes to filtering apply live, with no restart. Limits of the filtering: - Covered: EC2 instances, ECS tasks, RDS and ElastiCache nodes, load balancers, and Lambda environments of functions with a VPC configuration. EFS mount targets carry security groups in the API, but a file system is a Docker volume mounted into the instance and there is no network path to filter, so they are recorded only. - Ingress sources that can be matched are IPv4 CIDRs and groups of the same VPC. Prefix lists and IPv6 ranges are recorded but match nothing (VPC networks are IPv4 only), and groups of a peer VPC do not exist (there is no peering). Network ACLs are recorded, not enforced. diff --git a/docs/aws-compat.md b/docs/aws-compat.md index 7655c125..fa7ee7d8 100644 --- a/docs/aws-compat.md +++ b/docs/aws-compat.md @@ -111,7 +111,7 @@ that is not itself a trusted proxy is the source address, and `X-Forwarded-Proto Notes: - Terraform's S3 support prefixes the endpoint host with the account ID, so use `http://localhost:PORT`, not an IP address. -- EC2 VM instances: the AMIs `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` (named `homecloud/vm/...`, so an `aws_ami` lookup for the usual `ubuntu/images/...` names still finds the container images) boot the official cloud image as a QEMU virtual machine; `DescribeImages` and `DescribeInstances` report `VirtualizationType: hvm` and `Hypervisor: kvm` for them (`xen` for container images). `RunInstances` takes the same parameters: `KeyName` authorizes the key for the image's default user (`ubuntu`, `debian`), `UserData` goes to cloud-init unchanged (scripts, `#cloud-config`), and the root `BlockDeviceMappings` entry (`/dev/xvda`, `/dev/sda1` or `/dev/sda`) sets the root disk size (default 8 GiB, at least 4) and `DeleteOnTermination`. The root disk shows up in `DescribeVolumes` and `DescribeInstances` as an attached volume at `/dev/xvda`. `GetConsoleOutput` returns the guest's serial console. Instances stay `pending` until the guest has booted. Guests are emulated, and slow, when the Docker host has no `/dev/kvm`; the native API's `virtualization` field says `kvm` or `emulated`. Not supported yet, with an `UnsupportedOperation` error: attaching or detaching volumes, extra block devices or file systems at launch, `CreateImage`, the browser terminal and run-command. Snapshots, backups and CloudWatch metrics of VM disks are not covered either. +- EC2 VM instances: the AMIs `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` (named `homecloud/vm/...`, so an `aws_ami` lookup for the usual `ubuntu/images/...` names still finds the container images) boot the official cloud image as a QEMU virtual machine; `DescribeImages` and `DescribeInstances` report `VirtualizationType: hvm` and `Hypervisor: kvm` for them (`xen` for container images). `RunInstances` takes the same parameters: `KeyName` authorizes the key for the image's default user (`ubuntu`, `debian`), `UserData` goes to cloud-init unchanged (scripts, `#cloud-config`), and the root `BlockDeviceMappings` entry (`/dev/xvda`, `/dev/sda1` or `/dev/sda`) sets the root disk size (default 8 GiB, at least 4) and `DeleteOnTermination`. The root disk shows up in `DescribeVolumes` and `DescribeInstances` as an attached volume at `/dev/xvda`. `GetConsoleOutput` returns the guest's serial console. Instances stay `pending` until the guest has booted. Guests are emulated, and slow, when the Docker host has no `/dev/kvm`; the native API's `virtualization` field says `kvm` or `emulated`. Run-command (`ssm:SendCommand`, through qemu-guest-agent), the browser terminal (the guest's serial console: set a console password with user data to log in) and CloudWatch `HC/EC2` metrics (measured inside the guest) work as for container instances. Not supported yet, with an `UnsupportedOperation` error: attaching or detaching volumes, extra block devices or file systems at launch and `CreateImage`. Snapshots and backups of VM disks are not covered either. - EC2 Elastic IPs (`AllocateAddress`, `DescribeAddresses`, `AssociateAddress`, `DisassociateAddress`, `ReleaseAddress`) are records, not routed addresses. An allocation (`eipalloc-...`) reserves a stable address from the pool in the `elastic_ip_pool` config setting (default `203.0.113.0/24`, a documentation range), and an association (`eipassoc-...`) makes an instance report it as its public IP in `DescribeInstances`, network interfaces and the instance metadata service. It follows the instance across stop and start and is released from it when the instance is terminated. Only `vpc` addresses, one Elastic IP per instance (a second association replaces the first) and instance or primary-interface targets are supported, and bringing your own address is not. Traffic to an instance still arrives on the host ports published by its security groups at the HomeCloud host (`public_host`), not on the Elastic IP. - Security groups are enforced inside the VPC. Ingress rules (protocol, ports or ICMP type/code, and an IPv4 CIDR or a referenced group) decide which resources may open connections to an instance, ECS task, RDS or ElastiCache node, load balancer or VPC-attached Lambda environment; anything else is dropped, replies to allowed connections flow back, and a resource with no group is in the VPC's default group, which allows traffic from its own members. Egress rules are enforced once the default allow-all egress rule has been revoked (DNS and the metadata service always stay reachable). A load balancer's traffic to its targets, health checks included, is judged by the targets' groups. Rules are programmed live into each container's network namespace when rules or group membership change, when resources start, restart or terminate, and when the members of a referenced group change; see [architecture.md](architecture.md#limits-and-differences-from-aws) for the mechanism and its limits (prefix lists and IPv6 sources match nothing, EFS mount targets are recorded only, network ACLs are not enforced). Rules that publish host ports (`0.0.0.0/0` or `127.0.0.1/32`, TCP/UDP, up to 32 ports) still recreate an instance's container when its published ports change (processes restart, disk, volumes and IP are kept); filtering changes never restart anything. Requests use the query API's `IpPermissions.N.Groups` member (`UserIdGroupPairs` is accepted too) for group sources. - Route 53 records are rendered into CoreDNS zone files and picked up within a few seconds; `GetChange` reports `INSYNC` immediately. Public zones answer on the host's DNS port and inside VPCs, private zones only inside their associated VPCs. Each zone has a default apex NS and SOA (shown in listings, not deletable). Alias targets are load balancer DNS names (`.elb.internal`, as returned by ELBv2) and follow the balancer's address. Not supported: routing policies (weighted, latency, failover, geolocation, multivalue; `SetIdentifier` is rejected), health checks, DNSSEC, traffic policies, delegation sets, other alias targets (CloudFront, S3 websites), and `SPF`/`NAPTR`/`DS` records. Names are absolute with or without the trailing dot; a wildcard is returned as `\052`. A public zone's name server is `ns.`. From 12eb2ec1dafbfe7e6b2a4e85580e376bd8317337 Mon Sep 17 00:00:00 2001 From: Suryansh Prajapati <58465650+drk1rd@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:13:56 +0530 Subject: [PATCH 14/25] Console: container or VM choice in the launch wizard, VM badges, System log tab, EC2 capabilities endpoint, demo VM images and instances --- cli/internal/svc/ec2/capabilities.go | 25 + cli/internal/svc/ec2/ec2.go | 1 + console/components/ec2/images-list.tsx | 18 +- console/components/ec2/instance-actions.tsx | 27 +- .../ec2/instance-console-output.tsx | 6 +- console/components/ec2/instance-detail.tsx | 21 +- console/components/ec2/instances-list.tsx | 7 +- console/components/ec2/launch-wizard.tsx | 1377 ++++++++++++----- console/lib/demo/ids.ts | 4 + console/lib/demo/svc/ec2.ts | 44 +- console/lib/types/ec2.ts | 14 + pages/demo/404.html | 2 +- pages/demo/404/index.html | 2 +- .../static/chunks/1002-8a7bfbc5c0cdd804.js | 1 - .../static/chunks/1095-ae659394aacc73ae.js | 1 - .../static/chunks/1113-4fa3c21659063672.js | 1 + .../static/chunks/1183-0fabc0cb94ae6718.js | 1 - .../static/chunks/1208-631c5c15bd4f82c5.js | 1 + .../static/chunks/1226-6d3b4c4c19ad6645.js | 1 + .../static/chunks/1255-b45d400a656668f9.js | 1 - .../static/chunks/1259-5cdaeb31c5eef083.js | 1 + .../static/chunks/1333-2601f57e81887558.js | 1 - .../static/chunks/1395-39a84bc45525ef9f.js | 1 + .../static/chunks/1417-20c7c0e5ab7f270e.js | 1 - .../static/chunks/142-5b0f0c3b0268f52a.js | 1 + .../static/chunks/1452-959646fd8a9d848d.js | 1 + .../static/chunks/1457-fd95b6d33da31afc.js | 1 + .../static/chunks/1481-269b428d2ec485b3.js | 1 + .../static/chunks/1490-839e6ed2aa0a8eee.js | 1 + .../static/chunks/150-46fef33977dc7f29.js | 1 + .../static/chunks/1514-a0a787fb38394f9b.js | 1 - .../static/chunks/1536-367972fc74b101c4.js | 1 + .../static/chunks/1537-5418411d17191e6b.js | 1 - .../static/chunks/1593-bc79e8f31d5cc831.js | 1 - .../static/chunks/1610-9d0bca101f0fc771.js | 1 - .../static/chunks/1641-c8aff58c35c31de5.js | 1 - .../static/chunks/1681-a9fcd944336cfde4.js | 1 + .../static/chunks/1719-2d8b4a4c2391a956.js | 1 + ...b56308.js => 17f2321f.e75e484eec52c258.js} | 2 +- .../static/chunks/1819-ba32c9c8a5fbe2c4.js | 1 - .../static/chunks/1830-dbb06546d320e8e5.js | 1 + .../static/chunks/1884-97bfbc48adb573f3.js | 1 - .../static/chunks/1930-6cbf49bb6738f91b.js | 1 + .../static/chunks/1968-7f453ed0e6f4674b.js | 1 + .../static/chunks/2008-922f78b1b1b1523a.js | 1 - .../static/chunks/2074-f1841ca9174cd224.js | 1 - .../static/chunks/2092-62380e5e4f804a52.js | 1 - .../static/chunks/2112-41340fe381241d76.js | 1 - .../static/chunks/2151-f6771539118eac7c.js | 1 - .../static/chunks/2163-544a128d1dbff73d.js | 1 - .../static/chunks/2164-94cd05207cd4c462.js | 1 - ...14282894f8.js => 2166.4feae7d72ea214c1.js} | 2 +- .../static/chunks/2214-edb7d8ef98da3f72.js | 1 - .../static/chunks/2240-937631aef2e41767.js | 1 + .../static/chunks/2373-7fb2701203f01ca2.js | 1 + .../static/chunks/244-5740d44de1fdaeb6.js | 1 + .../static/chunks/2498-f13d085283c1079e.js | 1 + .../static/chunks/2523-ceac31097bdc3247.js | 1 - .../static/chunks/253-fc32bd1e7cba0add.js | 1 - .../static/chunks/2585-ec8bd016598d977c.js | 1 + .../static/chunks/2604-05d83523dc25cd50.js | 1 + .../static/chunks/2689-f9dac9488c272556.js | 1 + .../static/chunks/2718-f810e006b35713e1.js | 1 - .../static/chunks/2798-e9971f13e2c8bb76.js | 1 + .../static/chunks/2811-15c9c2f02394d4cc.js | 1 + .../static/chunks/2868-47f12b686ed1aebc.js | 1 - .../static/chunks/2886-f35b181bb9b3e6f5.js | 1 + .../static/chunks/2897-1ffbde21ffffc29a.js | 1 + .../static/chunks/2911-08266d2d9b9f028c.js | 1 - .../static/chunks/2999-a21f98017c0bf06b.js | 1 - .../static/chunks/3041-087b8498f815199e.js | 1 + .../static/chunks/3046-6dfc61495af485a7.js | 1 - .../static/chunks/3116-5c1d4bdbae7e3fdf.js | 1 - .../static/chunks/3134-6f6154684ee8fa7c.js | 1 - .../static/chunks/3169-c2032f7edc6d8fe2.js | 1 - .../static/chunks/3198-085a52b0ea5869cc.js | 1 + .../static/chunks/3238-8e56b6f34ccc89f3.js | 1 - .../static/chunks/3254-b7a579fa88ceb3e7.js | 1 - .../static/chunks/3323-152d836556796a7c.js | 1 + .../static/chunks/3403-cbe788ef3ee0085f.js | 1 + .../static/chunks/344-222bd6e3df1f0184.js | 1 - .../static/chunks/3486-bbe949347b1e81f8.js | 1 - .../static/chunks/3536-bf5cb635d8c9dd51.js | 1 + .../static/chunks/3577-e0b740bef33bfd9e.js | 1 + .../static/chunks/359-5e183b68b52b5075.js | 1 + .../static/chunks/3606-1fc1602e529c0f62.js | 1 + .../static/chunks/3660-7b5be0acdf82a0df.js | 1 - .../static/chunks/3714-d71b6a2478b62899.js | 1 - .../static/chunks/3749-5585da21ee5b7e52.js | 1 - .../static/chunks/3768-7b3016d18ae8bc0c.js | 1 - .../static/chunks/3795-f2f775bd517af2cc.js | 1 - .../static/chunks/382-30ee812967762ed6.js | 1 + .../static/chunks/3833-d39d92163ca5f46a.js | 1 - .../static/chunks/3907-d94ac6ae2c452e54.js | 1 + .../static/chunks/3914-6dc13dfc6a1992bb.js | 1 - .../static/chunks/3958-b34b0996cc4ec066.js | 1 + ...4e49c1.js => 3d9f79e1-cbe493dcf58ac9be.js} | 2 +- .../static/chunks/4016-16a8dbabf865ca27.js | 1 + .../static/chunks/4054-1241b7acd338992e.js | 1 + .../static/chunks/4124-c5369c1c22ae29ac.js | 1 + .../static/chunks/4132-96fd061957e633fa.js | 1 - .../static/chunks/4160-30e1366f7e402d2b.js | 1 - .../static/chunks/417-b72c42dd24608c97.js | 1 + .../static/chunks/4174-ffd51ec6ea00d565.js | 1 - .../static/chunks/421-73888418a719f407.js | 1 - .../static/chunks/4217-fc623125971a877e.js | 1 - .../static/chunks/4230-678885b832678d56.js | 1 + .../static/chunks/4274.55d9e52083373d09.js | 1 - .../static/chunks/4352-22920917fbf293bd.js | 1 - .../static/chunks/4444-8e3c11e75995cded.js | 1 + .../static/chunks/4486-7b9fd81891891577.js | 1 + .../static/chunks/45-a805c9704bab3eb5.js | 1 - .../static/chunks/4512-6ff5abd62d45cae2.js | 1 - .../static/chunks/4557-845555fb7f127aea.js | 1 + .../static/chunks/4559-80a1f3a95a02e757.js | 1 - .../static/chunks/4562-ac7b83e04a658374.js | 1 + .../static/chunks/4577-e817478d893a9650.js | 1 - .../static/chunks/4621-6b0c3052c5bad864.js | 1 + .../static/chunks/4660-82ba4a8d785affa4.js | 1 - .../static/chunks/4694-935aa6087f87cc7f.js | 1 + .../static/chunks/4699-18447b37b76491bd.js | 1 - .../static/chunks/4710-c965380d5be3c7ff.js | 1 - .../static/chunks/4741-e5891000eeda9c04.js | 1 - .../static/chunks/4790-b7af8968520c317b.js | 1 + .../static/chunks/4795-92b20640a209a000.js | 1 + .../static/chunks/4806-e5dc4990b7318f77.js | 1 - .../static/chunks/4870-fcaf818fc1583373.js | 1 - .../static/chunks/4895-11ea10bf5641bc43.js | 1 + .../static/chunks/4990-01b3c07d971c96a0.js | 1 + .../static/chunks/5009-74d771429c160cdc.js | 1 + .../static/chunks/5037-da3eae3b2cbb57f2.js | 1 + .../static/chunks/5041-b899099f3201c222.js | 1 + .../static/chunks/5159-bbe8e0c4fb2abec4.js | 1 + .../static/chunks/5174-a89e823c17536150.js | 1 + .../static/chunks/5263-e8da8a154a4fb8d1.js | 1 - .../static/chunks/5270-85a2536ae473419e.js | 1 - .../static/chunks/5340-13780c6d3c4d3d1d.js | 1 + .../static/chunks/5433-c3dbfa77a8137eb2.js | 1 - .../static/chunks/5443-19770755b053d366.js | 1 - .../static/chunks/5444-5e4f47b7fbe623ee.js | 1 + .../static/chunks/5465-7a40d1bccd018862.js | 1 + .../static/chunks/5525-789dc5ce7bbcbaba.js | 1 - .../static/chunks/5607-2cfbaba2f726d0d8.js | 1 + .../static/chunks/5659-cb7535dfbdcd7d44.js | 1 + .../static/chunks/5673-299eafc44ce32675.js | 1 - .../static/chunks/5721-47076df829e033b3.js | 1 + .../static/chunks/5752-92ea4d69f5149382.js | 1 - .../static/chunks/5766-221b3e546111aaa5.js | 1 + .../static/chunks/5795-a80047ec0fe98719.js | 1 + .../static/chunks/5815-dacfb3ceecbd9f3a.js | 1 + .../static/chunks/5818-61d91c792e8dcd67.js | 1 - .../static/chunks/5825-86244729db25916b.js | 1 - .../static/chunks/5826-1fc54d56a257b7a4.js | 1 + .../static/chunks/586-e3359930f5d2b83a.js | 1 + .../static/chunks/5895-671759db9f9d4f52.js | 1 + .../static/chunks/5955-d4c7800fad916273.js | 1 + .../static/chunks/5968-b09b05a4ae2a585f.js | 1 - .../static/chunks/5982-d6008b14e91b8063.js | 1 + .../static/chunks/6078-77979580a726c3b8.js | 1 - .../static/chunks/608-79af78ce03ec32af.js | 1 + .../static/chunks/6080-52f0601357906793.js | 1 + .../static/chunks/6101-11ba261def4b1210.js | 1 - .../static/chunks/6117-965a786c96e8a482.js | 1 + ...d9ccacb3f3.js => 6128-43972cc21ae7dce9.js} | 2 +- .../static/chunks/6130-398e23edbb230836.js | 1 - .../static/chunks/616-b8e8274039b89f49.js | 1 - .../static/chunks/6170-2398b633b2afe03e.js | 1 - .../static/chunks/6292-44aa084734a14b7c.js | 1 - .../static/chunks/64-35f6609dd9a2c2f4.js | 1 + .../static/chunks/6402-b0eea2ecbe30bf3e.js | 1 + .../static/chunks/6420-e3ff25ff96f63dd5.js | 1 + .../static/chunks/643-323d17af60ee743d.js | 1 - .../static/chunks/6457-d4787263f10664a5.js | 1 + .../static/chunks/6507-9f24d4eeb4b24e7a.js | 1 + .../static/chunks/6608-5a3f55dd5ceacedd.js | 1 - .../static/chunks/6627-13c4d14be53a00db.js | 1 + .../static/chunks/6645-b5b04d1a4610f67f.js | 1 + .../static/chunks/6705-9656d5a014fd593e.js | 1 - .../static/chunks/6714-3ccccd3b3e6a951b.js | 1 + .../static/chunks/6801-c1c965257356cda1.js | 1 + .../static/chunks/6864-971b5637d882b519.js | 1 + .../static/chunks/6896-711ba682d45613da.js | 1 - .../static/chunks/6955-37023ab31ea418f7.js | 1 - .../static/chunks/7012-355f4e7983a8a5e5.js | 1 - .../static/chunks/7036-3035e5135864b961.js | 1 + .../static/chunks/7194-5ba3b4606ee4b919.js | 1 + .../static/chunks/7206-ae8f8a4965e96198.js | 1 - .../static/chunks/7274-6afc4f8fc4a54d70.js | 1 - .../static/chunks/7275-5cf7d7bb81a38ccd.js | 1 + .../static/chunks/7300-271d146a7b4e9199.js | 1 + .../static/chunks/7310-1fd266e20f77e455.js | 1 - .../static/chunks/7341-dcc240c291a380ad.js | 1 - .../static/chunks/7351-bd1010d550cd9dc1.js | 1 - .../static/chunks/7375-e2081966aa8b3d58.js | 1 - .../static/chunks/7422-a103a707ccd2a883.js | 1 - .../static/chunks/7432-5ac8af3cd22d5d52.js | 1 - .../static/chunks/752-62c777c747915964.js | 1 + .../static/chunks/7565-883b9e0a2e20a038.js | 1 + .../static/chunks/7580-f4f352e3970e5754.js | 1 + .../static/chunks/76-de33956717e4ab01.js | 1 - .../static/chunks/7605-5a8d1c27ac916077.js | 1 + .../static/chunks/7624-c2292a941bfa09cc.js | 1 - .../static/chunks/7649-172a4f8e1eb7b8dc.js | 1 + .../static/chunks/7655-881de2aca039b573.js | 1 + .../static/chunks/7691-45a19096ebb27bca.js | 1 - .../static/chunks/7695-ea40a6690b86fc66.js | 1 - .../static/chunks/7722-3a9c9959728127c0.js | 1 + .../static/chunks/7739-65b3643e795e5b60.js | 1 - .../static/chunks/7751-a9a0f8dbbde4f405.js | 1 - .../static/chunks/7768-97edde54ed9b4b00.js | 1 - .../static/chunks/7795-d5d0aada730ecf67.js | 1 + .../static/chunks/7830-e406ff109815212d.js | 1 - .../static/chunks/7900-86f8feeb4953099f.js | 1 - .../static/chunks/7985-fcc90c92c56a0fcb.js | 1 + .../static/chunks/8006-d7e9cac4e76f79a7.js | 1 + .../static/chunks/8038-75b8decf81e00ac8.js | 1 - .../static/chunks/8064-20db72538994032b.js | 1 + .../static/chunks/8082-63564dddc92661c5.js | 1 - .../static/chunks/809-aef610cd128e776c.js | 1 - .../static/chunks/8150-8a00f64f1bb25381.js | 1 + .../static/chunks/8297-024594c25c98b482.js | 1 - .../static/chunks/8401-d40ac5179200e489.js | 1 - .../static/chunks/8403-bfd6be192888c5a7.js | 1 - .../static/chunks/8446-740c027da02cfba6.js | 1 + .../static/chunks/8467-4f908b36d8c2f9a7.js | 1 - .../static/chunks/8492-c1aa4e240d35ec95.js | 1 + .../static/chunks/8501-ee250a2ae24211f4.js | 1 - .../static/chunks/8550.6fcc6d1ebfe691f2.js | 1 + .../static/chunks/8583-0e0569fbe139d99d.js | 1 - .../static/chunks/8614-a0d03e9166917f09.js | 1 + .../static/chunks/8657-87dc740191e4259b.js | 1 + .../static/chunks/866-87d9aa71d8b4f3c4.js | 1 - .../static/chunks/8737-6f825f5e7f34114e.js | 1 - .../static/chunks/8746-a3d2def3b3f084f5.js | 1 - .../static/chunks/8747-6b7380577a196c73.js | 1 - .../static/chunks/8795-a0ce2e663100b50d.js | 1 + .../static/chunks/8801-48584feac543b3b6.js | 1 - .../static/chunks/8861-f0243c276de8ee7a.js | 1 + .../static/chunks/893-9dc8d679a2852c8a.js | 1 + .../static/chunks/8948-8d81396a7a569cc9.js | 1 + .../static/chunks/8970-da3d69a214b3bb28.js | 1 - .../static/chunks/8999-a6e71b6a13b23b17.js | 1 + .../static/chunks/9037-4127e44310c29010.js | 1 + .../static/chunks/9043-3362f56844891bcb.js | 1 - .../static/chunks/9093-835cc964e292a352.js | 1 + .../static/chunks/916-0588e02195f65045.js | 1 + .../static/chunks/9170-76001466ce2c7891.js | 1 + .../static/chunks/918-48809276f0b25079.js | 1 + .../static/chunks/9181-91c314c88e784294.js | 1 + .../static/chunks/9182-39361ac4f943740d.js | 1 + .../static/chunks/9209-479e74ee8674b356.js | 1 - .../static/chunks/9219-051804c0515dbcd4.js | 1 - .../static/chunks/9247-02c26bbb9e8447af.js | 1 - .../static/chunks/9276-714512c9da4d324f.js | 1 - .../static/chunks/9282-98a3543fd5b1bec1.js | 1 + .../static/chunks/9339-bd9676d77485ab0f.js | 1 - ...bcc38940d6.js => 9431-56d873e3e8ea5ff1.js} | 2 +- .../static/chunks/9554-93bc5f1c97fb09cc.js | 1 - .../static/chunks/9576-1e7d9f852ba5f8e0.js | 1 + .../static/chunks/9603-1b6c0d6dc4c73cc0.js | 1 + .../static/chunks/9686-6e136e4c61966113.js | 1 - .../static/chunks/976-557313cc0ad0dc25.js | 1 - .../static/chunks/9789-66f6a02d0406fc8d.js | 1 - .../static/chunks/9791-5d4c13ab21fc0d45.js | 1 - .../static/chunks/9798-fd1112fe845c7a9c.js | 1 - .../static/chunks/9818-6abd4585639f687c.js | 1 + .../static/chunks/9819-a14ea5d645bb67fe.js | 1 + .../static/chunks/9865-66c048907a4ce9ab.js | 1 + .../static/chunks/9936-8313f2ca2afc63fc.js | 1 - .../static/chunks/9986-944353085eef2fed.js | 1 + .../acm/certificate/page-cbec3df084b22553.js | 1 - .../acm/certificate/page-d9ea7bfb58f7ca81.js | 1 + .../(console)/acm/page-3754ab26e8e8a3fa.js | 1 - .../(console)/acm/page-a506e6597b660bcf.js | 1 + .../apigateway/api/page-8b6f0b4f4e84d13e.js | 1 + .../apigateway/api/page-9bbb39634a615084.js | 1 - .../apigateway/page-97fa9b93eaa9b8fe.js | 1 - .../apigateway/page-d800ac3fbe4352a7.js | 1 + .../create/page-336bc2c82c83ad40.js | 1 + .../create/page-b518762d012d6b3c.js | 1 - .../cloudformation/page-21883cc144ab324b.js | 1 - .../cloudformation/page-bfaf7ff49401330a.js | 1 + .../resource-types/page-3966710fa0f59f83.js | 1 + .../resource-types/page-ef98373a9341e317.js | 1 - ...dde3740fa6.js => page-571231527f3b5bce.js} | 2 +- .../cloudtrail/page-679763f285158463.js | 1 + .../cloudtrail/page-83836d06b3f52729.js | 1 - .../alarms/page-1d9906c8a7e2f251.js | 1 - .../alarms/page-f6faa9d9d28dacdc.js | 1 + .../insights/page-6566a33141c0a2e3.js | 1 - .../insights/page-8413ffbcaaad2ba2.js | 1 + .../logs/group/page-4de93eb9321182da.js | 1 - .../logs/group/page-9217550d87c1b2b2.js | 1 + .../cloudwatch/logs/page-0a7bf7a69cadfa5d.js | 1 - .../cloudwatch/logs/page-ff41c6899c0debfc.js | 1 + .../metrics/page-22055ad43356c7c8.js | 1 + .../metrics/page-2c3424c791c1d75c.js | 1 - .../cloudwatch/page-34ee3cba2fe894d3.js | 1 - .../cloudwatch/page-9cee150c6e020bda.js | 1 + .../cognito/page-840be91de2635382.js | 1 - .../cognito/page-d948dd3364101d18.js | 1 + .../cognito/pool/page-43d2cc59cda6cbba.js | 1 + .../cognito/pool/page-85d740bdf51dc47d.js | 1 - .../dynamodb/create/page-e21aace8646e6cc4.js | 1 + .../dynamodb/create/page-e98ebdc3390d0025.js | 1 - .../dynamodb/page-a52f6cf14b2bf68f.js | 1 + .../dynamodb/page-fe63803cbae9c622.js | 1 - .../dynamodb/table/page-969dc2da4888c12c.js | 1 - .../dynamodb/table/page-cfaf699f3f4a0c46.js | 1 + ...bcf4dd4684.js => page-2926c041348f7a3f.js} | 2 +- .../group/page-90365d19246f9213.js | 1 - .../group/page-bfbcf827adddfdf0.js | 1 + .../ec2/autoscaling/page-2cd7d3220ed6b835.js | 1 - .../ec2/autoscaling/page-90bd271cc8f879f6.js | 1 + .../ec2/elastic-ips/page-80a086adc671cd26.js | 1 - .../ec2/elastic-ips/page-ac19975efb08eb6f.js | 1 + .../ec2/images/page-0f4eeb9c66b3de9e.js | 1 - .../ec2/images/page-c5a9f04c2ac23cf3.js | 1 + .../instance-types/page-55ff2ec55511ea4d.js | 1 + .../instance-types/page-7d534a2ddc2ae483.js | 1 - .../ec2/instance/page-550e8243673dda66.js | 1 - .../ec2/instance/page-fa0de87916058801.js | 1 + .../ec2/key-pairs/page-3ed1864f74dd2781.js | 1 + .../ec2/key-pairs/page-4322838d69019af6.js | 1 - .../ec2/launch/page-865008fd4edbc3c6.js | 1 + .../ec2/launch/page-95f9c5f373088c6b.js | 1 - .../(console)/ec2/page-2f1d21b8a0cb6638.js | 1 + .../(console)/ec2/page-7decea7cc775783d.js | 1 - .../ec2/snapshots/page-039520dc68b27461.js | 1 + .../ec2/snapshots/page-debacf2386934296.js | 1 - .../ec2/volumes/page-826b966deb3ee0d6.js | 1 - .../ec2/volumes/page-88d0676aa230fc6b.js | 1 + .../(console)/ecr/page-67dcc47f5098faf1.js | 1 + .../(console)/ecr/page-bf91a2dec480bb05.js | 1 - .../ecr/repository/page-1fe97aae9099fe50.js | 1 - .../ecr/repository/page-abb2dcbd9f97dc6b.js | 1 + .../ecs/create/page-3360447933bd5e32.js | 1 + .../ecs/create/page-e4bb0e486f3dc24d.js | 1 - .../(console)/ecs/page-4cfa0065d82a62d1.js | 1 + .../(console)/ecs/page-b5d619b6b8f4df3c.js | 1 - .../ecs/service/page-5f7159cebc3ece3e.js | 1 + .../ecs/service/page-c2079d3bea6d4b40.js | 1 - .../task-definition/page-b85d625d9b322d50.js | 1 + .../task-definition/page-cc368d0a83eff4f0.js | 1 - .../task-definitions/page-61c374e3656b4ede.js | 1 - .../task-definitions/page-ed8af94e93d9986b.js | 1 + .../register/page-1923bacd9e1f2760.js | 1 - .../register/page-2b7839f1d4038150.js | 1 + .../ecs/task/page-af743b57fad2a4b0.js | 1 + .../ecs/task/page-f5d6810012d3179b.js | 1 - .../ecs/tasks/page-b8e04d602765384c.js | 1 + .../ecs/tasks/page-ec6ffdf687581332.js | 1 - .../efs/file-system/page-6987b136ae457e57.js | 1 + .../efs/file-system/page-9a2555ca572d7db4.js | 1 - .../(console)/efs/page-3202be6d938287ff.js | 1 + .../(console)/efs/page-49aee9e986a09f4e.js | 1 - .../backups/page-05514774bc54d3aa.js | 1 + .../backups/page-82e990afaa5a7060.js | 1 - .../cluster/page-480a483922fa2eb8.js | 1 + .../cluster/page-b62828dc4a52e790.js | 1 - .../create/page-b297da2a2db9f91c.js | 1 + .../create/page-e245f84cbd1efd36.js | 1 - .../elasticache/page-56fda7da0b007044.js | 1 - .../elasticache/page-e404cdf0219f5ec8.js | 1 + ...ef36be11d1.js => page-fa2dc1566d76b2c7.js} | 2 +- .../load-balancer/page-2146278dfc17a5d3.js | 1 - .../load-balancer/page-413427b894fa63ab.js | 1 + .../(console)/elb/page-def3ec842dc498de.js | 1 - .../(console)/elb/page-f4bc3f35918e44b2.js | 1 + .../elb/target-group/page-0012e99a0673b468.js | 1 + .../elb/target-group/page-0de2b1384d1763b2.js | 1 - .../target-groups/page-7c5339681bb3f975.js | 1 - .../target-groups/page-af830e09304b5d5d.js | 1 + .../events/buses/page-541cf50813e284e6.js | 1 - .../events/buses/page-553da040bc5386fd.js | 1 + .../events/create/page-8b5542dbd7b61d87.js | 1 - .../events/create/page-cae7dc66e7b98550.js | 1 + .../(console)/events/page-695f3781a2193400.js | 1 - .../(console)/events/page-d190b9309d80f2dd.js | 1 + .../events/rule/page-16a1e14a99155a2f.js | 1 + .../events/rule/page-fbfa46d687280d19.js | 1 - .../events/scheduler/page-6d7a88618cb86760.js | 1 + .../events/scheduler/page-906808278323c070.js | 1 - .../events/send/page-2cd34dbe836480e3.js | 1 - .../events/send/page-56f24370e8a59ffb.js | 1 + .../iam/group/page-141587a04c787f71.js | 1 + .../iam/group/page-a612e7fdfe9d87bd.js | 1 - .../iam/groups/page-1dfeb8e7f920170d.js | 1 + .../iam/groups/page-56d09c2bfdaa833f.js | 1 - .../instance-profile/page-6c7b7535049389f7.js | 1 + .../instance-profile/page-e2931816e5191040.js | 1 - .../page-061b9ba709841cbc.js | 1 + .../page-091d3566df187938.js | 1 - .../(console)/iam/page-90cf54612f35e963.js | 1 - .../(console)/iam/page-e72be3d46a834709.js | 1 + .../policies/create/page-444a8bd4109d4eac.js | 1 + .../policies/create/page-b5fdecbc1e4aa55c.js | 1 - .../iam/policies/page-3a6147959722fce3.js | 1 - .../iam/policies/page-de9407ea56e5b853.js | 1 + .../iam/policy/page-18785a13f0400bc4.js | 1 - .../iam/policy/page-acf40b22fc7ff7c1.js | 1 + .../iam/role/page-8122f451484c94cf.js | 1 + .../iam/role/page-c3b3afd299b23fca.js | 1 - .../iam/roles/create/page-975a8f3ed8a1ed62.js | 1 - .../iam/roles/create/page-c418ab362719acbd.js | 1 + .../iam/roles/page-0487960af1e93165.js | 1 - .../iam/roles/page-ab96a74b8fecc948.js | 1 + .../iam/simulator/page-a0c5a533ad02dc69.js | 1 + .../iam/simulator/page-e3a6392373252f3a.js | 1 - .../iam/user/page-195b38158a7833f7.js | 1 + .../iam/user/page-76a66f8c704d8f7e.js | 1 - .../iam/users/page-568ec43c6fc4be00.js | 1 + .../iam/users/page-c4f4039970353c5e.js | 1 - .../kms/crypto/page-2d16005049011bad.js | 1 - .../kms/crypto/page-bdb61b46df0c2b50.js | 1 + .../kms/key/page-83f80b8a51f3cf11.js | 1 + .../kms/key/page-fdbfe4f0709449ee.js | 1 - .../(console)/kms/page-9f60b4c1303ab1e4.js | 1 + .../(console)/kms/page-c962c8b39b9e8d23.js | 1 - .../lambda/create/page-9138fe8dbc4f670f.js | 1 - .../lambda/create/page-da9594769ce287ce.js | 1 + .../lambda/function/page-98aad04a0cb685a7.js | 1 + .../lambda/function/page-ef88bbc7c2a9c322.js | 1 - .../lambda/layers/page-581fa5930d6c8b32.js | 1 + .../lambda/layers/page-6b4b1ce85314cdd8.js | 1 - .../(console)/lambda/page-33b6e3f76ad03b2c.js | 1 + .../(console)/lambda/page-9509cf12b433b020.js | 1 - .../lambda/triggers/page-411cbdb8aee6b037.js | 1 - .../lambda/triggers/page-f30c709ebecdc473.js | 1 + .../app/(console)/layout-85ed75832cb8eb38.js | 1 - .../app/(console)/layout-bf64ca2ac6bdf0a0.js | 1 + .../app/(console)/page-106b14dc44527189.js | 1 + .../app/(console)/page-ae6f21e48eae204a.js | 1 - .../rds/create/page-20b846bfb3aae3b8.js | 1 - .../rds/create/page-c2784d14ee56c5a6.js | 1 + .../rds/instance/page-0f9156b03fcec92b.js | 1 + .../rds/instance/page-acf64b28cf419ab9.js | 1 - .../(console)/rds/page-ad4607f6dd1615d3.js | 1 + .../(console)/rds/page-d2b0d3601d5505e5.js | 1 - .../rds/snapshots/page-05514774bc54d3aa.js | 1 + .../rds/snapshots/page-82e990afaa5a7060.js | 1 - .../route53/page-19e2c4b0d564c5bf.js | 1 + .../route53/page-c2a80626d4cec4f4.js | 1 - .../route53/zone/page-8fddfa2809e96394.js | 1 - .../route53/zone/page-eddcfa80e2a827d3.js | 1 + .../s3/bucket/page-53e00c2a54e9a574.js | 1 - .../s3/bucket/page-6ae624d4cc1f475f.js | 1 + .../app/(console)/s3/page-0feed00d49e27252.js | 1 - .../app/(console)/s3/page-836e20daee1a21a0.js | 1 + .../secrets/create/page-43868686d82bad7b.js | 1 + .../secrets/create/page-7711446b056182c4.js | 1 - .../secrets/page-7edfa4177bdeb2a5.js | 1 - .../secrets/page-d02cea1cd2a89536.js | 1 + .../secrets/secret/page-1e7fbb3497136a89.js | 1 - .../secrets/secret/page-630d8abb846110f4.js | 1 + .../sfn/create/page-72b0633bdb1fd31d.js | 1 + .../sfn/create/page-7a23ce0a622467be.js | 1 - .../sfn/execution/page-de6aae2909bb6087.js | 1 - .../sfn/execution/page-deeec01d17cd5199.js | 1 + .../(console)/sfn/page-75d5f7697a0cb377.js | 1 + .../(console)/sfn/page-f7042adf92a05aac.js | 1 - .../state-machine/page-5f8ff3b710667bcd.js | 1 - .../state-machine/page-bebda58e0a323234.js | 1 + .../(console)/sns/page-b0fbd74a48f4c5e4.js | 1 + .../(console)/sns/page-c31e19ca44532ea7.js | 1 - .../subscriptions/page-182a521b0858a71e.js | 1 + .../subscriptions/page-43a6314e41df7ebf.js | 1 - .../sns/topic/page-c3bdd42fdfa9ccf3.js | 1 - .../sns/topic/page-dbc915d4188a41c7.js | 1 + .../sqs/create/page-81846f8f69c9d275.js | 1 + .../sqs/create/page-e030814ea732b76f.js | 1 - .../(console)/sqs/page-a1f0419a9220e0ac.js | 1 + .../(console)/sqs/page-f3a3a8a372cc9661.js | 1 - .../sqs/queue/page-1888b28eabbed991.js | 1 - .../sqs/queue/page-dccca85db08595cc.js | 1 + .../ssm/create/page-4c78f566049d9266.js | 1 - .../ssm/create/page-c947c42fba9eb297.js | 1 + .../(console)/ssm/page-1327e36392a431a3.js | 1 - .../(console)/ssm/page-e38894dbe346e1c5.js | 1 + .../ssm/parameter/page-00efb33c31067698.js | 1 + .../ssm/parameter/page-d40bd1284156717b.js | 1 - .../page-02934b5fcdfea050.js | 1 - .../page-b02bd93efa7a1bed.js | 1 + .../(console)/vpc/page-0c5828baeda14237.js | 1 - .../(console)/vpc/page-e7153cf6bf3051ca.js | 1 + .../vpc/route-tables/page-09596d10748e1a1c.js | 1 - .../vpc/route-tables/page-373d98f457f57aec.js | 1 + .../security-group/page-5e913dc7fb7b6a65.js | 1 - .../security-group/page-747b223b039c7a42.js | 1 + .../security-groups/page-308985e555c65c7b.js | 1 + .../security-groups/page-a6faff0bcec76df4.js | 1 - .../vpc/subnets/page-9cd2c2329f5687b0.js | 1 - .../vpc/subnets/page-ff9ec9f0119e519c.js | 1 + .../app/_not-found/page-2070973868b3af12.js | 1 + .../app/_not-found/page-542e15a4fe423705.js | 1 - .../chunks/app/layout-f589a28c31e80c79.js | 1 + .../chunks/app/layout-f83df127d0360db0.js | 1 - .../chunks/app/login/page-827cf8f6c53d111f.js | 1 - .../chunks/app/login/page-bf95b73c71d0ce5c.js | 1 + .../chunks/framework-4374eae96780d8a1.js | 1 - .../chunks/framework-4dd41bbf68badc4e.js | 1 + .../static/chunks/main-1d1d8f3ac4de8ecb.js | 1 + .../chunks/main-app-0030d1290935a9af.js | 1 + .../chunks/main-app-14c7ed497a2445dc.js | 1 - .../static/chunks/main-c201be324f769095.js | 1 - .../chunks/pages/_app-4b3fb5e477a0267f.js | 1 - .../chunks/pages/_app-7816e155798d3ad4.js | 1 + .../chunks/pages/_error-46bca0e17ea5c773.js | 1 + .../chunks/pages/_error-c970d8b55ace1b48.js | 1 - ...4d462a9.js => webpack-aa25a3360e80c153.js} | 2 +- .../_next/static/css/2ba92d0a3e4d7b00.css | 1 + .../_next/static/css/5cc952e448590a72.css | 1 - .../_buildManifest.js | 2 +- .../_ssgManifest.js | 0 pages/demo/acm/certificate/index.html | 2 +- pages/demo/acm/certificate/index.txt | 26 +- pages/demo/acm/index.html | 2 +- pages/demo/acm/index.txt | 26 +- pages/demo/apigateway/api/index.html | 2 +- pages/demo/apigateway/api/index.txt | 26 +- pages/demo/apigateway/index.html | 2 +- pages/demo/apigateway/index.txt | 26 +- pages/demo/cloudformation/create/index.html | 2 +- pages/demo/cloudformation/create/index.txt | 26 +- pages/demo/cloudformation/index.html | 2 +- pages/demo/cloudformation/index.txt | 26 +- .../cloudformation/resource-types/index.html | 2 +- .../cloudformation/resource-types/index.txt | 26 +- pages/demo/cloudformation/stack/index.html | 2 +- pages/demo/cloudformation/stack/index.txt | 26 +- pages/demo/cloudtrail/index.html | 2 +- pages/demo/cloudtrail/index.txt | 26 +- pages/demo/cloudwatch/alarms/index.html | 2 +- pages/demo/cloudwatch/alarms/index.txt | 26 +- pages/demo/cloudwatch/index.html | 2 +- pages/demo/cloudwatch/index.txt | 26 +- pages/demo/cloudwatch/insights/index.html | 2 +- pages/demo/cloudwatch/insights/index.txt | 26 +- pages/demo/cloudwatch/logs/group/index.html | 2 +- pages/demo/cloudwatch/logs/group/index.txt | 26 +- pages/demo/cloudwatch/logs/index.html | 2 +- pages/demo/cloudwatch/logs/index.txt | 26 +- pages/demo/cloudwatch/metrics/index.html | 2 +- pages/demo/cloudwatch/metrics/index.txt | 26 +- pages/demo/cognito/index.html | 2 +- pages/demo/cognito/index.txt | 26 +- pages/demo/cognito/pool/index.html | 2 +- pages/demo/cognito/pool/index.txt | 26 +- pages/demo/dynamodb/create/index.html | 2 +- pages/demo/dynamodb/create/index.txt | 26 +- pages/demo/dynamodb/index.html | 2 +- pages/demo/dynamodb/index.txt | 26 +- pages/demo/dynamodb/table/index.html | 2 +- pages/demo/dynamodb/table/index.txt | 26 +- pages/demo/ec2/autoscaling/create/index.html | 2 +- pages/demo/ec2/autoscaling/create/index.txt | 26 +- pages/demo/ec2/autoscaling/group/index.html | 2 +- pages/demo/ec2/autoscaling/group/index.txt | 26 +- pages/demo/ec2/autoscaling/index.html | 2 +- pages/demo/ec2/autoscaling/index.txt | 26 +- pages/demo/ec2/elastic-ips/index.html | 2 +- pages/demo/ec2/elastic-ips/index.txt | 26 +- pages/demo/ec2/images/index.html | 2 +- pages/demo/ec2/images/index.txt | 26 +- pages/demo/ec2/index.html | 2 +- pages/demo/ec2/index.txt | 26 +- pages/demo/ec2/instance-types/index.html | 2 +- pages/demo/ec2/instance-types/index.txt | 26 +- pages/demo/ec2/instance/index.html | 2 +- pages/demo/ec2/instance/index.txt | 26 +- pages/demo/ec2/key-pairs/index.html | 2 +- pages/demo/ec2/key-pairs/index.txt | 26 +- pages/demo/ec2/launch/index.html | 2 +- pages/demo/ec2/launch/index.txt | 26 +- pages/demo/ec2/snapshots/index.html | 2 +- pages/demo/ec2/snapshots/index.txt | 26 +- pages/demo/ec2/volumes/index.html | 2 +- pages/demo/ec2/volumes/index.txt | 26 +- pages/demo/ecr/index.html | 2 +- pages/demo/ecr/index.txt | 26 +- pages/demo/ecr/repository/index.html | 2 +- pages/demo/ecr/repository/index.txt | 26 +- pages/demo/ecs/create/index.html | 2 +- pages/demo/ecs/create/index.txt | 26 +- pages/demo/ecs/index.html | 2 +- pages/demo/ecs/index.txt | 26 +- pages/demo/ecs/service/index.html | 2 +- pages/demo/ecs/service/index.txt | 26 +- pages/demo/ecs/task-definition/index.html | 2 +- pages/demo/ecs/task-definition/index.txt | 26 +- pages/demo/ecs/task-definitions/index.html | 2 +- pages/demo/ecs/task-definitions/index.txt | 26 +- .../ecs/task-definitions/register/index.html | 2 +- .../ecs/task-definitions/register/index.txt | 26 +- pages/demo/ecs/task/index.html | 2 +- pages/demo/ecs/task/index.txt | 26 +- pages/demo/ecs/tasks/index.html | 2 +- pages/demo/ecs/tasks/index.txt | 26 +- pages/demo/efs/file-system/index.html | 2 +- pages/demo/efs/file-system/index.txt | 26 +- pages/demo/efs/index.html | 2 +- pages/demo/efs/index.txt | 26 +- pages/demo/elasticache/backups/index.html | 2 +- pages/demo/elasticache/backups/index.txt | 26 +- pages/demo/elasticache/cluster/index.html | 2 +- pages/demo/elasticache/cluster/index.txt | 26 +- pages/demo/elasticache/create/index.html | 2 +- pages/demo/elasticache/create/index.txt | 26 +- pages/demo/elasticache/index.html | 2 +- pages/demo/elasticache/index.txt | 26 +- pages/demo/elb/create/index.html | 2 +- pages/demo/elb/create/index.txt | 26 +- pages/demo/elb/index.html | 2 +- pages/demo/elb/index.txt | 26 +- pages/demo/elb/load-balancer/index.html | 2 +- pages/demo/elb/load-balancer/index.txt | 26 +- pages/demo/elb/target-group/index.html | 2 +- pages/demo/elb/target-group/index.txt | 26 +- pages/demo/elb/target-groups/index.html | 2 +- pages/demo/elb/target-groups/index.txt | 26 +- pages/demo/events/buses/index.html | 2 +- pages/demo/events/buses/index.txt | 26 +- pages/demo/events/create/index.html | 2 +- pages/demo/events/create/index.txt | 26 +- pages/demo/events/index.html | 2 +- pages/demo/events/index.txt | 26 +- pages/demo/events/rule/index.html | 2 +- pages/demo/events/rule/index.txt | 26 +- pages/demo/events/scheduler/index.html | 2 +- pages/demo/events/scheduler/index.txt | 26 +- pages/demo/events/send/index.html | 2 +- pages/demo/events/send/index.txt | 26 +- pages/demo/iam/group/index.html | 2 +- pages/demo/iam/group/index.txt | 26 +- pages/demo/iam/groups/index.html | 2 +- pages/demo/iam/groups/index.txt | 26 +- pages/demo/iam/index.html | 2 +- pages/demo/iam/index.txt | 26 +- pages/demo/iam/instance-profile/index.html | 2 +- pages/demo/iam/instance-profile/index.txt | 26 +- pages/demo/iam/instance-profiles/index.html | 2 +- pages/demo/iam/instance-profiles/index.txt | 26 +- pages/demo/iam/policies/create/index.html | 2 +- pages/demo/iam/policies/create/index.txt | 26 +- pages/demo/iam/policies/index.html | 2 +- pages/demo/iam/policies/index.txt | 26 +- pages/demo/iam/policy/index.html | 2 +- pages/demo/iam/policy/index.txt | 26 +- pages/demo/iam/role/index.html | 2 +- pages/demo/iam/role/index.txt | 26 +- pages/demo/iam/roles/create/index.html | 2 +- pages/demo/iam/roles/create/index.txt | 26 +- pages/demo/iam/roles/index.html | 2 +- pages/demo/iam/roles/index.txt | 26 +- pages/demo/iam/simulator/index.html | 2 +- pages/demo/iam/simulator/index.txt | 26 +- pages/demo/iam/user/index.html | 2 +- pages/demo/iam/user/index.txt | 26 +- pages/demo/iam/users/index.html | 2 +- pages/demo/iam/users/index.txt | 26 +- pages/demo/index.html | 2 +- pages/demo/index.txt | 26 +- pages/demo/kms/crypto/index.html | 2 +- pages/demo/kms/crypto/index.txt | 26 +- pages/demo/kms/index.html | 2 +- pages/demo/kms/index.txt | 26 +- pages/demo/kms/key/index.html | 2 +- pages/demo/kms/key/index.txt | 26 +- pages/demo/lambda/create/index.html | 2 +- pages/demo/lambda/create/index.txt | 26 +- pages/demo/lambda/function/index.html | 2 +- pages/demo/lambda/function/index.txt | 26 +- pages/demo/lambda/index.html | 2 +- pages/demo/lambda/index.txt | 26 +- pages/demo/lambda/layers/index.html | 2 +- pages/demo/lambda/layers/index.txt | 26 +- pages/demo/lambda/triggers/index.html | 2 +- pages/demo/lambda/triggers/index.txt | 26 +- pages/demo/login/index.html | 2 +- pages/demo/login/index.txt | 26 +- pages/demo/rds/create/index.html | 2 +- pages/demo/rds/create/index.txt | 26 +- pages/demo/rds/index.html | 2 +- pages/demo/rds/index.txt | 26 +- pages/demo/rds/instance/index.html | 2 +- pages/demo/rds/instance/index.txt | 26 +- pages/demo/rds/snapshots/index.html | 2 +- pages/demo/rds/snapshots/index.txt | 26 +- pages/demo/route53/index.html | 2 +- pages/demo/route53/index.txt | 26 +- pages/demo/route53/zone/index.html | 2 +- pages/demo/route53/zone/index.txt | 26 +- pages/demo/s3/bucket/index.html | 2 +- pages/demo/s3/bucket/index.txt | 26 +- pages/demo/s3/index.html | 2 +- pages/demo/s3/index.txt | 26 +- pages/demo/secrets/create/index.html | 2 +- pages/demo/secrets/create/index.txt | 26 +- pages/demo/secrets/index.html | 2 +- pages/demo/secrets/index.txt | 26 +- pages/demo/secrets/secret/index.html | 2 +- pages/demo/secrets/secret/index.txt | 26 +- pages/demo/sfn/create/index.html | 2 +- pages/demo/sfn/create/index.txt | 26 +- pages/demo/sfn/execution/index.html | 2 +- pages/demo/sfn/execution/index.txt | 26 +- pages/demo/sfn/index.html | 2 +- pages/demo/sfn/index.txt | 26 +- pages/demo/sfn/state-machine/index.html | 2 +- pages/demo/sfn/state-machine/index.txt | 26 +- pages/demo/sns/index.html | 2 +- pages/demo/sns/index.txt | 26 +- pages/demo/sns/subscriptions/index.html | 2 +- pages/demo/sns/subscriptions/index.txt | 26 +- pages/demo/sns/topic/index.html | 2 +- pages/demo/sns/topic/index.txt | 26 +- pages/demo/sqs/create/index.html | 2 +- pages/demo/sqs/create/index.txt | 26 +- pages/demo/sqs/index.html | 2 +- pages/demo/sqs/index.txt | 26 +- pages/demo/sqs/queue/index.html | 2 +- pages/demo/sqs/queue/index.txt | 26 +- pages/demo/ssm/create/index.html | 2 +- pages/demo/ssm/create/index.txt | 26 +- pages/demo/ssm/index.html | 2 +- pages/demo/ssm/index.txt | 26 +- pages/demo/ssm/parameter/index.html | 2 +- pages/demo/ssm/parameter/index.txt | 26 +- pages/demo/vpc/index.html | 2 +- pages/demo/vpc/index.txt | 26 +- pages/demo/vpc/internet-gateways/index.html | 2 +- pages/demo/vpc/internet-gateways/index.txt | 26 +- pages/demo/vpc/route-tables/index.html | 2 +- pages/demo/vpc/route-tables/index.txt | 26 +- pages/demo/vpc/security-group/index.html | 2 +- pages/demo/vpc/security-group/index.txt | 26 +- pages/demo/vpc/security-groups/index.html | 2 +- pages/demo/vpc/security-groups/index.txt | 26 +- pages/demo/vpc/subnets/index.html | 2 +- pages/demo/vpc/subnets/index.txt | 26 +- 740 files changed, 3014 insertions(+), 2208 deletions(-) create mode 100644 cli/internal/svc/ec2/capabilities.go delete mode 100644 pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js delete mode 100644 pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js create mode 100644 pages/demo/_next/static/chunks/1113-4fa3c21659063672.js delete mode 100644 pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js create mode 100644 pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js create mode 100644 pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js delete mode 100644 pages/demo/_next/static/chunks/1255-b45d400a656668f9.js create mode 100644 pages/demo/_next/static/chunks/1259-5cdaeb31c5eef083.js delete mode 100644 pages/demo/_next/static/chunks/1333-2601f57e81887558.js create mode 100644 pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js delete mode 100644 pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js create mode 100644 pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js create mode 100644 pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js create mode 100644 pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js create mode 100644 pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js create mode 100644 pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js create mode 100644 pages/demo/_next/static/chunks/150-46fef33977dc7f29.js delete mode 100644 pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js create mode 100644 pages/demo/_next/static/chunks/1536-367972fc74b101c4.js delete mode 100644 pages/demo/_next/static/chunks/1537-5418411d17191e6b.js delete mode 100644 pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js delete mode 100644 pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js delete mode 100644 pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js create mode 100644 pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js create mode 100644 pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js rename pages/demo/_next/static/chunks/{e868780c.c23ff2f7f8b56308.js => 17f2321f.e75e484eec52c258.js} (99%) delete mode 100644 pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js create mode 100644 pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js delete mode 100644 pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js create mode 100644 pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js create mode 100644 pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js delete mode 100644 pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js delete mode 100644 pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js delete mode 100644 pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js delete mode 100644 pages/demo/_next/static/chunks/2112-41340fe381241d76.js delete mode 100644 pages/demo/_next/static/chunks/2151-f6771539118eac7c.js delete mode 100644 pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js delete mode 100644 pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js rename pages/demo/_next/static/chunks/{5581.aa9cac14282894f8.js => 2166.4feae7d72ea214c1.js} (95%) delete mode 100644 pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js create mode 100644 pages/demo/_next/static/chunks/2240-937631aef2e41767.js create mode 100644 pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js create mode 100644 pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js create mode 100644 pages/demo/_next/static/chunks/2498-f13d085283c1079e.js delete mode 100644 pages/demo/_next/static/chunks/2523-ceac31097bdc3247.js delete mode 100644 pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js create mode 100644 pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js create mode 100644 pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js create mode 100644 pages/demo/_next/static/chunks/2689-f9dac9488c272556.js delete mode 100644 pages/demo/_next/static/chunks/2718-f810e006b35713e1.js create mode 100644 pages/demo/_next/static/chunks/2798-e9971f13e2c8bb76.js create mode 100644 pages/demo/_next/static/chunks/2811-15c9c2f02394d4cc.js delete mode 100644 pages/demo/_next/static/chunks/2868-47f12b686ed1aebc.js create mode 100644 pages/demo/_next/static/chunks/2886-f35b181bb9b3e6f5.js create mode 100644 pages/demo/_next/static/chunks/2897-1ffbde21ffffc29a.js delete mode 100644 pages/demo/_next/static/chunks/2911-08266d2d9b9f028c.js delete mode 100644 pages/demo/_next/static/chunks/2999-a21f98017c0bf06b.js create mode 100644 pages/demo/_next/static/chunks/3041-087b8498f815199e.js delete mode 100644 pages/demo/_next/static/chunks/3046-6dfc61495af485a7.js delete mode 100644 pages/demo/_next/static/chunks/3116-5c1d4bdbae7e3fdf.js delete mode 100644 pages/demo/_next/static/chunks/3134-6f6154684ee8fa7c.js delete mode 100644 pages/demo/_next/static/chunks/3169-c2032f7edc6d8fe2.js create mode 100644 pages/demo/_next/static/chunks/3198-085a52b0ea5869cc.js delete mode 100644 pages/demo/_next/static/chunks/3238-8e56b6f34ccc89f3.js delete mode 100644 pages/demo/_next/static/chunks/3254-b7a579fa88ceb3e7.js create mode 100644 pages/demo/_next/static/chunks/3323-152d836556796a7c.js create mode 100644 pages/demo/_next/static/chunks/3403-cbe788ef3ee0085f.js delete mode 100644 pages/demo/_next/static/chunks/344-222bd6e3df1f0184.js delete mode 100644 pages/demo/_next/static/chunks/3486-bbe949347b1e81f8.js create mode 100644 pages/demo/_next/static/chunks/3536-bf5cb635d8c9dd51.js create mode 100644 pages/demo/_next/static/chunks/3577-e0b740bef33bfd9e.js create mode 100644 pages/demo/_next/static/chunks/359-5e183b68b52b5075.js create mode 100644 pages/demo/_next/static/chunks/3606-1fc1602e529c0f62.js delete mode 100644 pages/demo/_next/static/chunks/3660-7b5be0acdf82a0df.js delete mode 100644 pages/demo/_next/static/chunks/3714-d71b6a2478b62899.js delete mode 100644 pages/demo/_next/static/chunks/3749-5585da21ee5b7e52.js delete mode 100644 pages/demo/_next/static/chunks/3768-7b3016d18ae8bc0c.js delete mode 100644 pages/demo/_next/static/chunks/3795-f2f775bd517af2cc.js create mode 100644 pages/demo/_next/static/chunks/382-30ee812967762ed6.js delete mode 100644 pages/demo/_next/static/chunks/3833-d39d92163ca5f46a.js create mode 100644 pages/demo/_next/static/chunks/3907-d94ac6ae2c452e54.js delete mode 100644 pages/demo/_next/static/chunks/3914-6dc13dfc6a1992bb.js create mode 100644 pages/demo/_next/static/chunks/3958-b34b0996cc4ec066.js rename pages/demo/_next/static/chunks/{4bd1b696-100b9d70ed4e49c1.js => 3d9f79e1-cbe493dcf58ac9be.js} (99%) create mode 100644 pages/demo/_next/static/chunks/4016-16a8dbabf865ca27.js create mode 100644 pages/demo/_next/static/chunks/4054-1241b7acd338992e.js create mode 100644 pages/demo/_next/static/chunks/4124-c5369c1c22ae29ac.js delete mode 100644 pages/demo/_next/static/chunks/4132-96fd061957e633fa.js delete mode 100644 pages/demo/_next/static/chunks/4160-30e1366f7e402d2b.js create mode 100644 pages/demo/_next/static/chunks/417-b72c42dd24608c97.js delete mode 100644 pages/demo/_next/static/chunks/4174-ffd51ec6ea00d565.js delete mode 100644 pages/demo/_next/static/chunks/421-73888418a719f407.js delete mode 100644 pages/demo/_next/static/chunks/4217-fc623125971a877e.js create mode 100644 pages/demo/_next/static/chunks/4230-678885b832678d56.js delete mode 100644 pages/demo/_next/static/chunks/4274.55d9e52083373d09.js delete mode 100644 pages/demo/_next/static/chunks/4352-22920917fbf293bd.js create mode 100644 pages/demo/_next/static/chunks/4444-8e3c11e75995cded.js create mode 100644 pages/demo/_next/static/chunks/4486-7b9fd81891891577.js delete mode 100644 pages/demo/_next/static/chunks/45-a805c9704bab3eb5.js delete mode 100644 pages/demo/_next/static/chunks/4512-6ff5abd62d45cae2.js create mode 100644 pages/demo/_next/static/chunks/4557-845555fb7f127aea.js delete mode 100644 pages/demo/_next/static/chunks/4559-80a1f3a95a02e757.js create mode 100644 pages/demo/_next/static/chunks/4562-ac7b83e04a658374.js delete mode 100644 pages/demo/_next/static/chunks/4577-e817478d893a9650.js create mode 100644 pages/demo/_next/static/chunks/4621-6b0c3052c5bad864.js delete mode 100644 pages/demo/_next/static/chunks/4660-82ba4a8d785affa4.js create mode 100644 pages/demo/_next/static/chunks/4694-935aa6087f87cc7f.js delete mode 100644 pages/demo/_next/static/chunks/4699-18447b37b76491bd.js delete mode 100644 pages/demo/_next/static/chunks/4710-c965380d5be3c7ff.js delete mode 100644 pages/demo/_next/static/chunks/4741-e5891000eeda9c04.js create mode 100644 pages/demo/_next/static/chunks/4790-b7af8968520c317b.js create mode 100644 pages/demo/_next/static/chunks/4795-92b20640a209a000.js delete mode 100644 pages/demo/_next/static/chunks/4806-e5dc4990b7318f77.js delete mode 100644 pages/demo/_next/static/chunks/4870-fcaf818fc1583373.js create mode 100644 pages/demo/_next/static/chunks/4895-11ea10bf5641bc43.js create mode 100644 pages/demo/_next/static/chunks/4990-01b3c07d971c96a0.js create mode 100644 pages/demo/_next/static/chunks/5009-74d771429c160cdc.js create mode 100644 pages/demo/_next/static/chunks/5037-da3eae3b2cbb57f2.js create mode 100644 pages/demo/_next/static/chunks/5041-b899099f3201c222.js create mode 100644 pages/demo/_next/static/chunks/5159-bbe8e0c4fb2abec4.js create mode 100644 pages/demo/_next/static/chunks/5174-a89e823c17536150.js delete mode 100644 pages/demo/_next/static/chunks/5263-e8da8a154a4fb8d1.js delete mode 100644 pages/demo/_next/static/chunks/5270-85a2536ae473419e.js create mode 100644 pages/demo/_next/static/chunks/5340-13780c6d3c4d3d1d.js delete mode 100644 pages/demo/_next/static/chunks/5433-c3dbfa77a8137eb2.js delete mode 100644 pages/demo/_next/static/chunks/5443-19770755b053d366.js create mode 100644 pages/demo/_next/static/chunks/5444-5e4f47b7fbe623ee.js create mode 100644 pages/demo/_next/static/chunks/5465-7a40d1bccd018862.js delete mode 100644 pages/demo/_next/static/chunks/5525-789dc5ce7bbcbaba.js create mode 100644 pages/demo/_next/static/chunks/5607-2cfbaba2f726d0d8.js create mode 100644 pages/demo/_next/static/chunks/5659-cb7535dfbdcd7d44.js delete mode 100644 pages/demo/_next/static/chunks/5673-299eafc44ce32675.js create mode 100644 pages/demo/_next/static/chunks/5721-47076df829e033b3.js delete mode 100644 pages/demo/_next/static/chunks/5752-92ea4d69f5149382.js create mode 100644 pages/demo/_next/static/chunks/5766-221b3e546111aaa5.js create mode 100644 pages/demo/_next/static/chunks/5795-a80047ec0fe98719.js create mode 100644 pages/demo/_next/static/chunks/5815-dacfb3ceecbd9f3a.js delete mode 100644 pages/demo/_next/static/chunks/5818-61d91c792e8dcd67.js delete mode 100644 pages/demo/_next/static/chunks/5825-86244729db25916b.js create mode 100644 pages/demo/_next/static/chunks/5826-1fc54d56a257b7a4.js create mode 100644 pages/demo/_next/static/chunks/586-e3359930f5d2b83a.js create mode 100644 pages/demo/_next/static/chunks/5895-671759db9f9d4f52.js create mode 100644 pages/demo/_next/static/chunks/5955-d4c7800fad916273.js delete mode 100644 pages/demo/_next/static/chunks/5968-b09b05a4ae2a585f.js create mode 100644 pages/demo/_next/static/chunks/5982-d6008b14e91b8063.js delete mode 100644 pages/demo/_next/static/chunks/6078-77979580a726c3b8.js create mode 100644 pages/demo/_next/static/chunks/608-79af78ce03ec32af.js create mode 100644 pages/demo/_next/static/chunks/6080-52f0601357906793.js delete mode 100644 pages/demo/_next/static/chunks/6101-11ba261def4b1210.js create mode 100644 pages/demo/_next/static/chunks/6117-965a786c96e8a482.js rename pages/demo/_next/static/chunks/{2209-957d81d9ccacb3f3.js => 6128-43972cc21ae7dce9.js} (89%) delete mode 100644 pages/demo/_next/static/chunks/6130-398e23edbb230836.js delete mode 100644 pages/demo/_next/static/chunks/616-b8e8274039b89f49.js delete mode 100644 pages/demo/_next/static/chunks/6170-2398b633b2afe03e.js delete mode 100644 pages/demo/_next/static/chunks/6292-44aa084734a14b7c.js create mode 100644 pages/demo/_next/static/chunks/64-35f6609dd9a2c2f4.js create mode 100644 pages/demo/_next/static/chunks/6402-b0eea2ecbe30bf3e.js create mode 100644 pages/demo/_next/static/chunks/6420-e3ff25ff96f63dd5.js delete mode 100644 pages/demo/_next/static/chunks/643-323d17af60ee743d.js create mode 100644 pages/demo/_next/static/chunks/6457-d4787263f10664a5.js create mode 100644 pages/demo/_next/static/chunks/6507-9f24d4eeb4b24e7a.js delete mode 100644 pages/demo/_next/static/chunks/6608-5a3f55dd5ceacedd.js create mode 100644 pages/demo/_next/static/chunks/6627-13c4d14be53a00db.js create mode 100644 pages/demo/_next/static/chunks/6645-b5b04d1a4610f67f.js delete mode 100644 pages/demo/_next/static/chunks/6705-9656d5a014fd593e.js create mode 100644 pages/demo/_next/static/chunks/6714-3ccccd3b3e6a951b.js create mode 100644 pages/demo/_next/static/chunks/6801-c1c965257356cda1.js create mode 100644 pages/demo/_next/static/chunks/6864-971b5637d882b519.js delete mode 100644 pages/demo/_next/static/chunks/6896-711ba682d45613da.js delete mode 100644 pages/demo/_next/static/chunks/6955-37023ab31ea418f7.js delete mode 100644 pages/demo/_next/static/chunks/7012-355f4e7983a8a5e5.js create mode 100644 pages/demo/_next/static/chunks/7036-3035e5135864b961.js create mode 100644 pages/demo/_next/static/chunks/7194-5ba3b4606ee4b919.js delete mode 100644 pages/demo/_next/static/chunks/7206-ae8f8a4965e96198.js delete mode 100644 pages/demo/_next/static/chunks/7274-6afc4f8fc4a54d70.js create mode 100644 pages/demo/_next/static/chunks/7275-5cf7d7bb81a38ccd.js create mode 100644 pages/demo/_next/static/chunks/7300-271d146a7b4e9199.js delete mode 100644 pages/demo/_next/static/chunks/7310-1fd266e20f77e455.js delete mode 100644 pages/demo/_next/static/chunks/7341-dcc240c291a380ad.js delete mode 100644 pages/demo/_next/static/chunks/7351-bd1010d550cd9dc1.js delete mode 100644 pages/demo/_next/static/chunks/7375-e2081966aa8b3d58.js delete mode 100644 pages/demo/_next/static/chunks/7422-a103a707ccd2a883.js delete mode 100644 pages/demo/_next/static/chunks/7432-5ac8af3cd22d5d52.js create mode 100644 pages/demo/_next/static/chunks/752-62c777c747915964.js create mode 100644 pages/demo/_next/static/chunks/7565-883b9e0a2e20a038.js create mode 100644 pages/demo/_next/static/chunks/7580-f4f352e3970e5754.js delete mode 100644 pages/demo/_next/static/chunks/76-de33956717e4ab01.js create mode 100644 pages/demo/_next/static/chunks/7605-5a8d1c27ac916077.js delete mode 100644 pages/demo/_next/static/chunks/7624-c2292a941bfa09cc.js create mode 100644 pages/demo/_next/static/chunks/7649-172a4f8e1eb7b8dc.js create mode 100644 pages/demo/_next/static/chunks/7655-881de2aca039b573.js delete mode 100644 pages/demo/_next/static/chunks/7691-45a19096ebb27bca.js delete mode 100644 pages/demo/_next/static/chunks/7695-ea40a6690b86fc66.js create mode 100644 pages/demo/_next/static/chunks/7722-3a9c9959728127c0.js delete mode 100644 pages/demo/_next/static/chunks/7739-65b3643e795e5b60.js delete mode 100644 pages/demo/_next/static/chunks/7751-a9a0f8dbbde4f405.js delete mode 100644 pages/demo/_next/static/chunks/7768-97edde54ed9b4b00.js create mode 100644 pages/demo/_next/static/chunks/7795-d5d0aada730ecf67.js delete mode 100644 pages/demo/_next/static/chunks/7830-e406ff109815212d.js delete mode 100644 pages/demo/_next/static/chunks/7900-86f8feeb4953099f.js create mode 100644 pages/demo/_next/static/chunks/7985-fcc90c92c56a0fcb.js create mode 100644 pages/demo/_next/static/chunks/8006-d7e9cac4e76f79a7.js delete mode 100644 pages/demo/_next/static/chunks/8038-75b8decf81e00ac8.js create mode 100644 pages/demo/_next/static/chunks/8064-20db72538994032b.js delete mode 100644 pages/demo/_next/static/chunks/8082-63564dddc92661c5.js delete mode 100644 pages/demo/_next/static/chunks/809-aef610cd128e776c.js create mode 100644 pages/demo/_next/static/chunks/8150-8a00f64f1bb25381.js delete mode 100644 pages/demo/_next/static/chunks/8297-024594c25c98b482.js delete mode 100644 pages/demo/_next/static/chunks/8401-d40ac5179200e489.js delete mode 100644 pages/demo/_next/static/chunks/8403-bfd6be192888c5a7.js create mode 100644 pages/demo/_next/static/chunks/8446-740c027da02cfba6.js delete mode 100644 pages/demo/_next/static/chunks/8467-4f908b36d8c2f9a7.js create mode 100644 pages/demo/_next/static/chunks/8492-c1aa4e240d35ec95.js delete mode 100644 pages/demo/_next/static/chunks/8501-ee250a2ae24211f4.js create mode 100644 pages/demo/_next/static/chunks/8550.6fcc6d1ebfe691f2.js delete mode 100644 pages/demo/_next/static/chunks/8583-0e0569fbe139d99d.js create mode 100644 pages/demo/_next/static/chunks/8614-a0d03e9166917f09.js create mode 100644 pages/demo/_next/static/chunks/8657-87dc740191e4259b.js delete mode 100644 pages/demo/_next/static/chunks/866-87d9aa71d8b4f3c4.js delete mode 100644 pages/demo/_next/static/chunks/8737-6f825f5e7f34114e.js delete mode 100644 pages/demo/_next/static/chunks/8746-a3d2def3b3f084f5.js delete mode 100644 pages/demo/_next/static/chunks/8747-6b7380577a196c73.js create mode 100644 pages/demo/_next/static/chunks/8795-a0ce2e663100b50d.js delete mode 100644 pages/demo/_next/static/chunks/8801-48584feac543b3b6.js create mode 100644 pages/demo/_next/static/chunks/8861-f0243c276de8ee7a.js create mode 100644 pages/demo/_next/static/chunks/893-9dc8d679a2852c8a.js create mode 100644 pages/demo/_next/static/chunks/8948-8d81396a7a569cc9.js delete mode 100644 pages/demo/_next/static/chunks/8970-da3d69a214b3bb28.js create mode 100644 pages/demo/_next/static/chunks/8999-a6e71b6a13b23b17.js create mode 100644 pages/demo/_next/static/chunks/9037-4127e44310c29010.js delete mode 100644 pages/demo/_next/static/chunks/9043-3362f56844891bcb.js create mode 100644 pages/demo/_next/static/chunks/9093-835cc964e292a352.js create mode 100644 pages/demo/_next/static/chunks/916-0588e02195f65045.js create mode 100644 pages/demo/_next/static/chunks/9170-76001466ce2c7891.js create mode 100644 pages/demo/_next/static/chunks/918-48809276f0b25079.js create mode 100644 pages/demo/_next/static/chunks/9181-91c314c88e784294.js create mode 100644 pages/demo/_next/static/chunks/9182-39361ac4f943740d.js delete mode 100644 pages/demo/_next/static/chunks/9209-479e74ee8674b356.js delete mode 100644 pages/demo/_next/static/chunks/9219-051804c0515dbcd4.js delete mode 100644 pages/demo/_next/static/chunks/9247-02c26bbb9e8447af.js delete mode 100644 pages/demo/_next/static/chunks/9276-714512c9da4d324f.js create mode 100644 pages/demo/_next/static/chunks/9282-98a3543fd5b1bec1.js delete mode 100644 pages/demo/_next/static/chunks/9339-bd9676d77485ab0f.js rename pages/demo/_next/static/chunks/{1401-266e7cbcc38940d6.js => 9431-56d873e3e8ea5ff1.js} (66%) delete mode 100644 pages/demo/_next/static/chunks/9554-93bc5f1c97fb09cc.js create mode 100644 pages/demo/_next/static/chunks/9576-1e7d9f852ba5f8e0.js create mode 100644 pages/demo/_next/static/chunks/9603-1b6c0d6dc4c73cc0.js delete mode 100644 pages/demo/_next/static/chunks/9686-6e136e4c61966113.js delete mode 100644 pages/demo/_next/static/chunks/976-557313cc0ad0dc25.js delete mode 100644 pages/demo/_next/static/chunks/9789-66f6a02d0406fc8d.js delete mode 100644 pages/demo/_next/static/chunks/9791-5d4c13ab21fc0d45.js delete mode 100644 pages/demo/_next/static/chunks/9798-fd1112fe845c7a9c.js create mode 100644 pages/demo/_next/static/chunks/9818-6abd4585639f687c.js create mode 100644 pages/demo/_next/static/chunks/9819-a14ea5d645bb67fe.js create mode 100644 pages/demo/_next/static/chunks/9865-66c048907a4ce9ab.js delete mode 100644 pages/demo/_next/static/chunks/9936-8313f2ca2afc63fc.js create mode 100644 pages/demo/_next/static/chunks/9986-944353085eef2fed.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/acm/certificate/page-cbec3df084b22553.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/acm/certificate/page-d9ea7bfb58f7ca81.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/acm/page-3754ab26e8e8a3fa.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/acm/page-a506e6597b660bcf.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/apigateway/api/page-8b6f0b4f4e84d13e.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/apigateway/api/page-9bbb39634a615084.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/apigateway/page-97fa9b93eaa9b8fe.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/apigateway/page-d800ac3fbe4352a7.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudformation/create/page-336bc2c82c83ad40.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudformation/create/page-b518762d012d6b3c.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudformation/page-21883cc144ab324b.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudformation/page-bfaf7ff49401330a.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudformation/resource-types/page-3966710fa0f59f83.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudformation/resource-types/page-ef98373a9341e317.js rename pages/demo/_next/static/chunks/app/(console)/cloudformation/stack/{page-e289fcdde3740fa6.js => page-571231527f3b5bce.js} (52%) create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudtrail/page-679763f285158463.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudtrail/page-83836d06b3f52729.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/alarms/page-1d9906c8a7e2f251.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/alarms/page-f6faa9d9d28dacdc.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/insights/page-6566a33141c0a2e3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/insights/page-8413ffbcaaad2ba2.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/logs/group/page-4de93eb9321182da.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/logs/group/page-9217550d87c1b2b2.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/logs/page-0a7bf7a69cadfa5d.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/logs/page-ff41c6899c0debfc.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/metrics/page-22055ad43356c7c8.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/metrics/page-2c3424c791c1d75c.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/page-34ee3cba2fe894d3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cloudwatch/page-9cee150c6e020bda.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cognito/page-840be91de2635382.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cognito/page-d948dd3364101d18.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/cognito/pool/page-43d2cc59cda6cbba.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/cognito/pool/page-85d740bdf51dc47d.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/dynamodb/create/page-e21aace8646e6cc4.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/dynamodb/create/page-e98ebdc3390d0025.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/dynamodb/page-a52f6cf14b2bf68f.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/dynamodb/page-fe63803cbae9c622.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/dynamodb/table/page-969dc2da4888c12c.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/dynamodb/table/page-cfaf699f3f4a0c46.js rename pages/demo/_next/static/chunks/app/(console)/ec2/autoscaling/create/{page-327646bcf4dd4684.js => page-2926c041348f7a3f.js} (73%) delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/autoscaling/group/page-90365d19246f9213.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/autoscaling/group/page-bfbcf827adddfdf0.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/autoscaling/page-2cd7d3220ed6b835.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/autoscaling/page-90bd271cc8f879f6.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/elastic-ips/page-80a086adc671cd26.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/elastic-ips/page-ac19975efb08eb6f.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/images/page-0f4eeb9c66b3de9e.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/images/page-c5a9f04c2ac23cf3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/instance-types/page-55ff2ec55511ea4d.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/instance-types/page-7d534a2ddc2ae483.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/instance/page-550e8243673dda66.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/instance/page-fa0de87916058801.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/key-pairs/page-3ed1864f74dd2781.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/key-pairs/page-4322838d69019af6.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/launch/page-865008fd4edbc3c6.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/launch/page-95f9c5f373088c6b.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/page-2f1d21b8a0cb6638.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/page-7decea7cc775783d.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/snapshots/page-039520dc68b27461.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/snapshots/page-debacf2386934296.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/volumes/page-826b966deb3ee0d6.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ec2/volumes/page-88d0676aa230fc6b.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecr/page-67dcc47f5098faf1.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecr/page-bf91a2dec480bb05.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecr/repository/page-1fe97aae9099fe50.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecr/repository/page-abb2dcbd9f97dc6b.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/create/page-3360447933bd5e32.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/create/page-e4bb0e486f3dc24d.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/page-4cfa0065d82a62d1.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/page-b5d619b6b8f4df3c.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/service/page-5f7159cebc3ece3e.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/service/page-c2079d3bea6d4b40.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task-definition/page-b85d625d9b322d50.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task-definition/page-cc368d0a83eff4f0.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task-definitions/page-61c374e3656b4ede.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task-definitions/page-ed8af94e93d9986b.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task-definitions/register/page-1923bacd9e1f2760.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task-definitions/register/page-2b7839f1d4038150.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task/page-af743b57fad2a4b0.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/task/page-f5d6810012d3179b.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/tasks/page-b8e04d602765384c.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ecs/tasks/page-ec6ffdf687581332.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/efs/file-system/page-6987b136ae457e57.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/efs/file-system/page-9a2555ca572d7db4.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/efs/page-3202be6d938287ff.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/efs/page-49aee9e986a09f4e.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/backups/page-05514774bc54d3aa.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/backups/page-82e990afaa5a7060.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/cluster/page-480a483922fa2eb8.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/cluster/page-b62828dc4a52e790.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/create/page-b297da2a2db9f91c.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/create/page-e245f84cbd1efd36.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/page-56fda7da0b007044.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elasticache/page-e404cdf0219f5ec8.js rename pages/demo/_next/static/chunks/app/(console)/elb/create/{page-062b29ef36be11d1.js => page-fa2dc1566d76b2c7.js} (66%) delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/load-balancer/page-2146278dfc17a5d3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/load-balancer/page-413427b894fa63ab.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/page-def3ec842dc498de.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/page-f4bc3f35918e44b2.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/target-group/page-0012e99a0673b468.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/target-group/page-0de2b1384d1763b2.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/target-groups/page-7c5339681bb3f975.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/elb/target-groups/page-af830e09304b5d5d.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/events/buses/page-541cf50813e284e6.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/events/buses/page-553da040bc5386fd.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/events/create/page-8b5542dbd7b61d87.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/events/create/page-cae7dc66e7b98550.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/events/page-695f3781a2193400.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/events/page-d190b9309d80f2dd.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/events/rule/page-16a1e14a99155a2f.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/events/rule/page-fbfa46d687280d19.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/events/scheduler/page-6d7a88618cb86760.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/events/scheduler/page-906808278323c070.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/events/send/page-2cd34dbe836480e3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/events/send/page-56f24370e8a59ffb.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/group/page-141587a04c787f71.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/group/page-a612e7fdfe9d87bd.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/groups/page-1dfeb8e7f920170d.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/groups/page-56d09c2bfdaa833f.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/instance-profile/page-6c7b7535049389f7.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/instance-profile/page-e2931816e5191040.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/instance-profiles/page-061b9ba709841cbc.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/instance-profiles/page-091d3566df187938.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/page-90cf54612f35e963.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/page-e72be3d46a834709.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/policies/create/page-444a8bd4109d4eac.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/policies/create/page-b5fdecbc1e4aa55c.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/policies/page-3a6147959722fce3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/policies/page-de9407ea56e5b853.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/policy/page-18785a13f0400bc4.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/policy/page-acf40b22fc7ff7c1.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/role/page-8122f451484c94cf.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/role/page-c3b3afd299b23fca.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/roles/create/page-975a8f3ed8a1ed62.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/roles/create/page-c418ab362719acbd.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/roles/page-0487960af1e93165.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/roles/page-ab96a74b8fecc948.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/simulator/page-a0c5a533ad02dc69.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/simulator/page-e3a6392373252f3a.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/user/page-195b38158a7833f7.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/user/page-76a66f8c704d8f7e.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/users/page-568ec43c6fc4be00.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/iam/users/page-c4f4039970353c5e.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/kms/crypto/page-2d16005049011bad.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/kms/crypto/page-bdb61b46df0c2b50.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/kms/key/page-83f80b8a51f3cf11.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/kms/key/page-fdbfe4f0709449ee.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/kms/page-9f60b4c1303ab1e4.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/kms/page-c962c8b39b9e8d23.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/create/page-9138fe8dbc4f670f.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/create/page-da9594769ce287ce.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/function/page-98aad04a0cb685a7.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/function/page-ef88bbc7c2a9c322.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/layers/page-581fa5930d6c8b32.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/layers/page-6b4b1ce85314cdd8.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/page-33b6e3f76ad03b2c.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/page-9509cf12b433b020.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/triggers/page-411cbdb8aee6b037.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/lambda/triggers/page-f30c709ebecdc473.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/layout-85ed75832cb8eb38.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/layout-bf64ca2ac6bdf0a0.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/page-106b14dc44527189.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/page-ae6f21e48eae204a.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/create/page-20b846bfb3aae3b8.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/create/page-c2784d14ee56c5a6.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/instance/page-0f9156b03fcec92b.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/instance/page-acf64b28cf419ab9.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/page-ad4607f6dd1615d3.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/page-d2b0d3601d5505e5.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/snapshots/page-05514774bc54d3aa.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/rds/snapshots/page-82e990afaa5a7060.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/route53/page-19e2c4b0d564c5bf.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/route53/page-c2a80626d4cec4f4.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/route53/zone/page-8fddfa2809e96394.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/route53/zone/page-eddcfa80e2a827d3.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/s3/bucket/page-53e00c2a54e9a574.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/s3/bucket/page-6ae624d4cc1f475f.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/s3/page-0feed00d49e27252.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/s3/page-836e20daee1a21a0.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/secrets/create/page-43868686d82bad7b.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/secrets/create/page-7711446b056182c4.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/secrets/page-7edfa4177bdeb2a5.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/secrets/page-d02cea1cd2a89536.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/secrets/secret/page-1e7fbb3497136a89.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/secrets/secret/page-630d8abb846110f4.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/create/page-72b0633bdb1fd31d.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/create/page-7a23ce0a622467be.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/execution/page-de6aae2909bb6087.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/execution/page-deeec01d17cd5199.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/page-75d5f7697a0cb377.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/page-f7042adf92a05aac.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/state-machine/page-5f8ff3b710667bcd.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sfn/state-machine/page-bebda58e0a323234.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sns/page-b0fbd74a48f4c5e4.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sns/page-c31e19ca44532ea7.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sns/subscriptions/page-182a521b0858a71e.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sns/subscriptions/page-43a6314e41df7ebf.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sns/topic/page-c3bdd42fdfa9ccf3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sns/topic/page-dbc915d4188a41c7.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sqs/create/page-81846f8f69c9d275.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sqs/create/page-e030814ea732b76f.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sqs/page-a1f0419a9220e0ac.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sqs/page-f3a3a8a372cc9661.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/sqs/queue/page-1888b28eabbed991.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/sqs/queue/page-dccca85db08595cc.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ssm/create/page-4c78f566049d9266.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ssm/create/page-c947c42fba9eb297.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ssm/page-1327e36392a431a3.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ssm/page-e38894dbe346e1c5.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/ssm/parameter/page-00efb33c31067698.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/ssm/parameter/page-d40bd1284156717b.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/internet-gateways/page-02934b5fcdfea050.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/internet-gateways/page-b02bd93efa7a1bed.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/page-0c5828baeda14237.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/page-e7153cf6bf3051ca.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/route-tables/page-09596d10748e1a1c.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/route-tables/page-373d98f457f57aec.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/security-group/page-5e913dc7fb7b6a65.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/security-group/page-747b223b039c7a42.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/security-groups/page-308985e555c65c7b.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/security-groups/page-a6faff0bcec76df4.js delete mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/subnets/page-9cd2c2329f5687b0.js create mode 100644 pages/demo/_next/static/chunks/app/(console)/vpc/subnets/page-ff9ec9f0119e519c.js create mode 100644 pages/demo/_next/static/chunks/app/_not-found/page-2070973868b3af12.js delete mode 100644 pages/demo/_next/static/chunks/app/_not-found/page-542e15a4fe423705.js create mode 100644 pages/demo/_next/static/chunks/app/layout-f589a28c31e80c79.js delete mode 100644 pages/demo/_next/static/chunks/app/layout-f83df127d0360db0.js delete mode 100644 pages/demo/_next/static/chunks/app/login/page-827cf8f6c53d111f.js create mode 100644 pages/demo/_next/static/chunks/app/login/page-bf95b73c71d0ce5c.js delete mode 100644 pages/demo/_next/static/chunks/framework-4374eae96780d8a1.js create mode 100644 pages/demo/_next/static/chunks/framework-4dd41bbf68badc4e.js create mode 100644 pages/demo/_next/static/chunks/main-1d1d8f3ac4de8ecb.js create mode 100644 pages/demo/_next/static/chunks/main-app-0030d1290935a9af.js delete mode 100644 pages/demo/_next/static/chunks/main-app-14c7ed497a2445dc.js delete mode 100644 pages/demo/_next/static/chunks/main-c201be324f769095.js delete mode 100644 pages/demo/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js create mode 100644 pages/demo/_next/static/chunks/pages/_app-7816e155798d3ad4.js create mode 100644 pages/demo/_next/static/chunks/pages/_error-46bca0e17ea5c773.js delete mode 100644 pages/demo/_next/static/chunks/pages/_error-c970d8b55ace1b48.js rename pages/demo/_next/static/chunks/{webpack-113dd6ee34d462a9.js => webpack-aa25a3360e80c153.js} (68%) create mode 100644 pages/demo/_next/static/css/2ba92d0a3e4d7b00.css delete mode 100644 pages/demo/_next/static/css/5cc952e448590a72.css rename pages/demo/_next/static/{7cKf8A74v0nHdmWE0RUlw => hxN8baUg-romznA9qJ5aB}/_buildManifest.js (98%) rename pages/demo/_next/static/{7cKf8A74v0nHdmWE0RUlw => hxN8baUg-romznA9qJ5aB}/_ssgManifest.js (100%) diff --git a/cli/internal/svc/ec2/capabilities.go b/cli/internal/svc/ec2/capabilities.go new file mode 100644 index 00000000..22958f14 --- /dev/null +++ b/cli/internal/svc/ec2/capabilities.go @@ -0,0 +1,25 @@ +package ec2 + +import "github.com/homecloudhq/homecloud/cli/internal/httpx" + +// Capabilities tells the console what this host can run, so the launch wizard +// can warn before someone picks a VM image on a host without KVM. +type Capabilities struct { + // VM is "kvm" when virtual machine instances run hardware-accelerated, + // "emulated" when the Docker host has no usable /dev/kvm (QEMU emulates the + // CPU, which is slow), and "unavailable" when VMs cannot run at all. + VM string `json:"vm"` +} + +func (s *Service) capabilities(c *httpx.Ctx) (any, error) { + if s.env.Docker == nil { + return Capabilities{VM: "unavailable"}, nil + } + if s.vmRunnerFailure() != nil { + return Capabilities{VM: "unavailable"}, nil + } + if s.vmKVM() { + return Capabilities{VM: "kvm"}, nil + } + return Capabilities{VM: "emulated"}, nil +} diff --git a/cli/internal/svc/ec2/ec2.go b/cli/internal/svc/ec2/ec2.go index 0fc0a6a4..09ca13a0 100644 --- a/cli/internal/svc/ec2/ec2.go +++ b/cli/internal/svc/ec2/ec2.go @@ -303,6 +303,7 @@ func (s *Service) Routes(r *httpx.Router) { r.Handle("GET /api/v1/ec2/instances/{id}/terminal", "ec2-instance-connect:SendSSHPublicKey", s.terminal, res) r.Handle("GET /api/v1/ec2/instance-types", "ec2:DescribeInstanceTypes", s.listTypes) + r.Handle("GET /api/v1/ec2/capabilities", "ec2:DescribeInstanceTypes", s.capabilities) r.Handle("GET /api/v1/ec2/images", "ec2:DescribeImages", s.listImages) r.Handle("POST /api/v1/ec2/images", "ec2:RegisterImage", s.registerImage) imgRes := httpx.Res("arn:aws:ec2:{region}:{account}:image/{id}") diff --git a/console/components/ec2/images-list.tsx b/console/components/ec2/images-list.tsx index e513ea9e..644171cb 100644 --- a/console/components/ec2/images-list.tsx +++ b/console/components/ec2/images-list.tsx @@ -23,7 +23,8 @@ import { TimeAgo } from "@/components/console/time-ago" import { api, errorMessage, seg } from "@/lib/api" import { revalidate, useApi } from "@/lib/hooks" import type { Image } from "@/lib/types" -import { instanceHref } from "./instance-actions" +import { Badge } from "@/components/ui/badge" +import { instanceHref, isVMImage } from "./instance-actions" const IMAGES_PATH = "/api/v1/ec2/images" type Owner = "all" | "catalog" | "mine" @@ -40,7 +41,18 @@ const columns: Column[] = [ value: (im) => im.description, hideBelow: "lg", }, - { id: "ref", header: "Docker image", cell: (im) => {im.ref}, value: (im) => im.ref }, + { + id: "kind", + header: "Type", + cell: (im) => {isVMImage(im) ? "VM" : "Container"}, + value: (im) => (isVMImage(im) ? "VM" : "Container"), + }, + { + id: "ref", + header: "Docker image / VM base", + cell: (im) => {im.ref || im.vm_base || "-"}, + value: (im) => im.ref || im.vm_base || "", + }, { id: "owner", header: "Owner", @@ -58,7 +70,7 @@ const columns: Column[] = [ { id: "boot", header: "Boot mode", - cell: (im) => (im.keep_alive ? "VM-like (keep alive)" : "Application"), + cell: (im) => (isVMImage(im) ? "Virtual machine" : im.keep_alive ? "OS-like (keep alive)" : "Application"), value: (im) => (im.keep_alive ? "keep alive" : "application"), hideBelow: "md", }, diff --git a/console/components/ec2/instance-actions.tsx b/console/components/ec2/instance-actions.tsx index 324377d4..36d9e03b 100644 --- a/console/components/ec2/instance-actions.tsx +++ b/console/components/ec2/instance-actions.tsx @@ -15,7 +15,8 @@ import { StatusBadge } from "@/components/console/status-badge" import { api, errorMessage, seg } from "@/lib/api" import { revalidate, useApi } from "@/lib/hooks" import { formatMemoryMB, pluralize } from "@/lib/format" -import type { Image, Instance, InstanceState, InstanceType } from "@/lib/types" +import { Badge } from "@/components/ui/badge" +import type { Ec2Capabilities, Image, Instance, InstanceState, InstanceType } from "@/lib/types" export const INSTANCES_PATH = "/api/v1/ec2/instances" @@ -72,6 +73,30 @@ export function PublicPorts({ instance, empty = "-", compact }: { instance: Inst ) } +export const isVMInstance = (i: Pick) => i.virtualization === "kvm" || i.virtualization === "emulated" + +export const isVMImage = (im: Pick) => im.virtualization === "vm" || !!im.vm_base + +/** "Container", "VM · KVM" or "VM · emulated". */ +export function instanceKind(i: Pick) { + if (!isVMInstance(i)) return "Container" + return i.virtualization === "kvm" ? "VM · KVM" : "VM · emulated" +} + +/** Type badge for an instance: Container / VM · KVM / VM · emulated (slow). */ +export function InstanceKindBadge({ instance }: { instance: Pick }) { + const vm = isVMInstance(instance) + return ( + + {instanceKind(instance)} + + ) +} + +export function useEc2Capabilities() { + return useApi("/api/v1/ec2/capabilities", { revalidateOnFocus: false }) +} + export function useInstanceTypes() { return useApi("/api/v1/ec2/instance-types", { revalidateOnFocus: false }) } diff --git a/console/components/ec2/instance-console-output.tsx b/console/components/ec2/instance-console-output.tsx index 92652fa7..41bfb4b1 100644 --- a/console/components/ec2/instance-console-output.tsx +++ b/console/components/ec2/instance-console-output.tsx @@ -14,7 +14,7 @@ import { formatTime } from "@/lib/format" import { useApi } from "@/lib/hooks" import type { ConsoleOutput, Instance } from "@/lib/types" import { cn } from "@/lib/utils" -import { INSTANCES_PATH } from "./instance-actions" +import { INSTANCES_PATH, isVMInstance } from "./instance-actions" // Docker log lines start with an RFC 3339 timestamp. const TS = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z /gm @@ -59,8 +59,8 @@ export function InstanceConsoleOutput({ instance }: { instance: Instance }) { return (
diff --git a/console/components/ec2/instance-detail.tsx b/console/components/ec2/instance-detail.tsx index 11f47dbd..a11d3b39 100644 --- a/console/components/ec2/instance-detail.tsx +++ b/console/components/ec2/instance-detail.tsx @@ -27,7 +27,7 @@ import { formatDate, formatMemoryMB } from "@/lib/format" import { revalidate, useApi, useQueryParam, useSetQueryParam } from "@/lib/hooks" import { ASG_GROUP_TAG } from "@/lib/types" import type { Instance } from "@/lib/types" -import { INSTANCES_PATH, PublicPorts, instanceLabel, isTransitional, pollInterval, useInstanceActions } from "./instance-actions" +import { INSTANCES_PATH, InstanceKindBadge, PublicPorts, instanceLabel, isVMInstance, isTransitional, pollInterval, useInstanceActions } from "./instance-actions" import { instanceProfileHref } from "@/components/iam/common" import { InstanceConsoleOutput } from "./instance-console-output" import { InstanceMonitoring } from "./instance-monitoring" @@ -166,7 +166,7 @@ export function InstanceDetail() { Details Monitoring - Console output + {isVMInstance(inst) ? "System log" : "Console output"} Run command Connect @@ -204,6 +204,18 @@ function BackButton() { ) } +function VirtualizationValue({ inst }: { inst: Instance }) { + if (!isVMInstance(inst)) return Shares the host kernel + return ( + + + + {inst.virtualization === "kvm" ? "Own kernel, hardware accelerated (KVM)" : "Own kernel, CPU emulated (no /dev/kvm on the host, so it is slow)"} + + + ) +} + function DetailsTab({ inst }: { inst: Instance }) { return (
@@ -225,10 +237,11 @@ function DetailsTab({ inst }: { inst: Instance }) { ), }, - { label: "Image reference", value: }, + { label: "Virtualization", value: }, + ...(inst.image_ref ? [{ label: "Image reference", value: }] : []), { label: "Boot mode", - value: inst.keep_alive ? "Keep alive (VM-like: runs user data, then idles)" : "Application (runs the image's own process)", + value: isVMInstance(inst) ? "Virtual machine (own kernel, boots from a cloud image)" : inst.keep_alive ? "Keep alive (VM-like: runs user data, then idles)" : "Application (runs the image's own process)", }, { label: "Launch time", value: {formatDate(inst.launch_time)} () }, { label: "Terminated at", value: inst.terminated_at ? formatDate(inst.terminated_at) : "" }, diff --git a/console/components/ec2/instances-list.tsx b/console/components/ec2/instances-list.tsx index d28aee60..5657469b 100644 --- a/console/components/ec2/instances-list.tsx +++ b/console/components/ec2/instances-list.tsx @@ -17,7 +17,7 @@ import { StatusBadge } from "@/components/console/status-badge" import { TimeAgo } from "@/components/console/time-ago" import { useApi } from "@/lib/hooks" import type { Instance } from "@/lib/types" -import { INSTANCES_PATH, PublicPorts, instanceHref, pollInterval, useInstanceActions } from "./instance-actions" +import { INSTANCES_PATH, InstanceKindBadge, PublicPorts, instanceKind, instanceHref, pollInterval, useInstanceActions } from "./instance-actions" const STATES = ["all", "pending", "running", "stopping", "stopped", "shutting-down", "terminated"] as const @@ -39,13 +39,14 @@ const columns: Column[] = [ value: (i) => i.id, }, { id: "state", header: "Instance state", cell: (i) => , value: (i) => i.state }, + { id: "kind", header: "Type", cell: (i) => , value: (i) => instanceKind(i) }, { id: "type", header: "Instance type", cell: (i) => {i.instance_type}, value: (i) => i.instance_type }, { id: "image", header: "Image", cell: (i) => ( - {i.image_ref} + {i.image_ref || i.image_id} ), value: (i) => `${i.image_ref} ${i.image_id}`, @@ -138,7 +139,7 @@ export function InstancesList() {
a.vpc_id.localeCompare(b.vpc_id) || a.availability_zone.localeCompare(b.availability_zone) || a.name.localeCompare(b.name)) + return [...list].sort( + (a, b) => + a.vpc_id.localeCompare(b.vpc_id) || + a.availability_zone.localeCompare(b.availability_zone) || + a.name.localeCompare(b.name), + ); } export function LaunchWizard() { - const router = useRouter() - const imageParam = useQueryParam("image") - - const images = useApi("/api/v1/ec2/images", { revalidateOnFocus: false }) - const types = useInstanceTypes() - const subnets = useApi("/api/v1/vpc/subnets", { revalidateOnFocus: false }) - const fileSystems = useApi(FILE_SYSTEMS_PATH, { revalidateOnFocus: false }) - - const [name, setName] = useState("") - const [tagRows, setTagRows] = useState([]) - const [imageId, setImageId] = useState("") - const [imageFilter, setImageFilter] = useState("all") - const [imageQuery, setImageQuery] = useState("") - const [type, setType] = useState(DEFAULT_TYPE) - const [subnetId, setSubnetId] = useState("") - const [sgIds, setSgIds] = useState([]) - const [sgVpc, setSgVpc] = useState("") - const [volumes, setVolumes] = useState([]) - const [fsRows, setFsRows] = useState([]) - const [userData, setUserData] = useState("") - const [keyName, setKeyName] = useState("") - const [creatingKey, setCreatingKey] = useState(false) - const keyPairs = useApi(KEY_PAIRS_PATH) - const [profile, setProfile] = useState("") - const [mdEndpoint, setMdEndpoint] = useState<"enabled" | "disabled">("enabled") - const [mdTokens, setMdTokens] = useState<"optional" | "required">("required") - const [mdHops, setMdHops] = useState("2") - const [mdTags, setMdTags] = useState<"enabled" | "disabled">("disabled") - const [count, setCount] = useState("1") - const [submitted, setSubmitted] = useState(false) - const [pending, setPending] = useState(false) + const router = useRouter(); + const imageParam = useQueryParam("image"); + + const images = useApi("/api/v1/ec2/images", { + revalidateOnFocus: false, + }); + const types = useInstanceTypes(); + const subnets = useApi("/api/v1/vpc/subnets", { + revalidateOnFocus: false, + }); + const fileSystems = useApi(FILE_SYSTEMS_PATH, { + revalidateOnFocus: false, + }); + const caps = useEc2Capabilities(); + + const [name, setName] = useState(""); + const [tagRows, setTagRows] = useState([]); + const [kind, setKind] = useState("container"); + const [rootGb, setRootGb] = useState("8"); + const [imageId, setImageId] = useState(""); + const [imageFilter, setImageFilter] = useState("all"); + const [imageQuery, setImageQuery] = useState(""); + const [type, setType] = useState(DEFAULT_TYPE); + const [subnetId, setSubnetId] = useState(""); + const [sgIds, setSgIds] = useState([]); + const [sgVpc, setSgVpc] = useState(""); + const [volumes, setVolumes] = useState([]); + const [fsRows, setFsRows] = useState([]); + const [userData, setUserData] = useState(""); + const [keyName, setKeyName] = useState(""); + const [creatingKey, setCreatingKey] = useState(false); + const keyPairs = useApi(KEY_PAIRS_PATH); + const [profile, setProfile] = useState(""); + const [mdEndpoint, setMdEndpoint] = useState<"enabled" | "disabled">( + "enabled", + ); + const [mdTokens, setMdTokens] = useState<"optional" | "required">("required"); + const [mdHops, setMdHops] = useState("2"); + const [mdTags, setMdTags] = useState<"enabled" | "disabled">("disabled"); + const [count, setCount] = useState("1"); + const [submitted, setSubmitted] = useState(false); + const [pending, setPending] = useState(false); // Default image: ?image=, else Ubuntu 24.04, else the first. useEffect(() => { - if (imageId || !images.data?.length) return - const want = [imageParam, DEFAULT_IMAGE].find((id) => id && images.data!.some((im) => im.id === id)) - setImageId(want ?? images.data[0].id) - if (imageParam && images.data.some((im) => im.id === imageParam && im.owner !== "homecloud")) setImageFilter("mine") - }, [images.data, imageParam, imageId]) + if (imageId || !images.data?.length) return; + const want = [imageParam, DEFAULT_IMAGE].find( + (id) => id && images.data!.some((im) => im.id === id), + ); + const pick = + images.data.find((im) => im.id === want) ?? + images.data.find((im) => !isVMImage(im)) ?? + images.data[0]; + setKind(isVMImage(pick) ? "vm" : "container"); + setImageId(pick.id); + if ( + imageParam && + images.data.some((im) => im.id === imageParam && im.owner !== "homecloud") + ) + setImageFilter("mine"); + }, [images.data, imageParam, imageId]); - const sortedSubnets = useMemo(() => sortSubnets(subnets.data ?? []), [subnets.data]) + const sortedSubnets = useMemo( + () => sortSubnets(subnets.data ?? []), + [subnets.data], + ); // Default subnet: the default VPC's subnet in zone "a". useEffect(() => { - if (subnetId || !sortedSubnets.length) return - const pick = sortedSubnets.find((s) => s.default && s.availability_zone.endsWith("a")) ?? sortedSubnets.find((s) => s.default) ?? sortedSubnets[0] - setSubnetId(pick.id) - }, [sortedSubnets, subnetId]) + if (subnetId || !sortedSubnets.length) return; + const pick = + sortedSubnets.find( + (s) => s.default && s.availability_zone.endsWith("a"), + ) ?? + sortedSubnets.find((s) => s.default) ?? + sortedSubnets[0]; + setSubnetId(pick.id); + }, [sortedSubnets, subnetId]); - const subnet = sortedSubnets.find((s) => s.id === subnetId) - const vpcId = subnet?.vpc_id ?? "" - const sgs = useApi(vpcId ? "/api/v1/vpc/security-groups" : null, { query: { vpc_id: vpcId } }) + const subnet = sortedSubnets.find((s) => s.id === subnetId); + const vpcId = subnet?.vpc_id ?? ""; + const sgs = useApi( + vpcId ? "/api/v1/vpc/security-groups" : null, + { query: { vpc_id: vpcId } }, + ); // Reset the security group selection to the VPC's default group whenever the VPC changes. useEffect(() => { - if (!vpcId || !sgs.data || sgVpc === vpcId) return - const groups = sgs.data.filter((g) => g.vpc_id === vpcId) - const def = groups.find((g) => g.name === "default") - setSgIds(def ? [def.id] : []) - setSgVpc(vpcId) - }, [vpcId, sgs.data, sgVpc]) - - const image = images.data?.find((im) => im.id === imageId) - const instanceType = types.data?.find((t) => t.name === type) - const groups = (sgs.data ?? []).filter((g) => g.vpc_id === vpcId) - const selectedGroups = groups.filter((g) => sgIds.includes(g.id)) + if (!vpcId || !sgs.data || sgVpc === vpcId) return; + const groups = sgs.data.filter((g) => g.vpc_id === vpcId); + const def = groups.find((g) => g.name === "default"); + setSgIds(def ? [def.id] : []); + setSgVpc(vpcId); + }, [vpcId, sgs.data, sgVpc]); + + const image = images.data?.find((im) => im.id === imageId); + const instanceType = types.data?.find((t) => t.name === type); + const groups = (sgs.data ?? []).filter((g) => g.vpc_id === vpcId); + const selectedGroups = groups.filter((g) => sgIds.includes(g.id)); const publishedPorts = Array.from( - new Set(selectedGroups.flatMap((g) => g.ingress.filter((r) => (r.protocol === "tcp" || r.protocol === "udp") && (r.cidr === "0.0.0.0/0" || r.cidr === "127.0.0.1/32")).map((r) => (r.from_port === r.to_port ? `${r.from_port}/${r.protocol}` : `${r.from_port}-${r.to_port}/${r.protocol}`)))), - ) + new Set( + selectedGroups.flatMap((g) => + g.ingress + .filter( + (r) => + (r.protocol === "tcp" || r.protocol === "udp") && + (r.cidr === "0.0.0.0/0" || r.cidr === "127.0.0.1/32"), + ) + .map((r) => + r.from_port === r.to_port + ? `${r.from_port}/${r.protocol}` + : `${r.from_port}-${r.to_port}/${r.protocol}`, + ), + ), + ), + ); + + const isVM = kind === "vm"; + const chooseKind = (k: Kind) => { + if (k === kind) return; + setKind(k); + const want = k === "vm" ? DEFAULT_VM_IMAGE : DEFAULT_IMAGE; + const list = (images.data ?? []).filter( + (im) => isVMImage(im) === (k === "vm"), + ); + setImageId((list.find((im) => im.id === want) ?? list[0])?.id ?? ""); + if (k === "vm") { + setVolumes([]); + setFsRows([]); + } + }; const visibleImages = useMemo(() => { - const q = imageQuery.trim().toLowerCase() + const q = imageQuery.trim().toLowerCase(); return (images.data ?? []).filter((im) => { - if (imageFilter === "catalog" && im.owner !== "homecloud") return false - if (imageFilter === "mine" && im.owner === "homecloud") return false - if (!q) return true - return [im.name, im.description, im.ref, im.id].some((s) => s?.toLowerCase().includes(q)) - }) - }, [images.data, imageFilter, imageQuery]) + if (isVMImage(im) !== (kind === "vm")) return false; + if (imageFilter === "catalog" && im.owner !== "homecloud") return false; + if (imageFilter === "mine" && im.owner === "homecloud") return false; + if (!q) return true; + return [im.name, im.description, im.ref, im.id].some((s) => + s?.toLowerCase().includes(q), + ); + }); + }, [images.data, imageFilter, imageQuery, kind]); // ---- validation ---- - const n = Number(count) + const n = Number(count); const errors = useMemo(() => { - const e: Record = {} - if (name.length > 128) e.name = "Names are at most 128 characters" - if (!imageId) e.image = "Choose an image" - if (!type) e.type = "Choose an instance type" - if (!subnetId) e.subnet = "Choose a subnet" - if (!Number.isInteger(n) || n < 1 || n > 20) e.count = "Enter a whole number from 1 to 20" - const keys = tagRows.map((r) => r.key.trim()).filter(Boolean) - if (new Set(keys).size !== keys.length) e.tags = "Tag keys must be unique" - else if (tagRows.some((r) => !r.key.trim() && r.value.trim())) e.tags = "Every tag with a value needs a key" - const mounts = new Set() + const e: Record = {}; + if (name.length > 128) e.name = "Names are at most 128 characters"; + if (!imageId) e.image = "Choose an image"; + if (!type) e.type = "Choose an instance type"; + if (!subnetId) e.subnet = "Choose a subnet"; + if (!Number.isInteger(n) || n < 1 || n > 20) + e.count = "Enter a whole number from 1 to 20"; + const keys = tagRows.map((r) => r.key.trim()).filter(Boolean); + if (new Set(keys).size !== keys.length) e.tags = "Tag keys must be unique"; + else if (tagRows.some((r) => !r.key.trim() && r.value.trim())) + e.tags = "Every tag with a value needs a key"; + const mounts = new Set(); volumes.forEach((v, i) => { - const size = Number(v.size) - if (!Number.isInteger(size) || size < 1 || size > 16384) e[`vol${i}size`] = "1-16384 GiB" - if (!v.mount.startsWith("/")) e[`vol${i}mount`] = "Must be an absolute path starting with /" - else if (v.mount === "/" || /\s/.test(v.mount)) e[`vol${i}mount`] = "Choose a directory other than /, without spaces" - else if (mounts.has(v.mount.replace(/\/+$/, ""))) e[`vol${i}mount`] = "Mount paths must be unique" - mounts.add(v.mount.replace(/\/+$/, "")) - }) + const size = Number(v.size); + if (!Number.isInteger(size) || size < 1 || size > 16384) + e[`vol${i}size`] = "1-16384 GiB"; + if (!v.mount.startsWith("/")) + e[`vol${i}mount`] = "Must be an absolute path starting with /"; + else if (v.mount === "/" || /\s/.test(v.mount)) + e[`vol${i}mount`] = "Choose a directory other than /, without spaces"; + else if (mounts.has(v.mount.replace(/\/+$/, ""))) + e[`vol${i}mount`] = "Mount paths must be unique"; + mounts.add(v.mount.replace(/\/+$/, "")); + }); fsRows.forEach((f, i) => { - if (!f.id) e[`fs${i}id`] = "Choose a file system" - if (!f.mount.startsWith("/")) e[`fs${i}mount`] = "Must be an absolute path starting with /" - else if (f.mount === "/" || /\s/.test(f.mount)) e[`fs${i}mount`] = "Choose a directory other than /, without spaces" - else if (mounts.has(f.mount.replace(/\/+$/, ""))) e[`fs${i}mount`] = "Mount paths must be unique" - mounts.add(f.mount.replace(/\/+$/, "")) - }) - if (userData.length > 16 * 1024) e.userData = "User data is limited to 16 KB" - if (keyName.trim() && !/^[\x20-\x7e]{1,255}$/.test(keyName.trim())) e.keyName = "Key pair names are 1-255 ASCII characters" - const hops = Number(mdHops) - if (!Number.isInteger(hops) || hops < 1 || hops > 64) e.mdHops = "Enter a hop limit from 1 to 64" - return e - }, [name, imageId, type, subnetId, n, tagRows, volumes, fsRows, userData, keyName, mdHops]) - const err = (k: string) => (submitted ? errors[k] : undefined) - const valid = Object.keys(errors).length === 0 + if (!f.id) e[`fs${i}id`] = "Choose a file system"; + if (!f.mount.startsWith("/")) + e[`fs${i}mount`] = "Must be an absolute path starting with /"; + else if (f.mount === "/" || /\s/.test(f.mount)) + e[`fs${i}mount`] = "Choose a directory other than /, without spaces"; + else if (mounts.has(f.mount.replace(/\/+$/, ""))) + e[`fs${i}mount`] = "Mount paths must be unique"; + mounts.add(f.mount.replace(/\/+$/, "")); + }); + if (userData.length > 16 * 1024) + e.userData = "User data is limited to 16 KB"; + if (keyName.trim() && !/^[\x20-\x7e]{1,255}$/.test(keyName.trim())) + e.keyName = "Key pair names are 1-255 ASCII characters"; + const root = Number(rootGb); + if (isVM && (!Number.isInteger(root) || root < 4 || root > 16384)) + e.rootGb = "4-16384 GiB"; + const hops = Number(mdHops); + if (!Number.isInteger(hops) || hops < 1 || hops > 64) + e.mdHops = "Enter a hop limit from 1 to 64"; + return e; + }, [ + name, + imageId, + type, + subnetId, + n, + tagRows, + volumes, + fsRows, + userData, + keyName, + mdHops, + isVM, + rootGb, + ]); + const err = (k: string) => (submitted ? errors[k] : undefined); + const valid = Object.keys(errors).length === 0; const launch = async () => { - setSubmitted(true) + setSubmitted(true); if (!valid) { - toast.error("Fix the highlighted fields before launching") - return + toast.error("Fix the highlighted fields before launching"); + return; } const body: RunInstancesInput = { name: name.trim() || undefined, @@ -186,51 +330,82 @@ export function LaunchWizard() { user_data: userData || undefined, key_name: keyName.trim() || undefined, iam_instance_profile: profile || undefined, - metadata_options: { http_endpoint: mdEndpoint, http_tokens: mdTokens, hop_limit: Number(mdHops), instance_metadata_tags: mdTags }, + metadata_options: { + http_endpoint: mdEndpoint, + http_tokens: mdTokens, + hop_limit: Number(mdHops), + instance_metadata_tags: mdTags, + }, count: n, tags: rowsToTags(tagRows), - volumes: volumes.length - ? volumes.map((v) => ({ size_gb: Number(v.size), mount_path: v.mount.replace(/(.)\/+$/, "$1"), delete_on_termination: v.del })) - : undefined, - file_systems: fsRows.length - ? fsRows.map((f) => ({ file_system_id: f.id, mount_path: f.mount.replace(/(.)\/+$/, "$1"), read_only: f.ro })) - : undefined, - } - setPending(true) + root_volume: isVM ? { size_gb: Number(rootGb) } : undefined, + volumes: + volumes.length && !isVM + ? volumes.map((v) => ({ + size_gb: Number(v.size), + mount_path: v.mount.replace(/(.)\/+$/, "$1"), + delete_on_termination: v.del, + })) + : undefined, + file_systems: + fsRows.length && !isVM + ? fsRows.map((f) => ({ + file_system_id: f.id, + mount_path: f.mount.replace(/(.)\/+$/, "$1"), + read_only: f.ro, + })) + : undefined, + }; + setPending(true); try { - const out = await api.post(INSTANCES_PATH, body) - toast.success(out.length === 1 ? `Launched ${out[0].id}` : `Launched ${pluralize(out.length, "instance")}: ${out.map((i) => i.id).join(", ")}`) - await revalidate("/api/v1/ec2") - router.push(out.length === 1 ? instanceHref(out[0].id) : "/ec2/") + const out = await api.post(INSTANCES_PATH, body); + toast.success( + out.length === 1 + ? `Launched ${out[0].id}` + : `Launched ${pluralize(out.length, "instance")}: ${out.map((i) => i.id).join(", ")}`, + ); + await revalidate("/api/v1/ec2"); + router.push(out.length === 1 ? instanceHref(out[0].id) : "/ec2/"); } catch (e) { - toast.error(errorMessage(e)) - setPending(false) + toast.error(errorMessage(e)); + setPending(false); } - } + }; - const setVol = (i: number, patch: Partial) => setVolumes(volumes.map((v, j) => (j === i ? { ...v, ...patch } : v))) - const setFs = (i: number, patch: Partial) => setFsRows(fsRows.map((f, j) => (j === i ? { ...f, ...patch } : f))) - const fsById = (id: string) => fileSystems.data?.find((f) => f.id === id) + const setVol = (i: number, patch: Partial) => + setVolumes(volumes.map((v, j) => (j === i ? { ...v, ...patch } : v))); + const setFs = (i: number, patch: Partial) => + setFsRows(fsRows.map((f, j) => (j === i ? { ...f, ...patch } : f))); + const fsById = (id: string) => fileSystems.data?.find((f) => f.id === id); const addFs = () => { - const free = (fileSystems.data ?? []).find((f) => !fsRows.some((r) => r.id === f.id)) - const used = new Set(fsRows.map((r) => r.mount)) - let mount = "/mnt/efs" - for (let k = 2; used.has(mount); k++) mount = `/mnt/efs${k}` - setFsRows([...fsRows, { id: free?.id ?? "", mount, ro: !!free?.read_only }]) - } + const free = (fileSystems.data ?? []).find( + (f) => !fsRows.some((r) => r.id === f.id), + ); + const used = new Set(fsRows.map((r) => r.mount)); + let mount = "/mnt/efs"; + for (let k = 2; used.has(mount); k++) mount = `/mnt/efs${k}`; + setFsRows([ + ...fsRows, + { id: free?.id ?? "", mount, ro: !!free?.read_only }, + ]); + }; return (
{ - e.preventDefault() - launch() + e.preventDefault(); + launch(); }} className="grid grid-cols-1 items-start gap-4 xl:grid-cols-[minmax(0,1fr)_320px]" > @@ -243,9 +418,19 @@ export function LaunchWizard() { htmlFor="inst-name" optional error={err("name")} - help={n > 1 && name ? `Instances are named ${name}-1 ... ${name}-${n}.` : "Also a DNS alias for the instance inside its VPC network."} + help={ + n > 1 && name + ? `Instances are named ${name}-1 ... ${name}-${n}.` + : "Also a DNS alias for the instance inside its VPC network." + } > - setName(e.target.value)} placeholder="e.g. my-web-server" className="max-w-md" /> + setName(e.target.value)} + placeholder="e.g. my-web-server" + className="max-w-md" + /> @@ -253,18 +438,117 @@ export function LaunchWizard() {
+ {/* ---- Container or VM ---- */} +
+
+
+ {( + [ + [ + "container", + "Container", + Box, + "Starts in seconds and is lightweight, but shares the host kernel.", + ], + [ + "vm", + "Virtual machine", + Monitor, + "Has its own kernel and stronger isolation. Boots in about a minute; needs KVM on the host for full speed.", + ], + ] as [Kind, string, typeof Box, string][] + ).map(([k, label, Icon, blurb]) => { + const active = kind === k; + return ( + + ); + })} +
+ {isVM && caps.data?.vm === "emulated" && ( +
+ + + This host has no KVM ( + /dev/kvm), so + virtual machines are emulated and will be slow. Booting can + take several minutes. Containers are not affected. + +
+ )} + {isVM && caps.data?.vm === "unavailable" && ( +
+ + + Virtual machines are currently unavailable on this host. + Launching one is likely to fail. + +
+ )} +
+
+ {/* ---- Image ---- */}
- setImageQuery(e.target.value)} placeholder="Search images" className="h-8 pl-8" /> + setImageQuery(e.target.value)} + placeholder="Search images" + className="h-8 pl-8" + />
-
+
{( [ ["all", "All"], @@ -280,7 +564,9 @@ export function LaunchWizard() { onClick={() => setImageFilter(k)} className={cn( "rounded px-3 py-1 font-medium transition-colors", - imageFilter === k ? "bg-background text-foreground shadow-xs" : "text-muted-foreground hover:text-foreground", + imageFilter === k + ? "bg-background text-foreground shadow-xs" + : "text-muted-foreground hover:text-foreground", )} > {label} @@ -289,7 +575,10 @@ export function LaunchWizard() {
{images.error ? ( - images.mutate()} /> + images.mutate()} + /> ) : !images.data ? (
{Array.from({ length: 6 }, (_, i) => ( @@ -300,8 +589,12 @@ export function LaunchWizard() {

{imageFilter === "mine" && !imageQuery ? ( <> - You have no custom images yet. Create one from an instance or{" "} - + You have no custom images yet. Create one from an instance + or{" "} + register a Docker image . @@ -311,9 +604,13 @@ export function LaunchWizard() { )}

) : ( -
+
{visibleImages.map((im) => { - const active = im.id === imageId + const active = im.id === imageId; return ( - ) + ); })}
)} - {err("image") &&

{err("image")}

} + {err("image") && ( +

{err("image")}

+ )} {image && (

- Selected {image.id} ({image.ref}).{" "} - {image.keep_alive - ? "Boots like a VM: runs user data once, then stays up until stopped." - : "Runs the image's own entrypoint; the instance stops when that process exits."} + Selected{" "} + {image.id}{" "} + ({image.ref || image.vm_base}).{" "} + {isVMImage(image) + ? "Boots a virtual machine with its own kernel; cloud-init runs user data at first boot." + : image.keep_alive + ? "Boots like a VM: runs user data once, then stays up until stopped." + : "Runs the image's own entrypoint; the instance stops when that process exits."}

)}
{/* ---- Instance type ---- */} -
Compare instance types}> +
+ Compare instance types + + } + >
- +
- +
{instanceType && ( @@ -385,7 +731,10 @@ export function LaunchWizard() {
{/* ---- Key pair ---- */} -
+
- setKeyName(v === "__none" ? "" : v)} + > - Proceed without a key pair + + Proceed without a key pair + {(keyPairs.data ?? []).map((k) => ( {k.name} ({k.type}) @@ -407,11 +761,21 @@ export function LaunchWizard() { ))} -
- {creatingKey && setCreatingKey(false)} onCreated={(k) => setKeyName(k.name)} />} + {creatingKey && ( + setCreatingKey(false)} + onCreated={(k) => setKeyName(k.name)} + /> + )}
@@ -426,27 +790,50 @@ export function LaunchWizard() { subnet ? ( <> VPC{" "} - + {subnet.vpc_id} {" "} - · {subnet.cidr} · {subnet.availability_zone} · {formatNumber(subnet.available_ips)} available IPs + · {subnet.cidr} · {subnet.availability_zone} ·{" "} + {formatNumber(subnet.available_ips)} available IPs ) : undefined } > {subnets.error ? ( - subnets.mutate()} /> + subnets.mutate()} + /> ) : ( - - + {sortedSubnets.map((s) => ( - + {s.name || s.id} - {s.id} · {s.vpc_id} · {s.cidr} · {s.availability_zone} · {formatNumber(s.available_ips)} IPs + {s.id} · {s.vpc_id} · {s.cidr} ·{" "} + {s.availability_zone} ·{" "} + {formatNumber(s.available_ips)} IPs ))} @@ -458,7 +845,10 @@ export function LaunchWizard() {
Security groups - + Manage security groups
@@ -467,30 +857,55 @@ export function LaunchWizard() { ) : !sgs.data || !vpcId ? ( ) : groups.length === 0 ? ( -

This VPC has no security groups.

+

+ This VPC has no security groups. +

) : (
{groups.map((g) => { - const checked = sgIds.includes(g.id) + const checked = sgIds.includes(g.id); return ( -
)} {sgs.data && sgIds.length === 0 && ( -

No group selected: the VPC's default security group will be used.

+

+ No group selected: the VPC's default security group + will be used. +

)}

- Inbound (ingress) rules decide which ports are published on this host: each allowed port is mapped to a random host port, shown on the - instance as a clickable link. Rules are applied at launch. + Inbound (ingress) rules decide which ports are published on + this host: each allowed port is mapped to a random host + port, shown on the instance as a clickable link. Rules are + applied at launch. {selectedGroups.length > 0 && ( - <> Ports to publish: {publishedPorts.length ? {publishedPorts.join(", ")} : "none"}. + <> + {" "} + Ports to publish:{" "} + {publishedPorts.length ? ( + + {publishedPorts.join(", ")} + + ) : ( + "none" + )} + . + )}

@@ -520,124 +951,269 @@ export function LaunchWizard() {
{/* ---- Storage ---- */} -
-
- {volumes.length === 0 &&

No additional volumes.

} - {volumes.map((v, i) => ( -
- - setVol(i, { size: e.target.value })} className="h-8" /> - - - setVol(i, { mount: e.target.value })} placeholder="/data" className="h-8 font-mono" /> - - - -
- ))} -
- -
-

Sizes are advisory: Docker volumes are not capped.

-
-
- - {/* ---- File systems (EFS) ---- */} -
- Manage file systems - - } - > -
- {fileSystems.error ? ( - fileSystems.mutate()} /> - ) : fileSystems.data?.length === 0 ? ( -

- You have no file systems.{" "} - - Create a file system - {" "} - to share files between instances. -

- ) : ( - fsRows.length === 0 &&

No file systems mounted.

- )} - {fsRows.map((f, i) => { - const fs = fsById(f.id) - return ( -
- - + + setVol(i, { size: e.target.value })} + className="h-8" + /> - - setFs(i, { mount: e.target.value })} placeholder="/mnt/efs" className="h-8 font-mono" /> + + setVol(i, { mount: e.target.value })} + placeholder="/data" + className="h-8 font-mono" + /> - {fs?.read_only &&

This file system is read-only, so it is mounted read-only.

}
- ) - })} - {(fileSystems.data?.length ?? 0) > 0 && ( + ))}
-
- )} -
-
+

+ Sizes are advisory: Docker volumes are not capped. +

+ +
+ )} + + {/* ---- File systems (EFS) ---- */} + {!isVM && ( +
+ Manage file systems + + } + > +
+ {fileSystems.error ? ( + fileSystems.mutate()} + /> + ) : fileSystems.data?.length === 0 ? ( +

+ You have no file systems.{" "} + + Create a file system + {" "} + to share files between instances. +

+ ) : ( + fsRows.length === 0 && ( +

+ No file systems mounted. +

+ ) + )} + {fsRows.map((f, i) => { + const fs = fsById(f.id); + return ( +
+ + + + + setFs(i, { mount: e.target.value })} + placeholder="/mnt/efs" + className="h-8 font-mono" + /> + + + + {fs?.read_only && ( +

+ This file system is read-only, so it is mounted + read-only. +

+ )} +
+ ); + })} + {(fileSystems.data?.length ?? 0) > 0 && ( +
+ +
+ )} +
+
+ )} {/* ---- Advanced ---- */}
@@ -649,12 +1225,21 @@ export function LaunchWizard() { help="The profile's role credentials are served to the instance by the metadata service (169.254.169.254)." >
- +
- + setMdEndpoint(v as "enabled" | "disabled") + } + > @@ -664,22 +1249,59 @@ export function LaunchWizard() { - - + setMdTokens(v as "optional" | "required") + } + disabled={mdEndpoint === "disabled"} + > - V2 only (token required) - V1 and V2 (token optional) + + V2 only (token required) + + + V1 and V2 (token optional) + - - setMdHops(e.target.value)} className="w-28" disabled={mdEndpoint === "disabled"} /> + + setMdHops(e.target.value)} + className="w-28" + disabled={mdEndpoint === "disabled"} + /> - + setMdTags(v as "enabled" | "disabled") + } + disabled={mdEndpoint === "disabled"} + > @@ -702,7 +1324,9 @@ export function LaunchWizard() { rows={7} value={userData} onChange={(e) => setUserData(e.target.value)} - placeholder={"#!/bin/sh\napt-get update && apt-get install -y curl"} + placeholder={ + "#!/bin/sh\napt-get update && apt-get install -y curl" + } className="font-mono text-[13px]" spellCheck={false} /> @@ -711,8 +1335,10 @@ export function LaunchWizard() {

- {image.name} is an application image: it runs its own entrypoint, so user data is written to - /var/lib/homecloud/user-data but not executed. Only keep-alive images run it. + {image.name} is an application image: it + runs its own entrypoint, so user data is written to + /var/lib/homecloud/user-data but not executed. Only + keep-alive images run it.

)} @@ -724,15 +1350,32 @@ export function LaunchWizard() {
- ) + ); } -function SummaryItem({ label, children }: { label: string; children: React.ReactNode }) { +function SummaryItem({ + label, + children, +}: { + label: string; + children: React.ReactNode; +}) { return (
{label}
{children}
- ) + ); } diff --git a/console/lib/demo/ids.ts b/console/lib/demo/ids.ts index 57a94848..29e14c6b 100644 --- a/console/lib/demo/ids.ts +++ b/console/lib/demo/ids.ts @@ -38,6 +38,8 @@ export const INSTANCE = { bastion: stableId("i-", "shop-bastion"), batch: stableId("i-", "shop-batch-worker"), dev: stableId("i-", "dev-sandbox"), + ledger: stableId("i-", "shop-ledger-vm"), + audit: stableId("i-", "audit-vm"), } export const AMI = { @@ -46,6 +48,8 @@ export const AMI = { alpine: stableId("ami-", "alpine-3.20"), amazonLinux: stableId("ami-", "amazon-linux-2023"), shopWeb: stableId("ami-", "shop-web-v14"), + ubuntuVm: stableId("ami-", "ubuntu-24.04-vm"), + debianVm: stableId("ami-", "debian-12-vm"), } export const KEY_PAIRS = ["shop-prod", "shop-dev", "alice-laptop"] diff --git a/console/lib/demo/svc/ec2.ts b/console/lib/demo/svc/ec2.ts index 8ee4d5bd..31e17742 100644 --- a/console/lib/demo/svc/ec2.ts +++ b/console/lib/demo/svc/ec2.ts @@ -6,6 +6,7 @@ import { ASG_GROUP_TAG, type CommandResult, type ConsoleOutput, + type Ec2Capabilities, type ElasticIP, type Image, type Instance, @@ -55,12 +56,17 @@ const TYPES: InstanceType[] = [ export const findType = (n: string) => TYPES.find((t) => t.name === n) const cat = (id: string, name: string, description: string, ref: string, keep_alive = true): Image => ({ - id, name, description, ref, platform: "linux", keep_alive, owner: "homecloud", state: "available", + id, name, description, ref, platform: "linux", keep_alive, owner: "homecloud", state: "available", virtualization: "container", +}) +const vmImage = (id: string, name: string, description: string, vm_base: string): Image => ({ + id, name, description, ref: "", platform: "linux", keep_alive: true, owner: "homecloud", state: "available", virtualization: "vm", vm_base, }) const CATALOG: Image[] = [ cat(AMI.ubuntu, "Ubuntu Server 24.04 LTS", "Canonical Ubuntu 24.04 (Noble Numbat)", "ubuntu:24.04"), cat("ami-ubuntu-22-04", "Ubuntu Server 22.04 LTS", "Canonical Ubuntu 22.04 (Jammy Jellyfish)", "ubuntu:22.04"), cat(AMI.debian, "Debian 12", "Debian GNU/Linux 12 (bookworm)", "debian:12"), + vmImage(AMI.ubuntuVm, "Ubuntu Server 24.04 LTS (VM)", "Canonical Ubuntu 24.04 (Noble Numbat) cloud image, booted as a virtual machine with its own kernel and cloud-init", "ubuntu-24.04"), + vmImage(AMI.debianVm, "Debian 12 (VM)", "Debian GNU/Linux 12 (bookworm) cloud image, booted as a virtual machine with its own kernel and cloud-init", "debian-12"), cat(AMI.amazonLinux, "Amazon Linux 2023", "Amazon Linux 2023 base image", "amazonlinux:2023"), cat("ami-rocky-9", "Rocky Linux 9", "Enterprise Linux compatible", "rockylinux:9"), cat("ami-fedora-41", "Fedora 41", "Fedora Linux 41", "fedora:41"), @@ -106,6 +112,7 @@ interface InstSpec { profile?: boolean terminated?: number reason?: string + virt?: Instance["virtualization"] } function mkInstance(o: InstSpec): Instance { @@ -139,6 +146,8 @@ function mkInstance(o: InstSpec): Instance { terminated_at: o.terminated ? ago(o.terminated) : undefined, tags: { Name: o.name, ...o.tags }, key_name: o.key, + virtualization: o.virt, + vm_user: o.virt ? "ubuntu" : undefined, iam_profile_arn: o.profile ? PROFILE : undefined, iam_profile_id: o.profile ? "AIPADEMOWEBROLE0000" : undefined, metadata_options: { http_tokens: o.profile ? "required" : "optional", http_endpoint: "enabled", hop_limit: o.profile ? 2 : 1, instance_metadata_tags: "disabled" }, @@ -183,6 +192,14 @@ function seed(): Ec2State { id: INSTANCE.dev, name: "dev-sandbox", image: AMI.debian, ref: "debian:12", type: "t3.micro", subnet: SUBNET.defaultA, ip: "172.31.3.44", sgs: [SG.defaultVpc], launched: 40 * DAY, state: "stopped", key: KEY_PAIRS[1], tags: { Environment: "dev", Owner: "alice" }, }), + mkInstance({ + id: INSTANCE.ledger, name: "shop-ledger-vm", image: AMI.ubuntuVm, ref: "", type: "t3.medium", subnet: SUBNET.privateB, ip: "10.0.12.77", sgs: [SG.web], launched: 6 * DAY, virt: "kvm", + key: KEY_PAIRS[0], tags: { ...PUB_TAGS, Role: "ledger" }, + }), + mkInstance({ + id: INSTANCE.audit, name: "audit-vm", image: AMI.debianVm, ref: "", type: "t3.small", subnet: SUBNET.defaultB, ip: "172.31.16.9", sgs: [SG.defaultVpc], launched: 2 * DAY, virt: "emulated", + key: KEY_PAIRS[1], tags: { Environment: "dev", Owner: "alice" }, + }), mkInstance({ id: stableId("i-", "shop-web-old"), name: "shop-web-old", image: AMI.amazonLinux, ref: "amazonlinux:2023", type: "t3.small", subnet: SUBNET.privateA, ip: "10.0.11.19", sgs: [SG.web], launched: 60 * DAY, state: "terminated", terminated: 3 * DAY, reason: "Client.UserInitiatedShutdown", tags: { ...PUB_TAGS, Role: "web", "note": "replaced by the ASG" }, @@ -380,6 +397,7 @@ export function launchInstances(inp: RunInstancesInput, extraTags: Tags = {}): I const inst: Instance = { id, name, arn: arn("ec2", `instance/${id}`), image_id: img.id, image_ref: img.ref, instance_type: type.name, vcpus: type.vcpus, memory_mb: type.memory_mb, state: "pending", vpc_id: sn.vpc_id, subnet_id: sn.id, availability_zone: sn.availability_zone, private_ip: ip, private_dns: dnsOf(ip), security_groups: sgs, volumes: attachments, file_systems: fsList, + virtualization: img.virtualization === "vm" ? "kvm" : undefined, vm_user: img.virtualization === "vm" ? "ubuntu" : undefined, user_data: inp.user_data || undefined, keep_alive: img.keep_alive, public_ports: {}, public_host: "localhost", launch_time: new Date().toISOString(), tags: { ...(name ? { Name: name } : {}), ...(inp.tags ?? {}), ...extraTags }, key_name: inp.key_name || undefined, iam_profile_arn: profileArn, iam_profile_id: profileArn ? "AIPA" + hex(16).toUpperCase() : undefined, @@ -439,8 +457,31 @@ function finishTerminateNow(s: Ec2State, i: Instance) { const FAKE_PRIVATE_KEY = (name: string) => `-----BEGIN OPENSSH PRIVATE KEY-----\ndemo-not-a-real-private-key-${name}\nThis is placeholder text generated by the HomeCloud demo.\nInstall HomeCloud to create real key pairs.\n-----END OPENSSH PRIVATE KEY-----\n` +function vmLog(i: Instance, t: (n: number) => string): string { + const slow = i.virtualization === "emulated" + const k = (n: number) => `[${(n * (slow ? 9 : 1)).toFixed(6).padStart(12)}]` + const lines = [ + `[homecloud] ${t(0)} starting virtual machine ${i.id} (${i.instance_type}, ${i.virtualization === "kvm" ? "KVM acceleration" : "emulated, no /dev/kvm"})`, + `${k(0)} Linux version 6.8.0-45-generic (buildd@lcy02-amd64-044) #45-Ubuntu SMP PREEMPT_DYNAMIC`, + `${k(0.02)} Command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-45-generic root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyS0`, + `${k(0.4)} virtio_net virtio0 enp0s2: renamed from eth0`, + `${k(1.1)} EXT4-fs (vda1): mounted filesystem with ordered data mode.`, + `${k(2.3)} systemd[1]: Reached target Basic System.`, + `Cloud-init v. 24.2 running 'init-local' at ${t(9)}. Up ${slow ? "41.2" : "4.8"} seconds.`, + `ci-info: eth0: True ${i.private_ip} 255.255.255.0 global`, + `Cloud-init v. 24.2 running 'modules:config' at ${t(14)}. Up ${slow ? "58.0" : "9.6"} seconds.`, + ...(i.user_data ? i.user_data.split("\n").filter((l) => l.trim() && !l.startsWith("#")).slice(0, 6).map((l) => `+ ${l}`) : []), + `Cloud-init v. 24.2 finished at ${t(19)}. Datasource DataSourceNoCloud. Up ${slow ? "73.4" : "14.1"} seconds`, + `Ubuntu 24.04.1 LTS ${i.name} ttyS0`, + "", + `${i.name} login:`, + ] + return lines.join("\n") + "\n" +} + function consoleLog(i: Instance): string { const t = (n: number) => new Date(new Date(i.launch_time).getTime() + n * 1000).toISOString().replace("T", " ").slice(0, 19) + if (i.virtualization) return vmLog(i, t) const lines = [ `[homecloud] ${t(0)} creating instance ${i.id} (${i.instance_type}) from ${i.image_ref}`, `[homecloud] ${t(1)} network ${i.vpc_id} ${i.subnet_id} address ${i.private_ip}`, @@ -581,6 +622,7 @@ function routes(r: Router) { r.post(`${I}/:id/image`, ({ params, body }) => createImage(instById(params.id), body?.name, body?.description)) r.get("/api/v1/ec2/instance-types", () => TYPES) + r.get("/api/v1/ec2/capabilities", (): Ec2Capabilities => ({ vm: "kvm" })) // ---- images ---- const IM = "/api/v1/ec2/images" diff --git a/console/lib/types/ec2.ts b/console/lib/types/ec2.ts index adabc943..f85f6ec8 100644 --- a/console/lib/types/ec2.ts +++ b/console/lib/types/ec2.ts @@ -42,6 +42,15 @@ export interface Instance { iam_profile_arn?: string iam_profile_id?: string metadata_options?: MetadataOptions + /** VM instances: "kvm" (hardware accelerated) or "emulated" (no /dev/kvm, slow). Absent for containers. */ + virtualization?: "kvm" | "emulated" | (string & {}) + vm_user?: string +} + +/** What this host can run; GET /api/v1/ec2/capabilities. */ +export interface Ec2Capabilities { + /** "kvm" = VMs accelerated, "emulated" = no /dev/kvm (slow), "unavailable" */ + vm: "kvm" | "emulated" | "unavailable" | (string & {}) } /** Instance metadata service (IMDS) options. */ @@ -72,6 +81,9 @@ export interface Image { state: string created_at?: string source_instance?: string + /** "vm" (own kernel, QEMU guest) or "container" */ + virtualization?: "vm" | "container" | (string & {}) + vm_base?: string } export interface Volume { @@ -100,6 +112,8 @@ export interface RunInstancesInput { tags?: Tags volumes?: { volume_id?: string; size_gb?: number; mount_path: string; delete_on_termination?: boolean }[] file_systems?: FileSystemMount[] + /** VM images only: root disk size */ + root_volume?: { size_gb?: number; delete_on_termination?: boolean } key_name?: string /** instance profile name or ARN */ iam_instance_profile?: string diff --git a/pages/demo/404.html b/pages/demo/404.html index 61a9b89d..6ee26898 100644 --- a/pages/demo/404.html +++ b/pages/demo/404.html @@ -1 +1 @@ -404: This page could not be found.HomeCloud Console

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.HomeCloud Console

404

This page could not be found.

\ No newline at end of file diff --git a/pages/demo/404/index.html b/pages/demo/404/index.html index 61a9b89d..6ee26898 100644 --- a/pages/demo/404/index.html +++ b/pages/demo/404/index.html @@ -1 +1 @@ -404: This page could not be found.HomeCloud Console

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.HomeCloud Console

404

This page could not be found.

\ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js b/pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js deleted file mode 100644 index e7309faf..00000000 --- a/pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1002],{861:(e,t,r)=>{r.d(t,{b:()=>s,s:()=>i});var n=r(12115),o=r(97602),a=r(95155),i=n.forwardRef((e,t)=>(0,a.jsx)(o.sG.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));i.displayName="VisuallyHidden";var s=i},2138:(e,t,r)=>{r.d(t,{E:()=>l,F:()=>a,I:()=>L,M:()=>s,O:()=>p,R:()=>i,S:()=>J,U:()=>f,a:()=>c,b:()=>b,c:()=>S,d:()=>q,e:()=>h,f:()=>H,g:()=>V,h:()=>d,i:()=>m,j:()=>P,k:()=>U,m:()=>g,n:()=>u,o:()=>$,p:()=>x,q:()=>K,r:()=>N,s:()=>I,t:()=>X,u:()=>j});var n=r(12115),o=Object.prototype.hasOwnProperty;let a=0,i=1,s=2,l=3,d=4,c=new WeakMap,u=()=>{},f=u(),p=Object,m=e=>e===f,h=e=>"function"==typeof e,g=(e,t)=>({...e,...t}),b=e=>h(e.then),v={},y={},w="undefined",x=typeof window!=w,E=typeof document!=w,k=x&&"Deno"in window,S=(e,t)=>{let r=c.get(e);return[()=>!m(t)&&e.get(t)||v,n=>{if(!m(t)){let o=e.get(t);t in y||(y[t]=o),r[5](t,g(o,n),o||v)}},r[6],()=>!m(t)&&t in y?y[t]:!m(t)&&e.get(t)||v]},R=!0,[C,T]=x&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[u,u],O={initFocus:e=>(E&&document.addEventListener("visibilitychange",e),C("focus",e),()=>{E&&document.removeEventListener("visibilitychange",e),T("focus",e)}),initReconnect:e=>{let t=()=>{R=!0,e()},r=()=>{R=!1};return C("online",t),C("offline",r),()=>{T("online",t),T("offline",r)}}},P=!n.useId,L=!x||k,N=e=>x&&typeof window.requestAnimationFrame!=w?window.requestAnimationFrame(e):setTimeout(e,1),j=L?n.useEffect:n.useLayoutEffect,z="undefined"!=typeof navigator&&navigator.connection,A=!L&&z&&(["slow-2g","2g"].includes(z.effectiveType)||z.saveData),D=new WeakMap,M=(e,t)=>e==="[object ".concat(t,"]"),B=0,_=e=>{let t,r,n=typeof e,o=p.prototype.toString.call(e),a=M(o,"Date"),i=M(o,"RegExp"),s=M(o,"Object");if(p(e)!==e||a||i)t=a?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=D.get(e))return t;if(t=++B+"~",D.set(e,t),Array.isArray(e)){for(r=0,t="@";r{if(h(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?_(e):"",t]},W=0,V=()=>++W;async function H(){for(var e=arguments.length,t=Array(e),r=0;r{let t=y[o];return(h(l.revalidate)?l.revalidate(i().data,e):!1!==l.revalidate)&&(delete x[o],delete E[o],t&&t[0])?t[0](s).then(()=>i().data):i().data};if(t.length<3)return k();let R=a,C=!1,T=V();w[o]=[T,0];let O=!m(p),P=i(),L=P.data,N=P._c,j=m(N)?L:N;if(O&&g({data:p=h(p)?p(j,L):p,_c:j}),h(R))try{R=R(j)}catch(e){r=e,C=!0}if(R&&b(R)){let e;if(R=await R.catch(e=>{r=e,C=!0}),T!==w[o][0]){if(C)throw r;return R}C&&O&&(e=r,"function"==typeof u?u(e):!1!==u)&&(d=!0,g({data:j,_c:f}))}if(d&&!C&&(h(d)?g({data:d(R,j),error:f,_c:f}):g({data:R,error:f,_c:f})),w[o][1]=V(),Promise.resolve(k()).then(()=>{g({_c:f})}),C){if(v)throw r;return}return R}}let F=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},Y=(e,t)=>{if(!c.has(e)){let r=g(O,t),n=Object.create(null),o=H.bind(f,e),s=u,l=Object.create(null),p=(e,t)=>{let r=l[e]||[];return l[e]=r,r.push(t),()=>{let e=r.indexOf(t);e>=0&&(r[e]=r[r.length-1],r.pop())}},m=(t,r,n)=>{e.set(t,r);let o=l[t];if(o)for(let e of o)e(r,n)},h=t=>{let r=c.get(e),[,o,a,i]=r,s=V();for(let e in r[8]++,a)delete a[e];for(let e in i)delete i[e];for(let e in o)o[e]=[s,s];let u={};for(let t of[...e.keys()]){let r=e.get(t);e.delete(t);let n=l[t];if(n)for(let e of n)e(u,r)}let f=!t||!1!==t.revalidate;for(let e in n){let t=n[e];for(let e=0;e{if(!c.has(e)&&(c.set(e,[n,Object.create(null),Object.create(null),Object.create(null),o,m,p,h,0]),!L)){let t=r.initFocus(setTimeout.bind(f,F.bind(f,n,a))),o=r.initReconnect(setTimeout.bind(f,F.bind(f,n,i)));s=()=>{t&&t(),o&&o(),c.delete(e)}}};return b(),[e,o,b,s,h]}let r=c.get(e);return[e,r[4],f,f,r[7]]},[$,U,,,G]=Y(new Map),q=g({onLoadingSlow:u,onSuccess:u,onError:u,onErrorRetry:(e,t,r,n,o)=>{let a=r.errorRetryCount,i=o.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(m(a)||!(i>a))&&setTimeout(n,s,o)},onDiscarded:u,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:A?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:A?5e3:3e3,compare:function e(t,r){var n,a;if(t===r)return!0;if(t&&r&&(n=t.constructor)===r.constructor){if(n===Date)return t.getTime()===r.getTime();if(n===RegExp)return t.toString()===r.toString();if(n===Array){if((a=t.length)===r.length)for(;a--&&e(t[a],r[a]););return -1===a}if(!n||"object"==typeof t){for(n in a=0,t)if(o.call(t,n)&&++a&&!o.call(r,n)||!(n in r)||!e(t[n],r[n]))return!1;return Object.keys(r).length===a}}return t!=t&&r!=r},isPaused:()=>!1,cache:$,mutate:U,unload:G,fallback:{}},{isOnline:()=>R,isVisible:()=>{let e=E&&document.visibilityState;return m(e)||"hidden"!==e}}),X=(e,t)=>{let r=g(e,t);if(t){let{use:n,fallback:o,cacheData:a}=e,{use:i,fallback:s,cacheData:l}=t;n&&i&&(r.use=n.concat(i)),o&&s&&(r.fallback=g(o,s)),a&&l&&(r.cacheData=g(a,l))}return r},K=(0,n.createContext)({}),J=e=>{let{value:t}=e,r=(0,n.useContext)(K),o=h(t),a=(0,n.useMemo)(()=>o?t(r):t,[o,r,t]),i=(0,n.useMemo)(()=>o?a:X(r,a),[o,r,a]),s=a&&a.provider,l=(0,n.useRef)(f);s&&!l.current&&(l.current=Y(s(i.cache||$),a));let d=l.current;return d&&(i.cache=d[0],i.mutate=d[1],i.unload=d[4]),j(()=>{if(d)return d[2]&&d[2](),d[3]},[]),(0,n.createElement)(K.Provider,g(e,{value:i}))}},2821:(e,t,r)=>{function n(){for(var e,t,r=0,n="",o=arguments.length;rn,A:()=>o});let o=n},3468:(e,t,r)=>{r.d(t,{A:()=>i,q:()=>a});var n=r(12115),o=r(95155);function a(e,t){let r=n.createContext(t),a=e=>{let{children:t,...a}=e,i=n.useMemo(()=>a,Object.values(a));return(0,o.jsx)(r.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(o){let a=n.useContext(r);if(a)return a;if(void 0!==t)return t;throw Error(`\`${o}\` must be used within \`${e}\``)}]}function i(e,t=[]){let r=[],a=()=>{let t=r.map(e=>n.createContext(e));return function(r){let o=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])}};return a.scopeName=e,[function(t,a){let i=n.createContext(a),s=r.length;r=[...r,a];let l=t=>{let{scope:r,children:a,...l}=t,d=r?.[e]?.[s]||i,c=n.useMemo(()=>l,Object.values(l));return(0,o.jsx)(d.Provider,{value:c,children:a})};return l.displayName=t+"Provider",[l,function(r,o){let l=o?.[e]?.[s]||i,d=n.useContext(l);if(d)return d;if(void 0!==a)return a;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let o=r.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}(a,...t)]}},4129:(e,t,r)=>{r.d(t,{N:()=>o});var n=r(12115),o=globalThis?.document?n.useLayoutEffect:()=>{}},14806:(e,t,r)=>{e.exports=r(30125)},18720:(e,t,r)=>{r.d(t,{l$:()=>w,oR:()=>h});var n=r(12115),o=r(47650),a=Array(12).fill(0),i=e=>{let{visible:t,className:r}=e;return n.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":t},n.createElement("div",{className:"sonner-spinner"},a.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(t)}))))},s=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),f=1,p=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:f++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let o=e instanceof Promise?e:e(),a=void 0!==r,i,s=o.then(async e=>{if(i=["resolve",e],n.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(m(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,o="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description;this.create({id:r,type:"error",message:n,description:o})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:o})}}).catch(async e=>{if(i=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:o})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===i[0]?t(i[1]):e(i[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||f++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},m=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,h=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||f++;return p.addToast({title:e,...t,id:r}),r},{success:p.success,info:p.info,warning:p.warning,error:p.error,custom:p.custom,message:p.message,promise:p.promise,dismiss:p.dismiss,loading:p.loading},{getHistory:()=>p.toasts,getToasts:()=>p.getActiveToasts()});function g(e){return void 0!==e.label}function b(){for(var e=arguments.length,t=Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"undefined"==typeof document)return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var v=e=>{var t,r,o,a,f,p,m,h,v,y,w;let{invert:x,toast:E,unstyled:k,interacting:S,setHeights:R,visibleToasts:C,heights:T,index:O,toasts:P,expanded:L,removeToast:N,defaultRichColors:j,closeButton:z,style:A,cancelButtonStyle:D,actionButtonStyle:M,className:B="",descriptionClassName:_="",duration:I,position:W,gap:V,loadingIcon:H,expandByDefault:F,classNames:Y,icons:$,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:G}=e,[q,X]=n.useState(null),[K,J]=n.useState(null),[Z,Q]=n.useState(!1),[ee,et]=n.useState(!1),[er,en]=n.useState(!1),[eo,ea]=n.useState(!1),[ei,es]=n.useState(!1),[el,ed]=n.useState(0),[ec,eu]=n.useState(0),ef=n.useRef(E.duration||I||4e3),ep=n.useRef(null),em=n.useRef(null),eh=0===O,eg=O+1<=C,eb=E.type,ev=!1!==E.dismissible,ey=E.className||"",ew=E.descriptionClassName||"",ex=n.useMemo(()=>T.findIndex(e=>e.toastId===E.id)||0,[T,E.id]),eE=n.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:z},[E.closeButton,z]),ek=n.useMemo(()=>E.duration||I||4e3,[E.duration,I]),eS=n.useRef(0),eR=n.useRef(0),eC=n.useRef(0),eT=n.useRef(null),[eO,eP]=W.split("-"),eL=n.useMemo(()=>T.reduce((e,t,r)=>r>=ex?e:e+t.height,0),[T,ex]),eN=(()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),ej=E.invert||x,ez="loading"===eb;eR.current=n.useMemo(()=>ex*V+eL,[ex,eL]),n.useEffect(()=>{ef.current=ek},[ek]),n.useEffect(()=>{Q(!0)},[]),n.useEffect(()=>{let e=em.current;if(e){let t=e.getBoundingClientRect().height;return eu(t),R(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>R(e=>e.filter(e=>e.toastId!==E.id))}},[R,E.id]),n.useLayoutEffect(()=>{if(!Z)return;let e=em.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,eu(r),R(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:r}:e):[{toastId:E.id,height:r,position:E.position},...e])},[Z,E.title,E.description,R,E.id]);let eA=n.useCallback(()=>{et(!0),ed(eR.current),R(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{N(E)},200)},[E,N,R,eR]);return n.useEffect(()=>{let e;if((!E.promise||"loading"!==eb)&&E.duration!==1/0&&"loading"!==E.type)return L||S||G&&eN?(()=>{if(eC.current{var e;null==(e=E.onAutoClose)||e.call(E,E),eA()},ef.current)),()=>clearTimeout(e)},[L,S,E,eb,G,eN,eA]),n.useEffect(()=>{E.delete&&eA()},[eA,E.delete]),n.createElement("li",{tabIndex:0,ref:em,className:b(B,ey,null==Y?void 0:Y.toast,null==(t=null==E?void 0:E.classNames)?void 0:t.toast,null==Y?void 0:Y.default,null==Y?void 0:Y[eb],null==(r=null==E?void 0:E.classNames)?void 0:r[eb]),"data-sonner-toast":"","data-rich-colors":null!=(o=E.richColors)?o:j,"data-styled":!(E.jsx||E.unstyled||k),"data-mounted":Z,"data-promise":!!E.promise,"data-swiped":ei,"data-removed":ee,"data-visible":eg,"data-y-position":eO,"data-x-position":eP,"data-index":O,"data-front":eh,"data-swiping":er,"data-dismissible":ev,"data-type":eb,"data-invert":ej,"data-swipe-out":eo,"data-swipe-direction":K,"data-expanded":!!(L||F&&Z),style:{"--index":O,"--toasts-before":O,"--z-index":P.length-O,"--offset":"".concat(ee?el:eR.current,"px"),"--initial-height":F?"auto":"".concat(ec,"px"),...A,...E.style},onDragEnd:()=>{en(!1),X(null),eT.current=null},onPointerDown:e=>{ez||!ev||(ep.current=new Date,ed(eR.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(en(!0),eT.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(eo||!ev)return;eT.current=null;let o=Number((null==(e=em.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=em.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=new Date().getTime()-(null==(r=ep.current)?void 0:r.getTime()),s="x"===q?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11){ed(eR.current),null==(n=E.onDismiss)||n.call(E,E),J("x"===q?o>0?"right":"left":a>0?"down":"up"),eA(),ea(!0),es(!1);return}en(!1),X(null)},onPointerMove:t=>{var r,n,o,a;if(!eT.current||!ev||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=t.clientY-eT.current.y,s=t.clientX-eT.current.x,l=null!=(n=e.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(W);!q&&(Math.abs(s)>1||Math.abs(i)>1)&&X(Math.abs(s)>Math.abs(i)?"x":"y");let d={x:0,y:0};"y"===q?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(d.y=i):"x"===q&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(d.x=s),(Math.abs(d.x)>0||Math.abs(d.y)>0)&&es(!0),null==(o=em.current)||o.style.setProperty("--swipe-amount-x","".concat(d.x,"px")),null==(a=em.current)||a.style.setProperty("--swipe-amount-y","".concat(d.y,"px"))}},eE&&!E.jsx?n.createElement("button",{"aria-label":U,"data-disabled":ez,"data-close-button":!0,onClick:ez||!ev?()=>{}:()=>{var e;eA(),null==(e=E.onDismiss)||e.call(E,E)},className:b(null==Y?void 0:Y.closeButton,null==(a=null==E?void 0:E.classNames)?void 0:a.closeButton)},null!=(f=null==$?void 0:$.close)?f:u):null,E.jsx||(0,n.isValidElement)(E.title)?E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title:n.createElement(n.Fragment,null,eb||E.icon||E.promise?n.createElement("div",{"data-icon":"",className:b(null==Y?void 0:Y.icon,null==(p=null==E?void 0:E.classNames)?void 0:p.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var e,t,r;return null!=$&&$.loading?n.createElement("div",{className:b(null==Y?void 0:Y.loader,null==(e=null==E?void 0:E.classNames)?void 0:e.loader,"sonner-loader"),"data-visible":"loading"===eb},$.loading):H?n.createElement("div",{className:b(null==Y?void 0:Y.loader,null==(t=null==E?void 0:E.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===eb},H):n.createElement(i,{className:b(null==Y?void 0:Y.loader,null==(r=null==E?void 0:E.classNames)?void 0:r.loader),visible:"loading"===eb})}():null,"loading"!==E.type?E.icon||(null==$?void 0:$[eb])||(e=>{switch(e){case"success":return s;case"info":return d;case"warning":return l;case"error":return c;default:return null}})(eb):null):null,n.createElement("div",{"data-content":"",className:b(null==Y?void 0:Y.content,null==(m=null==E?void 0:E.classNames)?void 0:m.content)},n.createElement("div",{"data-title":"",className:b(null==Y?void 0:Y.title,null==(h=null==E?void 0:E.classNames)?void 0:h.title)},"function"==typeof E.title?E.title():E.title),E.description?n.createElement("div",{"data-description":"",className:b(_,ew,null==Y?void 0:Y.description,null==(v=null==E?void 0:E.classNames)?void 0:v.description)},"function"==typeof E.description?E.description():E.description):null),(0,n.isValidElement)(E.cancel)?E.cancel:E.cancel&&g(E.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||D,onClick:e=>{var t,r;g(E.cancel)&&ev&&(null==(r=(t=E.cancel).onClick)||r.call(t,e),eA())},className:b(null==Y?void 0:Y.cancelButton,null==(y=null==E?void 0:E.classNames)?void 0:y.cancelButton)},E.cancel.label):null,(0,n.isValidElement)(E.action)?E.action:E.action&&g(E.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||M,onClick:e=>{var t,r;g(E.action)&&(null==(r=(t=E.action).onClick)||r.call(t,e),e.defaultPrevented||eA())},className:b(null==Y?void 0:Y.actionButton,null==(w=null==E?void 0:E.classNames)?void 0:w.actionButton)},E.action.label):null))};function y(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}var w=(0,n.forwardRef)(function(e,t){let{invert:r,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:l,className:d,offset:c,mobileOffset:u,theme:f="light",richColors:m,duration:h,style:g,visibleToasts:b=3,toastOptions:w,dir:x=y(),gap:E=14,loadingIcon:k,icons:S,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:C}=e,[T,O]=n.useState([]),P=n.useMemo(()=>Array.from(new Set([a].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,a]),[L,N]=n.useState([]),[j,z]=n.useState(!1),[A,D]=n.useState(!1),[M,B]=n.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=n.useRef(null),I=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=n.useRef(null),V=n.useRef(!1),H=n.useCallback(e=>{O(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||p.dismiss(e.id),t.filter(t=>{let{id:r}=t;return r!==e.id})})},[]);return n.useEffect(()=>p.subscribe(e=>{if(e.dismiss)return void O(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));setTimeout(()=>{o.flushSync(()=>{O(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),n.useEffect(()=>{if("system"!==f)return void B(f);if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",e=>{let{matches:t}=e;B(t?"dark":"light")})}catch(t){e.addListener(e=>{let{matches:t}=e;try{B(t?"dark":"light")}catch(e){console.error(e)}})}},[f]),n.useEffect(()=>{T.length<=1&&z(!1)},[T]),n.useEffect(()=>{let e=e=>{var t,r;i.every(t=>e[t]||e.code===t)&&(z(!0),null==(t=_.current)||t.focus()),"Escape"===e.code&&(document.activeElement===_.current||null!=(r=_.current)&&r.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),n.useEffect(()=>{if(_.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,V.current=!1)}},[_.current]),n.createElement("section",{ref:t,"aria-label":"".concat(R," ").concat(I),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((t,o)=>{var a;let i,[f,p]=t.split("-");return T.length?n.createElement("ol",{key:t,dir:"auto"===x?y():x,tabIndex:-1,ref:_,className:d,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":f,"data-lifted":j&&T.length>1&&!s,"data-x-position":p,style:{"--front-toast-height":"".concat((null==(a=L[0])?void 0:a.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(E,"px"),...g,...(i={},[c,u].forEach((e,t)=>{let r=1===t,n=r?"--mobile-offset":"--offset",o=r?"16px":"32px";function a(e){["top","right","bottom","left"].forEach(t=>{i["".concat(n,"-").concat(t)]="number"==typeof e?"".concat(e,"px"):e})}"number"==typeof e||"string"==typeof e?a(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?i["".concat(n,"-").concat(t)]=o:i["".concat(n,"-").concat(t)]="number"==typeof e[t]?"".concat(e[t],"px"):e[t]}):a(o)}),i)},onBlur:e=>{V.current&&!e.currentTarget.contains(e.relatedTarget)&&(V.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||V.current||(V.current=!0,W.current=e.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{A||z(!1)},onDragEnd:()=>z(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||D(!0)},onPointerUp:()=>D(!1)},T.filter(e=>!e.position&&0===o||e.position===t).map((o,a)=>{var i,d;return n.createElement(v,{key:o.id,icons:S,index:a,toast:o,defaultRichColors:m,duration:null!=(i=null==w?void 0:w.duration)?i:h,className:null==w?void 0:w.className,descriptionClassName:null==w?void 0:w.descriptionClassName,invert:r,visibleToasts:b,closeButton:null!=(d=null==w?void 0:w.closeButton)?d:l,interacting:A,position:t,style:null==w?void 0:w.style,unstyled:null==w?void 0:w.unstyled,classNames:null==w?void 0:w.classNames,cancelButtonStyle:null==w?void 0:w.cancelButtonStyle,actionButtonStyle:null==w?void 0:w.actionButtonStyle,removeToast:H,toasts:T.filter(e=>e.position==o.position),heights:L.filter(e=>e.position==o.position),setHeights:N,expandByDefault:s,gap:E,loadingIcon:k,expanded:j,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))})},20063:(e,t,r)=>{var n=r(47260);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},27811:(e,t,r)=>{let n;r.d(t,{S:()=>h,u:()=>g});var o=r(12115),a=r(14806),i=r(2138);let s=i.p&&window.__SWR_DEVTOOLS_USE__,l=(s?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,r,n)=>{let o=r&&((...e)=>{let[n]=(0,i.s)(t),[,,,o]=i.a.get(i.o);if(n.startsWith("$inf$"))return r(...e);let a=o[n];return(0,i.i)(a)?r(...e):(delete o[n],a)});return e(t,o,n)});s&&(window.__SWR_DEVTOOLS_REACT__=o);let d=o.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),c={dedupe:!0},u=(e,t,r)=>{var n;return!!t&&(null==(n=e.get(t))?void 0:n.has(r))===!0},f=(e,t,r)=>{if(!t)return;let n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(r)},p=Promise.resolve(i.U);p.status="fulfilled",p.value=i.U;let m=()=>i.n,h=i.O.defineProperty(i.S,"defaultValue",{value:i.d}),g=(n=(e,t,r)=>{let{cache:n,compare:s,suspense:l,fallbackData:h,revalidateOnMount:g,revalidateIfStale:b,refreshInterval:v,refreshWhenHidden:y,refreshWhenOffline:w,keepPreviousData:x,strictServerPrefetchWarning:E}=r,[k,S,R,C]=i.a.get(n),[T,O]=(0,i.s)(e),P=(0,o.useRef)(!1),L=(0,o.useRef)(!1),N=(0,o.useRef)(T),j=(0,o.useRef)(t),z=(0,o.useRef)(r),A=()=>z.current.isVisible()&&z.current.isOnline(),[D,M,B,_]=(0,i.c)(n,T),I=(0,o.useRef)({}).current,W=(0,i.i)(h)?(0,i.i)(r.fallback)?i.U:r.fallback[T]:h,V=r.cacheData,H=T?null==V?void 0:V[T]:i.U,F=T?C[T]:i.U,Y=(0,i.i)(F)&&!(0,i.i)(H),$=Y?H:F,U=(e,t)=>{for(let r in I)if("data"===r){if(!s(e[r],t[r])&&(!(0,i.i)(e[r])||!s(eo,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},G=!P.current,q=(0,o.useMemo)(()=>{let e=D(),r=_(),n=e=>{let r=(0,i.m)(e);return(delete r._k,(()=>{if(!T||!t||z.current.isPaused())return!1;if(G&&!(0,i.i)(g))return g;let e=(0,i.i)(W)?r.data:W;return!(l&&Y&&(0,i.i)(e))&&((0,i.i)(e)||b)})())?{isValidating:!0,isLoading:!0,...r}:r},o=n(e),a=e===r?o:n(r),s=o;return[()=>{let e=n(D());return U(e,s)?(s.data=e.data,s.isLoading=e.isLoading,s.isValidating=e.isValidating,s.error=e.error,s):(s=e,e)},()=>a]},[n,T]),X=(0,a.useSyncExternalStore)((0,o.useCallback)(e=>B(T,(t,r)=>{U(r,t)||e()}),[n,T]),q[0],q[1]),K=k[T]&&k[T].length>0,J=X.data,Z=(0,i.i)(J)?W&&(0,i.b)(W)?d(W):W:J,Q=X.error,ee=(0,o.useRef)(Z),et=(0,o.useRef)(i.U),er=et.current;er||(et.current=er=new WeakMap);let en=(0,o.useRef)(null),eo=x?(0,i.i)(J)?(0,i.i)(ee.current)?Z:ee.current:J:Z,ea=T&&(0,i.i)(Z),ei=(0,o.useRef)(null);i.I||(0,a.useSyncExternalStore)(m,()=>(ei.current=!1,ei),()=>(ei.current=!0,ei));let es=ei.current;E&&es&&!l&&ea&&console.warn(`Missing pre-initiated data for serialized key "${T}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let el=!(!T||!t||z.current.isPaused())&&(!K||!!(0,i.i)(Q))&&(G&&!(0,i.i)(g)?g:(!l||!Y||!ea)&&(l?!(0,i.i)(Z)&&b:(0,i.i)(Z)||b)),ed=G&&el,ec=(0,i.i)(X.isValidating)?ed:X.isValidating,eu=(0,i.i)(X.isLoading)?ed:X.isLoading,ef=(0,o.useCallback)(async e=>{let t,n,o=j.current;if(!T||!o||L.current||z.current.isPaused())return!1;let a=!0,l=e||{},d=!R[T]||!l.dedupe,c=Y&&!u(er,V,T)&&!(0,i.i)($)&&(0,i.i)(D().data),p=()=>i.j?!L.current&&T===N.current&&P.current:T===N.current,m={isValidating:!1,isLoading:!1},h=()=>{M(m)},g=()=>{let e=R[T];e&&e[1]===n&&delete R[T]},b={isValidating:!0};(0,i.i)(D().data)&&(b.isLoading=!0);try{if(d&&(M(b),r.loadingTimeout&&(0,i.i)(D().data)&&setTimeout(()=>{a&&p()&&z.current.onLoadingSlow(T,r)},r.loadingTimeout),c&&f(er,V,T),R[T]=[c?$:o(O),(0,i.g)()],c&&C[T]&&delete C[T]),[t,n]=R[T],t=await t,d&&setTimeout(g,r.dedupingInterval),!R[T]||R[T][1]!==n)return d&&p()&&z.current.onDiscarded(T),!1;m.error=i.U;let e=S[T];if(!(0,i.i)(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return h(),d&&p()&&z.current.onDiscarded(T),!1;let l=D().data;m.data=s(l,t)?l:t,d&&p()&&z.current.onSuccess(t,T,r)}catch(r){g();let e=z.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(m.error=r,d&&p()&&(e.onError(r,T,e),(!0===t||(0,i.e)(t)&&t(r))&&(!z.current.revalidateOnFocus||!z.current.revalidateOnReconnect||A())&&e.onErrorRetry(r,T,e,e=>{let t=k[T];t&&t[0]&&t[0](i.E,e)},{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return a=!1,h(),!0},[T,n]),ep=(0,o.useCallback)((...e)=>(0,i.f)(n,N.current,...e),[]);if((0,i.u)(()=>{let e=en.current;e&&(en.current=null,f(er,e.cacheData,e.key),(0,i.i)(D().data)&&M({data:e.data,error:i.U,_k:e._k}),C[e.key]&&delete C[e.key])}),(0,i.u)(()=>{j.current=t,z.current=r,(0,i.i)(J)||(ee.current=J)}),(0,i.u)(()=>{if(t||!Y||(0,i.i)($)||u(er,V,T)||!(0,i.i)(D().data))return;f(er,V,T);let e=S[T];(({value:e,getCacheData:t,canCommit:r,setCache:n})=>{let o=e=>{r()&&(0,i.i)(t())&&n(e)};Promise.resolve(e).then(e=>{o({data:e,error:i.U})},e=>{o({error:e})})})({value:$,getCacheData:()=>D().data,canCommit:()=>!L.current&&T===N.current&&S[T]===e,setCache:e=>M({...e,_k:O})})}),(0,i.u)(()=>{if(!T)return;let e=ef.bind(i.U,c),t=0;z.current.revalidateOnFocus&&(t=Date.now()+z.current.focusThrottleInterval);let r=((e,t,r)=>{let n=t[e]||(t[e]=[]);return n.push(r),()=>{let e=n.indexOf(r);e>=0&&(n[e]=n[n.length-1],n.pop())}})(T,k,(r,n={})=>{if(r==i.F){let r=Date.now();z.current.revalidateOnFocus&&r>t&&A()&&(t=r+z.current.focusThrottleInterval,e())}else if(r==i.R)z.current.revalidateOnReconnect&&A()&&e();else if(r==i.M)return ef();else if(r==i.E)return ef(n);else if(r==i.h&&(ee.current=i.U,n.revalidate))return ef()});return L.current=!1,N.current=T,P.current=!0,M({_k:O}),el&&!R[T]&&((0,i.i)(Z)||i.I?e():(0,i.r)(e)),()=>{L.current=!0,r()}},[T]),(0,i.u)(()=>{let e;function t(){let t=(0,i.e)(v)?v(D().data):v;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!D().error&&(y||z.current.isVisible())&&(w||z.current.isOnline())?ef(c).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[v,y,w,T]),(0,o.useDebugValue)(eo),l){if(!i.j&&i.I&&ea&&(0,i.i)($))throw Error("Fallback data is required when using Suspense in SSR.");ea&&(j.current=t,z.current=r,L.current=!1);let e=!(0,i.i)($)&&ea,n=i.U;if(e&&Y?(Z=n=$&&(0,i.b)($)?d($):$,eo=n,i.I||(en.current={data:n,_k:O,key:T,cacheData:V})):d(e?ep($):p),!(0,i.i)(Q)&&ea)throw Q;let o=ea&&(0,i.i)(n)?ef(c):p;!(0,i.i)(eo)&&ea&&(o.status="fulfilled",o.value=!0),d(o)}return{mutate:ep,get data(){return I.data=!0,eo},get error(){return I.error=!0,Q},get isValidating(){return I.isValidating=!0,ec},get isLoading(){return I.isLoading=!0,eu}}},function(...e){let t=(()=>{let e=(0,o.useContext)(i.q);return(0,o.useMemo)(()=>(0,i.m)(i.d,e),[e])})(),[r,a,s]=(0,i.e)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],d=(0,i.t)(t,s),c=n,{use:u}=d,f=(u||[]).concat(l);for(let e=f.length;e--;)c=f[e](c);return c(r,a||d.fetcher||null,d)})},30125:(e,t,r)=>{var n=r(12115),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=n.useState,i=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=a({inst:{value:r,getSnapshot:t}}),o=n[0].inst,c=n[1];return s(function(){o.value=r,o.getSnapshot=t,d(o)&&c({inst:o})},[e,r,t]),i(function(){return d(o)&&c({inst:o}),e(function(){d(o)&&c({inst:o})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},32467:(e,t,r)=>{r.d(t,{DX:()=>i,xV:()=>l});var n=r(12115),o=r(94446),a=r(95155),i=n.forwardRef((e,t)=>{let{children:r,...o}=e,i=n.Children.toArray(r),l=i.find(d);if(l){let e=l.props.children,r=i.map(t=>t!==l?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,a.jsx)(s,{...o,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,a.jsx)(s,{...o,ref:t,children:r})});i.displayName="Slot";var s=n.forwardRef((e,t)=>{let{children:r,...a}=e;if(n.isValidElement(r)){let e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}(r);return n.cloneElement(r,{...function(e,t){let r={...t};for(let n in t){let o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props),ref:t?(0,o.t)(t,e):e})}return n.Children.count(r)>1?n.Children.only(null):null});s.displayName="SlotClone";var l=({children:e})=>(0,a.jsx)(a.Fragment,{children:e});function d(e){return n.isValidElement(e)&&e.type===l}},44831:(e,t,r)=>{r.d(t,{qW:()=>f});var n,o=r(12115),a=r(92556),i=r(97602),s=r(94446),l=r(70222),d=r(95155),c="dismissableLayer.update",u=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),f=o.forwardRef((e,t)=>{var r,f;let{disableOutsidePointerEvents:h=!1,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:v,onInteractOutside:y,onDismiss:w,...x}=e,E=o.useContext(u),[k,S]=o.useState(null),R=null!=(f=null==k?void 0:k.ownerDocument)?f:null==(r=globalThis)?void 0:r.document,[,C]=o.useState({}),T=(0,s.s)(t,e=>S(e)),O=Array.from(E.layers),[P]=[...E.layersWithOutsidePointerEventsDisabled].slice(-1),L=O.indexOf(P),N=k?O.indexOf(k):-1,j=E.layersWithOutsidePointerEventsDisabled.size>0,z=N>=L,A=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,l.c)(e),a=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!a.current){let t=function(){m("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",i.current),i.current=t,r.addEventListener("click",i.current,{once:!0})):t()}else r.removeEventListener("click",i.current);a.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",i.current)}},[r,n]),{onPointerDownCapture:()=>a.current=!0}}(e=>{let t=e.target,r=[...E.branches].some(e=>e.contains(t));z&&!r&&(null==b||b(e),null==y||y(e),e.defaultPrevented||null==w||w())},R),D=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,l.c)(e),a=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!a.current&&m("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{let t=e.target;![...E.branches].some(e=>e.contains(t))&&(null==v||v(e),null==y||y(e),e.defaultPrevented||null==w||w())},R);return!function(e,t=globalThis?.document){let r=(0,l.c)(e);o.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{N===E.layers.size-1&&(null==g||g(e),!e.defaultPrevented&&w&&(e.preventDefault(),w()))},R),o.useEffect(()=>{if(k)return h&&(0===E.layersWithOutsidePointerEventsDisabled.size&&(n=R.body.style.pointerEvents,R.body.style.pointerEvents="none"),E.layersWithOutsidePointerEventsDisabled.add(k)),E.layers.add(k),p(),()=>{h&&1===E.layersWithOutsidePointerEventsDisabled.size&&(R.body.style.pointerEvents=n)}},[k,R,h,E]),o.useEffect(()=>()=>{k&&(E.layers.delete(k),E.layersWithOutsidePointerEventsDisabled.delete(k),p())},[k,E]),o.useEffect(()=>{let e=()=>C({});return document.addEventListener(c,e),()=>document.removeEventListener(c,e)},[]),(0,d.jsx)(i.sG.div,{...x,ref:T,style:{pointerEvents:j?z?"auto":"none":void 0,...e.style},onFocusCapture:(0,a.m)(e.onFocusCapture,D.onFocusCapture),onBlurCapture:(0,a.m)(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:(0,a.m)(e.onPointerDownCapture,A.onPointerDownCapture)})});function p(){let e=new CustomEvent(c);document.dispatchEvent(e)}function m(e,t,r,n){let{discrete:o}=n,a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?(0,i.hO)(a,s):a.dispatchEvent(s)}f.displayName="DismissableLayer",o.forwardRef((e,t)=>{let r=o.useContext(u),n=o.useRef(null),a=(0,s.s)(t,n);return o.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,d.jsx)(i.sG.div,{...e,ref:a})}).displayName="DismissableLayerBranch"},53345:(e,t,r)=>{let n;r.d(t,{Mz:()=>eq,i3:()=>eK,UC:()=>eX,bL:()=>eG,Bk:()=>eN});var o=r(12115);let a=["top","right","bottom","left"],i=Math.min,s=Math.max,l=Math.round,d=Math.floor,c=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function f(e,t){return"function"==typeof e?e(t):e}function p(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return"x"===e?"y":"x"}function g(e){return"y"===e?"height":"width"}function b(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function v(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let y=["left","right"],w=["right","left"],x=["top","bottom"],E=["bottom","top"];function k(e){let t=p(e);return u[t]+e.slice(t.length)}function S(e){var t,r,n,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(r=e.right)?r:0,bottom:null!=(n=e.bottom)?n:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function R(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function C(e,t,r){let n,{reference:o,floating:a}=e,i=b(t),s=h(b(t)),l=g(s),d=p(t),c=o.x+o.width/2-a.width/2,u=o.y+o.height/2-a.height/2,f=o[l]/2-a[l]/2;switch(d){case"top":n={x:c,y:o.y-a.height};break;case"bottom":n={x:c,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:u};break;case"left":n={x:o.x-a.width,y:u};break;default:n={x:o.x,y:o.y}}let v=m(t);return v&&(n[s]+=f*("end"===v?1:-1)*(r&&"y"===i?-1:1)),n}async function T(e,t){var r;void 0===t&&(t={});let{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=f(t,e),h=S(m),g=s[p?"floating"===u?"reference":"floating":u],b=R(await a.getClippingRect({element:null==(r=await (null==a.isElement?void 0:a.isElement(g)))||r?g:g.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:l})),v="floating"===u?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),w=await (null==a.isElement?void 0:a.isElement(y))&&await (null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},x=R(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-x.top+h.top)/w.y,bottom:(x.bottom-b.bottom+h.bottom)/w.y,left:(b.left-x.left+h.left)/w.x,right:(x.right-b.right+h.right)/w.x}}let O=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=i.detectOverflow?i:{...i,detectOverflow:T},l=await (null==i.isRTL?void 0:i.isRTL(t)),d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=C(d,n,l),f=n,p=0,m={};for(let r=0;re[t]>=0)}let N=new Set(["left","top"]);async function j(e,t){let{placement:r,platform:n,elements:o}=e,a=await (null==n.isRTL?void 0:n.isRTL(o.floating)),i=p(r),s=m(r),l="y"===b(r),d=N.has(i)?-1:1,c=a&&l?-1:1,u=f(t,e),{mainAxis:h,crossAxis:g,alignmentAxis:v}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof v&&(g="end"===s?-1*v:v),l?{x:g*c,y:h*d}:{x:h*d,y:g*c}}function z(){return"undefined"!=typeof window}function A(e){return B(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function M(e){var t;return null==(t=(B(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function B(e){return!!z()&&(e instanceof Node||e instanceof D(e).Node)}function _(e){return!!z()&&(e instanceof Element||e instanceof D(e).Element)}function I(e){return!!z()&&(e instanceof HTMLElement||e instanceof D(e).HTMLElement)}function W(e){return!!z()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof D(e).ShadowRoot)}function V(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==o&&"contents"!==o}function H(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let F=/transform|translate|scale|rotate|perspective|filter/,Y=/paint|layout|strict|content/,$=e=>!!e&&"none"!==e;function U(e){let t=_(e)?X(e):e;return $(t.transform)||$(t.translate)||$(t.scale)||$(t.rotate)||$(t.perspective)||!G()&&($(t.backdropFilter)||$(t.filter))||F.test(t.willChange||"")||Y.test(t.contain||"")}function G(){return null==n&&(n="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n}function q(e){return/^(html|body|#document)$/.test(A(e))}function X(e){return D(e).getComputedStyle(e)}function K(e){return _(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if("html"===A(e))return e;let t=e.assignedSlot||e.parentNode||W(e)&&e.host||M(e);return W(t)?t.host:t}function Z(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=J(t);return q(r)?(t.ownerDocument||t).body:I(r)&&V(r)?r:e(r)}(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=D(o);if(!a)return t.concat(o,Z(o,[],r));{let e=Q(i);return t.concat(i,i.visualViewport||[],V(o)?o:[],e&&r?Z(e):[])}}function Q(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ee(e){let t=X(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=I(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=l(r)!==a||l(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function et(e){return _(e)?e:e.contextElement}function er(e){let t=et(e);if(!I(t))return c(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:a}=ee(t),i=(a?l(r.width):r.width)/n,s=(a?l(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}let en=c(0);function eo(e){let t=D(e);return G()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:en}function ea(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),i=et(e),s=c(1);t&&(n?_(n)&&(s=er(n)):s=er(e));let l=(void 0===(o=r)&&(o=!1),n&&o&&n===D(i))?eo(i):c(0),d=(a.left+l.x)/s.x,u=(a.top+l.y)/s.y,f=a.width/s.x,p=a.height/s.y;if(i&&n){let e=D(i),t=_(n)?D(n):n,r=e,o=Q(r);for(;o&&t!==r;){let e=er(o),t=o.getBoundingClientRect(),n=X(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;d*=e.x,u*=e.y,f*=e.x,p*=e.y,d+=a,u+=i,o=Q(r=D(o))}}return R({width:f,height:p,x:d,y:u})}function ei(e,t){let r=K(e).scrollLeft;return t?t.left+r:ea(M(e)).left+r}function es(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-ei(e,r),y:r.top+t.scrollTop}}function el(e,t,r){let n;if("viewport"===t||"layoutViewport"===t)n=function(e,t,r){void 0===r&&(r="viewport");let n="layoutViewport"===r,o=D(e),a=M(e),i=o.visualViewport,s=a.clientWidth,l=a.clientHeight,d=0,c=0;if(i){let e=!G()||"fixed"===t;n?e||(d=-i.offsetLeft,c=-i.offsetTop):(s=i.width,l=i.height,e&&(d=i.offsetLeft,c=i.offsetTop))}if(0>=ei(a)){let e=a.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-n),i="stable both-edges"===getComputedStyle(a).scrollbarGutter?o/2:o;i<=25&&(s-=i)}return{width:s,height:l,x:d,y:c}}(e,r,t);else if("document"===t)n=function(e){let t=K(e),r=e.ownerDocument.body,n=s(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=s(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),a=-t.scrollLeft+ei(e),i=-t.scrollTop;return"rtl"===X(r).direction&&(a+=s(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:a,y:i}}(M(e));else if(_(t))n=function(e,t){let r=ea(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=er(e),i=e.clientWidth*a.x,s=e.clientHeight*a.y;return{width:i,height:s,x:o*a.x,y:n*a.y}}(t,r);else{let r=eo(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return R(n)}function ed(e){return"static"===X(e).position}function ec(e,t){if(!I(e)||"fixed"===X(e).position)return null;if(t)return t(e);let r=e.offsetParent;return M(e)===r&&(r=r.ownerDocument.body),r}function eu(e,t){var r;let n=D(e);if(H(e))return n;if(!I(e)){let t=J(e);for(;t&&!q(t);){if(_(t)&&!ed(t))return t;t=J(t)}return n}let o=ec(e,t);for(;o&&(r=o,/^(table|td|th)$/.test(A(r)))&&ed(o);)o=ec(o,t);return o&&q(o)&&ed(o)&&!U(o)?n:o||function(e){let t=J(e);for(;I(t)&&!q(t);){if(U(t))return t;if(H(t))break;t=J(t)}return null}(e)||n}let ef=async function(e){let t=this.getOffsetParent||eu,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=I(t),o=M(t),a="fixed"===r,i=ea(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=c(0);if((n||!a)&&(("body"!==A(t)||V(o))&&(s=K(t)),n)){let e=ea(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!n&&o&&(l.x=ei(o));let d=!o||n||a?c(0):es(o,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},ep={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,a="fixed"===o,i=M(n),s=!!t&&H(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},d=c(1),u=c(0),f=I(n);if((f||!a)&&(("body"!==A(n)||V(i))&&(l=K(n)),f)){let e=ea(n);d=er(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let p=!i||f||a?c(0):es(i,l);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+p.x,y:r.y*d.y-l.scrollTop*d.y+u.y+p.y}},getDocumentElement:M,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[..."clippingAncestors"===r?H(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=Z(e,[],!1).filter(e=>_(e)&&"body"!==A(e)),o=null,a="fixed"===X(e).position,i=a?J(e):e;for(;_(i)&&!q(i);){let e=X(i),t=U(i),r=o?o.position:a?"fixed":"";t||"fixed"!==r&&("absolute"!==r||"static"!==e.position)?o=e:n=n.filter(e=>e!==i),i=J(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],l=el(t,a[0],o),d=l.top,c=l.right,u=l.bottom,f=l.left;for(let e=1;e({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:a,platform:l,elements:d,middlewareData:c}=t,{element:u,padding:p=0}=f(e,t)||{};if(null==u)return{};let v=S(p),y={x:r,y:n},w=h(b(o)),x=g(w),E=await l.getDimensions(u),k="y"===w,R=k?"clientHeight":"clientWidth",C=a.reference[x]+a.reference[w]-y[w]-a.floating[x],T=y[w]-a.reference[w],O=await (null==l.getOffsetParent?void 0:l.getOffsetParent(u)),P=O?O[R]:0;P&&await (null==l.isElement?void 0:l.isElement(O))||(P=d.floating[R]||a.floating[x]);let L=P/2-E[x]/2-1,N=i(v[k?"top":"left"],L),j=i(v[k?"bottom":"right"],L),z=P-E[x]-j,A=P/2-E[x]/2+(C/2-T/2),D=s(N,i(A,z)),M=!c.arrow&&null!=m(o)&&A!==D&&a.reference[x]/2-(A{t.current=e}),t}var eE=r(97602),ek=r(95155),eS=o.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...a}=e;return(0,ek.jsx)(eE.sG.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,ek.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eS.displayName="Arrow";var eR=r(94446),eC=r(3468),eT=r(70222),eO=r(4129),eP="Popper",[eL,eN]=(0,eC.A)(eP),[ej,ez]=eL(eP),eA=e=>{let{__scopePopper:t,children:r}=e,[n,a]=o.useState(null);return(0,ek.jsx)(ej,{scope:t,anchor:n,onAnchorChange:a,children:r})};eA.displayName=eP;var eD="PopperAnchor",eM=o.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...a}=e,i=ez(eD,r),s=o.useRef(null),l=(0,eR.s)(t,s);return o.useEffect(()=>{i.onAnchorChange((null==n?void 0:n.current)||s.current)}),n?null:(0,ek.jsx)(eE.sG.div,{...a,ref:l})});eM.displayName=eD;var eB="PopperContent",[e_,eI]=eL(eB),eW=o.forwardRef((e,t)=>{var r,n,a,l,c,u,S,R;let{__scopePopper:C,side:T="bottom",sideOffset:z=0,align:A="center",alignOffset:B=0,arrowPadding:_=0,avoidCollisions:I=!0,collisionBoundary:W=[],collisionPadding:V=0,sticky:H="partial",hideWhenDetached:F=!1,updatePositionStrategy:Y="optimized",onPlaced:$,...U}=e,G=ez(eB,C),[q,X]=o.useState(null),K=(0,eR.s)(t,e=>X(e)),[J,Q]=o.useState(null),ee=function(e){let[t,r]=o.useState(void 0);return(0,eO.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(J),er=null!=(S=null==ee?void 0:ee.width)?S:0,en=null!=(R=null==ee?void 0:ee.height)?R:0,eo="number"==typeof V?V:{top:0,right:0,bottom:0,left:0,...V},ei=Array.isArray(W)?W:[W],es=ei.length>0,el={padding:eo,boundary:ei.filter(eY),altBoundary:es},{refs:ed,floatingStyles:ec,placement:eu,isPositioned:ef,middlewareData:eS}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,f]=o.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=o.useState(n);ev(p,n)||m(n);let[h,g]=o.useState(null),[b,v]=o.useState(null),y=o.useCallback(e=>{e!==k.current&&(k.current=e,g(e))},[]),w=o.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),x=i||h,E=s||b,k=o.useRef(null),S=o.useRef(null),R=o.useRef(u),C=null!=d,T=ex(d),P=ex(a),L=ex(c),N=o.useCallback(()=>{if(!k.current||!S.current)return;let e={placement:t,strategy:r,middleware:p};P.current&&(e.platform=P.current),((e,t,r)=>{let n=new Map,o=null!=r?r:{},a={...ep,...o.platform,_c:n};return O(e,t,{...o,platform:a})})(k.current,S.current,e).then(e=>{let t={...e,isPositioned:!1!==L.current};j.current&&!ev(R.current,t)&&(R.current=t,eg.flushSync(()=>{f(t)}))})},[p,t,r,P,L]);eb(()=>{!1===c&&R.current.isPositioned&&(R.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[c]);let j=o.useRef(!1);eb(()=>(j.current=!0,()=>{j.current=!1}),[]),eb(()=>{if(x&&(k.current=x),E&&(S.current=E),x&&E){if(T.current)return T.current(x,E,N);N()}},[x,E,N,T,C]);let z=o.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:w}),[y,w]),A=o.useMemo(()=>({reference:x,floating:E}),[x,E]),D=o.useMemo(()=>{let e={position:r,left:0,top:0};if(!A.floating)return e;let t=ew(A.floating,u.x),n=ew(A.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...ey(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,A.floating,u.x,u.y]);return o.useMemo(()=>({...u,update:N,refs:z,elements:A,floatingStyles:D}),[u,N,z,A,D])}({strategy:"fixed",placement:T+("center"!==A?"-"+A:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r{a&&e.addEventListener("scroll",r),l&&e.addEventListener("resize",r)});let h=p&&u?function(e,t,r){let n,o=null,a=M(e);function l(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}function c(r,u){void 0===r&&(r=!1),void 0===u&&(u=1),l();let f=e.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(r||t(),!h||!g)return;let b=d(m),v=d(a.clientWidth-(p+h)),y={rootMargin:-b+"px "+-v+"px "+-d(a.clientHeight-(m+g))+"px "+-d(p)+"px",threshold:s(0,i(1,u))||1},w=!0;function x(t){let r=t[0].intersectionRatio;if(!em(f,e.getBoundingClientRect()))return c();if(r!==u){if(!w)return c();r?c(!1,r):n=setTimeout(()=>{c(!1,1e-7)},1e3)}w=!1}try{o=new IntersectionObserver(x,{...y,root:a.ownerDocument})}catch(e){o=new IntersectionObserver(x,y)}o.observe(e)}let u=D(e),f=()=>c(r);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),l()}}(p,r,l):null,g=-1,b=null;c&&(b=new ResizeObserver(e=>{let[n]=e;n&&n.target===p&&b&&t&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=b)||e.observe(t)})),r()}),p&&!f&&b.observe(p),t&&b.observe(t));let v=f?ea(e):null;return f&&function t(){let n=ea(e);v&&!em(v,n)&&r(),v=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;m.forEach(e=>{a&&e.removeEventListener("scroll",r),l&&e.removeEventListener("resize",r)}),null==h||h(),null==(e=b)||e.disconnect(),b=null,f&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===Y})},elements:{reference:G.anchor},middleware:[((e,t)=>{let r=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:a,placement:i,middlewareData:s}=t,l=await j(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({mainAxis:z+en,alignmentAxis:B}),I&&((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=f(e,t),p={x:r,y:n},m=await a.detectOverflow(t,u),g=b(o),v=h(g),y=p[v],w=p[g],x=(e,t)=>s(t+m["y"===e?"top":"left"],i(t,t-m["y"===e?"bottom":"right"]));l&&(y=x(v,y)),d&&(w=x(g,w));let E=c.fn({...t,[v]:y,[g]:w});return{...E,data:{x:E.x-r,y:E.y-n,enabled:{[v]:l,[g]:d}}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?((e,t)=>({fn:function(e){return void 0===e&&(e={}),{options:e,fn(t){var r,n,o,a;let{x:i,y:s,placement:l,rects:d,middlewareData:c}=t,{offset:u=0,mainAxis:m=!0,crossAxis:g=!0}=f(e,t),v={x:i,y:s},y=b(l),w=h(y),x=v[w],E=v[y],k=f(u,t),S="number"==typeof k?{mainAxis:k,crossAxis:0}:{mainAxis:null!=(r=k.mainAxis)?r:0,crossAxis:null!=(n=k.crossAxis)?n:0};if(m){let e="y"===w?"height":"width",t=d.reference[w]-d.floating[e]+S.mainAxis,r=d.reference[w]+d.reference[e]-S.mainAxis;xr&&(x=r)}if(g){let e="y"===w?"width":"height",t=N.has(p(l)),r=d.reference[y]-d.floating[e]+(t&&(null==(o=c.offset)?void 0:o[y])||0)+(t?0:S.crossAxis),n=d.reference[y]+d.reference[e]+(t?0:(null==(a=c.offset)?void 0:a[y])||0)-(t?S.crossAxis:0);En&&(E=n)}return{[w]:x,[y]:E}}}}(e).fn,options:[e,t]}))():void 0,...el}),I&&((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n,o,a,i;let{placement:s,middlewareData:l,rects:d,initialPlacement:c,platform:u,elements:S}=t,{mainAxis:R=!0,crossAxis:C=!0,fallbackPlacements:T,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:P="none",flipAlignment:L=!0,...N}=f(e,t);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let j=p(s),z=b(c),A=p(c)===c,D=await (null==u.isRTL?void 0:u.isRTL(S.floating)),M=T||(A||!L?[k(c)]:function(e){let t=k(e);return[v(e),t,v(t)]}(c)),B="none"!==P;!T&&B&&M.push(...function(e,t,r,n){let o=m(e),a=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?w:y;return t?y:w;case"left":case"right":return t?x:E;default:return[]}}(p(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(v)))),a}(c,L,P,D));let _=[c,...M],I=await u.detectOverflow(t,N),W=[],V=(null==(n=l.flip)?void 0:n.overflows)||[];if(R&&W.push(I[j]),C){let e=function(e,t,r){void 0===r&&(r=!1);let n=m(e),o=h(b(e)),a=g(o),i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=k(i)),[i,k(i)]}(s,d,D);W.push(I[e[0]],I[e[1]])}if(V=[...V,{placement:s,overflows:W}],!W.every(e=>e<=0)){let e=((null==(o=l.flip)?void 0:o.index)||0)+1,t=_[e];if(t&&("alignment"!==C||z===b(t)||V.every(e=>b(e.placement)!==z||e.overflows[0]>0)))return{data:{index:e,overflows:V},reset:{placement:t}};let r=null==(a=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!r)switch(O){case"bestFit":{let e=null==(i=V.filter(e=>{if(B){let t=b(e.placement);return t===z||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(r=e);break}case"initialPlacement":r=c}if(s!==r)return{reset:{placement:r}}}return{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({...el}),((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let r,n,{placement:o,rects:a,platform:l,elements:d}=t,{apply:c=()=>{},...u}=f(e,t),h=await l.detectOverflow(t,u),g=p(o),v=m(o),y="y"===b(o),{width:w,height:x}=a.floating;"top"===g||"bottom"===g?(r=g,n=v===(await (null==l.isRTL?void 0:l.isRTL(d.floating))?"start":"end")?"left":"right"):(n=g,r="end"===v?"top":"bottom");let E=x-h.top-h.bottom,k=w-h.left-h.right,S=i(x-h[r],E),R=i(w-h[n],k),C=t.middlewareData.shift,T=!C,O=S,P=R;null!=C&&C.enabled.x&&(P=k),null!=C&&C.enabled.y&&(O=E),T&&!v&&(y?P=w-2*s(h.left,h.right):O=x-2*s(h.top,h.bottom)),await c({...t,availableWidth:P,availableHeight:O});let L=await l.getDimensions(d.floating);return w!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({...el,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:a,height:i}=r.reference,s=t.floating.style;s.setProperty("--radix-popper-available-width","".concat(n,"px")),s.setProperty("--radix-popper-available-height","".concat(o,"px")),s.setProperty("--radix-popper-anchor-width","".concat(a,"px")),s.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),J&&((e,t)=>{let r=(e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eh({element:r.current,padding:n}).fn(t):{}:r?eh({element:r,padding:n}).fn(t):{}}}))(e);return{name:r.name,fn:r.fn,options:[e,t]}})({element:J,padding:_}),e$({arrowWidth:er,arrowHeight:en}),F&&((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=f(e,t);switch(o){case"referenceHidden":{let e=P(await n.detectOverflow(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:L(e)}}}case"escaped":{let e=P(await n.detectOverflow(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:L(e)}}}default:return{}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({strategy:"referenceHidden",...el})]}),[eC,eP]=eU(eu),eL=(0,eT.c)($);(0,eO.N)(()=>{ef&&(null==eL||eL())},[ef,eL]);let eN=null==(r=eS.arrow)?void 0:r.x,ej=null==(n=eS.arrow)?void 0:n.y,eA=(null==(a=eS.arrow)?void 0:a.centerOffset)!==0,[eD,eM]=o.useState();return(0,eO.N)(()=>{q&&eM(window.getComputedStyle(q).zIndex)},[q]),(0,ek.jsx)("div",{ref:ed.setFloating,"data-radix-popper-content-wrapper":"",style:{...ec,transform:ef?ec.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eD,"--radix-popper-transform-origin":[null==(l=eS.transformOrigin)?void 0:l.x,null==(c=eS.transformOrigin)?void 0:c.y].join(" "),...(null==(u=eS.hide)?void 0:u.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,ek.jsx)(e_,{scope:C,placedSide:eC,onArrowChange:Q,arrowX:eN,arrowY:ej,shouldHideArrow:eA,children:(0,ek.jsx)(eE.sG.div,{"data-side":eC,"data-align":eP,...U,ref:K,style:{...U.style,animation:ef?void 0:"none"}})})})});eW.displayName=eB;var eV="PopperArrow",eH={top:"bottom",right:"left",bottom:"top",left:"right"},eF=o.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=eI(eV,r),a=eH[o.placedSide];return(0,ek.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,ek.jsx)(eS,{...n,ref:t,style:{...n.style,display:"block"}})})});function eY(e){return null!==e}eF.displayName=eV;var e$=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,a,i;let{placement:s,rects:l,middlewareData:d}=t,c=(null==(r=d.arrow)?void 0:r.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,m]=eU(s),h={start:"0%",center:"50%",end:"100%"}[m],g=(null!=(a=null==(n=d.arrow)?void 0:n.x)?a:0)+u/2,b=(null!=(i=null==(o=d.arrow)?void 0:o.y)?i:0)+f/2,v="",y="";return"bottom"===p?(v=c?h:"".concat(g,"px"),y="".concat(-f,"px")):"top"===p?(v=c?h:"".concat(g,"px"),y="".concat(l.floating.height+f,"px")):"right"===p?(v="".concat(-f,"px"),y=c?h:"".concat(b,"px")):"left"===p&&(v="".concat(l.floating.width+f,"px"),y=c?h:"".concat(b,"px")),{data:{x:v,y}}}});function eU(e){let[t,r="center"]=e.split("-");return[t,r]}var eG=eA,eq=eM,eX=eW,eK=eF},68946:(e,t,r)=>{r.d(t,{B:()=>l});var n,o=r(12115),a=r(4129),i=(n||(n=r.t(o,2)))["useId".toString()]||(()=>void 0),s=0;function l(e){let[t,r]=o.useState(i());return(0,a.N)(()=>{e||r(e=>e??String(s++))},[e]),e||(t?`radix-${t}`:"")}},70222:(e,t,r)=>{r.d(t,{c:()=>o});var n=r(12115);function o(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}},75433:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(12115),o=r(47650),a=r(97602),i=r(4129),s=r(95155),l=n.forwardRef((e,t)=>{var r,l;let{container:d,...c}=e,[u,f]=n.useState(!1);(0,i.N)(()=>f(!0),[]);let p=d||u&&(null==(l=globalThis)||null==(r=l.document)?void 0:r.body);return p?o.createPortal((0,s.jsx)(a.sG.div,{...c,ref:t}),p):null});l.displayName="Portal"},75889:(e,t,r)=>{r.d(t,{QP:()=>H});let n=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),a=o?n(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;let i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},o=/^\[(.+)\]$/,a=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:i(t,e)).classGroupId=r;return}if("function"==typeof e)return s(e)?void a(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{a(o,i(t,e),r,n)})})},i=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},s=e=>e.isThemeGetter,l=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,d=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},c=/\s+/;function u(){let e,t,r=0,n="";for(;r{let t;if("string"==typeof e)return e;let r="";for(let n=0;n{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},m=/^\[(?:([a-z-]+):)?(.+)\]$/i,h=/^\d+\/\d+$/,g=new Set(["px","full","screen"]),b=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,y=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,E=e=>S(e)||g.has(e)||h.test(e),k=e=>B(e,"length",_),S=e=>!!e&&!Number.isNaN(Number(e)),R=e=>B(e,"number",S),C=e=>!!e&&Number.isInteger(Number(e)),T=e=>e.endsWith("%")&&S(e.slice(0,-1)),O=e=>m.test(e),P=e=>b.test(e),L=new Set(["length","size","percentage"]),N=e=>B(e,L,I),j=e=>B(e,"position",I),z=new Set(["image","url"]),A=e=>B(e,z,V),D=e=>B(e,"",W),M=()=>!0,B=(e,t,r)=>{let n=m.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},_=e=>v.test(e)&&!y.test(e),I=()=>!1,W=e=>w.test(e),V=e=>x.test(e);Symbol.toStringTag;let H=function(e,...t){let r,i,s,f=function(d){let c;return i=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,o=(o,a)=>{r.set(o,a),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}})((c=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{let r,i=[],s=0,l=0;for(let d=0;dl?r-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i})(c),...(e=>{let t=(e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return l(Object.entries(e.classGroups),r).forEach(([e,r])=>{a(r,n,e,t)}),n})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),n(r,t)||(e=>{if(o.test(e)){let t=o.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}})(e)},getConflictingClassGroupIds:(e,t)=>{let n=r[e]||[];return t&&i[e]?[...n,...i[e]]:n}}})(c)}).cache.get,s=r.cache.set,f=p,p(d)};function p(e){let t=i(e);if(t)return t;let n=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(c),s="";for(let e=i.length-1;e>=0;e-=1){let t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:f}=r(t),p=!!f,m=n(p?u.substring(0,f):u);if(!m){if(!p||!(m=n(u))){s=t+(s.length>0?" "+s:s);continue}p=!1}let h=d(l).join(":"),g=c?h+"!":h,b=g+m;if(a.includes(b))continue;a.push(b);let v=o(m,p);for(let e=0;e0?" "+s:s)}return s})(e,r);return s(e,n),n}return function(){return f(u.apply(null,arguments))}}(()=>{let e=p("colors"),t=p("spacing"),r=p("blur"),n=p("brightness"),o=p("borderColor"),a=p("borderRadius"),i=p("borderSpacing"),s=p("borderWidth"),l=p("contrast"),d=p("grayscale"),c=p("hueRotate"),u=p("invert"),f=p("gap"),m=p("gradientColorStops"),h=p("gradientColorStopPositions"),g=p("inset"),b=p("margin"),v=p("opacity"),y=p("padding"),w=p("saturate"),x=p("scale"),L=p("sepia"),z=p("skew"),B=p("space"),_=p("translate"),I=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",O,t],H=()=>[O,t],F=()=>["",E,k],Y=()=>["auto",S,O],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",O],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>[S,O];return{cacheSize:500,separator:":",theme:{colors:[M],spacing:[E,k],blur:["none","",P,O],brightness:J(),borderColor:[e],borderRadius:["none","","full",P,O],borderSpacing:H(),borderWidth:F(),contrast:J(),grayscale:X(),hueRotate:J(),invert:X(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[T,k],inset:V(),margin:V(),opacity:J(),padding:H(),saturate:J(),scale:J(),sepia:X(),skew:J(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[P]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),O]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",C,O]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",C,O]}],"grid-cols":[{"grid-cols":[M]}],"col-start-end":[{col:["auto",{span:["full",C,O]},O]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[M]}],"row-start-end":[{row:["auto",{span:[C,O]},O]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,t]}],"min-w":[{"min-w":[O,t,"min","max","fit"]}],"max-w":[{"max-w":[O,t,"none","full","min","max","fit","prose",{screen:[P]},P]}],h:[{h:[O,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,t,"auto","min","max","fit"]}],"font-size":[{text:["base",P,k]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",R]}],"font-family":[{font:[M]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",O]}],"line-clamp":[{"line-clamp":["none",S,R]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",E,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",E,k]}],"underline-offset":[{"underline-offset":["auto",E,O]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),j]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[E,O]}],"outline-w":[{outline:[E,k]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[E,k]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",P,D]}],"shadow-color":[{shadow:[M]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",P,O]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",O]}],duration:[{duration:J()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:J()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[C,O]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",O]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[E,k,R]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})},92556:(e,t,r)=>{r.d(t,{m:()=>n});function n(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}},94446:(e,t,r)=>{r.d(t,{s:()=>i,t:()=>a});var n=r(12115);function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return t=>{let r=!1,n=e.map(e=>{let n=o(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t{r.d(t,{hO:()=>l,sG:()=>s});var n=r(12115),o=r(47650),a=r(32467),i=r(95155),s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let r=n.forwardRef((e,r)=>{let{asChild:n,...o}=e,s=n?a.DX:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(s,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js b/pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js deleted file mode 100644 index 729f0c32..00000000 --- a/pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1095],{17705:(e,t,n)=>{n.d(t,{z:()=>c});var r=n(95155),a=n(52619),o=n.n(a),s=n(27937),i=n(25016);function l(e){let{items:t,className:n}=e;return(0,r.jsx)("nav",{"aria-label":"Breadcrumb",className:(0,i.cn)("text-muted-foreground flex min-w-0 flex-wrap items-center gap-1 text-sm",n),children:t.map((e,n)=>(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[n>0&&(0,r.jsx)(s.A,{className:"size-3.5 shrink-0 opacity-60"}),e.href&&n0&&(0,r.jsx)(l,{items:a}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight sm:text-2xl",children:t}),s]}),n&&(0,r.jsx)("p",{className:"text-muted-foreground mt-1 max-w-3xl text-sm",children:n})]}),o&&(0,r.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:o})]})]})}},25016:(e,t,n)=>{n.d(t,{cn:()=>o});var r=n(2821),a=n(75889);function o(){for(var e=arguments.length,t=Array(e),n=0;n{var r;n.d(t,{Em:()=>E,FH:()=>P,GC:()=>y,Ht:()=>h,Ms:()=>i,Se:()=>j,Zq:()=>b,_W:()=>p,aJ:()=>N,gJ:()=>d,hD:()=>u,iD:()=>A,jj:()=>l,o2:()=>s,ri:()=>D,sk:()=>S,tE:()=>a,y0:()=>x,yq:()=>k});let a=(null!=(r=n(95704).env.NEXT_PUBLIC_API_URL)?r:"").replace(/\/+$/,""),o="homecloud.session",s="/demo",i=!0,l="#demo-unavailable",c={token:"demo-token",expires:"2099-01-01T00:00:00Z",account_id:"123456789012",user:{name:"demo-admin",id:"AIDADEMOADMIN000000",arn:"arn:aws:iam::123456789012:user/demo-admin",root:!1,console_access:!0}};class u extends Error{constructor(e,t,n){super(n),this.name="ApiError",this.status=e,this.code=t}}function d(e){return e instanceof u?e.message||e.code:e instanceof Error?e.message:String(e)}let f=new Set;function h(){if(i)return c;try{let e=window.localStorage.getItem(o);if(!e)return null;let t=JSON.parse(e);if(!t.token||t.expires&&new Date(t.expires).getTime()t(e))}function p(e){return f.add(e),()=>f.delete(e)}function g(){var e,t;return null!=(t=null==(e=h())?void 0:e.token)?t:null}let v=!1;function w(){if(m(null),v||window.location.pathname.startsWith("/login"))return;v=!0;let e=window.location.pathname+window.location.search;window.location.href="/login/?next=".concat(encodeURIComponent(e))}function b(e){if(!e)return"";let t=new URLSearchParams;for(let[n,r]of Object.entries(e))null!=r&&""!==r&&t.set(n,String(r));let n=t.toString();return n?"?".concat(n):""}function x(e,t){return"".concat(a).concat(e).concat(b(t))}function y(e,t){var n;return i?l:x(e,{...t,access_token:null!=(n=g())?n:""})}function k(e,t){if(i)throw new u(501,"NotAvailableInDemo","Live connections are not available in the demo.");let n=a||window.location.origin,r=new URL(y(e,t),n);return r.protocol="https:"===r.protocol?"wss:":"ws:",r.toString()}let N=e=>encodeURIComponent(e);function S(){return n.e(4274).then(n.bind(n,54274))}async function T(e,t,n){var r;let a,o=await S(),s=n.body;if(n.body instanceof Blob)s=a=n.body.size<=524288?await n.body.text():void 0;else if("string"==typeof n.body){a=n.body;try{s=JSON.parse(n.body)}catch(e){s=n.body}}let i={};for(let[e,t]of Object.entries(null!=(r=n.query)?r:{}))null!=t&&""!==t&&(i[e]=String(t));try{return await o.demoRequest({method:e,path:t,query:i,body:s,raw:a,headers:n.headers})}catch(e){if(e instanceof o.DemoError)throw new u(e.status,e.code,e.message);throw e}}async function E(e,t){let n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i)return T(e,t,o);let s={Accept:"application/json",...o.headers},l=g();l&&(s.Authorization="Bearer ".concat(l)),void 0!==o.body&&(o.body instanceof Blob||o.body instanceof FormData||"string"==typeof o.body?r=o.body:(s["Content-Type"]="application/json",r=JSON.stringify(o.body)));try{a=await fetch(x(t,o.query),{method:e,headers:s,body:r,signal:o.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw e;throw new u(0,"NetworkError","Cannot reach the HomeCloud API. Is the server running?")}let c=await a.text();if(c)try{n=JSON.parse(c)}catch(e){n=c}if(!a.ok){var d,f;let e=null==n?void 0:n.error,t=new u(a.status,null!=(d=null==e?void 0:e.code)?d:"HTTP".concat(a.status),null!=(f=null==e?void 0:e.message)?f:"string"==typeof n&&n?n:a.statusText);throw 401!==a.status||o.noAuthRedirect||w(),t}return n}let P={get:(e,t,n)=>E("GET",e,{query:t,signal:n}),post:(e,t,n)=>E("POST",e,{body:t,query:n}),put:(e,t,n)=>E("PUT",e,{body:t,query:n}),patch:(e,t,n)=>E("PATCH",e,{body:t,query:n}),del:(e,t)=>E("DELETE",e,{query:t})};function j(e,t,n,r,a){if(i)return{promise:(async()=>{if(n.size>262144)throw new u(501,"NotAvailableInDemo","Uploads larger than 256 KB are not available in the demo.");return await new Promise(e=>setTimeout(e,300)),null==r||r(n.size,n.size),T("PUT",e,{query:t,body:n,headers:{"Content-Type":a||n.type||"application/octet-stream"}})})(),abort:()=>{}};let o=new XMLHttpRequest;return{promise:new Promise((s,i)=>{o.open("PUT",x(e,t));let l=g();l&&o.setRequestHeader("Authorization","Bearer ".concat(l)),o.setRequestHeader("Content-Type",a||n.type||"application/octet-stream"),o.upload.onprogress=e=>{e.lengthComputable&&(null==r||r(e.loaded,e.total))},o.onload=()=>{var e,t;let n;try{n=o.responseText?JSON.parse(o.responseText):void 0}catch(e){n=o.responseText}if(o.status>=200&&o.status<300)return void s(n);let r=null==n?void 0:n.error;401===o.status&&w(),i(new u(o.status,null!=(e=null==r?void 0:r.code)?e:"HTTP".concat(o.status),null!=(t=null==r?void 0:r.message)?t:o.statusText))},o.onerror=()=>i(new u(0,"NetworkError","Upload failed: cannot reach the HomeCloud API")),o.onabort=()=>i(new u(0,"Aborted","Upload cancelled")),o.send(n)}),abort:()=>o.abort()}}async function A(e,t){if(i)return c;let n=await E("POST","/api/v1/auth/login",{body:{username:e,password:t},noAuthRedirect:!0});return m(n),n}async function D(){if(!i){try{await E("POST","/api/v1/auth/logout",{noAuthRedirect:!0})}catch(e){}m(null)}}},73697:(e,t,n)=>{n.d(t,{DB:()=>f,Yi:()=>d,bN:()=>p,cB:()=>g,gf:()=>u,pE:()=>m,y3:()=>h});var r=n(12115),a=n(27811),o=n(2138),s=n(20063),i=n(18720),l=n(37621);let c=e=>(0,l.Em)("GET",e);function u(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e?e+(0,l.Zq)(r.query):null,s={refreshInterval:r.refreshInterval,keepPreviousData:null==(t=r.keepPreviousData)||t,revalidateOnFocus:null==(n=r.revalidateOnFocus)||n};return(0,a.u)(o,c,s)}function d(e){return(0,o.k)(t=>"string"==typeof t&&t.startsWith(e))}let f={fetcher:c,dedupingInterval:1500,errorRetryCount:2,shouldRetryOnError:e=>!(e instanceof l.hD)||0===e.status||e.status>=500};function h(){let[e,t]=(0,r.useState)(!1);return{pending:e,run:(0,r.useCallback)(async(e,n)=>{t(!0);try{let t=await e();return n&&i.oR.success("function"==typeof n?n(t):n),t}catch(e){i.oR.error((0,l.gJ)(e));return}finally{t(!1)}},[])}}function m(e){var t;return null!=(t=(0,s.useSearchParams)().get(e))?t:""}function p(){let e=(0,s.useRouter)(),t=(0,s.usePathname)(),n=(0,s.useSearchParams)();return(0,r.useCallback)((r,a)=>{let o=new URLSearchParams(n.toString());null===a||""===a?o.delete(r):o.set(r,a);let s=o.toString();e.replace("".concat(t).concat(s?"?".concat(s):""),{scroll:!1})},[e,t,n])}function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,[t,n]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}},97003:(e,t,n)=>{n.d(t,{$:()=>l});var r=n(95155);n(12115);var a=n(32467),o=n(83101),s=n(25016);let i=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n,size:o,asChild:l=!1,...c}=e,u=l?a.DX:"button";return(0,r.jsx)(u,{"data-slot":"button",className:(0,s.cn)(i({variant:n,size:o,className:t})),...c})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1113-4fa3c21659063672.js b/pages/demo/_next/static/chunks/1113-4fa3c21659063672.js new file mode 100644 index 00000000..9866a67a --- /dev/null +++ b/pages/demo/_next/static/chunks/1113-4fa3c21659063672.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1113],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},15410:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42730:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),d=r(79225),c=r(96886),p=r(12377),s=r(26276),u="Switch",[y,f]=(0,i.A)(u),[h,k]=y(u),b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:d,defaultChecked:c,required:u,disabled:y,value:f="on",onCheckedChange:k,form:b,...m}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),M=l.useRef(!1),S=!v||b||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,d=i?e:n,c=(0,o.c)(r);return[d,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else a(t)},[i,e,a,c])]}({prop:d,defaultProp:c,onChange:k});return(0,s.jsxs)(h,{scope:r,checked:E,disabled:y,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":g(E),"data-disabled":y?"":void 0,disabled:y,value:f,...m,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),S&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),S&&(0,s.jsx)(A,{control:v,bubbles:!M.current,name:i,value:f,checked:E,required:u,disabled:y,form:b,style:{transform:"translateX(-100%)"}})]})});b.displayName=u;var m="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(m,r);return(0,s.jsx)(p.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=m;var A=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,d.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,c.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var x=b,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},78341:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},79092:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let r=!1,l=e.map(e=>{let l=d(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function y(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,d=[];A(n)&&"function"==typeof M&&(n=M(n._payload)),l.Children.forEach(n,e=>{if(m(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof M&&(t=M(t._payload)),i=h(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=l.cloneElement(i,void 0,d):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let c=i?b(i):void 0,s=p(r,c);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=k(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?s:c),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(y,"createSlot");var f=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=f,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function m(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}u(k,"mergeProps"),u(b,"getElementRef"),u(m,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(g,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=y(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js b/pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js deleted file mode 100644 index 141e65ec..00000000 --- a/pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1183],{17982:(e,t,s)=>{s.d(t,{C:()=>o,z:()=>i});var n=s(95155),a=s(12115),r=s(53789),l=s(99051),c=s(25016);let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.bL,{className:(0,c.cn)("grid gap-2",s),...a,ref:t})});i.displayName=r.bL.displayName;let o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.q7,{ref:t,className:(0,c.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:(0,n.jsx)(r.C1,{className:"flex items-center justify-center",children:(0,n.jsx)(l.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});o.displayName=r.q7.displayName},41183:(e,t,s)=>{s.d(t,{CN:()=>C,DD:()=>V,Fd:()=>Q,GL:()=>I,GX:()=>P,L0:()=>v,MQ:()=>B,Oe:()=>J,Pg:()=>q,Q5:()=>K,U3:()=>X,V5:()=>H,Wr:()=>A,ZA:()=>_,bQ:()=>T,bY:()=>G,cR:()=>R,d_:()=>ee,dc:()=>$,eA:()=>S,hK:()=>et,iJ:()=>Z,jR:()=>Y,jV:()=>w,mP:()=>y,mR:()=>U,nF:()=>z,ps:()=>k,tE:()=>M,xx:()=>W,zT:()=>D});var n=s(95155),a=s(12115),r=s(27811),l=s(86651),c=s(70532),i=s(57828),o=s(89559),d=s(97003),u=s(84916),m=s(33789),x=s(90235),p=s(17982),f=s(68122),g=s(99116),h=s(73864),b=s(37621),j=s(25016);let y="/api/v1/iam",N=/^[\w+=,.@-]{1,64}$/,v=e=>"/iam/user/?name=".concat(encodeURIComponent(e)),w=e=>"/iam/group/?name=".concat(encodeURIComponent(e)),A=e=>"/iam/policy/?name=".concat(encodeURIComponent(e)),C=e=>"/iam/instance-profile/?name=".concat(encodeURIComponent(e)),k="text-primary font-medium hover:underline";function S(e,t){return t?N.test(t)?null:"Use 1-64 letters, digits or + = , . @ _ - characters.":"Enter a ".concat(e," name.")}function R(){return"".concat(window.location.origin,"/login/")}function L(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=["ABCDEFGHJKLMNPQRSTUVWXYZ","abcdefghijkmnopqrstuvwxyz","23456789","!@#$%^&*-_=+"],s=t.join(""),n=e=>{let t=new Uint32Array(1);return crypto.getRandomValues(t),t[0]%e},a=t.map(e=>e[n(e.length)]);for(;a.length0;e--){let t=n(e+1);[a[e],a[t]]=[a[t],a[e]]}return a.join("")}let E=e=>/[",\n]/.test(e)?'"'.concat(e.replace(/"/g,'""'),'"'):e;function D(e){return e.map(E).join(",")}function U(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"text/csv",n=URL.createObjectURL(new Blob([t],{type:s})),a=document.createElement("a");a.href=n,a.download=e,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}let I={Version:"2012-10-17",Statement:[{Effect:"Allow",Action:["s3:GetObject"],Resource:["*"]}]},z=e=>JSON.stringify(e,null,2),O=e=>"string"==typeof e&&e.length>0||Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e&&e.length>0);function P(e){let t=null==e?void 0:e.Statement;return null==t?[]:Array.isArray(t)?t:[t]}let _=e=>P(e).length;function M(e){if(!e||"object"!=typeof e||Array.isArray(e))return"The policy must be a JSON object";if(void 0!==e.Version&&"2012-10-17"!==e.Version&&"2008-10-17"!==e.Version)return'Version must be "2012-10-17" or "2008-10-17"';let t=e.Statement;if(null==t)return"Statement is required";let s=Array.isArray(t)?t:[t];if(0===s.length)return"Statement must not be empty";for(let e=0;e"*"!==e&&!e.includes(":"));if(a)return"Statement[".concat(e,"].").concat(n,' "').concat(a,'" must be :');if(void 0!==t.Resource&&void 0!==t.NotResource)return"Statement[".concat(e,"] cannot have both Resource and NotResource");if(void 0===t.Resource&&void 0===t.NotResource)return"Statement[".concat(e,"] needs a Resource or NotResource");let r=void 0!==t.Resource?"Resource":"NotResource";if(!O(t[r]))return"Statement[".concat(e,"].").concat(r," must be a string or a non-empty array of strings");if(void 0!==t.Principal)return"Statement[".concat(e,"]: Principal is only allowed in role trust policies");if(void 0!==t.Condition&&(!t.Condition||"object"!=typeof t.Condition||Array.isArray(t.Condition)))return"Statement[".concat(e,"].Condition must be an object of {operator: {key: value}}")}return null}let V=e=>null==e?[]:Array.isArray(e)?e:[e];function F(e){let t=[];if(!e||"object"!=typeof e)return t;for(let[s,n]of Object.entries(e))if(n&&"object"==typeof n)for(let[e,a]of Object.entries(n))t.push({op:s,key:e,values:(Array.isArray(a)?a:[a]).map(e=>String(e))});return t}function G(e){let{doc:t}=e,s=P(t).filter(e=>e&&"object"==typeof e);if(!s.length)return(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:"This policy has no statements."});let a=s.some(e=>F(e.Condition).length>0);return(0,n.jsx)("div",{className:"overflow-x-auto rounded-md border",children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"bg-muted/40 text-muted-foreground border-b text-left text-xs",children:[(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Effect"}),(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Actions"}),(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Resources"}),a&&(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Conditions"})]})}),(0,n.jsx)("tbody",{children:s.map((e,t)=>{let s=void 0===e.Action&&void 0!==e.NotAction,r=void 0===e.Resource&&void 0!==e.NotResource,l=F(e.Condition);return(0,n.jsxs)("tr",{className:"border-b align-top last:border-0",children:[(0,n.jsxs)("td",{className:"px-3 py-2",children:[(0,n.jsx)(h.Wh,{status:"Allow"===e.Effect?"allowed":"explicitDeny",label:e.Effect}),e.Sid&&(0,n.jsx)("div",{className:"text-muted-foreground mt-1 text-xs",children:e.Sid})]}),(0,n.jsxs)("td",{className:"px-3 py-2",children:[s&&(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-amber-700 dark:text-amber-300",children:"All actions except (NotAction)"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:V(s?e.NotAction:e.Action).map(e=>(0,n.jsx)("code",{className:"bg-muted rounded px-1.5 py-0.5 text-xs",children:"*"===e?"* (all actions)":e},e))})]}),(0,n.jsxs)("td",{className:"px-3 py-2",children:[r&&(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-amber-700 dark:text-amber-300",children:"All resources except (NotResource)"}),(0,n.jsx)("div",{className:"flex flex-col gap-0.5",children:V(r?e.NotResource:e.Resource).map(e=>(0,n.jsx)("span",{className:"font-mono text-xs break-all",children:"*"===e?"* (all resources)":e},e))})]}),a&&(0,n.jsx)("td",{className:"px-3 py-2",children:l.length?(0,n.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>(0,n.jsxs)("span",{className:"font-mono text-xs break-all",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:e.op})," ",e.key,": ",e.values.join(", ")]},"".concat(e.op,":").concat(e.key)))}):(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"None"})})]},t)})})]})})}let T=e=>e?"AWS managed":"Customer managed",W=e=>e.slice(e.lastIndexOf("/")+1);function B(e){let{managed:t}=e;return t?(0,n.jsx)(h.Wh,{status:"managed",tone:"info",label:"AWS managed"}):(0,n.jsx)(h.Wh,{status:"customer",tone:"neutral",label:"Customer managed"})}let J=[{service:"s3",actions:["s3:ListAllMyBuckets","s3:ListBucket","s3:GetObject","s3:PutObject","s3:DeleteObject","s3:CreateBucket","s3:DeleteBucket"]},{service:"ec2",actions:["ec2:DescribeInstances","ec2:RunInstances","ec2:StartInstances","ec2:StopInstances","ec2:TerminateInstances","ec2:DescribeVpcs"]},{service:"iam",actions:["iam:ListUsers","iam:GetUser","iam:CreateUser","iam:DeleteUser","iam:AttachUserPolicy","iam:CreateAccessKey","iam:ListPolicies"]},{service:"secretsmanager",actions:["secretsmanager:ListSecrets","secretsmanager:GetSecretValue","secretsmanager:CreateSecret","secretsmanager:DeleteSecret"]},{service:"cloudwatch",actions:["cloudwatch:ListMetrics","cloudwatch:GetMetricStatistics","cloudwatch:PutMetricAlarm","logs:DescribeLogGroups","logs:FilterLogEvents"]},{service:"other",actions:["cloudtrail:LookupEvents","lambda:InvokeFunction","dynamodb:GetItem","sqs:SendMessage","sns:Publish","rds:DescribeDBInstances"]}];function $(e){let{policies:t,loading:s,selected:r,onChange:c,exclude:i=[],maxHeight:o="max-h-72"}=e,[d,x]=(0,a.useState)(""),[p,g]=(0,a.useState)("all"),h=(0,a.useMemo)(()=>{let e=d.trim().toLowerCase();return(null!=t?t:[]).filter(e=>!i.includes(e.name)).filter(e=>"all"===p||("managed"===p?e.managed:!e.managed)).filter(t=>!e||t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)).sort((e,t)=>e.name.localeCompare(t.name))},[t,d,p,i]);return(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("div",{className:"relative min-w-48 flex-1",children:[(0,n.jsx)(l.A,{className:"text-muted-foreground absolute top-1/2 left-2.5 size-4 -translate-y-1/2"}),(0,n.jsx)(m.p,{value:d,onChange:e=>x(e.target.value),placeholder:"Filter policies by name or description",className:"h-8 pl-8"})]}),(0,n.jsx)("div",{className:"flex rounded-md border p-0.5 text-xs",children:[["all","All types"],["managed","AWS managed"],["local","Customer managed"]].map(e=>{let[t,s]=e;return(0,n.jsx)("button",{type:"button",onClick:()=>g(t),className:(0,j.cn)("rounded px-2 py-1",p===t?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:s},t)})})]}),(0,n.jsx)("div",{className:(0,j.cn)("overflow-y-auto rounded-md border",o),children:s?(0,n.jsx)("div",{className:"flex flex-col gap-2 p-3",children:Array.from({length:4},(e,t)=>(0,n.jsx)(f.E,{className:"h-8 w-full"},t))}):h.length?h.map(e=>{let t=r.includes(e.name);return(0,n.jsxs)("label",{className:(0,j.cn)("hover:bg-accent/50 flex cursor-pointer items-start gap-3 border-b px-3 py-2 last:border-0",t&&"bg-primary/5"),children:[(0,n.jsx)(u.S,{checked:t,onCheckedChange:t=>{let s;return s=e.name,c(!0===t?[...r,s]:r.filter(e=>e!==s))},className:"mt-0.5"}),(0,n.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,n.jsxs)("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[e.name," ",(0,n.jsx)(B,{managed:e.managed})]}),e.description&&(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]})]},e.name)}):(0,n.jsx)("p",{className:"text-muted-foreground p-6 text-center text-sm",children:"No policies match."})}),(0,n.jsxs)("p",{className:"text-muted-foreground text-xs",children:[r.length," selected"]})]})}function q(e){let{items:t,selected:s,onChange:a,empty:r,loading:l}=e;return l?(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(f.E,{className:"h-8 w-full"}),(0,n.jsx)(f.E,{className:"h-8 w-full"})]}):t.length?(0,n.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:t.map(e=>{let t=s.includes(e.id);return(0,n.jsxs)("label",{className:(0,j.cn)("hover:bg-accent/50 flex cursor-pointer items-center gap-3 border-b px-3 py-2 last:border-0",t&&"bg-primary/5"),children:[(0,n.jsx)(u.S,{checked:t,onCheckedChange:t=>a(!0===t?[...s,e.id]:s.filter(t=>t!==e.id))}),(0,n.jsxs)("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-2 text-sm",children:[(0,n.jsx)("span",{className:"font-medium",children:e.label}),e.sub&&(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:e.sub})]})]},e.id)})}):(0,n.jsx)("p",{className:"text-muted-foreground rounded-md border border-dashed p-4 text-center text-sm",children:r})}let H=()=>({mode:"auto",custom:"",generated:L()}),Q=e=>"auto"===e.mode?e.generated:e.custom,K=e=>"custom"===e.mode&&e.custom.length<8?"The password must be at least 8 characters.":null;function Y(e){let{value:t,onChange:s,showErrors:r}=e,[l,u]=(0,a.useState)(!1),f=K(t);return(0,n.jsxs)(p.z,{value:t.mode,onValueChange:e=>s({...t,mode:e}),className:"gap-3",children:[(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)(p.C,{value:"auto",id:"pw-auto",className:"mt-0.5"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,n.jsx)(x.J,{htmlFor:"pw-auto",children:"Autogenerated password"}),(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"You can view the password after you create the user."}),"auto"===t.mode&&(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("code",{className:"bg-muted rounded px-2 py-1 text-xs",children:l?t.generated:"•".repeat(t.generated.length)}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"size-7",onClick:()=>u(!l),"aria-label":l?"Hide password":"Show password",children:l?(0,n.jsx)(c.A,{}):(0,n.jsx)(i.A,{})}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"size-7",onClick:()=>s({...t,generated:L()}),"aria-label":"Regenerate",children:(0,n.jsx)(o.A,{})})]})]})]}),(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)(p.C,{value:"custom",id:"pw-custom",className:"mt-0.5"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,n.jsx)(x.J,{htmlFor:"pw-custom",children:"Custom password"}),"custom"===t.mode&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"relative max-w-sm",children:[(0,n.jsx)(m.p,{type:l?"text":"password",autoComplete:"new-password",value:t.custom,onChange:e=>s({...t,custom:e.target.value}),placeholder:"At least 8 characters","aria-invalid":r&&!!f,className:"pr-9"}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-0.5 right-0.5 size-8",onClick:()=>u(!l),"aria-label":l?"Hide password":"Show password",children:l?(0,n.jsx)(c.A,{}):(0,n.jsx)(i.A,{})})]}),r&&f?(0,n.jsx)("span",{className:"text-destructive text-xs",children:f}):(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"Must be at least 8 characters."})]})]})]})]})}function Z(e){let{value:t,label:s}=e,[r,l]=(0,a.useState)(!1);return(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,n.jsx)("code",{className:"bg-muted min-w-0 flex-1 rounded px-2 py-1 font-mono text-[13px] break-all",children:r?t:"•".repeat(Math.min(t.length,24))}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"size-8 shrink-0",onClick:()=>l(!r),"aria-label":r?"Hide ".concat(s):"Show ".concat(s),children:r?(0,n.jsx)(c.A,{}):(0,n.jsx)(i.A,{})}),(0,n.jsx)(g.i8,{value:t,toastMessage:"".concat(s," copied")})]})}function X(e){let t=e?"".concat(y,"/users?access-keys=").concat([...e].sort().join(",")):null;return(0,r.u)(t,async()=>Object.fromEntries(await Promise.all((null!=e?e:[]).map(async e=>{try{return[e,await b.FH.get("".concat(y,"/users/").concat((0,b.aJ)(e),"/access-keys"))]}catch(t){return[e,[]]}}))),{keepPreviousData:!0})}let ee=864e5;function et(e){var t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return Math.floor((s-new Date(null!=(t=e.last_used)?t:e.created_at).getTime())/ee)}},73864:(e,t,s)=>{s.d(t,{Rh:()=>g,Wh:()=>b});var n=s(95155),a=s(35299),r=s(61362),l=s(78874),c=s(52056),i=s(99051),o=s(32978),d=s(36835),u=s(25016);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},x={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},p=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),f={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function g(e){let t=f[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let s=e.toLowerCase().replace(/[_]+/g," ").trim();return s.charAt(0).toUpperCase()+s.slice(1)}function h(e){let{tone:t,spinning:s}=e,m="size-3.5 shrink-0";if(s)return(0,n.jsx)(a.A,{className:(0,u.cn)(m,"animate-spin")});switch(t){case"success":return(0,n.jsx)(r.A,{className:m});case"danger":return(0,n.jsx)(l.A,{className:m});case"warning":return(0,n.jsx)(c.A,{className:m});case"info":return(0,n.jsx)(i.A,{className:(0,u.cn)(m,"fill-current")});default:return"neutral"===t?(0,n.jsx)(o.A,{className:m}):(0,n.jsx)(d.A,{className:m})}}function b(e){var t;let{status:s,label:a,tone:r,className:l}=e,c=null!=r?r:null!=(t=x[s.toLowerCase()])?t:"neutral",i=null!=a?a:g(s);return(0,n.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[c],l),children:[(0,n.jsx)(h,{tone:c,spinning:p.has(s.toLowerCase())}),(0,n.jsx)("span",{children:i})]})}},90235:(e,t,s)=>{s.d(t,{J:()=>o});var n=s(95155),a=s(12115),r=s(43991),l=s(83101),c=s(25016);let i=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.b,{ref:t,className:(0,c.cn)(i(),s),...a})});o.displayName=r.b.displayName},99116:(e,t,s)=>{s.d(t,{Dk:()=>u,i8:()=>m,xh:()=>x});var n=s(95155),a=s(12115),r=s(5917),l=s(75426),c=s(18720),i=s(97003),o=s(82180),d=s(25016);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(n){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}}function m(e){let{value:t,label:s,className:m,size:x="icon",toastMessage:p}=e,[f,g]=(0,a.useState)(!1),h=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(g(!0),p&&c.oR.success(p),setTimeout(()=>g(!1),1500)):c.oR.error("Could not copy to the clipboard")},b=f?r.A:l.A;return"sm"===x?(0,n.jsxs)(i.$,{type:"button",variant:"outline",size:"sm",onClick:h,className:m,children:[(0,n.jsx)(b,{className:(0,d.cn)(f&&"text-emerald-600")}),null!=s?s:"Copy"]}):(0,n.jsxs)(o.m_,{children:[(0,n.jsx)(o.k$,{asChild:!0,children:(0,n.jsx)("button",{type:"button",onClick:h,"aria-label":null!=s?s:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,n.jsx)(b,{className:(0,d.cn)("size-3.5",f&&"text-emerald-600")})})}),(0,n.jsx)(o.ZI,{children:f?"Copied":null!=s?s:"Copy"})]})}function x(e){let{value:t,mono:s=!0,className:a,display:r}=e;return t?(0,n.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",a),children:[(0,n.jsx)("span",{className:(0,d.cn)("truncate",s&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,n.jsx)(m,{value:t})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js b/pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js new file mode 100644 index 00000000..b7efe0ad --- /dev/null +++ b/pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1208],{4089:(e,t,r)=>{r.d(t,{Xi:()=>o,av:()=>c,j7:()=>n,tU:()=>i});var a=r(26276);r(29320);var s=r(33359),l=r(88674);function i(e){let{className:t,...r}=e;return(0,a.jsx)(s.bL,{"data-slot":"tabs",className:(0,l.cn)("flex flex-col gap-4",t),...r})}function n(e){let{className:t,...r}=e;return(0,a.jsx)(s.B8,{"data-slot":"tabs-list",className:(0,l.cn)("text-muted-foreground flex h-10 w-full items-end justify-start gap-1 overflow-x-auto border-b",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)(s.l9,{"data-slot":"tabs-trigger",className:(0,l.cn)("relative -mb-px inline-flex h-10 items-center justify-center gap-1.5 border-b-2 border-transparent px-3 text-sm font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-primary data-[state=active]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)(s.UC,{"data-slot":"tabs-content",className:(0,l.cn)("flex-1 outline-none",t),...r})}},20960:(e,t,r)=>{r.d(t,{U:()=>x,q:()=>v});var a=r(26276),s=r(29320),l=r(91052),i=r.n(l),n=r(43036),o=r(35833),c=r(61561),d=r(89839);let u=[{v:"60",label:"1 hour"},{v:"180",label:"3 hours"},{v:"720",label:"12 hours"},{v:"1440",label:"24 hours"}],m=[{v:"60",label:"1 minute"},{v:"300",label:"5 minutes"}];function v(e){let{namespace:t,dimensions:r,charts:l,note:v}=e,[x,g]=(0,s.useState)("60"),[h,p]=(0,s.useState)("60");return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(o.l6,{value:x,onValueChange:g,children:[(0,a.jsx)(o.bq,{size:"sm",className:"w-36","aria-label":"Time range",children:(0,a.jsx)(o.yv,{})}),(0,a.jsx)(o.gC,{children:u.map(e=>(0,a.jsxs)(o.eb,{value:e.v,children:["Last ",e.label]},e.v))})]}),(0,a.jsxs)(o.l6,{value:h,onValueChange:p,children:[(0,a.jsx)(o.bq,{size:"sm",className:"w-40","aria-label":"Period",children:(0,a.jsx)(o.yv,{})}),(0,a.jsx)(o.gC,{children:m.map(e=>(0,a.jsxs)(o.eb,{value:e.v,children:["Period: ",e.label]},e.v))})]}),(0,a.jsxs)(i(),{href:"/cloudwatch/metrics/?namespace=".concat(encodeURIComponent(t)),className:"text-primary ml-auto inline-flex items-center gap-1 text-sm hover:underline",children:["View in CloudWatch ",(0,a.jsx)(n.A,{className:"size-3.5"})]})]}),v,(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:l.map(e=>{var s;let l=e.metrics.map(e=>({namespace:t,name:e.name,dimensions:r,label:e.label}));return(0,a.jsx)(d.w,{title:e.title,description:e.description,children:(0,a.jsx)(c.B$,{queries:l,rangeMinutes:Number(x),period:Number(h),stat:null!=(s=e.stat)?s:"Average",height:220,refreshMs:3e4})},e.title)})})]})}let x=[{title:"CPU utilization",description:"Percent",metrics:[{name:"CPUUtilization"}]},{title:"Memory utilization",description:"Percent",metrics:[{name:"MemoryUtilization"}]},{title:"Network",description:"Bytes per period",metrics:[{name:"NetworkIn",label:"Network in"},{name:"NetworkOut",label:"Network out"}]},{title:"Disk I/O",description:"Bytes per period",metrics:[{name:"DiskReadBytes",label:"Disk read"},{name:"DiskWriteBytes",label:"Disk write"}]}]},53023:(e,t,r)=>{r.d(t,{v:()=>l});var a=r(26276),s=r(88674);function l(e){let{items:t,columns:r=3,className:l}=e;return(0,a.jsx)("dl",{className:(0,s.cn)("grid grid-cols-1 gap-x-8 gap-y-4",{2:"sm:grid-cols-2",3:"sm:grid-cols-2 lg:grid-cols-3",4:"sm:grid-cols-2 lg:grid-cols-4"}[r],l),children:t.map(e=>(0,a.jsxs)("div",{className:(0,s.cn)("min-w-0",e.wide&&"sm:col-span-full"),children:[(0,a.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:e.label}),(0,a.jsx)("dd",{className:"min-w-0 text-sm break-words",children:""===e.value||null===e.value||void 0===e.value?(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"}):e.value})]},e.label))})}},61561:(e,t,r)=>{r.d(t,{B$:()=>N,hg:()=>b});var a=r(26276),s=r(29320),l=r(60228),i=r(89658),n=r(67524),o=r(17728),c=r(57475),d=r(77264),u=r(8847),m=r(56357),v=r(45773),x=r(11452),g=r(60528),h=r(28971),p=r(73062),f=r(88674);let b=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],j={Average:"average",Sum:"sum",Minimum:"minimum",Maximum:"maximum",SampleCount:"sample_count"};function N(e){var t;let{queries:r,rangeMinutes:N=60,period:k=60,stat:y="Average",height:w=220,threshold:D,className:S,refreshMs:z}=e,{data:C,error:M,isLoading:_}=function(e,t,r,a){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3e4,i=e.length?["metrics",JSON.stringify(e.map(e=>{let{label:t,...r}=e;return r})),t,r,a]:null;return(0,l.u)(i,()=>{let s=new Date,l=new Date(s.getTime()-6e4*t);return h.FH.post("/api/v1/cloudwatch/metrics/query",{queries:e.map(e=>{let{label:t,...i}=e;return{...i,start:l.toISOString(),end:s.toISOString(),period:r,stat:a}})})},{refreshInterval:s,keepPreviousData:!0})}(r,N,k,y,z),U=null!=(t=j[y])?t:"average",{rows:I,unit:P,hasData:A}=(0,s.useMemo)(()=>{let e=new Map,t="",r=!1;return(null!=C?C:[]).forEach((a,s)=>{var l,i;for(let n of(a.unit&&(t=a.unit),null!=(l=a.datapoints)?l:[])){r=!0;let t=new Date(n.timestamp).getTime(),a=null!=(i=e.get(t))?i:{t};a["s".concat(s)]=n[U],e.set(t,a)}}),{rows:[...e.values()].sort((e,t)=>e.t-t.t),unit:t,hasData:r}},[C,U]);if(_&&!C)return(0,a.jsx)(g.E,{className:(0,f.cn)("w-full rounded-md",S),style:{height:w}});if(M)return(0,a.jsx)("div",{className:(0,f.cn)("text-destructive flex items-center justify-center text-sm",S),style:{height:w},children:M.message});if(!A)return(0,a.jsxs)("div",{className:(0,f.cn)("text-muted-foreground flex flex-col items-center justify-center gap-1 rounded-md border border-dashed text-sm",S),style:{height:w},children:[(0,a.jsx)("span",{children:"No datapoints in this time range"}),(0,a.jsx)("span",{className:"text-xs",children:"Metrics are sampled every 30 seconds while a resource is running."})]});let B=r.map(e=>{var t;return null!=(t=e.label)?t:e.name}),L=Date.now();return(0,a.jsx)("div",{className:(0,f.cn)("w-full",S),style:{height:w},children:(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(n.b,{data:I,margin:{top:8,right:12,bottom:0,left:0},children:[(0,a.jsx)(o.d,{stroke:"var(--border)",strokeDasharray:"3 3",vertical:!1}),(0,a.jsx)(c.W,{dataKey:"t",type:"number",scale:"time",domain:[L-6e4*N,L],tickFormatter:e=>(0,p.fU)(e).slice(0,5),stroke:"var(--muted-foreground)",fontSize:11,tickLine:!1,axisLine:{stroke:"var(--border)"},minTickGap:40}),(0,a.jsx)(d.h,{stroke:"var(--muted-foreground)",fontSize:11,tickLine:!1,axisLine:!1,width:64,tickFormatter:e=>(0,p.YI)(e,P),domain:"Percent"===P?[0,e=>Math.max(10,10*Math.ceil(e/10))]:[0,"auto"]}),(0,a.jsx)(u.m,{cursor:{stroke:"var(--muted-foreground)",strokeDasharray:"3 3"},contentStyle:{background:"var(--popover)",border:"1px solid var(--border)",borderRadius:8,fontSize:12,color:"var(--popover-foreground)"},labelFormatter:e=>(0,p.fU)(Number(e)),formatter:(e,t)=>{var r;let a=Number(String(t).slice(1));return[(0,p.YI)(Number(e),P),null!=(r=B[a])?r:String(t)]}}),r.length>1&&(0,a.jsx)(m.s,{verticalAlign:"bottom",height:24,iconType:"plainline",formatter:e=>{var t;return(0,a.jsx)("span",{className:"text-foreground text-xs",children:null!=(t=B[Number(e.slice(1))])?t:e})}}),void 0!==D&&(0,a.jsx)(v.e,{y:D,stroke:"var(--destructive)",strokeDasharray:"4 4"}),r.map((e,t)=>(0,a.jsx)(x.N,{dataKey:"s".concat(t),type:"monotone",stroke:b[t%b.length],strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:2,stroke:"var(--card)"},connectNulls:!0,isAnimationActive:!1},t))]})})})}},68157:(e,t,r)=>{r.d(t,{Fc:()=>n,TN:()=>c,XL:()=>o});var a=r(26276);r(29320);var s=r(5820),l=r(88674);let i=(0,s.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function n(e){let{className:t,variant:r,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,l.cn)(i({variant:r}),t),...s})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,l.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,l.cn)("text-muted-foreground col-start-2 block space-y-1 text-sm [&_p]:leading-relaxed",t),...r})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js b/pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js new file mode 100644 index 00000000..3aafa093 --- /dev/null +++ b/pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1226],{17286:(e,n,t)=>{t.d(n,{Rh:()=>f,Wh:()=>b});var a=t(26276),s=t(40688),r=t(48947),l=t(31935),i=t(64761),o=t(64206),c=t(46319),u=t(42812),d=t(88674);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},p={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),g={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function f(e){let n=g[e.toLowerCase()];if(n)return n;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let t=e.toLowerCase().replace(/[_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function x(e){let{tone:n,spinning:t}=e,m="size-3.5 shrink-0";if(t)return(0,a.jsx)(s.A,{className:(0,d.cn)(m,"animate-spin")});switch(n){case"success":return(0,a.jsx)(r.A,{className:m});case"danger":return(0,a.jsx)(l.A,{className:m});case"warning":return(0,a.jsx)(i.A,{className:m});case"info":return(0,a.jsx)(o.A,{className:(0,d.cn)(m,"fill-current")});default:return"neutral"===n?(0,a.jsx)(c.A,{className:m}):(0,a.jsx)(u.A,{className:m})}}function b(e){var n;let{status:t,label:s,tone:r,className:l}=e,i=null!=r?r:null!=(n=p[t.toLowerCase()])?n:"neutral",o=null!=s?s:f(t);return(0,a.jsxs)("span",{className:(0,d.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[i],l),children:[(0,a.jsx)(x,{tone:i,spinning:h.has(t.toLowerCase())}),(0,a.jsx)("span",{children:o})]})}},36337:(e,n,t)=>{t.d(n,{f:()=>i});var a=t(26276),s=t(47006),r=t(73062),l=t(22927);function i(e){let{value:n,className:t}=e,i=(0,l.cB)(3e4);return n?(0,a.jsxs)(s.m_,{children:[(0,a.jsx)(s.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=t?t:"whitespace-nowrap",children:(0,r.fF)(n,i)})}),(0,a.jsx)(s.ZI,{children:(0,r.Yq)(n)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},50565:(e,n,t)=>{t.d(n,{d:()=>l});var a=t(26276);t(29320);var s=t(63240),r=t(88674);function l(e){let{className:n,...t}=e;return(0,a.jsx)(s.bL,{"data-slot":"switch",className:(0,r.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...t,children:(0,a.jsx)(s.zi,{"data-slot":"switch-thumb",className:(0,r.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,n,t)=>{t.d(n,{J:()=>c});var a=t(26276),s=t(29320),r=t(95774),l=t(5820),i=t(88674);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,n)=>{let{className:t,...s}=e;return(0,a.jsx)(r.b,{ref:n,className:(0,i.cn)(o(),t),...s})});c.displayName=r.b.displayName},70903:(e,n,t)=>{t.d(n,{Am:()=>m,Cv:()=>p,GA:()=>h,IO:()=>g,Pk:()=>v,Tw:()=>f,YN:()=>w,eF:()=>x,fi:()=>k,jZ:()=>j,jj:()=>y,p9:()=>_,z_:()=>C,zj:()=>b});var a=t(26276),s=t(10646),r=t(81155),l=t(50985),i=t(50565),o=t(74875),c=t(17286),u=t(28971),d=t(22927);let m="/api/v1/cognito",p="".concat(m,"/user-pools"),h=e=>"".concat(p,"/").concat((0,u.aJ)(e)),g=(e,n)=>"/cognito/pool/?id=".concat(encodeURIComponent(e)).concat(n?"&tab=".concat(n):"");function f(){return(0,d.gf)(p,{refreshInterval:3e4})}let x=/^[\w\s+=,.@-]{1,128}$/,b={min_length:8,require_uppercase:!1,require_lowercase:!0,require_numbers:!0,require_symbols:!1};function j(e){let n=[e.require_uppercase&&"uppercase",e.require_lowercase&&"lowercase",e.require_numbers&&"numbers",e.require_symbols&&"symbols"].filter(Boolean);return"At least ".concat(e.min_length," characters").concat(n.length?", with ".concat(n.join(", ")):"")}function w(e,n){let t=[];return[...e].lengtht({...n,min_length:""===e.target.value?NaN:Number(e.target.value)}),className:"w-28"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Require"}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["require_uppercase","Uppercase letters"],["require_lowercase","Lowercase letters"],["require_numbers","Numbers"],["require_symbols","Symbols"]].map(e=>{let[r,l]=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(s.S,{checked:!!n[r],onCheckedChange:e=>t({...n,[r]:!!e})}),l]},r)})})]})]})}let k=e=>!Number.isInteger(e)||e<6||e>99?"Enter a whole number from 6 to 99":void 0;function _(e){let{id:n,label:t,description:s,checked:r,onChange:o,disabled:c}=e;return(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.J,{htmlFor:n,className:"font-medium",children:t}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:s})]}),(0,a.jsx)(i.d,{id:n,checked:r,onCheckedChange:o,disabled:c})]})}},73062:(e,n,t)=>{t.d(n,{Fl:()=>h,YI:()=>i,Yq:()=>c,ZV:()=>l,a3:()=>m,fF:()=>d,fU:()=>u,qt:()=>r,td:()=>p,z3:()=>s});let a=["B","KB","MB","GB","TB","PB"];function s(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let t=Math.abs(e),s=0;for(;t>=1024&&s=100?0:n);return"".concat(e<0?"-":"").concat(r," ").concat(a[s])}function r(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let n=e/1024;return"".concat(Number.isInteger(n)?n:n.toFixed(1)," GiB")}function l(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:n})}function i(e,n){if(null==e||Number.isNaN(e))return"-";switch(n){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return s(e);case"Bytes/Second":return"".concat(s(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())||1971>n.getFullYear()?null:n}function c(e){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=o(e);return t?t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:n?"2-digit":void 0,hour12:!1}):"-"}function u(e){let n=o(e);return n?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function d(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),t=o(e);if(!t)return"-";let a=(t.getTime()-n)/1e3,s=Math.abs(a),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s<45||a>0&&a<60)return"just now";let l=a;for(let[e,n]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(n,"s");return"".concat(e," ").concat(1===e?n:t)}function h(e){let n=e.endsWith("/")?e.slice(0,-1):e,t=n.lastIndexOf("/");return t>=0?n.slice(t+1):n}},74875:(e,n,t)=>{t.d(n,{D:()=>l});var a=t(26276),s=t(50985),r=t(88674);function l(e){let{label:n,htmlFor:t,help:l,error:i,optional:o,children:c,className:u}=e;return(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",u),children:[(0,a.jsxs)(s.J,{htmlFor:t,className:"text-sm font-medium",children:[n,o&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,i?(0,a.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},76962:(e,n,t)=>{t.d(n,{Dk:()=>d,i8:()=>m,xh:()=>p});var a=t(26276),s=t(29320),r=t(72538),l=t(37995),i=t(34993),o=t(47045),c=t(47006),u=t(88674);async function d(e){try{return await navigator.clipboard.writeText(e),!0}catch(a){let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select();let t=document.execCommand("copy");return document.body.removeChild(n),t}}function m(e){let{value:n,label:t,className:m,size:p="icon",toastMessage:h}=e,[g,f]=(0,s.useState)(!1),x=async e=>{e.stopPropagation(),e.preventDefault(),await d(n)?(f(!0),h&&i.oR.success(h),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},b=g?r.A:l.A;return"sm"===p?(0,a.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:x,className:m,children:[(0,a.jsx)(b,{className:(0,u.cn)(g&&"text-emerald-600")}),null!=t?t:"Copy"]}):(0,a.jsxs)(c.m_,{children:[(0,a.jsx)(c.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:x,"aria-label":null!=t?t:"Copy",className:(0,u.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,a.jsx)(b,{className:(0,u.cn)("size-3.5",g&&"text-emerald-600")})})}),(0,a.jsx)(c.ZI,{children:g?"Copied":null!=t?t:"Copy"})]})}function p(e){let{value:n,mono:t=!0,className:s,display:r}=e;return n?(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex max-w-full items-center gap-1",s),children:[(0,a.jsx)("span",{className:(0,u.cn)("truncate",t&&"font-mono text-[0.8125rem]"),title:n,children:null!=r?r:n}),(0,a.jsx)(m,{value:n})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},91226:(e,n,t)=>{t.d(n,{PoolsList:()=>S,y:()=>A});var a=t(26276),s=t(29320),r=t(91052),l=t.n(r),i=t(78113),o=t(10002),c=t(50123),u=t(40688),d=t(34993),m=t(47045),p=t(64573),h=t(81155),g=t(47353),f=t(62083),x=t(76962),b=t(79181),j=t(12373),w=t(74875),N=t(21195),v=t(36337),y=t(28971),C=t(73062),k=t(22927),_=t(70903);function S(){var e;let n=(0,i.useRouter)(),{data:t,error:r,isLoading:u,isValidating:d,mutate:p}=(0,_.Tw)(),[h,f]=(0,s.useState)([]),[w,y]=(0,s.useState)("1"===(0,k.pE)("create")),[C,S]=(0,s.useState)(null),F=null!=(e=(null!=t?t:[]).find(e=>h.includes(e.id)))?e:null,R=[{id:"name",header:"User pool name",cell:e=>(0,a.jsx)(l(),{href:(0,_.IO)(e.id),onClick:e=>e.stopPropagation(),className:(0,b.V)(),children:e.name}),value:e=>e.name},{id:"id",header:"User pool ID",cell:e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[13px] whitespace-nowrap",children:[e.id,(0,a.jsx)(x.i8,{value:e.id,label:"Copy pool ID"})]}),value:e=>e.id},{id:"users",header:"Users",cell:e=>(0,a.jsx)("span",{className:"tabular-nums",children:e.users}),value:e=>e.users},{id:"clients",header:"App clients",cell:e=>(0,a.jsx)("span",{className:"tabular-nums",children:e.clients}),value:e=>e.clients,hideBelow:"sm"},{id:"signup",header:"Self sign-up",cell:e=>(0,a.jsx)("span",{className:"whitespace-nowrap",children:e.self_sign_up?e.auto_confirm?"Auto-confirmed":"Needs confirmation":(0,a.jsx)("span",{className:"text-muted-foreground",children:"Disabled"})}),value:e=>+!!e.self_sign_up,hideBelow:"md"},{id:"created",header:"Created",cell:e=>(0,a.jsx)(v.f,{value:e.created_at}),value:e=>e.created_at,hideBelow:"sm"}],D=[{label:"View details",onSelect:()=>F&&n.push((0,_.IO)(F.id)),disabled:!F},{label:"Integration",onSelect:()=>F&&n.push((0,_.IO)(F.id,"integration")),disabled:!F},{separator:!0},{label:"Delete user pool",destructive:!0,onSelect:()=>F&&S(F),disabled:!F}];return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(N.z,{title:"User pools",description:"User directories for your applications: sign-up and sign-in, groups, and signed JWTs that your code and API Gateway routes can verify.",breadcrumbs:[{label:"Cognito",href:"/cognito/"},{label:"User pools"}]}),(0,a.jsx)(b.b,{title:"User pools",data:t,columns:R,rowId:e=>e.id,loading:u,error:r,onRefresh:()=>p(),refreshing:d,selection:"single",selected:h,onSelectedChange:f,searchPlaceholder:"Filter by name or ID",defaultSort:{id:"name"},actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.$,{items:D,disabled:!F}),(0,a.jsxs)(m.$,{size:"sm",onClick:()=>y(!0),children:[(0,a.jsx)(o.A,{})," Create user pool"]})]}),empty:(0,a.jsx)(j.p,{icon:c.A,title:"No user pools",description:"Create a user pool, add an app client, and your application can sign users up and in with a couple of HTTP calls.",action:(0,a.jsxs)(m.$,{size:"sm",onClick:()=>y(!0),children:[(0,a.jsx)(o.A,{})," Create user pool"]})})}),(0,a.jsx)(I,{open:w,onOpenChange:y}),(0,a.jsx)(A,{pool:C,onClose:()=>S(null)})]})}function A(e){var n,t,s;let{pool:r,onClose:l,redirect:o}=e,c=(0,i.useRouter)();return(0,a.jsx)(f.T,{open:!!r,onOpenChange:e=>!e&&l(),title:"Delete user pool ".concat(null!=(n=null==r?void 0:r.name)?n:""),confirmText:null==r?void 0:r.name,description:(0,a.jsxs)("p",{children:["The pool is deleted with its ",(0,C.td)(null!=(t=null==r?void 0:r.users)?t:0,"user"),", ",(0,C.td)(null!=(s=null==r?void 0:r.clients)?s:0,"app client")," and signing key. Tokens it issued stop verifying, and API routes that use it as their authorizer return 401."]}),onConfirm:async()=>{r&&(await y.FH.del((0,_.GA)(r.id)),d.oR.success("Deleted user pool ".concat(r.name)),o&&c.push("/cognito/"),await (0,k.Yi)(_.Am))}})}function I(e){let{open:n,onOpenChange:t}=e,r=(0,i.useRouter)(),[l,o]=(0,s.useState)(""),[c,g]=(0,s.useState)(_.zj),[f,x]=(0,s.useState)(!0),[b,j]=(0,s.useState)(!0),[N,v]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1);(0,s.useEffect)(()=>{n&&(o(""),g(_.zj),x(!0),j(!0),v(!1))},[n]);let A=l.trim()?_.eF.test(l.trim())?void 0:"1-128 letters, digits, spaces and + = , . @ _ -":"Enter a name",I=(0,_.fi)(c.min_length),F=async e=>{if(e.preventDefault(),v(!0),A||I)return;let n={name:l.trim(),password_policy:c,auto_confirm:f,self_sign_up:b};S(!0);try{let e=await y.FH.post(_.Cv,n);d.oR.success("Created user pool ".concat(e.name)),await (0,k.Yi)(_.Am),t(!1),r.push((0,_.IO)(e.id))}catch(e){d.oR.error((0,y.gJ)(e))}finally{S(!1)}};return(0,a.jsx)(p.lG,{open:n,onOpenChange:e=>!C&&t(e),children:(0,a.jsx)(p.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-lg",children:(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-5",children:[(0,a.jsxs)(p.c7,{children:[(0,a.jsx)(p.L3,{children:"Create user pool"}),(0,a.jsx)(p.rr,{children:"Each pool has its own users, groups, app clients and RS256 signing key."})]}),(0,a.jsx)(w.D,{label:"User pool name",htmlFor:"pool-name",error:N?A:void 0,children:(0,a.jsx)(h.p,{id:"pool-name",autoFocus:!0,value:l,onChange:e=>o(e.target.value),placeholder:"shop-users",autoComplete:"off"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Password policy"}),(0,a.jsx)(_.z_,{value:c,onChange:g,idPrefix:"pool-pp",error:N?I:void 0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Sign-up"}),(0,a.jsx)(_.p9,{id:"pool-self",label:"Self sign-up",description:"Let anyone create an account through the public sign-up endpoint. Turn off to create users only from the console or API.",checked:b,onChange:j}),(0,a.jsx)(_.p9,{id:"pool-auto",label:"Auto-confirm new users",description:"Self-registered users can sign in immediately. Otherwise they stay unconfirmed until an administrator confirms them.",checked:f,onChange:x})]}),(0,a.jsxs)(p.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:C,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:C,children:[C&&(0,a.jsx)(u.A,{className:"animate-spin"}),"Create user pool"]})]})]})})})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1255-b45d400a656668f9.js b/pages/demo/_next/static/chunks/1255-b45d400a656668f9.js deleted file mode 100644 index 8549c38e..00000000 --- a/pages/demo/_next/static/chunks/1255-b45d400a656668f9.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1255],{307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderParamsFromClient",{enumerable:!0,get:function(){return n}});let n=r(77370).createRenderParamsFromClient;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,r,o){let l=o.length<=2,[a,i]=o,c=(0,u.createRouterCacheKey)(i),s=r.parallelRoutes.get(a),f=t.parallelRoutes.get(a);f&&f!==s||(f=new Map(s),t.parallelRoutes.set(a,f));let d=null==s?void 0:s.get(c),p=f.get(c);if(l){p&&p.lazyData&&p!==d||f.set(c,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1});return}if(!p||!d){p||f.set(c,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1});return}return p===d&&(p={lazyData:p.lazyData,rsc:p.rsc,prefetchRsc:p.prefetchRsc,head:p.head,prefetchHead:p.prefetchHead,parallelRoutes:new Map(p.parallelRoutes),loading:p.loading},f.set(c,p)),e(p,d,(0,n.getNextFlightSegmentPath)(o))}}});let n=r(16378),u=r(69190);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(28110);let n=r(53663),u=r(71923);(0,n.appBootstrap)(()=>{let{hydrate:e}=r(49781);r(17297),r(9766),e(u)}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return u}});let n=r(5240);function u(e,t){if("string"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+"/")}},3201:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getAppBuildId:function(){return u},setAppBuildId:function(){return n}});let r="";function n(e){r=e}function u(){return r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reportGlobalError",{enumerable:!0,get:function(){return r}});let r="function"==typeof reportError?reportError:e=>{globalThis.console.error(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isRecoverableError:function(){return i},onRecoverableError:function(){return c}});let n=r(28140),u=r(24553),o=n._(r(42444)),l=r(3463),a=new WeakSet;function i(e){return a.has(e)}let c=e=>{let t=(0,o.default)(e)&&"cause"in e?e.cause:e;(0,u.isBailoutToCSRError)(t)||(0,l.reportGlobalError)(t)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return n}});let n=r(67858).unstable_rethrow;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return o},SearchParamsContext:function(){return u}});let n=r(12115),u=(0,n.createContext)(null),o=(0,n.createContext)(null),l=(0,n.createContext)(null)},5240:(e,t)=>{"use strict";function r(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return r}})},5829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return o}});let n=r(37099),u=r(86437);function o(e){return(0,u.isRedirectError)(e)||(0,n.isHTTPAccessFallbackError)(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6640:(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unauthorized",{enumerable:!0,get:function(){return n}}),r(37099).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7460:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"matchSegment",{enumerable:!0,get:function(){return r}});let r=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1];("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return M}});let n=r(28140),u=r(49417),o=r(95155),l=r(86871),a=u._(r(12115)),i=n._(r(47650)),c=r(46752),s=r(32753),f=r(48359),d=r(88785),p=r(7460),h=r(84170),_=r(10531),y=r(63886),b=r(69190),v=r(48915),g=r(76248),m=r(39684);r(74061);let E=i.default.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=["bottom","height","left","right","top","width","x","y"];function O(e,t){let r=e.getBoundingClientRect();return r.top>=0&&r.top<=t}class P extends a.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,r)=>(0,p.matchSegment)(t,e[r]))))return;let r=null,n=e.hashFragment;if(n&&(r=function(e){var t;return"top"===e?document.body:null!=(t=document.getElementById(e))?t:document.getElementsByName(e)[0]}(n)),r||(r=(0,E.findDOMNode)(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return R.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,h.disableSmoothScrollDuringRouteTransition)(()=>{if(n)return void r.scrollIntoView();let e=document.documentElement,t=e.clientHeight;!O(r,t)&&(e.scrollTop=0,O(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function j(e){let{segmentPath:t,children:r}=e,n=(0,a.useContext)(c.GlobalLayoutRouterContext);if(!n)throw Object.defineProperty(Error("invariant global layout router not mounted"),"__NEXT_ERROR_CODE",{value:"E473",enumerable:!1,configurable:!0});return(0,o.jsx)(P,{segmentPath:t,focusAndScrollRef:n.focusAndScrollRef,children:r})}function T(e){let{tree:t,segmentPath:r,cacheNode:n,url:u}=e,i=(0,a.useContext)(c.GlobalLayoutRouterContext);if(!i)throw Object.defineProperty(Error("invariant global layout router not mounted"),"__NEXT_ERROR_CODE",{value:"E473",enumerable:!1,configurable:!0});let{tree:d}=i,h=null!==n.prefetchRsc?n.prefetchRsc:n.rsc,_=(0,a.useDeferredValue)(n.rsc,h),y="object"==typeof _&&null!==_&&"function"==typeof _.then?(0,a.use)(_):_;if(!y){let e=n.lazyData;if(null===e){let t=function e(t,r){if(t){let[n,u]=t,o=2===t.length;if((0,p.matchSegment)(r[0],n)&&r[1].hasOwnProperty(u)){if(o){let t=e(void 0,r[1][u]);return[r[0],{...r[1],[u]:[t[0],t[1],t[2],"refetch"]}]}return[r[0],{...r[1],[u]:e(t.slice(2),r[1][u])}]}}return r}(["",...r],d),o=(0,v.hasInterceptionRouteInCurrentTree)(d),c=Date.now();n.lazyData=e=(0,s.fetchServerResponse)(new URL(u,location.origin),{flightRouterState:t,nextUrl:o?i.nextUrl:null}).then(e=>((0,a.startTransition)(()=>{(0,g.dispatchAppRouterAction)({type:l.ACTION_SERVER_PATCH,previousTree:d,serverResponse:e,navigatedAt:c})}),e)),(0,a.use)(e)}(0,a.use)(f.unresolvedThenable)}return(0,o.jsx)(c.LayoutRouterContext.Provider,{value:{parentTree:t,parentCacheNode:n,parentSegmentPath:r,url:u},children:y})}function S(e){let t,{loading:r,children:n}=e;if(t="object"==typeof r&&null!==r&&"function"==typeof r.then?(0,a.use)(r):r){let e=t[0],r=t[1],u=t[2];return(0,o.jsx)(a.Suspense,{fallback:(0,o.jsxs)(o.Fragment,{children:[r,u,e]}),children:n})}return(0,o.jsx)(o.Fragment,{children:n})}function M(e){let{parallelRouterKey:t,error:r,errorStyles:n,errorScripts:u,templateStyles:l,templateScripts:i,template:s,notFound:f,forbidden:p,unauthorized:h,segmentViewBoundaries:v}=e,g=(0,a.useContext)(c.LayoutRouterContext);if(!g)throw Object.defineProperty(Error("invariant expected layout router to be mounted"),"__NEXT_ERROR_CODE",{value:"E56",enumerable:!1,configurable:!0});let{parentTree:E,parentCacheNode:R,parentSegmentPath:O,url:P}=g,M=R.parallelRoutes,w=M.get(t);w||(w=new Map,M.set(t,w));let A=E[0],C=null===O?[t]:O.concat([A,t]),x=E[1][t],N=x[0],U=(0,b.createRouterCacheKey)(N,!0),D=(0,m.useRouterBFCache)(x,U),L=[];do{let e=D.tree,t=D.stateKey,a=e[0],v=(0,b.createRouterCacheKey)(a),g=w.get(v);if(void 0===g){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1};g=e,w.set(v,e)}let m=R.loading,E=(0,o.jsxs)(c.TemplateContext.Provider,{value:(0,o.jsxs)(j,{segmentPath:C,children:[(0,o.jsx)(d.ErrorBoundary,{errorComponent:r,errorStyles:n,errorScripts:u,children:(0,o.jsx)(S,{loading:m,children:(0,o.jsx)(y.HTTPAccessFallbackBoundary,{notFound:f,forbidden:p,unauthorized:h,children:(0,o.jsxs)(_.RedirectBoundary,{children:[(0,o.jsx)(T,{url:P,tree:e,cacheNode:g,segmentPath:C}),null]})})})}),null]}),children:[l,i,s]},t);L.push(E),D=D.next}while(null!==D);return L}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10531:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectBoundary:function(){return f},RedirectErrorBoundary:function(){return s}});let n=r(49417),u=r(95155),o=n._(r(12115)),l=r(47260),a=r(86542),i=r(86437);function c(e){let{redirect:t,reset:r,redirectType:n}=e,u=(0,l.useRouter)();return(0,o.useEffect)(()=>{o.default.startTransition(()=>{n===i.RedirectType.push?u.push(t,{}):u.replace(t,{}),r()})},[t,n,r,u]),null}class s extends o.default.Component{static getDerivedStateFromError(e){if((0,i.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,u.jsx)(c,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function f(e){let{children:t}=e,r=(0,l.useRouter)();return(0,u.jsx)(s,{router:r,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"findHeadInCache",{enumerable:!0,get:function(){return o}});let n=r(65360),u=r(69190);function o(e,t){return function e(t,r,o,l){if(0===Object.keys(r).length)return[t,o,l];let a=Object.keys(r).filter(e=>"children"!==e);for(let l of("children"in r&&a.unshift("children"),a)){let[a,i]=r[l];if(a===n.DEFAULT_SEGMENT_KEY)continue;let c=t.parallelRoutes.get(l);if(!c)continue;let s=(0,u.createRouterCacheKey)(a),f=(0,u.createRouterCacheKey)(a,!0),d=c.get(s);if(!d)continue;let p=e(d,i,o+"/"+s,o+"/"+f);if(p)return p}return null}(e,t,"","")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return o}});let n=r(86343);function u(e){return void 0!==e}function o(e,t){var r,o;let l=null==(r=t.shouldScroll)||r,a=e.nextUrl;if(u(t.patchedTree)){let r=(0,n.computeChangedPath)(e.tree,t.patchedTree);r?a=r:a||(a=e.canonicalUrl)}return{canonicalUrl:u(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:u(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:u(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:u(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!l&&(!!u(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:t.onlyHashChange||!1,hashFragment:l?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:l?null!=(o=null==t?void 0:t.scrollableSegments)?o:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:u(t.patchedTree)?t.patchedTree:e.tree,nextUrl:a}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createMutableActionQueue:function(){return _},dispatchNavigateAction:function(){return v},dispatchTraverseAction:function(){return g},getCurrentAppRouterState:function(){return y},publicAppRouterInstance:function(){return m}});let n=r(86871),u=r(68451),o=r(12115),l=r(54089);r(66048);let a=r(76248),i=r(96058),c=r(17297),s=r(43933),f=r(63499);function d(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?p({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:n.ACTION_REFRESH,origin:window.location.origin},t)))}async function p(e){let{actionQueue:t,action:r,setState:n}=e,u=t.state;t.pending=r;let o=r.payload,a=t.action(u,o);function i(e){r.discarded||(t.state=e,d(t,n),r.resolve(e))}(0,l.isThenable)(a)?a.then(i,e=>{d(t,n),r.reject(e)}):i(a)}let h=null;function _(e,t){let r={state:e,dispatch:(e,t)=>(function(e,t,r){let u={resolve:r,reject:()=>{}};if(t.type!==n.ACTION_RESTORE){let e=new Promise((e,t)=>{u={resolve:e,reject:t}});(0,o.startTransition)(()=>{r(e)})}let l={payload:t,next:null,resolve:u.resolve,reject:u.reject};null===e.pending?(e.last=l,p({actionQueue:e,action:l,setState:r})):t.type===n.ACTION_NAVIGATE||t.type===n.ACTION_RESTORE?(e.pending.discarded=!0,l.next=e.pending.next,e.pending.payload.type===n.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),p({actionQueue:e,action:l,setState:r})):(null!==e.last&&(e.last.next=l),e.last=l)})(r,e,t),action:async(e,t)=>(0,u.reducer)(e,t),pending:null,last:null,onRouterTransitionStart:null!==t&&"function"==typeof t.onRouterTransitionStart?t.onRouterTransitionStart:null};if(null!==h)throw Object.defineProperty(Error("Internal Next.js Error: createMutableActionQueue was called more than once"),"__NEXT_ERROR_CODE",{value:"E624",enumerable:!1,configurable:!0});return h=r,r}function y(){return null!==h?h.state:null}function b(){return null!==h?h.onRouterTransitionStart:null}function v(e,t,r,u){let o=new URL((0,i.addBasePath)(e),location.href);(0,f.setLinkForCurrentNavigation)(u);let l=b();null!==l&&l(e,t),(0,a.dispatchAppRouterAction)({type:n.ACTION_NAVIGATE,url:o,isExternalUrl:(0,c.isExternalURL)(o),locationSearch:location.search,shouldScroll:r,navigateType:t,allowAliasing:!0})}function g(e,t){let r=b();null!==r&&r(e,"traverse"),(0,a.dispatchAppRouterAction)({type:n.ACTION_RESTORE,url:new URL(e),tree:t})}let m={back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let r=function(){if(null===h)throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0});return h}(),u=(0,c.createPrefetchURL)(e);if(null!==u){var o;(0,s.prefetchReducer)(r.state,{type:n.ACTION_PREFETCH,url:u,kind:null!=(o=null==t?void 0:t.kind)?o:n.PrefetchKind.FULL})}},replace:(e,t)=>{(0,o.startTransition)(()=>{var r;v(e,"replace",null==(r=null==t?void 0:t.scroll)||r,null)})},push:(e,t)=>{(0,o.startTransition)(()=>{var r;v(e,"push",null==(r=null==t?void 0:t.scroll)||r,null)})},refresh:()=>{(0,o.startTransition)(()=>{(0,a.dispatchAppRouterAction)({type:n.ACTION_REFRESH,origin:window.location.origin})})},hmrRefresh:()=>{throw Object.defineProperty(Error("hmrRefresh can only be used in development mode. Please use refresh instead."),"__NEXT_ERROR_CODE",{value:"E485",enumerable:!1,configurable:!0})}};window.next&&(window.next.router=m),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12115:(e,t,r)=>{"use strict";e.exports=r(61426)},12669:(e,t,r)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=r(59248)},12845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{UnrecognizedActionError:function(){return r},unstable_isUnrecognizedActionError:function(){return n}});class r extends Error{constructor(...e){super(...e),this.name="UnrecognizedActionError"}}function n(e){return!!(e&&"object"==typeof e&&e instanceof r)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{computeCacheBustingSearchParam:function(){return i},computeLegacyCacheBustingSearchParam:function(){return c}});let n=r(60075),u=new TextEncoder;function o(e){return void 0===e?"0":Array.isArray(e)?e.join(","):e}function l(e,t,r,n){return(void 0===e||"0"===e)&&void 0===t&&void 0===r&&void 0===n?null:[null!=e?e:"0",o(t),o(r),o(n)].join(",")}async function a(e){var t=new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",u.encode(e))).subarray(0,12);let r="";for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTML_LIMITED_BOT_UA_RE",{enumerable:!0,get:function(){return r}});let r=/[\w-]+-Google|Google-[\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight/i},15278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AsyncMetadataOutlet",{enumerable:!0,get:function(){return l}});let n=r(95155),u=r(12115);function o(e){let{promise:t}=e,{error:r,digest:n}=(0,u.use)(t);if(r)throw n&&(r.digest=n),r;return null}function l(e){let{promise:t}=e;return(0,n.jsx)(u.Suspense,{fallback:null,children:(0,n.jsx)(o,{promise:t})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},15860:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HandleISRError",{enumerable:!0,get:function(){return n}});let r=void 0;function n(e){let{error:t}=e;if(r){let e=r.getStore();if((null==e?void 0:e.isRevalidate)||(null==e?void 0:e.isStaticGeneration))throw console.error(t),t}return null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},15903:(e,t,r)=>{"use strict";function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}r.r(t),r.d(t,{_:()=>n})},16378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getFlightDataPartsFromPath:function(){return u},getNextFlightSegmentPath:function(){return o},normalizeFlightData:function(){return l},prepareFlightRouterStateForRequest:function(){return a}});let n=r(65360);function u(e){var t;let[r,n,u,o]=e.slice(-4),l=e.slice(0,-4);return{pathToSegment:l.slice(0,-1),segmentPath:l,segment:null!=(t=l[l.length-1])?t:"",tree:r,seedData:n,head:u,isHeadPartial:o,isRootRender:4===e.length}}function o(e){return e.slice(2)}function l(e){return"string"==typeof e?e:e.map(e=>u(e))}function a(e,t){return t?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(JSON.stringify(function e(t){var r,u;let[o,l,a,i,c,s]=t,f="string"==typeof(r=o)&&r.startsWith(n.PAGE_SEGMENT_KEY+"?")?n.PAGE_SEGMENT_KEY:r,d={};for(let[t,r]of Object.entries(l))d[t]=e(r);let p=[f,d,null,(u=i)&&"refresh"!==u?i:null];return void 0!==c&&(p[4]=c),void 0!==s&&(p[5]=s),p}(e)))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16486:(e,t)=>{"use strict";function r(e){return Object.prototype.toString.call(e)}function n(e){if("[object Object]"!==r(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getObjectClassLabel:function(){return r},isPlainObject:function(){return n}})},17297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createEmptyCacheNode:function(){return x},createPrefetchURL:function(){return A},default:function(){return L},isExternalURL:function(){return w}});let n=r(28140),u=r(49417),o=r(95155),l=u._(r(12115)),a=r(46752),i=r(86871),c=r(29658),s=r(3865),f=r(76248),d=r(93913),p=r(96058),h=r(43443),_=r(10531),y=r(10836),b=r(48359),v=r(51755),g=r(92929),m=r(86343),E=r(61489),R=r(11807),O=r(86542),P=r(86437);r(63499);let j=n._(r(28890)),T=n._(r(57150)),S=r(24431),M={};function w(e){return e.origin!==window.location.origin}function A(e){let t;if((0,d.isBot)(window.navigator.userAgent))return null;try{t=new URL((0,p.addBasePath)(e),window.location.href)}catch(t){throw Object.defineProperty(Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL."),"__NEXT_ERROR_CODE",{value:"E234",enumerable:!1,configurable:!0})}return w(t)?null:t}function C(e){let{appRouterState:t}=e;return(0,l.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:n}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,c.createHrefFromUrl)(new URL(window.location.href))!==n?(r.pendingPush=!1,window.history.pushState(u,"",n)):window.history.replaceState(u,"",n)},[t]),(0,l.useEffect)(()=>{},[t.nextUrl,t.tree]),null}function x(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1}}function N(e){null==e&&(e={});let t=window.history.state,r=null==t?void 0:t.__NA;r&&(e.__NA=r);let n=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return n&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=n),e}function U(e){let{headCacheNode:t}=e,r=null!==t?t.head:null,n=null!==t?t.prefetchHead:null,u=null!==n?n:r;return(0,l.useDeferredValue)(r,u)}function D(e){let t,{actionQueue:r,assetPrefix:n,globalError:u}=e,c=(0,f.useActionQueue)(r),{canonicalUrl:d}=c,{searchParams:p,pathname:E}=(0,l.useMemo)(()=>{let e=new URL(d,window.location.href);return{searchParams:e.searchParams,pathname:(0,g.hasBasePath)(e.pathname)?(0,v.removeBasePath)(e.pathname):e.pathname}},[d]);(0,l.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(M.pendingMpaPath=void 0,(0,f.dispatchAppRouterAction)({type:i.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[]),(0,l.useEffect)(()=>{function e(e){let t="reason"in e?e.reason:e.error;if((0,P.isRedirectError)(t)){e.preventDefault();let r=(0,O.getURLFromRedirectError)(t);(0,O.getRedirectTypeFromError)(t)===P.RedirectType.push?R.publicAppRouterInstance.push(r,{}):R.publicAppRouterInstance.replace(r,{})}}return window.addEventListener("error",e),window.addEventListener("unhandledrejection",e),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",e)}},[]);let{pushRef:T}=c;if(T.mpaNavigation){if(M.pendingMpaPath!==d){let e=window.location;T.pendingPush?e.assign(d):e.replace(d),M.pendingMpaPath=d}throw b.unresolvedThenable}(0,l.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),r=e=>{var t;let r=window.location.href,n=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,l.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:i.ACTION_RESTORE,url:new URL(null!=e?e:r,r),tree:n})})};window.history.pushState=function(t,n,u){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=N(t),u&&r(u)),e(t,n,u)},window.history.replaceState=function(e,n,u){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=N(e),u&&r(u)),t(e,n,u)};let n=e=>{if(e.state){if(!e.state.__NA)return void window.location.reload();(0,l.startTransition)(()=>{(0,R.dispatchTraverseAction)(window.location.href,e.state.__PRIVATE_NEXTJS_INTERNALS_TREE)})}};return window.addEventListener("popstate",n),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",n)}},[]);let{cache:w,tree:A,nextUrl:x,focusAndScrollRef:D}=c,L=(0,l.useMemo)(()=>(0,y.findHeadInCache)(w,A[1]),[w,A]),I=(0,l.useMemo)(()=>(0,m.getSelectedParams)(A),[A]),k=(0,l.useMemo)(()=>({parentTree:A,parentCacheNode:w,parentSegmentPath:null,url:d}),[A,w,d]),H=(0,l.useMemo)(()=>({tree:A,focusAndScrollRef:D,nextUrl:x}),[A,D,x]);if(null!==L){let[e,r,n]=L;t=(0,o.jsx)(U,{headCacheNode:e},r)}else t=null;let B=(0,o.jsxs)(_.RedirectBoundary,{children:[t,(0,o.jsx)(S.RootLayoutBoundary,{children:w.rsc}),(0,o.jsx)(h.AppRouterAnnouncer,{tree:A})]});return B=(0,o.jsx)(j.default,{errorComponent:u[0],errorStyles:u[1],children:B}),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(C,{appRouterState:c}),(0,o.jsx)(F,{}),(0,o.jsx)(s.PathParamsContext.Provider,{value:I,children:(0,o.jsx)(s.PathnameContext.Provider,{value:E,children:(0,o.jsx)(s.SearchParamsContext.Provider,{value:p,children:(0,o.jsx)(a.GlobalLayoutRouterContext.Provider,{value:H,children:(0,o.jsx)(a.AppRouterContext.Provider,{value:R.publicAppRouterInstance,children:(0,o.jsx)(a.LayoutRouterContext.Provider,{value:k,children:B})})})})})})]})}function L(e){let{actionQueue:t,globalErrorState:r,assetPrefix:n}=e;(0,E.useNavFailureHandler)();let u=(0,o.jsx)(D,{actionQueue:t,assetPrefix:n,globalError:r});return(0,o.jsx)(j.default,{errorComponent:T.default,children:u})}let I=new Set,k=new Set;function F(){let[,e]=l.default.useState(0),t=I.size;return(0,l.useEffect)(()=>{let r=()=>e(e=>e+1);return k.add(r),t!==I.size&&r(),()=>{k.delete(r)}},[t,e]),[...I].map((e,t)=>(0,o.jsx)("link",{rel:"stylesheet",href:""+e,precedence:"next"},t))}globalThis._N_E_STYLE_LOAD=function(e){let t=I.size;return I.add(e),I.size!==t&&k.forEach(e=>e()),Promise.resolve()},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17797:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_:()=>u});var n=0;function u(e){return"__private_"+n+++"_"+e}},17989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientSegmentRoot",{enumerable:!0,get:function(){return u}});let n=r(95155);function u(e){let{Component:t,slots:u,params:o,promise:l}=e;{let{createRenderParamsFromClient:e}=r(307),l=e(o);return(0,n.jsx)(t,{...u,params:l})}}r(48302),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20396:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{setCacheBustingSearchParam:function(){return l},setCacheBustingSearchParamWithHash:function(){return a}});let n=r(13485),u=r(52486);async function o(e){var t,r;return"function"==typeof(null==(r=globalThis.crypto)||null==(t=r.subtle)?void 0:t.digest)?(0,n.computeCacheBustingSearchParam)(e[u.NEXT_ROUTER_PREFETCH_HEADER],e[u.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER],e[u.NEXT_ROUTER_STATE_TREE_HEADER],e[u.NEXT_URL]):(0,n.computeLegacyCacheBustingSearchParam)(e[u.NEXT_ROUTER_PREFETCH_HEADER],e[u.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER],e[u.NEXT_ROUTER_STATE_TREE_HEADER],e[u.NEXT_URL])}let l=async(e,t)=>{a(e,await o(t))},a=(e,t)=>{let r=e.search,n=(r.startsWith("?")?r.slice(1):r).split("&").filter(e=>e&&!e.startsWith(""+u.NEXT_RSC_UNION_QUERY+"="));t.length>0?n.push(u.NEXT_RSC_UNION_QUERY+"="+t):n.push(""+u.NEXT_RSC_UNION_QUERY),e.search=n.length?"?"+n.join("&"):""};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{addSearchParamsToPageSegments:function(){return d},handleAliasedPrefetchEntry:function(){return f}});let n=r(65360),u=r(17297),o=r(60895),l=r(29658),a=r(69190),i=r(60543),c=r(11126),s=r(35737);function f(e,t,r,f,p){let h,_=t.tree,y=t.cache,b=(0,l.createHrefFromUrl)(f),v=[];if("string"==typeof r)return!1;for(let t of r){if(!function e(t){if(!t)return!1;let r=t[2];if(t[3])return!0;for(let t in r)if(e(r[t]))return!0;return!1}(t.seedData))continue;let r=t.tree;r=d(r,Object.fromEntries(f.searchParams));let{seedData:l,isRootRender:c,pathToSegment:p}=t,g=["",...p];r=d(r,Object.fromEntries(f.searchParams));let m=(0,o.applyRouterStatePatchToTree)(g,_,r,b),E=(0,u.createEmptyCacheNode)();if(c&&l){let t=l[1];E.loading=l[3],E.rsc=t,function e(t,r,u,o,l){if(0!==Object.keys(o[1]).length)for(let i in o[1]){let c,s=o[1][i],f=s[0],d=(0,a.createRouterCacheKey)(f),p=null!==l&&void 0!==l[2][i]?l[2][i]:null;if(null!==p){let e=p[1],r=p[3];c={lazyData:null,rsc:f.includes(n.PAGE_SEGMENT_KEY)?null:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:r,navigatedAt:t}}else c={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1};let h=r.parallelRoutes.get(i);h?h.set(d,c):r.parallelRoutes.set(i,new Map([[d,c]])),e(t,c,u,s,p)}}(e,E,y,r,l)}else E.rsc=y.rsc,E.prefetchRsc=y.prefetchRsc,E.loading=y.loading,E.parallelRoutes=new Map(y.parallelRoutes),(0,i.fillCacheWithNewSubTreeDataButOnlyLoading)(e,E,y,t);for(let e of(m&&(_=m,y=E,h=!0),(0,s.generateSegmentsFromPatch)(r))){let r=[...t.pathToSegment,...e];r[r.length-1]!==n.DEFAULT_SEGMENT_KEY&&v.push(r)}}return!!h&&(p.patchedTree=_,p.cache=y,p.canonicalUrl=b,p.hashFragment=f.hash,p.scrollableSegments=v,(0,c.handleMutable)(t,p))}function d(e,t){let[r,u,...o]=e;if(r.includes(n.PAGE_SEGMENT_KEY))return[(0,n.addSearchParamsIfPageSegment)(r,t),u,...o];let l={};for(let[e,r]of Object.entries(u))l[e]=d(r,t);return[r,l,...o]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,r){let[n,u,,l]=t;for(let a in n.includes(o.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=r,t[3]="refresh"),u)e(u[a],r)}},refreshInactiveParallelSegments:function(){return l}});let n=r(77609),u=r(32753),o=r(65360);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{navigatedAt:t,state:r,updatedTree:o,updatedCache:l,includeNextUrl:i,fetchedSegments:c,rootTree:s=o,canonicalUrl:f}=e,[,d,p,h]=o,_=[];if(p&&p!==f&&"refresh"===h&&!c.has(p)){c.add(p);let e=(0,u.fetchServerResponse)(new URL(p,location.origin),{flightRouterState:[s[0],s[1],s[2],"refetch"],nextUrl:i?r.nextUrl:null}).then(e=>{let{flightData:r}=e;if("string"!=typeof r)for(let e of r)(0,n.applyFlightData)(t,l,l,e)});_.push(e)}for(let e in d){let n=a({navigatedAt:t,state:r,updatedTree:d[e],updatedCache:l,includeNextUrl:i,fetchedSegments:c,rootTree:s,canonicalUrl:f});_.push(n)}await Promise.all(_)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{describeHasCheckingStringProperty:function(){return u},describeStringPropertyAccess:function(){return n},wellKnownProperties:function(){return o}});let r=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function n(e,t){return r.test(t)?"`"+e+"."+t+"`":"`"+e+"["+JSON.stringify(t)+"]`"}function u(e,t){let r=JSON.stringify(t);return"`Reflect.has("+e+", "+r+")`, `"+r+" in "+e+"`, or similar"}let o=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule","@@iterator"])},24431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MetadataBoundary:function(){return o},OutletBoundary:function(){return a},RootLayoutBoundary:function(){return i},ViewportBoundary:function(){return l}});let n=r(68440),u={[n.METADATA_BOUNDARY_NAME]:function(e){let{children:t}=e;return t},[n.VIEWPORT_BOUNDARY_NAME]:function(e){let{children:t}=e;return t},[n.OUTLET_BOUNDARY_NAME]:function(e){let{children:t}=e;return t},[n.ROOT_LAYOUT_BOUNDARY_NAME]:function(e){let{children:t}=e;return t}},o=u[n.METADATA_BOUNDARY_NAME.slice(0)],l=u[n.VIEWPORT_BOUNDARY_NAME.slice(0)],a=u[n.OUTLET_BOUNDARY_NAME.slice(0)],i=u[n.ROOT_LAYOUT_BOUNDARY_NAME.slice(0)]},24553:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{BailoutToCSRError:function(){return n},isBailoutToCSRError:function(){return u}});let r="BAILOUT_TO_CLIENT_SIDE_RENDERING";class n extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=r}}function u(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===r}},26381:(e,t)=>{"use strict";function r(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(98301);let n=r(77278);{let e=r.u;r.u=function(){for(var t=arguments.length,r=Array(t),u=0;u{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.r(t),r.d(t,{_:()=>n})},28890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(28140),u=r(95155);r(12115);let o=n._(r(77759)),l=r(88785),a=(0,r(93913).isBot)(window.navigator.userAgent);function i(e){let{children:t,errorComponent:r,errorStyles:n,errorScripts:i}=e;return a?(0,u.jsx)(o.default,{children:t}):(0,u.jsx)(l.ErrorBoundary,{errorComponent:r,errorStyles:n,errorScripts:i,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29658:(e,t)=>{"use strict";function r(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,r,o,l,a,i,c){if(0===Object.keys(l[1]).length){r.head=i;return}for(let s in l[1]){let f,d=l[1][s],p=d[0],h=(0,n.createRouterCacheKey)(p),_=null!==a&&void 0!==a[2][s]?a[2][s]:null;if(o){let n=o.parallelRoutes.get(s);if(n){let o,l=(null==c?void 0:c.kind)==="auto"&&c.status===u.PrefetchCacheEntryStatus.reusable,a=new Map(n),f=a.get(h);o=null!==_?{lazyData:null,rsc:_[1],prefetchRsc:null,head:null,prefetchHead:null,loading:_[3],parallelRoutes:new Map(null==f?void 0:f.parallelRoutes),navigatedAt:t}:l&&f?{lazyData:f.lazyData,rsc:f.rsc,prefetchRsc:f.prefetchRsc,head:f.head,prefetchHead:f.prefetchHead,parallelRoutes:new Map(f.parallelRoutes),loading:f.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==f?void 0:f.parallelRoutes),loading:null,navigatedAt:t},a.set(h,o),e(t,o,f,d,_||null,i,c),r.parallelRoutes.set(s,a);continue}}if(null!==_){let e=_[1],r=_[3];f={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:r,navigatedAt:t}}else f={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:t};let y=r.parallelRoutes.get(s);y?y.set(h,f):r.parallelRoutes.set(s,new Map([[h,f]])),e(t,f,void 0,d,_,i,c)}}}});let n=r(69190),u=r(86871);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},32753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createFetch:function(){return y},createFromNextReadableStream:function(){return b},fetchServerResponse:function(){return _}});let n=r(77197),u=r(52486),o=r(41209),l=r(85153),a=r(86871),i=r(16378),c=r(3201),s=r(20396),f=r(93223),d=n.createFromReadableStream;function p(e){return{flightData:(0,f.urlToUrlWithoutFlightMarker)(new URL(e,location.origin)).toString(),canonicalUrl:void 0,couldBeIntercepted:!1,prerendered:!1,postponed:!1,staleTime:-1}}let h=new AbortController;async function _(e,t){let{flightRouterState:r,nextUrl:n,prefetchKind:o}=t,l={[u.RSC_HEADER]:"1",[u.NEXT_ROUTER_STATE_TREE_HEADER]:(0,i.prepareFlightRouterStateForRequest)(r,t.isHmrRefresh)};o===a.PrefetchKind.AUTO&&(l[u.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(l[u.NEXT_URL]=n);try{var s;let t=o?o===a.PrefetchKind.TEMPORARY?"high":"low":"auto";(e=new URL(e)).pathname.endsWith("/")?e.pathname+="index.txt":e.pathname+=".txt";let r=await y(e,l,t,h.signal),n=(0,f.urlToUrlWithoutFlightMarker)(new URL(r.url)),d=r.redirected?n:void 0,_=r.headers.get("content-type")||"",v=!!(null==(s=r.headers.get("vary"))?void 0:s.includes(u.NEXT_URL)),g=!!r.headers.get(u.NEXT_DID_POSTPONE_HEADER),m=r.headers.get(u.NEXT_ROUTER_STALE_TIME_HEADER),E=null!==m?1e3*parseInt(m,10):-1,R=_.startsWith(u.RSC_CONTENT_TYPE_HEADER);if(R||(R=_.startsWith("text/plain")),!R||!r.ok||!r.body)return e.hash&&(n.hash=e.hash),p(n.toString());let O=g?function(e){let t=e.getReader();return new ReadableStream({async pull(e){for(;;){let{done:r,value:n}=await t.read();if(!r){e.enqueue(n);continue}return}}})}(r.body):r.body,P=await b(O);if((0,c.getAppBuildId)()!==P.b)return p(r.url);return{flightData:(0,i.normalizeFlightData)(P.f),canonicalUrl:d,couldBeIntercepted:v,prerendered:P.S,postponed:g,staleTime:E}}catch(t){return h.signal.aborted||console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),{flightData:e.toString(),canonicalUrl:void 0,couldBeIntercepted:!1,prerendered:!1,postponed:!1,staleTime:-1}}}async function y(e,t,r,n){let o=new URL(e);await (0,s.setCacheBustingSearchParam)(o,t);let l=await fetch(o,{credentials:"same-origin",headers:t,priority:r||void 0,signal:n}),a=l.redirected,i=new URL(l.url,o);return i.searchParams.delete(u.NEXT_RSC_UNION_QUERY),{url:i.href,redirected:a,ok:l.ok,headers:l.headers,body:l.body,status:l.status}}function b(e){return d(e,{callServer:o.callServer,findSourceMapURL:l.findSourceMapURL})}window.addEventListener("pagehide",()=>{h.abort()}),window.addEventListener("pageshow",()=>{h=new AbortController}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return s},RedirectType:function(){return u.RedirectType},forbidden:function(){return l.forbidden},notFound:function(){return o.notFound},permanentRedirect:function(){return n.permanentRedirect},redirect:function(){return n.redirect},unauthorized:function(){return a.unauthorized},unstable_isUnrecognizedActionError:function(){return f},unstable_rethrow:function(){return i.unstable_rethrow}});let n=r(86542),u=r(86437),o=r(42542),l=r(71099),a=r(6640),i=r(3860);class c extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class s extends URLSearchParams{append(){throw new c}delete(){throw new c}set(){throw new c}sort(){throw new c}}function f(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{generateSegmentsFromPatch:function(){return m},handleExternalUrl:function(){return g},navigateReducer:function(){return function e(t,r){let{url:E,isExternalUrl:R,navigateType:O,shouldScroll:P,allowAliasing:j}=r,T={},{hash:S}=E,M=(0,u.createHrefFromUrl)(E),w="push"===O;if((0,y.prunePrefetchCache)(t.prefetchCache),T.preserveCustomHistoryState=!1,T.pendingPush=w,R)return g(t,T,E.toString(),w);if(document.getElementById("__next-page-redirect"))return g(t,T,M,w);let A=(0,y.getOrCreatePrefetchCacheEntry)({url:E,nextUrl:t.nextUrl,tree:t.tree,prefetchCache:t.prefetchCache,allowAliasing:j}),{treeAtTimeOfPrefetch:C,data:x}=A;return d.prefetchQueue.bump(x),x.then(d=>{let{flightData:y,canonicalUrl:R,postponed:O}=d,j=Date.now(),x=!1;if(A.lastUsedTime||(A.lastUsedTime=j,x=!0),A.aliased){let n=new URL(E.href);R&&(n.pathname=R.pathname);let u=(0,v.handleAliasedPrefetchEntry)(j,t,y,n,T);return!1===u?e(t,{...r,allowAliasing:!1}):u}if("string"==typeof y)return g(t,T,y,w);let N=R?(0,u.createHrefFromUrl)(R):M;if(S&&t.canonicalUrl.split("#",1)[0]===N.split("#",1)[0])return T.onlyHashChange=!0,T.canonicalUrl=N,T.shouldScroll=P,T.hashFragment=S,T.scrollableSegments=[],(0,s.handleMutable)(t,T);let U=t.tree,D=t.cache,L=[];for(let e of y){let{pathToSegment:r,seedData:u,head:s,isHeadPartial:d,isRootRender:y}=e,v=e.tree,R=["",...r],P=(0,l.applyRouterStatePatchToTree)(R,U,v,M);if(null===P&&(P=(0,l.applyRouterStatePatchToTree)(R,C,v,M)),null!==P){if(u&&y&&O){let e=(0,_.startPPRNavigation)(j,D,U,v,u,s,d,!1,L);if(null!==e){if(null===e.route)return g(t,T,M,w);P=e.route;let r=e.node;null!==r&&(T.cache=r);let u=e.dynamicRequestTree;if(null!==u){let r=(0,n.fetchServerResponse)(new URL(N,E.origin),{flightRouterState:u,nextUrl:t.nextUrl});(0,_.listenForDynamicRequest)(e,r)}}else P=v}else{if((0,i.isNavigatingToNewRootLayout)(U,P))return g(t,T,M,w);let n=(0,p.createEmptyCacheNode)(),u=!1;for(let t of(A.status!==c.PrefetchCacheEntryStatus.stale||x?u=(0,f.applyFlightData)(j,D,n,e,A):(u=function(e,t,r,n){let u=!1;for(let o of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),m(n).map(e=>[...r,...e])))(0,b.clearCacheNodeDataForSegmentPath)(e,t,o),u=!0;return u}(n,D,r,v),A.lastUsedTime=j),(0,a.shouldHardNavigate)(R,U)?(n.rsc=D.rsc,n.prefetchRsc=D.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(n,D,r),T.cache=n):u&&(T.cache=n,D=n),m(v))){let e=[...r,...t];e[e.length-1]!==h.DEFAULT_SEGMENT_KEY&&L.push(e)}}U=P}}return T.patchedTree=U,T.canonicalUrl=N,T.scrollableSegments=L,T.hashFragment=S,T.shouldScroll=P,(0,s.handleMutable)(t,T)},()=>t)}}});let n=r(32753),u=r(29658),o=r(75597),l=r(60895),a=r(58130),i=r(44707),c=r(86871),s=r(11126),f=r(77609),d=r(43933),p=r(17297),h=r(65360),_=r(87317),y=r(83571),b=r(1281),v=r(21854);function g(e,t,r,n){return t.mpaNavigation=!0,t.canonicalUrl=r,t.pendingPush=n,t.scrollableSegments=void 0,(0,s.handleMutable)(e,t)}function m(e){let t=[],[r,n]=e;if(0===Object.keys(n).length)return[[r]];for(let[e,u]of Object.entries(n))for(let n of m(u))""===r?t.push([e,...n]):t.push([r,e,...n]);return t}r(66048),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return n}});let n=r(64869).createRenderSearchParamsFromClient;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return s}});let n=r(29658),u=r(60895),o=r(44707),l=r(35737),a=r(77609),i=r(11126),c=r(17297);function s(e,t){let{serverResponse:{flightData:r,canonicalUrl:s},navigatedAt:f}=t,d={};if(d.preserveCustomHistoryState=!1,"string"==typeof r)return(0,l.handleExternalUrl)(e,d,r,e.pushRef.pendingPush);let p=e.tree,h=e.cache;for(let t of r){let{segmentPath:r,tree:i}=t,_=(0,u.applyRouterStatePatchToTree)(["",...r],p,i,e.canonicalUrl);if(null===_)return e;if((0,o.isNavigatingToNewRootLayout)(p,_))return(0,l.handleExternalUrl)(e,d,e.canonicalUrl,e.pushRef.pendingPush);let y=s?(0,n.createHrefFromUrl)(s):void 0;y&&(d.canonicalUrl=y);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(f,h,b,t),d.patchedTree=_,d.cache=b,h=b,p=_}return(0,i.handleMutable)(e,d)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HTTPAccessErrorStatus:function(){return r},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return u},getAccessFallbackErrorTypeByStatus:function(){return a},getAccessFallbackHTTPStatus:function(){return l},isHTTPAccessFallbackError:function(){return o}});let r={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},n=new Set(Object.values(r)),u="NEXT_HTTP_ERROR_FALLBACK";function o(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,r]=e.digest.split(";");return t===u&&n.has(Number(r))}function l(e){return Number(e.digest.split(";")[1])}function a(e){switch(e){case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not-found";default:return}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return o}});let n=r(29658),u=r(86343);function o(e,t){var r;let{url:o,tree:l}=t,a=(0,n.createHrefFromUrl)(o),i=l||e.tree,c=e.cache;return{canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(r=(0,u.extractPathFromFlightRouterState)(i))?r:o.pathname}}r(87317),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let n=r(32753),u=r(29658),o=r(60895),l=r(44707),a=r(35737),i=r(11126),c=r(30637),s=r(17297),f=r(97332),d=r(48915),p=r(23597);function h(e,t){let{origin:r}=t,h={},_=e.canonicalUrl,y=e.tree;h.preserveCustomHistoryState=!1;let b=(0,s.createEmptyCacheNode)(),v=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);b.lazyData=(0,n.fetchServerResponse)(new URL(_,r),{flightRouterState:[y[0],y[1],y[2],"refetch"],nextUrl:v?e.nextUrl:null});let g=Date.now();return b.lazyData.then(async r=>{let{flightData:n,canonicalUrl:s}=r;if("string"==typeof n)return(0,a.handleExternalUrl)(e,h,n,e.pushRef.pendingPush);for(let r of(b.lazyData=null,n)){let{tree:n,seedData:i,head:d,isRootRender:m}=r;if(!m)return console.log("REFRESH FAILED"),e;let E=(0,o.applyRouterStatePatchToTree)([""],y,n,e.canonicalUrl);if(null===E)return(0,f.handleSegmentMismatch)(e,t,n);if((0,l.isNavigatingToNewRootLayout)(y,E))return(0,a.handleExternalUrl)(e,h,_,e.pushRef.pendingPush);let R=s?(0,u.createHrefFromUrl)(s):void 0;if(s&&(h.canonicalUrl=R),null!==i){let e=i[1],t=i[3];b.rsc=e,b.prefetchRsc=null,b.loading=t,(0,c.fillLazyItemsTillLeafWithHead)(g,b,void 0,n,i,d,void 0),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({navigatedAt:g,state:e,updatedTree:E,updatedCache:b,includeNextUrl:v,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=b,h.patchedTree=E,y=E}return(0,i.handleMutable)(e,h)},()=>e)}r(66048),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},39684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useRouterBFCache",{enumerable:!0,get:function(){return u}});let n=r(12115);function u(e,t){let[r,u]=(0,n.useState)(()=>({tree:e,stateKey:t,next:null}));if(r.tree===e)return r;let o={tree:e,stateKey:t,next:null},l=1,a=r,i=o;for(;null!==a&&l<1;){if(a.stateKey===t){i.next=a.next;break}{l++;let e={tree:a.tree,stateKey:a.stateKey,next:null};i.next=e,i=e}a=a.next}return u(o),o}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return l}});let n=r(12115),u=r(86871),o=r(76248);async function l(e,t){return new Promise((r,l)=>{(0,n.startTransition)(()=>{(0,o.dispatchAppRouterAction)({type:u.ACTION_SERVER_ACTION,actionId:e,actionArgs:t,resolve:r,reject:l})})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},42444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return u},getProperError:function(){return o}});let n=r(16486);function u(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function o(e){return u(e)?e:Object.defineProperty(Error((0,n.isPlainObject)(e)?function(e){let t=new WeakSet;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return r})}(e):e+""),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},42542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"notFound",{enumerable:!0,get:function(){return u}});let n=""+r(37099).HTTP_ERROR_FALLBACK_ERROR_CODE+";404";function u(){let e=Object.defineProperty(Error(n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw e.digest=n,e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AppRouterAnnouncer",{enumerable:!0,get:function(){return l}});let n=r(12115),u=r(47650),o="next-route-announcer";function l(e){let{tree:t}=e,[r,l]=(0,n.useState)(null);(0,n.useEffect)(()=>(l(function(){var e;let t=document.getElementsByName(o)[0];if(null==t||null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(o);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(o)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,n.useState)(""),c=(0,n.useRef)(void 0);return(0,n.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),r?(0,u.createPortal)(a,r):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{prefetchQueue:function(){return o},prefetchReducer:function(){return l}});let n=r(79889),u=r(83571),o=new n.PromiseQueue(5),l=function(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:r}=t;return(0,u.getOrCreatePrefetchCacheEntry)({url:r,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,allowAliasing:!0}),e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44707:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,r){let n=t[0],u=r[0];if(Array.isArray(n)&&Array.isArray(u)){if(n[0]!==u[0]||n[2]!==u[2])return!0}else if(n!==u)return!0;if(t[4])return!r[4];if(r[4])return!0;let o=Object.values(t[1])[0],l=Object.values(r[1])[0];return!o||!l||e(o,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},45009:(e,t,r)=>{"use strict";e.exports=r(47362)},46752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{AppRouterContext:function(){return u},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return o},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let n=r(28140)._(r(12115)),u=n.default.createContext(null),o=n.default.createContext(null),l=n.default.createContext(null),a=n.default.createContext(null),i=n.default.createContext(new Set)},47260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},forbidden:function(){return i.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},unauthorized:function(){return i.unauthorized},unstable_isUnrecognizedActionError:function(){return s.unstable_isUnrecognizedActionError},unstable_rethrow:function(){return i.unstable_rethrow},useParams:function(){return _},usePathname:function(){return p},useRouter:function(){return h},useSearchParams:function(){return d},useSelectedLayoutSegment:function(){return b},useSelectedLayoutSegments:function(){return y},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let n=r(12115),u=r(46752),o=r(3865),l=r(26381),a=r(65360),i=r(35439),c=r(72103),s=r(12845),f=void 0;function d(){let e=(0,n.useContext)(o.SearchParamsContext);return(0,n.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e])}function p(){return null==f||f("usePathname()"),(0,n.useContext)(o.PathnameContext)}function h(){let e=(0,n.useContext)(u.AppRouterContext);if(null===e)throw Object.defineProperty(Error("invariant expected app router to be mounted"),"__NEXT_ERROR_CODE",{value:"E238",enumerable:!1,configurable:!0});return e}function _(){return null==f||f("useParams()"),(0,n.useContext)(o.PathParamsContext)}function y(e){void 0===e&&(e="children"),null==f||f("useSelectedLayoutSegments()");let t=(0,n.useContext)(u.LayoutRouterContext);return t?function e(t,r,n,u){let o;if(void 0===n&&(n=!0),void 0===u&&(u=[]),n)o=t[1][r];else{var i;let e=t[1];o=null!=(i=e.children)?i:Object.values(e)[0]}if(!o)return u;let c=o[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?u:(u.push(s),e(o,r,!1,u))}(t.parentTree,e):null}function b(e){void 0===e&&(e="children"),null==f||f("useSelectedLayoutSegment()");let t=y(e);if(!t||0===t.length)return null;let r="children"===e?t[0]:t[t.length-1];return r===a.DEFAULT_SEGMENT_KEY?null:r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},47362:(e,t)=>{"use strict";function r(e,t){var r=e.length;for(e.push(t);0>>1,u=e[n];if(0>>1;no(i,r))co(s,i)?(e[n]=s,e[c]=r,n=c):(e[n]=i,e[a]=r,n=a);else if(co(s,r))e[n]=s,e[c]=r,n=c;else break}}return t}function o(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,_=!1,y=!1,b=!1,v=!1,g="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,E="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=n(f);null!==t;){if(null===t.callback)u(f);else if(t.startTime<=e)u(f),t.sortIndex=t.expirationTime,r(s,t);else break;t=n(f)}}function O(e){if(b=!1,R(e),!y)if(null!==n(s))y=!0,P||(P=!0,l());else{var t=n(f);null!==t&&x(O,t.startTime-e)}}var P=!1,j=-1,T=5,S=-1;function M(){return!!v||!(t.unstable_now()-Se&&M());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),r=!0;break t}p===n(s)&&u(s),R(e)}else u(s);p=n(s)}if(null!==p)r=!0;else{var c=n(f);null!==c&&x(O,c.startTime-e),r=!1}}break e}finally{p=null,h=o,_=!1}}}finally{r?l():P=!1}}}if("function"==typeof E)l=function(){E(w)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,C=A.port2;A.port1.onmessage=w,l=function(){C.postMessage(null)}}else l=function(){g(w,0)};function x(e,r){j=g(function(){e(t.unstable_now())},r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125a?(e.sortIndex=o,r(f,e),null===n(s)&&e===n(f)&&(b?(m(j),j=-1):b=!0,x(O,o-a))):(e.sortIndex=i,r(s,e),y||_||(y=!0,P||(P=!0,l()))),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}},47650:(e,t,r)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=r(58730)},48302:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"InvariantError",{enumerable:!0,get:function(){return r}});class r extends Error{constructor(e,t){super("Invariant: "+(e.endsWith(".")?e:e+".")+" This is a bug in Next.js.",t),this.name="InvariantError"}}},48359:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return r}});let r={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},48915:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasInterceptionRouteInCurrentTree",{enumerable:!0,get:function(){return function e(t){let[r,u]=t;if(Array.isArray(r)&&("di"===r[2]||"ci"===r[2])||"string"==typeof r&&(0,n.isInterceptionRouteAppPath)(r))return!0;if(u){for(let t in u)if(e(u[t]))return!0}return!1}}});let n=r(57630);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49417:(e,t,r)=>{"use strict";function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=o?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(u,l,a):u[l]=e[l]}return u.default=e,r&&r.set(e,u),u}r.r(t),r.d(t,{_:()=>u})},49781:(e,t,r)=>{"use strict";let n,u;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return U}});let o=r(28140),l=r(49417),a=r(95155);r(66001);let i=o._(r(12669)),c=l._(r(12115)),s=r(77197),f=r(82073),d=r(3789),p=r(65444),h=r(41209),_=r(85153),y=r(11807),b=o._(r(17297)),v=r(62592);r(46752);let g=r(3201),m=s.createFromReadableStream,E=document,R=new TextEncoder,O=!1,P=!1,j=null;function T(e){if(0===e[0])n=[];else if(1===e[0]){if(!n)throw Object.defineProperty(Error("Unexpected server data: missing bootstrap script."),"__NEXT_ERROR_CODE",{value:"E18",enumerable:!1,configurable:!0});u?u.enqueue(R.encode(e[1])):n.push(e[1])}else if(2===e[0])j=e[1];else if(3===e[0]){if(!n)throw Object.defineProperty(Error("Unexpected server data: missing bootstrap script."),"__NEXT_ERROR_CODE",{value:"E18",enumerable:!1,configurable:!0});let r=atob(e[1]),o=new Uint8Array(r.length);for(var t=0;t{e.enqueue("string"==typeof t?R.encode(t):t)}),O&&!P)&&(null===e.desiredSize||e.desiredSize<0?e.error(Object.defineProperty(Error("The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection."),"__NEXT_ERROR_CODE",{value:"E117",enumerable:!1,configurable:!0})):e.close(),P=!0,n=void 0),u=e}}),{callServer:h.callServer,findSourceMapURL:_.findSourceMapURL});function A(e){let{pendingActionQueue:t}=e,r=(0,c.use)(w),n=(0,c.use)(t);return(0,a.jsx)(b.default,{actionQueue:n,globalErrorState:r.G,assetPrefix:r.p})}let C=c.default.StrictMode;function x(e){let{children:t}=e;return t}let N={onDefaultTransitionIndicator:function(){return()=>{}},onRecoverableError:d.onRecoverableError,onCaughtError:p.onCaughtError,onUncaughtError:p.onUncaughtError};function U(e){let t=new Promise((t,r)=>{w.then(r=>{(0,g.setAppBuildId)(r.b);let n=Date.now();t((0,y.createMutableActionQueue)((0,v.createInitialRouterState)({navigatedAt:n,initialFlightData:r.f,initialCanonicalUrlParts:r.c,initialParallelRoutes:new Map,location:window.location,couldBeIntercepted:r.i,postponed:r.s,prerendered:r.S}),e))},e=>r(e))}),r=(0,a.jsx)(C,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(x,{children:(0,a.jsx)(A,{pendingActionQueue:t})})})});"__next_error__"===document.documentElement.id?i.default.createRoot(E,N).render(r):c.default.startTransition(()=>{i.default.hydrateRoot(E,r,{...N,formState:j})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useUntrackedPathname",{enumerable:!0,get:function(){return o}});let n=r(12115),u=r(3865);function o(){return(0,n.useContext)(u.PathnameContext)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return u}}),r(92929);let n="/demo";function u(e){return 0===n.length||(e=e.slice(n.length)).startsWith("/")||(e="/"+e),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_HEADER:function(){return n},FLIGHT_HEADERS:function(){return f},NEXT_ACTION_NOT_FOUND_HEADER:function(){return v},NEXT_DID_POSTPONE_HEADER:function(){return h},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return i},NEXT_HMR_REFRESH_HEADER:function(){return a},NEXT_IS_PRERENDER_HEADER:function(){return b},NEXT_REWRITTEN_PATH_HEADER:function(){return _},NEXT_REWRITTEN_QUERY_HEADER:function(){return y},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return l},NEXT_ROUTER_STALE_TIME_HEADER:function(){return p},NEXT_ROUTER_STATE_TREE_HEADER:function(){return u},NEXT_RSC_UNION_QUERY:function(){return d},NEXT_URL:function(){return c},RSC_CONTENT_TYPE_HEADER:function(){return s},RSC_HEADER:function(){return r}});let r="rsc",n="next-action",u="next-router-state-tree",o="next-router-prefetch",l="next-router-segment-prefetch",a="next-hmr-refresh",i="__next_hmr_refresh_hash__",c="next-url",s="text/x-component",f=[r,u,o,a,l],d="_rsc",p="x-nextjs-stale-time",h="x-nextjs-postponed",_="x-nextjs-rewritten-path",y="x-nextjs-rewritten-query",b="x-nextjs-prerender",v="x-nextjs-action-not-found";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53663:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return u}});let n=r(94681);function u(e){var t,r;t=self.__next_s,r=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[r,u]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");u&&(0,n.setAttributesFromProps)(o,u),r?(o.src=r,o.onload=()=>e(),o.onerror=t):u&&(o.innerHTML=u.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{r()}):r()}window.next={version:"15.5.26",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53965:e=>{!function(){var t={229:function(e){var t,r,n,u=e.exports={};function o(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var i=[],c=!1,s=-1;function f(){c&&n&&(c=!1,n.length?i=n.concat(i):s=-1,i.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=i.length;t;){for(n=i,i=[];++s1)for(var r=1;r{"use strict";function r(e){return null!==e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isThenable",{enumerable:!0,get:function(){return r}})},57150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let n=r(95155),u=r(15860),o={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}},l=function(e){let{error:t}=e,r=null==t?void 0:t.digest;return(0,n.jsxs)("html",{id:"__next_error__",children:[(0,n.jsx)("head",{}),(0,n.jsxs)("body",{children:[(0,n.jsx)(u.HandleISRError,{error:t}),(0,n.jsx)("div",{style:o.error,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{style:o.text,children:["Application error: a ",r?"server":"client","-side exception has occurred while loading ",window.location.hostname," (see the"," ",r?"server logs":"browser console"," for more information)."]}),r?(0,n.jsx)("p",{style:o.text,children:"Digest: "+r}):null]})})]})]})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},57630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return u},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return o}});let n=r(74061),u=["(..)(..)","(.)","(..)","(...)"];function o(e){return void 0!==e.split("/").find(e=>u.find(t=>e.startsWith(t)))}function l(e){let t,r,o;for(let n of e.split("/"))if(r=u.find(e=>n.startsWith(e))){[t,o]=e.split(r,2);break}if(!t||!r||!o)throw Object.defineProperty(Error("Invalid interception route: "+e+". Must be in the format //(..|...|..)(..)/"),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":o="/"===t?"/"+o:t+"/"+o;break;case"(..)":if("/"===t)throw Object.defineProperty(Error("Invalid interception route: "+e+". Cannot use (..) marker at the root level, use (.) instead."),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});o=t.split("/").slice(0,-1).concat(o).join("/");break;case"(...)":o="/"+o;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Object.defineProperty(Error("Invalid interception route: "+e+". Cannot use (..)(..) marker at the root level or one level up."),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});o=l.slice(0,-2).concat(o).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:o}}},58130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,r){let[o,l]=r,[a,i]=t;return(0,u.matchSegment)(a,o)?!(t.length<=2)&&e((0,n.getNextFlightSegmentPath)(t),l[i]):!!Array.isArray(a)}}});let n=r(16378),u=r(7460);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58730:(e,t,r)=>{"use strict";var n=r(12115);function u(e){var t="https://react.dev/errors/"+e;if(1{"use strict";function r(e){let t=5381;for(let r=0;r>>0}function n(e){return r(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{djb2Hash:function(){return r},hexHash:function(){return n}})},60543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fillCacheWithNewSubTreeData:function(){return i},fillCacheWithNewSubTreeDataButOnlyLoading:function(){return c}});let n=r(94201),u=r(30637),o=r(69190),l=r(65360);function a(e,t,r,a,i,c){let{segmentPath:s,seedData:f,tree:d,head:p}=a,h=t,_=r;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,r,n,i){let c,[s,f,d,p,h]=r;if(1===t.length){let e=a(r,n);return(0,l.addRefreshMarkerToActiveParallelSegments)(e,i),e}let[_,y]=t;if(!(0,o.matchSegment)(_,s))return null;if(2===t.length)c=a(f[y],n);else if(null===(c=e((0,u.getNextFlightSegmentPath)(t),f[y],n,i)))return null;let b=[t[0],{...f,[y]:c},d,p];return h&&(b[4]=!0),(0,l.addRefreshMarkerToActiveParallelSegments)(b,i),b}}});let n=r(65360),u=r(16378),o=r(7460),l=r(23597);function a(e,t){let[r,u]=e,[l,i]=t;if(l===n.DEFAULT_SEGMENT_KEY&&r!==n.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(r,l)){let t={};for(let e in u)void 0!==i[e]?t[e]=a(u[e],i[e]):t[e]=u[e];for(let e in i)t[e]||(t[e]=i[e]);let n=[r,t];return e[2]&&(n[2]=e[2]),e[3]&&(n[3]=e[3]),e[4]&&(n[4]=e[4]),n}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61426:(e,t,r)=>{"use strict";var n=r(95704),u=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),_=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function g(e,t,r){this.props=e,this.context=t,this.refs=v,this.updater=r||y}function m(){}function E(e,t,r){this.props=e,this.context=t,this.refs=v,this.updater=r||y}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var R=E.prototype=new m;R.constructor=E,b(R,g.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function P(){}var j={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function S(e,t,r){var n=r.ref;return{$$typeof:u,type:e,key:t,ref:void 0!==n?n:null,props:r}}function M(e){return"object"==typeof e&&null!==e&&e.$$typeof===u}var w=/\/+/g;function A(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function C(e,t,r){if(null==e)return e;var n=[],l=0;return!function e(t,r,n,l,a){var i,c,s,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var d=!1;if(null===t)d=!0;else switch(f){case"bigint":case"string":case"number":d=!0;break;case"object":switch(t.$$typeof){case u:case o:d=!0;break;case h:return e((d=t._init)(t._payload),r,n,l,a)}}if(d)return a=a(t),d=""===l?"."+A(t,0):l,O(a)?(n="",null!=d&&(n=d.replace(w,"$&/")+"/"),e(a,r,n,"",function(e){return e})):null!=a&&(M(a)&&(i=a,c=n+(null==a.key||t&&t.key===a.key?"":(""+a.key).replace(w,"$&/")+"/")+d,a=S(i.type,c,i.props)),r.push(a)),1;d=0;var p=""===l?".":l+":";if(O(t))for(var y=0;y{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{handleHardNavError:function(){return u},useNavFailureHandler:function(){return o}}),r(12115);let n=r(29658);function u(e){return!!e&&!!window.next.__pendingUrl&&(0,n.createHrefFromUrl)(new URL(window.location.href))!==(0,n.createHrefFromUrl)(window.next.__pendingUrl)&&(console.error("Error occurred during navigation, falling back to hard navigation",e),window.location.href=window.next.__pendingUrl.toString(),!0)}function o(){}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},62244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return A}});let n=r(41209),u=r(85153),o=r(52486),l=r(12845),a=r(77197),i=r(86871),c=r(66640),s=r(29658),f=r(35737),d=r(60895),p=r(44707),h=r(11126),_=r(30637),y=r(17297),b=r(48915),v=r(97332),g=r(23597),m=r(16378),E=r(86542),R=r(86437),O=r(83571),P=r(51755),j=r(92929),T=r(77519);r(66048);let S=a.createFromFetch;async function M(e,t,r){let i,s,f,d,{actionId:p,actionArgs:h}=r,_=(0,a.createTemporaryReferenceSet)(),y=(0,T.extractInfoFromServerReferenceId)(p),b="use-cache"===y.type?(0,T.omitUnusedArgs)(h,y):h,v=await (0,a.encodeReply)(b,{temporaryReferences:_}),g=await fetch(e.canonicalUrl,{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION_HEADER]:p,[o.NEXT_ROUTER_STATE_TREE_HEADER]:(0,m.prepareFlightRouterStateForRequest)(e.tree),...{},...t?{[o.NEXT_URL]:t}:{}},body:v});if("1"===g.headers.get(o.NEXT_ACTION_NOT_FOUND_HEADER))throw Object.defineProperty(new l.UnrecognizedActionError('Server Action "'+p+'" was not found on the server. \nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action'),"__NEXT_ERROR_CODE",{value:"E715",enumerable:!1,configurable:!0});let E=g.headers.get("x-action-redirect"),[O,P]=(null==E?void 0:E.split(";"))||[];switch(P){case"push":i=R.RedirectType.push;break;case"replace":i=R.RedirectType.replace;break;default:i=void 0}let j=!!g.headers.get(o.NEXT_IS_PRERENDER_HEADER);try{let e=JSON.parse(g.headers.get("x-action-revalidated")||"[[],0,0]");s={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){s=w}let M=O?(0,c.assignLocation)(O,new URL(e.canonicalUrl,window.location.href)):void 0,A=g.headers.get("content-type"),C=!!(A&&A.startsWith(o.RSC_CONTENT_TYPE_HEADER));if(!C&&!M)throw Object.defineProperty(Error(g.status>=400&&"text/plain"===A?await g.text():"An unexpected response was received from the server."),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});if(C){let e=await S(Promise.resolve(g),{callServer:n.callServer,findSourceMapURL:u.findSourceMapURL,temporaryReferences:_});f=M?void 0:e.a,d=(0,m.normalizeFlightData)(e.f)}else f=void 0,d=void 0;return{actionResult:f,actionFlightData:d,redirectLocation:M,redirectType:i,revalidatedParts:s,isPrerender:j}}let w={paths:[],tag:!1,cookie:!1};function A(e,t){let{resolve:r,reject:n}=t,u={},o=e.tree;u.preserveCustomHistoryState=!1;let l=e.nextUrl&&(0,b.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null,a=Date.now();return M(e,l,t).then(async c=>{let b,{actionResult:m,actionFlightData:T,redirectLocation:S,redirectType:M,isPrerender:w,revalidatedParts:A}=c;if(S&&(M===R.RedirectType.replace?(e.pushRef.pendingPush=!1,u.pendingPush=!1):(e.pushRef.pendingPush=!0,u.pendingPush=!0),u.canonicalUrl=b=(0,s.createHrefFromUrl)(S,!1)),!T)return(r(m),S)?(0,f.handleExternalUrl)(e,u,S.href,e.pushRef.pendingPush):e;if("string"==typeof T)return r(m),(0,f.handleExternalUrl)(e,u,T,e.pushRef.pendingPush);let C=A.paths.length>0||A.tag||A.cookie;for(let n of T){let{tree:i,seedData:c,head:s,isRootRender:h}=n;if(!h)return console.log("SERVER ACTION APPLY FAILED"),r(m),e;let E=(0,d.applyRouterStatePatchToTree)([""],o,i,b||e.canonicalUrl);if(null===E)return r(m),(0,v.handleSegmentMismatch)(e,t,i);if((0,p.isNavigatingToNewRootLayout)(o,E))return r(m),(0,f.handleExternalUrl)(e,u,b||e.canonicalUrl,e.pushRef.pendingPush);if(null!==c){let t=c[1],r=(0,y.createEmptyCacheNode)();r.rsc=t,r.prefetchRsc=null,r.loading=c[3],(0,_.fillLazyItemsTillLeafWithHead)(a,r,void 0,i,c,s,void 0),u.cache=r,u.prefetchCache=new Map,C&&await (0,g.refreshInactiveParallelSegments)({navigatedAt:a,state:e,updatedTree:E,updatedCache:r,includeNextUrl:!!l,canonicalUrl:u.canonicalUrl||e.canonicalUrl})}u.patchedTree=E,o=E}return S&&b?(C||((0,O.createSeededPrefetchCacheEntry)({url:S,data:{flightData:T,canonicalUrl:void 0,couldBeIntercepted:!1,prerendered:!1,postponed:!1,staleTime:-1},tree:e.tree,prefetchCache:e.prefetchCache,nextUrl:e.nextUrl,kind:w?i.PrefetchKind.FULL:i.PrefetchKind.AUTO}),u.prefetchCache=e.prefetchCache),n((0,E.getRedirectError)((0,j.hasBasePath)(b)?(0,P.removeBasePath)(b):b,M||R.RedirectType.push))):r(m),(0,h.handleMutable)(e,u)},t=>(n(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},62592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return s}});let n=r(29658),u=r(30637),o=r(86343),l=r(83571),a=r(86871),i=r(23597),c=r(16378);function s(e){var t,r;let{navigatedAt:s,initialFlightData:f,initialCanonicalUrlParts:d,initialParallelRoutes:p,location:h,couldBeIntercepted:_,postponed:y,prerendered:b}=e,v=d.join("/"),g=(0,c.getFlightDataPartsFromPath)(f[0]),{tree:m,seedData:E,head:R}=g,O={lazyData:null,rsc:null==E?void 0:E[1],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:p,loading:null!=(t=null==E?void 0:E[3])?t:null,navigatedAt:s},P=h?(0,n.createHrefFromUrl)(h):v;(0,i.addRefreshMarkerToActiveParallelSegments)(m,P);let j=new Map;(null===p||0===p.size)&&(0,u.fillLazyItemsTillLeafWithHead)(s,O,void 0,m,E,R,void 0);let T={tree:m,cache:O,prefetchCache:j,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:P,nextUrl:null!=(r=(0,o.extractPathFromFlightRouterState)(m)||(null==h?void 0:h.pathname))?r:null};if(h){let e=new URL(""+h.pathname+h.search,h.origin);(0,l.createSeededPrefetchCacheEntry)({url:e,data:{flightData:[g],canonicalUrl:void 0,couldBeIntercepted:!!_,prerendered:b,postponed:y,staleTime:b&&1?l.STATIC_STALETIME_MS:-1},tree:T.tree,prefetchCache:T.prefetchCache,nextUrl:T.nextUrl,kind:b?a.PrefetchKind.FULL:a.PrefetchKind.AUTO})}return T}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{IDLE_LINK_STATUS:function(){return s},PENDING_LINK_STATUS:function(){return c},mountFormInstance:function(){return g},mountLinkInstance:function(){return v},onLinkVisibilityChanged:function(){return E},onNavigationIntent:function(){return R},pingVisibleLinks:function(){return P},setLinkForCurrentNavigation:function(){return f},unmountLinkForCurrentNavigation:function(){return d},unmountPrefetchableInstance:function(){return m}}),r(11807);let n=r(17297),u=r(66048),o=r(12115),l=r(86871),a=r(48302),i=null,c={pending:!0},s={pending:!1};function f(e){(0,o.startTransition)(()=>{null==i||i.setOptimisticLinkStatus(s),null==e||e.setOptimisticLinkStatus(c),i=e})}function d(e){i===e&&(i=null)}let p="function"==typeof WeakMap?new WeakMap:new Map,h=new Set,_="function"==typeof IntersectionObserver?new IntersectionObserver(function(e){for(let t of e){let e=t.intersectionRatio>0;E(t.target,e)}},{rootMargin:"200px"}):null;function y(e,t){void 0!==p.get(e)&&m(e),p.set(e,t),null!==_&&_.observe(e)}function b(e){try{return(0,n.createPrefetchURL)(e)}catch(t){return("function"==typeof reportError?reportError:console.error)("Cannot prefetch '"+e+"' because it cannot be converted to a URL."),null}}function v(e,t,r,n,u,o){if(u){let u=b(t);if(null!==u){let t={router:r,fetchStrategy:n,isVisible:!1,prefetchTask:null,prefetchHref:u.href,setOptimisticLinkStatus:o};return y(e,t),t}}return{router:r,fetchStrategy:n,isVisible:!1,prefetchTask:null,prefetchHref:null,setOptimisticLinkStatus:o}}function g(e,t,r,n){let u=b(t);null!==u&&y(e,{router:r,fetchStrategy:n,isVisible:!1,prefetchTask:null,prefetchHref:u.href,setOptimisticLinkStatus:null})}function m(e){let t=p.get(e);if(void 0!==t){p.delete(e),h.delete(t);let r=t.prefetchTask;null!==r&&(0,u.cancelPrefetchTask)(r)}null!==_&&_.unobserve(e)}function E(e,t){let r=p.get(e);void 0!==r&&(r.isVisible=t,t?h.add(r):h.delete(r),O(r,u.PrefetchPriority.Default))}function R(e,t){let r=p.get(e);void 0!==r&&void 0!==r&&O(r,u.PrefetchPriority.Intent)}function O(e,t){var r;let n=e.prefetchTask;if(!e.isVisible){null!==n&&(0,u.cancelPrefetchTask)(n);return}r=e,(async()=>{let e;switch(r.fetchStrategy){case u.FetchStrategy.PPR:e=l.PrefetchKind.AUTO;break;case u.FetchStrategy.Full:e=l.PrefetchKind.FULL;break;case u.FetchStrategy.PPRRuntime:throw Object.defineProperty(new a.InvariantError("FetchStrategy.PPRRuntime should never be used when `experimental.clientSegmentCache` is disabled"),"__NEXT_ERROR_CODE",{value:"E772",enumerable:!1,configurable:!0});default:r.fetchStrategy,e=void 0}return r.router.prefetch(r.prefetchHref,{kind:e})})().catch(e=>{})}function P(e,t){for(let r of h){let n=r.prefetchTask;if(null!==n&&!(0,u.isPrefetchTaskDirty)(n,e,t))continue;null!==n&&(0,u.cancelPrefetchTask)(n);let o=(0,u.createCacheKey)(r.prefetchHref,e);r.prefetchTask=(0,u.schedulePrefetchTask)(o,t,r.fetchStrategy,u.PrefetchPriority.Default,null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessFallbackBoundary",{enumerable:!0,get:function(){return s}});let n=r(49417),u=r(95155),o=n._(r(12115)),l=r(51486),a=r(37099);r(94781);let i=r(46752);class c extends o.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isHTTPAccessFallbackError)(e))return{triggeredStatus:(0,a.getAccessFallbackHTTPStatus)(e)};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.triggeredStatus?{triggeredStatus:void 0,previousPathname:e.pathname}:{triggeredStatus:t.triggeredStatus,previousPathname:e.pathname}}render(){let{notFound:e,forbidden:t,unauthorized:r,children:n}=this.props,{triggeredStatus:o}=this.state,l={[a.HTTPAccessErrorStatus.NOT_FOUND]:e,[a.HTTPAccessErrorStatus.FORBIDDEN]:t,[a.HTTPAccessErrorStatus.UNAUTHORIZED]:r};if(o){let i=o===a.HTTPAccessErrorStatus.NOT_FOUND&&e,c=o===a.HTTPAccessErrorStatus.FORBIDDEN&&t,s=o===a.HTTPAccessErrorStatus.UNAUTHORIZED&&r;return i||c||s?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("meta",{name:"robots",content:"noindex"}),!1,l[o]]}):n}return n}constructor(e){super(e),this.state={triggeredStatus:void 0,previousPathname:e.pathname}}}function s(e){let{notFound:t,forbidden:r,unauthorized:n,children:a}=e,s=(0,l.useUntrackedPathname)(),f=(0,o.useContext)(i.MissingSlotContext);return t||r||n?(0,u.jsx)(c,{pathname:s,notFound:t,forbidden:r,unauthorized:n,missingSlots:f,children:a}):(0,u.jsx)(u.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},64425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ROOT_SEGMENT_CACHE_KEY:function(){return o},ROOT_SEGMENT_REQUEST_KEY:function(){return u},appendSegmentCacheKeyPart:function(){return c},appendSegmentRequestKeyPart:function(){return a},convertSegmentPathToStaticExportFilename:function(){return d},createSegmentCacheKeyPart:function(){return i},createSegmentRequestKeyPart:function(){return l}});let n=r(65360),u="",o="";function l(e){if("string"==typeof e)return e.startsWith(n.PAGE_SEGMENT_KEY)?n.PAGE_SEGMENT_KEY:"/_not-found"===e?"_not-found":f(e);let t=e[0],r=e[2];return"$"+r+"$"+f(t)}function a(e,t,r){return e+"/"+("children"===t?r:"@"+f(t)+"/"+r)}function i(e,t){return"string"==typeof t?e:e+"$"+f(t[1])}function c(e,t,r){return e+"/"+("children"===t?r:"@"+f(t)+"/"+r)}let s=/^[a-zA-Z0-9\-_@]+$/;function f(e){return s.test(e)?e:"!"+btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function d(e){return"__next"+e.replace(/\//g,".")+".txt"}},64869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return o}});let n=r(23982),u=new WeakMap;function o(e){let t=u.get(e);if(t)return t;let r=Promise.resolve(e);return u.set(e,r),Object.keys(e).forEach(t=>{n.wellKnownProperties.has(t)||(r[t]=e[t])}),r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hmrRefreshReducer",{enumerable:!0,get:function(){return n}}),r(32753),r(29658),r(60895),r(44707),r(35737),r(11126),r(77609),r(17297),r(97332),r(48915);let n=function(e,t){return e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65360:(e,t)=>{"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}function n(e){return e.startsWith("@")&&"@children"!==e}function u(e,t){if(e.includes(o)){let e=JSON.stringify(t);return"{}"!==e?o+"?"+e:o}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DEFAULT_SEGMENT_KEY:function(){return l},PAGE_SEGMENT_KEY:function(){return o},addSearchParamsIfPageSegment:function(){return u},isGroupSegment:function(){return r},isParallelRouteSegment:function(){return n}});let o="__PAGE__",l="__DEFAULT__"},65444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{onCaughtError:function(){return s},onUncaughtError:function(){return f}});let n=r(28140),u=r(5829),o=r(24553),l=r(3463),a=r(88785),i=n._(r(57150)),c={decorateDevError:e=>e,handleClientError:()=>{},originConsoleError:console.error.bind(console)};function s(e,t){var r;let n,l=null==(r=t.errorBoundary)?void 0:r.constructor;if(n=n||l===a.ErrorBoundaryHandler&&t.errorBoundary.props.errorComponent===i.default)return f(e);(0,o.isBailoutToCSRError)(e)||(0,u.isNextRouterError)(e)||c.originConsoleError(e)}function f(e){(0,o.isBailoutToCSRError)(e)||(0,u.isNextRouterError)(e)||(0,l.reportGlobalError)(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(90535),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66048:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{FetchStrategy:function(){return h},NavigationResultTag:function(){return d},PrefetchPriority:function(){return p},cancelPrefetchTask:function(){return i},createCacheKey:function(){return f},getCurrentCacheVersion:function(){return l},isPrefetchTaskDirty:function(){return s},navigate:function(){return u},prefetch:function(){return n},reschedulePrefetchTask:function(){return c},revalidateEntireCache:function(){return o},schedulePrefetchTask:function(){return a}});let r=()=>{throw Object.defineProperty(Error("Segment Cache experiment is not enabled. This is a bug in Next.js."),"__NEXT_ERROR_CODE",{value:"E654",enumerable:!1,configurable:!0})},n=r,u=r,o=r,l=r,a=r,i=r,c=r,s=r,f=r;var d=function(e){return e[e.MPA=0]="MPA",e[e.Success=1]="Success",e[e.NoOp=2]="NoOp",e[e.Async=3]="Async",e}({}),p=function(e){return e[e.Intent=2]="Intent",e[e.Default=1]="Default",e[e.Background=0]="Background",e}({}),h=function(e){return e[e.LoadingBoundary=0]="LoadingBoundary",e[e.PPR=1]="PPR",e[e.PPRRuntime=2]="PPRRuntime",e[e.Full=3]="Full",e}({});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"assignLocation",{enumerable:!0,get:function(){return u}});let n=r(96058);function u(e,t){if(e.startsWith(".")){let r=t.origin+t.pathname;return new URL((r.endsWith("/")?r:r+"/")+e)}return new URL((0,n.addBasePath)(e),t.href)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},67858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return function e(t){if((0,u.isNextRouterError)(t)||(0,n.isBailoutToCSRError)(t))throw t;t instanceof Error&&"cause"in t&&e(t.cause)}}});let n=r(24553),u=r(5829);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},68440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{METADATA_BOUNDARY_NAME:function(){return r},OUTLET_BOUNDARY_NAME:function(){return u},ROOT_LAYOUT_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return n}});let r="__next_metadata_boundary__",n="__next_viewport_boundary__",u="__next_outlet_boundary__",o="__next_root_layout_boundary__"},68451:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let n=r(86871),u=r(35737),o=r(36798),l=r(37854),a=r(38719),i=r(43933),c=r(65345),s=r(62244),f=function(e,t){switch(t.type){case n.ACTION_NAVIGATE:return(0,u.navigateReducer)(e,t);case n.ACTION_SERVER_PATCH:return(0,o.serverPatchReducer)(e,t);case n.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case n.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case n.ACTION_HMR_REFRESH:return(0,c.hmrRefreshReducer)(e,t);case n.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case n.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Object.defineProperty(Error("Unknown action"),"__NEXT_ERROR_CODE",{value:"E295",enumerable:!1,configurable:!0})}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return u}});let n=r(65360);function u(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(n.PAGE_SEGMENT_KEY)?n.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71099:(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"forbidden",{enumerable:!0,get:function(){return n}}),r(37099).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return o}});let n=r(77700),u=r(5240),o=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:r,hash:o}=(0,u.parsePath)(e);return/\.[^/]+\/?$/.test(t)?""+(0,n.removeTrailingSlash)(t)+r+o:t.endsWith("/")?""+t+r+o:t+"/"+r+o};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71923:(e,t,r)=>{"use strict";e.exports=r(19393)},72103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ServerInsertedHTMLContext:function(){return u},useServerInsertedHTML:function(){return o}});let n=r(49417)._(r(12115)),u=n.default.createContext(null);function o(e){let t=(0,n.useContext)(u);t&&t(e)}},73879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return u}});let n=r(5240);function u(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:u,hash:o}=(0,n.parsePath)(e);return""+t+r+u+o}},74061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return l}});let n=r(76196),u=r(65360);function o(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,u.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},75597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,r,o){let l=o.length<=2,[a,i]=o,c=(0,n.createRouterCacheKey)(i),s=r.parallelRoutes.get(a);if(!s)return;let f=t.parallelRoutes.get(a);if(f&&f!==s||(f=new Map(s),t.parallelRoutes.set(a,f)),l)return void f.delete(c);let d=s.get(c),p=f.get(c);p&&d&&(p===d&&(p={lazyData:p.lazyData,rsc:p.rsc,prefetchRsc:p.prefetchRsc,head:p.head,prefetchHead:p.prefetchHead,parallelRoutes:new Map(p.parallelRoutes)},f.set(c,p)),e(p,d,(0,u.getNextFlightSegmentPath)(o)))}}});let n=r(69190),u=r(16378);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76196:(e,t)=>{"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},76248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{dispatchAppRouterAction:function(){return l},useActionQueue:function(){return a}});let n=r(49417)._(r(12115)),u=r(54089),o=null;function l(e){if(null===o)throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0});o(e)}function a(e){let[t,r]=n.default.useState(e.state);return o=t=>e.dispatch(t,r),(0,u.isThenable)(t)?(0,n.use)(t):t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77197:(e,t,r)=>{"use strict";e.exports=r(99062)},77278:(e,t)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"encodeURIPath",{enumerable:!0,get:function(){return r}})},77370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderParamsFromClient",{enumerable:!0,get:function(){return o}});let n=r(23982),u=new WeakMap;function o(e){let t=u.get(e);if(t)return t;let r=Promise.resolve(e);return u.set(e,r),Object.keys(e).forEach(t=>{n.wellKnownProperties.has(t)||(r[t]=e[t])}),r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{SERVER_REFERENCE_ID_LENGTH:function(){return r},extractInfoFromServerReferenceId:function(){return u},mightBeServerReferenceId:function(){return n},omitUnusedArgs:function(){return o}});let r=42;function n(e){return e.length===r}function u(e){let t=parseInt(e.slice(0,2),16),r=t>>1&63,n=Array(6);for(let e=0;e<6;e++){let t=r>>5-e&1;n[e]=1===t}return{type:1==(t>>7&1)?"use-cache":"server-action",usedArgs:n,hasRestArgs:1==(1&t)}}function o(e,t){let r=Array(e.length);for(let n=0;n=6&&t.hasRestArgs)&&(r[n]=e[n]);return r}},77609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return o}});let n=r(30637),u=r(60543);function o(e,t,r,o,l){let{tree:a,seedData:i,head:c,isRootRender:s}=o;if(null===i)return!1;if(s){let u=i[1];r.loading=i[3],r.rsc=u,r.prefetchRsc=null,(0,n.fillLazyItemsTillLeafWithHead)(e,r,t,a,i,c,l)}else r.rsc=t.rsc,r.prefetchRsc=t.prefetchRsc,r.parallelRoutes=new Map(t.parallelRoutes),r.loading=t.loading,(0,u.fillCacheWithNewSubTreeData)(e,r,t,o,l);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77700:(e,t)=>{"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},77759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{GracefulDegradeBoundary:function(){return o},default:function(){return l}});let n=r(95155),u=r(12115);class o extends u.Component{static getDerivedStateFromError(e){return{hasError:!0}}componentDidMount(){let e=this.htmlRef.current;this.state.hasError&&e&&Object.entries(this.htmlAttributes).forEach(t=>{let[r,n]=t;e.setAttribute(r,n)})}render(){let{hasError:e}=this.state;return(this.rootHtml||(this.rootHtml=document.documentElement.innerHTML,this.htmlAttributes=function(e){let t={};for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let n=r(15903),u=r(17797);var o=u._("_maxConcurrency"),l=u._("_runningCount"),a=u._("_queue"),i=u._("_processNext");class c{enqueue(e){let t,r,u=new Promise((e,n)=>{t=e,r=n}),o=async()=>{try{n._(this,l)[l]++;let r=await e();t(r)}catch(e){r(e)}finally{n._(this,l)[l]--,n._(this,i)[i]()}};return n._(this,a)[a].push({promiseFn:u,task:o}),n._(this,i)[i](),u}bump(e){let t=n._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=n._(this,a)[a].splice(t,1)[0];n._(this,a)[a].unshift(e),n._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,o,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),n._(this,o)[o]=e,n._(this,l)[l]=0,n._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(n._(this,l)[l]0){var t;null==(t=n._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"IconMark",{enumerable:!0,get:function(){return n}}),r(95155);let n=()=>null},81099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return r}});var r=function(e){return e[e.SeeOther=303]="SeeOther",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e}({});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let n=r(95155);function u(e){let{Component:t,searchParams:u,params:o,promises:l}=e;{let{createRenderSearchParamsFromClient:e}=r(35878),l=e(u),{createRenderParamsFromClient:a}=r(307),i=a(o);return(0,n.jsx)(t,{params:i,searchParams:l})}}r(48302),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return n}});let n=r(28140)._(r(12115)).default.createContext({})},83571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DYNAMIC_STALETIME_MS:function(){return d},STATIC_STALETIME_MS:function(){return p},createSeededPrefetchCacheEntry:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let n=r(32753),u=r(86871),o=r(43933);function l(e,t,r){let n=e.pathname;return(t&&(n+=e.search),r)?""+r+"%"+n:n}function a(e,t,r){return l(e,t===u.PrefetchKind.FULL,r)}function i(e){let{url:t,nextUrl:r,tree:n,prefetchCache:o,kind:a,allowAliasing:i=!0}=e,c=function(e,t,r,n,o){for(let a of(void 0===t&&(t=u.PrefetchKind.TEMPORARY),[r,null])){let r=l(e,!0,a),i=l(e,!1,a),c=e.search?r:i,s=n.get(c);if(s&&o){if(s.url.pathname===e.pathname&&s.url.search!==e.search)return{...s,aliased:!0};return s}let f=n.get(i);if(o&&e.search&&t!==u.PrefetchKind.FULL&&f&&!f.key.includes("%"))return{...f,aliased:!0}}if(t!==u.PrefetchKind.FULL&&o){for(let t of n.values())if(t.url.pathname===e.pathname&&!t.key.includes("%"))return{...t,aliased:!0}}}(t,a,r,o,i);return c?(c.status=h(c),c.kind!==u.PrefetchKind.FULL&&a===u.PrefetchKind.FULL&&c.data.then(e=>{if(!(Array.isArray(e.flightData)&&e.flightData.some(e=>e.isRootRender&&null!==e.seedData)))return s({tree:n,url:t,nextUrl:r,prefetchCache:o,kind:null!=a?a:u.PrefetchKind.TEMPORARY})}),a&&c.kind===u.PrefetchKind.TEMPORARY&&(c.kind=a),c):s({tree:n,url:t,nextUrl:r,prefetchCache:o,kind:a||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:r,prefetchCache:n,url:o,data:l,kind:i}=e,c=l.couldBeIntercepted?a(o,i,t):a(o,i),s={treeAtTimeOfPrefetch:r,data:Promise.resolve(l),kind:i,prefetchTime:Date.now(),lastUsedTime:Date.now(),staleTime:l.staleTime,key:c,status:u.PrefetchCacheEntryStatus.fresh,url:o};return n.set(c,s),s}function s(e){let{url:t,kind:r,tree:l,nextUrl:i,prefetchCache:c}=e,s=a(t,r),f=o.prefetchQueue.enqueue(()=>(0,n.fetchServerResponse)(t,{flightRouterState:l,nextUrl:i,prefetchKind:r}).then(e=>{let r;if(e.couldBeIntercepted&&(r=function(e){let{url:t,nextUrl:r,prefetchCache:n,existingCacheKey:u}=e,o=n.get(u);if(!o)return;let l=a(t,o.kind,r);return n.set(l,{...o,key:l}),n.delete(u),l}({url:t,existingCacheKey:s,nextUrl:i,prefetchCache:c})),e.prerendered){let t=c.get(null!=r?r:s);t&&(t.kind=u.PrefetchKind.FULL,-1!==e.staleTime&&(t.staleTime=e.staleTime))}return e})),d={treeAtTimeOfPrefetch:l,data:f,kind:r,prefetchTime:Date.now(),lastUsedTime:null,staleTime:-1,key:s,status:u.PrefetchCacheEntryStatus.fresh,url:t};return c.set(s,d),d}function f(e){for(let[t,r]of e)h(r)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("0"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:r,lastUsedTime:n}=e;return Date.now()<(null!=n?n:r)+d?n?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:t===u.PrefetchKind.AUTO&&Date.now(){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange)return void e();let r=document.documentElement;r.dataset.scrollBehavior;let n=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"disableSmoothScrollDuringRouteTransition",{enumerable:!0,get:function(){return n}}),r(94781)},85153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"findSourceMapURL",{enumerable:!0,get:function(){return r}});let r=void 0;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{computeChangedPath:function(){return c},extractPathFromFlightRouterState:function(){return i},getSelectedParams:function(){return function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],o=Array.isArray(t),l=o?t[1]:t;!l||l.startsWith(u.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):o&&(r[t[0]]=t[1]),r=e(n,r))}return r}}});let n=r(57630),u=r(65360),o=r(7460),l=e=>"string"==typeof e?"children"===e?"":e:e[1];function a(e){return e.reduce((e,t)=>{let r;return""===(t="/"===(r=t)[0]?r.slice(1):r)||(0,u.isGroupSegment)(t)?e:e+"/"+t},"")||"/"}function i(e){var t;let r=Array.isArray(e[0])?e[0][1]:e[0];if(r===u.DEFAULT_SEGMENT_KEY||n.INTERCEPTION_ROUTE_MARKERS.some(e=>r.startsWith(e)))return;if(r.startsWith(u.PAGE_SEGMENT_KEY))return"";let o=[l(r)],c=null!=(t=e[1])?t:{},s=c.children?i(c.children):void 0;if(void 0!==s)o.push(s);else for(let[e,t]of Object.entries(c)){if("children"===e)continue;let r=i(t);void 0!==r&&o.push(r)}return a(o)}function c(e,t){let r=function e(t,r){let[u,a]=t,[c,s]=r,f=l(u),d=l(c);if(n.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,o.matchSegment)(u,c)){var p;return null!=(p=i(r))?p:""}for(let t in a)if(s[t]){let r=e(a[t],s[t]);if(null!==r)return l(c)+"/"+r}return null}(e,t);return null==r||"/"===r?r:a(r.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{REDIRECT_ERROR_CODE:function(){return u},RedirectType:function(){return o},isRedirectError:function(){return l}});let n=r(81099),u="NEXT_REDIRECT";var o=function(e){return e.push="push",e.replace="replace",e}({});function l(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let t=e.digest.split(";"),[r,o]=t,l=t.slice(2,-2).join(";"),a=Number(t.at(-2));return r===u&&("replace"===o||"push"===o)&&"string"==typeof l&&!isNaN(a)&&a in n.RedirectStatusCode}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getRedirectError:function(){return l},getRedirectStatusCodeFromError:function(){return f},getRedirectTypeFromError:function(){return s},getURLFromRedirectError:function(){return c},permanentRedirect:function(){return i},redirect:function(){return a}});let n=r(81099),u=r(86437),o=void 0;function l(e,t,r){void 0===r&&(r=n.RedirectStatusCode.TemporaryRedirect);let o=Object.defineProperty(Error(u.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return o.digest=u.REDIRECT_ERROR_CODE+";"+t+";"+e+";"+r+";",o}function a(e,t){var r;throw null!=t||(t=(null==o||null==(r=o.getStore())?void 0:r.isAction)?u.RedirectType.push:u.RedirectType.replace),l(e,t,n.RedirectStatusCode.TemporaryRedirect)}function i(e,t){throw void 0===t&&(t=u.RedirectType.replace),l(e,t,n.RedirectStatusCode.PermanentRedirect)}function c(e){return(0,u.isRedirectError)(e)?e.digest.split(";").slice(2,-2).join(";"):null}function s(e){if(!(0,u.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return e.digest.split(";",2)[1]}function f(e){if(!(0,u.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(e.digest.split(";").at(-2))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86871:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_HMR_REFRESH:function(){return a},ACTION_NAVIGATE:function(){return n},ACTION_PREFETCH:function(){return l},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return u},ACTION_SERVER_ACTION:function(){return i},ACTION_SERVER_PATCH:function(){return o},PrefetchCacheEntryStatus:function(){return s},PrefetchKind:function(){return c}});let r="refresh",n="navigate",u="restore",o="server-patch",l="prefetch",a="hmr-refresh",i="server-action";var c=function(e){return e.AUTO="auto",e.FULL="full",e.TEMPORARY="temporary",e}({}),s=function(e){return e.fresh="fresh",e.reusable="reusable",e.expired="expired",e.stale="stale",e}({});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86897:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element");function n(e,t,n){var u=null;if(void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),"key"in t)for(var o in n={},t)"key"!==o&&(n[o]=t[o]);else n=t;return{$$typeof:r,type:e,key:u,ref:void 0!==(t=n.ref)?t:null,props:n}}t.Fragment=Symbol.for("react.fragment"),t.jsx=n,t.jsxs=n},87317:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{abortTask:function(){return h},listenForDynamicRequest:function(){return p},startPPRNavigation:function(){return c},updateCacheNodeOnPopstateRestoration:function(){return function e(t,r){let n=r[1],u=t.parallelRoutes,l=new Map(u);for(let t in n){let r=n[t],a=r[0],i=(0,o.createRouterCacheKey)(a),c=u.get(t);if(void 0!==c){let n=c.get(i);if(void 0!==n){let u=e(n,r),o=new Map(c);o.set(i,u),l.set(t,o)}}}let a=t.rsc,i=b(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:[null,null],prefetchRsc:i?t.prefetchRsc:null,loading:t.loading,parallelRoutes:l,navigatedAt:t.navigatedAt}}}});let n=r(65360),u=r(7460),o=r(69190),l=r(44707),a=r(83571),i={route:null,node:null,dynamicRequestTree:null,children:null};function c(e,t,r,l,a,c,d,p,h){return function e(t,r,l,a,c,d,p,h,_,y,b){let v=l[1],g=a[1],m=null!==d?d[2]:null;c||!0===a[4]&&(c=!0);let E=r.parallelRoutes,R=new Map(E),O={},P=null,j=!1,T={};for(let r in g){let l,a=g[r],f=v[r],d=E.get(r),S=null!==m?m[r]:null,M=a[0],w=y.concat([r,M]),A=(0,o.createRouterCacheKey)(M),C=void 0!==f?f[0]:void 0,x=void 0!==d?d.get(A):void 0;if(null!==(l=M===n.DEFAULT_SEGMENT_KEY?void 0!==f?{route:f,node:null,dynamicRequestTree:null,children:null}:s(t,f,a,x,c,void 0!==S?S:null,p,h,w,b):_&&0===Object.keys(a[1]).length?s(t,f,a,x,c,void 0!==S?S:null,p,h,w,b):void 0!==f&&void 0!==C&&(0,u.matchSegment)(M,C)&&void 0!==x&&void 0!==f?e(t,x,f,a,c,S,p,h,_,w,b):s(t,f,a,x,c,void 0!==S?S:null,p,h,w,b))){if(null===l.route)return i;null===P&&(P=new Map),P.set(r,l);let e=l.node;if(null!==e){let t=new Map(d);t.set(A,e),R.set(r,t)}let t=l.route;O[r]=t;let n=l.dynamicRequestTree;null!==n?(j=!0,T[r]=n):T[r]=t}else O[r]=a,T[r]=a}if(null===P)return null;let S={lazyData:null,rsc:r.rsc,prefetchRsc:r.prefetchRsc,head:r.head,prefetchHead:r.prefetchHead,loading:r.loading,parallelRoutes:R,navigatedAt:t};return{route:f(a,O),node:S,dynamicRequestTree:j?f(a,T):null,children:P}}(e,t,r,l,!1,a,c,d,p,[],h)}function s(e,t,r,n,u,c,s,p,h,_){return!u&&(void 0===t||(0,l.isNavigatingToNewRootLayout)(t,r))?i:function e(t,r,n,u,l,i,c,s){let p,h,_,y,b=r[1],v=0===Object.keys(b).length;if(void 0!==n&&n.navigatedAt+a.DYNAMIC_STALETIME_MS>t)p=n.rsc,h=n.loading,_=n.head,y=n.navigatedAt;else if(null===u)return d(t,r,null,l,i,c,s);else if(p=u[1],h=u[3],_=v?l:null,y=t,u[4]||i&&v)return d(t,r,u,l,i,c,s);let g=null!==u?u[2]:null,m=new Map,E=void 0!==n?n.parallelRoutes:null,R=new Map(E),O={},P=!1;if(v)s.push(c);else for(let r in b){let n=b[r],u=null!==g?g[r]:null,a=null!==E?E.get(r):void 0,f=n[0],d=c.concat([r,f]),p=(0,o.createRouterCacheKey)(f),h=e(t,n,void 0!==a?a.get(p):void 0,u,l,i,d,s);m.set(r,h);let _=h.dynamicRequestTree;null!==_?(P=!0,O[r]=_):O[r]=n;let y=h.node;if(null!==y){let e=new Map;e.set(p,y),R.set(r,e)}}return{route:r,node:{lazyData:null,rsc:p,prefetchRsc:null,head:_,prefetchHead:null,loading:h,parallelRoutes:R,navigatedAt:y},dynamicRequestTree:P?f(r,O):null,children:m}}(e,r,n,c,s,p,h,_)}function f(e,t){let r=[e[0],t];return 2 in e&&(r[2]=e[2]),3 in e&&(r[3]=e[3]),4 in e&&(r[4]=e[4]),r}function d(e,t,r,n,u,l,a){let i=f(t,t[1]);return i[3]="refetch",{route:t,node:function e(t,r,n,u,l,a,i){let c=r[1],s=null!==n?n[2]:null,f=new Map;for(let r in c){let n=c[r],d=null!==s?s[r]:null,p=n[0],h=a.concat([r,p]),_=(0,o.createRouterCacheKey)(p),y=e(t,n,void 0===d?null:d,u,l,h,i),b=new Map;b.set(_,y),f.set(r,b)}let d=0===f.size;d&&i.push(a);let p=null!==n?n[1]:null,h=null!==n?n[3]:null;return{lazyData:null,parallelRoutes:f,prefetchRsc:void 0!==p?p:null,prefetchHead:d?u:[null,null],loading:void 0!==h?h:null,rsc:v(),head:d?v():null,navigatedAt:t}}(e,t,r,n,u,l,a),dynamicRequestTree:i,children:null}}function p(e,t){t.then(t=>{let{flightData:r}=t;if("string"!=typeof r){for(let t of r){let{segmentPath:r,tree:n,seedData:l,head:a}=t;l&&function(e,t,r,n,l){let a=e;for(let e=0;e{h(e,t)})}function h(e,t){let r=e.node;if(null===r)return;let n=e.children;if(null===n)_(e.route,r,t);else for(let e of n.values())h(e,t);e.dynamicRequestTree=null}function _(e,t,r){let n=e[1],u=t.parallelRoutes;for(let e in n){let t=n[e],l=u.get(e);if(void 0===l)continue;let a=t[0],i=(0,o.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&_(t,c,r)}let l=t.rsc;b(l)&&(null===r?l.resolve(null):l.reject(r));let a=t.head;b(a)&&a.resolve(null)}let y=Symbol();function b(e){return e&&e.tag===y}function v(){let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.status="pending",r.resolve=t=>{"pending"===r.status&&(r.status="fulfilled",r.value=t,e(t))},r.reject=e=>{"pending"===r.status&&(r.status="rejected",r.reason=e,t(e))},r.tag=y,r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},88785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ErrorBoundary:function(){return f},ErrorBoundaryHandler:function(){return s}});let n=r(28140),u=r(95155),o=n._(r(12115)),l=r(51486),a=r(5829);r(61489);let i=r(15860),c=(0,r(93913).isBot)(window.navigator.userAgent);class s extends o.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){let{error:r}=t;return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error&&!c?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.HandleISRError,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,u.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function f(e){let{errorComponent:t,errorStyles:r,errorScripts:n,children:o}=e,a=(0,l.useUntrackedPathname)();return t?(0,u.jsx)(s,{pathname:a,errorComponent:t,errorStyles:r,errorScripts:n,children:o}):(0,u.jsx)(u.Fragment,{children:o})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},90535:()=>{"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},92929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return u}});let n=r(2018);function u(e){return(0,n.pathHasPrefix)(e,"/demo")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},93223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{doesStaticSegmentAppearInURL:function(){return c},getCacheKeyForDynamicParam:function(){return s},getParamValueFromCacheKey:function(){return d},getRenderedPathname:function(){return a},getRenderedSearch:function(){return l},parseDynamicParamFromURLPart:function(){return i},urlToUrlWithoutFlightMarker:function(){return f}});let n=r(65360),u=r(64425),o=r(52486);function l(e){let t=e.headers.get(o.NEXT_REWRITTEN_QUERY_HEADER);return null!==t?""===t?"":"?"+t:f(new URL(e.url)).search}function a(e){let t=e.headers.get(o.NEXT_REWRITTEN_PATH_HEADER);return null!=t?t:f(new URL(e.url)).pathname}function i(e,t,r){switch(e){case"c":case"ci":return rencodeURIComponent(e)):[];case"oc":return rencodeURIComponent(e)):null;case"d":case"di":if(r>=t.length)return"";return encodeURIComponent(t[r]);default:return""}}function c(e){return!(e===u.ROOT_SEGMENT_REQUEST_KEY||e.startsWith(n.PAGE_SEGMENT_KEY)||"("===e[0]&&e.endsWith(")"))&&e!==n.DEFAULT_SEGMENT_KEY&&"/_not-found"!==e}function s(e,t){return"string"==typeof e?(0,n.addSearchParamsIfPageSegment)(e,Object.fromEntries(new URLSearchParams(t))):null===e?"":e.join("/")}function f(e){let t=new URL(e);if(t.searchParams.delete(o.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,r=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-r)}return t}function d(e,t){return"c"===t||"oc"===t?e.split("/"):e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},93913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HTML_LIMITED_BOT_UA_RE:function(){return n.HTML_LIMITED_BOT_UA_RE},HTML_LIMITED_BOT_UA_RE_STRING:function(){return o},getBotType:function(){return i},isBot:function(){return a}});let n=r(14029),u=/Googlebot(?!-)|Googlebot$/i,o=n.HTML_LIMITED_BOT_UA_RE.source;function l(e){return n.HTML_LIMITED_BOT_UA_RE.test(e)}function a(e){return u.test(e)||l(e)}function i(e){return u.test(e)?"dom":l(e)?"html":void 0}},94201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return u}});let n=r(69190);function u(e,t,r){for(let u in r[1]){let o=r[1][u][0],l=(0,n.createRouterCacheKey)(o),a=t.parallelRoutes.get(u);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(u,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"setAttributesFromProps",{enumerable:!0,get:function(){return o}});let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"},n=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"];function u(e){return["async","defer","noModule"].includes(e)}function o(e,t){for(let[o,l]of Object.entries(t)){if(!t.hasOwnProperty(o)||n.includes(o)||void 0===l)continue;let a=r[o]||o.toLowerCase();"SCRIPT"===e.tagName&&u(a)?e[a]=!!l:e.setAttribute(a,String(l)),(!1===l||"SCRIPT"===e.tagName&&u(a)&&(!l||"false"===l))&&(e.setAttribute(a,""),e.removeAttribute(a))}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},95155:(e,t,r)=>{"use strict";e.exports=r(86897)},95704:(e,t,r)=>{"use strict";var n,u;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(u=r.g.process)?void 0:u.env)?r.g.process:r(53965)},96058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return o}});let n=r(73879),u=r(71239);function o(e,t){return(0,u.normalizePathTrailingSlash)((0,n.addPathPrefix)(e,"/demo"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},97332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return u}});let n=r(35737);function u(e,t,r){return(0,n.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98301:(e,t)=>{"use strict";function r(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return r}})},98924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let n=r(49417),u=r(95155),o=n._(r(12115)),l=r(46752);function a(){let e=(0,o.useContext)(l.TemplateContext);return(0,u.jsx)(u.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99062:(e,t,r)=>{"use strict";var n=r(47650),u={stream:!0},o=Object.prototype.hasOwnProperty,l=new Map;function a(e){var t=r(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function i(){}function c(e){for(var t=e[1],n=[],u=0;uf||35===f||114===f||120===f?(d=f,f=3,s++):(d=0,f=3);continue;case 2:44===(b=i[s++])?f=4:h=h<<4|(96i.length&&(b=-1)}var v=i.byteOffset+s;if(-1{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},9072:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},14045:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},15257:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]])},16088:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},30359:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]])},36537:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("DatabaseZap",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]])},37995:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},48139:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},50123:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},56922:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])},59947:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},65451:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]])},68669:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]])},69545:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},70175:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},76216:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]])},77802:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]])},79234:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},80403:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},85469:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},85499:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},87024:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("SquareFunction",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]])},94620:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]])},95364:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1333-2601f57e81887558.js b/pages/demo/_next/static/chunks/1333-2601f57e81887558.js deleted file mode 100644 index 91759597..00000000 --- a/pages/demo/_next/static/chunks/1333-2601f57e81887558.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1333],{6132:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},20639:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},23327:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},27937:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},32978:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},35626:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36835:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>j});var l=r(12115),n=r.t(l,2),a=r(47650),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];x(n)&&"function"==typeof w&&(n=w(n._payload)),l.Children.forEach(n,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof w&&(t=w(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?m(i):void 0,u=s(r,d);if(!i){if(n||0===n)throw Error(o?M(e):g(e));return n}let p=k(a,i.props??{});return i.type!==l.Fragment&&(p.ref=r?u:d),l.cloneElement(i,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(k,"mergeProps"),p(m,"getElementRef"),p(v,"isSlottable");var b=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}p(x,"isLazyComponent"),p(A,"isPromiseLike");var g=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=n[" use ".trim().toString()],S=r(95155),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=l.forwardRef(R(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52056:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},61362:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},71360:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},75426:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78108:(e,t,r)=>{r.d(t,{Z:()=>n});var l=r(12115);function n(e){let t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},78874:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99051:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>g,zi:()=>M});var l=r(12115),n=r(92556),a=r(94446),i=r(3468),o=r(70222),c=r(78108),d=r(4129),s=r(97602),u=r(95155),p="Switch",[f,y]=(0,i.A)(p),[h,k]=f(p),m=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:p,disabled:f,value:y="on",onCheckedChange:k,form:m,...v}=e,[b,g]=l.useState(null),M=(0,a.s)(t,e=>g(e)),w=l.useRef(!1),S=!b||m||!!b.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,u.jsxs)(h,{scope:r,checked:E,disabled:f,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":p,"data-state":A(E),"data-disabled":f?"":void 0,disabled:f,value:y,...v,ref:M,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),S&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())})}),S&&(0,u.jsx)(x,{control:b,bubbles:!w.current,name:i,value:y,checked:E,required:p,disabled:f,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=p;var v="SwitchThumb",b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(v,r);return(0,u.jsx)(s.sG.span,{"data-state":A(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});b.displayName=v;var x=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),s=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var g=m,M=b}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js b/pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js new file mode 100644 index 00000000..a946bd96 --- /dev/null +++ b/pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1395],{1211:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},1897:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},1947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},10002:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},23566:(e,t,n)=>{n.d(t,{q7:()=>I,bL:()=>T,RG:()=>M});var r=n(29320),a=n(62315),o=n(2430),l=n(36103),i=n(65335),d=n(29203),c=n(12377),u=n(82275),s=n(97645),y=n(26276),p="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},f="RovingFocusGroup",[m,k,v]=(0,o.N)(f),[A,M]=(0,i.A)(f,[v]),[x,b]=A(f),g=r.forwardRef((e,t)=>(0,y.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,y.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,y.jsx)(w,{...e,ref:t})})}));g.displayName=f;var w=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:v,onEntryFocus:A,preventScrollOnEntryFocus:M=!1,...b}=e,g=r.useRef(null),w=(0,l.s)(t,g),j=(0,s.jH)(d),[N=null,C]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,u.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,d=(0,u.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else o(t)},[l,e,o,d])]}({prop:f,defaultProp:m,onChange:v}),[T,I]=r.useState(!1),E=(0,u.c)(A),D=k(n),F=r.useRef(!1),[L,z]=r.useState(0);return r.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(p,E),()=>e.removeEventListener(p,E)},[E]),(0,y.jsx)(x,{scope:n,orientation:o,dir:j,loop:i,currentTabStopId:N,onItemFocus:r.useCallback(e=>C(e),[C]),onItemShiftTab:r.useCallback(()=>I(!0),[]),onFocusableItemAdd:r.useCallback(()=>z(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>z(e=>e-1),[]),children:(0,y.jsx)(c.sG.div,{tabIndex:T||0===L?-1:0,"data-orientation":o,...b,ref:w,style:{outline:"none",...e.style},onMouseDown:(0,a.m)(e.onMouseDown,()=>{F.current=!0}),onFocus:(0,a.m)(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!T){let t=new CustomEvent(p,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===N),...e].filter(Boolean).map(e=>e.ref.current),M)}}F.current=!1}),onBlur:(0,a.m)(e.onBlur,()=>I(!1))})})}),j="RovingFocusGroupItem",N=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:i,...u}=e,s=(0,d.B)(),p=i||s,h=b(j,n),f=h.currentTabStopId===p,v=k(n),{onFocusableItemAdd:A,onFocusableItemRemove:M}=h;return r.useEffect(()=>{if(o)return A(),()=>M()},[o,A,M]),(0,y.jsx)(m.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,y.jsx)(c.sG.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o?h.onItemFocus(p):e.preventDefault()}),onFocus:(0,a.m)(e.onFocus,()=>h.onItemFocus(p)),onKeyDown:(0,a.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let a=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return C[a]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=v().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(n,r+1):n.slice(r+1)}setTimeout(()=>R(n))}})})})});N.displayName=j;var C={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}var T=g,I=N},24608:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},27102:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,n)=>{n.d(t,{UC:()=>L,B8:()=>D,bL:()=>E,l9:()=>F});var r=n(29320),a=n(62315),o=n(65335),l=n(23566),i=n(36103),d=n(96886),c=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,o]=r.useState(),l=r.useRef({}),i=r.useRef(e),c=r.useRef("none"),[s,y]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=u(l.current);c.current="mounted"===s?e:"none"},[s]),(0,d.N)(()=>{let t=l.current,n=i.current;if(n!==e){let r=c.current,a=u(t);e?y("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?y("UNMOUNT"):n&&r!==a?y("ANIMATION_OUT"):y("UNMOUNT"),i.current=e}},[e,y]),(0,d.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=u(l.current).includes(e.animationName);if(e.target===a&&r&&(y("ANIMATION_END"),!i.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},o=e=>{e.target===a&&(c.current=u(l.current))};return a.addEventListener("animationstart",o),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",o),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}y("ANIMATION_END")},[a,y]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{e&&(l.current=getComputedStyle(e)),o(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),l=(0,i.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:l}):null};function u(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var s=n(12377),y=n(97645),p=n(82275),h=n(29203),f=n(26276),m="Tabs",[k,v]=(0,o.A)(m,[l.RG]),A=(0,l.RG)(),[M,x]=k(m),b=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:l,orientation:i="horizontal",dir:d,activationMode:c="automatic",...u}=e,m=(0,y.jH)(d),[k,v]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,p.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,d=(0,p.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else o(t)},[l,e,o,d])]}({prop:a,onChange:o,defaultProp:l});return(0,f.jsx)(M,{scope:n,baseId:(0,h.B)(),value:k,onValueChange:v,orientation:i,dir:m,activationMode:c,children:(0,f.jsx)(s.sG.div,{dir:m,"data-orientation":i,...u,ref:t})})});b.displayName=m;var g="TabsList",w=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=x(g,n),i=A(n);return(0,f.jsx)(l.bL,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:(0,f.jsx)(s.sG.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});w.displayName=g;var j="TabsTrigger",N=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,d=x(j,n),c=A(n),u=T(d.baseId,r),y=I(d.baseId,r),p=r===d.value;return(0,f.jsx)(l.q7,{asChild:!0,...c,focusable:!o,active:p,children:(0,f.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":y,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||o||!e||d.onValueChange(r)})})})});N.displayName=j;var C="TabsContent",R=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:l,...i}=e,d=x(C,n),u=T(d.baseId,a),y=I(d.baseId,a),p=a===d.value,h=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(c,{present:o||p,children:n=>{let{present:r}=n;return(0,f.jsx)(s.sG.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:y,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&l})}})});function T(e,t){return"".concat(e,"-trigger-").concat(t)}function I(e,t){return"".concat(e,"-content-").concat(t)}R.displayName=C;var E=b,D=w,F=N,L=R},37111:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]])},37995:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39367:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},39727:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},57275:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},59947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},61427:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},64761:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},79092:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},79433:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},85223:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]])},86931:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},89965:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},98123:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js b/pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js deleted file mode 100644 index 80a8c124..00000000 --- a/pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1417],{7220:(e,t,a)=>{a.d(t,{SQ:()=>l,_2:()=>r,lp:()=>c,mB:()=>u,rI:()=>o,ty:()=>i});var s=a(95155);a(12115);var n=a(42209),d=a(25016);function o(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,s.jsx)(n.l9,{"data-slot":"dropdown-menu-trigger",...t})}function l(e){let{className:t,sideOffset:a=4,...o}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...o})})}function r(e){let{className:t,inset:a,variant:o="default",...i}=e;return(0,s.jsx)(n.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i})}function c(e){let{className:t,inset:a,...o}=e;return(0,s.jsx)(n.JU,{"data-slot":"dropdown-menu-label","data-inset":a,className:(0,d.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...o})}function u(e){let{className:t,...a}=e;return(0,s.jsx)(n.wv,{"data-slot":"dropdown-menu-separator",className:(0,d.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},54679:(e,t,a)=>{a.d(t,{Cf:()=>c,Es:()=>m,L3:()=>f,c7:()=>u,lG:()=>i,rr:()=>x});var s=a(95155);a(12115);var n=a(19080),d=a(65229),o=a(25016);function i(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"dialog",...t})}function l(e){let{...t}=e;return(0,s.jsx)(n.ZL,{"data-slot":"dialog-portal",...t})}function r(e){let{className:t,...a}=e;return(0,s.jsx)(n.hJ,{"data-slot":"dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function c(e){let{className:t,children:a,showCloseButton:i=!0,...c}=e;return(0,s.jsxs)(l,{"data-slot":"dialog-portal",children:[(0,s.jsx)(r,{}),(0,s.jsxs)(n.UC,{"data-slot":"dialog-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...c,children:[a,i&&(0,s.jsxs)(n.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(d.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(n.hE,{"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(n.VY,{"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...a})}},86233:(e,t,a)=>{a.d(t,{T:()=>u});var s=a(95155),n=a(12115),d=a(35299),o=a(97003),i=a(54679),l=a(33789),r=a(37621),c=a(18720);function u(e){let{open:t,onOpenChange:a,title:u,description:m,children:f,confirmText:x,actionLabel:p="Delete",destructive:g=!0,onConfirm:h}=e,[v,j]=(0,n.useState)(""),[b,N]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&j("")},[t]);let w=!b&&(!x||v===x),y=async e=>{if(null==e||e.preventDefault(),w){N(!0);try{await h(),a(!1)}catch(e){c.oR.error((0,r.gJ)(e))}finally{N(!1)}}};return(0,s.jsx)(i.lG,{open:t,onOpenChange:e=>!b&&a(e),children:(0,s.jsx)(i.Cf,{className:"sm:max-w-lg",children:(0,s.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4",children:[(0,s.jsxs)(i.c7,{children:[(0,s.jsx)(i.L3,{children:u}),m&&(0,s.jsx)(i.rr,{asChild:!0,children:(0,s.jsx)("div",{children:m})})]}),f,x&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("label",{className:"text-sm",htmlFor:"confirm-input",children:["To confirm, type ",(0,s.jsx)("span",{className:"bg-muted rounded px-1 font-mono font-medium",children:x})," in the field."]}),(0,s.jsx)(l.p,{id:"confirm-input",autoFocus:!0,autoComplete:"off",value:v,onChange:e=>j(e.target.value),placeholder:x})]}),(0,s.jsxs)(i.Es,{children:[(0,s.jsx)(o.$,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:b,children:"Cancel"}),(0,s.jsxs)(o.$,{type:"submit",variant:g?"destructive":"default",disabled:!w,children:[b&&(0,s.jsx)(d.A,{className:"animate-spin"}),p]})]})]})})})}},91615:(e,t,a)=>{a.d(t,{$:()=>i});var s=a(95155),n=a(24033),d=a(97003),o=a(7220);function i(e){let{items:t,label:a="Actions",disabled:i,size:l="sm"}=e;return(0,s.jsxs)(o.rI,{children:[(0,s.jsx)(o.ty,{asChild:!0,children:(0,s.jsxs)(d.$,{variant:"outline",size:l,disabled:i,children:[a," ",(0,s.jsx)(n.A,{className:"opacity-60"})]})}),(0,s.jsx)(o.SQ,{align:"end",className:"min-w-52",children:t.map((e,t)=>"separator"in e?(0,s.jsx)(o.mB,{},"sep-".concat(t)):"heading"in e?(0,s.jsx)(o.lp,{className:"text-muted-foreground text-xs",children:e.heading},"h-".concat(t)):(0,s.jsxs)(o._2,{disabled:e.disabled,variant:e.destructive?"destructive":"default",onSelect:()=>e.onSelect(),title:e.hint,children:[e.icon,e.label]},e.label))})]})}},95567:(e,t,a)=>{a.d(t,{p:()=>o});var s=a(95155),n=a(43465),d=a(25016);function o(e){let{icon:t=n.A,title:a,description:o,action:i,className:l}=e;return(0,s.jsxs)("div",{className:(0,d.cn)("flex flex-col items-center justify-center gap-2 px-6 py-12 text-center",l),children:[(0,s.jsx)("div",{className:"bg-muted text-muted-foreground mb-1 flex size-11 items-center justify-center rounded-full",children:(0,s.jsx)(t,{className:"size-5"})}),(0,s.jsx)("p",{className:"font-medium",children:a}),o&&(0,s.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:o}),i&&(0,s.jsx)("div",{className:"mt-2",children:i})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js b/pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js new file mode 100644 index 00000000..fec76b6f --- /dev/null +++ b/pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[142],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},22012:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},24608:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43036:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},68673:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>q});var r=l(29320),a=l.t(r,2),n=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function p(...e){return t=>{let l=!1,r=e.map(e=>{let r=d(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,d=[];b(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;b(t)&&"function"==typeof w&&(t=w(t._payload)),i=u(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=r.cloneElement(i,void 0,d):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let p=i?k(i):void 0,y=c(l,p);if(!i){if(a||0===a)throw Error(o?M(e):x(e));return a}let h=m(n,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:p),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(f,"createSlot");var s=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var u=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}h(m,"mergeProps"),h(k,"getElementRef"),h(v,"isSlottable");var A=Symbol.for("react.lazy");function b(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===A&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}h(b,"isLazyComponent"),h(g,"isPromiseLike");var x=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(26276),S=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});S(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,q=r.forwardRef(j(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js b/pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js new file mode 100644 index 00000000..9e30cabc --- /dev/null +++ b/pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1452],{11363:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(26276);a(29320);var r=a(88674);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},50565:(e,t,a)=>{a.d(t,{d:()=>l});var s=a(26276);a(29320);var r=a(63240),n=a(88674);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.bL,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.zi,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,t,a)=>{a.d(t,{J:()=>o});var s=a(26276),r=a(29320),n=a(95774),l=a(5820),i=a(88674);let d=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.b,{ref:t,className:(0,i.cn)(d(),a),...r})});o.displayName=n.b.displayName},74875:(e,t,a)=>{a.d(t,{D:()=>l});var s=a(26276),r=a(50985),n=a(88674);function l(e){let{label:t,htmlFor:a,help:l,error:i,optional:d,children:o,className:c}=e;return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-1.5",c),children:[(0,s.jsxs)(r.J,{htmlFor:a,className:"text-sm font-medium",children:[t,d&&(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,s.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},81452:(e,t,a)=>{a.d(t,{H:()=>Y,RuleWizard:()=>Z});var s=a(26276),r=a(29320),n=a(91052),l=a.n(n),i=a(78113),d=a(7489),o=a(1947),c=a(63991),u=a(80403),m=a(72538),p=a(53630),h=a(40688),x=a(10365),f=a(48947),g=a(31935),v=a(10002),j=a(15410),b=a(34993),N=a(47045),y=a(81155),k=a(50985),w=a(35833),S=a(50565),_=a(11363),C=a(12373),O=a(21444),A=a(74875),J=a(97542),D=a(90554),q=a(21195),E=a(89839),F=a(28971),T=a(73062),z=a(22927),M=a(88674),R=a(20201),$=a(46425);let P=()=>({kind:"lambda",arn:"",mode:"event",input:"",inputPath:"",pathsMap:"",template:"",retries:"",maxAge:"",dlq:""});function I(e){var t,a,s,r,n,l,i;let d=e.input_transformer;return{id:e.id,kind:null!=(s=(0,R.WL)(e.arn))?s:"lambda",arn:e.arn,mode:d?"transformer":e.input_path?"path":e.input?"constant":"event",input:null!=(r=e.input)?r:"",inputPath:null!=(n=e.input_path)?n:"",pathsMap:(null==d?void 0:d.input_paths_map)&&Object.keys(d.input_paths_map).length?JSON.stringify(d.input_paths_map,null,2):"",template:null!=(l=null==d?void 0:d.input_template)?l:"",retries:(null==(t=e.retry_policy)?void 0:t.maximum_retry_attempts)!=null?String(e.retry_policy.maximum_retry_attempts):"",maxAge:(null==(a=e.retry_policy)?void 0:a.maximum_event_age_in_seconds)!=null?String(e.retry_policy.maximum_event_age_in_seconds):"",dlq:null!=(i=e.dead_letter_arn)?i:"",extra:{role_arn:e.role_arn,message_group_id:e.message_group_id}}}function U(e){let t=e.retries.trim()||e.maxAge.trim()?{maximum_retry_attempts:e.retries.trim()?Number(e.retries):void 0,maximum_event_age_in_seconds:e.maxAge.trim()?Number(e.maxAge):void 0}:void 0;return{...e.extra,id:e.id,arn:e.arn,input:"constant"===e.mode?e.input.trim():void 0,input_path:"path"===e.mode?e.inputPath.trim():void 0,input_transformer:"transformer"===e.mode?{input_paths_map:e.pathsMap.trim()?JSON.parse(e.pathsMap):void 0,input_template:e.template}:void 0,retry_policy:t,dead_letter_arn:e.dlq||void 0}}let B=/^\$(\.[A-Za-z0-9_\-]+|\[\d+\])*$/,L=[["Every minute","rate(1 minute)"],["Every 5 minutes","rate(5 minutes)"],["Every 15 minutes","cron(0/15 * * * ? *)"],["Hourly","rate(1 hour)"],["Daily","rate(1 day)"],["Daily at 12:00 UTC","cron(0 12 * * ? *)"],["Weekdays at 09:00 UTC","cron(0 9 ? * MON-FRI *)"],["1st of the month, 00:00 UTC","cron(0 0 1 * ? *)"]],W=["0","12","*","*","?","*"],H=JSON.stringify({source:["my.app"],"detail-type":["order.paid"]},null,2),V=e=>!e||"object"!=typeof e||Array.isArray(e)?"Must be a JSON object":null;function G(e){let t=e.trim();if(!t.startsWith("cron(")||!t.endsWith(")"))return null;let a=t.slice(5,-1).trim().split(/\s+/);return 6===a.length?a:null}function Y(){var e,t,a,s;let r=(0,z.gf)("/api/v1/lambda/functions",{revalidateOnFocus:!1}),n=(0,z.gf)("/api/v1/sqs/queues",{revalidateOnFocus:!1}),l=(0,z.gf)("/api/v1/sns/topics",{revalidateOnFocus:!1}),i=(0,z.gf)("/api/v1/sfn/state-machines",{revalidateOnFocus:!1});return{lambda:{data:null==(e=r.data)?void 0:e.map(e=>({name:e.name,arn:e.arn})),error:r.error},sqs:{data:null==(t=n.data)?void 0:t.map(e=>({name:e.name,arn:e.arn})),error:n.error},sns:{data:null==(a=l.data)?void 0:a.map(e=>({name:e.name,arn:e.arn})),error:l.error},sfn:{data:null==(s=i.data)?void 0:s.map(e=>({name:e.name,arn:e.arn})),error:i.error}}}function Z(){var e;let t=(0,i.useRouter)(),a=(0,z.pE)("name"),n=!!a,j=(0,z.pE)("bus")||"default",[w,Z]=(0,r.useState)(j);(0,r.useEffect)(()=>Z(j),[j]);let K=(0,z.gf)(n?"".concat(R.MU,"/").concat((0,F.aJ)(a)):null,{revalidateOnFocus:!1,keepPreviousData:!1,query:(0,R.nq)(w)}),Q=(0,z.gf)(n?null:R.MU,{revalidateOnFocus:!1,query:(0,R.nq)(w)}),et=Y(),[ea,es]=(0,r.useState)(""),[er,en]=(0,r.useState)(""),[el,ei]=(0,r.useState)("schedule"),[ed,eo]=(0,r.useState)("rate(5 minutes)"),[ec,eu]=(0,r.useState)(W),[em,ep]=(0,r.useState)(!1),[eh,ex]=(0,r.useState)(H),[ef,eg]=(0,r.useState)(""),[ev,ej]=(0,r.useState)(null),[eb,eN]=(0,r.useState)(!1),[ey,ek]=(0,r.useState)([P()]),[ew,eS]=(0,r.useState)(!0),[e_,eC]=(0,r.useState)(!1),[eO,eA]=(0,r.useState)(!1),[eJ,eD]=(0,r.useState)(!1);(0,r.useEffect)(()=>{var e,t;return eg(JSON.stringify({version:"0",id:"6a7e8feb-b491-4cf7-a9f1-bf3703467718","detail-type":"order.paid",source:"my.app",account:null!=(t=null==(e=(0,F.Ht)())?void 0:e.account_id)?t:"000000000000",time:new Date().toISOString().replace(/\.\d+Z$/,"Z"),region:"us-east-1",resources:[],detail:{order_id:"o-1001",total:42}},null,2))},[]),(0,r.useEffect)(()=>{var e,t,a;let s=K.data;if(s&&!e_){if(es(s.name),en(null!=(e=s.description)?e:""),s.schedule_expression){ei("schedule"),eo(s.schedule_expression);let e=G(s.schedule_expression);e&&eu(e)}else ei("pattern"),ex(JSON.stringify(null!=(t=s.event_pattern)?t:{},null,2));ek((null!=(a=s.targets)?a:[]).map(I)),eS("DISABLED"!==s.state),eC(!0)}},[K.data,e_]);let eq=e=>{eo(e);let t=G(e);t&&eu(t)},eE=(0,r.useMemo)(()=>{var e,t;let a={};if(!n){let t=(0,R.qx)(ea);t?a.name=t:(null==(e=Q.data)?void 0:e.some(e=>e.name===ea))&&(a.name="A rule named ".concat(ea," already exists"))}if(er.length>512&&(a.description="Descriptions are at most 512 characters"),"schedule"===el){let e=(0,R.Me)(ed);e?a.schedule=e:"default"!==w&&(a.schedule="Schedules run on the default event bus only")}else{let e=null!=(t=(0,J.F)(eh))?t:V(JSON.parse(eh));e&&(a.pattern=e)}let s=new Set;return ey.forEach((e,t)=>{var r,n;if(e.arn?s.has(e.arn)&&(a["t".concat(t,"arn")]="This target is already added"):a["t".concat(t,"arn")]="Choose a ".concat(null!=(n=null==(r=R.aO.find(t=>t.kind===e.kind))?void 0:r.noun)?n:"target"),s.add(e.arn),"constant"===e.mode){let s=e.input.trim()?(0,J.F)(e.input):"Enter the JSON to send";s&&(a["t".concat(t,"input")]=e.input.trim()?"Invalid JSON: ".concat(s):s)}else if("path"===e.mode)B.test(e.inputPath.trim())||(a["t".concat(t,"input")]="Enter a JSONPath such as $.detail");else if("transformer"===e.mode){if(e.pathsMap.trim()){let s=(0,J.F)(e.pathsMap),r=s?null:JSON.parse(e.pathsMap);s?a["t".concat(t,"paths")]="Invalid JSON: ".concat(s):(!r||"object"!=typeof r||Array.isArray(r)||Object.values(r).some(e=>"string"!=typeof e||!B.test(e)))&&(a["t".concat(t,"paths")]='Must be an object of JSONPaths, e.g. {"id": "$.detail.id"}')}e.template.trim()||(a["t".concat(t,"template")]="The input template is required")}let l=Number(e.retries);e.retries.trim()&&(!Number.isInteger(l)||l<0||l>185)&&(a["t".concat(t,"retries")]="0 to 185");let i=Number(e.maxAge);e.maxAge.trim()&&(!Number.isInteger(i)||i<60||i>86400)&&(a["t".concat(t,"age")]="60 to 86400 seconds")}),a},[n,ea,Q.data,er,el,ed,eh,ey,w]),eF=e=>eO?eE[e]:void 0,eT=0===Object.keys(eE).length,ez=(0,r.useMemo)(()=>"schedule"!==el||(0,R.Me)(ed)?[]:(0,R.Oz)(ed,5),[el,ed]),eM=(0,r.useMemo)(()=>{try{return"rate"===(0,R.nP)(ed).kind}catch(e){return!1}},[ed]),eR=async()=>{var e,t;let a=null!=(e=(0,J.F)(eh))?e:V(JSON.parse(eh)),s=null!=(t=(0,J.F)(ef))?t:V(JSON.parse(ef));if(a||s)return void b.oR.error(a?"Event pattern: ".concat(a):"Sample event: ".concat(s));eN(!0);try{let e=await F.FH.post("".concat(R.W1,"/test-pattern"),{pattern:JSON.parse(eh),event:JSON.parse(ef)});ej(e.result)}catch(e){b.oR.error((0,F.gJ)(e))}finally{eN(!1)}},e$=async()=>{if(eA(!0),!eT)return void b.oR.error("Fix the highlighted fields before saving");let e={description:er.trim(),schedule_expression:"schedule"===el?ed.trim():void 0,event_pattern:"pattern"===el?JSON.parse(eh):void 0,state:ew?"ENABLED":"DISABLED",targets:ey.map(U)};eD(!0);try{let a=await F.FH.put("".concat(R.MU,"/").concat((0,F.aJ)(ea)),e,(0,R.nq)(w)),s=a.schedule_expression&&(0,R.xN)(a)?" Next run ".concat((0,T.Yq)(a.next_run)).concat("DISABLED"===a.state?" once enabled":"","."):"";b.oR.success("".concat(n?"Saved":"Created"," rule ").concat(a.name,".").concat(s)),await (0,z.Yi)(R.MU),t.push((0,R.Gd)(a.name,w))}catch(e){b.oR.error((0,F.gJ)(e)),eD(!1)}},eP=n?"Edit rule ".concat(a):"Create rule",eI=[{label:"EventBridge",href:"/events/"},{label:"Rules",href:"/events/"},...n?[{label:a,href:(0,R.Gd)(a,w)},{label:"Edit"}]:[{label:"Create rule"}]];if(n&&K.error&&!K.data){let e=K.error instanceof F.hD&&404===K.error.status;return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(q.z,{title:eP,breadcrumbs:eI}),e?(0,s.jsx)(E.w,{children:(0,s.jsx)(C.p,{icon:d.A,title:"Rule not found",description:"Rule ".concat(a," does not exist."),action:(0,s.jsx)(N.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)(l(),{href:"/events/",children:[(0,s.jsx)(o.A,{})," Back to rules"]})})})}):(0,s.jsx)(O.W,{error:K.error,onRetry:()=>K.mutate()})]})}return n&&!e_?(0,s.jsx)(D.P0,{}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(q.z,{title:eP,description:"A rule runs on a schedule or matches published events, then delivers to up to five targets.",breadcrumbs:eI}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),e$()},className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-[minmax(0,1fr)_320px]",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,s.jsx)(E.w,{title:"Rule details",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(A.D,{label:"Event bus",htmlFor:"rule-bus",help:n?"A rule's bus cannot be changed.":"Schedules run on the default bus only; event patterns work on any bus.",children:(0,s.jsx)($.z,{id:"rule-bus",value:w,onChange:Z,disabled:n,className:"max-w-md"})}),(0,s.jsx)(A.D,{label:"Name",htmlFor:"rule-name",error:eF("name"),help:n?"Rule names cannot be changed.":"Up to 64 letters, digits, dots, hyphens and underscores.",children:(0,s.jsx)(y.p,{id:"rule-name",value:ea,onChange:e=>es(e.target.value),disabled:n,placeholder:"e.g. nightly-report",autoFocus:!n,autoComplete:"off",spellCheck:!1,className:"max-w-md"})}),(0,s.jsx)(A.D,{label:"Description",htmlFor:"rule-desc",optional:!0,error:eF("description"),children:(0,s.jsx)(_.T,{id:"rule-desc",rows:2,value:er,onChange:e=>en(e.target.value),className:"max-w-xl"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Rule type"}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",role:"radiogroup","aria-label":"Rule type",children:[["schedule",c.A,"Schedule","Run the targets at a fixed rate or on a cron schedule (UTC)."],["pattern",u.A,"Event pattern","Run the targets when a published event matches a pattern."]].map(e=>{let[t,a,r,n]=e,l=el===t;return(0,s.jsxs)("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>ei(t),className:(0,M.cn)("relative flex gap-3 rounded-lg border p-3 text-left transition-colors",l?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,s.jsx)(a,{className:(0,M.cn)("mt-0.5 size-5 shrink-0",l?"text-primary":"text-muted-foreground")}),(0,s.jsxs)("span",{className:"flex flex-col gap-0.5 pr-6",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:r}),(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]}),l&&(0,s.jsx)("span",{className:"bg-primary text-primary-foreground absolute top-2 right-2 flex size-5 items-center justify-center rounded-full",children:(0,s.jsx)(m.A,{className:"size-3.5"})})]},t)})})]})]})}),"schedule"===el&&(0,s.jsx)(E.w,{title:"Schedule",description:"Times are UTC. The scheduler checks rules at the top of every minute.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:L.map(e=>{let[t,a]=e;return(0,s.jsx)(N.$,{type:"button",size:"sm",variant:ed.trim()===a?"secondary":"outline",className:"h-7 text-xs",onClick:()=>eq(a),title:a,children:t},a)})}),(0,s.jsx)(A.D,{label:"Schedule expression",htmlFor:"rule-schedule",error:null!=(e=eF("schedule"))?e:ed.trim()&&eE.schedule?eE.schedule:void 0,help:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-mono",children:"rate(N minute|minutes|hour|hours|day|days)"})," or"," ",(0,s.jsx)("span",{className:"font-mono",children:"cron(minutes hours day-of-month month day-of-week year)"})]}),children:(0,s.jsx)(y.p,{id:"rule-schedule",value:ed,onChange:e=>eq(e.target.value),placeholder:"rate(5 minutes)",spellCheck:!1,className:"max-w-md font-mono"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ep(!em),className:"text-primary w-fit text-sm hover:underline",children:em?"Hide cron builder":"Build a cron expression"}),em&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:R.fC.map((e,t)=>(0,s.jsx)(A.D,{label:(0,s.jsx)("span",{className:"text-xs",children:e.label}),htmlFor:"cron-".concat(t),help:e.hint,children:(0,s.jsx)(y.p,{id:"cron-".concat(t),value:ec[t],onChange:e=>((e,t)=>{let a=ec.map((a,s)=>s===e?t:a);eu(a),eo("cron(".concat(a.map(e=>e.trim()||"*").join(" "),")"))})(t,e.target.value),placeholder:e.placeholder,className:"h-8 font-mono",spellCheck:!1})},e.label))}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Use ",(0,s.jsx)("span",{className:"font-mono",children:"*"})," for any value, ",(0,s.jsx)("span",{className:"font-mono",children:"?"})," in exactly one of day-of-month and day-of-week, ranges ",(0,s.jsx)("span",{className:"font-mono",children:"MON-FRI"}),", lists ",(0,s.jsx)("span",{className:"font-mono",children:"1,15"})," and steps"," ",(0,s.jsx)("span",{className:"font-mono",children:"0/15"}),"."]})]})]}),(0,s.jsxs)("div",{className:"bg-muted/30 flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Next runs"," ",!eE.schedule&&(0,s.jsxs)("span",{className:"text-muted-foreground font-normal",children:["\xb7 ",(0,R.Bg)(ed)]})]}),ez.length?(0,s.jsx)("ol",{className:"flex flex-col gap-0.5 text-sm",children:ez.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap gap-x-3",children:[(0,s.jsx)("span",{className:"font-mono text-[13px]",children:(0,R.ay)(e)}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[(0,T.Yq)(e,!1)," local"]})]},e.getTime()))}):(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:eE.schedule?"Enter a valid expression to preview run times.":"No run in the next year."}),(0,s.jsxs)("p",{className:"text-muted-foreground flex gap-1.5 text-xs",children:[(0,s.jsx)(p.A,{className:"mt-px size-3.5 shrink-0"}),(0,s.jsxs)("span",{children:[eM?"Rates are counted from when the rule is saved (then from each run). ":"","This is an estimate: the server computes the exact next run, shown on the rule after saving."]})]})]})]})}),"pattern"===el&&(0,s.jsx)(E.w,{title:"Event pattern",description:"Every key in the pattern must match the event. Arrays list allowed values; nested objects match nested fields.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(A.D,{label:"Pattern",error:eF("pattern"),children:(0,s.jsx)(J.i,{value:eh,onChange:e=>(ex(e),ej(null)),rows:8,validate:V})}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Supported matchers: exact values ",(0,s.jsx)("span",{className:"font-mono",children:'["a","b"]'}),", ",(0,s.jsx)("span",{className:"font-mono",children:'{"prefix":"ord"}'}),","," ",(0,s.jsx)("span",{className:"font-mono",children:'{"exists":true}'}),", ",(0,s.jsx)("span",{className:"font-mono",children:'{"anything-but":["x"]}'})," and"," ",(0,s.jsx)("span",{className:"font-mono",children:'{"numeric":[">",0,"<=",100]}'}),"."]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Test with a sample event"}),(0,s.jsx)(J.i,{value:ef,onChange:e=>(eg(e),ej(null)),rows:12,validate:V}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(N.$,{type:"button",variant:"outline",size:"sm",onClick:eR,disabled:eb,children:[eb?(0,s.jsx)(h.A,{className:"animate-spin"}):(0,s.jsx)(x.A,{}),"Test pattern"]}),!0===ev&&(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-sm font-medium text-emerald-700 dark:text-emerald-400",children:[(0,s.jsx)(f.A,{className:"size-4"})," The sample event matches the pattern"]}),!1===ev&&(0,s.jsxs)("span",{className:"text-destructive flex items-center gap-1.5 text-sm font-medium",children:[(0,s.jsx)(g.A,{className:"size-4"})," The sample event does not match"]})]})]})]})}),(0,s.jsx)(E.w,{title:"Targets",description:"Each target receives the event JSON, part of it, a constant, or a transformed template. Failed deliveries are retried and can go to a dead-letter queue.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[0===ey.length&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"No targets: the rule will fire and count invocations but deliver nothing."}),ey.map((e,t)=>{var a,r,n;return(0,s.jsx)(X,{index:t,row:e,options:et[e.kind],onChange:e=>ek(ey.map((a,s)=>s===t?{...a,...e}:a)),onRemove:()=>ek(ey.filter((e,a)=>a!==t)),queues:et.sqs,errors:{arn:eF("t".concat(t,"arn")),input:eF("t".concat(t,"input")),paths:null!=(a=eF("t".concat(t,"paths")))?a:eE["t".concat(t,"paths")],template:eF("t".concat(t,"template")),retries:null!=(r=eF("t".concat(t,"retries")))?r:eE["t".concat(t,"retries")],age:null!=(n=eF("t".concat(t,"age")))?n:eE["t".concat(t,"age")]}},t)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(N.$,{type:"button",variant:"outline",size:"sm",disabled:ey.length>=5,onClick:()=>ek([...ey,P()]),children:[(0,s.jsx)(v.A,{})," Add target"]}),(0,s.jsxs)("span",{className:"text-muted-foreground text-xs",children:[ey.length," of 5"]})]})]})})]}),(0,s.jsx)("aside",{className:"xl:sticky xl:top-4",children:(0,s.jsx)(E.w,{title:"Summary",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(k.J,{htmlFor:"rule-enabled",className:"font-medium",children:"Enabled"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Disabled rules keep their configuration but never fire."})]}),(0,s.jsx)(S.d,{id:"rule-enabled",checked:ew,onCheckedChange:eS})]}),(0,s.jsxs)("dl",{className:"flex flex-col gap-3 border-t pt-3 text-sm",children:[(0,s.jsx)(ee,{label:"Name",children:(0,s.jsx)("span",{className:"font-mono text-[13px] break-all",children:ea||"-"})}),(0,s.jsx)(ee,{label:"Type",children:"schedule"===el?"Schedule":"Event pattern"}),"schedule"===el?(0,s.jsx)(ee,{label:"Schedule",children:(0,s.jsx)("span",{className:"font-mono text-[13px] break-all",children:ed||"-"})}):(0,s.jsx)(ee,{label:"Pattern",children:(0,s.jsx)("span",{className:"font-mono text-[12.5px] break-all",children:(0,J.F)(eh)?"Invalid JSON":(0,R.tJ)(JSON.parse(eh),140)})}),(0,s.jsx)(ee,{label:"Targets",children:ey.filter(e=>e.arn).length?(0,s.jsx)("ul",{className:"flex flex-col gap-0.5",children:ey.filter(e=>e.arn).map(e=>{var t;return(0,s.jsxs)("li",{className:"truncate",children:[(0,s.jsxs)("span",{className:"text-muted-foreground text-xs",children:[null==(t=R.aO.find(t=>t.kind===e.kind))?void 0:t.label,":"]})," ",(0,R.je)(e.arn)]},e.arn)})}):"None"})]}),eO&&!eT&&(0,s.jsx)("p",{className:"text-destructive text-xs",children:"Some settings need attention. Check the highlighted fields."}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,s.jsxs)(N.$,{type:"submit",disabled:eJ,children:[eJ&&(0,s.jsx)(h.A,{className:"animate-spin"}),n?"Save changes":"Create rule"]}),(0,s.jsx)(N.$,{type:"button",variant:"outline",asChild:!0,children:(0,s.jsx)(l(),{href:n?(0,R.Gd)(a,w):"/events/",children:"Cancel"})})]})]})})})]})]})}let K=[{value:"event",label:"Matched event",help:"The whole event JSON."},{value:"path",label:"Part of the matched event",help:"The value at a JSONPath of the event."},{value:"constant",label:"Constant (JSON text)",help:"Fixed JSON instead of the event."},{value:"transformer",label:"Input transformer",help:"Extract values into variables, then fill a template."}],Q="__none__";function X(e){var t,a,n;let{index:l,row:i,options:d,queues:o,onChange:c,onRemove:u,errors:m}=e,[p,h]=(0,r.useState)(!1),x=p||!!(i.retries||i.maxAge||i.dlq),f=R.aO.find(e=>e.kind===i.kind),g=null!=(t=d.data)?t:[],v=i.arn&&d.data&&!g.some(e=>e.arn===i.arn),b=null!=(a=o.data)?a:[],k=K.find(e=>e.value===i.mode);return(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Target ",l+1]}),(0,s.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",className:"size-7",onClick:u,"aria-label":"Remove target",children:(0,s.jsx)(j.A,{})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[12rem_minmax(0,1fr)]",children:[(0,s.jsx)(A.D,{label:"Target type",children:(0,s.jsxs)(w.l6,{value:i.kind,onValueChange:e=>c({kind:e,arn:""}),children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":"Target type",children:(0,s.jsx)(w.yv,{})}),(0,s.jsx)(w.gC,{children:R.aO.map(e=>(0,s.jsx)(w.eb,{value:e.kind,children:e.label},e.kind))})]})}),(0,s.jsx)(A.D,{label:f.label,error:null!=(n=m.arn)?n:d.error?(0,F.gJ)(d.error):void 0,help:i.arn?(0,s.jsx)("span",{className:"font-mono break-all",children:i.arn}):void 0,children:(0,s.jsxs)(w.l6,{value:i.arn,onValueChange:e=>c({arn:e}),disabled:!d.data,children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":f.label,children:(0,s.jsx)(w.yv,{placeholder:d.data?g.length?"Choose a ".concat(f.noun):"No ".concat(f.noun,"s found"):"Loading..."})}),(0,s.jsxs)(w.gC,{children:[v&&(0,s.jsxs)(w.eb,{value:i.arn,children:[(0,R.je)(i.arn)," ",(0,s.jsx)("span",{className:"text-destructive text-xs",children:"(not found)"})]}),g.map(e=>(0,s.jsx)(w.eb,{value:e.arn,children:e.name},e.arn))]})]})})]}),(0,s.jsx)(A.D,{label:"Configure target input",help:k.help,children:(0,s.jsxs)(w.l6,{value:i.mode,onValueChange:e=>c({mode:e}),children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full sm:w-72","aria-label":"Target input",children:(0,s.jsx)(w.yv,{})}),(0,s.jsx)(w.gC,{children:K.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})}),"constant"===i.mode&&(0,s.jsx)(A.D,{label:"Constant input (JSON)",error:m.input,children:(0,s.jsx)(_.T,{rows:3,value:i.input,onChange:e=>c({input:e.target.value}),placeholder:'{"task": "cleanup"}',className:"font-mono text-[13px]",spellCheck:!1})}),"path"===i.mode&&(0,s.jsx)(A.D,{label:"Input path",error:m.input,help:"For example $.detail sends only the event's detail object.",children:(0,s.jsx)(y.p,{value:i.inputPath,onChange:e=>c({inputPath:e.target.value}),placeholder:"$.detail",className:"h-8 font-mono text-[13px]",spellCheck:!1})}),"transformer"===i.mode&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A.D,{label:"Input path",optional:!0,error:m.paths,help:"A JSON object mapping variable names to JSONPaths into the event.",children:(0,s.jsx)(_.T,{rows:3,value:i.pathsMap,onChange:e=>c({pathsMap:e.target.value}),placeholder:'{\n "order": "$.detail.order_id",\n "source": "$.source"\n}',className:"font-mono text-[13px]",spellCheck:!1})}),(0,s.jsx)(A.D,{label:"Template",error:m.template,help:"Use placeholders. inserts the whole event, the rule name.",children:(0,s.jsx)(_.T,{rows:3,value:i.template,onChange:e=>c({template:e.target.value}),placeholder:'{"text": "Order from "}',className:"font-mono text-[13px]",spellCheck:!1})})]}),(0,s.jsxs)("label",{className:"flex w-fit items-center gap-2 text-sm",children:[(0,s.jsx)(S.d,{checked:x,onCheckedChange:e=>{h(e),e||c({retries:"",maxAge:"",dlq:""})},"aria-label":"Retry policy and dead-letter queue"}),"Retry policy and dead-letter queue"]}),x&&(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,s.jsx)(A.D,{label:"Maximum age of event",error:m.age,help:"Seconds, 60-86400 (default 86400).",children:(0,s.jsx)(y.p,{inputMode:"numeric",value:i.maxAge,onChange:e=>c({maxAge:e.target.value.replace(/[^\d]/g,"")}),placeholder:"86400",className:"h-8"})}),(0,s.jsx)(A.D,{label:"Retry attempts",error:m.retries,help:"0-185 (default 185).",children:(0,s.jsx)(y.p,{inputMode:"numeric",value:i.retries,onChange:e=>c({retries:e.target.value.replace(/[^\d]/g,"")}),placeholder:"185",className:"h-8"})}),(0,s.jsx)(A.D,{label:"Dead-letter queue",help:"Undeliverable events go to this SQS queue.",error:o.error?(0,F.gJ)(o.error):void 0,children:(0,s.jsxs)(w.l6,{value:i.dlq||Q,onValueChange:e=>c({dlq:e===Q?"":e}),disabled:!o.data,children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":"Dead-letter queue",children:(0,s.jsx)(w.yv,{placeholder:"None"})}),(0,s.jsxs)(w.gC,{children:[(0,s.jsx)(w.eb,{value:Q,children:"None"}),i.dlq&&!b.some(e=>e.arn===i.dlq)&&(0,s.jsx)(w.eb,{value:i.dlq,children:(0,R.je)(i.dlq)}),b.map(e=>(0,s.jsx)(w.eb,{value:e.arn,children:e.name},e.arn))]})]})})]})]})}function ee(e){let{label:t,children:a}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground text-xs font-medium",children:t}),(0,s.jsx)("dd",{className:"min-w-0 break-words",children:a})]})}},89839:(e,t,a)=>{a.d(t,{w:()=>n});var s=a(26276),r=a(88674);function n(e){let{title:t,description:a,actions:n,children:l,className:i,bodyClassName:d,flush:o}=e;return(0,s.jsxs)("section",{className:(0,r.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||n)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),a&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:a})]}),n&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:n})]}),(0,s.jsx)("div",{className:(0,r.cn)(!o&&"p-4",d),children:l})]})}},97542:(e,t,a)=>{a.d(t,{F:()=>c,i:()=>u});var s=a(26276),r=a(29320),n=a(7489),l=a(48947),i=a(79092),d=a(47045),o=a(88674);function c(e){if(!e.trim())return"Document is empty";try{return JSON.parse(e),null}catch(e){return e instanceof Error?e.message:String(e)}}function u(e){let{value:t,onChange:a,rows:u=16,readOnly:m,validate:p,className:h,id:x}=e,f=(0,r.useMemo)(()=>{let e=c(t);return e||(p?p(JSON.parse(t)):null)},[t,p]),g=Math.max(t.split("\n").length,u);return(0,s.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-2",h),children:[(0,s.jsxs)("div",{className:(0,o.cn)("bg-muted/30 flex overflow-hidden rounded-md border font-mono text-[13px] leading-5",f&&!m&&"border-destructive/60"),children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"text-muted-foreground/60 bg-muted/50 border-r px-2 py-2 text-right select-none",children:Array.from({length:g},(e,t)=>(0,s.jsx)("div",{children:t+1},t))}),(0,s.jsx)("textarea",{id:x,value:t,readOnly:m,onChange:e=>null==a?void 0:a(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!m){e.preventDefault();let s=e.currentTarget,{selectionStart:r,selectionEnd:n}=s,l=t.slice(0,r)+" "+t.slice(n);null==a||a(l),requestAnimationFrame(()=>{s.selectionStart=s.selectionEnd=r+2})}},spellCheck:!1,rows:g,className:"min-w-0 flex-1 resize-none overflow-x-auto bg-transparent px-3 py-2 whitespace-pre outline-none"})]}),!m&&(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f?(0,s.jsxs)("span",{className:"text-destructive flex items-center gap-1",children:[(0,s.jsx)(n.A,{className:"size-3.5"})," ",f]}):(0,s.jsxs)("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[(0,s.jsx)(l.A,{className:"size-3.5"})," Valid JSON"]}),(0,s.jsxs)(d.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{try{null==a||a(JSON.stringify(JSON.parse(t),null,2))}catch(e){}},disabled:!!c(t),children:[(0,s.jsx)(i.A,{})," Format"]})]})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js b/pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js new file mode 100644 index 00000000..2158bfbc --- /dev/null +++ b/pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1457],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),s=r(12377),p=r(26276),u="Switch",[f,y]=(0,i.A)(u),[h,m]=f(u),b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:f,value:y="on",onCheckedChange:m,form:b,...k}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),S=l.useRef(!1),E=!v||b||!!v.closest("form"),[M=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:m});return(0,p.jsxs)(h,{scope:r,checked:M,disabled:f,children:[(0,p.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":M,"aria-required":u,"data-state":g(M),"data-disabled":f?"":void 0,disabled:f,value:y,...k,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,p.jsx)(A,{control:v,bubbles:!S.current,name:i,value:y,checked:M,required:u,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});b.displayName=u;var k="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=m(k,r);return(0,p.jsx)(s.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=k;var A=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),s=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,p.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var x=b,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},76216:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tp(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];A(n)&&"function"==typeof S&&(n=S(n._payload)),l.Children.forEach(n,e=>{if(k(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof S&&(t=S(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?b(i):void 0,p=s(r,d);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=m(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?p:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var y=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}u(m,"mergeProps"),u(b,"getElementRef"),u(k,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(g,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=n[" use ".trim().toString()],E=r(26276),M=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});M(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js b/pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js new file mode 100644 index 00000000..a2ab2ce5 --- /dev/null +++ b/pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1481],{2430:(e,t,r)=>{r.d(t,{N:()=>c});var l=r(29320),n=r(65335),o=r(36103),a=r(18442),i=r(26276);function c(e){let t=e+"CollectionProvider",[r,c]=(0,n.A)(t),[s,d]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:r}=e,n=l.useRef(null),o=l.useRef(new Map).current;return(0,i.jsx)(s,{scope:t,itemMap:o,collectionRef:n,children:r})};u.displayName=t;let m=e+"CollectionSlot",f=l.forwardRef((e,t)=>{let{scope:r,children:l}=e,n=d(m,r),c=(0,o.s)(t,n.collectionRef);return(0,i.jsx)(a.DX,{ref:c,children:l})});f.displayName=m;let y=e+"CollectionItemSlot",p="data-radix-collection-item",h=l.forwardRef((e,t)=>{let{scope:r,children:n,...c}=e,s=l.useRef(null),u=(0,o.s)(t,s),m=d(y,r);return l.useEffect(()=>(m.itemMap.set(s,{ref:s,...c}),()=>void m.itemMap.delete(s))),(0,i.jsx)(a.DX,{...{[p]:""},ref:u,children:n})});return h.displayName=y,[{Provider:u,Slot:f,ItemSlot:h},function(t){let r=d(e+"CollectionConsumer",t);return l.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(p,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},c]}},3209:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},21308:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>d});var l=r(29320),n=(e,t,r,l,n,o,a,i)=>{let c=document.documentElement,s=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,l=r&&o?n.map(e=>o[e]||e):n;r?(c.classList.remove(...l),c.classList.add(o&&o[t]?o[t]:t)):c.setAttribute(e,t)}),r=t,i&&s.includes(r)&&(c.style.colorScheme=r)}if(l)d(l);else try{let e=localStorage.getItem(t)||r,l=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(l)}catch(e){}},o=["light","dark"],a="(prefers-color-scheme: dark)",i=l.createContext(void 0),c={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=l.useContext(i))?e:c},d=e=>l.useContext(i)?l.createElement(l.Fragment,null,e.children):l.createElement(m,{...e}),u=["light","dark"],m=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:n=!0,enableColorScheme:c=!0,storageKey:s="theme",themes:d=u,defaultTheme:m=n?"system":"light",attribute:b="data-theme",value:v,children:g,nonce:k,scriptProps:x}=e,[S,w]=l.useState(()=>y(s,m)),[E,A]=l.useState(()=>"system"===S?h():S),C=v?Object.values(v):d,M=l.useCallback(e=>{let t=e;if(!t)return;"system"===e&&n&&(t=h());let l=v?v[t]:t,a=r?p(k):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...C),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(b)?b.forEach(s):s(b),c){let e=o.includes(m)?m:null,r=o.includes(t)?t:e;i.style.colorScheme=r}null==a||a()},[k]),R=l.useCallback(e=>{let t="function"==typeof e?e(S):e;w(t);try{localStorage.setItem(s,t)}catch(e){}},[S]),j=l.useCallback(e=>{A(h(e)),"system"===S&&n&&!t&&M("system")},[S,t]);l.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(j),j(e),()=>e.removeListener(j)},[j]),l.useEffect(()=>{let e=e=>{e.key===s&&(e.newValue?w(e.newValue):R(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[R]),l.useEffect(()=>{M(null!=t?t:S)},[t,S]);let P=l.useMemo(()=>({theme:S,setTheme:R,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:n?[...d,"system"]:d,systemTheme:n?E:void 0}),[S,R,t,E,n,d]);return l.createElement(i.Provider,{value:P},l.createElement(f,{forcedTheme:t,storageKey:s,attribute:b,enableSystem:n,enableColorScheme:c,defaultTheme:m,value:v,themes:d,nonce:k,scriptProps:x}),g)},f=l.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:o,enableSystem:a,enableColorScheme:i,defaultTheme:c,value:s,themes:d,nonce:u,scriptProps:m}=e,f=JSON.stringify([o,r,c,t,d,s,a,i]).slice(1,-1);return l.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(n.toString(),")(").concat(f,")")}})}),y=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},p=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},39367:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},40688:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},49305:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},82708:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},84083:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},89965:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},91276:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>j});var l=r(29320),n=r.t(l,2),o=r(93993),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function s(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...o}=t,a=null,i=!1,c=[];k(n)&&"function"==typeof E&&(n=E(n._payload)),l.Children.forEach(n,e=>{if(v(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof E&&(t=E(t._payload)),a=p(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=l.cloneElement(a,void 0,c):!i&&1===l.Children.count(n)&&l.isValidElement(n)&&(a=n);let s=a?b(a):void 0,u=d(r,s);if(!a){if(n||0===n)throw Error(i?w(e):S(e));return n}let m=h(o,a.props??{});return a.type!==l.Fragment&&(m.ref=r?u:s),l.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}m(f,"createSlot");var y=Symbol.for("radix.slottable");m(function(e){let t=m(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var p=m((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let r={...t};for(let l in t){let n=e[l],o=t[l];/^on[A-Z]/.test(l)?n&&o?r[l]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...o}:"className"===l&&(r[l]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}m(h,"mergeProps"),m(b,"getElementRef"),m(v,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}m(k,"isLazyComponent"),m(x,"isPromiseLike");var S=m(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=m(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),E=n[" use ".trim().toString()],A=r(26276),C=Object.defineProperty,M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,A.jsx)(n?r:t,{...o,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});C(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=l.forwardRef(R(function(e,t){return(0,A.jsx)(M.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},97645:(e,t,r)=>{r.d(t,{jH:()=>o});var l=r(29320);r(26276);var n=l.createContext(void 0);function o(e){let t=l.useContext(n);return e||t||"ltr"}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js b/pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js new file mode 100644 index 00000000..ed233ccd --- /dev/null +++ b/pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1490],{7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>R});var r=l(29320),a=l.t(r,2),n=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,c=[];A(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let d=i?m(i):void 0,y=p(l,d);if(!i){if(a||0===a)throw Error(o?M(e):g(e));return a}let u=k(n,i.props??{});return i.type!==r.Fragment&&(u.ref=l?y:d),r.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var h=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var s=u((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}u(k,"mergeProps"),u(m,"getElementRef"),u(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(x,"isPromiseLike");var g=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(26276),C=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});C(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=r.forwardRef(j(function(e,t){return(0,E.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},98123:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/150-46fef33977dc7f29.js b/pages/demo/_next/static/chunks/150-46fef33977dc7f29.js new file mode 100644 index 00000000..6c58facc --- /dev/null +++ b/pages/demo/_next/static/chunks/150-46fef33977dc7f29.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150],{17286:(e,t,n)=>{n.d(t,{Rh:()=>f,Wh:()=>b});var s=n(26276),a=n(40688),r=n(48947),l=n(31935),i=n(64761),c=n(64206),o=n(46319),d=n(42812),u=n(88674);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},x={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),g={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function f(e){let t=g[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function p(e){let{tone:t,spinning:n}=e,m="size-3.5 shrink-0";if(n)return(0,s.jsx)(a.A,{className:(0,u.cn)(m,"animate-spin")});switch(t){case"success":return(0,s.jsx)(r.A,{className:m});case"danger":return(0,s.jsx)(l.A,{className:m});case"warning":return(0,s.jsx)(i.A,{className:m});case"info":return(0,s.jsx)(c.A,{className:(0,u.cn)(m,"fill-current")});default:return"neutral"===t?(0,s.jsx)(o.A,{className:m}):(0,s.jsx)(d.A,{className:m})}}function b(e){var t;let{status:n,label:a,tone:r,className:l}=e,i=null!=r?r:null!=(t=x[n.toLowerCase()])?t:"neutral",c=null!=a?a:f(n);return(0,s.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[i],l),children:[(0,s.jsx)(p,{tone:i,spinning:h.has(n.toLowerCase())}),(0,s.jsx)("span",{children:c})]})}},27374:(e,t,n)=>{n.d(t,{NG:()=>v,eN:()=>b,pJ:()=>N,q:()=>p,rj:()=>f,ti:()=>j});var s=n(26276),a=n(29320),r=n(98123),l=n(9443),i=n(9828),c=n(47045),o=n(89839),d=n(53023),u=n(76962),m=n(21444),x=n(60528),h=n(22927),g=n(88674);function f(e){let t=/^[a-z0-9.-]*$/.test(e),n=e.length>0&&/^[a-z0-9]/.test(e)&&/[a-z0-9]$/.test(e);return[{label:"Between 3 and 63 characters",ok:e.length>=3&&e.length<=63},{label:"Only lowercase letters, digits, dots (.) and hyphens (-)",ok:e.length>0&&t},{label:"Starts and ends with a letter or digit",ok:n}]}function p(e){return f(e).every(e=>e.ok)}let b=(e,t)=>{let n=new URLSearchParams({name:e,...t});return"/s3/bucket/?".concat(n.toString())};function j(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1).toLowerCase():""}function v(e){let{code:t,className:n}=e;return(0,s.jsxs)("div",{className:(0,g.cn)("bg-muted/50 relative rounded-md border",n),children:[(0,s.jsx)("pre",{className:"overflow-x-auto p-3 pr-10 font-mono text-[12.5px] leading-5 whitespace-pre",children:t}),(0,s.jsx)("div",{className:"absolute top-2 right-2",children:(0,s.jsx)(u.i8,{value:t,label:"Copy code"})})]})}function k(e){let{value:t}=e,[n,i]=(0,a.useState)(!1);return(0,s.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1",children:[(0,s.jsx)("span",{className:"truncate font-mono text-[13px]",children:n?t:"•".repeat(Math.min(24,t.length||8))}),(0,s.jsx)("button",{type:"button",onClick:()=>i(!n),"aria-label":n?"Hide":"Show",className:"text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded",children:n?(0,s.jsx)(r.A,{className:"size-3.5"}):(0,s.jsx)(l.A,{className:"size-3.5"})}),(0,s.jsx)(u.i8,{value:t,label:"Copy secret"})]})}function N(e){let{bucket:t}=e,{data:n,error:r,isLoading:l,mutate:g}=(0,h.gf)("/api/v1/s3/credentials",{revalidateOnFocus:!1}),[f,p]=(0,a.useState)(!!t),b=n?["export AWS_ACCESS_KEY_ID=".concat(n.access_key_id),"export AWS_SECRET_ACCESS_KEY=".concat(n.secret_access_key),"export AWS_DEFAULT_REGION=".concat(n.region),"","aws --endpoint-url ".concat(n.endpoint," s3 ls").concat(t?" s3://".concat(t,"/"):"")].join("\n"):"";return(0,s.jsx)(o.w,{title:(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"text-muted-foreground size-4"})," S3 API access"]}),description:"The HomeCloud S3 endpoint speaks the S3 protocol: point any AWS SDK or the AWS CLI at it.",actions:(0,s.jsxs)(c.$,{variant:"outline",size:"sm",onClick:()=>p(!f),children:[f?"Hide":"Show"," details"]}),className:f?void 0:"[&>header]:border-b-0",bodyClassName:f?void 0:"hidden",children:r?(0,s.jsx)(m.W,{error:r,onRetry:()=>g()}):l||!n?(0,s.jsx)(x.E,{className:"h-24"}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.v,{columns:2,items:[{label:"Endpoint",value:(0,s.jsx)(u.xh,{value:n.endpoint})},{label:"Region",value:(0,s.jsx)(u.xh,{value:n.region})},{label:"Access key ID",value:(0,s.jsx)(u.xh,{value:n.access_key_id})},{label:"Secret access key",value:(0,s.jsx)(k,{value:n.secret_access_key})}]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"AWS CLI example"}),(0,s.jsx)(v,{code:b})]})]})})}},28553:(e,t,n)=>{n.d(t,{LY:()=>u,O6:()=>c,_y:()=>o,fP:()=>d});var s=n(26276),a=n(15410),r=n(10002),l=n(47045),i=n(81155);function c(e){return Object.entries(null!=e?e:{}).map(e=>{let[t,n]=e;return{key:t,value:n}})}function o(e){let t={};for(let n of e)n.key.trim()&&(t[n.key.trim()]=n.value);return Object.keys(t).length?t:void 0}function d(e){let{rows:t,onChange:n,keyPlaceholder:c="Key",valuePlaceholder:o="Value",addLabel:d="Add tag",max:u=50}=e,m=(e,s)=>n(t.map((t,n)=>n===e?{...t,...s}:t));return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[t.length>0&&(0,s.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,s.jsx)("span",{children:c}),(0,s.jsx)("span",{children:o})]}),t.map((e,r)=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,s.jsx)(i.p,{value:e.key,onChange:e=>m(r,{key:e.target.value}),placeholder:c,className:"h-8"}),(0,s.jsx)(i.p,{value:e.value,onChange:e=>m(r,{value:e.target.value}),placeholder:o,className:"h-8"}),(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>n(t.filter((e,t)=>t!==r)),"aria-label":"Remove",children:(0,s.jsx)(a.A,{})})]},r)),(0,s.jsx)("div",{children:(0,s.jsxs)(l.$,{type:"button",variant:"outline",size:"sm",onClick:()=>n([...t,{key:"",value:""}]),disabled:t.length>=u,children:[(0,s.jsx)(r.A,{})," ",d]})})]})}function u(e){let{tags:t}=e,n=Object.entries(null!=t?t:{});return n.length?(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(e=>{let[t,n]=e;return(0,s.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:t}),n&&(0,s.jsxs)("span",{children:["=",n]})]},t)})}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},50565:(e,t,n)=>{n.d(t,{d:()=>l});var s=n(26276);n(29320);var a=n(63240),r=n(88674);function l(e){let{className:t,...n}=e;return(0,s.jsx)(a.bL,{"data-slot":"switch",className:(0,r.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:(0,s.jsx)(a.zi,{"data-slot":"switch-thumb",className:(0,r.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,t,n)=>{n.d(t,{J:()=>o});var s=n(26276),a=n(29320),r=n(95774),l=n(5820),i=n(88674);let c=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,s.jsx)(r.b,{ref:t,className:(0,i.cn)(c(),n),...a})});o.displayName=r.b.displayName},53023:(e,t,n)=>{n.d(t,{v:()=>r});var s=n(26276),a=n(88674);function r(e){let{items:t,columns:n=3,className:r}=e;return(0,s.jsx)("dl",{className:(0,a.cn)("grid grid-cols-1 gap-x-8 gap-y-4",{2:"sm:grid-cols-2",3:"sm:grid-cols-2 lg:grid-cols-3",4:"sm:grid-cols-2 lg:grid-cols-4"}[n],r),children:t.map(e=>(0,s.jsxs)("div",{className:(0,a.cn)("min-w-0",e.wide&&"sm:col-span-full"),children:[(0,s.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:e.label}),(0,s.jsx)("dd",{className:"min-w-0 text-sm break-words",children:""===e.value||null===e.value||void 0===e.value?(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):e.value})]},e.label))})}},73062:(e,t,n)=>{n.d(t,{Fl:()=>h,YI:()=>i,Yq:()=>o,ZV:()=>l,a3:()=>m,fF:()=>u,fU:()=>d,qt:()=>r,td:()=>x,z3:()=>a});let s=["B","KB","MB","GB","TB","PB"];function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),a=0;for(;n>=1024&&a=100?0:t);return"".concat(e<0?"-":"").concat(r," ").concat(s[a])}function r(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function i(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return a(e);case"Bytes/Second":return"".concat(a(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function c(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function o(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=c(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=c(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=c(e);if(!n)return"-";let s=(n.getTime()-t)/1e3,a=Math.abs(s),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(a<45||s>0&&s<60)return"just now";let l=s;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function h(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},74875:(e,t,n)=>{n.d(t,{D:()=>l});var s=n(26276),a=n(50985),r=n(88674);function l(e){let{label:t,htmlFor:n,help:l,error:i,optional:c,children:o,className:d}=e;return(0,s.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",d),children:[(0,s.jsxs)(a.J,{htmlFor:n,className:"text-sm font-medium",children:[t,c&&(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,s.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},76035:(e,t,n)=>{n.d(t,{$:()=>w,E:()=>C});var s=n(26276),a=n(29320),r=n(78113),l=n(48947),i=n(64206),c=n(64761),o=n(40688),d=n(34993),u=n(47045),m=n(10646),x=n(64573),h=n(81155),g=n(50985),f=n(50565),p=n(62083),b=n(74875),j=n(28553),v=n(28971),k=n(22927),N=n(88674),y=n(27374);function w(e){let{open:t,onOpenChange:n}=e,p=(0,r.useRouter)(),[w,C]=(0,a.useState)(""),[S,A]=(0,a.useState)(!1),[_,E]=(0,a.useState)(!0),[z,B]=(0,a.useState)(!1),[F,D]=(0,a.useState)([]),[L,I]=(0,a.useState)(!1),[R,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(C(""),A(!1),E(!0),B(!1),D([]),M(!1))},[t]);let O=(0,y.rj)(w),T=(0,y.q)(w),J=async e=>{if(e.preventDefault(),M(!0),T){I(!0);try{await v.FH.post("/api/v1/s3/buckets",{name:w,versioning:S,public:!_,object_lock:z,tags:(0,j._y)(F)}),d.oR.success("Bucket ".concat(w," created")),(0,k.Yi)("/api/v1/s3"),n(!1),p.push((0,y.eN)(w))}catch(e){d.oR.error((0,v.gJ)(e))}finally{I(!1)}}};return(0,s.jsx)(x.lG,{open:t,onOpenChange:e=>!L&&n(e),children:(0,s.jsx)(x.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:(0,s.jsxs)("form",{onSubmit:J,className:"flex flex-col gap-5",children:[(0,s.jsxs)(x.c7,{children:[(0,s.jsx)(x.L3,{children:"Create bucket"}),(0,s.jsx)(x.rr,{children:"Buckets are containers for objects stored in HomeCloud S3."})]}),(0,s.jsxs)(b.D,{label:"Bucket name",htmlFor:"bucket-name",children:[(0,s.jsx)(h.p,{id:"bucket-name",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:w,onChange:e=>C(e.target.value),onBlur:()=>M(!0),placeholder:"my-bucket","aria-invalid":R&&!T}),(0,s.jsx)("ul",{className:"mt-1 flex flex-col gap-1 text-xs",children:O.map(e=>(0,s.jsxs)("li",{className:(0,N.cn)("flex items-center gap-1.5",e.ok?"text-emerald-600 dark:text-emerald-400":R||w?"text-destructive":"text-muted-foreground"),children:[e.ok?(0,s.jsx)(l.A,{className:"size-3.5"}):(0,s.jsx)(i.A,{className:"size-3.5"}),e.label]},e.label))})]}),(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-versioning",className:"font-medium",children:"Bucket versioning"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Keep multiple variants of an object to recover from overwrites and deletes."})]}),(0,s.jsx)(f.d,{id:"bucket-versioning",checked:S,onCheckedChange:A})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-block",className:"font-medium",children:"Block all public access"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"When off, anyone can read objects in this bucket without credentials."})]}),(0,s.jsx)(f.d,{id:"bucket-block",checked:_,onCheckedChange:E})]}),!_&&(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-amber-300 bg-amber-50 p-2 text-xs text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300",children:[(0,s.jsx)(c.A,{className:"mt-0.5 size-3.5 shrink-0"}),"Objects in this bucket will be publicly readable by anyone who can reach the S3 endpoint."]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,s.jsx)(m.S,{id:"bucket-lock",checked:z,onCheckedChange:e=>B(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-lock",className:"font-medium",children:"Enable Object Lock"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Store objects using a write-once-read-many model. Can only be set at creation."})]})]}),(0,s.jsx)(b.D,{label:"Tags",optional:!0,children:(0,s.jsx)(j.fP,{rows:F,onChange:D})}),(0,s.jsxs)(x.Es,{children:[(0,s.jsx)(u.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:L,children:"Cancel"}),(0,s.jsxs)(u.$,{type:"submit",disabled:L||R&&!T,children:[L&&(0,s.jsx)(o.A,{className:"animate-spin"}),"Create bucket"]})]})]})})})}function C(e){let{bucket:t,open:n,onOpenChange:r,onDeleted:l}=e,[i,o]=(0,a.useState)(!1),[u,x]=(0,a.useState)(null);return(0,a.useEffect)(()=>{n&&(o(!1),x(null))},[n]),(0,s.jsxs)(p.T,{open:n,onOpenChange:r,title:"Delete bucket ".concat(t,"?"),description:"Deleting a bucket cannot be undone. Bucket names are unique; another bucket with this name can be created afterwards.",confirmText:t,actionLabel:"Delete bucket",onConfirm:async()=>{x(null);try{await v.FH.del("/api/v1/s3/buckets/".concat((0,v.aJ)(t)),i?{force:"true"}:void 0)}catch(e){throw e instanceof v.hD&&"BucketNotEmpty"===e.code?x("The bucket is not empty. Select “Empty the bucket first” to delete all objects together with the bucket."):x((0,v.gJ)(e)),e}d.oR.success("Bucket ".concat(t," deleted")),(0,k.Yi)("/api/v1/s3"),null==l||l()},children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,s.jsx)(m.S,{id:"bucket-force",checked:i,onCheckedChange:e=>o(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-force",className:"font-medium",children:"Empty the bucket first (delete all objects)"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Every object and object version in the bucket is permanently deleted."})]})]}),u&&(0,s.jsxs)("div",{className:"border-destructive/30 bg-destructive/5 text-destructive flex items-start gap-2 rounded-md border p-3 text-sm",children:[(0,s.jsx)(c.A,{className:"mt-0.5 size-4 shrink-0"}),(0,s.jsx)("span",{children:u})]})]})}},76962:(e,t,n)=>{n.d(t,{Dk:()=>u,i8:()=>m,xh:()=>x});var s=n(26276),a=n(29320),r=n(72538),l=n(37995),i=n(34993),c=n(47045),o=n(47006),d=n(88674);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(s){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let n=document.execCommand("copy");return document.body.removeChild(t),n}}function m(e){let{value:t,label:n,className:m,size:x="icon",toastMessage:h}=e,[g,f]=(0,a.useState)(!1),p=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(f(!0),h&&i.oR.success(h),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},b=g?r.A:l.A;return"sm"===x?(0,s.jsxs)(c.$,{type:"button",variant:"outline",size:"sm",onClick:p,className:m,children:[(0,s.jsx)(b,{className:(0,d.cn)(g&&"text-emerald-600")}),null!=n?n:"Copy"]}):(0,s.jsxs)(o.m_,{children:[(0,s.jsx)(o.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:p,"aria-label":null!=n?n:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,s.jsx)(b,{className:(0,d.cn)("size-3.5",g&&"text-emerald-600")})})}),(0,s.jsx)(o.ZI,{children:g?"Copied":null!=n?n:"Copy"})]})}function x(e){let{value:t,mono:n=!0,className:a,display:r}=e;return t?(0,s.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",a),children:[(0,s.jsx)("span",{className:(0,d.cn)("truncate",n&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,s.jsx)(m,{value:t})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})}},89839:(e,t,n)=>{n.d(t,{w:()=>r});var s=n(26276),a=n(88674);function r(e){let{title:t,description:n,actions:r,children:l,className:i,bodyClassName:c,flush:o}=e;return(0,s.jsxs)("section",{className:(0,a.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||r)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),n&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:n})]}),r&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]}),(0,s.jsx)("div",{className:(0,a.cn)(!o&&"p-4",c),children:l})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js b/pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js deleted file mode 100644 index bc20ab79..00000000 --- a/pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1514],{18514:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},35626:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},54485:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},59e3:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},60356:(e,t,n)=>{n.d(t,{UC:()=>L,B8:()=>I,bL:()=>j,l9:()=>S});var r=n(12115),a=n(92556),i=n(3468),o=n(29525),l=n(94446),s=n(4129),u=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,i]=r.useState(),o=r.useRef({}),l=r.useRef(e),u=r.useRef("none"),[c,f]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=d(o.current);u.current="mounted"===c?e:"none"},[c]),(0,s.N)(()=>{let t=o.current,n=l.current;if(n!==e){let r=u.current,a=d(t);e?f("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?f("UNMOUNT"):n&&r!==a?f("ANIMATION_OUT"):f("UNMOUNT"),l.current=e}},[e,f]),(0,s.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=d(o.current).includes(e.animationName);if(e.target===a&&r&&(f("ANIMATION_END"),!l.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},i=e=>{e.target===a&&(u.current=d(o.current))};return a.addEventListener("animationstart",i),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",i),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{e&&(o.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),o=(0,l.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof n||a.isPresent?r.cloneElement(i,{ref:o}):null};function d(e){return(null==e?void 0:e.animationName)||"none"}u.displayName="Presence";var c=n(97602),f=n(66218),p=n(70222),h=n(68946),m=n(95155),y="Tabs",[v,b]=(0,i.A)(y,[o.RG]),k=(0,o.RG)(),[N,w]=v(y),g=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:u="automatic",...d}=e,y=(0,f.jH)(s),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,i=r.useRef(a),o=(0,p.c)(t);return r.useEffect(()=>{i.current!==a&&(o(a),i.current=a)},[a,i,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:a,s=(0,p.c)(n);return[l,r.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s(n)}else i(t)},[o,e,i,s])]}({prop:a,onChange:i,defaultProp:o});return(0,m.jsx)(N,{scope:n,baseId:(0,h.B)(),value:v,onValueChange:b,orientation:l,dir:y,activationMode:u,children:(0,m.jsx)(c.sG.div,{dir:y,"data-orientation":l,...d,ref:t})})});g.displayName=y;var x="TabsList",A=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,i=w(x,n),l=k(n);return(0,m.jsx)(o.bL,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:(0,m.jsx)(c.sG.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});A.displayName=x;var M="TabsTrigger",T=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...l}=e,s=w(M,n),u=k(n),d=C(s.baseId,r),f=O(s.baseId,r),p=r===s.value;return(0,m.jsx)(o.q7,{asChild:!0,...u,focusable:!i,active:p,children:(0,m.jsx)(c.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...l,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==s.activationMode;p||i||!e||s.onValueChange(r)})})})});T.displayName=M;var E="TabsContent",R=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:i,children:o,...l}=e,s=w(E,n),d=C(s.baseId,a),f=O(s.baseId,a),p=a===s.value,h=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,m.jsx)(u,{present:i||p,children:n=>{let{present:r}=n;return(0,m.jsx)(c.sG.div,{"data-state":p?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&o})}})});function C(e,t){return"".concat(e,"-trigger-").concat(t)}function O(e,t){return"".concat(e,"-content-").concat(t)}R.displayName=E;var j=g,I=A,S=T,L=R},71360:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},75159:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},99587:(e,t,n)=>{n.d(t,{bL:()=>g,zi:()=>x});var r=n(12115),a=n(92556),i=n(94446),o=n(3468),l=n(70222),s=n(78108),u=n(4129),d=n(97602),c=n(95155),f="Switch",[p,h]=(0,o.A)(f),[m,y]=p(f),v=r.forwardRef((e,t)=>{let{__scopeSwitch:n,name:o,checked:s,defaultChecked:u,required:f,disabled:p,value:h="on",onCheckedChange:y,form:v,...b}=e,[k,g]=r.useState(null),x=(0,i.s)(t,e=>g(e)),A=r.useRef(!1),M=!k||v||!!k.closest("form"),[T=!1,E]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,i=r.useRef(a),o=(0,l.c)(t);return r.useEffect(()=>{i.current!==a&&(o(a),i.current=a)},[a,i,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,s=o?e:a,u=(0,l.c)(n);return[s,r.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else i(t)},[o,e,i,u])]}({prop:s,defaultProp:u,onChange:y});return(0,c.jsxs)(m,{scope:n,checked:T,disabled:p,children:[(0,c.jsx)(d.sG.button,{type:"button",role:"switch","aria-checked":T,"aria-required":f,"data-state":w(T),"data-disabled":p?"":void 0,disabled:p,value:h,...b,ref:x,onClick:(0,a.m)(e.onClick,e=>{E(e=>!e),M&&(A.current=e.isPropagationStopped(),A.current||e.stopPropagation())})}),M&&(0,c.jsx)(N,{control:k,bubbles:!A.current,name:o,value:h,checked:T,required:f,disabled:p,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=f;var b="SwitchThumb",k=r.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=y(b,n);return(0,c.jsx)(d.sG.span,{"data-state":w(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});k.displayName=b;var N=e=>{let{control:t,checked:n,bubbles:a=!0,...i}=e,o=r.useRef(null),l=(0,s.Z)(n),d=function(e){let[t,n]=r.useState(void 0);return(0,u.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(t);return r.useEffect(()=>{let e=o.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(l!==n&&t){let r=new Event("click",{bubbles:a});t.call(e,n),e.dispatchEvent(r)}},[l,n,a]),(0,c.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function w(e){return e?"checked":"unchecked"}var g=v,x=k}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1536-367972fc74b101c4.js b/pages/demo/_next/static/chunks/1536-367972fc74b101c4.js new file mode 100644 index 00000000..6e8f975d --- /dev/null +++ b/pages/demo/_next/static/chunks/1536-367972fc74b101c4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1536],{17286:(e,t,n)=>{n.d(t,{Rh:()=>f,Wh:()=>b});var a=n(26276),r=n(40688),s=n(48947),l=n(31935),o=n(64761),i=n(64206),c=n(46319),d=n(42812),u=n(88674);let g={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},m={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),p={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function f(e){let t=p[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function x(e){let{tone:t,spinning:n}=e,g="size-3.5 shrink-0";if(n)return(0,a.jsx)(r.A,{className:(0,u.cn)(g,"animate-spin")});switch(t){case"success":return(0,a.jsx)(s.A,{className:g});case"danger":return(0,a.jsx)(l.A,{className:g});case"warning":return(0,a.jsx)(o.A,{className:g});case"info":return(0,a.jsx)(i.A,{className:(0,u.cn)(g,"fill-current")});default:return"neutral"===t?(0,a.jsx)(c.A,{className:g}):(0,a.jsx)(d.A,{className:g})}}function b(e){var t;let{status:n,label:r,tone:s,className:l}=e,o=null!=s?s:null!=(t=m[n.toLowerCase()])?t:"neutral",i=null!=r?r:f(n);return(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",g[o],l),children:[(0,a.jsx)(x,{tone:o,spinning:h.has(n.toLowerCase())}),(0,a.jsx)("span",{children:i})]})}},35833:(e,t,n)=>{n.d(t,{TR:()=>h,bq:()=>g,eb:()=>p,gC:()=>m,l6:()=>c,s3:()=>d,yv:()=>u});var a=n(26276);n(29320);var r=n(13412),s=n(77440),l=n(72538),o=n(56761),i=n(88674);function c(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,a.jsx)(r.WT,{"data-slot":"select-value",...t})}function g(e){let{className:t,size:n="default",children:l,...o}=e;return(0,a.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":n,className:(0,i.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...o,children:[l,(0,a.jsx)(r.In,{asChild:!0,children:(0,a.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:n,position:s="popper",...l}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsxs)(r.UC,{"data-slot":"select-content",className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...l,children:[(0,a.jsx)(f,{}),(0,a.jsx)(r.LM,{className:(0,i.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(x,{})]})})}function h(e){let{className:t,...n}=e;return(0,a.jsx)(r.JU,{"data-slot":"select-label",className:(0,i.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...n})}function p(e){let{className:t,children:n,...s}=e;return(0,a.jsxs)(r.q7,{"data-slot":"select-item",className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(r.VF,{children:(0,a.jsx)(l.A,{className:"size-4"})})}),(0,a.jsx)(r.p4,{children:n})]})}function f(e){let{className:t,...n}=e;return(0,a.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(o.A,{className:"size-4"})})}function x(e){let{className:t,...n}=e;return(0,a.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(s.A,{className:"size-4"})})}},36337:(e,t,n)=>{n.d(t,{f:()=>o});var a=n(26276),r=n(47006),s=n(73062),l=n(22927);function o(e){let{value:t,className:n}=e,o=(0,l.cB)(3e4);return t?(0,a.jsxs)(r.m_,{children:[(0,a.jsx)(r.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=n?n:"whitespace-nowrap",children:(0,s.fF)(t,o)})}),(0,a.jsx)(r.ZI,{children:(0,s.Yq)(t)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},50985:(e,t,n)=>{n.d(t,{J:()=>c});var a=n(26276),r=n(29320),s=n(95774),l=n(5820),o=n(88674);let i=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.b,{ref:t,className:(0,o.cn)(i(),n),...r})});c.displayName=s.b.displayName},51536:(e,t,n)=>{n.d(t,{L:()=>F,LogGroupList:()=>z,X:()=>T});var a=n(26276),r=n(29320),s=n(91052),l=n.n(s),o=n(78113),i=n(40688),c=n(86931),d=n(10002),u=n(85469),g=n(34993),m=n(47045),h=n(64573),p=n(81155),f=n(35833),x=n(47353),b=n(62083),v=n(79181),j=n(12373),w=n(74875),y=n(21195),N=n(17286),C=n(36337),k=n(28971),L=n(73062),S=n(22927),_=n(93064);function T(e){let{source:t}=e;return"container"===t?(0,a.jsx)(N.Wh,{status:"container",tone:"info",label:"Container"}):(0,a.jsx)(N.Wh,{status:"stored",tone:"neutral",label:"Stored"})}function A(e){let{id:t,value:n,onChange:r}=e;return(0,a.jsxs)(f.l6,{value:String(n),onValueChange:e=>r(Number(e)),children:[(0,a.jsx)(f.bq,{id:t,className:"w-full",children:(0,a.jsx)(f.yv,{})}),(0,a.jsxs)(f.gC,{children:[(0,a.jsx)(f.eb,{value:"0",children:"Never expire"}),!_.eX.includes(n)&&0!==n&&(0,a.jsx)(f.eb,{value:String(n),children:(0,_.VQ)(n)}),_.eX.map(e=>(0,a.jsx)(f.eb,{value:String(e),children:(0,_.VQ)(e)},e))]})]})}function F(e){let{open:t,onOpenChange:n,group:s}=e,[l,o]=(0,r.useState)(s.retention_days),[c,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&o(s.retention_days)},[t,s.retention_days]);let u=async e=>{e.preventDefault(),d(!0);try{await k.FH.put("/api/v1/logs/groups/".concat((0,k.aJ)(s.name),"/retention"),{retention_days:l}),g.oR.success("Retention of ".concat(s.name," set to ").concat((0,_.VQ)(l).toLowerCase())),(0,S.Yi)("/api/v1/logs"),n(!1)}catch(e){g.oR.error((0,k.gJ)(e))}finally{d(!1)}};return(0,a.jsx)(h.lG,{open:t,onOpenChange:e=>!c&&n(e),children:(0,a.jsx)(h.Cf,{className:"sm:max-w-md",children:(0,a.jsxs)("form",{onSubmit:u,className:"flex flex-col gap-5",children:[(0,a.jsxs)(h.c7,{children:[(0,a.jsx)(h.L3,{children:"Edit retention setting"}),(0,a.jsx)(h.rr,{className:"break-all",children:s.name})]}),(0,a.jsx)(w.D,{label:"Expire events after",htmlFor:"retention",help:"Streams with no events newer than the retention period are deleted.",children:(0,a.jsx)(A,{id:"retention",value:l,onChange:o})}),(0,a.jsxs)(h.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:c,children:[c&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Save"]})]})]})})})}function M(e){let{open:t,onOpenChange:n,existing:s}=e,l=(0,o.useRouter)(),[c,d]=(0,r.useState)(""),[u,f]=(0,r.useState)(0),[x,b]=(0,r.useState)(!1),[v,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&(d(""),f(0),b(!1))},[t]);let y=c.trim(),N=y?y.startsWith("/hc/")?"The /hc/ prefix is reserved for container log groups":y.length>512?"At most 512 characters":/^[\w\-./#]+$/.test(y)?(null==s?void 0:s.some(e=>e.name===y))?"A log group with this name already exists":null:"Use letters, numbers and _ - . / # only":"Name is required",C=async e=>{if(e.preventDefault(),b(!0),!N){j(!0);try{await k.FH.post("/api/v1/logs/groups",{name:y,retention_days:u}),g.oR.success("Log group ".concat(y," created")),(0,S.Yi)("/api/v1/logs"),n(!1),l.push((0,_.hy)(y))}catch(e){g.oR.error((0,k.gJ)(e))}finally{j(!1)}}};return(0,a.jsx)(h.lG,{open:t,onOpenChange:e=>!v&&n(e),children:(0,a.jsx)(h.Cf,{className:"sm:max-w-md",children:(0,a.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-5",children:[(0,a.jsxs)(h.c7,{children:[(0,a.jsx)(h.L3,{children:"Create log group"}),(0,a.jsx)(h.rr,{children:"Applications write events to streams inside a log group with PutLogEvents."})]}),(0,a.jsx)(w.D,{label:"Log group name",htmlFor:"lg-name",error:x||c?N:void 0,children:(0,a.jsx)(p.p,{id:"lg-name",autoFocus:!0,className:"font-mono",value:c,onChange:e=>d(e.target.value),placeholder:"/myapp/production",spellCheck:!1})}),(0,a.jsx)(w.D,{label:"Retention",htmlFor:"lg-retention",children:(0,a.jsx)(A,{id:"lg-retention",value:u,onChange:f})}),(0,a.jsxs)(h.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:v,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:v,children:[v&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Create"]})]})]})})})}function z(){let{data:e,error:t,isLoading:n,isValidating:s,mutate:o}=(0,S.gf)("/api/v1/logs/groups",{refreshInterval:3e4}),i=(0,_.RA)(),h=(0,S.pE)("create"),[p,f]=(0,r.useState)([]),[w,N]=(0,r.useState)(!1),[A,z]=(0,r.useState)(!1),[I,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"1"===h&&N(!0)},[h]);let R=null==e?void 0:e.find(e=>e.name===p[0]),B=(null==R?void 0:R.source)==="stored",D=(0,r.useMemo)(()=>[{id:"name",header:"Log group",value:e=>"".concat(e.name," ").concat((0,_.gQ)(e.name,i)),cell:e=>(0,a.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,a.jsx)(l(),{href:(0,_.hy)(e.name),className:"".concat((0,v.V)()," font-mono text-[13px] break-all"),onClick:e=>e.stopPropagation(),children:e.name}),"container"===e.source&&(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:(0,_.gQ)(e.name,i)})]})},{id:"source",header:"Source",value:e=>e.source,cell:e=>(0,a.jsx)(T,{source:e.source})},{id:"retention",header:"Retention",value:e=>"container"===e.source?-1:e.retention_days||1e9,cell:e=>"container"===e.source?(0,a.jsx)("span",{className:"text-muted-foreground",children:"Container lifetime"}):(0,_.VQ)(e.retention_days),hideBelow:"sm"},{id:"bytes",header:"Stored bytes",value:e=>e.stored_bytes,cell:e=>"container"===e.source?(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,a.jsx)("span",{className:"tabular-nums",children:(0,L.z3)(e.stored_bytes)}),hideBelow:"md"},{id:"created",header:"Created",value:e=>e.created_at,cell:e=>(0,a.jsx)(C.f,{value:e.created_at}),hideBelow:"md"}],[i]),O=async()=>{R&&(await k.FH.del("/api/v1/logs/groups/".concat((0,k.aJ)(R.name))),g.oR.success("Log group ".concat(R.name," deleted")),f([]),(0,S.Yi)("/api/v1/logs"))};return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(y.z,{breadcrumbs:[{label:"CloudWatch",href:"/cloudwatch/"},{label:"Log groups"}],title:"Log groups",description:(0,a.jsxs)(a.Fragment,{children:["Stored log groups keep events your applications send with PutLogEvents. Container log groups (",(0,a.jsx)("span",{className:"font-mono",children:"/hc/..."}),") are read-only views of the stdout and stderr of running HomeCloud containers."]})}),(0,a.jsx)(v.b,{title:"Log groups",data:e,columns:D,rowId:e=>e.name,loading:n,error:t,onRefresh:()=>o(),refreshing:s,selection:"single",selected:p,onSelectedChange:f,searchPlaceholder:"Filter log groups",defaultSort:{id:"name"},actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.$,{disabled:!R,items:[{label:"Edit retention setting",disabled:!B,hint:B?void 0:"Container log groups live as long as the container",onSelect:()=>z(!0)},{separator:!0},{label:"Delete log group",destructive:!0,icon:(0,a.jsx)(c.A,{}),disabled:!B,hint:B?void 0:"Container log groups are read-only",onSelect:()=>E(!0)}]}),(0,a.jsxs)(m.$,{size:"sm",onClick:()=>N(!0),children:[(0,a.jsx)(d.A,{})," Create log group"]})]}),empty:(0,a.jsx)(j.p,{icon:u.A,title:"No log groups",description:"Log groups appear here when containers run or when you create one.",action:(0,a.jsxs)(m.$,{size:"sm",onClick:()=>N(!0),children:[(0,a.jsx)(d.A,{})," Create log group"]})})}),(0,a.jsx)(M,{open:w,onOpenChange:N,existing:e}),R&&B&&(0,a.jsx)(F,{open:A,onOpenChange:z,group:R}),R&&B&&(0,a.jsx)(b.T,{open:I,onOpenChange:E,title:"Delete log group?",description:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-mono break-all",children:R.name})," and all of its streams and events (",(0,L.z3)(R.stored_bytes),") will be deleted permanently."]}),confirmText:R.name,actionLabel:"Delete log group",onConfirm:O})]})}},73062:(e,t,n)=>{n.d(t,{Fl:()=>h,YI:()=>o,Yq:()=>c,ZV:()=>l,a3:()=>g,fF:()=>u,fU:()=>d,qt:()=>s,td:()=>m,z3:()=>r});let a=["B","KB","MB","GB","TB","PB"];function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),r=0;for(;n>=1024&&r=100?0:t);return"".concat(e<0?"-":"").concat(s," ").concat(a[r])}function s(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function o(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return r(e);case"Bytes/Second":return"".concat(r(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function i(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=i(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=i(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=i(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,r=Math.abs(a),s=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(r<45||a>0&&a<60)return"just now";let l=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function h(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},74875:(e,t,n)=>{n.d(t,{D:()=>l});var a=n(26276),r=n(50985),s=n(88674);function l(e){let{label:t,htmlFor:n,help:l,error:o,optional:i,children:c,className:d}=e;return(0,a.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",d),children:[(0,a.jsxs)(r.J,{htmlFor:n,className:"text-sm font-medium",children:[t,i&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,o?(0,a.jsx)("p",{className:"text-destructive text-xs",children:o}):l?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},93064:(e,t,n)=>{n.d(t,{$M:()=>v,BB:()=>m,EN:()=>u,RA:()=>x,T$:()=>h,VQ:()=>y,cC:()=>f,eX:()=>w,gQ:()=>N,gS:()=>o,gi:()=>d,hy:()=>j,nR:()=>i,t6:()=>p,tG:()=>b,we:()=>c});var a=n(26276),r=n(29320),s=n(17286),l=n(22927);let o=["Average","Sum","Minimum","Maximum","SampleCount"],i=[{value:60,label:"1 minute"},{value:300,label:"5 minutes"},{value:900,label:"15 minutes"},{value:3600,label:"1 hour"}],c=[{value:"GreaterThanThreshold",symbol:">",label:"Greater than"},{value:"GreaterThanOrEqualToThreshold",symbol:">=",label:"Greater than or equal to"},{value:"LessThanThreshold",symbol:"<",label:"Less than"},{value:"LessThanOrEqualToThreshold",symbol:"<=",label:"Less than or equal to"}];function d(e){return e%3600==0?"".concat(e/3600," hour").concat(3600===e?"":"s"):e%60==0?"".concat(e/60," minute").concat(60===e?"":"s"):"".concat(e," seconds")}let u=[{value:"missing",label:"Treat missing data as missing"},{value:"notBreaching",label:"Treat missing data as good (not breaching threshold)"},{value:"breaching",label:"Treat missing data as bad (breaching threshold)"},{value:"ignore",label:"Ignore (maintain the alarm state)"}],g={LessThanLowerOrGreaterThanUpperThreshold:"outside the anomaly detection band",LessThanLowerThreshold:"below the anomaly detection band",GreaterThanUpperThreshold:"above the anomaly detection band"};function m(e){var t,n,a;let r=d(e.period*e.evaluation_periods),s=e.datapoints_to_alarm||e.evaluation_periods,l=s===e.evaluation_periods?1===s?"1 datapoint":"".concat(s," datapoints"):"".concat(s," out of ").concat(e.evaluation_periods," datapoints"),o=e.statistic&&"Average"!==e.statistic?" (".concat(e.statistic,")"):"",i=g[e.comparison_operator];return i?"".concat(e.metric||"Metric").concat(o," ").concat(i," for ").concat(l," within ").concat(r):"".concat(e.metric).concat(o," ").concat((t=e.comparison_operator,null!=(a=null==(n=c.find(e=>e.value===t))?void 0:n.symbol)?a:t)," ").concat(e.threshold," for ").concat(l," within ").concat(r)}function h(e){return e?Object.entries(e).sort((e,t)=>{let[n]=e,[a]=t;return n.localeCompare(a)}).map(e=>{let[t,n]=e;return"".concat(t,"=").concat(n)}).join(", "):""}let p={ALARM:"In alarm",OK:"OK",INSUFFICIENT_DATA:"Insufficient data"};function f(e){var t;let{state:n}=e,r="ALARM"===n?"danger":"OK"===n?"success":"neutral";return(0,a.jsx)(s.Wh,{status:n.toLowerCase(),tone:r,label:null!=(t=p[n])?t:n})}function x(){let{data:e}=(0,l.gf)("/api/v1/ec2/instances",{refreshInterval:6e4});return(0,r.useMemo)(()=>{let t=new Map;for(let n of null!=e?e:[])n.name&&t.set(n.id,n.name);return t},[e])}function b(e,t){return e?Object.entries(e).map(e=>{let[n,a]=e,r="InstanceId"===n?t.get(a):void 0;return r?"".concat(r," (").concat(a,")"):a}).join(", "):""}let v=[{value:15,label:"15m"},{value:60,label:"1h"},{value:180,label:"3h"},{value:720,label:"12h"},{value:1440,label:"24h"}],j=e=>"/cloudwatch/logs/group/?name=".concat(encodeURIComponent(e)),w=[1,3,5,7,14,30,60,90,120,150,180,365];function y(e){return e?1===e?"1 day":"".concat(e," days"):"Never expire"}function N(e,t){var n;let a=/^\/hc\/([^/]+)\/(.+)$/.exec(e);if(!a)return"";let[,r,s]=a;if("ec2"===r){let e=t.get(s);return e?"Console output of EC2 instance ".concat(e):"Console output of EC2 instance ".concat(s)}return"s3"===r?"HomeCloud S3 server output":"Container output of ".concat(null!=(n=({rds:"RDS database",elasticache:"ElastiCache cluster",lambda:"Lambda function"})[r])?n:r," ").concat(s)}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1537-5418411d17191e6b.js b/pages/demo/_next/static/chunks/1537-5418411d17191e6b.js deleted file mode 100644 index 4201f746..00000000 --- a/pages/demo/_next/static/chunks/1537-5418411d17191e6b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1537],{7e3:(e,t,n)=>{n.d(t,{Fl:()=>m,YI:()=>i,Yq:()=>c,ZV:()=>l,a3:()=>h,fF:()=>u,fU:()=>d,qt:()=>s,td:()=>g,z3:()=>r});let a=["B","KB","MB","GB","TB","PB"];function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),r=0;for(;n>=1024&&r=100?0:t);return"".concat(e<0?"-":"").concat(s," ").concat(a[r])}function s(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function i(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return r(e);case"Bytes/Second":return"".concat(r(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=o(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=o(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,r=Math.abs(a),s=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(r<45||a>0&&a<60)return"just now";let l=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function m(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},11723:(e,t,n)=>{n.d(t,{f:()=>i});var a=n(95155),r=n(82180),s=n(7e3),l=n(73697);function i(e){let{value:t,className:n}=e,i=(0,l.cB)(3e4);return t?(0,a.jsxs)(r.m_,{children:[(0,a.jsx)(r.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=n?n:"whitespace-nowrap",children:(0,s.fF)(t,i)})}),(0,a.jsx)(r.ZI,{children:(0,s.Yq)(t)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},16981:(e,t,n)=>{n.d(t,{D:()=>l});var a=n(95155),r=n(90235),s=n(25016);function l(e){let{label:t,htmlFor:n,help:l,error:i,optional:o,children:c,className:d}=e;return(0,a.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",d),children:[(0,a.jsxs)(r.J,{htmlFor:n,className:"text-sm font-medium",children:[t,o&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,i?(0,a.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},32559:(e,t,n)=>{n.d(t,{Fc:()=>i,TN:()=>c,XL:()=>o});var a=n(95155);n(12115);var r=n(83101),s=n(25016);let l=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:n,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,s.cn)(l({variant:n}),t),...r})}function o(e){let{className:t,...n}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,s.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...n})}function c(e){let{className:t,...n}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,s.cn)("text-muted-foreground col-start-2 block space-y-1 text-sm [&_p]:leading-relaxed",t),...n})}},47507:(e,t,n)=>{n.d(t,{TR:()=>m,bq:()=>h,eb:()=>p,gC:()=>g,l6:()=>c,s3:()=>d,yv:()=>u});var a=n(95155);n(12115);var r=n(95435),s=n(24033),l=n(5917),i=n(12108),o=n(25016);function c(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,a.jsx)(r.WT,{"data-slot":"select-value",...t})}function h(e){let{className:t,size:n="default",children:l,...i}=e;return(0,a.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":n,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[l,(0,a.jsx)(r.In,{asChild:!0,children:(0,a.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function g(e){let{className:t,children:n,position:s="popper",...l}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsxs)(r.UC,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...l,children:[(0,a.jsx)(x,{}),(0,a.jsx)(r.LM,{className:(0,o.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(f,{})]})})}function m(e){let{className:t,...n}=e;return(0,a.jsx)(r.JU,{"data-slot":"select-label",className:(0,o.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...n})}function p(e){let{className:t,children:n,...s}=e;return(0,a.jsxs)(r.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(r.VF,{children:(0,a.jsx)(l.A,{className:"size-4"})})}),(0,a.jsx)(r.p4,{children:n})]})}function x(e){let{className:t,...n}=e;return(0,a.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(i.A,{className:"size-4"})})}function f(e){let{className:t,...n}=e;return(0,a.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(s.A,{className:"size-4"})})}},63963:(e,t,n)=>{n.d(t,{Ge:()=>_,HH:()=>p,NK:()=>A,TD:()=>v,WL:()=>k,X6:()=>F,XZ:()=>g,Zg:()=>d,aM:()=>S,dl:()=>b,e2:()=>m,eF:()=>f,er:()=>h,i6:()=>z,it:()=>N,iw:()=>M,j0:()=>u,jE:()=>L,jw:()=>j,lr:()=>R,mG:()=>x,qR:()=>c,uD:()=>D,vs:()=>E,x6:()=>P,xD:()=>T});var a=n(95155),r=n(52619),s=n.n(r),l=n(47507),i=n(73864),o=n(73697);let c="/api/v1/elb/load-balancers",d="/api/v1/elb/target-groups",u="/api/v1/elb",h=(e,t)=>"/elb/load-balancer/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),g=(e,t)=>"/elb/target-group/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),m=e=>"/ecs/service/?name=".concat(encodeURIComponent(e)),p=e=>"/vpc/?id=".concat(encodeURIComponent(e)),x=e=>"/vpc/subnets/?vpc_id=".concat(encodeURIComponent(e)),f=/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,30}[a-zA-Z0-9])?$/,v=e=>"provisioning"===e;function j(e){return e.some(v)?2e3:15e3}function b(e){let{state:t}=e;return"provisioning"===t?(0,a.jsx)(i.Wh,{status:"pending",label:"Provisioning",tone:"warning"}):(0,a.jsx)(i.Wh,{status:t})}let y={healthy:"success",unhealthy:"danger",unavailable:"warning",initial:"warning",unused:"neutral"};function N(e){var t;let{health:n}=e,r=null!=(t=y[n])?t:"neutral";return(0,a.jsx)(i.Wh,{status:n,tone:r})}let w=e=>/^[0-9a-f]{32}$/.test(e),C=e=>e.startsWith("i-");function k(e){return C(e)?"Instance":w(e)?"ECS task":"Target"}function _(e){let{id:t,className:n}=e,r=C(t)?"/ec2/instance/?id=".concat(encodeURIComponent(t)):w(t)?"/ecs/task/?id=".concat(encodeURIComponent(t)):null,l=w(t)?t.slice(0,12):t,i="font-mono text-[13px] whitespace-nowrap ".concat(null!=n?n:"");return r?(0,a.jsx)(s(),{href:r,title:t,onClick:e=>e.stopPropagation(),className:"text-primary hover:underline ".concat(i),children:l}):(0,a.jsx)("span",{className:i,children:t})}function S(e){let{name:t}=e;return(0,a.jsx)(s(),{href:g(t),onClick:e=>e.stopPropagation(),className:"text-primary font-medium whitespace-nowrap hover:underline",children:t})}function F(e){let{name:t}=e;return(0,a.jsx)(s(),{href:h(t),onClick:e=>e.stopPropagation(),className:"text-primary font-medium whitespace-nowrap hover:underline",children:t})}function T(e,t){var n;return null==(n=e.public_ports)?void 0:n["".concat(t.port,"/tcp")]}function P(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"".concat(n?"https":"http","://").concat(e.public_host||"localhost",":").concat(t)}let I=(e,t)=>{var n;return(null!=(n=e.listeners)?n:[]).some(e=>"".concat(e.port,"/tcp")===t&&"HTTPS"===e.protocol)};function D(e){var t;let{lb:n,empty:r="-",compact:s}=e,l=Object.entries(null!=(t=n.public_ports)?t:{}).sort((e,t)=>parseInt(e[0])-parseInt(t[0]));if(!l.length)return(0,a.jsx)("span",{className:"text-muted-foreground",children:r});let i=n.public_host||"localhost";return(0,a.jsx)("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:l.map(e=>{let[t,r]=e;return(0,a.jsx)("a",{href:P(n,r,I(n,t)),target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),className:"text-primary font-mono text-[13px] whitespace-nowrap hover:underline",children:s?"".concat(t.split("/")[0]," → ").concat(r):"".concat(I(n,t)?"https://":"").concat(i,":").concat(r)},t)})})}function R(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,o.gf)(c,{refreshInterval:e?e=>j((null!=e?e:[]).map(e=>e.state)):0})}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return(0,o.gf)(d,{refreshInterval:e})}function M(){return(0,o.gf)("/api/v1/ec2/instances",{refreshInterval:3e4})}function z(e,t){return(null!=t?t:[]).filter(t=>(function(e){var t,n;let a=new Set;for(let r of null!=(t=e.listeners)?t:[])for(let e of(r.default_target_group&&a.add(r.default_target_group),null!=(n=r.rules)?n:[]))a.add(e.target_group);return[...a]})(t).includes(e)).map(e=>e.name)}function L(e){let t={total:e.length,healthy:0,unhealthy:0,other:0};for(let n of e)"healthy"===n.health?t.healthy++:"unhealthy"===n.health?t.unhealthy++:t.other++;return t}function E(e){let{id:t,value:n,onChange:r,vpcId:s,placeholder:i="Choose a target group",invalid:o}=e,{data:c,isLoading:d}=A(),u=(null!=c?c:[]).filter(e=>!s||e.vpc_id===s).sort((e,t)=>e.name.localeCompare(t.name));return(0,a.jsxs)(l.l6,{value:n,onValueChange:e=>e&&r(e),disabled:d&&!c,children:[(0,a.jsx)(l.bq,{id:t,className:"w-full","aria-invalid":o,children:(0,a.jsx)(l.yv,{placeholder:d&&!c?"Loading target groups...":u.length?i:"No target groups in this VPC"})}),(0,a.jsx)(l.gC,{children:u.map(e=>(0,a.jsxs)(l.eb,{value:e.name,children:[(0,a.jsx)("span",{className:"font-medium",children:e.name}),(0,a.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:[e.protocol,":",e.port," \xb7 ",e.targets.length," target",1===e.targets.length?"":"s"]})]},e.name))})]})}},65451:(e,t,n)=>{n.d(t,{Ff:()=>P,IS:()=>D,Qs:()=>R,hg:()=>I});var a=n(95155),r=n(12115),s=n(52619),l=n.n(s),i=n(20063),o=n(35299),c=n(6132),d=n(18720),u=n(32559),h=n(97003),g=n(84916),m=n(54679),p=n(33789),x=n(47507),f=n(86233),v=n(16981),j=n(73864),b=n(37621),y=n(7e3),N=n(73697),w=n(25016),C=n(63963);let k=e=>{var t,n,a,r;return{path:null!=(t=null==e?void 0:e.path)?t:"/",interval:String(null!=(n=null==e?void 0:e.interval_seconds)?n:15),healthy:String(null!=(a=null==e?void 0:e.healthy_threshold)?a:2),unhealthy:String(null!=(r=null==e?void 0:e.unhealthy_threshold)?r:2)}},_=(e,t,n)=>/^\d+$/.test(e)&&Number(e)>=t&&Number(e)<=n;function S(e){let t={};return(!e.path.startsWith("/")||/\s/.test(e.path))&&(t.path="Must start with / and contain no spaces"),_(e.interval,5,300)||(t.interval="5-300 seconds"),_(e.healthy,1,10)||(t.healthy="1-10"),_(e.unhealthy,1,10)||(t.unhealthy="1-10"),t}let F=e=>({path:e.path,interval_seconds:Number(e.interval),healthy_threshold:Number(e.healthy),unhealthy_threshold:Number(e.unhealthy)});function T(e){let{form:t,onChange:n,errors:r,idPrefix:s}=e,l=e=>n({...t,...e});return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(v.D,{label:"Health check path",htmlFor:"".concat(s,"-path"),error:r.path,help:"HTTP GET from inside the VPC; any 2xx or 3xx response is healthy.",children:(0,a.jsx)(p.p,{id:"".concat(s,"-path"),value:t.path,onChange:e=>l({path:e.target.value}),className:"font-mono",spellCheck:!1})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,a.jsx)(v.D,{label:"Interval (seconds)",htmlFor:"".concat(s,"-interval"),error:r.interval,children:(0,a.jsx)(p.p,{id:"".concat(s,"-interval"),inputMode:"numeric",value:t.interval,onChange:e=>l({interval:e.target.value})})}),(0,a.jsx)(v.D,{label:"Healthy threshold",htmlFor:"".concat(s,"-healthy"),error:r.healthy,children:(0,a.jsx)(p.p,{id:"".concat(s,"-healthy"),inputMode:"numeric",value:t.healthy,onChange:e=>l({healthy:e.target.value})})}),(0,a.jsx)(v.D,{label:"Unhealthy threshold",htmlFor:"".concat(s,"-unhealthy"),error:r.unhealthy,children:(0,a.jsx)(p.p,{id:"".concat(s,"-unhealthy"),inputMode:"numeric",value:t.unhealthy,onChange:e=>l({unhealthy:e.target.value})})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Thresholds are consecutive checks needed to change state. Each check times out after 4 seconds. Only unhealthy targets are removed from routing."})]})}function P(e){var t;let{open:n,onOpenChange:s}=e,l=(0,i.useRouter)(),c=(0,N.gf)(n?"/api/v1/vpc/vpcs":null,{revalidateOnFocus:!1}),[u,g]=(0,r.useState)(""),[f,j]=(0,r.useState)("80"),[y,w]=(0,r.useState)(""),[P,I]=(0,r.useState)(k()),[D,R]=(0,r.useState)(!1),[A,M]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n&&(g(""),j("80"),w(""),I(k()),R(!1))},[n]),(0,r.useEffect)(()=>{var e,t;n&&!y&&(null==(e=c.data)?void 0:e.length)&&w((null!=(t=c.data.find(e=>e.default))?t:c.data[0]).id)},[n,y,c.data]);let z={...S(P)};C.eF.test(u)||(z.name="1-32 letters, digits and hyphens; must not start or end with a hyphen"),_(f,1,65535)||(z.port="1-65535"),y||(z.vpc="Choose a VPC");let L=e=>D?z[e]:void 0,E=async e=>{if(e.preventDefault(),R(!0),Object.keys(z).length)return;let t={name:u,port:Number(f),vpc_id:y,health_check:F(P)};M(!0);try{await b.FH.post(C.Zg,t),d.oR.success("Created target group ".concat(u)),await (0,N.Yi)(C.j0),s(!1),l.push((0,C.XZ)(u))}catch(e){d.oR.error((0,b.gJ)(e))}finally{M(!1)}};return(0,a.jsx)(m.lG,{open:n,onOpenChange:e=>!A&&s(e),children:(0,a.jsx)(m.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:(0,a.jsxs)("form",{onSubmit:E,className:"flex flex-col gap-4",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Create target group"}),(0,a.jsx)(m.rr,{children:"A set of EC2 instances or ECS tasks that load balancers forward HTTP requests to."})]}),(0,a.jsx)(v.D,{label:"Target group name",htmlFor:"tg-name",error:L("name"),children:(0,a.jsx)(p.p,{id:"tg-name",value:u,onChange:e=>g(e.target.value),placeholder:"e.g. web-tg",autoFocus:!0,autoComplete:"off",spellCheck:!1})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[10rem_minmax(0,1fr)]",children:[(0,a.jsx)(v.D,{label:"Protocol : Port",htmlFor:"tg-port",error:L("port"),help:"Default port targets receive traffic on.",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:"HTTP:"}),(0,a.jsx)(p.p,{id:"tg-port",inputMode:"numeric",value:f,onChange:e=>j(e.target.value)})]})}),(0,a.jsx)(v.D,{label:"VPC",htmlFor:"tg-vpc",error:L("vpc"),help:"Targets and load balancers must be in this VPC.",children:(0,a.jsxs)(x.l6,{value:y,onValueChange:e=>e&&w(e),disabled:!c.data,children:[(0,a.jsx)(x.bq,{id:"tg-vpc",className:"w-full",children:(0,a.jsx)(x.yv,{placeholder:c.data?"Choose a VPC":"Loading VPCs..."})}),(0,a.jsx)(x.gC,{children:(null!=(t=c.data)?t:[]).map(e=>(0,a.jsxs)(x.eb,{value:e.id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.name||e.id}),(0,a.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:[e.id," \xb7 ",e.cidr,e.default?" \xb7 default":""]})]},e.id))})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Health checks"}),(0,a.jsx)(T,{form:P,onChange:I,errors:{path:L("path"),interval:L("interval"),healthy:L("healthy"),unhealthy:L("unhealthy")},idPrefix:"tg-hc"})]}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(h.$,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:A,children:"Cancel"}),(0,a.jsxs)(h.$,{type:"submit",disabled:A,children:[A&&(0,a.jsx)(o.A,{className:"animate-spin"}),"Create target group"]})]})]})})})}function I(e){let{tg:t,onClose:n}=e,[s,l]=(0,r.useState)(k()),[i,c]=(0,r.useState)(!1),[u,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&(l(k(t.health_check)),c(!1))},[t]);let p=S(s),x=e=>i?p[e]:void 0,f=async e=>{if(e.preventDefault(),c(!0),t&&!Object.keys(p).length){g(!0);try{await b.FH.patch("".concat(C.Zg,"/").concat((0,b.aJ)(t.name)),F(s)),d.oR.success("Updated health checks for ".concat(t.name)),await (0,N.Yi)(C.j0),n()}catch(e){d.oR.error((0,b.gJ)(e))}finally{g(!1)}}};return(0,a.jsx)(m.lG,{open:!!t,onOpenChange:e=>!e&&!u&&n(),children:(0,a.jsx)(m.Cf,{className:"sm:max-w-xl",children:(0,a.jsxs)("form",{onSubmit:f,className:"flex flex-col gap-4",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Edit health check settings"}),(0,a.jsxs)(m.rr,{children:["Applies to every load balancer that forwards to ",null==t?void 0:t.name,". Takes effect at the next check."]})]}),(0,a.jsx)(T,{form:s,onChange:l,errors:{path:x("path"),interval:x("interval"),healthy:x("healthy"),unhealthy:x("unhealthy")},idPrefix:"ehc"}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(h.$,{type:"button",variant:"outline",onClick:n,disabled:u,children:"Cancel"}),(0,a.jsxs)(h.$,{type:"submit",disabled:u,children:[u&&(0,a.jsx)(o.A,{className:"animate-spin"}),"Save changes"]})]})]})})})}function D(e){var t;let{tg:n,onClose:s}=e,i=(0,C.iw)(),[x,f]=(0,r.useState)([]),[k,S]=(0,r.useState)(""),[F,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n&&(f([]),S(String(n.port)))},[n]);let P=(0,r.useMemo)(()=>{var e;return(null!=(e=i.data)?e:[]).filter(e=>"running"===e.state&&(!n||e.vpc_id===n.vpc_id)).sort((e,t)=>(e.name||e.id).localeCompare(t.name||t.id))},[i.data,n]),I=(null!=(t=i.data)?t:[]).filter(e=>"running"===e.state&&n&&e.vpc_id!==n.vpc_id).length,D=_(k,1,65535),R=async e=>{if(e.preventDefault(),n&&x.length&&D){T(!0);try{await b.FH.post("".concat(C.Zg,"/").concat((0,b.aJ)(n.name),"/targets"),{targets:x.map(e=>({id:e,port:Number(k)}))}),d.oR.success("Registered ".concat((0,y.td)(x.length,"target")," in ").concat(n.name)),await (0,N.Yi)(C.j0),s()}catch(e){d.oR.error((0,b.gJ)(e))}finally{T(!1)}}};return(0,a.jsx)(m.lG,{open:!!n,onOpenChange:e=>!e&&!F&&s(),children:(0,a.jsx)(m.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-4",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Register targets"}),(0,a.jsxs)(m.rr,{children:["Choose running instances in ",null==n?void 0:n.vpc_id," to receive traffic from ",null==n?void 0:n.name,"."]})]}),i.error?(0,a.jsxs)(u.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{}),(0,a.jsx)(u.XL,{children:"Could not load instances"}),(0,a.jsx)(u.TN,{children:(0,b.gJ)(i.error)})]}):i.data?0===P.length?(0,a.jsxs)("p",{className:"text-muted-foreground rounded-md border border-dashed p-6 text-center text-sm",children:["No running instances in this VPC."," ",(0,a.jsx)(l(),{href:"/ec2/launch/",className:"text-primary hover:underline",children:"Launch an instance"}),"."]}):(0,a.jsxs)("div",{className:"max-h-72 divide-y overflow-y-auto rounded-md border",children:[(0,a.jsxs)("label",{className:"bg-muted/40 flex items-center gap-3 px-3 py-2 text-xs font-semibold",children:[(0,a.jsx)(g.S,{checked:x.length===P.length||!!x.length&&"indeterminate",onCheckedChange:e=>f(e?P.map(e=>e.id):[]),"aria-label":"Select all instances"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"Instance"})]}),P.map(e=>{let t,r=x.includes(e.id);return(0,a.jsxs)("label",{className:(0,w.cn)("flex cursor-pointer items-center gap-3 px-3 py-2",r&&"bg-primary/5 dark:bg-primary/10"),children:[(0,a.jsx)(g.S,{checked:r,onCheckedChange:t=>f(t?[...x,e.id]:x.filter(t=>t!==e.id))}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name||e.id}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.id}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.private_ip}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.instance_type})]}),(t=e.id,(null==n?void 0:n.targets.some(e=>e.id===t&&String(e.port)===k))&&(0,a.jsx)(j.Wh,{status:"registered",tone:"info",label:"Registered"}))]},e.id)})]}):(0,a.jsx)("div",{className:"bg-muted/50 h-32 animate-pulse rounded-md border"}),I>0&&(0,a.jsxs)("p",{className:"text-muted-foreground text-xs",children:[(0,y.td)(I,"running instance")," in other VPCs are hidden."]}),(0,a.jsx)(v.D,{label:"Port",htmlFor:"rt-port",error:D?void 0:"1-65535",help:"Port the instances serve on. Defaults to the target group port (".concat(null==n?void 0:n.port,")."),children:(0,a.jsx)(p.p,{id:"rt-port",inputMode:"numeric",value:k,onChange:e=>S(e.target.value),className:"w-32"})}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"ECS services with a load balancer register and deregister their tasks automatically; they don't need to be added here."}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(h.$,{type:"button",variant:"outline",onClick:s,disabled:F,children:"Cancel"}),(0,a.jsxs)(h.$,{type:"submit",disabled:F||!x.length||!D,children:[F&&(0,a.jsx)(o.A,{className:"animate-spin"}),"Register ",x.length?(0,y.td)(x.length,"target"):"targets"]})]})]})})})}function R(e){var t,n;let{tg:r,usedBy:s,onClose:l,onDeleted:i}=e;return(0,a.jsx)(f.T,{open:!!r,onOpenChange:e=>!e&&l(),title:"Delete target group ".concat(null!=(t=null==r?void 0:r.name)?t:"","?"),description:s.length?(0,a.jsxs)(u.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{}),(0,a.jsx)(u.XL,{children:"Target group in use"}),(0,a.jsx)(u.TN,{children:(0,a.jsxs)("span",{children:["It is used by"," ",s.map((e,t)=>(0,a.jsxs)("span",{children:[t>0&&", ",(0,a.jsx)(C.X6,{name:e})]},e)),". Delete the listeners or rules that forward to it first, or the deletion will be rejected."]})})]}):(0,a.jsxs)(a.Fragment,{children:["The target group and its ",(0,y.td)(null!=(n=null==r?void 0:r.targets.length)?n:0,"target registration")," are deleted. The instances themselves keep running."]}),confirmText:null==r?void 0:r.name,onConfirm:async()=>{r&&(await b.FH.del("".concat(C.Zg,"/").concat((0,b.aJ)(r.name))),d.oR.success("Deleted target group ".concat(r.name)),await (0,N.Yi)(C.j0),null==i||i())}})}},73864:(e,t,n)=>{n.d(t,{Rh:()=>x,Wh:()=>v});var a=n(95155),r=n(35299),s=n(61362),l=n(78874),i=n(52056),o=n(99051),c=n(32978),d=n(36835),u=n(25016);let h={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},g={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},m=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),p={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function x(e){let t=p[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function f(e){let{tone:t,spinning:n}=e,h="size-3.5 shrink-0";if(n)return(0,a.jsx)(r.A,{className:(0,u.cn)(h,"animate-spin")});switch(t){case"success":return(0,a.jsx)(s.A,{className:h});case"danger":return(0,a.jsx)(l.A,{className:h});case"warning":return(0,a.jsx)(i.A,{className:h});case"info":return(0,a.jsx)(o.A,{className:(0,u.cn)(h,"fill-current")});default:return"neutral"===t?(0,a.jsx)(c.A,{className:h}):(0,a.jsx)(d.A,{className:h})}}function v(e){var t;let{status:n,label:r,tone:s,className:l}=e,i=null!=s?s:null!=(t=g[n.toLowerCase()])?t:"neutral",o=null!=r?r:x(n);return(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",h[i],l),children:[(0,a.jsx)(f,{tone:i,spinning:m.has(n.toLowerCase())}),(0,a.jsx)("span",{children:o})]})}},90235:(e,t,n)=>{n.d(t,{J:()=>c});var a=n(95155),r=n(12115),s=n(43991),l=n(83101),i=n(25016);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.b,{ref:t,className:(0,i.cn)(o(),n),...r})});c.displayName=s.b.displayName}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js b/pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js deleted file mode 100644 index 2e1332e8..00000000 --- a/pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1593],{6132:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},32978:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},35017:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]])},35626:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36835:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},46046:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},52020:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},52056:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},60356:(e,t,a)=>{a.d(t,{UC:()=>z,B8:()=>I,bL:()=>O,l9:()=>q});var n=a(12115),r=a(92556),i=a(3468),d=a(29525),o=a(94446),l=a(4129),c=e=>{let{present:t,children:a}=e,r=function(e){var t,a;let[r,i]=n.useState(),d=n.useRef({}),o=n.useRef(e),c=n.useRef("none"),[u,y]=(t=e?"mounted":"unmounted",a={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=a[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=s(d.current);c.current="mounted"===u?e:"none"},[u]),(0,l.N)(()=>{let t=d.current,a=o.current;if(a!==e){let n=c.current,r=s(t);e?y("MOUNT"):"none"===r||(null==t?void 0:t.display)==="none"?y("UNMOUNT"):a&&n!==r?y("ANIMATION_OUT"):y("UNMOUNT"),o.current=e}},[e,y]),(0,l.N)(()=>{if(r){var e;let t,a=null!=(e=r.ownerDocument.defaultView)?e:window,n=e=>{let n=s(d.current).includes(e.animationName);if(e.target===r&&n&&(y("ANIMATION_END"),!o.current)){let e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=a.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},i=e=>{e.target===r&&(c.current=s(d.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{a.clearTimeout(t),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}y("ANIMATION_END")},[r,y]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:n.useCallback(e=>{e&&(d.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof a?a({present:r.isPresent}):n.Children.only(a),d=(0,o.s)(r.ref,function(e){var t,a;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(r=(n=null==(a=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:a.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof a||r.isPresent?n.cloneElement(i,{ref:d}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var u=a(97602),y=a(66218),h=a(70222),p=a(68946),f=a(95155),k="Tabs",[v,m]=(0,i.A)(k,[d.RG]),A=(0,d.RG)(),[M,b]=v(k),x=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:d,orientation:o="horizontal",dir:l,activationMode:c="automatic",...s}=e,k=(0,y.jH)(l),[v,m]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,h.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,o=d?e:r,l=(0,h.c)(a);return[o,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&l(a)}else i(t)},[d,e,i,l])]}({prop:r,onChange:i,defaultProp:d});return(0,f.jsx)(M,{scope:a,baseId:(0,p.B)(),value:v,onValueChange:m,orientation:o,dir:k,activationMode:c,children:(0,f.jsx)(u.sG.div,{dir:k,"data-orientation":o,...s,ref:t})})});x.displayName=k;var w="TabsList",g=n.forwardRef((e,t)=>{let{__scopeTabs:a,loop:n=!0,...r}=e,i=b(w,a),o=A(a);return(0,f.jsx)(d.bL,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:(0,f.jsx)(u.sG.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});g.displayName=w;var N="TabsTrigger",C=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,disabled:i=!1,...o}=e,l=b(N,a),c=A(a),s=T(l.baseId,n),y=E(l.baseId,n),h=n===l.value;return(0,f.jsx)(d.q7,{asChild:!0,...c,focusable:!i,active:h,children:(0,f.jsx)(u.sG.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":y,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:s,...o,ref:t,onMouseDown:(0,r.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():l.onValueChange(n)}),onKeyDown:(0,r.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&l.onValueChange(n)}),onFocus:(0,r.m)(e.onFocus,()=>{let e="manual"!==l.activationMode;h||i||!e||l.onValueChange(n)})})})});C.displayName=N;var R="TabsContent",j=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,forceMount:i,children:d,...o}=e,l=b(R,a),s=T(l.baseId,r),y=E(l.baseId,r),h=r===l.value,p=n.useRef(h);return n.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(c,{present:i||h,children:a=>{let{present:n}=a;return(0,f.jsx)(u.sG.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":s,hidden:!n,id:y,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:n&&d})}})});function T(e,t){return"".concat(e,"-trigger-").concat(t)}function E(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=R;var O=x,I=g,q=C,z=j},61362:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},71360:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},74054:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78874:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89559:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},91169:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},93499:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},99265:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},99587:(e,t,a)=>{a.d(t,{bL:()=>x,zi:()=>w});var n=a(12115),r=a(92556),i=a(94446),d=a(3468),o=a(70222),l=a(78108),c=a(4129),s=a(97602),u=a(95155),y="Switch",[h,p]=(0,d.A)(y),[f,k]=h(y),v=n.forwardRef((e,t)=>{let{__scopeSwitch:a,name:d,checked:l,defaultChecked:c,required:y,disabled:h,value:p="on",onCheckedChange:k,form:v,...m}=e,[A,x]=n.useState(null),w=(0,i.s)(t,e=>x(e)),g=n.useRef(!1),N=!A||v||!!A.closest("form"),[C=!1,R]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,o.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,l=d?e:r,c=(0,o.c)(a);return[l,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&c(a)}else i(t)},[d,e,i,c])]}({prop:l,defaultProp:c,onChange:k});return(0,u.jsxs)(f,{scope:a,checked:C,disabled:h,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":C,"aria-required":y,"data-state":b(C),"data-disabled":h?"":void 0,disabled:h,value:p,...m,ref:w,onClick:(0,r.m)(e.onClick,e=>{R(e=>!e),N&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),N&&(0,u.jsx)(M,{control:A,bubbles:!g.current,name:d,value:p,checked:C,required:y,disabled:h,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=y;var m="SwitchThumb",A=n.forwardRef((e,t)=>{let{__scopeSwitch:a,...n}=e,r=k(m,a);return(0,u.jsx)(s.sG.span,{"data-state":b(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});A.displayName=m;var M=e=>{let{control:t,checked:a,bubbles:r=!0,...i}=e,d=n.useRef(null),o=(0,l.Z)(a),s=function(e){let[t,a]=n.useState(void 0);return(0,c.N)(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,r;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,r=t.blockSize}else n=e.offsetWidth,r=e.offsetHeight;a({width:n,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}a(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=d.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==a&&t){let n=new Event("click",{bubbles:r});t.call(e,a),e.dispatchEvent(n)}},[o,a,r]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:d,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function b(e){return e?"checked":"unchecked"}var x=v,w=A}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js b/pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js deleted file mode 100644 index f10b7d89..00000000 --- a/pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1610],{2084:(e,s,l)=>{l.d(s,{$j:()=>D,$r:()=>w,D_:()=>j,ET:()=>O,EV:()=>K,II:()=>k,PV:()=>v,Tn:()=>b,_n:()=>S,cA:()=>A,cC:()=>_,mg:()=>F,qS:()=>y});var a=l(95155),t=l(52619),i=l.n(t),r=l(84916),n=l(33789),d=l(90235),o=l(47507),c=l(7235),u=l(16981),m=l(50524),h=l(73697),x=l(25016),p=l(98351);let g={s:1,min:60,h:3600,days:86400},f="alias/aws/sqs",v={visibility:"30",retention:"4",retentionUnit:"days",delay:"0",wait:"0",maxSizeKB:"256",dedup:!1,dedupScope:"queue",throughputLimit:"perQueue",dlqEnabled:!1,dlq:"",maxReceives:"3",sse:"sqs",kmsKey:f,kmsReuse:"300",allow:"",allowSources:[],policyEnabled:!1,policy:""};function y(e){if(!e)return null;try{let s=JSON.parse(e);return s&&"string"==typeof s.redrivePermission?s:null}catch(e){return null}}function b(e){return e.kms_master_key_id?"kms":e.sqs_managed_sse_enabled?"sqs":"none"}function j(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch(s){return e}}function k(e){var s,l,a,t,i,r,n,d;let o=y(e.redrive_allow_policy),[c,u]=function(e){for(let s of["days","h","min"])if(e%g[s]==0)return[String(e/g[s]),s];return[String(e),"s"]}(e.message_retention_seconds);return{visibility:String(e.visibility_timeout),retention:c,retentionUnit:u,delay:String(e.delay_seconds),wait:String(e.receive_wait_time_seconds),maxSizeKB:String(Math.round(e.max_message_size/1024)),dedup:e.content_based_deduplication,dedupScope:null!=(a=e.deduplication_scope)?a:"queue",throughputLimit:null!=(t=e.fifo_throughput_limit)?t:"perQueue",dlqEnabled:!!e.redrive_policy,dlq:null!=(i=null==(s=e.redrive_policy)?void 0:s.dead_letter_queue)?i:"",maxReceives:String(null!=(r=null==(l=e.redrive_policy)?void 0:l.max_receive_count)?r:3),sse:b(e),kmsKey:e.kms_master_key_id||f,kmsReuse:String(e.kms_data_key_reuse_period_seconds||300),allow:(null==o?void 0:o.redrivePermission)==="allowAll"?"":null!=(n=null==o?void 0:o.redrivePermission)?n:"",allowSources:null!=(d=null==o?void 0:o.sourceQueueArns)?d:[],policyEnabled:!!e.policy,policy:e.policy?j(e.policy):""}}let N=e=>/^\s*\d+\s*$/.test(e)?Number(e):NaN,_=e=>N(e.retention)*g[e.retentionUnit];function w(e){let s={},l=(e,l,a,t,i)=>{(!Number.isInteger(l)||lt)&&(s[e]=i)};if(l("visibility",N(e.visibility),0,43200,"Enter 0-43200 seconds (12 hours)"),l("retention",_(e),60,1209600,"Enter between 1 minute and 14 days"),l("delay",N(e.delay),0,900,"Enter 0-900 seconds (15 minutes)"),l("wait",N(e.wait),0,20,"Enter 0-20 seconds"),l("maxSizeKB",N(e.maxSizeKB),1,256,"Enter 1-256 KB"),e.dlqEnabled&&(e.dlq||(s.dlq="Choose a dead-letter queue"),l("maxReceives",N(e.maxReceives),1,1e3,"Enter 1-1000")),"kms"===e.sse&&(e.kmsKey.trim()||(s.kmsKey="Enter a KMS key ID, ARN or alias"),l("kmsReuse",N(e.kmsReuse),60,86400,"Enter 60-86400 seconds (1 minute to 24 hours)")),"byQueue"===e.allow&&(e.allowSources.length<1||e.allowSources.length>10)&&(s.allowSources="Choose 1-10 source queues"),e.policyEnabled){let l=(0,m.F)(e.policy);l?s.policy=l:e.policy.trim().startsWith("{")||(s.policy="The policy must be a JSON object")}return s}function S(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a={visibility_timeout:N(e.visibility),message_retention_seconds:_(e),delay_seconds:N(e.delay),receive_wait_time_seconds:N(e.wait),max_message_size:1024*N(e.maxSizeKB)};return s&&(a.content_based_deduplication=e.dedup,a.deduplication_scope=e.dedupScope,a.fifo_throughput_limit=e.throughputLimit),"kms"===e.sse?(a.kms_master_key_id=e.kmsKey.trim(),a.kms_data_key_reuse_period_seconds=N(e.kmsReuse),a.sqs_managed_sse_enabled=!1):(a.kms_master_key_id="",a.sqs_managed_sse_enabled="sqs"===e.sse),a.redrive_allow_policy=e.allow?JSON.stringify("byQueue"===e.allow?{redrivePermission:e.allow,sourceQueueArns:e.allowSources}:{redrivePermission:e.allow}):"",a.policy=e.policyEnabled?JSON.stringify(JSON.parse(e.policy)):"",e.dlqEnabled?a.redrive_policy={dead_letter_queue:e.dlq,max_receive_count:N(e.maxReceives)}:l&&(a.redrive_policy={dead_letter_queue:"",max_receive_count:0}),a}function q(e){let{id:s,value:l,onChange:t,suffix:i,invalid:r}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.p,{id:s,inputMode:"numeric",value:l,onChange:e=>t(e.target.value),className:"h-9 w-32","aria-invalid":r}),(0,a.jsx)("span",{className:"text-muted-foreground text-sm",children:i})]})}function C(e){let{label:s,value:l,onChange:t,options:i}=e;return(0,a.jsx)("div",{role:"radiogroup","aria-label":s,className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:i.map(e=>(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":l===e.value,onClick:()=>t(e.value),className:(0,x.cn)("flex items-start gap-3 rounded-md border p-3 text-left transition-colors",l===e.value?"border-primary bg-primary/5 ring-primary ring-1":"hover:bg-muted/40"),children:[(0,a.jsx)("span",{className:(0,x.cn)("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border",l===e.value?"border-primary":"border-input"),children:l===e.value&&(0,a.jsx)("span",{className:"bg-primary size-2 rounded-full"})}),(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.title}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:e.text})]})]},e.value||"_"))})}function F(e){let{config:s,onChange:l,errors:t,fifo:i}=e;return(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[(0,a.jsx)(u.D,{label:"Visibility timeout",htmlFor:"cfg-vis",error:t.visibility,help:"How long a received message stays hidden from other consumers. 0 seconds to 12 hours.",children:(0,a.jsx)(q,{id:"cfg-vis",value:s.visibility,onChange:e=>l({visibility:e}),suffix:"seconds",invalid:!!t.visibility})}),(0,a.jsx)(u.D,{label:"Message retention period",htmlFor:"cfg-ret",error:t.retention,help:"How long messages are kept. 1 minute to 14 days.",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.p,{id:"cfg-ret",inputMode:"numeric",value:s.retention,onChange:e=>l({retention:e.target.value}),className:"h-9 w-24","aria-invalid":!!t.retention}),(0,a.jsxs)(o.l6,{value:s.retentionUnit,onValueChange:e=>l({retentionUnit:e}),children:[(0,a.jsx)(o.bq,{className:"w-28","aria-label":"Retention unit",children:(0,a.jsx)(o.yv,{})}),(0,a.jsxs)(o.gC,{children:[(0,a.jsx)(o.eb,{value:"s",children:"Seconds"}),(0,a.jsx)(o.eb,{value:"min",children:"Minutes"}),(0,a.jsx)(o.eb,{value:"h",children:"Hours"}),(0,a.jsx)(o.eb,{value:"days",children:"Days"})]})]})]})}),(0,a.jsx)(u.D,{label:"Delivery delay",htmlFor:"cfg-delay",error:t.delay,help:i?"Applies to the whole queue; FIFO queues do not support per-message delays. 0-900 seconds.":"Delay before new messages become visible. 0-900 seconds.",children:(0,a.jsx)(q,{id:"cfg-delay",value:s.delay,onChange:e=>l({delay:e}),suffix:"seconds",invalid:!!t.delay})}),(0,a.jsx)(u.D,{label:"Receive message wait time",htmlFor:"cfg-wait",error:t.wait,help:"Default long-polling wait for receive calls. 0 = short polling, up to 20 seconds.",children:(0,a.jsx)(q,{id:"cfg-wait",value:s.wait,onChange:e=>l({wait:e}),suffix:"seconds",invalid:!!t.wait})}),(0,a.jsx)(u.D,{label:"Maximum message size",htmlFor:"cfg-size",error:t.maxSizeKB,help:"1-256 KB.",children:(0,a.jsx)(q,{id:"cfg-size",value:s.maxSizeKB,onChange:e=>l({maxSizeKB:e}),suffix:"KB",invalid:!!t.maxSizeKB})}),i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3 md:col-span-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(d.J,{htmlFor:"cfg-dedup",className:"font-medium",children:"Content-based deduplication"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Use a hash of the message body as the deduplication ID, so senders don't have to provide one. Duplicates within 5 minutes are dropped."})]}),(0,a.jsx)(c.d,{id:"cfg-dedup",checked:s.dedup,onCheckedChange:e=>l({dedup:e})})]}),(0,a.jsx)(u.D,{label:"Deduplication scope",htmlFor:"cfg-dedup-scope",help:"Whether deduplication IDs are unique across the queue or within each message group.",children:(0,a.jsxs)(o.l6,{value:s.dedupScope,onValueChange:e=>l({dedupScope:e}),children:[(0,a.jsx)(o.bq,{id:"cfg-dedup-scope",className:"w-full max-w-xs",children:(0,a.jsx)(o.yv,{})}),(0,a.jsxs)(o.gC,{children:[(0,a.jsx)(o.eb,{value:"queue",children:"Queue"}),(0,a.jsx)(o.eb,{value:"messageGroup",children:"Message group"})]})]})}),(0,a.jsx)(u.D,{label:"FIFO throughput limit",htmlFor:"cfg-throughput",help:"messageGroup"===s.dedupScope&&"perMessageGroupId"===s.throughputLimit?"High throughput mode: the quota applies to each message group.":"Whether the throughput quota applies to the whole queue or to each message group.",children:(0,a.jsxs)(o.l6,{value:s.throughputLimit,onValueChange:e=>l({throughputLimit:e}),children:[(0,a.jsx)(o.bq,{id:"cfg-throughput",className:"w-full max-w-xs",children:(0,a.jsx)(o.yv,{})}),(0,a.jsxs)(o.gC,{children:[(0,a.jsx)(o.eb,{value:"perQueue",children:"Per queue"}),(0,a.jsx)(o.eb,{value:"perMessageGroupId",children:"Per message group ID"})]})]})})]})]})}let E=[{value:"sqs",title:"SSE-SQS",text:"Encrypt with SQS-managed keys."},{value:"kms",title:"SSE-KMS",text:"Encrypt with a KMS key you choose."},{value:"none",title:"Disabled",text:"No server-side encryption."}];function D(e){var s,l;let{config:t,onChange:r,errors:d}=e,o=(0,h.gf)("kms"===t.sse?"/api/v1/kms/keys":null,{revalidateOnFocus:!1}),c=Array.from(new Set([f,...(null!=(s=(0,h.gf)("kms"===t.sse?"/api/v1/kms/aliases":null,{revalidateOnFocus:!1}).data)?s:[]).map(e=>e.name),...(null!=(l=o.data)?l:[]).filter(e=>"Enabled"===e.state).map(e=>e.id)]));return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(C,{label:"Server-side encryption",value:t.sse,onChange:e=>r({sse:e}),options:E}),"kms"===t.sse&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[(0,a.jsxs)(u.D,{label:"KMS key",htmlFor:"cfg-kms-key",error:d.kmsKey,help:(0,a.jsxs)(a.Fragment,{children:["Key ID, key ARN or alias."," ",(0,a.jsx)(i(),{href:"/kms/",className:"text-primary hover:underline",children:"Manage keys"})]}),children:[(0,a.jsx)(n.p,{id:"cfg-kms-key",list:"cfg-kms-keys",value:t.kmsKey,onChange:e=>r({kmsKey:e.target.value}),className:"h-9 font-mono text-[13px]",autoComplete:"off",spellCheck:!1,"aria-invalid":!!d.kmsKey}),(0,a.jsx)("datalist",{id:"cfg-kms-keys",children:c.map(e=>(0,a.jsx)("option",{value:e},e))})]}),(0,a.jsx)(u.D,{label:"Data key reuse period",htmlFor:"cfg-kms-reuse",error:d.kmsReuse,help:"60 seconds to 24 hours.",children:(0,a.jsx)(q,{id:"cfg-kms-reuse",value:t.kmsReuse,onChange:e=>r({kmsReuse:e}),suffix:"seconds",invalid:!!d.kmsReuse})})]})]})}function A(e){var s,l;let{config:t,onChange:r,errors:m,fifo:h,queues:x,self:g}=e,f=(null!=x?x:[]).filter(e=>e.fifo===h&&e.name!==g),v=f.find(e=>e.name===t.dlq),b=y(null==v?void 0:v.redrive_allow_policy),j=null==(s=(null!=x?x:[]).find(e=>e.name===g))?void 0:s.arn,k=b&&("denyAll"===b.redrivePermission||"byQueue"===b.redrivePermission&&!(j&&(null==(l=b.sourceQueueArns)?void 0:l.includes(j))));return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(d.J,{htmlFor:"cfg-dlq-on",className:"font-medium",children:"Send undeliverable messages to a dead-letter queue"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"A message received more than the maximum number of times without being deleted is moved to the dead-letter queue."})]}),(0,a.jsx)(c.d,{id:"cfg-dlq-on",checked:t.dlqEnabled,onCheckedChange:e=>r({dlqEnabled:e})})]}),t.dlqEnabled&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[(0,a.jsx)(u.D,{label:"Dead-letter queue",htmlFor:"cfg-dlq",error:m.dlq,help:f.length?"Only ".concat(h?"FIFO":"standard"," queues can be used."):(0,a.jsxs)(a.Fragment,{children:["No other ",h?"FIFO":"standard"," queue exists."," ",(0,a.jsx)(i(),{href:"/sqs/create/",className:"text-primary hover:underline",children:"Create one first"}),"."]}),children:(0,a.jsxs)(o.l6,{value:t.dlq,onValueChange:e=>r({dlq:e}),children:[(0,a.jsx)(o.bq,{id:"cfg-dlq",className:"w-full","aria-invalid":!!m.dlq,children:(0,a.jsx)(o.yv,{placeholder:x?"Choose a queue":"Loading queues..."})}),(0,a.jsx)(o.gC,{children:f.map(e=>(0,a.jsx)(o.eb,{value:e.name,children:e.name},e.name))})]})}),(0,a.jsx)(u.D,{label:"Maximum receives",htmlFor:"cfg-maxrecv",error:m.maxReceives,help:"1-1000 receives before a message is moved.",children:(0,a.jsx)(n.p,{id:"cfg-maxrecv",inputMode:"numeric",value:t.maxReceives,onChange:e=>r({maxReceives:e.target.value}),className:"h-9 w-32","aria-invalid":!!m.maxReceives})}),t.dlq&&(0,a.jsxs)("p",{className:"text-muted-foreground text-xs md:col-span-2",children:["Messages will move to"," ",(0,a.jsx)(i(),{href:(0,p.BY)(t.dlq),className:"text-primary hover:underline",children:t.dlq})," ","after ",t.maxReceives||"?"," receives.",k&&(0,a.jsxs)("span",{className:"mt-1 block text-amber-700 dark:text-amber-300",children:[t.dlq,"'s redrive allow policy (",b.redrivePermission,") may not permit this queue as a source."]})]})]})]})}let z=[{value:"",title:"Allow all",text:"Any queue of the same type (default)."},{value:"byQueue",title:"By queue",text:"Only the source queues you choose."},{value:"denyAll",title:"Deny all",text:"No queue can use this one as its DLQ."}];function K(e){let{config:s,onChange:l,errors:t,fifo:i,queues:n,self:d}=e,o=(null!=n?n:[]).filter(e=>e.fifo===i&&e.name!==d),c=new Set(o.map(e=>e.arn)),m=[...o.map(e=>({arn:e.arn,name:e.name})),...s.allowSources.filter(e=>!c.has(e)).map(e=>({arn:e,name:e}))];return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(C,{label:"Redrive allow policy",value:s.allow,onChange:e=>l({allow:e}),options:z}),"byQueue"===s.allow&&(0,a.jsx)(u.D,{label:"Source queues",error:t.allowSources,help:"Choose up to 10 ".concat(i?"FIFO":"standard"," queues (").concat(s.allowSources.length," selected)."),children:m.length?(0,a.jsx)("div",{className:"flex max-h-56 flex-col divide-y overflow-y-auto rounded-md border",children:m.map(e=>(0,a.jsxs)("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[(0,a.jsx)(r.S,{checked:s.allowSources.includes(e.arn),onCheckedChange:a=>{let t;return t=e.arn,l({allowSources:!0===a?[...s.allowSources.filter(e=>e!==t),t]:s.allowSources.filter(e=>e!==t)})},"aria-label":e.name}),(0,a.jsx)("span",{className:"min-w-0 truncate font-mono text-[13px]",title:e.arn,children:e.name})]},e.arn))}):(0,a.jsx)("p",{className:"text-muted-foreground rounded-md border p-3 text-sm",children:n?"No other ".concat(i?"FIFO":"standard"," queues exist yet."):"Loading queues..."})})]})}function O(e){let{config:s,onChange:l,errors:t,arn:i}=e;return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(d.J,{htmlFor:"cfg-policy-on",className:"font-medium",children:"Attach an access policy"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"A resource policy document, as in Amazon SQS. HomeCloud stores and returns it; access is decided by IAM identity policies."})]}),(0,a.jsx)(c.d,{id:"cfg-policy-on",checked:s.policyEnabled,onCheckedChange:e=>l({policyEnabled:e,policy:e&&!s.policy.trim()?JSON.stringify({Version:"2012-10-17",Id:"__default_policy_ID",Statement:[{Sid:"__owner_statement",Effect:"Allow",Principal:{AWS:i.split(":")[4]||"*"},Action:["SQS:*"],Resource:i||"*"}]},null,2):s.policy})})]}),s.policyEnabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.i,{value:s.policy,onChange:e=>l({policy:e}),rows:10}),t.policy&&(0,a.jsx)("p",{className:"text-destructive text-xs",children:t.policy})]})]})}},7235:(e,s,l)=>{l.d(s,{d:()=>r});var a=l(95155);l(12115);var t=l(99587),i=l(25016);function r(e){let{className:s,...l}=e;return(0,a.jsx)(t.bL,{"data-slot":"switch",className:(0,i.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...l,children:(0,a.jsx)(t.zi,{"data-slot":"switch-thumb",className:(0,i.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},16981:(e,s,l)=>{l.d(s,{D:()=>r});var a=l(95155),t=l(90235),i=l(25016);function r(e){let{label:s,htmlFor:l,help:r,error:n,optional:d,children:o,className:c}=e;return(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",c),children:[(0,a.jsxs)(t.J,{htmlFor:l,className:"text-sm font-medium",children:[s,d&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,n?(0,a.jsx)("p",{className:"text-destructive text-xs",children:n}):r?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:r}):null]})}},26667:(e,s,l)=>{l.d(s,{A:()=>a});let a=(0,l(71847).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},50524:(e,s,l)=>{l.d(s,{F:()=>c,i:()=>u});var a=l(95155),t=l(12115),i=l(6132),r=l(61362),n=l(26667),d=l(97003),o=l(25016);function c(e){if(!e.trim())return"Document is empty";try{return JSON.parse(e),null}catch(e){return e instanceof Error?e.message:String(e)}}function u(e){let{value:s,onChange:l,rows:u=16,readOnly:m,validate:h,className:x,id:p}=e,g=(0,t.useMemo)(()=>{let e=c(s);return e||(h?h(JSON.parse(s)):null)},[s,h]),f=Math.max(s.split("\n").length,u);return(0,a.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-2",x),children:[(0,a.jsxs)("div",{className:(0,o.cn)("bg-muted/30 flex overflow-hidden rounded-md border font-mono text-[13px] leading-5",g&&!m&&"border-destructive/60"),children:[(0,a.jsx)("div",{"aria-hidden":!0,className:"text-muted-foreground/60 bg-muted/50 border-r px-2 py-2 text-right select-none",children:Array.from({length:f},(e,s)=>(0,a.jsx)("div",{children:s+1},s))}),(0,a.jsx)("textarea",{id:p,value:s,readOnly:m,onChange:e=>null==l?void 0:l(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!m){e.preventDefault();let a=e.currentTarget,{selectionStart:t,selectionEnd:i}=a,r=s.slice(0,t)+" "+s.slice(i);null==l||l(r),requestAnimationFrame(()=>{a.selectionStart=a.selectionEnd=t+2})}},spellCheck:!1,rows:f,className:"min-w-0 flex-1 resize-none overflow-x-auto bg-transparent px-3 py-2 whitespace-pre outline-none"})]}),!m&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[g?(0,a.jsxs)("span",{className:"text-destructive flex items-center gap-1",children:[(0,a.jsx)(i.A,{className:"size-3.5"})," ",g]}):(0,a.jsxs)("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[(0,a.jsx)(r.A,{className:"size-3.5"})," Valid JSON"]}),(0,a.jsxs)(d.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{try{null==l||l(JSON.stringify(JSON.parse(s),null,2))}catch(e){}},disabled:!!c(s),children:[(0,a.jsx)(n.A,{})," Format"]})]})]})}},60495:(e,s,l)=>{l.d(s,{LY:()=>u,O6:()=>d,_y:()=>o,fP:()=>c});var a=l(95155),t=l(65229),i=l(6191),r=l(97003),n=l(33789);function d(e){return Object.entries(null!=e?e:{}).map(e=>{let[s,l]=e;return{key:s,value:l}})}function o(e){let s={};for(let l of e)l.key.trim()&&(s[l.key.trim()]=l.value);return Object.keys(s).length?s:void 0}function c(e){let{rows:s,onChange:l,keyPlaceholder:d="Key",valuePlaceholder:o="Value",addLabel:c="Add tag",max:u=50}=e,m=(e,a)=>l(s.map((s,l)=>l===e?{...s,...a}:s));return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[s.length>0&&(0,a.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,a.jsx)("span",{children:d}),(0,a.jsx)("span",{children:o})]}),s.map((e,i)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,a.jsx)(n.p,{value:e.key,onChange:e=>m(i,{key:e.target.value}),placeholder:d,className:"h-8"}),(0,a.jsx)(n.p,{value:e.value,onChange:e=>m(i,{value:e.target.value}),placeholder:o,className:"h-8"}),(0,a.jsx)(r.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>l(s.filter((e,s)=>s!==i)),"aria-label":"Remove",children:(0,a.jsx)(t.A,{})})]},i)),(0,a.jsx)("div",{children:(0,a.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",onClick:()=>l([...s,{key:"",value:""}]),disabled:s.length>=u,children:[(0,a.jsx)(i.A,{})," ",c]})})]})}function u(e){let{tags:s}=e,l=Object.entries(null!=s?s:{});return l.length?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:s}),l&&(0,a.jsxs)("span",{children:["=",l]})]},s)})}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},61362:(e,s,l)=>{l.d(s,{A:()=>a});let a=(0,l(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},62325:(e,s,l)=>{l.d(s,{w:()=>i});var a=l(95155),t=l(25016);function i(e){let{title:s,description:l,actions:i,children:r,className:n,bodyClassName:d,flush:o}=e;return(0,a.jsxs)("section",{className:(0,t.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",n),children:[(s||i)&&(0,a.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[s&&(0,a.jsx)("h2",{className:"text-base font-semibold",children:s}),l&&(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:l})]}),i&&(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:i})]}),(0,a.jsx)("div",{className:(0,t.cn)(!o&&"p-4",d),children:r})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js b/pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js deleted file mode 100644 index f4c28010..00000000 --- a/pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1641],{6132:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},16140:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]])},19408:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},20386:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]])},20508:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},20562:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},20639:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},21786:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},26617:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},32320:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},32978:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},39068:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},52056:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},57828:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},61362:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},70532:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},73366:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]])},75426:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78874:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89470:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]])},89559:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},93499:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js b/pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js new file mode 100644 index 00000000..5bd09803 --- /dev/null +++ b/pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1681,2886],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>g,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),s=r(12377),p=r(26276),u="Switch",[y,f]=(0,i.A)(u),[h,k]=y(u),m=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:y,value:f="on",onCheckedChange:k,form:m,...b}=e,[v,g]=l.useState(null),w=(0,a.s)(t,e=>g(e)),S=l.useRef(!1),M=!v||m||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,p.jsxs)(h,{scope:r,checked:E,disabled:y,children:[(0,p.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":A(E),"data-disabled":y?"":void 0,disabled:y,value:f,...b,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),M&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),M&&(0,p.jsx)(x,{control:v,bubbles:!S.current,name:i,value:f,checked:E,required:u,disabled:y,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=u;var b="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(b,r);return(0,p.jsx)(s.sG.span,{"data-state":A(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=b;var x=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),s=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,p.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var g=m,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},69200:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tp(e,"name",{value:t,configurable:!0});function y(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];x(n)&&"function"==typeof S&&(n=S(n._payload)),l.Children.forEach(n,e=>{if(b(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof S&&(t=S(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?m(i):void 0,p=s(r,d);if(!i){if(n||0===n)throw Error(o?w(e):g(e));return n}let u=k(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?p:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(y,"createSlot");var f=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=f,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}u(k,"mergeProps"),u(m,"getElementRef"),u(b,"isSlottable");var v=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}u(x,"isLazyComponent"),u(A,"isPromiseLike");var g=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=n[" use ".trim().toString()],M=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=y(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,M.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,M.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js b/pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js new file mode 100644 index 00000000..aee2751f --- /dev/null +++ b/pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1719,2886],{1211:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},14045:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29526:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,r)=>{r.d(t,{UC:()=>D,B8:()=>T,bL:()=>O,l9:()=>P});var n=r(29320),a=r(62315),i=r(65335),l=r(23566),o=r(36103),d=r(96886),c=e=>{let{present:t,children:r}=e,a=function(e){var t,r;let[a,i]=n.useState(),l=n.useRef({}),o=n.useRef(e),c=n.useRef("none"),[s,p]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=r[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=u(l.current);c.current="mounted"===s?e:"none"},[s]),(0,d.N)(()=>{let t=l.current,r=o.current;if(r!==e){let n=c.current,a=u(t);e?p("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):r&&n!==a?p("ANIMATION_OUT"):p("UNMOUNT"),o.current=e}},[e,p]),(0,d.N)(()=>{if(a){var e;let t,r=null!=(e=a.ownerDocument.defaultView)?e:window,n=e=>{let n=u(l.current).includes(e.animationName);if(e.target===a&&n&&(p("ANIMATION_END"),!o.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=r.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},i=e=>{e.target===a&&(c.current=u(l.current))};return a.addEventListener("animationstart",i),a.addEventListener("animationcancel",n),a.addEventListener("animationend",n),()=>{r.clearTimeout(t),a.removeEventListener("animationstart",i),a.removeEventListener("animationcancel",n),a.removeEventListener("animationend",n)}}p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:n.useCallback(e=>{e&&(l.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),l=(0,o.s)(a.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(a=(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof r||a.isPresent?n.cloneElement(i,{ref:l}):null};function u(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var s=r(12377),p=r(97645),f=r(82275),y=r(29203),h=r(26276),m="Tabs",[v,k]=(0,i.A)(m,[l.RG]),b=(0,l.RG)(),[g,A]=v(m),x=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:a,onValueChange:i,defaultValue:l,orientation:o="horizontal",dir:d,activationMode:c="automatic",...u}=e,m=(0,p.jH)(d),[v,k]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[a]=r,i=n.useRef(a),l=(0,f.c)(t);return n.useEffect(()=>{i.current!==a&&(l(a),i.current=a)},[a,i,l]),r}({defaultProp:t,onChange:r}),l=void 0!==e,o=l?e:a,d=(0,f.c)(r);return[o,n.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else i(t)},[l,e,i,d])]}({prop:a,onChange:i,defaultProp:l});return(0,h.jsx)(g,{scope:r,baseId:(0,y.B)(),value:v,onValueChange:k,orientation:o,dir:m,activationMode:c,children:(0,h.jsx)(s.sG.div,{dir:m,"data-orientation":o,...u,ref:t})})});x.displayName=m;var w="TabsList",M=n.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...a}=e,i=A(w,r),o=b(r);return(0,h.jsx)(l.bL,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:(0,h.jsx)(s.sG.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});M.displayName=w;var C="TabsTrigger",N=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:i=!1,...o}=e,d=A(C,r),c=b(r),u=j(d.baseId,n),p=S(d.baseId,n),f=n===d.value;return(0,h.jsx)(l.q7,{asChild:!0,...c,focusable:!i,active:f,children:(0,h.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(n)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(n)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;f||i||!e||d.onValueChange(n)})})})});N.displayName=C;var E="TabsContent",R=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:a,forceMount:i,children:l,...o}=e,d=A(E,r),u=j(d.baseId,a),p=S(d.baseId,a),f=a===d.value,y=n.useRef(f);return n.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,h.jsx)(c,{present:i||f,children:r=>{let{present:n}=r;return(0,h.jsx)(s.sG.div,{"data-state":f?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:p,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:n&&l})}})});function j(e,t){return"".concat(e,"-trigger-").concat(t)}function S(e,t){return"".concat(e,"-content-").concat(t)}R.displayName=E;var O=x,T=M,P=N,D=R},37995:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},44057:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},45814:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var n=r(29320),a=r(62315),i=r(36103),l=r(65335),o=r(82275),d=r(79225),c=r(96886),u=r(12377),s=r(26276),p="Switch",[f,y]=(0,l.A)(p),[h,m]=f(p),v=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:l,checked:d,defaultChecked:c,required:p,disabled:f,value:y="on",onCheckedChange:m,form:v,...k}=e,[b,x]=n.useState(null),w=(0,i.s)(t,e=>x(e)),M=n.useRef(!1),C=!b||v||!!b.closest("form"),[N=!1,E]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[a]=r,i=n.useRef(a),l=(0,o.c)(t);return n.useEffect(()=>{i.current!==a&&(l(a),i.current=a)},[a,i,l]),r}({defaultProp:t,onChange:r}),l=void 0!==e,d=l?e:a,c=(0,o.c)(r);return[d,n.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else i(t)},[l,e,i,c])]}({prop:d,defaultProp:c,onChange:m});return(0,s.jsxs)(h,{scope:r,checked:N,disabled:f,children:[(0,s.jsx)(u.sG.button,{type:"button",role:"switch","aria-checked":N,"aria-required":p,"data-state":A(N),"data-disabled":f?"":void 0,disabled:f,value:y,...k,ref:w,onClick:(0,a.m)(e.onClick,e=>{E(e=>!e),C&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),C&&(0,s.jsx)(g,{control:b,bubbles:!M.current,name:l,value:y,checked:N,required:p,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=p;var k="SwitchThumb",b=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,a=m(k,r);return(0,s.jsx)(u.sG.span,{"data-state":A(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});b.displayName=k;var g=e=>{let{control:t,checked:r,bubbles:a=!0,...i}=e,l=n.useRef(null),o=(0,d.Z)(r),u=function(e){let[t,r]=n.useState(void 0);return(0,c.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,a=t.blockSize}else n=e.offsetWidth,a=e.offsetHeight;r({width:n,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=l.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let n=new Event("click",{bubbles:a});t.call(e,r),e.dispatchEvent(n)}},[o,r,a]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var x=v,w=b},64206:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},81335:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]])},86931:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>j});var n=r(29320),a=r.t(n,2),i=r(93993),l=Object.defineProperty,o=(e,t)=>l(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let r=!1,n=e.map(e=>{let n=d(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=n.forwardRef((t,r)=>{let{children:a,...i}=t,l=null,o=!1,d=[];g(a)&&"function"==typeof M&&(a=M(a._payload)),n.Children.forEach(a,e=>{if(k(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof M&&(t=M(t._payload)),l=h(e,t),d.push(l?.props?.children)}else d.push(e)}),l?l=n.cloneElement(l,void 0,d):!o&&1===n.Children.count(a)&&n.isValidElement(a)&&(l=a);let c=l?v(l):void 0,s=u(r,c);if(!l){if(a||0===a)throw Error(o?w(e):x(e));return a}let p=m(i,l.props??{});return l.type!==n.Fragment&&(p.ref=r?s:c),n.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(m,"mergeProps"),p(v,"getElementRef"),p(k,"isSlottable");var b=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}p(g,"isLazyComponent"),p(A,"isPromiseLike");var x=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=a[" use ".trim().toString()],C=r(26276),N=Object.defineProperty,E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),a=n.forwardRef((e,n)=>{let{asChild:a,...i}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,C.jsx)(a?r:t,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});N(function(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=n.forwardRef(R(function(e,t){return(0,C.jsx)(E.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/e868780c.c23ff2f7f8b56308.js b/pages/demo/_next/static/chunks/17f2321f.e75e484eec52c258.js similarity index 99% rename from pages/demo/_next/static/chunks/e868780c.c23ff2f7f8b56308.js rename to pages/demo/_next/static/chunks/17f2321f.e75e484eec52c258.js index a0c10e95..a34c96a2 100644 --- a/pages/demo/_next/static/chunks/e868780c.c23ff2f7f8b56308.js +++ b/pages/demo/_next/static/chunks/17f2321f.e75e484eec52c258.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3888],{79101:(e,i,s)=>{s.r(i),s.d(i,{Terminal:()=>rP});var r=s(95704),n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=(e,i,s,r)=>{for(var h,a=r>1?void 0:r?o(i,s):i,l=e.length-1;l>=0;l--)(h=e[l])&&(a=(r?h(i,s,a):h(a))||a);return r&&a&&n(i,s,a),a},a=(e,i)=>(s,r)=>i(s,r,e),l="Terminal input",c={get:()=>l,set:e=>l=e},d="Too much output to announce, navigate to rows manually to read",_={get:()=>d,set:e=>d=e};function u(e,i,s,r){var n;n=e=e.replace(/\r?\n/g,"\r"),e=s.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,s.triggerDataEvent(e,!0),i.value=""}function f(e,i,s){let r=s.getBoundingClientRect(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function g(e,i,s,r,n){f(e,i,s),n&&r.rightClickSelect(e),i.value=r.selectionText,i.select()}function p(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function v(e,i=0,s=e.length){let r="";for(let n=i;n65535?(i-=65536,r+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):r+=String.fromCharCode(i)}return r}var m=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?i[r++]=(this._interim-55296)*1024+s-56320+65536:(i[r++]=this._interim,i[r++]=s),this._interim=0}for(let o=n;o=s)return this._interim=n,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(n-55296)*1024+h-56320+65536:(i[r++]=n,i[r++]=h);continue}65279!==n&&(i[r++]=n)}return r}},S=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,h,a,l=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let h=0,a;for(;(a=63&this.interim[++h])&&h<4;)o<<=6,o|=a;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=l-h;for(;c=s)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[h++]=a,o<<=6,o|=63&a}n||(2===l?o<128?c--:i[r++]=o:3===l?o<2048||o>=55296&&o<=57343||65279===o||(i[r++]=o):o<65536||o>1114111||(i[r++]=o)),this.interim.fill(0)}let d=s-4,_=c;for(;_=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128||(l=(31&n)<<6|63&o)<128){_--;continue}i[r++]=l}else if((240&n)==224){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if((l=(15&n)<<12|(63&o)<<6|63&h)<2048||l>=55296&&l<=57343||65279===l)continue;i[r++]=l}else if((248&n)==240){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=h,r;if((192&(a=e[_++]))!=128){_--;continue}if((l=(7&n)<<18|(63&o)<<12|(63&h)<<6|63&a)<65536||l>1114111)continue;i[r++]=l}}return r}},b=class e{constructor(){this.fg=0,this.bg=0,this.extended=new w}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},w=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},y=class e extends b{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new w,this.combinedData=""}static fromCharData(i){let s=new e;return s.setFromCharData(i),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?p(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},C="di$target",k="di$dependencies",x=new Map;function E(e){if(x.has(e))return x.get(e);let i=function(e,s,r){var n,o,h;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");n=i,o=e,h=r,o[C]===o?o[k].push({id:n,index:h}):(o[k]=[{id:n,index:h}],o[C]=o)};return i._id=e,x.set(e,i),i}var B=E("BufferService"),D=E("CoreMouseService"),R=E("CoreService"),M=E("CharsetService"),L=E("InstantiationService"),P=E("LogService"),T=E("OptionsService"),A=E("OscLinkService"),O=E("UnicodeService"),I=E("DecorationService"),N=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s)return void i(void 0);let r=[],n=this._optionsService.rawOptions.linkHandler,o=new y,h=s.getTrimmedLength(),a=-1,l=-1,c=!1;for(let i=0;in?n.activate(e,i,o):function(e,i){if(confirm(`Do you want to navigate to ${i}? +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8381],{77542:(e,i,s)=>{s.r(i),s.d(i,{Terminal:()=>rP});var r=s(36159),n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=(e,i,s,r)=>{for(var h,a=r>1?void 0:r?o(i,s):i,l=e.length-1;l>=0;l--)(h=e[l])&&(a=(r?h(i,s,a):h(a))||a);return r&&a&&n(i,s,a),a},a=(e,i)=>(s,r)=>i(s,r,e),l="Terminal input",c={get:()=>l,set:e=>l=e},d="Too much output to announce, navigate to rows manually to read",_={get:()=>d,set:e=>d=e};function u(e,i,s,r){var n;n=e=e.replace(/\r?\n/g,"\r"),e=s.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,s.triggerDataEvent(e,!0),i.value=""}function f(e,i,s){let r=s.getBoundingClientRect(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function g(e,i,s,r,n){f(e,i,s),n&&r.rightClickSelect(e),i.value=r.selectionText,i.select()}function p(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function v(e,i=0,s=e.length){let r="";for(let n=i;n65535?(i-=65536,r+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):r+=String.fromCharCode(i)}return r}var m=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?i[r++]=(this._interim-55296)*1024+s-56320+65536:(i[r++]=this._interim,i[r++]=s),this._interim=0}for(let o=n;o=s)return this._interim=n,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(n-55296)*1024+h-56320+65536:(i[r++]=n,i[r++]=h);continue}65279!==n&&(i[r++]=n)}return r}},S=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,h,a,l=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let h=0,a;for(;(a=63&this.interim[++h])&&h<4;)o<<=6,o|=a;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=l-h;for(;c=s)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[h++]=a,o<<=6,o|=63&a}n||(2===l?o<128?c--:i[r++]=o:3===l?o<2048||o>=55296&&o<=57343||65279===o||(i[r++]=o):o<65536||o>1114111||(i[r++]=o)),this.interim.fill(0)}let d=s-4,_=c;for(;_=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128||(l=(31&n)<<6|63&o)<128){_--;continue}i[r++]=l}else if((240&n)==224){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if((l=(15&n)<<12|(63&o)<<6|63&h)<2048||l>=55296&&l<=57343||65279===l)continue;i[r++]=l}else if((248&n)==240){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=h,r;if((192&(a=e[_++]))!=128){_--;continue}if((l=(7&n)<<18|(63&o)<<12|(63&h)<<6|63&a)<65536||l>1114111)continue;i[r++]=l}}return r}},b=class e{constructor(){this.fg=0,this.bg=0,this.extended=new w}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},w=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},y=class e extends b{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new w,this.combinedData=""}static fromCharData(i){let s=new e;return s.setFromCharData(i),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?p(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},C="di$target",k="di$dependencies",x=new Map;function E(e){if(x.has(e))return x.get(e);let i=function(e,s,r){var n,o,h;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");n=i,o=e,h=r,o[C]===o?o[k].push({id:n,index:h}):(o[k]=[{id:n,index:h}],o[C]=o)};return i._id=e,x.set(e,i),i}var B=E("BufferService"),D=E("CoreMouseService"),R=E("CoreService"),M=E("CharsetService"),L=E("InstantiationService"),P=E("LogService"),T=E("OptionsService"),A=E("OscLinkService"),O=E("UnicodeService"),I=E("DecorationService"),N=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s)return void i(void 0);let r=[],n=this._optionsService.rawOptions.linkHandler,o=new y,h=s.getTrimmedLength(),a=-1,l=-1,c=!1;for(let i=0;in?n.activate(e,i,o):function(e,i){if(confirm(`Do you want to navigate to ${i}? WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}(0,i),hover:(e,i)=>n?.hover?.(e,i,o),leave:(e,i)=>n?.leave?.(e,i,o)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(l=i,a=o.extended.urlId):(l=-1,a=-1)}}i(r)}};N=h([a(0,B),a(1,T),a(2,A)],N);var H=E("CharSizeService"),W=E("CoreBrowserService"),z=E("MouseService"),F=E("RenderService"),$=E("SelectionService"),K=E("CharacterJoinerService"),U=E("ThemeService"),q=E("LinkProviderService"),V=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?G.isErrorNoTelemetry(e)?new G(e.message+` diff --git a/pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js b/pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js deleted file mode 100644 index 670441cc..00000000 --- a/pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1819],{4774:(e,t,a)=>{a.d(t,{BC:()=>g,GM:()=>d,GN:()=>h,Kh:()=>N,aR:()=>p,dB:()=>w,fe:()=>f,h6:()=>y,nO:()=>j,qT:()=>m,sV:()=>u});var n=a(95155),s=a(32320),i=a(19408),l=a(20508),r=a(89470),o=a(39068),c=a(41183);let d=e=>"/iam/role/?name=".concat(encodeURIComponent(e)),u=e=>"/iam/roles/create/".concat(e?"?service=".concat(encodeURIComponent(e)):""),m=[{principal:"lambda.amazonaws.com",name:"Lambda",description:"Allows Lambda functions to call HomeCloud services on your behalf."},{principal:"ec2.amazonaws.com",name:"EC2",description:"Allows EC2 instances to call HomeCloud services on your behalf."},{principal:"ecs-tasks.amazonaws.com",name:"Elastic Container Service Task",description:"Allows ECS tasks to call HomeCloud services on your behalf."},{principal:"states.amazonaws.com",name:"Step Functions",description:"Allows state machines to invoke Lambda functions and other services."},{principal:"events.amazonaws.com",name:"EventBridge",description:"Allows EventBridge rules to deliver events to targets."},{principal:"apigateway.amazonaws.com",name:"API Gateway",description:"Allows API Gateway to call integrations and push logs to CloudWatch."},{principal:"cloudformation.amazonaws.com",name:"CloudFormation",description:"Allows CloudFormation to create and manage stack resources on your behalf."},{principal:"scheduler.amazonaws.com",name:"EventBridge Scheduler",description:"Allows schedules to invoke their targets."}],f=e=>{var t,a;return null!=(a=null==(t=m.find(t=>t.principal===e))?void 0:t.name)?a:e.replace(/\.amazonaws\.com$/,"")},x=e=>1===e.length?e[0]:e;function h(e){return{Version:"2012-10-17",Statement:[{Effect:"Allow",Principal:{Service:x(e)},Action:"sts:AssumeRole"}]}}function p(e,t){return{Version:"2012-10-17",Statement:[{Effect:"Allow",Principal:{AWS:x(t.length?t:["arn:aws:iam::".concat(e,":root")])},Action:"sts:AssumeRole"}]}}let v=e=>"string"==typeof e&&e.length>0||Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e&&e.length>0);function g(e){if(!e||"object"!=typeof e||Array.isArray(e))return"The trust policy must be a JSON object";let t=e.Statement;if(null==t)return"Statement is required";let a=Array.isArray(t)?t:[t];if(0===a.length)return"Statement must not be empty";for(let e=0;e!["AWS","Service","Federated"].includes(e));if(a)return"Statement[".concat(e,"].Principal.").concat(a,": use AWS, Service or Federated");if(!t.length)return"Statement[".concat(e,"].Principal must name at least one principal");for(let a of t)if(!v(n[a]))return"Statement[".concat(e,"].Principal.").concat(a," must be a string or a non-empty array of strings")}if(void 0!==t.Resource||void 0!==t.NotResource)return"Statement[".concat(e,"].Resource is not allowed in a trust policy");if(void 0!==t.Action&&void 0!==t.NotAction)return"Statement[".concat(e,"] cannot have both Action and NotAction");let s=void 0!==t.NotAction?"NotAction":"Action";if(!v(t[s]))return"Statement[".concat(e,"].").concat(s," must be a string or a non-empty array of strings");let i=(0,c.DD)(t[s]).find(e=>!e.toLowerCase().startsWith("sts:"));if(i)return"Statement[".concat(e,"].").concat(s,' "').concat(i,'": trust policies only grant sts: actions')}return null}function j(e){let t=[],a=new Set,n=e=>{let n="".concat(e.kind,":").concat(e.value);a.has(n)||(a.add(n),t.push(e))};for(let t of(0,c.GX)(e)){if(!t||"Allow"!==t.Effect)continue;let e=t.Principal;if("*"===e){n({kind:"any",label:"Anyone",value:"*"});continue}if(e&&"object"==typeof e){for(let t of(0,c.DD)(e.Service))n({kind:"service",label:"AWS service: ".concat(f(t)),value:t});for(let t of(0,c.DD)(e.AWS))n(function(e){if("*"===e)return{kind:"any",label:"Any AWS principal",value:e};if(/^\d{12}$/.test(e))return{kind:"account",label:"Account: ".concat(e),value:e};let t=/^arn:[\w-]+:(iam|sts)::(\d*):(.*)$/.exec(e);if(t){let[,,a,n]=t;if("root"===n)return{kind:"account",label:"Account: ".concat(a),value:e};if(n.startsWith("user/"))return{kind:"user",label:"User: ".concat(n.slice(n.lastIndexOf("/")+1)),value:e};if(n.startsWith("role/"))return{kind:"role",label:"Role: ".concat(n.slice(n.lastIndexOf("/")+1)),value:e}}return{kind:"other",label:e,value:e}}(t));for(let t of(0,c.DD)(e.Federated))n({kind:"federated",label:"Identity provider: ".concat(t),value:t})}}return t}let b={service:s.A,account:i.A,user:l.A,role:r.A,federated:o.A,any:o.A,other:o.A};function w(e){let{role:t,max:a=3}=e,s=j(t.assume_role_policy);if(!s.length)return(0,n.jsx)("span",{className:"text-muted-foreground",children:"None"});let i=s.slice(0,a);return(0,n.jsxs)("span",{className:"flex flex-col gap-0.5",children:[i.map(e=>{let t=b[e.kind];return(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",title:e.value,children:[(0,n.jsx)(t,{className:"text-muted-foreground size-3.5 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:e.label})]},"".concat(e.kind,":").concat(e.value))}),s.length>a&&(0,n.jsxs)("span",{className:"text-muted-foreground text-xs",children:["and ",s.length-a," more"]})]})}function N(e){let t=Math.floor(e/3600),a=Math.round(e%3600/60);return a?"".concat(t," h ").concat(a," min"):1===t?"1 hour":"".concat(t," hours")}let y=[1,2,4,6,8,12].map(e=>({value:3600*e,label:1===e?"1 hour":"".concat(e," hours")}))},7e3:(e,t,a)=>{a.d(t,{Fl:()=>x,YI:()=>r,Yq:()=>c,ZV:()=>l,a3:()=>m,fF:()=>u,fU:()=>d,qt:()=>i,td:()=>f,z3:()=>s});let n=["B","KB","MB","GB","TB","PB"];function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let a=Math.abs(e),s=0;for(;a>=1024&&s=100?0:t);return"".concat(e<0?"-":"").concat(i," ").concat(n[s])}function i(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function r(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return s(e);case"Bytes/Second":return"".concat(s(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=o(e);return a?a.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),a=o(e);if(!a)return"-";let n=(a.getTime()-t)/1e3,s=Math.abs(n),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s<45||n>0&&n<60)return"just now";let l=n;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:a)}function x(e){let t=e.endsWith("/")?e.slice(0,-1):e,a=t.lastIndexOf("/");return a>=0?t.slice(a+1):t}},11723:(e,t,a)=>{a.d(t,{f:()=>r});var n=a(95155),s=a(82180),i=a(7e3),l=a(73697);function r(e){let{value:t,className:a}=e,r=(0,l.cB)(3e4);return t?(0,n.jsxs)(s.m_,{children:[(0,n.jsx)(s.k$,{asChild:!0,children:(0,n.jsx)("span",{className:null!=a?a:"whitespace-nowrap",children:(0,i.fF)(t,r)})}),(0,n.jsx)(s.ZI,{children:(0,i.Yq)(t)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}},16981:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(95155),s=a(90235),i=a(25016);function l(e){let{label:t,htmlFor:a,help:l,error:r,optional:o,children:c,className:d}=e;return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",d),children:[(0,n.jsxs)(s.J,{htmlFor:a,className:"text-sm font-medium",children:[t,o&&(0,n.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,r?(0,n.jsx)("p",{className:"text-destructive text-xs",children:r}):l?(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},31629:(e,t,a)=>{a.d(t,{v:()=>i});var n=a(95155),s=a(25016);function i(e){let{items:t,columns:a=3,className:i}=e;return(0,n.jsx)("dl",{className:(0,s.cn)("grid grid-cols-1 gap-x-8 gap-y-4",{2:"sm:grid-cols-2",3:"sm:grid-cols-2 lg:grid-cols-3",4:"sm:grid-cols-2 lg:grid-cols-4"}[a],i),children:t.map(e=>(0,n.jsxs)("div",{className:(0,s.cn)("min-w-0",e.wide&&"sm:col-span-full"),children:[(0,n.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:e.label}),(0,n.jsx)("dd",{className:"min-w-0 text-sm break-words",children:""===e.value||null===e.value||void 0===e.value?(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"}):e.value})]},e.label))})}},47507:(e,t,a)=>{a.d(t,{TR:()=>x,bq:()=>m,eb:()=>h,gC:()=>f,l6:()=>c,s3:()=>d,yv:()=>u});var n=a(95155);a(12115);var s=a(95435),i=a(24033),l=a(5917),r=a(12108),o=a(25016);function c(e){let{...t}=e;return(0,n.jsx)(s.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,n.jsx)(s.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,n.jsx)(s.WT,{"data-slot":"select-value",...t})}function m(e){let{className:t,size:a="default",children:l,...r}=e;return(0,n.jsxs)(s.l9,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[l,(0,n.jsx)(s.In,{asChild:!0,children:(0,n.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function f(e){let{className:t,children:a,position:i="popper",...l}=e;return(0,n.jsx)(s.ZL,{children:(0,n.jsxs)(s.UC,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...l,children:[(0,n.jsx)(p,{}),(0,n.jsx)(s.LM,{className:(0,o.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,n.jsx)(v,{})]})})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(s.JU,{"data-slot":"select-label",className:(0,o.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function h(e){let{className:t,children:a,...i}=e;return(0,n.jsxs)(s.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[(0,n.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,n.jsx)(s.VF,{children:(0,n.jsx)(l.A,{className:"size-4"})})}),(0,n.jsx)(s.p4,{children:a})]})}function p(e){let{className:t,...a}=e;return(0,n.jsx)(s.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,n.jsx)(r.A,{className:"size-4"})})}function v(e){let{className:t,...a}=e;return(0,n.jsx)(s.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,n.jsx)(i.A,{className:"size-4"})})}},90923:(e,t,a)=>{a.d(t,{Xi:()=>o,av:()=>c,j7:()=>r,tU:()=>l});var n=a(95155);a(12115);var s=a(60356),i=a(25016);function l(e){let{className:t,...a}=e;return(0,n.jsx)(s.bL,{"data-slot":"tabs",className:(0,i.cn)("flex flex-col gap-4",t),...a})}function r(e){let{className:t,...a}=e;return(0,n.jsx)(s.B8,{"data-slot":"tabs-list",className:(0,i.cn)("text-muted-foreground flex h-10 w-full items-end justify-start gap-1 overflow-x-auto border-b",t),...a})}function o(e){let{className:t,...a}=e;return(0,n.jsx)(s.l9,{"data-slot":"tabs-trigger",className:(0,i.cn)("relative -mb-px inline-flex h-10 items-center justify-center gap-1.5 border-b-2 border-transparent px-3 text-sm font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-primary data-[state=active]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function c(e){let{className:t,...a}=e;return(0,n.jsx)(s.UC,{"data-slot":"tabs-content",className:(0,i.cn)("flex-1 outline-none",t),...a})}},91819:(e,t,a)=>{a.d(t,{StateMachineDetailPage:()=>$,p:()=>O});var n=a(95155),s=a(12115),i=a(52619),l=a.n(i),r=a(4774),o=a(20063),c=a(6132),d=a(18514),u=a(71360),m=a(85921),f=a(35626),x=a(36168),h=a(35299),p=a(18720),v=a(97003),g=a(54679),j=a(33789),b=a(47507),w=a(90923),N=a(99116),y=a(82523),S=a(95567),A=a(97438),C=a(16981),k=a(50524),z=a(31629),_=a(59516),E=a(17705),D=a(62325),R=a(73864),F=a(60495),B=a(11723),I=a(37621),P=a(7e3),M=a(73697),L=a(73178),T=a(81271),q=a(88256);let W=["executions","definition"];function $(){var e;let t=(0,o.useRouter)(),a=(0,M.pE)("name"),i=(0,M.pE)("tab"),f=(0,M.pE)("start"),x=(0,M.bN)(),h=W.includes(i)?i:"executions",{data:p,error:g,isLoading:j,mutate:b}=(0,M.gf)(a?(0,T.lg)(a):null,{refreshInterval:e=>{var t;return(null!=(t=null==e?void 0:e.executions.RUNNING)?t:0)>0?3e3:15e3}}),y=(0,T.TR)({onDeleted:()=>t.push("/sfn/")}),[C,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{f&&p&&(k(!0),x("start",null))},[f,p,x]);let L=[{label:"Step Functions",href:"/sfn/"},{label:"State machines",href:"/sfn/"},{label:a||"State machine"}];if(!a)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E.z,{title:"State machine",breadcrumbs:L}),(0,n.jsx)(S.p,{title:"No state machine selected",description:"Open a state machine from the list.",action:(0,n.jsx)(G,{})})]});if(g&&!p){let e=g instanceof I.hD&&404===g.status;return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)(E.z,{title:a,breadcrumbs:L}),e?(0,n.jsx)(D.w,{children:(0,n.jsx)(S.p,{icon:c.A,title:"State machine not found",description:"State machine ".concat(a," does not exist."),action:(0,n.jsx)(G,{})})}):(0,n.jsx)(A.W,{error:g,onRetry:()=>b()})]})}if(j||!p)return(0,n.jsx)(_.P0,{});let q=p.state_machine;return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)(E.z,{title:q.name,badge:(0,n.jsx)(R.Wh,{status:q.status.toLowerCase()}),description:q.definition.Comment?String(q.definition.Comment):"".concat("EXPRESS"===q.type?"Express":"Standard"," state machine"),breadcrumbs:L,actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.$,{variant:"outline",size:"sm",asChild:!0,children:(0,n.jsxs)(l(),{href:(0,T.Te)(q.name),children:[(0,n.jsx)(d.A,{})," Edit"]})}),(0,n.jsxs)(v.$,{variant:"outline",size:"sm",onClick:()=>y.remove(q.name),children:[(0,n.jsx)(u.A,{})," Delete"]}),(0,n.jsxs)(v.$,{size:"sm",onClick:()=>k(!0),children:[(0,n.jsx)(m.A,{})," Start execution"]})]})}),(0,n.jsx)(D.w,{title:"Details",children:(0,n.jsx)(z.v,{columns:3,items:[{label:"Name",value:q.name},{label:"Status",value:(0,n.jsx)(R.Wh,{status:q.status.toLowerCase()})},{label:"Type",value:"EXPRESS"===q.type?"Express":"Standard"},{label:"Execution role",value:q.role_arn?(0,n.jsx)(l(),{href:(0,r.GM)(null!=(e=q.role_arn.split("/").pop())?e:""),className:"text-primary hover:underline",children:q.role_arn.split("/").pop()}):""},{label:"Created",value:(0,n.jsxs)("span",{children:[(0,P.Yq)(q.created_at)," (",(0,n.jsx)(B.f,{value:q.created_at}),")"]})},{label:"Last updated",value:(0,n.jsxs)("span",{children:[(0,P.Yq)(q.updated_at)," (",(0,n.jsx)(B.f,{value:q.updated_at}),")"]})},{label:"Executions",value:(0,n.jsx)(T.YH,{counts:p.executions})},{label:"ARN",value:(0,n.jsx)(N.xh,{value:q.arn}),wide:!0},...q.tags&&Object.keys(q.tags).length?[{label:"Tags",value:(0,n.jsx)(F.LY,{tags:q.tags}),wide:!0}]:[]]})}),(0,n.jsxs)(w.tU,{value:h,onValueChange:e=>x("tab","executions"===e?null:e),children:[(0,n.jsxs)(w.j7,{children:[(0,n.jsx)(w.Xi,{value:"executions",children:"Executions"}),(0,n.jsx)(w.Xi,{value:"definition",children:"Definition"})]}),(0,n.jsx)(w.av,{value:"executions",children:(0,n.jsx)(U,{machine:q.name,onStart:()=>k(!0)})}),(0,n.jsx)(w.av,{value:"definition",children:(0,n.jsx)(Y,{detail:p})})]}),(0,n.jsx)(O,{machine:C?q.name:null,onClose:()=>k(!1)}),y.dialog]})}function G(){return(0,n.jsx)(v.$,{variant:"outline",size:"sm",asChild:!0,children:(0,n.jsxs)(l(),{href:"/sfn/",children:[(0,n.jsx)(f.A,{})," Back to state machines"]})})}function U(e){let{machine:t,onStart:a}=e,[i,r]=(0,s.useState)("all"),{data:o,error:c,isLoading:d,isValidating:u,mutate:f}=(0,M.gf)("".concat((0,T.lg)(t),"/executions"),{query:{status:"all"===i?void 0:i},refreshInterval:e=>(null!=e?e:[]).some(e=>"RUNNING"===e.status)?2e3:15e3}),h=(null!=o?o:[]).some(e=>"RUNNING"===e.status),p=(0,M.cB)(h?1e3:6e4),g=[{id:"name",header:"Name",cell:e=>(0,n.jsx)(l(),{href:(0,T._E)(e.id),className:"".concat((0,y.V)()," font-mono text-[13px]"),children:e.name}),value:e=>e.name},{id:"status",header:"Status",cell:e=>(0,n.jsx)(T.vZ,{status:e.status}),value:e=>e.status},{id:"start",header:"Started",cell:e=>(0,n.jsx)("span",{className:"whitespace-nowrap",children:(0,P.Yq)(e.start_date)}),value:e=>e.start_date,hideBelow:"sm"},{id:"stop",header:"Stopped",cell:e=>e.stop_date?(0,n.jsx)("span",{className:"whitespace-nowrap",children:(0,P.Yq)(e.stop_date)}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"}),value:e=>{var t;return null!=(t=e.stop_date)?t:""},hideBelow:"md"},{id:"duration",header:"Duration",cell:e=>(0,n.jsx)("span",{className:"tabular-nums whitespace-nowrap",children:(0,T.gz)(e.start_date,e.stop_date,p)}),value:e=>(e.stop_date?new Date(e.stop_date).getTime():p)-new Date(e.start_date).getTime()}];return(0,n.jsx)(y.b,{title:"Executions",data:o,columns:g,rowId:e=>e.id,loading:d,error:c,onRefresh:()=>f(),refreshing:u,searchPlaceholder:"Find executions by name",defaultSort:{id:"start",desc:!0},actions:(0,n.jsxs)(v.$,{size:"sm",onClick:a,children:[(0,n.jsx)(m.A,{})," Start execution"]}),filters:(0,n.jsxs)(b.l6,{value:i,onValueChange:e=>e&&r(e),children:[(0,n.jsx)(b.bq,{size:"sm",className:"h-8 w-40","aria-label":"Status filter",children:(0,n.jsx)(b.yv,{})}),(0,n.jsxs)(b.gC,{children:[(0,n.jsx)(b.eb,{value:"all",children:"All statuses"}),L.c.map(e=>(0,n.jsx)(b.eb,{value:e,children:(0,T.m8)(e)},e))]})]}),empty:"all"!==i?(0,n.jsx)(S.p,{icon:x.A,title:"No ".concat((0,T.m8)(i).toLowerCase()," executions"),action:(0,n.jsx)(v.$,{variant:"outline",size:"sm",onClick:()=>r("all"),children:"Show all executions"})}):(0,n.jsx)(S.p,{icon:x.A,title:"No executions",description:"Start an execution with a JSON input. Executions also start from EventBridge rules that target this state machine.",action:(0,n.jsxs)(v.$,{size:"sm",onClick:a,children:[(0,n.jsx)(m.A,{})," Start execution"]})})})}function Y(e){let{detail:t}=e,a=t.state_machine,s=(0,T.j9)(a.definition);return(0,n.jsxs)("div",{className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-2",children:[(0,n.jsx)(D.w,{title:"Graph",bodyClassName:"p-3",children:(0,n.jsx)(q.bH,{definition:a.definition})}),(0,n.jsx)(D.w,{title:"Definition",actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N.i8,{value:s,size:"sm",label:"Copy",toastMessage:"Definition copied"}),(0,n.jsx)(v.$,{variant:"outline",size:"sm",asChild:!0,children:(0,n.jsxs)(l(),{href:(0,T.Te)(a.name),children:[(0,n.jsx)(d.A,{})," Edit"]})})]}),bodyClassName:"p-3",children:(0,n.jsx)("pre",{className:"bg-muted/30 max-h-[36rem] overflow-auto rounded-md border p-3 font-mono text-[12.5px] leading-5",children:s})})]})}function O(e){let{machine:t,onClose:a,initialInput:i}=e,l=(0,o.useRouter)(),[r,c]=(0,s.useState)(""),[d,u]=(0,s.useState)("{}"),[f,x]=(0,s.useState)(!1),[b,w]=(0,s.useState)(!1);(0,s.useEffect)(()=>{t&&(c(""),w(!1),void 0!==i&&u(i))},[t,i]);let N=r?(0,T.eA)(r,"Execution names"):null,y=(0,k.F)(d),S=async e=>{if(e.preventDefault(),w(!0),t&&!N&&!y){x(!0);try{let e=await I.FH.post("".concat((0,T.lg)(t),"/executions"),{name:r||void 0,input:JSON.parse(d)});p.oR.success("Started execution ".concat(e.name)),await (0,M.Yi)(T.k$),a(),l.push((0,T._E)(e.id))}catch(e){p.oR.error((0,I.gJ)(e))}finally{x(!1)}}};return(0,n.jsx)(g.lG,{open:!!t,onOpenChange:e=>!e&&!f&&a(),children:(0,n.jsx)(g.Cf,{className:"sm:max-w-2xl",children:(0,n.jsxs)("form",{onSubmit:S,className:"flex min-w-0 flex-col gap-4",children:[(0,n.jsxs)(g.c7,{children:[(0,n.jsx)(g.L3,{children:"Start execution"}),(0,n.jsxs)(g.rr,{children:["Run ",(0,n.jsx)("span",{className:"font-mono",children:t})," with a JSON input. You are taken to the execution to follow it."]})]}),(0,n.jsx)(C.D,{label:"Name",optional:!0,htmlFor:"exec-name",error:b||r?N:void 0,help:"Unique within this state machine. Defaults to a random ID.",children:(0,n.jsx)(j.p,{id:"exec-name",autoComplete:"off",spellCheck:!1,value:r,onChange:e=>c(e.target.value),className:"font-mono text-[13px]"})}),(0,n.jsx)(C.D,{label:"Input",children:(0,n.jsx)("div",{className:"max-h-[50vh] overflow-auto",children:(0,n.jsx)(k.i,{value:d,onChange:u,rows:8})})}),(0,n.jsxs)(g.Es,{children:[(0,n.jsx)(v.$,{type:"button",variant:"outline",onClick:a,disabled:f,children:"Cancel"}),(0,n.jsxs)(v.$,{type:"submit",disabled:f||!!y||!!N,children:[f?(0,n.jsx)(h.A,{className:"animate-spin"}):(0,n.jsx)(m.A,{}),"Start execution"]})]})]})})})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js b/pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js new file mode 100644 index 00000000..19e4db43 --- /dev/null +++ b/pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1830],{1947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},23566:(e,t,n)=>{n.d(t,{q7:()=>S,bL:()=>j,RG:()=>k});var r=n(29320),a=n(62315),o=n(2430),l=n(36103),i=n(65335),u=n(29203),c=n(12377),s=n(82275),d=n(97645),f=n(26276),p="rovingFocusGroup.onEntryFocus",y={bubbles:!1,cancelable:!0},m="RovingFocusGroup",[h,v,b]=(0,o.N)(m),[g,k]=(0,i.A)(m,[b]),[A,w]=g(m),x=r.forwardRef((e,t)=>(0,f.jsx)(h.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(h.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(M,{...e,ref:t})})}));x.displayName=m;var M=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:u,currentTabStopId:m,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:b,onEntryFocus:g,preventScrollOnEntryFocus:k=!1,...w}=e,x=r.useRef(null),M=(0,l.s)(t,x),R=(0,d.jH)(u),[E=null,N]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,s.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=(0,s.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}({prop:m,defaultProp:h,onChange:b}),[j,S]=r.useState(!1),I=(0,s.c)(g),T=v(n),D=r.useRef(!1),[O,F]=r.useState(0);return r.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(p,I),()=>e.removeEventListener(p,I)},[I]),(0,f.jsx)(A,{scope:n,orientation:o,dir:R,loop:i,currentTabStopId:E,onItemFocus:r.useCallback(e=>N(e),[N]),onItemShiftTab:r.useCallback(()=>S(!0),[]),onFocusableItemAdd:r.useCallback(()=>F(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>F(e=>e-1),[]),children:(0,f.jsx)(c.sG.div,{tabIndex:j||0===O?-1:0,"data-orientation":o,...w,ref:M,style:{outline:"none",...e.style},onMouseDown:(0,a.m)(e.onMouseDown,()=>{D.current=!0}),onFocus:(0,a.m)(e.onFocus,e=>{let t=!D.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(p,y);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);C([e.find(e=>e.active),e.find(e=>e.id===E),...e].filter(Boolean).map(e=>e.ref.current),k)}}D.current=!1}),onBlur:(0,a.m)(e.onBlur,()=>S(!1))})})}),R="RovingFocusGroupItem",E=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:i,...s}=e,d=(0,u.B)(),p=i||d,y=w(R,n),m=y.currentTabStopId===p,b=v(n),{onFocusableItemAdd:g,onFocusableItemRemove:k}=y;return r.useEffect(()=>{if(o)return g(),()=>k()},[o,g,k]),(0,f.jsx)(h.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,f.jsx)(c.sG.span,{tabIndex:m?0:-1,"data-orientation":y.orientation,...s,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,a.m)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,a.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let a=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return N[a]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=y.loop?function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(n,r+1):n.slice(r+1)}setTimeout(()=>C(n))}})})})});E.displayName=R;var N={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}var j=x,S=E},24608:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},29902:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,n)=>{n.d(t,{UC:()=>O,B8:()=>T,bL:()=>I,l9:()=>D});var r=n(29320),a=n(62315),o=n(65335),l=n(23566),i=n(36103),u=n(96886),c=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,o]=r.useState(),l=r.useRef({}),i=r.useRef(e),c=r.useRef("none"),[d,f]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=s(l.current);c.current="mounted"===d?e:"none"},[d]),(0,u.N)(()=>{let t=l.current,n=i.current;if(n!==e){let r=c.current,a=s(t);e?f("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?f("UNMOUNT"):n&&r!==a?f("ANIMATION_OUT"):f("UNMOUNT"),i.current=e}},[e,f]),(0,u.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=s(l.current).includes(e.animationName);if(e.target===a&&r&&(f("ANIMATION_END"),!i.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},o=e=>{e.target===a&&(c.current=s(l.current))};return a.addEventListener("animationstart",o),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",o),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:r.useCallback(e=>{e&&(l.current=getComputedStyle(e)),o(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),l=(0,i.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:l}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var d=n(12377),f=n(97645),p=n(82275),y=n(29203),m=n(26276),h="Tabs",[v,b]=(0,o.A)(h,[l.RG]),g=(0,l.RG)(),[k,A]=v(h),w=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:l,orientation:i="horizontal",dir:u,activationMode:c="automatic",...s}=e,h=(0,f.jH)(u),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,p.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=(0,p.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}({prop:a,onChange:o,defaultProp:l});return(0,m.jsx)(k,{scope:n,baseId:(0,y.B)(),value:v,onValueChange:b,orientation:i,dir:h,activationMode:c,children:(0,m.jsx)(d.sG.div,{dir:h,"data-orientation":i,...s,ref:t})})});w.displayName=h;var x="TabsList",M=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=A(x,n),i=g(n);return(0,m.jsx)(l.bL,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:(0,m.jsx)(d.sG.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});M.displayName=x;var R="TabsTrigger",E=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,u=A(R,n),c=g(n),s=j(u.baseId,r),f=S(u.baseId,r),p=r===u.value;return(0,m.jsx)(l.q7,{asChild:!0,...c,focusable:!o,active:p,children:(0,m.jsx)(d.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:s,...i,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():u.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&u.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==u.activationMode;p||o||!e||u.onValueChange(r)})})})});E.displayName=R;var N="TabsContent",C=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:l,...i}=e,u=A(N,n),s=j(u.baseId,a),f=S(u.baseId,a),p=a===u.value,y=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,m.jsx)(c,{present:o||p,children:n=>{let{present:r}=n;return(0,m.jsx)(d.sG.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":s,hidden:!r,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&l})}})});function j(e,t){return"".concat(e,"-trigger-").concat(t)}function S(e,t){return"".concat(e,"-content-").concat(t)}C.displayName=N;var I=w,T=M,D=E,O=C},37995:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},42812:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43036:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},46319:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},64206:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},79092:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},86931:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,n)=>{n.d(t,{b:()=>j});var r=n(29320),a=n.t(r,2),o=n(93993),l=Object.defineProperty,i=(e,t)=>l(e,"name",{value:t,configurable:!0});function u(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let n=!1,r=e.map(e=>{let r=u(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;td(e,"name",{value:t,configurable:!0});function p(e){let t=r.forwardRef((t,n)=>{let{children:a,...o}=t,l=null,i=!1,u=[];k(a)&&"function"==typeof M&&(a=M(a._payload)),r.Children.forEach(a,e=>{if(b(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof M&&(t=M(t._payload)),l=m(e,t),u.push(l?.props?.children)}else u.push(e)}),l?l=r.cloneElement(l,void 0,u):!i&&1===r.Children.count(a)&&r.isValidElement(a)&&(l=a);let c=l?v(l):void 0,d=s(n,c);if(!l){if(a||0===a)throw Error(i?x(e):w(e));return a}let f=h(o,l.props??{});return l.type!==r.Fragment&&(f.ref=n?d:c),r.cloneElement(l,f)});return t.displayName=`${e}.Slot`,t}f(p,"createSlot");var y=Symbol.for("radix.slottable");f(function(e){let t=f(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var m=f((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let n={...t};for(let r in t){let a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}f(h,"mergeProps"),f(v,"getElementRef"),f(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}f(k,"isLazyComponent"),f(A,"isPromiseLike");var w=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=a[" use ".trim().toString()],R=n(26276),E=Object.defineProperty,N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=p(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,R.jsx)(a?n:t,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});E(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,j=r.forwardRef(C(function(e,t){return(0,R.jsx)(N.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js b/pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js deleted file mode 100644 index 39514f48..00000000 --- a/pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1884],{19080:(e,t,n)=>{n.d(t,{bm:()=>eo,UC:()=>et,VY:()=>er,hJ:()=>ee,ZL:()=>$,bL:()=>Q,hE:()=>en});var r=n(12115),o=n(92556),i=n(94446),a=n(3468),l=n(68946),s=n(70222),u=n(44831),d=n(69666),c=n(75433),f=n(4129),p=e=>{let{present:t,children:n}=e,o=function(e){var t,n;let[o,i]=r.useState(),a=r.useRef({}),l=r.useRef(e),s=r.useRef("none"),[u,d]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=m(a.current);s.current="mounted"===u?e:"none"},[u]),(0,f.N)(()=>{let t=a.current,n=l.current;if(n!==e){let r=s.current,o=m(t);e?d("MOUNT"):"none"===o||(null==t?void 0:t.display)==="none"?d("UNMOUNT"):n&&r!==o?d("ANIMATION_OUT"):d("UNMOUNT"),l.current=e}},[e,d]),(0,f.N)(()=>{if(o){var e;let t,n=null!=(e=o.ownerDocument.defaultView)?e:window,r=e=>{let r=m(a.current).includes(e.animationName);if(e.target===o&&r&&(d("ANIMATION_END"),!l.current)){let e=o.style.animationFillMode;o.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=e)})}},i=e=>{e.target===o&&(s.current=m(a.current))};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",r),o.addEventListener("animationend",r),()=>{n.clearTimeout(t),o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",r),o.removeEventListener("animationend",r)}}d("ANIMATION_END")},[o,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:r.useCallback(e=>{e&&(a.current=getComputedStyle(e)),i(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),l=(0,i.s)(o.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(o=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:l}):null};function m(e){return(null==e?void 0:e.animationName)||"none"}p.displayName="Presence";var g=n(97602),v=n(19526),N=n(40101),y=n(97745),D=n(32467),h=n(95155),O="Dialog",[R,b]=(0,a.A)(O),[w,I]=R(O),E=e=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:i,onOpenChange:a,modal:u=!0}=e,d=r.useRef(null),c=r.useRef(null),[f=!1,p]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[o,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[o]=n,i=r.useRef(o),a=(0,s.c)(t);return r.useEffect(()=>{i.current!==o&&(a(o),i.current=o)},[o,i,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,l=a?e:o,u=(0,s.c)(n);return[l,r.useCallback(t=>{if(a){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else i(t)},[a,e,i,u])]}({prop:o,defaultProp:i,onChange:a});return(0,h.jsx)(w,{scope:t,triggerRef:d,contentRef:c,contentId:(0,l.B)(),titleId:(0,l.B)(),descriptionId:(0,l.B)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:u,children:n})};E.displayName=O;var j="DialogTrigger";r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=I(j,n),l=(0,i.s)(t,a.triggerRef);return(0,h.jsx)(g.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":X(a.open),...r,ref:l,onClick:(0,o.m)(e.onClick,a.onOpenToggle)})}).displayName=j;var x="DialogPortal",[C,A]=R(x,{forceMount:void 0}),M=e=>{let{__scopeDialog:t,forceMount:n,children:o,container:i}=e,a=I(x,t);return(0,h.jsx)(C,{scope:t,forceMount:n,children:r.Children.map(o,e=>(0,h.jsx)(p,{present:n||a.open,children:(0,h.jsx)(c.Z,{asChild:!0,container:i,children:e})}))})};M.displayName=x;var _="DialogOverlay",T=r.forwardRef((e,t)=>{let n=A(_,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=I(_,e.__scopeDialog);return i.modal?(0,h.jsx)(p,{present:r||i.open,children:(0,h.jsx)(F,{...o,ref:t})}):null});T.displayName=_;var F=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=I(_,n);return(0,h.jsx)(N.A,{as:D.DX,allowPinchZoom:!0,shards:[o.contentRef],children:(0,h.jsx)(g.sG.div,{"data-state":X(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),P="DialogContent",k=r.forwardRef((e,t)=>{let n=A(P,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=I(P,e.__scopeDialog);return(0,h.jsx)(p,{present:r||i.open,children:i.modal?(0,h.jsx)(U,{...o,ref:t}):(0,h.jsx)(L,{...o,ref:t})})});k.displayName=P;var U=r.forwardRef((e,t)=>{let n=I(P,e.__scopeDialog),a=r.useRef(null),l=(0,i.s)(t,n.contentRef,a);return r.useEffect(()=>{let e=a.current;if(e)return(0,y.Eq)(e)},[]),(0,h.jsx)(S,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.m)(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:(0,o.m)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,o.m)(e.onFocusOutside,e=>e.preventDefault())})}),L=r.forwardRef((e,t)=>{let n=I(P,e.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return(0,h.jsx)(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,a;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(a=n.triggerRef.current)||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var r,a;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let l=t.target;(null==(a=n.triggerRef.current)?void 0:a.contains(l))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),S=r.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:l,...s}=e,c=I(P,n),f=r.useRef(null),p=(0,i.s)(t,f);return(0,v.Oh)(),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.n,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:l,children:(0,h.jsx)(u.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":X(c.open),...s,ref:p,onDismiss:()=>c.onOpenChange(!1)})}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Y,{titleId:c.titleId}),(0,h.jsx)(z,{contentRef:f,descriptionId:c.descriptionId})]})]})}),W="DialogTitle",B=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=I(W,n);return(0,h.jsx)(g.sG.h2,{id:o.titleId,...r,ref:t})});B.displayName=W;var G="DialogDescription",q=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=I(G,n);return(0,h.jsx)(g.sG.p,{id:o.descriptionId,...r,ref:t})});q.displayName=G;var V="DialogClose",Z=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=I(V,n);return(0,h.jsx)(g.sG.button,{type:"button",...r,ref:t,onClick:(0,o.m)(e.onClick,()=>i.onOpenChange(!1))})});function X(e){return e?"open":"closed"}Z.displayName=V;var H="DialogTitleWarning",[J,K]=(0,a.q)(H,{contentName:P,titleName:W,docsSlug:"dialog"}),Y=e=>{let{titleId:t}=e,n=K(H),o="`".concat(n.contentName,"` requires a `").concat(n.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(n.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(n.docsSlug);return r.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},z=e=>{let{contentRef:t,descriptionId:n}=e,o=K("DialogDescriptionWarning"),i="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(o.contentName,"}.");return r.useEffect(()=>{var e;let r=null==(e=t.current)?void 0:e.getAttribute("aria-describedby");n&&r&&(document.getElementById(n)||console.warn(i))},[i,t,n]),null},Q=E,$=M,ee=T,et=k,en=B,er=q,eo=Z},65229:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js b/pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js new file mode 100644 index 00000000..fe0a2c36 --- /dev/null +++ b/pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1930],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},22470:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},30359:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},44057:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},69545:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>R});var r=l(29320),n=l.t(r,2),a=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function y(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=y(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;tp(e,"name",{value:t,configurable:!0});function u(e){let t=r.forwardRef((t,l)=>{let{children:n,...a}=t,i=null,o=!1,y=[];A(n)&&"function"==typeof M&&(n=M(n._payload)),r.Children.forEach(n,e=>{if(x(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof M&&(t=M(t._payload)),i=f(e,t),y.push(i?.props?.children)}else y.push(e)}),i?i=r.cloneElement(i,void 0,y):!o&&1===r.Children.count(n)&&r.isValidElement(n)&&(i=n);let d=i?m(i):void 0,p=c(l,d);if(!i){if(n||0===n)throw Error(o?w(e):g(e));return n}let h=k(a,i.props??{});return i.type!==r.Fragment&&(h.ref=l?p:d),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(u,"createSlot");var s=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var f=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let n=e[r],a=t[r];/^on[A-Z]/.test(r)?n&&a?l[r]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(l[r]=n):"style"===r?l[r]={...n,...a}:"className"===r&&(l[r]=[n,a].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function x(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}h(k,"mergeProps"),h(m,"getElementRef"),h(x,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&b(e._payload)}function b(e){return"object"==typeof e&&null!==e&&"then"in e}h(A,"isLazyComponent"),h(b,"isPromiseLike");var g=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=l(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=u(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?l:t,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=r.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js b/pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js new file mode 100644 index 00000000..81389389 --- /dev/null +++ b/pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1968],{1211:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},1947:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},8266:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},10002:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},28296:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},29724:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]])},29902:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,a)=>{a.d(t,{UC:()=>z,B8:()=>I,bL:()=>O,l9:()=>q});var n=a(29320),r=a(62315),i=a(65335),d=a(23566),o=a(36103),l=a(96886),c=e=>{let{present:t,children:a}=e,r=function(e){var t,a;let[r,i]=n.useState(),d=n.useRef({}),o=n.useRef(e),c=n.useRef("none"),[u,y]=(t=e?"mounted":"unmounted",a={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=a[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=s(d.current);c.current="mounted"===u?e:"none"},[u]),(0,l.N)(()=>{let t=d.current,a=o.current;if(a!==e){let n=c.current,r=s(t);e?y("MOUNT"):"none"===r||(null==t?void 0:t.display)==="none"?y("UNMOUNT"):a&&n!==r?y("ANIMATION_OUT"):y("UNMOUNT"),o.current=e}},[e,y]),(0,l.N)(()=>{if(r){var e;let t,a=null!=(e=r.ownerDocument.defaultView)?e:window,n=e=>{let n=s(d.current).includes(e.animationName);if(e.target===r&&n&&(y("ANIMATION_END"),!o.current)){let e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=a.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},i=e=>{e.target===r&&(c.current=s(d.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{a.clearTimeout(t),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}y("ANIMATION_END")},[r,y]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:n.useCallback(e=>{e&&(d.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof a?a({present:r.isPresent}):n.Children.only(a),d=(0,o.s)(r.ref,function(e){var t,a;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(r=(n=null==(a=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:a.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof a||r.isPresent?n.cloneElement(i,{ref:d}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var u=a(12377),y=a(97645),h=a(82275),p=a(29203),f=a(26276),k="Tabs",[v,m]=(0,i.A)(k,[d.RG]),A=(0,d.RG)(),[M,b]=v(k),x=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:d,orientation:o="horizontal",dir:l,activationMode:c="automatic",...s}=e,k=(0,y.jH)(l),[v,m]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,h.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,o=d?e:r,l=(0,h.c)(a);return[o,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&l(a)}else i(t)},[d,e,i,l])]}({prop:r,onChange:i,defaultProp:d});return(0,f.jsx)(M,{scope:a,baseId:(0,p.B)(),value:v,onValueChange:m,orientation:o,dir:k,activationMode:c,children:(0,f.jsx)(u.sG.div,{dir:k,"data-orientation":o,...s,ref:t})})});x.displayName=k;var w="TabsList",g=n.forwardRef((e,t)=>{let{__scopeTabs:a,loop:n=!0,...r}=e,i=b(w,a),o=A(a);return(0,f.jsx)(d.bL,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:(0,f.jsx)(u.sG.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});g.displayName=w;var N="TabsTrigger",C=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,disabled:i=!1,...o}=e,l=b(N,a),c=A(a),s=T(l.baseId,n),y=E(l.baseId,n),h=n===l.value;return(0,f.jsx)(d.q7,{asChild:!0,...c,focusable:!i,active:h,children:(0,f.jsx)(u.sG.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":y,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:s,...o,ref:t,onMouseDown:(0,r.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():l.onValueChange(n)}),onKeyDown:(0,r.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&l.onValueChange(n)}),onFocus:(0,r.m)(e.onFocus,()=>{let e="manual"!==l.activationMode;h||i||!e||l.onValueChange(n)})})})});C.displayName=N;var R="TabsContent",j=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,forceMount:i,children:d,...o}=e,l=b(R,a),s=T(l.baseId,r),y=E(l.baseId,r),h=r===l.value,p=n.useRef(h);return n.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(c,{present:i||h,children:a=>{let{present:n}=a;return(0,f.jsx)(u.sG.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":s,hidden:!n,id:y,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:n&&d})}})});function T(e,t){return"".concat(e,"-trigger-").concat(t)}function E(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=R;var O=x,I=g,q=C,z=j},37995:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43036:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},46319:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},50123:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},51203:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},56753:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,a)=>{a.d(t,{bL:()=>x,zi:()=>w});var n=a(29320),r=a(62315),i=a(36103),d=a(65335),o=a(82275),l=a(79225),c=a(96886),s=a(12377),u=a(26276),y="Switch",[h,p]=(0,d.A)(y),[f,k]=h(y),v=n.forwardRef((e,t)=>{let{__scopeSwitch:a,name:d,checked:l,defaultChecked:c,required:y,disabled:h,value:p="on",onCheckedChange:k,form:v,...m}=e,[A,x]=n.useState(null),w=(0,i.s)(t,e=>x(e)),g=n.useRef(!1),N=!A||v||!!A.closest("form"),[C=!1,R]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,o.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,l=d?e:r,c=(0,o.c)(a);return[l,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&c(a)}else i(t)},[d,e,i,c])]}({prop:l,defaultProp:c,onChange:k});return(0,u.jsxs)(f,{scope:a,checked:C,disabled:h,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":C,"aria-required":y,"data-state":b(C),"data-disabled":h?"":void 0,disabled:h,value:p,...m,ref:w,onClick:(0,r.m)(e.onClick,e=>{R(e=>!e),N&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),N&&(0,u.jsx)(M,{control:A,bubbles:!g.current,name:d,value:p,checked:C,required:y,disabled:h,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=y;var m="SwitchThumb",A=n.forwardRef((e,t)=>{let{__scopeSwitch:a,...n}=e,r=k(m,a);return(0,u.jsx)(s.sG.span,{"data-state":b(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});A.displayName=m;var M=e=>{let{control:t,checked:a,bubbles:r=!0,...i}=e,d=n.useRef(null),o=(0,l.Z)(a),s=function(e){let[t,a]=n.useState(void 0);return(0,c.N)(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,r;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,r=t.blockSize}else n=e.offsetWidth,r=e.offsetHeight;a({width:n,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}a(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=d.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==a&&t){let n=new Event("click",{bubbles:r});t.call(e,a),e.dispatchEvent(n)}},[o,a,r]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:d,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function b(e){return e?"checked":"unchecked"}var x=v,w=A},64761:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js b/pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js deleted file mode 100644 index 18468c2a..00000000 --- a/pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2008],{6191:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},14639:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])},20562:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},35626:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},43465:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,n)=>{n.d(t,{b:()=>C});var r=n(12115),a=n.t(r,2),o=n(47650),i=Object.defineProperty,l=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let n=!1,r=e.map(e=>{let r=d(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,n)=>{let{children:a,...o}=t,i=null,l=!1,d=[];k(a)&&"function"==typeof M&&(a=M(a._payload)),r.Children.forEach(a,e=>{if(b(e)){l=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof M&&(t=M(t._payload)),i=h(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=r.cloneElement(i,void 0,d):!l&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let u=i?v(i):void 0,s=c(n,u);if(!i){if(a||0===a)throw Error(l?w(e):x(e));return a}let p=m(o,i.props??{});return i.type!==r.Fragment&&(p.ref=n?s:u),r.cloneElement(i,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let n={...t};for(let r in t){let a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(m,"mergeProps"),p(v,"getElementRef"),p(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}p(k,"isLazyComponent"),p(A,"isPromiseLike");var x=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=a[" use ".trim().toString()],N=n(95155),E=Object.defineProperty,R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,N.jsx)(a?n:t,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});E(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,C=r.forwardRef(j(function(e,t){return(0,N.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52987:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},60356:(e,t,n)=>{n.d(t,{UC:()=>I,B8:()=>T,bL:()=>S,l9:()=>D});var r=n(12115),a=n(92556),o=n(3468),i=n(29525),l=n(94446),d=n(4129),u=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,o]=r.useState(),i=r.useRef({}),l=r.useRef(e),u=r.useRef("none"),[s,p]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=c(i.current);u.current="mounted"===s?e:"none"},[s]),(0,d.N)(()=>{let t=i.current,n=l.current;if(n!==e){let r=u.current,a=c(t);e?p("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):n&&r!==a?p("ANIMATION_OUT"):p("UNMOUNT"),l.current=e}},[e,p]),(0,d.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=c(i.current).includes(e.animationName);if(e.target===a&&r&&(p("ANIMATION_END"),!l.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},o=e=>{e.target===a&&(u.current=c(i.current))};return a.addEventListener("animationstart",o),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",o),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{e&&(i.current=getComputedStyle(e)),o(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),i=(0,l.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:i}):null};function c(e){return(null==e?void 0:e.animationName)||"none"}u.displayName="Presence";var s=n(97602),p=n(66218),f=n(70222),y=n(68946),h=n(95155),m="Tabs",[v,b]=(0,o.A)(m,[i.RG]),g=(0,i.RG)(),[k,A]=v(m),x=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:d,activationMode:u="automatic",...c}=e,m=(0,p.jH)(d),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),i=(0,f.c)(t);return r.useEffect(()=>{o.current!==a&&(i(a),o.current=a)},[a,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,l=i?e:a,d=(0,f.c)(n);return[l,r.useCallback(t=>{if(i){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else o(t)},[i,e,o,d])]}({prop:a,onChange:o,defaultProp:i});return(0,h.jsx)(k,{scope:n,baseId:(0,y.B)(),value:v,onValueChange:b,orientation:l,dir:m,activationMode:u,children:(0,h.jsx)(s.sG.div,{dir:m,"data-orientation":l,...c,ref:t})})});x.displayName=m;var w="TabsList",M=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=A(w,n),l=g(n);return(0,h.jsx)(i.bL,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:(0,h.jsx)(s.sG.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});M.displayName=w;var N="TabsTrigger",E=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,d=A(N,n),u=g(n),c=C(d.baseId,r),p=O(d.baseId,r),f=r===d.value;return(0,h.jsx)(i.q7,{asChild:!0,...u,focusable:!o,active:f,children:(0,h.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...l,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;f||o||!e||d.onValueChange(r)})})})});E.displayName=N;var R="TabsContent",j=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:i,...l}=e,d=A(R,n),c=C(d.baseId,a),p=O(d.baseId,a),f=a===d.value,y=r.useRef(f);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,h.jsx)(u,{present:o||f,children:n=>{let{present:r}=n;return(0,h.jsx)(s.sG.div,{"data-state":f?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":c,hidden:!r,id:p,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&i})}})});function C(e,t){return"".concat(e,"-trigger-").concat(t)}function O(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=R;var S=x,T=M,D=E,I=j},71360:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},71613:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]])},74054:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},86651:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},90368:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},93499:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},99051:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js b/pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js deleted file mode 100644 index d1fb15d0..00000000 --- a/pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2074],{6132:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},20639:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},23327:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},27937:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>C});var n=r(12115),l=r.t(n,2),o=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tf(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:l,...o}=t,a=null,i=!1,c=[];g(l)&&"function"==typeof S&&(l=S(l._payload)),n.Children.forEach(l,e=>{if(k(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof S&&(t=S(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=n.cloneElement(a,void 0,c):!i&&1===n.Children.count(l)&&n.isValidElement(l)&&(a=l);let d=a?m(a):void 0,f=s(r,d);if(!a){if(l||0===l)throw Error(i?w(e):x(e));return l}let u=b(o,a.props??{});return a.type!==n.Fragment&&(u.ref=r?f:d),n.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}u(p,"createSlot");var y=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}u(b,"mergeProps"),u(m,"getElementRef"),u(k,"isSlottable");var v=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}u(g,"isLazyComponent"),u(A,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=l[" use ".trim().toString()],E=r(95155),R=Object.defineProperty,M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),l=n.forwardRef((e,n)=>{let{asChild:l,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(l?r:t,{...o,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});R(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,C=n.forwardRef(j(function(e,t){return(0,E.jsx)(M.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},55867:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},57828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},65229:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},70532:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var n=r(12115),l=r(92556),o=r(94446),a=r(3468),i=r(70222),c=r(78108),d=r(4129),s=r(97602),f=r(95155),u="Switch",[p,y]=(0,a.A)(u),[h,b]=p(u),m=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:a,checked:c,defaultChecked:d,required:u,disabled:p,value:y="on",onCheckedChange:b,form:m,...k}=e,[v,x]=n.useState(null),w=(0,o.s)(t,e=>x(e)),S=n.useRef(!1),E=!v||m||!!v.closest("form"),[R=!1,M]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[l,o]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[l]=r,o=n.useRef(l),a=(0,i.c)(t);return n.useEffect(()=>{o.current!==l&&(a(l),o.current=l)},[l,o,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,c=a?e:l,d=(0,i.c)(r);return[c,n.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else o(t)},[a,e,o,d])]}({prop:c,defaultProp:d,onChange:b});return(0,f.jsxs)(h,{scope:r,checked:R,disabled:p,children:[(0,f.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":R,"aria-required":u,"data-state":A(R),"data-disabled":p?"":void 0,disabled:p,value:y,...k,ref:w,onClick:(0,l.m)(e.onClick,e=>{M(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,f.jsx)(g,{control:v,bubbles:!S.current,name:a,value:y,checked:R,required:u,disabled:p,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=u;var k="SwitchThumb",v=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,l=b(k,r);return(0,f.jsx)(s.sG.span,{"data-state":A(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:t})});v.displayName=k;var g=e=>{let{control:t,checked:r,bubbles:l=!0,...o}=e,a=n.useRef(null),i=(0,c.Z)(r),s=function(e){let[t,r]=n.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,l;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,l=t.blockSize}else n=e.offsetWidth,l=e.offsetHeight;r({width:n,height:l})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=a.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(i!==r&&t){let n=new Event("click",{bubbles:l});t.call(e,r),e.dispatchEvent(n)}},[i,r,l]),(0,f.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:a,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var x=m,w=v}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js b/pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js deleted file mode 100644 index 0aee3ff9..00000000 --- a/pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2092],{16981:(e,s,t)=>{t.d(s,{D:()=>r});var a=t(95155),n=t(90235),l=t(25016);function r(e){let{label:s,htmlFor:t,help:r,error:i,optional:d,children:o,className:c}=e;return(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",c),children:[(0,a.jsxs)(n.J,{htmlFor:t,className:"text-sm font-medium",children:[s,d&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,a.jsx)("p",{className:"text-destructive text-xs",children:i}):r?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:r}):null]})}},23327:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},47507:(e,s,t)=>{t.d(s,{TR:()=>h,bq:()=>x,eb:()=>p,gC:()=>m,l6:()=>o,s3:()=>c,yv:()=>u});var a=t(95155);t(12115);var n=t(95435),l=t(24033),r=t(5917),i=t(12108),d=t(25016);function o(e){let{...s}=e;return(0,a.jsx)(n.bL,{"data-slot":"select",...s})}function c(e){let{...s}=e;return(0,a.jsx)(n.YJ,{"data-slot":"select-group",...s})}function u(e){let{...s}=e;return(0,a.jsx)(n.WT,{"data-slot":"select-value",...s})}function x(e){let{className:s,size:t="default",children:r,...i}=e;return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...i,children:[r,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(l.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:s,children:t,position:l="popper",...r}=e;return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:l,...r,children:[(0,a.jsx)(f,{}),(0,a.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,a.jsx)(g,{})]})})}function h(e){let{className:s,...t}=e;return(0,a.jsx)(n.JU,{"data-slot":"select-label",className:(0,d.cn)("text-muted-foreground px-2 py-1.5 text-xs",s),...t})}function p(e){let{className:s,children:t,...l}=e;return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",s),...l,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(r.A,{className:"size-4"})})}),(0,a.jsx)(n.p4,{children:t})]})}function f(e){let{className:s,...t}=e;return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...t,children:(0,a.jsx)(i.A,{className:"size-4"})})}function g(e){let{className:s,...t}=e;return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...t,children:(0,a.jsx)(l.A,{className:"size-4"})})}},60495:(e,s,t)=>{t.d(s,{LY:()=>u,O6:()=>d,_y:()=>o,fP:()=>c});var a=t(95155),n=t(65229),l=t(6191),r=t(97003),i=t(33789);function d(e){return Object.entries(null!=e?e:{}).map(e=>{let[s,t]=e;return{key:s,value:t}})}function o(e){let s={};for(let t of e)t.key.trim()&&(s[t.key.trim()]=t.value);return Object.keys(s).length?s:void 0}function c(e){let{rows:s,onChange:t,keyPlaceholder:d="Key",valuePlaceholder:o="Value",addLabel:c="Add tag",max:u=50}=e,x=(e,a)=>t(s.map((s,t)=>t===e?{...s,...a}:s));return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[s.length>0&&(0,a.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,a.jsx)("span",{children:d}),(0,a.jsx)("span",{children:o})]}),s.map((e,l)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,a.jsx)(i.p,{value:e.key,onChange:e=>x(l,{key:e.target.value}),placeholder:d,className:"h-8"}),(0,a.jsx)(i.p,{value:e.value,onChange:e=>x(l,{value:e.target.value}),placeholder:o,className:"h-8"}),(0,a.jsx)(r.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>t(s.filter((e,s)=>s!==l)),"aria-label":"Remove",children:(0,a.jsx)(n.A,{})})]},l)),(0,a.jsx)("div",{children:(0,a.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",onClick:()=>t([...s,{key:"",value:""}]),disabled:s.length>=u,children:[(0,a.jsx)(l.A,{})," ",c]})})]})}function u(e){let{tags:s}=e,t=Object.entries(null!=s?s:{});return t.length?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map(e=>{let[s,t]=e;return(0,a.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:s}),t&&(0,a.jsxs)("span",{children:["=",t]})]},s)})}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},62325:(e,s,t)=>{t.d(s,{w:()=>l});var a=t(95155),n=t(25016);function l(e){let{title:s,description:t,actions:l,children:r,className:i,bodyClassName:d,flush:o}=e;return(0,a.jsxs)("section",{className:(0,n.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(s||l)&&(0,a.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[s&&(0,a.jsx)("h2",{className:"text-base font-semibold",children:s}),t&&(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:t})]}),l&&(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:l})]}),(0,a.jsx)("div",{className:(0,n.cn)(!o&&"p-4",d),children:r})]})}},77801:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(71847).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},85450:(e,s,t)=>{t.d(s,{AF:()=>N,Ho:()=>b,Mj:()=>y});var a=t(95155),n=t(52619),l=t.n(n),r=t(12115),i=t(35299),d=t(77801),o=t(23327),c=t(18720),u=t(97003),x=t(54679),m=t(47507),h=t(99116),p=t(62325),f=t(37621),g=t(73697),j=t(41183);let v="__none__";function b(e){let{value:s,onChange:t,id:n,className:l}=e,{data:i,isLoading:d}=(0,g.gf)("".concat(j.mP,"/policies")),[o,c]=(0,r.useMemo)(()=>{let e=[...null!=i?i:[]].sort((e,s)=>e.name.localeCompare(s.name));return[e.filter(e=>e.managed),e.filter(e=>!e.managed)]},[i]);return(0,a.jsxs)(m.l6,{value:s||v,onValueChange:e=>t(e===v?"":e),disabled:d,children:[(0,a.jsx)(m.bq,{id:n,className:null!=l?l:"w-full sm:w-96","aria-label":"Permissions boundary",children:(0,a.jsx)(m.yv,{placeholder:d?"Loading policies...":"No permissions boundary"})}),(0,a.jsxs)(m.gC,{className:"max-h-80",children:[(0,a.jsx)(m.eb,{value:v,children:"No permissions boundary"}),c.length>0&&(0,a.jsxs)(m.s3,{children:[(0,a.jsx)(m.TR,{children:"Customer managed"}),c.map(e=>(0,a.jsx)(m.eb,{value:e.arn,children:e.name},e.arn))]}),(0,a.jsxs)(m.s3,{children:[(0,a.jsx)(m.TR,{children:"AWS managed"}),o.map(e=>(0,a.jsx)(m.eb,{value:e.arn,children:e.name},e.arn))]})]})]})}function y(e){let{kind:s}=e;return(0,a.jsxs)(a.Fragment,{children:["A permissions boundary is a managed policy that sets the maximum permissions the ",s," can have. The ",s,"'s effective permissions are the ones allowed by both its policies and the boundary."]})}function N(e){var s;let{kind:t,arn:n,onSet:x,readOnlyNote:m}=e,v=(0,g.gf)(n?"".concat(j.mP,"/policies"):null),b=n?(null!=(s=v.data)?s:[]).find(e=>e.arn===n):void 0,N=!!n&&!!v.data&&!b,[k,C]=(0,r.useState)(!1),[z,_]=(0,r.useState)(!1),A=async()=>{if(x){_(!0);try{await x(""),c.oR.success("Permissions boundary removed")}catch(e){c.oR.error((0,f.gJ)(e))}finally{_(!1)}}};return(0,a.jsxs)(p.w,{title:"Permissions boundary",description:(0,a.jsx)(y,{kind:t}),actions:x?(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsxs)(u.$,{size:"sm",variant:"outline",onClick:A,disabled:z,children:[z&&(0,a.jsx)(i.A,{className:"animate-spin"})," Remove boundary"]}),(0,a.jsx)(u.$,{size:"sm",variant:"outline",onClick:()=>C(!0),children:n?"Change boundary":"Set boundary"})]}):void 0,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(d.A,{className:"size-4 shrink-0 text-amber-600 dark:text-amber-400"}),(0,a.jsx)(l(),{href:(0,j.Wr)((0,j.xx)(n)),className:j.ps,children:(0,j.xx)(n)}),b&&(0,a.jsx)(j.MQ,{managed:b.managed})]}),(0,a.jsx)(h.xh,{value:n,className:"text-[13px]"}),N&&(0,a.jsxs)("p",{className:"text-destructive text-xs",children:["The boundary policy no longer exists, so it allows nothing: the ",t," has no effective permissions."]})]}):(0,a.jsx)("p",{className:"text-muted-foreground",children:"Permissions boundary is not set."}),!x&&m&&(0,a.jsxs)("p",{className:"text-muted-foreground flex items-start gap-2 text-xs",children:[(0,a.jsx)(o.A,{className:"mt-0.5 size-3.5 shrink-0"})," ",m]})]}),x&&(0,a.jsx)(w,{open:k,onOpenChange:C,kind:t,current:null!=n?n:"",onSet:x})]})}function w(e){let{open:s,onOpenChange:t,kind:n,current:l,onSet:d}=e,[o,m]=(0,r.useState)(l),[h,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{s&&m(l)},[s,l]);let g=async()=>{p(!0);try{await d(o),c.oR.success(o?"Permissions boundary set":"Permissions boundary removed"),t(!1)}catch(e){c.oR.error((0,f.gJ)(e))}finally{p(!1)}};return(0,a.jsx)(x.lG,{open:s,onOpenChange:e=>!h&&t(e),children:(0,a.jsxs)(x.Cf,{children:[(0,a.jsxs)(x.c7,{children:[(0,a.jsx)(x.L3,{children:"Set permissions boundary"}),(0,a.jsx)(x.rr,{children:(0,a.jsx)(y,{kind:n})})]}),(0,a.jsx)(b,{value:o,onChange:m,className:"w-full"}),(0,a.jsxs)(x.Es,{children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>t(!1),disabled:h,children:"Cancel"}),(0,a.jsxs)(u.$,{onClick:g,disabled:h||o===l,children:[h&&(0,a.jsx)(i.A,{className:"animate-spin"})," Set boundary"]})]})]})})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2112-41340fe381241d76.js b/pages/demo/_next/static/chunks/2112-41340fe381241d76.js deleted file mode 100644 index a8e13818..00000000 --- a/pages/demo/_next/static/chunks/2112-41340fe381241d76.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2112],{1253:(e,t,a)=>{a.d(t,{W:()=>m});var n=a(95155),r=a(12115),s=a(20063),l=a(18720),i=a(84916),o=a(86233),c=a(37621),d=a(7e3),u=a(73697),p=a(62307);function m(e){let{zone:t,onClose:a,redirect:m}=e,h=(0,s.useRouter)(),[x,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>f(!1),[t]);let g=t?(0,p.LK)(t.name):"",v=!!t&&t.records>0;return(0,n.jsx)(o.T,{open:!!t,onOpenChange:e=>!e&&a(),title:"Delete hosted zone ".concat(g),confirmText:g,description:(0,n.jsxs)("p",{children:["The zone stops answering immediately. Clients that cached its records keep them until their TTL expires.",!v&&" The zone has no records besides the generated SOA and NS."]}),onConfirm:async()=>{if(t){if(v&&!x)throw Error("Confirm that the ".concat((0,d.td)(t.records,"record")," in the zone should be deleted too"));await c.FH.del("".concat(p.EK,"/").concat((0,c.aJ)(t.id)),v?{force:!0}:void 0),l.oR.success("Deleted hosted zone ".concat(g)),m&&h.push("/route53/"),await (0,u.Yi)(p.fD)}},children:v&&(0,n.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-amber-600/30 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-400/30 dark:bg-amber-500/10 dark:text-amber-300",children:[(0,n.jsx)(i.S,{className:"mt-0.5",checked:x,onCheckedChange:e=>f(!!e)}),(0,n.jsxs)("span",{children:["Also delete the ",(0,d.td)(t.records,"record")," in this zone (force delete)."]})]})})}},11723:(e,t,a)=>{a.d(t,{f:()=>i});var n=a(95155),r=a(82180),s=a(7e3),l=a(73697);function i(e){let{value:t,className:a}=e,i=(0,l.cB)(3e4);return t?(0,n.jsxs)(r.m_,{children:[(0,n.jsx)(r.k$,{asChild:!0,children:(0,n.jsx)("span",{className:null!=a?a:"whitespace-nowrap",children:(0,s.fF)(t,i)})}),(0,n.jsx)(r.ZI,{children:(0,s.Yq)(t)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}},16981:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(95155),r=a(90235),s=a(25016);function l(e){let{label:t,htmlFor:a,help:l,error:i,optional:o,children:c,className:d}=e;return(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",d),children:[(0,n.jsxs)(r.J,{htmlFor:a,className:"text-sm font-medium",children:[t,o&&(0,n.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,i?(0,n.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},62307:(e,t,a)=>{a.d(t,{EK:()=>p,Kt:()=>z,LK:()=>h,Pi:()=>x,T0:()=>y,WF:()=>N,Wn:()=>m,Y8:()=>v,ao:()=>j,c4:()=>b,c8:()=>T,fD:()=>u,in:()=>g,oY:()=>A,pG:()=>w});var n=a(95155),r=a(52619),s=a.n(r),l=a(99708),i=a(39068),o=a(10253),c=a(25016),d=a(73697);let u="/api/v1/route53",p="".concat(u,"/zones"),m=e=>"/route53/zone/?id=".concat(encodeURIComponent(e)),h=e=>e.replace(/\.$/,"");function x(){return(0,d.gf)(p,{refreshInterval:3e4})}let f=/^([a-zA-Z0-9_]([a-zA-Z0-9_-]{0,61}[a-zA-Z0-9_])?\.)+$/;function g(e){let t=e.trim().toLowerCase();return t?(t.endsWith(".")||(t+="."),!f.test(t)||t.length>254)?"Use labels of letters, digits, hyphens and underscores separated by dots, e.g. example.internal":null:"Enter a domain name"}function v(e,t){return e&&"@"!==e?e.endsWith(".")?e:"".concat(e,".").endsWith(t)?"".concat(e,"."):"".concat(e,".").concat(t):t}let b=["A","AAAA","CNAME","TXT","MX","SRV","NS","CAA","PTR"],N={A:{placeholder:"192.168.1.20",help:"IPv4 addresses, one per line."},AAAA:{placeholder:"fd00::20",help:"IPv6 addresses, one per line."},CNAME:{placeholder:"www.example.com.",help:"Exactly one domain name. A CNAME cannot share its name with other records or sit at the zone apex."},TXT:{placeholder:"v=spf1 -all",help:"One string per line, up to 255 characters each. Quotes are added for you."},MX:{placeholder:"10 mail.example.com.",help:"Priority and mail server, one per line."},SRV:{placeholder:"10 5 5060 sip.example.com.",help:"Priority, weight, port and target, one per line."},NS:{placeholder:"ns1.example.com.",help:"Name servers for a delegated subdomain, one per line."},CAA:{placeholder:'0 issue "letsencrypt.org"',help:"Flags, tag and value, one per line."},PTR:{placeholder:"host.example.com.",help:"Domain names, one per line (reverse DNS)."}},k=/^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/;function j(e,t){if(/[\n\r;]/.test(t))return"Values may not contain semicolons";switch(e){case"A":return k.test(t)?null:"".concat(t," is not an IPv4 address");case"AAAA":return!function(e){if(!e.includes(":")||k.test(e))return!1;try{return new URL("http://[".concat(e,"]/")),!0}catch(e){return!1}}(t)?"".concat(t," is not an IPv6 address"):null;case"CNAME":case"NS":case"PTR":return f.test("".concat(t.replace(/\.$/,""),"."))?null:"".concat(t," is not a domain name");case"TXT":return t.length>255?"TXT strings are at most 255 characters":null;case"MX":return/^\d+\s+\S+$/.test(t)?null:"Use the form: priority mail-server";case"SRV":return/^\d+\s+\d+\s+\d+\s+\S+$/.test(t)?null:"Use the form: priority weight port target";case"CAA":return/^\d+\s+[a-zA-Z0-9]+\s+\S.*$/.test(t)?null:'Use the form: flags tag "value"'}return null}function y(e,t){let a=e.trim().toLowerCase();if(!a||"@"===a)return null;let n=v(a,t);return n.endsWith(t)?f.test(n.replace(/^\*\./,""))?null:"Use letters, digits, hyphens and underscores; a leading * is a wildcard":"The name must be inside ".concat(h(t))}function A(e){let{isPrivate:t,className:a}=e,r=t?l.A:i.A;return(0,n.jsxs)("span",{className:(0,c.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",t?"bg-slate-100 text-slate-700 ring-slate-500/20 dark:bg-slate-500/15 dark:text-slate-300 dark:ring-slate-400/20":"bg-violet-50 text-violet-700 ring-violet-600/20 dark:bg-violet-500/10 dark:text-violet-300 dark:ring-violet-400/20",a),children:[(0,n.jsx)(r,{className:"size-3"})," ",t?"Private":"Public"]})}let C={instance:"EC2 instance",task:"ECS task",database:"Database","load-balancer":"Load balancer"},w=e=>C[e];function T(){var e,t,a,n;let r=!(arguments.length>0)||void 0===arguments[0]||arguments[0],s=(0,d.gf)(r?"/api/v1/ec2/instances":null,{refreshInterval:3e4}),l=(0,d.gf)(r?"/api/v1/ecs/tasks":null,{refreshInterval:3e4}),i=(0,d.gf)(r?"/api/v1/rds/instances":null,{refreshInterval:3e4}),c=(0,d.gf)(r?"/api/v1/elb/load-balancers":null,{refreshInterval:3e4}),u=[];for(let t of null!=(e=s.data)?e:[])"terminated"!==t.state&&u.push({id:t.id,kind:"instance",label:t.name?"".concat(t.name," (").concat(t.id,")"):t.id,detail:"".concat(t.state).concat(t.private_ip?" \xb7 ".concat(t.private_ip):""),href:"/ec2/instance/?id=".concat(encodeURIComponent(t.id)),live:"running"===t.state||"pending"===t.state});for(let e of null!=(t=l.data)?t:[])"STOPPED"!==e.last_status&&u.push({id:e.id,kind:"task",label:"".concat(e.id.slice(0,12)).concat(e.service?" (".concat(e.service,")"):""),detail:"".concat(e.last_status).concat(e.private_ip?" \xb7 ".concat(e.private_ip):""),href:"/ecs/task/?id=".concat(encodeURIComponent(e.id)),live:"RUNNING"===e.last_status});for(let e of null!=(a=i.data)?a:[])u.push({id:e.id,kind:"database",label:e.id,detail:"".concat(e.engine," \xb7 ").concat(e.status),href:(0,o.YW)(e.kind,e.id),live:"stopped"!==e.status&&"failed"!==e.status&&"deleting"!==e.status});for(let e of null!=(n=c.data)?n:[])u.push({id:e.name,kind:"load-balancer",label:e.name,detail:"".concat(e.scheme," \xb7 ").concat(e.private_ip||e.state),href:"/elb/load-balancer/?name=".concat(encodeURIComponent(e.name)),live:!!e.private_ip});return{targets:u,loading:!s.data||!l.data||!i.data||!c.data}}function z(e){let{alias:t,targets:a,loading:r}=e,l=a.find(e=>e.id===t);return l?(0,n.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:w(l.kind)}),(0,n.jsx)(s(),{href:l.href,className:"text-primary font-mono text-[13px] hover:underline",onClick:e=>e.stopPropagation(),children:"task"===l.kind?l.id.slice(0,12):l.id}),!l.live&&(0,n.jsx)("span",{className:"text-xs text-amber-700 dark:text-amber-400",children:"(not running: no answer)"})]}):(0,n.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,n.jsx)("span",{className:"font-mono text-[13px]",children:t}),!r&&(0,n.jsx)("span",{className:"text-destructive text-xs",children:"(not found: no answer)"})]})}},67001:(e,t,a)=>{a.d(t,{T:()=>s});var n=a(95155);a(12115);var r=a(25016);function s(e){let{className:t,...a}=e;return(0,n.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},90235:(e,t,a)=>{a.d(t,{J:()=>c});var n=a(95155),r=a(12115),s=a(43991),l=a(83101),i=a(25016);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(s.b,{ref:t,className:(0,i.cn)(o(),a),...r})});c.displayName=s.b.displayName},99116:(e,t,a)=>{a.d(t,{Dk:()=>u,i8:()=>p,xh:()=>m});var n=a(95155),r=a(12115),s=a(5917),l=a(75426),i=a(18720),o=a(97003),c=a(82180),d=a(25016);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(n){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let a=document.execCommand("copy");return document.body.removeChild(t),a}}function p(e){let{value:t,label:a,className:p,size:m="icon",toastMessage:h}=e,[x,f]=(0,r.useState)(!1),g=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(f(!0),h&&i.oR.success(h),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},v=x?s.A:l.A;return"sm"===m?(0,n.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:g,className:p,children:[(0,n.jsx)(v,{className:(0,d.cn)(x&&"text-emerald-600")}),null!=a?a:"Copy"]}):(0,n.jsxs)(c.m_,{children:[(0,n.jsx)(c.k$,{asChild:!0,children:(0,n.jsx)("button",{type:"button",onClick:g,"aria-label":null!=a?a:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",p),children:(0,n.jsx)(v,{className:(0,d.cn)("size-3.5",x&&"text-emerald-600")})})}),(0,n.jsx)(c.ZI,{children:x?"Copied":null!=a?a:"Copy"})]})}function m(e){let{value:t,mono:a=!0,className:r,display:s}=e;return t?(0,n.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",r),children:[(0,n.jsx)("span",{className:(0,d.cn)("truncate",a&&"font-mono text-[0.8125rem]"),title:t,children:null!=s?s:t}),(0,n.jsx)(p,{value:t})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2151-f6771539118eac7c.js b/pages/demo/_next/static/chunks/2151-f6771539118eac7c.js deleted file mode 100644 index 7038773d..00000000 --- a/pages/demo/_next/static/chunks/2151-f6771539118eac7c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2151],{5379:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>d});var l=r(12115),n=(e,t,r,l,n,o,a,i)=>{let c=document.documentElement,s=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,l=r&&o?n.map(e=>o[e]||e):n;r?(c.classList.remove(...l),c.classList.add(o&&o[t]?o[t]:t)):c.setAttribute(e,t)}),r=t,i&&s.includes(r)&&(c.style.colorScheme=r)}if(l)d(l);else try{let e=localStorage.getItem(t)||r,l=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(l)}catch(e){}},o=["light","dark"],a="(prefers-color-scheme: dark)",i=l.createContext(void 0),c={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=l.useContext(i))?e:c},d=e=>l.useContext(i)?l.createElement(l.Fragment,null,e.children):l.createElement(m,{...e}),u=["light","dark"],m=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:n=!0,enableColorScheme:c=!0,storageKey:s="theme",themes:d=u,defaultTheme:m=n?"system":"light",attribute:b="data-theme",value:v,children:g,nonce:k,scriptProps:x}=e,[S,w]=l.useState(()=>y(s,m)),[E,A]=l.useState(()=>"system"===S?h():S),C=v?Object.values(v):d,M=l.useCallback(e=>{let t=e;if(!t)return;"system"===e&&n&&(t=h());let l=v?v[t]:t,a=r?p(k):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...C),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(b)?b.forEach(s):s(b),c){let e=o.includes(m)?m:null,r=o.includes(t)?t:e;i.style.colorScheme=r}null==a||a()},[k]),R=l.useCallback(e=>{let t="function"==typeof e?e(S):e;w(t);try{localStorage.setItem(s,t)}catch(e){}},[S]),j=l.useCallback(e=>{A(h(e)),"system"===S&&n&&!t&&M("system")},[S,t]);l.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(j),j(e),()=>e.removeListener(j)},[j]),l.useEffect(()=>{let e=e=>{e.key===s&&(e.newValue?w(e.newValue):R(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[R]),l.useEffect(()=>{M(null!=t?t:S)},[t,S]);let P=l.useMemo(()=>({theme:S,setTheme:R,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:n?[...d,"system"]:d,systemTheme:n?E:void 0}),[S,R,t,E,n,d]);return l.createElement(i.Provider,{value:P},l.createElement(f,{forcedTheme:t,storageKey:s,attribute:b,enableSystem:n,enableColorScheme:c,defaultTheme:m,value:v,themes:d,nonce:k,scriptProps:x}),g)},f=l.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:o,enableSystem:a,enableColorScheme:i,defaultTheme:c,value:s,themes:d,nonce:u,scriptProps:m}=e,f=JSON.stringify([o,r,c,t,d,s,a,i]).slice(1,-1);return l.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(n.toString(),")(").concat(f,")")}})}),y=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},p=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},6132:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9540:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},20508:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},32320:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},37494:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>j});var l=r(12115),n=r.t(l,2),o=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function s(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...o}=t,a=null,i=!1,c=[];k(n)&&"function"==typeof E&&(n=E(n._payload)),l.Children.forEach(n,e=>{if(v(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof E&&(t=E(t._payload)),a=p(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=l.cloneElement(a,void 0,c):!i&&1===l.Children.count(n)&&l.isValidElement(n)&&(a=n);let s=a?b(a):void 0,u=d(r,s);if(!a){if(n||0===n)throw Error(i?w(e):S(e));return n}let m=h(o,a.props??{});return a.type!==l.Fragment&&(m.ref=r?u:s),l.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}m(f,"createSlot");var y=Symbol.for("radix.slottable");m(function(e){let t=m(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var p=m((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let r={...t};for(let l in t){let n=e[l],o=t[l];/^on[A-Z]/.test(l)?n&&o?r[l]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...o}:"className"===l&&(r[l]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}m(h,"mergeProps"),m(b,"getElementRef"),m(v,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}m(k,"isLazyComponent"),m(x,"isPromiseLike");var S=m(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=m(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),E=n[" use ".trim().toString()],A=r(95155),C=Object.defineProperty,M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,A.jsx)(n?r:t,{...o,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});C(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=l.forwardRef(R(function(e,t){return(0,A.jsx)(M.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},59427:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},66218:(e,t,r)=>{r.d(t,{jH:()=>o});var l=r(12115);r(95155);var n=l.createContext(void 0);function o(e){let t=l.useContext(n);return e||t||"ltr"}},84926:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},86651:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},88167:(e,t,r)=>{r.d(t,{N:()=>c});var l=r(12115),n=r(3468),o=r(94446),a=r(32467),i=r(95155);function c(e){let t=e+"CollectionProvider",[r,c]=(0,n.A)(t),[s,d]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:r}=e,n=l.useRef(null),o=l.useRef(new Map).current;return(0,i.jsx)(s,{scope:t,itemMap:o,collectionRef:n,children:r})};u.displayName=t;let m=e+"CollectionSlot",f=l.forwardRef((e,t)=>{let{scope:r,children:l}=e,n=d(m,r),c=(0,o.s)(t,n.collectionRef);return(0,i.jsx)(a.DX,{ref:c,children:l})});f.displayName=m;let y=e+"CollectionItemSlot",p="data-radix-collection-item",h=l.forwardRef((e,t)=>{let{scope:r,children:n,...c}=e,s=l.useRef(null),u=(0,o.s)(t,s),m=d(y,r);return l.useEffect(()=>(m.itemMap.set(s,{ref:s,...c}),()=>void m.itemMap.delete(s))),(0,i.jsx)(a.DX,{...{[p]:""},ref:u,children:n})});return h.displayName=y,[{Provider:u,Slot:f,ItemSlot:h},function(t){let r=d(e+"CollectionConsumer",t);return l.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(p,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},c]}},91456:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js b/pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js deleted file mode 100644 index 43530778..00000000 --- a/pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2163],{60495:(e,a,t)=>{t.d(a,{LY:()=>m,O6:()=>o,_y:()=>c,fP:()=>d});var l=t(95155),n=t(65229),s=t(6191),r=t(97003),i=t(33789);function o(e){return Object.entries(null!=e?e:{}).map(e=>{let[a,t]=e;return{key:a,value:t}})}function c(e){let a={};for(let t of e)t.key.trim()&&(a[t.key.trim()]=t.value);return Object.keys(a).length?a:void 0}function d(e){let{rows:a,onChange:t,keyPlaceholder:o="Key",valuePlaceholder:c="Value",addLabel:d="Add tag",max:m=50}=e,u=(e,l)=>t(a.map((a,t)=>t===e?{...a,...l}:a));return(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[a.length>0&&(0,l.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,l.jsx)("span",{children:o}),(0,l.jsx)("span",{children:c})]}),a.map((e,s)=>(0,l.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,l.jsx)(i.p,{value:e.key,onChange:e=>u(s,{key:e.target.value}),placeholder:o,className:"h-8"}),(0,l.jsx)(i.p,{value:e.value,onChange:e=>u(s,{value:e.target.value}),placeholder:c,className:"h-8"}),(0,l.jsx)(r.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>t(a.filter((e,a)=>a!==s)),"aria-label":"Remove",children:(0,l.jsx)(n.A,{})})]},s)),(0,l.jsx)("div",{children:(0,l.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",onClick:()=>t([...a,{key:"",value:""}]),disabled:a.length>=m,children:[(0,l.jsx)(s.A,{})," ",d]})})]})}function m(e){let{tags:a}=e,t=Object.entries(null!=a?a:{});return t.length?(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map(e=>{let[a,t]=e;return(0,l.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:a}),t&&(0,l.jsxs)("span",{children:["=",t]})]},a)})}):(0,l.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},68607:(e,a,t)=>{t.d(a,{R:()=>N,i:()=>C});var l=t(95155),n=t(12115),s=t(52619),r=t.n(s),i=t(93499),o=t(35299),c=t(20639),d=t(18720),m=t(97003),u=t(33789),x=t(47507),h=t(99116),p=t(16981),g=t(31629),f=t(62325),j=t(37621),v=t(73697),b=t(10045);let y="/api/v1/ecr/repositories";function N(e){var a,t,s;let{id:o,value:c,onChange:d,invalid:m}=e,h=(0,v.gf)(y,{revalidateOnFocus:!1}),[p,g]=(0,n.useState)(""),f=(0,v.gf)(p?"".concat(y,"/").concat(p.split("/").map(encodeURIComponent).join("/")):null),j=null==(a=h.data)?void 0:a.find(e=>e.name===p),b=(null!=(s=null==(t=f.data)?void 0:t.images)?s:[]).flatMap(e=>{var a;return(null==(a=e.tags)?void 0:a.length)?e.tags.map(e=>{var a;return{uri:"".concat(null!=(a=null==j?void 0:j.uri)?a:"",":").concat(e),label:e}}):[{uri:e.uri,label:e.digest.slice(0,19)}]});return(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,l.jsx)(u.p,{id:o,value:c,onChange:e=>d(e.target.value),placeholder:"localhost:5500/my-repo:latest",className:"max-w-2xl font-mono",spellCheck:!1,"aria-invalid":m}),h.data&&h.data.length>0&&(0,l.jsxs)("div",{className:"flex max-w-2xl flex-col gap-2 sm:flex-row sm:items-center",children:[(0,l.jsx)("span",{className:"text-muted-foreground shrink-0 text-xs",children:"Browse ECR:"}),(0,l.jsxs)(x.l6,{value:p,onValueChange:g,children:[(0,l.jsx)(x.bq,{className:"h-8 w-full min-w-0 sm:w-56","aria-label":"ECR repository",children:(0,l.jsx)(x.yv,{placeholder:"Repository"})}),(0,l.jsx)(x.gC,{children:h.data.map(e=>(0,l.jsx)(x.eb,{value:e.name,children:e.name},e.name))})]}),(0,l.jsxs)(x.l6,{value:b.some(e=>e.uri===c)?c:"",onValueChange:d,disabled:!p||!f.data,children:[(0,l.jsx)(x.bq,{className:"h-8 w-full min-w-0 sm:w-56","aria-label":"Image",children:(0,l.jsx)(x.yv,{placeholder:p&&f.data&&!b.length?"No images":"Image tag"})}),(0,l.jsx)(x.gC,{children:b.map(e=>(0,l.jsx)(x.eb,{value:e.uri,children:e.label},e.uri))})]})]}),h.data&&0===h.data.length&&(0,l.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Push an image to"," ",(0,l.jsxs)(r(),{href:"/ecr/",target:"_blank",className:"text-primary inline-flex items-center gap-0.5 hover:underline",children:["ECR ",(0,l.jsx)(i.A,{className:"size-3"})]})," ","or enter any registry URI the host can pull, e.g. public.ecr.aws/..."]})]})}function C(e){var a,t,s,r,i;let{fn:x}=e,[y,C]=(0,n.useState)(null!=(a=x.image_uri)?a:""),[w,k]=(0,n.useState)(""),[S,z]=(0,n.useState)(""),[R,D]=(0,n.useState)(""),[_,I]=(0,n.useState)(!1),[E,A]=(0,n.useState)(null),F=null!=(t=x.image_config)?t:{},P=async e=>{if(e.preventDefault(),y.trim()){A("image");try{await j.FH.put("".concat((0,b.gQ)(x.name),"/code"),{image_uri:y.trim()}),d.oR.success("Deploying ".concat(y.trim())),await (0,v.Yi)(b.c5)}catch(e){d.oR.error((0,j.gJ)(e))}finally{A(null)}}},$=e=>e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):[],B=async e=>{e.preventDefault(),A("cfg");try{await j.FH.patch((0,b.gQ)(x.name),{image_config:{EntryPoint:$(w),Command:$(S),WorkingDirectory:R.trim()}}),d.oR.success("Saved the image configuration"),await (0,v.Yi)(b.c5),I(!1)}catch(e){d.oR.error((0,j.gJ)(e))}finally{A(null)}};return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(f.w,{title:"Container image",description:"The function runs this image. Deploying pulls the image again, even when the tag is unchanged.",children:(0,l.jsxs)("form",{onSubmit:P,className:"flex flex-col gap-4",children:[(0,l.jsx)(g.v,{columns:2,items:[{label:"Current image URI",value:(0,l.jsx)(h.xh,{value:null!=(s=x.image_uri)?s:""}),wide:!0}]}),(0,l.jsx)(p.D,{label:"Image URI",htmlFor:"img-uri",children:(0,l.jsx)(N,{id:"img-uri",value:y,onChange:C})}),(0,l.jsx)("div",{className:"flex justify-end border-t pt-4",children:(0,l.jsxs)(m.$,{type:"submit",disabled:!!E||!y.trim(),children:["image"===E?(0,l.jsx)(o.A,{className:"animate-spin"}):(0,l.jsx)(c.A,{})," Deploy new image"]})})]})}),(0,l.jsx)(f.w,{title:"Image configuration",description:"Overrides for the image's ENTRYPOINT, CMD and WORKDIR.",actions:!_&&(0,l.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{var e,a,t;k((null!=(e=F.EntryPoint)?e:[]).join(", ")),z((null!=(a=F.Command)?a:[]).join(", ")),D(null!=(t=F.WorkingDirectory)?t:""),I(!0)},children:"Edit"}),children:_?(0,l.jsxs)("form",{onSubmit:B,className:"flex flex-col gap-4",children:[(0,l.jsx)(p.D,{label:"Entrypoint",htmlFor:"img-entry",optional:!0,help:"Comma-separated, e.g. /lambda-entrypoint.sh",children:(0,l.jsx)(u.p,{id:"img-entry",value:w,onChange:e=>k(e.target.value),className:"font-mono"})}),(0,l.jsx)(p.D,{label:"Command",htmlFor:"img-cmd",optional:!0,help:"Comma-separated, e.g. app.handler",children:(0,l.jsx)(u.p,{id:"img-cmd",value:S,onChange:e=>z(e.target.value),className:"font-mono"})}),(0,l.jsx)(p.D,{label:"Working directory",htmlFor:"img-wd",optional:!0,children:(0,l.jsx)(u.p,{id:"img-wd",value:R,onChange:e=>D(e.target.value),className:"font-mono"})}),(0,l.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,l.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>I(!1),disabled:!!E,children:"Cancel"}),(0,l.jsxs)(m.$,{type:"submit",disabled:!!E,children:["cfg"===E&&(0,l.jsx)(o.A,{className:"animate-spin"}),"Save"]})]})]}):(0,l.jsx)(g.v,{columns:3,items:[{label:"Entrypoint",value:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:(null!=(r=F.EntryPoint)?r:[]).join(" ")||"Image default"})},{label:"Command",value:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:(null!=(i=F.Command)?i:[]).join(" ")||"Image default"})},{label:"Working directory",value:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:F.WorkingDirectory||"Image default"})}]})})]})}},82163:(e,a,t)=>{t.d(a,{CreateFunction:()=>P,h:()=>A});var l=t(95155),n=t(12115),s=t(52619),r=t.n(s),i=t(20063),o=t(26617),c=t(16140),d=t(20386),m=t(73366),u=t(21786),x=t(65229),h=t(35299),p=t(20639),g=t(18720),f=t(97003),j=t(33789),v=t(68122),b=t(97438),y=t(16981),N=t(17705),C=t(62325),w=t(60495),k=t(43131),S=t(37621),z=t(7e3),R=t(73697),D=t(25016),_=t(10045),I=t(68607),E=t(4395);function A(e){let a=e.map(e=>e.key.trim()).filter(Boolean);if(new Set(a).size!==a.length)return"Variable names must be unique";if(e.some(e=>!e.key.trim()&&e.value.trim()))return"Every variable with a value needs a name";let t=a.find(e=>!_.Wy.test(e));return t?'"'.concat(t,'" is not a valid name: use letters, digits and underscores, not starting with a digit'):null}function F(e){let{active:a,disabled:t,onClick:n,icon:s,title:r,text:i}=e;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":a,disabled:t,onClick:n,className:(0,D.cn)("flex items-start gap-3 rounded-md border p-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60",a?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,l.jsx)(s,{className:"text-muted-foreground mt-0.5 size-5 shrink-0"}),(0,l.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,l.jsx)("span",{className:"text-sm font-medium",children:r}),(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:i})]})]})}function P(){var e,a,t;let s=(0,i.useRouter)(),P=(0,_.ZO)(),[B,O]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[U,W]=(0,n.useState)("Zip"),[Z,L]=(0,n.useState)(""),[q,Y]=(0,n.useState)(""),[V,H]=(0,n.useState)("x86_64"),[K,J]=(0,n.useState)(""),[Q,X]=(0,n.useState)([]),[G,ee]=(0,n.useState)("template"),[ea,et]=(0,n.useState)(null),[el,en]=(0,n.useState)(""),[es,er]=(0,n.useState)(!1),[ei,eo]=(0,n.useState)("128"),[ec,ed]=(0,n.useState)("3"),[em,eu]=(0,n.useState)([]),[ex,eh]=(0,n.useState)(!1),[ep,eg]=(0,n.useState)(!1),ef=(0,n.useRef)(null);(0,n.useEffect)(()=>{var e,a,t;!q&&(null==(e=P.data)?void 0:e.length)&&Y(null!=(t=null==(a=P.data.find(e=>"python3.12"===e.name))?void 0:a.name)?t:P.data[0].name)},[P.data,q]);let ej=null==(e=P.data)?void 0:e.find(e=>e.name===q),ev=!!(null==ej?void 0:ej.template);(0,n.useEffect)(()=>{ej&&!ej.template&&"template"===G&&ee("zip")},[ej,G]),(0,n.useEffect)(()=>{ej&&(!es||"template"===G)&&en(ej.default_handler)},[ej,es,G]);let eb=Number(ei),ey=Number(ec),eN=(0,n.useMemo)(()=>{let e={};if(_.dF.test(B)||(e.name="1-64 characters: letters, digits, hyphens (-) and underscores (_)"),"Zip"!==U||q||(e.runtime="Choose a runtime"),"Image"!==U||/^\S+$/.test(Z.trim())||(e.image="Enter a container image URI, e.g. localhost:5500/my-repo:latest"),(!Number.isInteger(eb)||eb<128||eb>10240)&&(e.memory="Enter a whole number of MB from 128 to 10240"),(!Number.isInteger(ey)||ey<1||ey>900)&&(e.timeout="Enter a whole number of seconds from 1 to 900"),"Zip"===U&&"zip"===G){ea?ea.size>_.j3&&(e.zip="The package is ".concat((0,z.z3)(ea.size),"; the limit is 50 MB")):e.zip="Choose a .zip file";let a=(0,_.P8)(q,el);a&&(e.handler=a)}let a=A(em);return a&&(e.env=a),e},[B,U,Z,q,eb,ey,G,ea,el,em]),eC=e=>ex||"name"===e&&B?eN[e]:void 0,ew=0===Object.keys(eN).length,ek=async()=>{if(eh(!0),!ew)return void g.oR.error("Fix the highlighted fields before creating the function");eg(!0);try{let e={name:B,description:T.trim()||void 0,memory_mb:eb,timeout_seconds:ey,environment:(0,w._y)(em),architectures:[V],role:K||void 0};"Image"===U?(e.package_type="Image",e.image_uri=Z.trim()):(e.runtime=q,Q.length&&(e.layers=Q),"zip"===G&&ea&&(e.handler=el,e.code={zip_base64:await (0,_.bB)(ea)}));let a=await S.FH.post(_.U1,e);g.oR.success("Created function ".concat(a.name)),await (0,R.Yi)(_.c5),s.push((0,_.qw)(a.name,"Zip"===U&&"template"===G?"code":void 0))}catch(e){g.oR.error((0,S.gJ)(e)),eg(!1)}};return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(N.z,{title:"Create function",description:"Start from a runtime's hello-world template, upload a deployment package, or run a container image.",breadcrumbs:[{label:"Lambda",href:"/lambda/"},{label:"Functions",href:"/lambda/"},{label:"Create function"}]}),(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ek()},className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-[minmax(0,1fr)_320px]",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,l.jsx)(C.w,{title:"Basic information",children:(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsx)(y.D,{label:"Function name",htmlFor:"fn-name",error:eC("name"),help:"1-64 characters: letters, digits, hyphens and underscores. It cannot be changed later.",children:(0,l.jsx)(j.p,{id:"fn-name",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:B,onChange:e=>O(e.target.value),placeholder:"my-function",className:"max-w-md font-mono","aria-invalid":!!eC("name")})}),(0,l.jsx)(y.D,{label:"Description",htmlFor:"fn-desc",optional:!0,children:(0,l.jsx)(j.p,{id:"fn-desc",value:T,onChange:e=>M(e.target.value),className:"max-w-xl",maxLength:256})}),(0,l.jsx)(y.D,{label:"Package type",children:(0,l.jsxs)("div",{role:"radiogroup",className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,l.jsx)(F,{active:"Zip"===U,onClick:()=>W("Zip"),icon:o.A,title:"Zip archive",text:"Pick a managed runtime; author code in the console or upload a .zip."}),(0,l.jsx)(F,{active:"Image"===U,onClick:()=>W("Image"),icon:c.A,title:"Container image",text:"Run an image that implements the Lambda Runtime API, e.g. from ECR."})]})}),"Image"===U?(0,l.jsx)(y.D,{label:"Container image URI",htmlFor:"fn-image",error:eC("image"),help:"The image is pulled when the function is created and whenever its code is updated.",children:(0,l.jsx)(I.R,{id:"fn-image",value:Z,onChange:L,invalid:!!eC("image")})}):(0,l.jsx)(y.D,{label:"Runtime",error:eC("runtime"),children:P.error?(0,l.jsx)(b.W,{error:P.error,onRetry:()=>P.mutate()}):P.data?(0,l.jsx)("div",{role:"radiogroup",className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:P.data.map(e=>{let a=e.name===q;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>Y(e.name),className:(0,D.cn)("flex min-w-0 flex-col items-start gap-0.5 rounded-md border px-3 py-2.5 text-left transition-colors",a?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,l.jsxs)("span",{className:"text-sm font-medium",children:[e.label,e.deprecated&&(0,l.jsx)("span",{className:"text-muted-foreground text-xs font-normal",children:" (deprecated)"})]}),(0,l.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.name}),(0,l.jsx)("span",{className:"text-muted-foreground max-w-full truncate text-xs",title:e.image,children:e.template?"Image ".concat(e.image):"Deployment package required"})]},e.name)})}):(0,l.jsx)(v.E,{className:"h-20 rounded-md"})}),(0,l.jsx)(y.D,{label:"Architecture",help:"The instruction set of the execution environment.",children:(0,l.jsx)("div",{role:"radiogroup",className:"flex flex-wrap gap-2",children:_.Xe.map(e=>(0,l.jsx)(f.$,{type:"button",role:"radio","aria-checked":V===e,size:"sm",variant:V===e?"secondary":"outline",onClick:()=>H(e),className:(0,D.cn)("font-mono",V===e&&"ring-primary ring-1"),children:e},e))})})]})}),"Zip"===U&&(0,l.jsx)(C.w,{title:"Code source",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{role:"radiogroup",className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,l.jsx)(F,{active:"template"===G,disabled:!ev,onClick:()=>ee("template"),icon:d.A,title:"Start from runtime template",text:ev?"A hello-world handler you can edit in the console.":"".concat(null!=(a=null==ej?void 0:ej.label)?a:"This runtime"," has no template: upload a package.")}),(0,l.jsx)(F,{active:"zip"===G,onClick:()=>ee("zip"),icon:m.A,title:"Upload a .zip file",text:"A deployment package with your code and dependencies."})]}),"template"===G?ej?(0,l.jsxs)("div",{className:"overflow-hidden rounded-md border",children:[(0,l.jsxs)("div",{className:"bg-muted/50 flex items-center justify-between gap-2 border-b px-3 py-1.5 text-xs",children:[(0,l.jsx)("span",{className:"font-mono font-medium",children:ej.default_file}),(0,l.jsx)("span",{className:"text-muted-foreground",children:"Read-only preview"})]}),(0,l.jsx)("pre",{className:"bg-muted/20 max-h-80 overflow-auto p-3 font-mono text-[12.5px] leading-5",children:ej.template})]}):(0,l.jsx)(v.E,{className:"h-40 rounded-md"}):(0,l.jsxs)(y.D,{label:"Deployment package",error:eC("zip"),help:"A .zip file up to 50 MB. Files at the root of the archive end up in /var/task.",children:[(0,l.jsx)("input",{ref:ef,type:"file",accept:".zip,application/zip",className:"hidden",onChange:e=>{var a,t;et(null!=(t=null==(a=e.target.files)?void 0:a[0])?t:null),e.target.value=""}}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)(f.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{var e;return null==(e=ef.current)?void 0:e.click()},children:[(0,l.jsx)(u.A,{})," ",ea?"Choose another file":"Choose .zip file"]}),ea&&(0,l.jsxs)("span",{className:"bg-muted inline-flex max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-sm",children:[(0,l.jsx)(m.A,{className:"size-4 shrink-0"}),(0,l.jsx)("span",{className:"truncate font-mono text-[13px]",children:ea.name}),(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:(0,z.z3)(ea.size)}),(0,l.jsx)("button",{type:"button",onClick:()=>et(null),"aria-label":"Remove file",className:"text-muted-foreground hover:text-foreground",children:(0,l.jsx)(x.A,{className:"size-3.5"})})]})]})]}),(0,l.jsx)(y.D,{label:"Handler",htmlFor:"fn-handler",error:eC("handler"),help:"template"===G?"Template code uses the runtime's default handler. You can change it after creation.":(0,_.Aj)(q),children:(0,l.jsx)(j.p,{id:"fn-handler",value:el,disabled:"template"===G,onChange:e=>{en(e.target.value),er(!0)},className:"max-w-md font-mono",spellCheck:!1})}),(0,l.jsx)(y.D,{label:"Layers",optional:!0,help:"Shared libraries and code, extracted to /opt in order before the function starts.",children:(0,l.jsx)(E.LV,{value:Q,onChange:X,runtime:q,architecture:V})})]})}),(0,l.jsx)(C.w,{title:"Permissions",children:(0,l.jsx)(y.D,{label:"Execution role",htmlFor:"fn-role",optional:!0,help:"The function's code receives temporary credentials for this role in AWS_ACCESS_KEY_ID and friends. Without a role it runs without credentials.",children:(0,l.jsx)(k.n,{id:"fn-role",value:K,onChange:e=>J(e),service:"lambda.amazonaws.com",allowNone:!0,placeholder:"No execution role",className:"max-w-xl"})})}),(0,l.jsx)(C.w,{title:"Settings",children:(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsx)(y.D,{label:"Memory (MB)",htmlFor:"fn-memory",error:eC("memory"),help:"128-10240 MB. CPU is allotted in proportion to memory.",children:(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(j.p,{id:"fn-memory",type:"number",min:128,max:10240,value:ei,onChange:e=>eo(e.target.value),className:"h-8 w-28"}),_.lU.map(e=>(0,l.jsx)(f.$,{type:"button",size:"sm",variant:eb===e?"secondary":"ghost",className:"h-7 px-2 text-xs",onClick:()=>eo(String(e)),children:(0,z.qt)(e)},e))]})}),(0,l.jsx)(y.D,{label:"Timeout (seconds)",htmlFor:"fn-timeout",error:eC("timeout"),help:"1-900 seconds. Invocations that run longer are stopped.",children:(0,l.jsx)(j.p,{id:"fn-timeout",type:"number",min:1,max:900,value:ec,onChange:e=>ed(e.target.value),className:"h-8 w-28"})}),(0,l.jsx)(y.D,{label:"Environment variables",optional:!0,error:eC("env"),children:(0,l.jsx)(w.fP,{rows:em,onChange:eu,keyPlaceholder:"Key",valuePlaceholder:"Value",addLabel:"Add environment variable"})})]})})]}),(0,l.jsx)("aside",{className:"xl:sticky xl:top-4",children:(0,l.jsx)(C.w,{title:"Summary",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("dl",{className:"flex flex-col gap-3 text-sm",children:[(0,l.jsx)($,{label:"Function name",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:B||"-"})}),"Image"===U?(0,l.jsx)($,{label:"Container image",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:Z||"-"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($,{label:"Runtime",children:null!=(t=null==ej?void 0:ej.label)?t:"-"}),(0,l.jsx)($,{label:"Code",children:"template"===G?(0,l.jsxs)(l.Fragment,{children:["Template ",(0,l.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:null==ej?void 0:ej.default_file})]}):ea?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:ea.name})," ",(0,l.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",(0,z.z3)(ea.size),")"]})]}):"No package chosen"}),(0,l.jsx)($,{label:"Handler",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:el||"-"})}),Q.length>0&&(0,l.jsx)($,{label:"Layers",children:Q.length})]}),(0,l.jsx)($,{label:"Architecture",children:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:V})}),(0,l.jsx)($,{label:"Execution role",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:K?K.split("/").pop():"None"})}),(0,l.jsxs)($,{label:"Memory / timeout",children:[Number.isInteger(eb)?(0,z.qt)(eb):"-"," / ",Number.isInteger(ey)&&ey>0?(0,_.BE)(ey):"-"]}),(0,l.jsx)($,{label:"Environment variables",children:(0,w._y)(em)?Object.keys((0,w._y)(em)).length:"None"})]}),ex&&!ew&&(0,l.jsx)("p",{className:"text-destructive text-xs",children:"Some settings need attention. Check the highlighted fields."}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,l.jsxs)(f.$,{type:"submit",disabled:ep||"Zip"===U&&!q,children:[ep?(0,l.jsx)(h.A,{className:"animate-spin"}):(0,l.jsx)(p.A,{}),"Create function"]}),(0,l.jsx)(f.$,{type:"button",variant:"outline",asChild:!0,children:(0,l.jsx)(r(),{href:"/lambda/",children:"Cancel"})})]})]})})})]})]})}function $(e){let{label:a,children:t}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("dt",{className:"text-muted-foreground text-xs font-medium",children:a}),(0,l.jsx)("dd",{className:"min-w-0 break-words",children:t})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js b/pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js deleted file mode 100644 index 52f6685d..00000000 --- a/pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2164],{6132:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},27937:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},29525:(e,t,r)=>{r.d(t,{q7:()=>D,bL:()=>j,RG:()=>k});var n=r(12115),o=r(92556),l=r(88167),a=r(94446),i=r(3468),c=r(68946),u=r(97602),s=r(70222),f=r(66218),d=r(95155),p="rovingFocusGroup.onEntryFocus",y={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[m,v,b]=(0,l.N)(h),[g,k]=(0,i.A)(h,[b]),[w,A]=g(h),x=n.forwardRef((e,t)=>(0,d.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(R,{...e,ref:t})})}));x.displayName=h;var R=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:l,loop:i=!1,dir:c,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:b,onEntryFocus:g,preventScrollOnEntryFocus:k=!1,...A}=e,x=n.useRef(null),R=(0,a.s)(t,x),E=(0,f.jH)(c),[S=null,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[o,l]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[o]=r,l=n.useRef(o),a=(0,s.c)(t);return n.useEffect(()=>{l.current!==o&&(a(o),l.current=o)},[o,l,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,i=a?e:o,c=(0,s.c)(r);return[i,n.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else l(t)},[a,e,l,c])]}({prop:h,defaultProp:m,onChange:b}),[j,D]=n.useState(!1),_=(0,s.c)(g),F=v(r),I=n.useRef(!1),[P,L]=n.useState(0);return n.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(p,_),()=>e.removeEventListener(p,_)},[_]),(0,d.jsx)(w,{scope:r,orientation:l,dir:E,loop:i,currentTabStopId:S,onItemFocus:n.useCallback(e=>C(e),[C]),onItemShiftTab:n.useCallback(()=>D(!0),[]),onFocusableItemAdd:n.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>L(e=>e-1),[]),children:(0,d.jsx)(u.sG.div,{tabIndex:j||0===P?-1:0,"data-orientation":l,...A,ref:R,style:{outline:"none",...e.style},onMouseDown:(0,o.m)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,o.m)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(p,y);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),k)}}I.current=!1}),onBlur:(0,o.m)(e.onBlur,()=>D(!1))})})}),E="RovingFocusGroupItem",S=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:l=!0,active:a=!1,tabStopId:i,...s}=e,f=(0,c.B)(),p=i||f,y=A(E,r),h=y.currentTabStopId===p,b=v(r),{onFocusableItemAdd:g,onFocusableItemRemove:k}=y;return n.useEffect(()=>{if(l)return g(),()=>k()},[l,g,k]),(0,d.jsx)(m.ItemSlot,{scope:r,id:p,focusable:l,active:a,children:(0,d.jsx)(u.sG.span,{tabIndex:h?0:-1,"data-orientation":y.orientation,...s,ref:t,onMouseDown:(0,o.m)(e.onMouseDown,e=>{l?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,o.m)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,o.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return C[o]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=y.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>M(r))}})})})});S.displayName=E;var C={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var j=x,D=S},32978:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},36835:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>j});var n=r(12115),o=r.t(n,2),l=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tf(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:o,...l}=t,a=null,i=!1,c=[];k(o)&&"function"==typeof R&&(o=R(o._payload)),n.Children.forEach(o,e=>{if(b(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof R&&(t=R(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=n.cloneElement(a,void 0,c):!i&&1===n.Children.count(o)&&n.isValidElement(o)&&(a=o);let u=a?v(a):void 0,f=s(r,u);if(!a){if(o||0===o)throw Error(i?x(e):A(e));return o}let d=m(l,a.props??{});return a.type!==n.Fragment&&(d.ref=r?f:u),n.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}d(p,"createSlot");var y=Symbol.for("radix.slottable");d(function(e){let t=d(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=d((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=(...e)=>{let t=l(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}d(m,"mergeProps"),d(v,"getElementRef"),d(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&w(e._payload)}function w(e){return"object"==typeof e&&null!==e&&"then"in e}d(k,"isLazyComponent"),d(w,"isPromiseLike");var A=d(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=d(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),R=o[" use ".trim().toString()],E=r(95155),S=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),o=n.forwardRef((e,n)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(o?r:t,{...l,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});S(function(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var M=Object.defineProperty,j=n.forwardRef(M(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52056:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},55867:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},61362:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},78874:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99051:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/5581.aa9cac14282894f8.js b/pages/demo/_next/static/chunks/2166.4feae7d72ea214c1.js similarity index 95% rename from pages/demo/_next/static/chunks/5581.aa9cac14282894f8.js rename to pages/demo/_next/static/chunks/2166.4feae7d72ea214c1.js index e78c8620..0ab63cf1 100644 --- a/pages/demo/_next/static/chunks/5581.aa9cac14282894f8.js +++ b/pages/demo/_next/static/chunks/2166.4feae7d72ea214c1.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5581],{75581:(e,t,r)=>{r.r(t),r.d(t,{FitAddon:()=>i});var i=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),n={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},a=n.top+n.bottom;return{cols:Math.max(2,Math.floor((s-(n.right+n.left)-t)/e.css.cell.width)),rows:Math.max(1,Math.floor((i-a)/e.css.cell.height))}}}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2166],{22166:(e,t,r)=>{r.r(t),r.d(t,{FitAddon:()=>i});var i=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),n={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},a=n.top+n.bottom;return{cols:Math.max(2,Math.floor((s-(n.right+n.left)-t)/e.css.cell.width)),rows:Math.max(1,Math.floor((i-a)/e.css.cell.height))}}}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js b/pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js deleted file mode 100644 index 0cf1ca86..00000000 --- a/pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2214],{6132:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},32978:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},40583:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]])},43465:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,l)=>{l.d(t,{b:()=>z});var r=l(12115),a=l.t(r,2),n=l(47650),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,c=[];A(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let d=i?m(i):void 0,y=p(l,d);if(!i){if(a||0===a)throw Error(o?g(e):x(e));return a}let h=k(n,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:d),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(f,"createSlot");var u=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=u,t},"createSlottable");var s=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}h(k,"mergeProps"),h(m,"getElementRef"),h(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&M(e._payload)}function M(e){return"object"==typeof e&&null!==e&&"then"in e}h(A,"isLazyComponent"),h(M,"isPromiseLike");var x=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),g=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(95155),S=Object.defineProperty,j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});S(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,z=r.forwardRef(C(function(e,t){return(0,E.jsx)(j.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},46046:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},52056:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},57828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},61362:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},70532:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},78874:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},80003:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},89559:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99051:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},99708:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2240-937631aef2e41767.js b/pages/demo/_next/static/chunks/2240-937631aef2e41767.js new file mode 100644 index 00000000..d05016e8 --- /dev/null +++ b/pages/demo/_next/static/chunks/2240-937631aef2e41767.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2240],{10646:(e,t,a)=>{a.d(t,{S:()=>o});var s=a(26276),l=a(29320),r=a(93788),n=a(72538),i=a(88674);let o=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(r.bL,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...l,children:(0,s.jsx)(r.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,s.jsx)(n.A,{className:"h-4 w-4"})})})});o.displayName=r.bL.displayName},11363:(e,t,a)=>{a.d(t,{T:()=>r});var s=a(26276);a(29320);var l=a(88674);function r(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,l.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},21444:(e,t,a)=>{a.d(t,{W:()=>d});var s=a(26276),l=a(7489),r=a(29902),n=a(47045),i=a(28971),o=a(88674);function d(e){let{error:t,onRetry:a,className:d}=e;return(0,s.jsxs)("div",{className:(0,o.cn)("border-destructive/30 bg-destructive/5 text-destructive flex flex-col gap-3 rounded-lg border p-4 text-sm sm:flex-row sm:items-center sm:justify-between",d),children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(l.A,{className:"mt-0.5 size-4 shrink-0"}),(0,s.jsx)("span",{className:"break-words",children:(0,i.gJ)(t)})]}),a&&(0,s.jsxs)(n.$,{variant:"outline",size:"sm",onClick:a,className:"text-foreground shrink-0",children:[(0,s.jsx)(r.A,{})," Retry"]})]})}},28553:(e,t,a)=>{a.d(t,{LY:()=>x,O6:()=>o,_y:()=>d,fP:()=>c});var s=a(26276),l=a(15410),r=a(10002),n=a(47045),i=a(81155);function o(e){return Object.entries(null!=e?e:{}).map(e=>{let[t,a]=e;return{key:t,value:a}})}function d(e){let t={};for(let a of e)a.key.trim()&&(t[a.key.trim()]=a.value);return Object.keys(t).length?t:void 0}function c(e){let{rows:t,onChange:a,keyPlaceholder:o="Key",valuePlaceholder:d="Value",addLabel:c="Add tag",max:x=50}=e,u=(e,s)=>a(t.map((t,a)=>a===e?{...t,...s}:t));return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[t.length>0&&(0,s.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,s.jsx)("span",{children:o}),(0,s.jsx)("span",{children:d})]}),t.map((e,r)=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,s.jsx)(i.p,{value:e.key,onChange:e=>u(r,{key:e.target.value}),placeholder:o,className:"h-8"}),(0,s.jsx)(i.p,{value:e.value,onChange:e=>u(r,{value:e.target.value}),placeholder:d,className:"h-8"}),(0,s.jsx)(n.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>a(t.filter((e,t)=>t!==r)),"aria-label":"Remove",children:(0,s.jsx)(l.A,{})})]},r)),(0,s.jsx)("div",{children:(0,s.jsxs)(n.$,{type:"button",variant:"outline",size:"sm",onClick:()=>a([...t,{key:"",value:""}]),disabled:t.length>=x,children:[(0,s.jsx)(r.A,{})," ",c]})})]})}function x(e){let{tags:t}=e,a=Object.entries(null!=t?t:{});return a.length?(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(e=>{let[t,a]=e;return(0,s.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:t}),a&&(0,s.jsxs)("span",{children:["=",a]})]},t)})}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},32240:(e,t,a)=>{a.d(t,{CryptoPage:()=>L,_x:()=>E,b3:()=>D});var s=a(26276),l=a(29320),r=a(91052),n=a.n(r),i=a(44057),o=a(45300),d=a(40688),c=a(7489),x=a(24068),u=a(68157),m=a(47045),p=a(10646),h=a(50985),f=a(35833),g=a(11363),y=a(76962),b=a(21444),v=a(74875),j=a(21195),N=a(89839),k=a(28553),w=a(28971),C=a(22927),_=a(88674),A=a(89865);function S(e){let t=new TextEncoder().encode(e),a="";for(let e of t)a+=String.fromCharCode(e);return btoa(a)}function T(e){try{let t=atob(e),a=Uint8Array.from(t,e=>e.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(a)}catch(e){return null}}function F(e){let{arn:t,keys:a}=e,l=(0,A.ai)(t),r=null==a?void 0:a.find(e=>e.id===l);return(0,s.jsx)(n(),{href:(0,A.B0)(l),className:"text-primary font-mono text-[13px] break-all hover:underline",children:r?(0,A.w8)(r):l})}function E(e){var t;let{keyId:a,lockKey:r}=e,n=(0,A.VY)(),[p,h]=(0,l.useState)("encrypt"),[f,j]=(0,l.useState)(null!=a?a:""),[C,E]=(0,l.useState)(""),[z,D]=(0,l.useState)(""),[L,M]=(0,l.useState)([]),[P,O]=(0,l.useState)(!1),[$,H]=(0,l.useState)(null),[R,Y]=(0,l.useState)(null),[I,K]=(0,l.useState)(null);(0,l.useEffect)(()=>{a&&j(a)},[a]),(0,l.useEffect)(()=>{var e;if(f||!n.data)return;let t=n.data.filter(e=>"Enabled"===e.state),a=null!=(e=t.find(e=>!e.managed))?e:t[0];a&&j(a.id)},[f,n.data]);let V=null==(t=n.data)?void 0:t.find(e=>e.id===f),J=new TextEncoder().encode(C).length,U=J>4096,W=e=>{h(e),H(null)},B=async()=>{O(!0),H(null),Y(null);try{let e=await w.FH.post("".concat(A.YL,"/encrypt"),{key_id:f,plaintext:S(C),encryption_context:(0,k._y)(L)});Y(e)}catch(e){H((0,w.gJ)(e))}finally{O(!1)}},X=async()=>{O(!0),H(null),K(null);try{let e=await w.FH.post("".concat(A.YL,"/decrypt"),{ciphertext_blob:z.replace(/\s+/g,""),encryption_context:(0,k._y)(L)});K(e)}catch(e){H((0,w.gJ)(e))}finally{O(!1)}},G=I?T(I.plaintext):null,Z=!!f&&(null==V?void 0:V.state)==="Enabled"&&C.length>0&&!U&&!P,q=z.trim().length>0&&!P;return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{role:"tablist","aria-label":"Operation",className:"bg-muted inline-flex w-fit rounded-lg p-1",children:["encrypt","decrypt"].map(e=>(0,s.jsxs)("button",{type:"button",role:"tab","aria-selected":p===e,onClick:()=>W(e),className:(0,_.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",p===e?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"),children:["encrypt"===e?(0,s.jsx)(i.A,{className:"size-4"}):(0,s.jsx)(o.A,{className:"size-4"}),"encrypt"===e?"Encrypt":"Decrypt"]},e))}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(N.w,{title:"encrypt"===p?"Input":"Ciphertext",bodyClassName:"flex flex-col gap-4",children:["encrypt"===p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.D,{label:"KMS key",htmlFor:"crypto-key",help:r?void 0:"Only enabled keys can encrypt.",error:V&&"Enabled"!==V.state?"This key is ".concat("PendingDeletion"===V.state?"pending deletion":"disabled"," and cannot encrypt."):void 0,children:n.error?(0,s.jsx)(b.W,{error:n.error,onRetry:()=>n.mutate()}):(0,s.jsx)(A.i$,{id:"crypto-key",keys:n.data,value:f,onChange:j,onlyEnabled:!0,symmetricOnly:!0,disabled:r})}),(0,s.jsx)(v.D,{label:"Plaintext",htmlFor:"crypto-plaintext",error:U?"Plaintext is limited to ".concat(4096," bytes; encrypt a data key for larger payloads."):void 0,help:"".concat(J," / ").concat(4096," bytes (UTF-8)"),children:(0,s.jsx)(g.T,{id:"crypto-plaintext",value:C,onChange:e=>E(e.target.value),placeholder:"Text to encrypt",rows:6,spellCheck:!1,className:"font-mono text-[13px]","aria-invalid":U})})]}):(0,s.jsx)(v.D,{label:"Ciphertext blob",htmlFor:"crypto-blob",help:"Base64 ciphertext returned by Encrypt. The key is identified from the blob itself.",children:(0,s.jsx)(g.T,{id:"crypto-blob",value:z,onChange:e=>D(e.target.value),placeholder:"AST...",rows:6,spellCheck:!1,className:"font-mono text-[13px] break-all"})}),(0,s.jsx)(v.D,{label:"Encryption context",optional:!0,help:"Key/value pairs bound to the ciphertext. Decrypt must supply exactly the same pairs.",children:(0,s.jsx)(k.fP,{rows:L,onChange:M,keyPlaceholder:"Context key",valuePlaceholder:"Context value",addLabel:"Add context pair"})}),(0,s.jsx)("div",{children:"encrypt"===p?(0,s.jsxs)(m.$,{onClick:B,disabled:!Z,children:[P?(0,s.jsx)(d.A,{className:"animate-spin"}):(0,s.jsx)(i.A,{})," Encrypt"]}):(0,s.jsxs)(m.$,{onClick:X,disabled:!q,children:[P?(0,s.jsx)(d.A,{className:"animate-spin"}):(0,s.jsx)(o.A,{})," Decrypt"]})})]}),(0,s.jsxs)(N.w,{title:"Output",bodyClassName:"flex flex-col gap-3",children:[$&&(0,s.jsxs)(u.Fc,{variant:"destructive",children:[(0,s.jsx)(c.A,{}),(0,s.jsx)(u.XL,{children:"encrypt"===p?"Encryption failed":"Decryption failed"}),(0,s.jsx)(u.TN,{className:"break-words",children:$})]}),"encrypt"===p&&R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Ciphertext blob (base64)"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(y.i8,{value:R.ciphertext_blob,size:"sm",toastMessage:"Ciphertext copied"}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{R&&(D(R.ciphertext_blob),K(null),W("decrypt"))},children:["Decrypt it ",(0,s.jsx)(x.A,{})]})]})]}),(0,s.jsx)(g.T,{readOnly:!0,value:R.ciphertext_blob,rows:6,className:"bg-muted/40 font-mono text-[12.5px] break-all",onFocus:e=>e.target.select()}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Encrypted with ",(0,s.jsx)(F,{arn:R.key_id,keys:n.data}),"."]})]}):"decrypt"===p&&I?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:null!==G?"Plaintext":"Plaintext (binary, base64)"}),(0,s.jsx)(y.i8,{value:null!=G?G:I.plaintext,size:"sm",toastMessage:"Plaintext copied"})]}),(0,s.jsx)("pre",{className:"bg-muted/40 max-h-72 overflow-auto rounded-md border p-3 font-mono text-[13px] break-all whitespace-pre-wrap",children:null!=G?G:I.plaintext}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Decrypted with ",(0,s.jsx)(F,{arn:I.key_id,keys:n.data}),"."]})]}):!$&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"encrypt"===p?"The base64 ciphertext appears here.":"The decrypted plaintext and the key that was used appear here."})]})]})]})}let z={encrypt:"Encrypt",decrypt:"Decrypt",sign:"Sign",verify:"Verify",mac:"Generate MAC","verify-mac":"Verify MAC"};function D(e){var t,a,r,n,i;let o,{k:j}=e,k=j.key_spec.startsWith("HMAC_"),F="SIGN_VERIFY"===j.key_usage,E=k?["mac","verify-mac"]:F?["sign","verify"]:["encrypt","decrypt"],D=(0,C.gf)(k?null:"".concat(A.vJ,"/").concat(encodeURIComponent(j.id),"/public-key")),L=k?[(o=j.key_spec,"HMAC_SHA_".concat(o.replace("HMAC_","")))]:null!=(r=F?null==(t=D.data)?void 0:t.signing_algorithms:null==(a=D.data)?void 0:a.encryption_algorithms)?r:[],[M,P]=(0,l.useState)(E[0]),[O,$]=(0,l.useState)(""),[H,R]=(0,l.useState)(""),[Y,I]=(0,l.useState)(!1),[K,V]=(0,l.useState)(""),[J,U]=(0,l.useState)(!1),[W,B]=(0,l.useState)(null),[X,G]=(0,l.useState)(null);(0,l.useEffect)(()=>{!O&&L.length&&$(L[0])},[O,L]);let Z="decrypt"!==M,q="verify"===M||"verify-mac"===M||"decrypt"===M,Q=Y?H.trim():S(H),ee=async()=>{U(!0),B(null),G(null);try{let e=K.replace(/\s+/g,""),t=Y?"DIGEST":"RAW";if("encrypt"===M){let e=await w.FH.post("".concat(A.YL,"/encrypt"),{key_id:j.id,plaintext:Q,encryption_algorithm:O});G({label:"Ciphertext blob (base64)",value:e.ciphertext_blob})}else if("decrypt"===M){let t=await w.FH.post("".concat(A.YL,"/decrypt"),{key_id:j.id,ciphertext_blob:e,encryption_algorithm:O});G({label:"Plaintext",value:t.plaintext,text:T(t.plaintext)})}else if("sign"===M){let e=await w.FH.post("".concat(A.YL,"/sign"),{key_id:j.id,message:Q,message_type:t,algorithm:O});G({label:"Signature (base64)",value:e.signature})}else if("mac"===M){let e=await w.FH.post("".concat(A.YL,"/generate-mac"),{key_id:j.id,message:Q,algorithm:O});G({label:"MAC (base64)",value:e.mac})}else{let a="verify"===M?{key_id:j.id,message:Q,message_type:t,algorithm:O,signature:e}:{key_id:j.id,message:Q,algorithm:O,mac:e},s=await w.FH.post("".concat(A.YL,"/").concat(M),a);G({label:"verify"===M?"Signature":"MAC",value:"",valid:s.valid})}}catch(e){B((0,w.gJ)(e))}finally{U(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{role:"tablist","aria-label":"Operation",className:"bg-muted inline-flex w-fit rounded-lg p-1",children:E.map(e=>(0,s.jsx)("button",{type:"button",role:"tab","aria-selected":M===e,onClick:()=>{P(e),B(null),G(null)},className:(0,_.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",M===e?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"),children:z[e]},e))}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(N.w,{title:"Input",bodyClassName:"flex flex-col gap-4",children:[(0,s.jsx)(v.D,{label:"Algorithm",htmlFor:"asym-alg",children:(0,s.jsxs)(f.l6,{value:O,onValueChange:$,disabled:L.length<=1,children:[(0,s.jsx)(f.bq,{id:"asym-alg",className:"w-full font-mono text-[13px]",children:(0,s.jsx)(f.yv,{placeholder:D.isLoading?"Loading...":"Choose an algorithm"})}),(0,s.jsx)(f.gC,{children:L.map(e=>(0,s.jsx)(f.eb,{value:e,className:"font-mono text-[13px]",children:e},e))})]})}),Z&&(0,s.jsx)(v.D,{label:"encrypt"===M?"Plaintext":Y?"Message digest (base64)":"Message",htmlFor:"asym-msg",help:F?void 0:"".concat(new TextEncoder().encode(H).length," bytes (UTF-8)"),children:(0,s.jsx)(g.T,{id:"asym-msg",value:H,onChange:e=>R(e.target.value),rows:5,spellCheck:!1,className:"font-mono text-[13px]"})}),F&&Z&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.S,{id:"asym-digest",checked:Y,onCheckedChange:e=>I(!0===e)}),(0,s.jsx)(h.J,{htmlFor:"asym-digest",className:"text-sm font-normal",children:"The message is a precomputed digest (base64)"})]}),q&&(0,s.jsx)(v.D,{label:"decrypt"===M?"Ciphertext blob (base64)":"verify"===M?"Signature (base64)":"MAC (base64)",htmlFor:"asym-proof",children:(0,s.jsx)(g.T,{id:"asym-proof",value:K,onChange:e=>V(e.target.value),rows:4,spellCheck:!1,className:"font-mono text-[13px] break-all"})}),(0,s.jsx)("div",{children:(0,s.jsxs)(m.$,{onClick:ee,disabled:J||!O||"Enabled"!==j.state||Z&&!H||q&&!K.trim(),children:[J&&(0,s.jsx)(d.A,{className:"animate-spin"})," ",z[M]]})})]}),(0,s.jsxs)(N.w,{title:"Output",bodyClassName:"flex flex-col gap-3",children:[W&&(0,s.jsxs)(u.Fc,{variant:"destructive",children:[(0,s.jsx)(c.A,{}),(0,s.jsxs)(u.XL,{children:[z[M]," failed"]}),(0,s.jsx)(u.TN,{className:"break-words",children:W})]}),(null==X?void 0:X.valid)!==void 0?(0,s.jsxs)(u.Fc,{variant:X.valid?"default":"destructive",children:[(0,s.jsx)(u.XL,{children:X.valid?"".concat(X.label," is valid"):"".concat(X.label," is not valid")}),(0,s.jsx)(u.TN,{children:X.valid?"The message matches.":"The message was changed, or a different key or algorithm was used."})]}):X?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:null===X.text?"".concat(X.label," (binary, base64)"):X.label}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(y.i8,{value:null!=(n=X.text)?n:X.value,size:"sm"}),"decrypt"!==M&&(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{(null==X?void 0:X.value)&&(V(X.value),G(null),P("encrypt"===M?"decrypt":"sign"===M?"verify":"verify-mac"))},children:["encrypt"===M?"Decrypt it":"Verify it"," ",(0,s.jsx)(x.A,{})]})]})]}),(0,s.jsx)(g.T,{readOnly:!0,value:null!=(i=X.text)?i:X.value,rows:5,className:"bg-muted/40 font-mono text-[12.5px] break-all",onFocus:e=>e.target.select()})]}):!W&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"The result appears here."})]})]}),!k&&(0,s.jsx)(N.w,{title:"Public key",description:"Share the public key to let others encrypt data for this key or verify its signatures without calling KMS.",children:D.error?(0,s.jsx)(b.W,{error:D.error,onRetry:()=>D.mutate()}):D.data?(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(y.i8,{value:D.data.pem,size:"sm",toastMessage:"Public key copied"})}),(0,s.jsx)("pre",{className:"bg-muted/40 overflow-auto rounded-md border p-3 font-mono text-[12px]",children:D.data.pem})]}):(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"Loading public key..."})})]})}function L(){let e=(0,C.pE)("key");return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(j.z,{title:"Encrypt / decrypt",description:"Try KMS encryption from the console. Payloads are limited to 4 KB; nothing you enter here is stored.",breadcrumbs:[{label:"KMS",href:"/kms/"},{label:"Encrypt / decrypt"}]}),(0,s.jsx)(E,{keyId:e||void 0})]})}},47006:(e,t,a)=>{a.d(t,{Bc:()=>n,ZI:()=>d,k$:()=>o,m_:()=>i});var s=a(26276);a(29320);var l=a(86864),r=a(88674);function n(e){let{delayDuration:t=0,...a}=e;return(0,s.jsx)(l.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function i(e){let{...t}=e;return(0,s.jsx)(n,{children:(0,s.jsx)(l.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,s.jsx)(l.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:a=0,children:n,...i}=e;return(0,s.jsx)(l.ZL,{children:(0,s.jsxs)(l.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[n,(0,s.jsx)(l.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},68157:(e,t,a)=>{a.d(t,{Fc:()=>i,TN:()=>d,XL:()=>o});var s=a(26276);a(29320);var l=a(5820),r=a(88674);let n=(0,l.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:a,...l}=e;return(0,s.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,r.cn)(n({variant:a}),t),...l})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-title",className:(0,r.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-description",className:(0,r.cn)("text-muted-foreground col-start-2 block space-y-1 text-sm [&_p]:leading-relaxed",t),...a})}},76962:(e,t,a)=>{a.d(t,{Dk:()=>x,i8:()=>u,xh:()=>m});var s=a(26276),l=a(29320),r=a(72538),n=a(37995),i=a(34993),o=a(47045),d=a(47006),c=a(88674);async function x(e){try{return await navigator.clipboard.writeText(e),!0}catch(s){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let a=document.execCommand("copy");return document.body.removeChild(t),a}}function u(e){let{value:t,label:a,className:u,size:m="icon",toastMessage:p}=e,[h,f]=(0,l.useState)(!1),g=async e=>{e.stopPropagation(),e.preventDefault(),await x(t)?(f(!0),p&&i.oR.success(p),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},y=h?r.A:n.A;return"sm"===m?(0,s.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:g,className:u,children:[(0,s.jsx)(y,{className:(0,c.cn)(h&&"text-emerald-600")}),null!=a?a:"Copy"]}):(0,s.jsxs)(d.m_,{children:[(0,s.jsx)(d.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:g,"aria-label":null!=a?a:"Copy",className:(0,c.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",u),children:(0,s.jsx)(y,{className:(0,c.cn)("size-3.5",h&&"text-emerald-600")})})}),(0,s.jsx)(d.ZI,{children:h?"Copied":null!=a?a:"Copy"})]})}function m(e){let{value:t,mono:a=!0,className:l,display:r}=e;return t?(0,s.jsxs)("span",{className:(0,c.cn)("inline-flex max-w-full items-center gap-1",l),children:[(0,s.jsx)("span",{className:(0,c.cn)("truncate",a&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,s.jsx)(u,{value:t})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})}},81155:(e,t,a)=>{a.d(t,{p:()=>r});var s=a(26276);a(29320);var l=a(88674);function r(e){let{className:t,type:a,...r}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,l.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}},89839:(e,t,a)=>{a.d(t,{w:()=>r});var s=a(26276),l=a(88674);function r(e){let{title:t,description:a,actions:r,children:n,className:i,bodyClassName:o,flush:d}=e;return(0,s.jsxs)("section",{className:(0,l.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||r)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),a&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:a})]}),r&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]}),(0,s.jsx)("div",{className:(0,l.cn)(!d&&"p-4",o),children:n})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js b/pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js new file mode 100644 index 00000000..4d6358ca --- /dev/null +++ b/pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2373],{7489:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},23566:(e,t,r)=>{r.d(t,{q7:()=>D,bL:()=>j,RG:()=>k});var n=r(29320),o=r(62315),l=r(2430),a=r(36103),i=r(65335),c=r(29203),u=r(12377),s=r(82275),f=r(97645),d=r(26276),p="rovingFocusGroup.onEntryFocus",y={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[m,v,b]=(0,l.N)(h),[g,k]=(0,i.A)(h,[b]),[w,A]=g(h),x=n.forwardRef((e,t)=>(0,d.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(R,{...e,ref:t})})}));x.displayName=h;var R=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:l,loop:i=!1,dir:c,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:b,onEntryFocus:g,preventScrollOnEntryFocus:k=!1,...A}=e,x=n.useRef(null),R=(0,a.s)(t,x),E=(0,f.jH)(c),[S=null,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[o,l]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[o]=r,l=n.useRef(o),a=(0,s.c)(t);return n.useEffect(()=>{l.current!==o&&(a(o),l.current=o)},[o,l,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,i=a?e:o,c=(0,s.c)(r);return[i,n.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else l(t)},[a,e,l,c])]}({prop:h,defaultProp:m,onChange:b}),[j,D]=n.useState(!1),_=(0,s.c)(g),F=v(r),I=n.useRef(!1),[P,L]=n.useState(0);return n.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(p,_),()=>e.removeEventListener(p,_)},[_]),(0,d.jsx)(w,{scope:r,orientation:l,dir:E,loop:i,currentTabStopId:S,onItemFocus:n.useCallback(e=>C(e),[C]),onItemShiftTab:n.useCallback(()=>D(!0),[]),onFocusableItemAdd:n.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>L(e=>e-1),[]),children:(0,d.jsx)(u.sG.div,{tabIndex:j||0===P?-1:0,"data-orientation":l,...A,ref:R,style:{outline:"none",...e.style},onMouseDown:(0,o.m)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,o.m)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(p,y);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),k)}}I.current=!1}),onBlur:(0,o.m)(e.onBlur,()=>D(!1))})})}),E="RovingFocusGroupItem",S=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:l=!0,active:a=!1,tabStopId:i,...s}=e,f=(0,c.B)(),p=i||f,y=A(E,r),h=y.currentTabStopId===p,b=v(r),{onFocusableItemAdd:g,onFocusableItemRemove:k}=y;return n.useEffect(()=>{if(l)return g(),()=>k()},[l,g,k]),(0,d.jsx)(m.ItemSlot,{scope:r,id:p,focusable:l,active:a,children:(0,d.jsx)(u.sG.span,{tabIndex:h?0:-1,"data-orientation":y.orientation,...s,ref:t,onMouseDown:(0,o.m)(e.onMouseDown,e=>{l?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,o.m)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,o.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return C[o]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=y.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>M(r))}})})})});S.displayName=E;var C={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var j=x,D=S},29902:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},40688:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},64206:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},85882:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>j});var n=r(29320),o=r.t(n,2),l=r(93993),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tf(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:o,...l}=t,a=null,i=!1,c=[];k(o)&&"function"==typeof R&&(o=R(o._payload)),n.Children.forEach(o,e=>{if(b(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof R&&(t=R(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=n.cloneElement(a,void 0,c):!i&&1===n.Children.count(o)&&n.isValidElement(o)&&(a=o);let u=a?v(a):void 0,f=s(r,u);if(!a){if(o||0===o)throw Error(i?x(e):A(e));return o}let d=m(l,a.props??{});return a.type!==n.Fragment&&(d.ref=r?f:u),n.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}d(p,"createSlot");var y=Symbol.for("radix.slottable");d(function(e){let t=d(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=d((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=(...e)=>{let t=l(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}d(m,"mergeProps"),d(v,"getElementRef"),d(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&w(e._payload)}function w(e){return"object"==typeof e&&null!==e&&"then"in e}d(k,"isLazyComponent"),d(w,"isPromiseLike");var A=d(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=d(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),R=o[" use ".trim().toString()],E=r(26276),S=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),o=n.forwardRef((e,n)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(o?r:t,{...l,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});S(function(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var M=Object.defineProperty,j=n.forwardRef(M(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js b/pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js new file mode 100644 index 00000000..362e29dc --- /dev/null +++ b/pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[244],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},2430:(e,t,l)=>{l.d(t,{N:()=>c});var r=l(29320),n=l(65335),a=l(36103),o=l(18442),i=l(26276);function c(e){let t=e+"CollectionProvider",[l,c]=(0,n.A)(t),[d,p]=l(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:l}=e,n=r.useRef(null),a=r.useRef(new Map).current;return(0,i.jsx)(d,{scope:t,itemMap:a,collectionRef:n,children:l})};u.displayName=t;let y=e+"CollectionSlot",f=r.forwardRef((e,t)=>{let{scope:l,children:r}=e,n=p(y,l),c=(0,a.s)(t,n.collectionRef);return(0,i.jsx)(o.DX,{ref:c,children:r})});f.displayName=y;let s=e+"CollectionItemSlot",h="data-radix-collection-item",m=r.forwardRef((e,t)=>{let{scope:l,children:n,...c}=e,d=r.useRef(null),u=(0,a.s)(t,d),y=p(s,l);return r.useEffect(()=>(y.itemMap.set(d,{ref:d,...c}),()=>void y.itemMap.delete(d))),(0,i.jsx)(o.DX,{...{[h]:""},ref:u,children:n})});return m.displayName=s,[{Provider:u,Slot:f,ItemSlot:m},function(t){let l=p(e+"CollectionConsumer",t);return r.useCallback(()=>{let e=l.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(h,"]")));return Array.from(l.itemMap.values()).sort((e,l)=>t.indexOf(e.ref.current)-t.indexOf(l.ref.current))},[l.collectionRef,l.itemMap])},c]}},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},77440:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>j});var r=l(29320),n=l.t(r,2),a=l(93993),o=Object.defineProperty,i=(e,t)=>o(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:n,...a}=t,o=null,i=!1,c=[];x(n)&&"function"==typeof w&&(n=w(n._payload)),r.Children.forEach(n,e=>{if(v(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof w&&(t=w(t._payload)),o=h(e,t),c.push(o?.props?.children)}else c.push(e)}),o?o=r.cloneElement(o,void 0,c):!i&&1===r.Children.count(n)&&r.isValidElement(n)&&(o=n);let d=o?k(o):void 0,u=p(l,d);if(!o){if(n||0===n)throw Error(i?M(e):g(e));return n}let y=m(a,o.props??{});return o.type!==r.Fragment&&(y.ref=l?u:d),r.cloneElement(o,y)});return t.displayName=`${e}.Slot`,t}y(f,"createSlot");var s=Symbol.for("radix.slottable");y(function(e){let t=y(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var h=y((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let l={...t};for(let r in t){let n=e[r],a=t[r];/^on[A-Z]/.test(r)?n&&a?l[r]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(l[r]=n):"style"===r?l[r]={...n,...a}:"className"===r&&(l[r]=[n,a].filter(Boolean).join(" "))}return{...e,...l}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}y(m,"mergeProps"),y(k,"getElementRef"),y(v,"isSlottable");var A=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===A&&"_payload"in e&&b(e._payload)}function b(e){return"object"==typeof e&&null!==e&&"then"in e}y(x,"isLazyComponent"),y(b,"isPromiseLike");var g=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=n[" use ".trim().toString()],C=l(26276),R=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,C.jsx)(n?l:t,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});R(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var E=Object.defineProperty,j=r.forwardRef(E(function(e,t){return(0,C.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},97645:(e,t,l)=>{l.d(t,{jH:()=>a});var r=l(29320);l(26276);var n=r.createContext(void 0);function a(e){let t=r.useContext(n);return e||t||"ltr"}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2498-f13d085283c1079e.js b/pages/demo/_next/static/chunks/2498-f13d085283c1079e.js new file mode 100644 index 00000000..94ff4d8b --- /dev/null +++ b/pages/demo/_next/static/chunks/2498-f13d085283c1079e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2498],{2222:(e,t,n)=>{n.d(t,{SQ:()=>l,_2:()=>d,lp:()=>c,mB:()=>u,rI:()=>o,ty:()=>i});var r=n(26276);n(29320);var a=n(56128),s=n(88674);function o(e){let{...t}=e;return(0,r.jsx)(a.bL,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,r.jsx)(a.l9,{"data-slot":"dropdown-menu-trigger",...t})}function l(e){let{className:t,sideOffset:n=4,...o}=e;return(0,r.jsx)(a.ZL,{children:(0,r.jsx)(a.UC,{"data-slot":"dropdown-menu-content",sideOffset:n,className:(0,s.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...o})})}function d(e){let{className:t,inset:n,variant:o="default",...i}=e;return(0,r.jsx)(a.q7,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":o,className:(0,s.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i})}function c(e){let{className:t,inset:n,...o}=e;return(0,r.jsx)(a.JU,{"data-slot":"dropdown-menu-label","data-inset":n,className:(0,s.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...o})}function u(e){let{className:t,...n}=e;return(0,r.jsx)(a.wv,{"data-slot":"dropdown-menu-separator",className:(0,s.cn)("bg-border -mx-1 my-1 h-px",t),...n})}},2498:(e,t,n)=>{n.d(t,{b:()=>O,g:()=>A});var r=n(26276),a=n(29320),s=n(91052),o=n.n(s),i=n(78113),l=n(21308),d=n(39367),c=n(84083),u=n(27102),m=n(82708),p=n(91276),h=n(89965),x=n(3209),f=n(49305),g=n(47045),v=n(2222),b=n(69844),w=n(47006),j=n(76962),y=n(44936),N=n(28971),k=n(22927),S=n(98985),C=n(88674);function A(e){let{className:t,compact:n}=e;return(0,r.jsxs)("span",{className:(0,C.cn)("flex items-center gap-2 font-semibold tracking-tight",t),children:[(0,r.jsx)("span",{className:"bg-brand flex size-7 items-center justify-center rounded-md text-white shadow-sm",children:(0,r.jsx)(d.A,{className:"size-4",strokeWidth:2.5})}),!n&&(0,r.jsx)("span",{children:"HomeCloud"})]})}function z(e){let{s:t,className:n}=e,a=t.icon;return(0,r.jsx)("span",{className:(0,C.cn)("flex size-7 shrink-0 items-center justify-center rounded-md",t.color,n),children:(0,r.jsx)(a,{className:"size-4"})})}function E(){let[e,t]=(0,a.useState)(!1);return(0,r.jsxs)(b.AM,{open:e,onOpenChange:t,children:[(0,r.jsx)(b.Wv,{asChild:!0,children:(0,r.jsxs)(g.$,{variant:"ghost",size:"sm",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground data-[state=open]:bg-topbar-muted h-8",children:[(0,r.jsx)(c.A,{})," ",(0,r.jsx)("span",{className:"hidden sm:inline",children:"Services"})]})}),(0,r.jsxs)(b.hl,{align:"start",sideOffset:8,className:"max-h-[80vh] w-[min(92vw,760px)] overflow-y-auto p-0",children:[(0,r.jsx)("div",{className:"border-b px-4 py-3",children:(0,r.jsx)("p",{className:"text-sm font-semibold",children:"All services"})}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-x-6 gap-y-5 p-4 sm:grid-cols-2 md:grid-cols-3",children:(0,S.aM)().map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground mb-1.5 text-xs font-semibold tracking-wide uppercase",children:e.category}),(0,r.jsx)("ul",{className:"flex flex-col gap-0.5",children:e.services.map(e=>(0,r.jsx)("li",{children:e.comingSoon?(0,r.jsxs)("span",{className:"text-muted-foreground flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 text-sm opacity-70",children:[(0,r.jsx)(z,{s:e,className:"grayscale"}),(0,r.jsx)("span",{className:"truncate",children:e.name}),(0,r.jsx)("span",{className:"bg-muted ml-auto rounded px-1.5 py-0.5 text-[10px] font-medium uppercase",children:"Soon"})]}):(0,r.jsxs)(o(),{href:e.href,onClick:()=>t(!1),className:"hover:bg-accent flex items-center gap-2 rounded-md px-2 py-1.5 text-sm",children:[(0,r.jsx)(z,{s:e}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block truncate font-medium",children:e.name}),(0,r.jsx)("span",{className:"text-muted-foreground block truncate text-xs",children:e.description})]})]})},e.id))})]},e.category))})]})]})}function D(){let e=[];for(let n of S.Bg){var t;for(let r of(e.push({service:n,label:n.name,href:n.href,sub:n.comingSoon?"Coming soon":n.description}),null!=(t=n.nav)?t:[]))for(let t of r.items)t.href!==n.href&&e.push({service:n,label:"".concat(n.name," › ").concat(t.label),href:t.href})}return e}function T(){let e=(0,i.useRouter)(),[t,n]=(0,a.useState)(""),[s,o]=(0,a.useState)(!1),[l,d]=(0,a.useState)(0),c=(0,a.useRef)(null),m=(0,a.useMemo)(D,[]),p=(0,a.useMemo)(()=>{let e=t.trim().toLowerCase();return e?m.filter(t=>"".concat(t.label," ").concat(t.service.description," ").concat(t.service.category).toLowerCase().includes(e)).slice(0,12):m.filter(e=>!e.label.includes("›")).slice(0,10)},[t,m]);(0,a.useEffect)(()=>{let e=e=>{let t=e.target;if("/"===e.key&&!["INPUT","TEXTAREA"].includes(t.tagName)&&!t.isContentEditable&&!t.closest(".xterm")){var n;e.preventDefault(),null==(n=c.current)||n.focus()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let h=t=>{var r;t.service.comingSoon||(o(!1),n(""),null==(r=c.current)||r.blur(),e.push(t.href))};return(0,r.jsxs)(b.AM,{open:s&&p.length>=0,onOpenChange:o,children:[(0,r.jsx)(b.dT,{asChild:!0,children:(0,r.jsxs)("div",{className:"relative w-full max-w-md",children:[(0,r.jsx)(u.A,{className:"pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-white/50"}),(0,r.jsx)("input",{ref:c,value:t,onChange:e=>{n(e.target.value),d(0),o(!0)},onFocus:()=>o(!0),onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),d(e=>Math.min(e+1,p.length-1));else if("ArrowUp"===e.key)e.preventDefault(),d(e=>Math.max(e-1,0));else if("Enter"===e.key&&p[l])e.preventDefault(),h(p[l]);else if("Escape"===e.key){var t;o(!1),null==(t=c.current)||t.blur()}},placeholder:"Search services","aria-label":"Search services",className:"bg-topbar-muted h-8 w-full rounded-md border border-white/10 pr-8 pl-8 text-sm text-white placeholder:text-white/50 focus:border-white/30 focus:outline-none"}),(0,r.jsx)("kbd",{className:"pointer-events-none absolute top-1/2 right-2 hidden -translate-y-1/2 rounded border border-white/20 px-1.5 text-[10px] text-white/50 sm:block",children:"/"})]})}),(0,r.jsx)(b.hl,{align:"start",sideOffset:6,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{e.target===c.current&&e.preventDefault()},className:"w-[var(--radix-popover-trigger-width)] min-w-72 p-1",children:0===p.length?(0,r.jsxs)("p",{className:"text-muted-foreground px-3 py-6 text-center text-sm",children:["No services match “",t,"”"]}):(0,r.jsxs)("ul",{role:"listbox",children:[!t&&(0,r.jsx)("li",{className:"text-muted-foreground px-2 pt-1 pb-1.5 text-xs font-medium",children:"Services"}),p.map((e,t)=>(0,r.jsx)("li",{role:"option","aria-selected":t===l,children:(0,r.jsxs)("button",{type:"button",onMouseEnter:()=>d(t),onClick:()=>h(e),disabled:e.service.comingSoon,className:(0,C.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm disabled:cursor-not-allowed disabled:opacity-60",t===l&&"bg-accent"),children:[(0,r.jsx)(z,{s:e.service,className:"size-6"}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"block truncate",children:e.label}),e.sub&&(0,r.jsx)("span",{className:"text-muted-foreground block truncate text-xs",children:e.sub})]})]})},e.href+e.label))]})})]})}function I(){let{resolvedTheme:e,setTheme:t}=(0,l.D)(),[n,s]=(0,a.useState)(!1);(0,a.useEffect)(()=>s(!0),[]);let o=n&&"dark"===e;return(0,r.jsxs)(w.m_,{children:[(0,r.jsx)(w.k$,{asChild:!0,children:(0,r.jsx)(g.$,{variant:"ghost",size:"icon",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground size-8",onClick:()=>t(o?"light":"dark"),"aria-label":"Toggle dark mode",children:o?(0,r.jsx)(m.A,{}):(0,r.jsx)(p.A,{})})}),(0,r.jsx)(w.ZI,{children:o?"Light mode":"Dark mode"})]})}function _(){let e=(0,y.w)(),t=async()=>{await (0,N.ri)(),window.location.href=N.Ms?"/":"/login/"};return(0,r.jsxs)(v.rI,{children:[(0,r.jsx)(v.ty,{asChild:!0,children:(0,r.jsxs)(g.$,{variant:"ghost",size:"sm",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground data-[state=open]:bg-topbar-muted h-8 max-w-72",children:[(0,r.jsx)("span",{className:"flex size-5 items-center justify-center rounded-full bg-white/15",children:(0,r.jsx)(h.A,{className:"size-3"})}),(0,r.jsxs)("span",{className:"hidden truncate md:inline",children:[e.user.name,(0,r.jsxs)("span",{className:"text-white/50",children:[" @ ",e.account_id]})]})]})}),(0,r.jsxs)(v.SQ,{align:"end",className:"w-72",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 px-2 py-2 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground text-xs",children:"Signed in as"}),(0,r.jsxs)("p",{className:"font-medium",children:[e.user.name,e.user.root&&(0,r.jsx)("span",{className:"bg-muted ml-2 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase",children:"root"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground text-xs",children:"Account ID"}),(0,r.jsxs)("p",{className:"flex items-center gap-1 font-mono text-[13px]",children:[e.account_id," ",(0,r.jsx)(j.i8,{value:e.account_id,label:"Copy account ID"})]})]}),e.user.arn&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground text-xs",children:"ARN"}),(0,r.jsxs)("p",{className:"flex items-center gap-1 font-mono text-xs break-all",children:[(0,r.jsx)("span",{className:"min-w-0",children:e.user.arn})," ",(0,r.jsx)(j.i8,{value:e.user.arn,label:"Copy ARN"})]})]})]}),(0,r.jsx)(v.mB,{}),e.user.name&&(0,r.jsx)(v._2,{asChild:!0,children:(0,r.jsxs)(o(),{href:"/iam/user/?name=".concat(encodeURIComponent(e.user.name)),children:[(0,r.jsx)(h.A,{})," Security credentials"]})}),(0,r.jsxs)(v._2,{onSelect:t,children:[(0,r.jsx)(x.A,{})," Sign out"]})]})]})}function O(e){var t,n;let{onMenu:a,showMenu:s}=e,i=null!=(n=null==(t=(0,k.gf)("/api/v1/health").data)?void 0:t.region)?n:"us-east-1";return(0,r.jsxs)("header",{className:"bg-topbar text-topbar-foreground sticky top-0 z-40 flex h-12 shrink-0 items-center gap-2 border-b border-black/20 px-2 sm:px-3",children:[s&&(0,r.jsx)(g.$,{variant:"ghost",size:"icon",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground size-8 lg:hidden",onClick:a,"aria-label":"Open navigation",children:(0,r.jsx)(f.A,{})}),(0,r.jsxs)(o(),{href:"/",className:"mr-1 flex items-center rounded-md px-1 py-1 hover:bg-white/5","aria-label":"Console home",children:[(0,r.jsx)(A,{className:"hidden sm:flex"}),(0,r.jsx)(A,{compact:!0,className:"sm:hidden"})]}),(0,r.jsx)(E,{}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 justify-center px-1",children:(0,r.jsx)(T,{})}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)(w.m_,{children:[(0,r.jsx)(w.k$,{asChild:!0,children:(0,r.jsx)("span",{className:"hidden h-6 items-center rounded border border-white/20 px-2 font-mono text-xs text-white/80 sm:inline-flex",children:i})}),(0,r.jsx)(w.ZI,{children:"Region"})]}),(0,r.jsx)(I,{}),(0,r.jsx)(_,{})]})]})}},22927:(e,t,n)=>{n.d(t,{DB:()=>m,Yi:()=>u,bN:()=>x,cB:()=>f,gf:()=>c,pE:()=>h,y3:()=>p});var r=n(29320),a=n(60228),s=n(99935),o=n(78113),i=n(34993),l=n(28971);let d=e=>(0,l.Em)("GET",e);function c(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e?e+(0,l.Zq)(r.query):null,o={refreshInterval:r.refreshInterval,keepPreviousData:null==(t=r.keepPreviousData)||t,revalidateOnFocus:null==(n=r.revalidateOnFocus)||n};return(0,a.u)(s,d,o)}function u(e){return(0,s.k)(t=>"string"==typeof t&&t.startsWith(e))}let m={fetcher:d,dedupingInterval:1500,errorRetryCount:2,shouldRetryOnError:e=>!(e instanceof l.hD)||0===e.status||e.status>=500};function p(){let[e,t]=(0,r.useState)(!1);return{pending:e,run:(0,r.useCallback)(async(e,n)=>{t(!0);try{let t=await e();return n&&i.oR.success("function"==typeof n?n(t):n),t}catch(e){i.oR.error((0,l.gJ)(e));return}finally{t(!1)}},[])}}function h(e){var t;return null!=(t=(0,o.useSearchParams)().get(e))?t:""}function x(){let e=(0,o.useRouter)(),t=(0,o.usePathname)(),n=(0,o.useSearchParams)();return(0,r.useCallback)((r,a)=>{let s=new URLSearchParams(n.toString());null===a||""===a?s.delete(r):s.set(r,a);let o=s.toString();e.replace("".concat(t).concat(o?"?".concat(o):""),{scroll:!1})},[e,t,n])}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,[t,n]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}},28971:(e,t,n)=>{var r;n.d(t,{Em:()=>C,FH:()=>A,GC:()=>j,Ht:()=>p,Ms:()=>i,Se:()=>z,Zq:()=>b,_W:()=>x,aJ:()=>N,gJ:()=>u,hD:()=>c,iD:()=>E,jj:()=>l,o2:()=>o,ri:()=>D,sk:()=>k,tE:()=>a,y0:()=>w,yq:()=>y});let a=(null!=(r=n(36159).env.NEXT_PUBLIC_API_URL)?r:"").replace(/\/+$/,""),s="homecloud.session",o="/demo",i=!0,l="#demo-unavailable",d={token:"demo-token",expires:"2099-01-01T00:00:00Z",account_id:"123456789012",user:{name:"demo-admin",id:"AIDADEMOADMIN000000",arn:"arn:aws:iam::123456789012:user/demo-admin",root:!1,console_access:!0}};class c extends Error{constructor(e,t,n){super(n),this.name="ApiError",this.status=e,this.code=t}}function u(e){return e instanceof c?e.message||e.code:e instanceof Error?e.message:String(e)}let m=new Set;function p(){if(i)return d;try{let e=window.localStorage.getItem(s);if(!e)return null;let t=JSON.parse(e);if(!t.token||t.expires&&new Date(t.expires).getTime()t(e))}function x(e){return m.add(e),()=>m.delete(e)}function f(){var e,t;return null!=(t=null==(e=p())?void 0:e.token)?t:null}let g=!1;function v(){if(h(null),g||window.location.pathname.startsWith("/login"))return;g=!0;let e=window.location.pathname+window.location.search;window.location.href="/login/?next=".concat(encodeURIComponent(e))}function b(e){if(!e)return"";let t=new URLSearchParams;for(let[n,r]of Object.entries(e))null!=r&&""!==r&&t.set(n,String(r));let n=t.toString();return n?"?".concat(n):""}function w(e,t){return"".concat(a).concat(e).concat(b(t))}function j(e,t){var n;return i?l:w(e,{...t,access_token:null!=(n=f())?n:""})}function y(e,t){if(i)throw new c(501,"NotAvailableInDemo","Live connections are not available in the demo.");let n=a||window.location.origin,r=new URL(j(e,t),n);return r.protocol="https:"===r.protocol?"wss:":"ws:",r.toString()}let N=e=>encodeURIComponent(e);function k(){return n.e(8550).then(n.bind(n,78550))}async function S(e,t,n){var r;let a,s=await k(),o=n.body;if(n.body instanceof Blob)o=a=n.body.size<=524288?await n.body.text():void 0;else if("string"==typeof n.body){a=n.body;try{o=JSON.parse(n.body)}catch(e){o=n.body}}let i={};for(let[e,t]of Object.entries(null!=(r=n.query)?r:{}))null!=t&&""!==t&&(i[e]=String(t));try{return await s.demoRequest({method:e,path:t,query:i,body:o,raw:a,headers:n.headers})}catch(e){if(e instanceof s.DemoError)throw new c(e.status,e.code,e.message);throw e}}async function C(e,t){let n,r,a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i)return S(e,t,s);let o={Accept:"application/json",...s.headers},l=f();l&&(o.Authorization="Bearer ".concat(l)),void 0!==s.body&&(s.body instanceof Blob||s.body instanceof FormData||"string"==typeof s.body?r=s.body:(o["Content-Type"]="application/json",r=JSON.stringify(s.body)));try{a=await fetch(w(t,s.query),{method:e,headers:o,body:r,signal:s.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw e;throw new c(0,"NetworkError","Cannot reach the HomeCloud API. Is the server running?")}let d=await a.text();if(d)try{n=JSON.parse(d)}catch(e){n=d}if(!a.ok){var u,m;let e=null==n?void 0:n.error,t=new c(a.status,null!=(u=null==e?void 0:e.code)?u:"HTTP".concat(a.status),null!=(m=null==e?void 0:e.message)?m:"string"==typeof n&&n?n:a.statusText);throw 401!==a.status||s.noAuthRedirect||v(),t}return n}let A={get:(e,t,n)=>C("GET",e,{query:t,signal:n}),post:(e,t,n)=>C("POST",e,{body:t,query:n}),put:(e,t,n)=>C("PUT",e,{body:t,query:n}),patch:(e,t,n)=>C("PATCH",e,{body:t,query:n}),del:(e,t)=>C("DELETE",e,{query:t})};function z(e,t,n,r,a){if(i)return{promise:(async()=>{if(n.size>262144)throw new c(501,"NotAvailableInDemo","Uploads larger than 256 KB are not available in the demo.");return await new Promise(e=>setTimeout(e,300)),null==r||r(n.size,n.size),S("PUT",e,{query:t,body:n,headers:{"Content-Type":a||n.type||"application/octet-stream"}})})(),abort:()=>{}};let s=new XMLHttpRequest;return{promise:new Promise((o,i)=>{s.open("PUT",w(e,t));let l=f();l&&s.setRequestHeader("Authorization","Bearer ".concat(l)),s.setRequestHeader("Content-Type",a||n.type||"application/octet-stream"),s.upload.onprogress=e=>{e.lengthComputable&&(null==r||r(e.loaded,e.total))},s.onload=()=>{var e,t;let n;try{n=s.responseText?JSON.parse(s.responseText):void 0}catch(e){n=s.responseText}if(s.status>=200&&s.status<300)return void o(n);let r=null==n?void 0:n.error;401===s.status&&v(),i(new c(s.status,null!=(e=null==r?void 0:r.code)?e:"HTTP".concat(s.status),null!=(t=null==r?void 0:r.message)?t:s.statusText))},s.onerror=()=>i(new c(0,"NetworkError","Upload failed: cannot reach the HomeCloud API")),s.onabort=()=>i(new c(0,"Aborted","Upload cancelled")),s.send(n)}),abort:()=>s.abort()}}async function E(e,t){if(i)return d;let n=await C("POST","/api/v1/auth/login",{body:{username:e,password:t},noAuthRedirect:!0});return h(n),n}async function D(){if(!i){try{await C("POST","/api/v1/auth/logout",{noAuthRedirect:!0})}catch(e){}h(null)}}},47045:(e,t,n)=>{n.d(t,{$:()=>l});var r=n(26276);n(29320);var a=n(18442),s=n(5820),o=n(88674);let i=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n,size:s,asChild:l=!1,...d}=e,c=l?a.DX:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,o.cn)(i({variant:n,size:s,className:t})),...d})}},69844:(e,t,n)=>{n.d(t,{AM:()=>o,Wv:()=>i,dT:()=>d,hl:()=>l});var r=n(26276);n(29320);var a=n(77422),s=n(88674);function o(e){let{...t}=e;return(0,r.jsx)(a.bL,{"data-slot":"popover",...t})}function i(e){let{...t}=e;return(0,r.jsx)(a.l9,{"data-slot":"popover-trigger",...t})}function l(e){let{className:t,align:n="center",sideOffset:o=4,...i}=e;return(0,r.jsx)(a.ZL,{children:(0,r.jsx)(a.UC,{"data-slot":"popover-content",align:n,sideOffset:o,className:(0,s.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...i})})}function d(e){let{...t}=e;return(0,r.jsx)(a.Mz,{"data-slot":"popover-anchor",...t})}},88674:(e,t,n)=>{n.d(t,{cn:()=>s});var r=n(46138),a=n(93294);function s(){for(var e=arguments.length,t=Array(e),n=0;n{t.d(s,{p:()=>a});var l=t(95155);t(12115);var r=t(25016);function a(e){let{className:s,type:t,...a}=e;return(0,l.jsx)("input",{type:t,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s),...a})}},59516:(e,s,t)=>{t.d(s,{P0:()=>n,Qv:()=>i});var l=t(95155),r=t(68122),a=t(25016);function i(e){let{rows:s=5,cols:t=5}=e;return(0,l.jsx)("div",{className:"divide-y",children:Array.from({length:s},(e,s)=>(0,l.jsx)("div",{className:"flex items-center gap-4 px-4 py-3",children:Array.from({length:t},(e,s)=>(0,l.jsx)(r.E,{className:(0,a.cn)("h-4",0===s?"w-40":"flex-1")},s))},s))})}function n(){return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(r.E,{className:"h-4 w-48"}),(0,l.jsx)(r.E,{className:"h-8 w-72"}),(0,l.jsx)("div",{className:"bg-card grid grid-cols-1 gap-6 rounded-lg border p-4 sm:grid-cols-3",children:Array.from({length:9},(e,s)=>(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(r.E,{className:"h-3 w-24"}),(0,l.jsx)(r.E,{className:"h-4 w-40"})]},s))})]})}},68122:(e,s,t)=>{t.d(s,{E:()=>a});var l=t(95155),r=t(25016);function a(e){let{className:s,...t}=e;return(0,l.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",s),...t})}},82180:(e,s,t)=>{t.d(s,{Bc:()=>i,ZI:()=>o,k$:()=>d,m_:()=>n});var l=t(95155);t(12115);var r=t(79209),a=t(25016);function i(e){let{delayDuration:s=0,...t}=e;return(0,l.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:s,...t})}function n(e){let{...s}=e;return(0,l.jsx)(i,{children:(0,l.jsx)(r.bL,{"data-slot":"tooltip",...s})})}function d(e){let{...s}=e;return(0,l.jsx)(r.l9,{"data-slot":"tooltip-trigger",...s})}function o(e){let{className:s,sideOffset:t=0,children:i,...n}=e;return(0,l.jsx)(r.ZL,{children:(0,l.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:t,className:(0,a.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",s),...n,children:[i,(0,l.jsx)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},82523:(e,s,t)=>{t.d(s,{V:()=>k,b:()=>y});var l=t(95155),r=t(12115),a=t(89559),i=t(86651),n=t(65229),d=t(90368),o=t(27937),c=t(8803),m=t(20562),u=t(74054),x=t(97003),h=t(84916),f=t(33789),p=t(82180),g=t(97438),b=t(59516),j=t(25016);let v={sm:"hidden sm:table-cell",md:"hidden md:table-cell",lg:"hidden lg:table-cell"};function N(e){return null==e?"":String(e).toLowerCase()}function y(e){let{title:s,description:t,count:y,data:k,columns:C,rowId:z,loading:A,error:S,onRetry:E,selection:_="none",selected:M,onSelectedChange:L,actions:$,onRefresh:B,refreshing:R,searchPlaceholder:F="Filter resources",filter:P,filters:Z,noSearch:I,empty:Q,pageSize:W=25,defaultSort:q,onRowClick:D,rowClassName:J,expanded:K,className:O}=e,[U,V]=(0,r.useState)(""),[G,H]=(0,r.useState)(q),[T,X]=(0,r.useState)(0),[Y,ee]=(0,r.useState)([]),es=null!=M?M:Y,et=e=>{L&&L(e),void 0===M&&ee(e)},el=(0,r.useMemo)(()=>null!=k?k:[],[k]),er=(0,r.useMemo)(()=>{let e=U.trim().toLowerCase();return e?el.filter(s=>P?P(s,e):C.some(t=>t.value&&N(t.value(s)).includes(e))):el},[el,U,P,C]),ea=(0,r.useMemo)(()=>{if(!G)return er;let e=C.find(e=>e.id===G.id);if(!(null==e?void 0:e.value))return er;let s=[...er];return s.sort((s,t)=>{let l,r=e.value(s),a=e.value(t);return l="number"==typeof r&&"number"==typeof a?r-a:N(r).localeCompare(N(a),void 0,{numeric:!0}),G.desc?-l:l}),s},[er,G,C]),ei=Math.max(1,Math.ceil(ea.length/W));(0,r.useEffect)(()=>{T>=ei&&X(ei-1)},[T,ei]);let en=ea.slice(T*W,T*W+W),ed=(0,r.useMemo)(()=>new Set(el.map(z)),[el,z]);(0,r.useEffect)(()=>{if(!k)return;let e=es.filter(e=>ed.has(e));e.length!==es.length&&et(e)},[ed]);let eo=e=>{"single"===_?et(es[0]===e?[]:[e]):et(es.includes(e)?es.filter(s=>s!==e):[...es,e])},ec=en.map(z),em=ec.length>0&&ec.every(e=>es.includes(e)),eu=ec.some(e=>es.includes(e)),ex=null!=y?y:el.length,eh=s||$||B;return(0,l.jsxs)("div",{className:(0,j.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",O),children:[eh&&(0,l.jsxs)("div",{className:"flex flex-col gap-3 px-4 pt-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[s&&(0,l.jsxs)("h2",{className:"text-base font-semibold",children:[s," ",k&&(0,l.jsxs)("span",{className:"text-muted-foreground font-normal",children:["(",ex,")"]})]}),t&&(0,l.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:t})]}),(0,l.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[B&&(0,l.jsxs)(p.m_,{children:[(0,l.jsx)(p.k$,{asChild:!0,children:(0,l.jsx)(x.$,{variant:"outline",size:"icon",className:"size-8",onClick:B,"aria-label":"Refresh",children:(0,l.jsx)(a.A,{className:(0,j.cn)(R&&"animate-spin")})})}),(0,l.jsx)(p.ZI,{children:"Refresh"})]}),$]})]}),(!I||Z)&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 px-4 pt-3 pb-3 md:flex-row md:items-center",children:[!I&&(0,l.jsxs)("div",{className:"relative w-full md:max-w-sm",children:[(0,l.jsx)(i.A,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2"}),(0,l.jsx)(f.p,{value:U,onChange:e=>{V(e.target.value),X(0)},placeholder:F,className:"h-8 pr-8 pl-8"}),U&&(0,l.jsx)("button",{type:"button","aria-label":"Clear filter",onClick:()=>V(""),className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-2 -translate-y-1/2",children:(0,l.jsx)(n.A,{className:"size-4"})})]}),Z&&(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:Z}),(0,l.jsx)("div",{className:"text-muted-foreground flex items-center gap-1 text-sm md:ml-auto",children:ei>1&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.$,{variant:"ghost",size:"icon",className:"size-7",disabled:0===T,onClick:()=>X(T-1),"aria-label":"Previous page",children:(0,l.jsx)(d.A,{})}),(0,l.jsxs)("span",{className:"tabular-nums",children:[T+1," / ",ei]}),(0,l.jsx)(x.$,{variant:"ghost",size:"icon",className:"size-7",disabled:T>=ei-1,onClick:()=>X(T+1),"aria-label":"Next page",children:(0,l.jsx)(o.A,{})})]})})]}),!eh&&I&&!Z&&(0,l.jsx)("div",{className:"h-1"}),S?(0,l.jsx)("div",{className:"px-4 pb-4",children:(0,l.jsx)(g.W,{error:S,onRetry:null!=E?E:B})}):A&&!k?(0,l.jsx)("div",{className:"border-t",children:(0,l.jsx)(b.Qv,{cols:Math.min(C.length,5)})}):0===el.length?(0,l.jsx)("div",{className:"border-t",children:null!=Q?Q:(0,l.jsx)("p",{className:"text-muted-foreground p-8 text-center text-sm",children:"No resources"})}):(0,l.jsx)("div",{className:"relative w-full overflow-x-auto border-t",children:(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"bg-muted/40 border-b",children:["none"!==_&&(0,l.jsx)("th",{className:"w-10 px-4 py-2 text-left",children:"multi"===_&&(0,l.jsx)(h.S,{"aria-label":"Select all",checked:!!em||!!eu&&"indeterminate",onCheckedChange:e=>et(e?Array.from(new Set([...es,...ec])):es.filter(e=>!ec.includes(e)))})}),C.map(e=>{var s;let t=null!=(s=e.sortable)?s:!!e.value,r=(null==G?void 0:G.id)===e.id;return(0,l.jsx)("th",{className:(0,j.cn)("text-muted-foreground px-3 py-2 text-left text-xs font-semibold tracking-wide whitespace-nowrap first:pl-4 last:pr-4",e.hideBelow&&v[e.hideBelow],e.headerClassName),children:t?(0,l.jsxs)("button",{type:"button",onClick:()=>{var s;(null!=(s=e.sortable)?s:!!e.value)&&H(s=>(null==s?void 0:s.id)===e.id?s.desc?void 0:{id:e.id,desc:!0}:{id:e.id})},className:"hover:text-foreground inline-flex items-center gap-1",children:[e.header,r?(null==G?void 0:G.desc)?(0,l.jsx)(c.A,{className:"size-3"}):(0,l.jsx)(m.A,{className:"size-3"}):(0,l.jsx)(u.A,{className:"size-3 opacity-40"})]}):e.header},e.id)})]})}),(0,l.jsxs)("tbody",{children:[0===en.length&&(0,l.jsx)("tr",{children:(0,l.jsxs)("td",{colSpan:C.length+ +("none"!==_),className:"text-muted-foreground p-8 text-center",children:["No matches for “",U,"”"]})}),en.map(e=>{let s=z(e),t=es.includes(s),r=null==K?void 0:K(e);return(0,l.jsxs)(w,{children:[(0,l.jsxs)("tr",{"data-state":t?"selected":void 0,onClick:()=>{D?D(e):"none"!==_&&eo(s)},className:(0,j.cn)("border-b transition-colors last:border-0",("none"!==_||D)&&"cursor-pointer",t?"bg-primary/5 dark:bg-primary/10":"hover:bg-muted/40",null==J?void 0:J(e)),children:["none"!==_&&(0,l.jsx)("td",{className:"w-10 px-4 py-2",onClick:e=>e.stopPropagation(),children:"multi"===_?(0,l.jsx)(h.S,{"aria-label":"Select ".concat(s),checked:t,onCheckedChange:()=>eo(s)}):(0,l.jsx)("input",{type:"radio","aria-label":"Select ".concat(s),className:"accent-primary size-4 cursor-pointer align-middle",checked:t,onChange:()=>eo(s),onClick:()=>t&&et([])})}),C.map(s=>(0,l.jsx)("td",{className:(0,j.cn)("px-3 py-2 align-middle first:pl-4 last:pr-4 [&_a.font-mono]:whitespace-nowrap",s.hideBelow&&v[s.hideBelow],s.className),children:s.cell(e)},s.id))]}),r&&(0,l.jsx)("tr",{className:"bg-muted/30 border-b",children:(0,l.jsx)("td",{colSpan:C.length+ +("none"!==_),className:"px-4 py-3",children:r})})]},s)})]})]})})]})}function w(e){let{children:s}=e;return(0,l.jsx)(l.Fragment,{children:s})}function k(){return"text-primary font-medium hover:underline"}},84916:(e,s,t)=>{t.d(s,{S:()=>d});var l=t(95155),r=t(12115),a=t(65027),i=t(5917),n=t(25016);let d=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,l.jsx)(a.bL,{ref:s,className:(0,n.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:(0,l.jsx)(a.C1,{className:(0,n.cn)("flex items-center justify-center text-current"),children:(0,l.jsx)(i.A,{className:"h-4 w-4"})})})});d.displayName=a.bL.displayName},97438:(e,s,t)=>{t.d(s,{W:()=>o});var l=t(95155),r=t(6132),a=t(89559),i=t(97003),n=t(37621),d=t(25016);function o(e){let{error:s,onRetry:t,className:o}=e;return(0,l.jsxs)("div",{className:(0,d.cn)("border-destructive/30 bg-destructive/5 text-destructive flex flex-col gap-3 rounded-lg border p-4 text-sm sm:flex-row sm:items-center sm:justify-between",o),children:[(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[(0,l.jsx)(r.A,{className:"mt-0.5 size-4 shrink-0"}),(0,l.jsx)("span",{className:"break-words",children:(0,n.gJ)(s)})]}),t&&(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:t,className:"text-foreground shrink-0",children:[(0,l.jsx)(a.A,{})," Retry"]})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js b/pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js deleted file mode 100644 index 72e17aca..00000000 --- a/pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[253],{7e3:(e,t,n)=>{n.d(t,{Fl:()=>p,YI:()=>c,Yq:()=>r,ZV:()=>o,a3:()=>h,fF:()=>u,fU:()=>d,qt:()=>i,td:()=>m,z3:()=>s});let a=["B","KB","MB","GB","TB","PB"];function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),s=0;for(;n>=1024&&s=100?0:t);return"".concat(e<0?"-":"").concat(i," ").concat(a[s])}function i(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function c(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(o(e,1),"%");case"Bytes":return s(e);case"Bytes/Second":return"".concat(s(e),"/s");case"Milliseconds":return"".concat(o(e,0)," ms");case"Seconds":return"".concat(o(e,1)," s");default:return o(e)}}function l(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function r(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=l(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=l(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=l(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,s=Math.abs(a),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s<45||a>0&&a<60)return"just now";let o=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(o)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function p(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},10253:(e,t,n)=>{n.d(t,{$f:()=>d,A4:()=>l,BU:()=>u,HE:()=>z,HO:()=>D,Ic:()=>r,MQ:()=>j,Mf:()=>I,Pk:()=>L,QZ:()=>f,VT:()=>q,WD:()=>m,Wh:()=>h,Xc:()=>b,YW:()=>p,_D:()=>N,a9:()=>g,cW:()=>B,dT:()=>M,dq:()=>v,fz:()=>_,hT:()=>C,jk:()=>S,nu:()=>k,y7:()=>w});var a=n(95155),s=n(47507),i=n(7e3),o=n(73697),c=n(25016);let l="/api/v1/rds",r="/api/v1/rds/instances",d="/api/v1/rds/snapshots",u={rds:{family:"rds",service:"RDS",kinds:["relational","document"],classKind:"db",base:"/rds/",detailPath:"/rds/instance/",createPath:"/rds/create/",snapshotsPath:"/rds/snapshots/",noun:"database",Noun:"Database",nouns:"databases",Nouns:"Databases",snap:"snapshot",Snap:"Snapshot",snaps:"snapshots",Snaps:"Snapshots",idLabel:"DB identifier",namespace:"HC/RDS",dimension:"DBInstanceIdentifier"},elasticache:{family:"elasticache",service:"ElastiCache",kinds:["cache"],classKind:"cache",base:"/elasticache/",detailPath:"/elasticache/cluster/",createPath:"/elasticache/create/",snapshotsPath:"/elasticache/backups/",noun:"cluster",Noun:"Cluster",nouns:"clusters",Nouns:"Clusters",snap:"backup",Snap:"Backup",snaps:"backups",Snaps:"Backups",idLabel:"Cluster ID",namespace:"HC/ElastiCache",dimension:"CacheClusterId"}},h=e=>"cache"===e?"elasticache":"rds",m=(e,t)=>e.kinds.includes(t),p=(e,t,n)=>"".concat(u[h(e)].detailPath,"?id=").concat(encodeURIComponent(t)).concat(n?"&tab=".concat(n):""),f=e=>"cache"===e?"backups":"snapshots",g=e=>"cache"===e?"console":"query",x=["creating","starting","stopping","rebooting","restoring","backing-up","modifying","deleting"],b=e=>x.includes(e);function v(e){return e.some(b)?2e3:15e3}let y=/^[a-z][a-z0-9-]{0,62}$/;function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Identifier";return e?y.test(e)?void 0:"".concat(t," must start with a lowercase letter and contain only lowercase letters, digits and hyphens (max 63)"):"Enter ".concat("Identifier"===t?"an identifier":"a ".concat(t.toLowerCase()))}function w(e){return e.length<8?"At least 8 characters":/["'/@\s\\]/.test(e)?"May not contain quotes, slashes, @ or spaces":void 0}let N=e=>"memcached"!==e,k=e=>"memcached"!==e,M=e=>["postgres","mysql","mariadb","mongodb"].includes(e),z=e=>"redis"===e||"valkey"===e;function C(){return(0,o.gf)("".concat(l,"/engines"),{revalidateOnFocus:!1})}function B(e){return"".concat(e," vCPU").concat(1===e?"":"s")}function _(e){return"".concat(B(e.vcpus),", ").concat((0,i.qt)(e.memory_mb))}function D(e){return e.endpoint.address?"".concat(e.endpoint.address,":").concat(e.endpoint.port):""}function S(e){return e.publicly_accessible&&e.endpoint.public_host&&e.endpoint.public_port?"".concat(e.endpoint.public_host,":").concat(e.endpoint.public_port):""}let P={postgres:{mono:"Pg",cls:"bg-sky-700 text-white",label:"PostgreSQL"},mysql:{mono:"My",cls:"bg-orange-500 text-white",label:"MySQL"},mariadb:{mono:"Ma",cls:"bg-amber-800 text-white",label:"MariaDB"},mongodb:{mono:"Mo",cls:"bg-emerald-600 text-white",label:"MongoDB"},redis:{mono:"R",cls:"bg-red-600 text-white",label:"Redis"},valkey:{mono:"Vk",cls:"bg-indigo-600 text-white",label:"Valkey"},memcached:{mono:"Mc",cls:"bg-teal-600 text-white",label:"Memcached"}};function I(e){var t;let{engine:n,size:s="sm",className:i}=e,o=null!=(t=P[n])?t:{mono:n.slice(0,2),cls:"bg-slate-500 text-white"};return(0,a.jsx)("span",{"aria-hidden":!0,className:(0,c.cn)("inline-flex shrink-0 items-center justify-center font-bold tracking-tight select-none",{xs:"size-5 text-[9px] rounded",sm:"size-6 text-[10px] rounded-md",lg:"size-10 text-sm rounded-lg"}[s],o.cls,i),children:o.mono})}function L(e){var t,n,s,i;let{engine:o,version:c,engines:l}=e;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[(0,a.jsx)(I,{engine:o,size:"xs"}),(0,a.jsxs)("span",{children:[(null!=(i=null!=(s=null==l||null==(t=l.find(e=>e.name===o))?void 0:t.label)?s:null==(n=P[o])?void 0:n.label)?i:o).replace(" (DocumentDB compatible)",""),c&&(0,a.jsxs)("span",{className:"text-muted-foreground",children:[" ",c]})]})]})}function q(e){var t;let{value:n,onChange:i,kind:o,id:l,className:r}=e,{data:d,isLoading:u}=C(),h=(null!=(t=null==d?void 0:d.classes)?t:[]).filter(e=>e.kind===o);return(0,a.jsxs)(s.l6,{value:n,onValueChange:i,disabled:u&&!d,children:[(0,a.jsx)(s.bq,{id:l,className:(0,c.cn)("w-full",r),children:(0,a.jsx)(s.yv,{placeholder:u?"Loading classes...":"Choose a class"})}),(0,a.jsx)(s.gC,{children:h.map(e=>(0,a.jsxs)(s.eb,{value:e.name,children:[(0,a.jsx)("span",{className:"font-mono text-[13px]",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:_(e)})]},e.name))})]})}},47507:(e,t,n)=>{n.d(t,{TR:()=>p,bq:()=>h,eb:()=>f,gC:()=>m,l6:()=>r,s3:()=>d,yv:()=>u});var a=n(95155);n(12115);var s=n(95435),i=n(24033),o=n(5917),c=n(12108),l=n(25016);function r(e){let{...t}=e;return(0,a.jsx)(s.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(s.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,a.jsx)(s.WT,{"data-slot":"select-value",...t})}function h(e){let{className:t,size:n="default",children:o,...c}=e;return(0,a.jsxs)(s.l9,{"data-slot":"select-trigger","data-size":n,className:(0,l.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...c,children:[o,(0,a.jsx)(s.In,{asChild:!0,children:(0,a.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:n,position:i="popper",...o}=e;return(0,a.jsx)(s.ZL,{children:(0,a.jsxs)(s.UC,{"data-slot":"select-content",className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...o,children:[(0,a.jsx)(g,{}),(0,a.jsx)(s.LM,{className:(0,l.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(x,{})]})})}function p(e){let{className:t,...n}=e;return(0,a.jsx)(s.JU,{"data-slot":"select-label",className:(0,l.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...n})}function f(e){let{className:t,children:n,...i}=e;return(0,a.jsxs)(s.q7,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(s.VF,{children:(0,a.jsx)(o.A,{className:"size-4"})})}),(0,a.jsx)(s.p4,{children:n})]})}function g(e){let{className:t,...n}=e;return(0,a.jsx)(s.PP,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(c.A,{className:"size-4"})})}function x(e){let{className:t,...n}=e;return(0,a.jsx)(s.wn,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(i.A,{className:"size-4"})})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js b/pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js new file mode 100644 index 00000000..d2e587bd --- /dev/null +++ b/pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2585],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9072:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),p=r(12377),s=r(26276),u="Switch",[f,h]=(0,i.A)(u),[y,k]=f(u),m=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:f,value:h="on",onCheckedChange:k,form:m,...b}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),M=l.useRef(!1),S=!v||m||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,s.jsxs)(y,{scope:r,checked:E,disabled:f,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":A(E),"data-disabled":f?"":void 0,disabled:f,value:h,...b,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),S&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),S&&(0,s.jsx)(g,{control:v,bubbles:!M.current,name:i,value:h,checked:E,required:u,disabled:f,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=u;var b="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(b,r);return(0,s.jsx)(p.sG.span,{"data-state":A(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=b;var g=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var x=m,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];g(n)&&"function"==typeof M&&(n=M(n._payload)),l.Children.forEach(n,e=>{if(b(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof M&&(t=M(t._payload)),i=y(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?m(i):void 0,s=p(r,d);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=k(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?s:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var h=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var y=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}u(k,"mergeProps"),u(m,"getElementRef"),u(b,"isSlottable");var v=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}u(g,"isLazyComponent"),u(A,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js b/pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js new file mode 100644 index 00000000..c0532d0e --- /dev/null +++ b/pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2604],{427:(t,e,r)=>{"use strict";r.d(e,{QQ:()=>c,VU:()=>l,XC:()=>p,_U:()=>f,j2:()=>s});var n=r(29320),o=r(2346),i=r.n(o);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],u=["points","pathLength"],l={svg:["viewBox","children"],polygon:u,polyline:u},s=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],f=function(t,e){if(!t||"function"==typeof t||"boolean"==typeof t)return null;var r=t;if((0,n.isValidElement)(t)&&(r=t.props),!i()(r))return null;var o={};return Object.keys(r).forEach(function(t){s.includes(t)&&(o[t]=e||function(e){return r[t](r,e)})}),o},p=function(t,e,r){if(!i()(t)||"object"!==a(t))return null;var n=null;return Object.keys(t).forEach(function(o){var i=t[o];s.includes(o)&&"function"==typeof i&&(n||(n={}),n[o]=function(t){return i(e,r,t),null})}),n}},1116:(t,e,r)=>{"use strict";r.d(e,{s0:()=>n6,gH:()=>n0,YB:()=>oo,HQ:()=>or,xi:()=>oi,Hj:()=>og,BX:()=>n3,tA:()=>n2,DW:()=>oh,y2:()=>op,nb:()=>of,PW:()=>n9,Ay:()=>nQ,vf:()=>n4,Mk:()=>od,Ps:()=>n1,Mn:()=>ol,kA:()=>oy,Rh:()=>ot,w7:()=>os,zb:()=>oO,kr:()=>nZ,_L:()=>n8,KC:()=>ox,A1:()=>n7,W7:()=>on,AQ:()=>ob,_f:()=>oa});var n,o,i,a,c,u,l,s={};r.r(s),r.d(s,{scaleBand:()=>f.A,scaleDiverging:()=>function t(){var e=tN(rZ()(tv));return e.copy=function(){return rY(e,t())},tj.K.apply(e,arguments)},scaleDivergingLog:()=>function t(){var e=tX(rZ()).domain([.1,1,10]);return e.copy=function(){return rY(e,t()).base(e.base())},tj.K.apply(e,arguments)},scaleDivergingPow:()=>rQ,scaleDivergingSqrt:()=>r0,scaleDivergingSymlog:()=>function t(){var e=tV(rZ());return e.copy=function(){return rY(e,t()).constant(e.constant())},tj.K.apply(e,arguments)},scaleIdentity:()=>function t(e){var r;function n(t){return null==t||isNaN(t*=1)?r:t}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,ty),n):e.slice()},n.unknown=function(t){return arguments.length?(r=t,n):r},n.copy=function(){return t(e).unknown(r)},e=arguments.length?Array.from(e,ty):[0,1],tN(n)},scaleImplicit:()=>tG.h,scaleLinear:()=>tB,scaleLog:()=>function t(){let e=tX(tO()).domain([1,10]);return e.copy=()=>tx(e,t()).base(e.base()),tj.C.apply(e,arguments),e},scaleOrdinal:()=>tG.A,scalePoint:()=>f.z,scalePow:()=>tQ,scaleQuantile:()=>function t(){var e,r=[],n=[],o=[];function i(){var t=0,e=Math.max(1,n.length);for(o=Array(e-1);++t=1)return+r(t[n-1],n-1,t);var n,o=(n-1)*e,i=Math.floor(o),a=+r(t[i],i,t);return a+(r(t[i+1],i+1,t)-a)*(o-i)}}(r,t/e);return a}function a(t){return null==t||isNaN(t*=1)?e:n[A(o,t)]}return a.invertExtent=function(t){var e=n.indexOf(t);return e<0?[NaN,NaN]:[e>0?o[e-1]:r[0],efunction t(){var e,r=0,n=1,o=1,i=[.5],a=[0,1];function c(t){return null!=t&&t<=t?a[A(i,t,0,o)]:e}function u(){var t=-1;for(i=Array(o);++t=o?[i[o-1],n]:[i[e-1],i[e]]},c.unknown=function(t){return arguments.length&&(e=t),c},c.thresholds=function(){return i.slice()},c.copy=function(){return t().domain([r,n]).range(a).unknown(e)},tj.C.apply(tN(c),arguments)},scaleRadial:()=>function t(){var e,r=tw(),n=[0,1],o=!1;function i(t){var n,i=Math.sign(n=r(t))*Math.sqrt(Math.abs(n));return isNaN(i)?e:o?Math.round(i):i}return i.invert=function(t){return r.invert(t1(t))},i.domain=function(t){return arguments.length?(r.domain(t),i):r.domain()},i.range=function(t){return arguments.length?(r.range((n=Array.from(t,ty)).map(t1)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(o=!!t,i):o},i.clamp=function(t){return arguments.length?(r.clamp(t),i):r.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(r.domain(),n).round(o).clamp(r.clamp()).unknown(e)},tj.C.apply(i,arguments),tN(i)},scaleSequential:()=>function t(){var e=tN(rG()(tv));return e.copy=function(){return rY(e,t())},tj.K.apply(e,arguments)},scaleSequentialLog:()=>function t(){var e=tX(rG()).domain([1,10]);return e.copy=function(){return rY(e,t()).base(e.base())},tj.K.apply(e,arguments)},scaleSequentialPow:()=>rK,scaleSequentialQuantile:()=>function t(){var e=[],r=tv;function n(t){if(null!=t&&!isNaN(t*=1))return r((A(e,t,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();for(let r of(e=[],t))null==r||isNaN(r*=1)||e.push(r);return e.sort(g),n},n.interpolator=function(t){return arguments.length?(r=t,n):r},n.range=function(){return e.map((t,n)=>r(n/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(r,n)=>(function(t,e,r){if(!(!(n=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e*=1)>=e&&(yield e);else{let r=-1;for(let n of t)null!=(n=e(n,++r,t))&&(n*=1)>=n&&(yield n)}}(t,void 0))).length)||isNaN(e*=1))){if(e<=0||n<2)return t3(t);if(e>=1)return t2(t);var n,o=(n-1)*e,i=Math.floor(o),a=t2((function t(e,r,n=0,o=1/0,i){if(r=Math.floor(r),n=Math.floor(Math.max(0,n)),o=Math.floor(Math.min(e.length-1,o)),!(n<=r&&r<=o))return e;for(i=void 0===i?t6:function(t=g){if(t===g)return t6;if("function"!=typeof t)throw TypeError("compare is not a function");return(e,r)=>{let n=t(e,r);return n||0===n?n:(0===t(r,r))-(0===t(e,e))}}(i);o>n;){if(o-n>600){let a=o-n+1,c=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),s=.5*Math.sqrt(u*l*(a-l)/a)*(c-a/2<0?-1:1),f=Math.max(n,Math.floor(r-c*l/a+s)),p=Math.min(o,Math.floor(r+(a-c)*l/a+s));t(e,r,f,p,i)}let a=e[r],c=n,u=o;for(t5(e,n,r),i(e[o],a)>0&&t5(e,n,o);ci(e[c],a);)++c;for(;i(e[u],a)>0;)--u}0===i(e[n],a)?t5(e,n,u):t5(e,++u,o),u<=r&&(n=u+1),r<=u&&(o=u-1)}return e})(t,i).subarray(0,i+1));return a+(t3(t.subarray(i+1))-a)*(o-i)}})(e,n/t))},n.copy=function(){return t(r).domain(e)},tj.K.apply(n,arguments)},scaleSequentialSqrt:()=>rJ,scaleSequentialSymlog:()=>function t(){var e=tV(rG());return e.copy=function(){return rY(e,t()).constant(e.constant())},tj.K.apply(e,arguments)},scaleSqrt:()=>t0,scaleSymlog:()=>function t(){var e=tV(tO());return e.copy=function(){return tx(e,t()).constant(e.constant())},tj.C.apply(e,arguments)},scaleThreshold:()=>function t(){var e,r=[.5],n=[0,1],o=1;function i(t){return null!=t&&t<=t?n[A(r,t,0,o)]:e}return i.domain=function(t){return arguments.length?(o=Math.min((r=Array.from(t)).length,n.length-1),i):r.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),o=Math.min(r.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var e=n.indexOf(t);return[r[e-1],r[e]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t().domain(r).range(n).unknown(e)},tj.C.apply(i,arguments)},scaleTime:()=>rH,scaleUtc:()=>rV,tickFormat:()=>tI});var f=r(41662);let p=Math.sqrt(50),h=Math.sqrt(10),y=Math.sqrt(2);function d(t,e,r){let n,o,i,a=(e-t)/Math.max(0,r),c=Math.floor(Math.log10(a)),u=a/Math.pow(10,c),l=u>=p?10:u>=h?5:u>=y?2:1;return(c<0?(n=Math.round(t*(i=Math.pow(10,-c)/l)),o=Math.round(e*i),n/ie&&--o,i=-i):(n=Math.round(t/(i=Math.pow(10,c)*l)),o=Math.round(e/i),n*ie&&--o),o0))return[];if(t===e)return[t];let n=e=o))return[];let c=i-o+1,u=Array(c);if(n)if(a<0)for(let t=0;te?1:t>=e?0:NaN}function x(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function O(t){let e,r,n;function o(t,n,i=0,a=t.length){if(i>>1;0>r(t[e],n)?i=e+1:a=e}while(ig(t(e),r),n=(e,r)=>t(e)-r):(e=t===g||t===x?t:w,r=t,n=t),{left:o,center:function(t,e,r=0,i=t.length){let a=o(t,e,r,i-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,o=0,i=t.length){if(o>>1;0>=r(t[e],n)?o=e+1:i=e}while(o>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?X(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?X(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=D.exec(t))?new H(e[1],e[2],e[3],1):(e=I.exec(t))?new H(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=N.exec(t))?X(e[1],e[2],e[3],e[4]):(e=B.exec(t))?X(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=R.exec(t))?Z(e[1],e[2]/100,e[3]/100,1):(e=L.exec(t))?Z(e[1],e[2]/100,e[3]/100,e[4]):z.hasOwnProperty(t)?W(z[t]):"transparent"===t?new H(NaN,NaN,NaN,0):null}function W(t){return new H(t>>16&255,t>>8&255,255&t,1)}function X(t,e,r,n){return n<=0&&(t=e=r=NaN),new H(t,e,r,n)}function q(t,e,r,n){var o;return 1==arguments.length?((o=t)instanceof k||(o=$(o)),o)?new H((o=o.rgb()).r,o.g,o.b,o.opacity):new H:new H(t,e,r,null==n?1:n)}function H(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function V(){return`#${J(this.r)}${J(this.g)}${J(this.b)}`}function G(){let t=Y(this.opacity);return`${1===t?"rgb(":"rgba("}${K(this.r)}, ${K(this.g)}, ${K(this.b)}${1===t?")":`, ${t})`}`}function Y(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function K(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function J(t){return((t=K(t))<16?"0":"")+t.toString(16)}function Z(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new tt(t,e,r,n)}function Q(t){if(t instanceof tt)return new tt(t.h,t.s,t.l,t.opacity);if(t instanceof k||(t=$(t)),!t)return new tt;if(t instanceof tt)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,c=i-o,u=(i+o)/2;return c?(a=e===i?(r-n)/c+(r0&&u<1?0:a,new tt(a,c,u,t.opacity)}function tt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function te(t){return(t=(t||0)%360)<0?t+360:t}function tr(t){return Math.max(0,Math.min(1,t||0))}function tn(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function to(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}P(k,$,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U,formatHex:U,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Q(this).formatHsl()},formatRgb:F,toString:F}),P(H,q,E(k,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new H(K(this.r),K(this.g),K(this.b),Y(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:V,formatHex:V,formatHex8:function(){return`#${J(this.r)}${J(this.g)}${J(this.b)}${J((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:G,toString:G})),P(tt,function(t,e,r,n){return 1==arguments.length?Q(t):new tt(t,e,r,null==n?1:n)},E(k,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new H(tn(t>=240?t-240:t+120,o,n),tn(t,o,n),tn(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new tt(te(this.h),tr(this.s),tr(this.l),Y(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Y(this.opacity);return`${1===t?"hsl(":"hsla("}${te(this.h)}, ${100*tr(this.s)}%, ${100*tr(this.l)}%${1===t?")":`, ${t})`}`}}));let ti=t=>()=>t;function ta(t,e){var r=e-t;return r?function(e){return t+e*r}:ti(isNaN(t)?e:t)}let tc=function t(e){var r,n=1==(r=+e)?ta:function(t,e){var n,o,i;return e-t?(n=t,o=e,n=Math.pow(n,i=r),o=Math.pow(o,i)-n,i=1/i,function(t){return Math.pow(n+t*o,i)}):ti(isNaN(t)?e:t)};function o(t,e){var r=n((t=q(t)).r,(e=q(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ta(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function tu(t){return function(e){var r,n,o=e.length,i=Array(o),a=Array(o),c=Array(o);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,c=nc&&(a=e.slice(c,a),l[u]?l[u]+=a:l[++u]=a),(o=o[0])===(i=i[0])?l[u]?l[u]+=i:l[++u]=i:(l[++u]=null,s.push({i:u,x:tl(o,i)})),c=tf.lastIndex;return ce&&(r=t,t=e,e=r),l=function(r){return Math.max(t,Math.min(e,r))}),n=u>2?tg:tb,o=i=null,f}function f(e){return null==e||isNaN(e*=1)?r:(o||(o=n(a.map(t),c,u)))(t(l(e)))}return f.invert=function(r){return l(e((i||(i=n(c,a.map(t),tl)))(r)))},f.domain=function(t){return arguments.length?(a=Array.from(t,ty),s()):a.slice()},f.range=function(t){return arguments.length?(c=Array.from(t),s()):c.slice()},f.rangeRound=function(t){return c=Array.from(t),u=th,s()},f.clamp=function(t){return arguments.length?(l=!!t||tv,s()):l!==tv},f.interpolate=function(t){return arguments.length?(u=t,s()):u},f.unknown=function(t){return arguments.length?(r=t,f):r},function(r,n){return t=r,e=n,s()}}function tw(){return tO()(tv,tv)}var tj=r(75283),tS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tA(t){var e;if(!(e=tS.exec(t)))throw Error("invalid format: "+t);return new tP({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function tP(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function tE(t,e){if(!isFinite(t)||0===t)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function tk(t){return(t=tE(Math.abs(t)))?t[1]:NaN}function tM(t,e){var r=tE(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+Array(o-n.length+2).join("0")}tA.prototype=tP.prototype,tP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let t_={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>tM(100*t,e),r:tM,s:function(t,e){var r=tE(t,e);if(!r)return n=void 0,t.toPrecision(e);var o=r[0],i=r[1],a=i-(n=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,c=o.length;return a===c?o:a>c?o+Array(a-c+1).join("0"):a>0?o.slice(0,a)+"."+o.slice(a):"0."+Array(1-a).join("0")+tE(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tT(t){return t}var tC=Array.prototype.map,tD=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function tI(t,e,r,n){var o,c,u=b(t,e,r);switch((n=tA(null==n?",f":n)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(c=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tk(l)/3)))-tk(Math.abs(u))))||(n.precision=c),a(n,l);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(c=Math.max(0,tk(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(o=Math.abs(o=u)))-tk(o))+1)||(n.precision=c-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(c=Math.max(0,-tk(Math.abs(u))))||(n.precision=c-("%"===n.type)*2)}return i(n)}function tN(t){var e=t.domain;return t.ticks=function(t){var r=e();return v(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return tI(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,o,i=e(),a=0,c=i.length-1,u=i[a],l=i[c],s=10;for(l0;){if((o=m(u,l,r))===n)return i[a]=u,i[c]=l,e(i);if(o>0)u=Math.floor(u/o)*o,l=Math.ceil(l/o)*o;else if(o<0)u=Math.ceil(u*o)/o,l=Math.floor(l*o)/o;else break;n=o}return t},t}function tB(){var t=tw();return t.copy=function(){return tx(t,tB())},tj.C.apply(t,arguments),tN(t)}function tR(t,e){t=t.slice();var r,n=0,o=t.length-1,i=t[n],a=t[o];return a-t(-e,r)}function tX(t){let e,r,n=t(tL,tz),o=n.domain,a=10;function c(){var i,c;return e=(i=a)===Math.E?Math.log:10===i&&Math.log10||2===i&&Math.log2||(i=Math.log(i),t=>Math.log(t)/i),r=10===(c=a)?t$:c===Math.E?Math.exp:t=>Math.pow(c,t),o()[0]<0?(e=tW(e),r=tW(r),t(tU,tF)):t(tL,tz),n}return n.base=function(t){return arguments.length?(a=+t,c()):a},n.domain=function(t){return arguments.length?(o(t),c()):o()},n.ticks=t=>{let n,i,c=o(),u=c[0],l=c[c.length-1],s=l0){for(;f<=p;++f)for(n=1;nl)break;y.push(i)}}else for(;f<=p;++f)for(n=a-1;n>=1;--n)if(!((i=f>0?n/r(-f):n*r(f))l)break;y.push(i)}2*y.length{if(null==t&&(t=10),null==o&&(o=10===a?"s":","),"function"!=typeof o&&(a%1||null!=(o=tA(o)).precision||(o.trim=!0),o=i(o)),t===1/0)return o;let c=Math.max(1,a*t/n.ticks().length);return t=>{let n=t/r(Math.round(e(t)));return n*ao(tR(o(),{floor:t=>r(Math.floor(e(t))),ceil:t=>r(Math.ceil(e(t)))})),n}function tq(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tH(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tV(t){var e=1,r=t(tq(1),tH(e));return r.constant=function(r){return arguments.length?t(tq(e=+r),tH(e)):e},tN(r)}i=(o=function(t){var e,r,o,i=void 0===t.grouping||void 0===t.thousands?tT:(e=tC.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,c=e[0],u=0;o>0&&c>0&&(u+c+1>n&&(c=Math.max(1,n-u)),i.push(t.substring(o-=c,o+c)),!((u+=c+1)>n));)c=e[a=(a+1)%e.length];return i.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",u=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?tT:(o=tC.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return o[+t]})}),s=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",p=void 0===t.nan?"NaN":t.nan+"";function h(t,e){var r=(t=tA(t)).fill,o=t.align,h=t.sign,y=t.symbol,d=t.zero,v=t.width,m=t.comma,b=t.precision,g=t.trim,x=t.type;"n"===x?(m=!0,x="g"):t_[x]||(void 0===b&&(b=12),g=!0,x="g"),(d||"0"===r&&"="===o)&&(d=!0,r="0",o="=");var O=(e&&void 0!==e.prefix?e.prefix:"")+("$"===y?a:"#"===y&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),w=("$"===y?c:/[%p]/.test(x)?s:"")+(e&&void 0!==e.suffix?e.suffix:""),j=t_[x],S=/[defgprs%]/.test(x);function A(t){var e,a,c,s=O,y=w;if("c"===x)y=j(t)+y,t="";else{var A=(t*=1)<0||1/t<0;if(t=isNaN(t)?p:j(Math.abs(t),b),g&&(t=function(t){t:for(var e,r=t.length,n=1,o=-1;n0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==h&&(A=!1),s=(A?"("===h?h:f:"-"===h||"("===h?"":h)+s,y=("s"!==x||isNaN(t)||void 0===n?"":tD[8+n/3])+y+(A&&"("===h?")":""),S){for(e=-1,a=t.length;++e(c=t.charCodeAt(e))||c>57){y=(46===c?u+t.slice(e+1):t.slice(e))+y,t=t.slice(0,e);break}}}m&&!d&&(t=i(t,1/0));var P=s.length+t.length+y.length,E=P>1)+s+t+y+E.slice(P);break;default:t=E+s+t+y}return l(t)}return b=void 0===b?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),A.toString=function(){return t+""},A}return{format:h,formatPrefix:function(t,e){var r=3*Math.max(-8,Math.min(8,Math.floor(tk(e)/3))),n=Math.pow(10,-r),o=h(((t=tA(t)).type="f",t),{suffix:tD[8+r/3]});return function(t){return o(n*t)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,a=o.formatPrefix;var tG=r(76554);function tY(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tK(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function tJ(t){return t<0?-t*t:t*t}function tZ(t){var e=t(tv,tv),r=1;return e.exponent=function(e){return arguments.length?1==(r=+e)?t(tv,tv):.5===r?t(tK,tJ):t(tY(r),tY(1/r)):r},tN(e)}function tQ(){var t=tZ(tO());return t.copy=function(){return tx(t,tQ()).exponent(t.exponent())},tj.C.apply(t,arguments),t}function t0(){return tQ.apply(null,arguments).exponent(.5)}function t1(t){return Math.sign(t)*t*t}function t2(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r=o)&&(r=o)}return r}function t3(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function t6(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te))}function t5(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}let t7=new Date,t4=new Date;function t8(t,e,r,n){function o(e){return t(e=0==arguments.length?new Date:new Date(+e)),e}return o.floor=e=>(t(e=new Date(+e)),e),o.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),o.round=t=>{let e=o(t),r=o.ceil(t);return t-e(e(t=new Date(+t),null==r?1:Math.floor(r)),t),o.range=(r,n,i)=>{let a,c=[];if(r=o.ceil(r),i=null==i?1:Math.floor(i),!(r0))return c;do c.push(a=new Date(+r)),e(r,i),t(r);while(at8(e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)},(t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}),r&&(o.count=(e,n)=>(t7.setTime(+e),t4.setTime(+n),t(t7),t(t4),Math.floor(r(t7,t4))),o.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?o.filter(n?e=>n(e)%t==0:e=>o.count(0,e)%t==0):o:null),o}let t9=t8(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);t9.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?t8(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):t9:null,t9.range;let et=t8(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+1e3*e)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());et.range;let ee=t8(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());ee.range;let er=t8(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());er.range;let en=t8(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getHours());en.range;let eo=t8(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());eo.range;let ei=t8(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);ei.range;let ea=t8(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);ea.range;let ec=t8(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));function eu(t){return t8(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}ec.range;let el=eu(0),es=eu(1),ef=eu(2),ep=eu(3),eh=eu(4),ey=eu(5),ed=eu(6);function ev(t){return t8(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/6048e5)}el.range,es.range,ef.range,ep.range,eh.range,ey.range,ed.range;let em=ev(0),eb=ev(1),eg=ev(2),ex=ev(3),eO=ev(4),ew=ev(5),ej=ev(6);em.range,eb.range,eg.range,ex.range,eO.range,ew.range,ej.range;let eS=t8(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());eS.range;let eA=t8(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());eA.range;let eP=t8(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());eP.every=t=>isFinite(t=Math.floor(t))&&t>0?t8(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}):null,eP.range;let eE=t8(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function ek(t,e,r,n,o,i){let a=[[et,1,1e3],[et,5,5e3],[et,15,15e3],[et,30,3e4],[i,1,6e4],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function c(e,r,n){let o=Math.abs(r-e)/n,i=O(([,,t])=>t).right(a,o);if(i===a.length)return t.every(b(e/31536e6,r/31536e6,n));if(0===i)return t9.every(Math.max(b(e,r,n),1));let[c,u]=a[o/a[i-1][2]isFinite(t=Math.floor(t))&&t>0?t8(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}):null,eE.range;let[eM,e_]=ek(eE,eA,em,ec,eo,er),[eT,eC]=ek(eP,eS,el,ei,en,ee);function eD(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function eI(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function eN(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var eB={"-":"",_:" ",0:"0"},eR=/^\s*\d+/,eL=/^%/,ez=/[\\^$*+?|[\]().{}]/g;function eU(t,e,r){var n=t<0?"-":"",o=(n?-t:t)+"",i=o.length;return n+(i[t.toLowerCase(),e]))}function eX(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function eq(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function eH(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function eV(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function eG(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function eY(t,e,r){var n=eR.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function eK(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function eJ(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function eZ(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function eQ(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function e0(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function e1(t,e,r){var n=eR.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function e2(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function e3(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function e6(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function e5(t,e,r){var n=eR.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function e7(t,e,r){var n=eR.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function e4(t,e,r){var n=eL.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function e8(t,e,r){var n=eR.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function e9(t,e,r){var n=eR.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function rt(t,e){return eU(t.getDate(),e,2)}function re(t,e){return eU(t.getHours(),e,2)}function rr(t,e){return eU(t.getHours()%12||12,e,2)}function rn(t,e){return eU(1+ei.count(eP(t),t),e,3)}function ro(t,e){return eU(t.getMilliseconds(),e,3)}function ri(t,e){return ro(t,e)+"000"}function ra(t,e){return eU(t.getMonth()+1,e,2)}function rc(t,e){return eU(t.getMinutes(),e,2)}function ru(t,e){return eU(t.getSeconds(),e,2)}function rl(t){var e=t.getDay();return 0===e?7:e}function rs(t,e){return eU(el.count(eP(t)-1,t),e,2)}function rf(t){var e=t.getDay();return e>=4||0===e?eh(t):eh.ceil(t)}function rp(t,e){return t=rf(t),eU(eh.count(eP(t),t)+(4===eP(t).getDay()),e,2)}function rh(t){return t.getDay()}function ry(t,e){return eU(es.count(eP(t)-1,t),e,2)}function rd(t,e){return eU(t.getFullYear()%100,e,2)}function rv(t,e){return eU((t=rf(t)).getFullYear()%100,e,2)}function rm(t,e){return eU(t.getFullYear()%1e4,e,4)}function rb(t,e){var r=t.getDay();return eU((t=r>=4||0===r?eh(t):eh.ceil(t)).getFullYear()%1e4,e,4)}function rg(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+eU(e/60|0,"0",2)+eU(e%60,"0",2)}function rx(t,e){return eU(t.getUTCDate(),e,2)}function rO(t,e){return eU(t.getUTCHours(),e,2)}function rw(t,e){return eU(t.getUTCHours()%12||12,e,2)}function rj(t,e){return eU(1+ea.count(eE(t),t),e,3)}function rS(t,e){return eU(t.getUTCMilliseconds(),e,3)}function rA(t,e){return rS(t,e)+"000"}function rP(t,e){return eU(t.getUTCMonth()+1,e,2)}function rE(t,e){return eU(t.getUTCMinutes(),e,2)}function rk(t,e){return eU(t.getUTCSeconds(),e,2)}function rM(t){var e=t.getUTCDay();return 0===e?7:e}function r_(t,e){return eU(em.count(eE(t)-1,t),e,2)}function rT(t){var e=t.getUTCDay();return e>=4||0===e?eO(t):eO.ceil(t)}function rC(t,e){return t=rT(t),eU(eO.count(eE(t),t)+(4===eE(t).getUTCDay()),e,2)}function rD(t){return t.getUTCDay()}function rI(t,e){return eU(eb.count(eE(t)-1,t),e,2)}function rN(t,e){return eU(t.getUTCFullYear()%100,e,2)}function rB(t,e){return eU((t=rT(t)).getUTCFullYear()%100,e,2)}function rR(t,e){return eU(t.getUTCFullYear()%1e4,e,4)}function rL(t,e){var r=t.getUTCDay();return eU((t=r>=4||0===r?eO(t):eO.ceil(t)).getUTCFullYear()%1e4,e,4)}function rz(){return"+0000"}function rU(){return"%"}function rF(t){return+t}function r$(t){return Math.floor(t/1e3)}function rW(t){return new Date(t)}function rX(t){return t instanceof Date?+t:+new Date(+t)}function rq(t,e,r,n,o,i,a,c,u,l){var s=tw(),f=s.invert,p=s.domain,h=l(".%L"),y=l(":%S"),d=l("%I:%M"),v=l("%I %p"),m=l("%a %d"),b=l("%b %d"),g=l("%B"),x=l("%Y");function O(t){return(u(t)1)for(var r,n,o,i=1,a=t[e[0]],c=a.length;i=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:rF,s:r$,S:ru,u:rl,U:rs,V:rp,w:rh,W:ry,x:null,X:null,y:rd,Y:rm,Z:rg,"%":rU},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return c[t.getUTCMonth()]},c:null,d:rx,e:rx,f:rA,g:rB,G:rL,H:rO,I:rw,j:rj,L:rS,m:rP,M:rE,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:rF,s:r$,S:rk,u:rM,U:r_,V:rC,w:rD,W:rI,x:null,X:null,y:rN,Y:rR,Z:rz,"%":rU},O={a:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=y.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){var n=f.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){var n=d.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,r,n){return S(t,e,r,n)},d:e0,e:e0,f:e7,g:eK,G:eY,H:e2,I:e2,j:e1,L:e5,m:eQ,M:e3,p:function(t,e,r){var n=l.exec(e.slice(r));return n?(t.p=s.get(n[0].toLowerCase()),r+n[0].length):-1},q:eZ,Q:e8,s:e9,S:e6,u:eq,U:eH,V:eV,w:eX,W:eG,x:function(t,e,n){return S(t,r,e,n)},X:function(t,e,r){return S(t,n,e,r)},y:eK,Y:eY,Z:eJ,"%":e4};function w(t,e){return function(r){var n,o,i,a=[],c=-1,u=0,l=t.length;for(r instanceof Date||(r=new Date(+r));++c53)return null;"w"in i||(i.w=1),"Z"in i?(n=(o=(n=eI(eN(i.y,0,1))).getUTCDay())>4||0===o?eb.ceil(n):eb(n),n=ea.offset(n,(i.V-1)*7),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(n=(o=(n=eD(eN(i.y,0,1))).getDay())>4||0===o?es.ceil(n):es(n),n=ei.offset(n,(i.V-1)*7),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:+("W"in i)),o="Z"in i?eI(eN(i.y,0,1)).getUTCDay():eD(eN(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,eI(i)):eD(i)}}function S(t,e,r,n){for(var o,i,a=0,c=e.length,u=r.length;a=u)return -1;if(37===(o=e.charCodeAt(a++))){if(!(i=O[(o=e.charAt(a++))in eB?e.charAt(a++):o])||(n=i(t,r,n))<0)return -1}else if(o!=r.charCodeAt(n++))return -1}return n}return g.x=w(r,g),g.X=w(n,g),g.c=w(e,g),x.x=w(r,x),x.X=w(n,x),x.c=w(e,x),{format:function(t){var e=w(t+="",g);return e.toString=function(){return t},e},parse:function(t){var e=j(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=j(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,c.parse,l=c.utcFormat,c.utcParse;var r2=r(16981),r3=r(60672);function r6(t){for(var e=t.length,r=Array(e);--e>=0;)r[e]=e;return r}function r5(t,e){return t[e]}function r7(t){let e=[];return e.key=t,e}var r4=r(17601),r8=r.n(r4),r9=r(93783),nt=r.n(r9),ne=r(76152),nr=r.n(ne),nn=r(38581),no=r.n(nn),ni=r(11172),na=r.n(ni),nc=r(71247),nu=r.n(nc),nl=r(71852),ns=r.n(nl),nf=r(97262),np=r.n(nf),nh=r(8827),ny=r.n(nh),nd=r(95903),nv=r.n(nd),nm=r(91696),nb=r.n(nm),ng=r(88700),nx=r.n(ng);function nO(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=e?r.apply(void 0,o):t(e-a,nA(function(){for(var t=arguments.length,e=Array(t),n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);rn&&(o=n,i=r),[o,i]}function nL(t,e,r){if(t.lte(0))return new(nx())(0);var n=nC.getDigitCount(t.toNumber()),o=new(nx())(10).pow(n),i=t.div(o),a=1!==n?.05:.1,c=new(nx())(Math.ceil(i.div(a).toNumber())).add(r).mul(a).mul(o);return e?c:new(nx())(Math.ceil(c))}function nz(t,e,r){var n=1,o=new(nx())(t);if(!o.isint()&&r){var i=Math.abs(t);i<1?(n=new(nx())(10).pow(nC.getDigitCount(t)-1),o=new(nx())(Math.floor(o.div(n).toNumber())).mul(n)):i>1&&(o=new(nx())(Math.floor(t)))}else 0===t?o=new(nx())(Math.floor((e-1)/2)):r||(o=new(nx())(Math.floor(t)));var a=Math.floor((e-1)/2);return nM(nk(function(t){return o.add(new(nx())(t-a).mul(n)).toNumber()}),nE)(0,e)}var nU=nT(function(t){var e=nI(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),c=nI(nR([r,n]),2),u=c[0],l=c[1];if(u===-1/0||l===1/0){var s=l===1/0?[u].concat(nD(nE(0,o-1).map(function(){return 1/0}))):[].concat(nD(nE(0,o-1).map(function(){return-1/0})),[l]);return r>n?n_(s):s}if(u===l)return nz(u,o,i);var f=function t(e,r,n,o){var i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((r-e)/(n-1)))return{step:new(nx())(0),tickMin:new(nx())(0),tickMax:new(nx())(0)};var c=nL(new(nx())(r).sub(e).div(n-1),o,a),u=Math.ceil((i=e<=0&&r>=0?new(nx())(0):(i=new(nx())(e).add(r).div(2)).sub(new(nx())(i).mod(c))).sub(e).div(c).toNumber()),l=Math.ceil(new(nx())(r).sub(i).div(c).toNumber()),s=u+l+1;return s>n?t(e,r,n,o,a+1):(s0?l+(n-s):l,u=r>0?u:u+(n-s)),{step:c,tickMin:i.sub(new(nx())(u).mul(c)),tickMax:i.add(new(nx())(l).mul(c))})}(u,l,a,i),p=f.step,h=f.tickMin,y=f.tickMax,d=nC.rangeStep(h,y.add(new(nx())(.1).mul(p)),p);return r>n?n_(d):d});nT(function(t){var e=nI(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),c=nI(nR([r,n]),2),u=c[0],l=c[1];if(u===-1/0||l===1/0)return[r,n];if(u===l)return nz(u,o,i);var s=nL(new(nx())(l).sub(u).div(a-1),i,0),f=nM(nk(function(t){return new(nx())(u).add(new(nx())(t).mul(s)).toNumber()}),nE)(0,a).filter(function(t){return t>=u&&t<=l});return r>n?n_(f):f});var nF=nT(function(t,e){var r=nI(t,2),n=r[0],o=r[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=nI(nR([n,o]),2),c=a[0],u=a[1];if(c===-1/0||u===1/0)return[n,o];if(c===u)return[c];var l=Math.max(e,2),s=nL(new(nx())(u).sub(c).div(l-1),i,0),f=[].concat(nD(nC.rangeStep(new(nx())(c),new(nx())(u).sub(new(nx())(.99).mul(s)),s)),[u]);return n>o?n_(f):f}),n$=r(78813),nW=r(73127),nX=r(6566),nq=r(51955);function nH(t){return(nH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nV(t){return function(t){if(Array.isArray(t))return nG(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return nG(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nG(t,e)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nG(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!=(e=null==r?void 0:r.length)?e:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var c=o.range,u=0;u0?n[u-1].coordinate:n[a-1].coordinate,s=n[u].coordinate,f=u>=a-1?n[0].coordinate:n[u+1].coordinate,p=void 0;if((0,nW.sA)(s-l)!==(0,nW.sA)(f-s)){var h=[];if((0,nW.sA)(f-s)===(0,nW.sA)(c[1]-c[0])){p=f;var y=s+c[1]-c[0];h[0]=Math.min(y,(y+l)/2),h[1]=Math.max(y,(y+l)/2)}else{p=l;var d=f+c[1]-c[0];h[0]=Math.min(s,(d+s)/2),h[1]=Math.max(s,(d+s)/2)}var v=[Math.min(s,(p+s)/2),Math.max(s,(p+s)/2)];if(t>v[0]&&t<=v[1]||t>=h[0]&&t<=h[1]){i=n[u].index;break}}else{var m=Math.min(l,f),b=Math.max(l,f);if(t>(m+s)/2&&t<=(b+s)/2){i=n[u].index;break}}}else for(var g=0;g0&&g(r[g].coordinate+r[g-1].coordinate)/2&&t<=(r[g].coordinate+r[g+1].coordinate)/2||g===a-1&&t>(r[g].coordinate+r[g-1].coordinate)/2){i=r[g].index;break}return i},n1=function(t){var e,r,n=t.type.displayName,o=null!=(e=t.type)&&e.defaultProps?nK(nK({},t.type.defaultProps),t.props):t.props,i=o.stroke,a=o.fill;switch(n){case"Line":r=i;break;case"Area":case"Radar":r=i&&"none"!==i?i:a;break;default:r=a}return r},n2=function(t){var e=t.barSize,r=t.totalSize,n=t.stackGroups,o=void 0===n?{}:n;if(!o)return{};for(var i={},a=Object.keys(o),c=0,u=a.length;c=0});if(v&&v.length){var m=v[0].type.defaultProps,b=void 0!==m?nK(nK({},m),v[0].props):v[0].props,g=b.barSize,x=b[d];i[x]||(i[x]=[]);var O=nr()(g)?e:g;i[x].push({item:v[0],stackList:v.slice(1),barSize:nr()(O)?void 0:(0,nW.F4)(O,r,0)})}}return i},n3=function(t){var e,r=t.barGap,n=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=void 0===i?[]:i,c=t.maxBarSize,u=a.length;if(u<1)return null;var l=(0,nW.F4)(r,o,0,!0),s=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=o/u,h=a.reduce(function(t,e){return t+e.barSize||0},0);(h+=(u-1)*l)>=o&&(h-=(u-1)*l,l=0),h>=o&&p>0&&(f=!0,p*=.9,h=u*p);var y={offset:((o-h)/2|0)-l,size:0};e=a.reduce(function(t,e){var r={item:e.item,position:{offset:y.offset+y.size+l,size:f?p:e.barSize}},n=[].concat(nV(t),[r]);return y=n[n.length-1].position,e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){n.push({item:t,position:y})}),n},s)}else{var d=(0,nW.F4)(n,o,0,!0);o-2*d-(u-1)*l<=0&&(l=0);var v=(o-2*d-(u-1)*l)/u;v>1&&(v>>=0);var m=c===+c?Math.min(v,c):v;e=a.reduce(function(t,e,r){var n=[].concat(nV(t),[{item:e.item,position:{offset:d+(v+l)*r+(v-m)/2,size:m}}]);return e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){n.push({item:t,position:n[n.length-1].position})}),n},s)}return e},n6=function(t,e,r,n){var o=r.children,i=r.width,a=r.margin,c=i-(a.left||0)-(a.right||0),u=(0,nq.g)({children:o,legendWidth:c});if(u){var l=n||{},s=l.width,f=l.height,p=u.align,h=u.verticalAlign,y=u.layout;if(("vertical"===y||"horizontal"===y&&"middle"===h)&&"center"!==p&&(0,nW.Et)(t[p]))return nK(nK({},t),{},nJ({},p,t[p]+(s||0)));if(("horizontal"===y||"vertical"===y&&"center"===p)&&"middle"!==h&&(0,nW.Et)(t[h]))return nK(nK({},t),{},nJ({},h,t[h]+(f||0)))}return t},n5=function(t,e,r,n,o){var i=e.props.children,a=(0,nX.aS)(i,n$.u).filter(function(t){var e;return e=t.props.direction,!!nr()(o)||("horizontal"===n?"yAxis"===o:"vertical"===n||"x"===e?"xAxis"===o:"y"!==e||"yAxis"===o)});if(a&&a.length){var c=a.map(function(t){return t.props.dataKey});return t.reduce(function(t,e){var n=nZ(e,r);if(nr()(n))return t;var o=Array.isArray(n)?[nt()(n),r8()(n)]:[n,n],i=c.reduce(function(t,r){var n=nZ(e,r,0),i=o[0]-Math.abs(Array.isArray(n)?n[0]:n),a=o[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(i,t[0]),Math.max(a,t[1])]},[1/0,-1/0]);return[Math.min(i[0],t[0]),Math.max(i[1],t[1])]},[1/0,-1/0])}return null},n7=function(t,e,r,n,o){var i=e.map(function(e){return n5(t,e,r,o,n)}).filter(function(t){return!nr()(t)});return i&&i.length?i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]):null},n4=function(t,e,r,n,o){var i=e.map(function(e){var i=e.props.dataKey;return"number"===r&&i&&n5(t,e,i,n)||nQ(t,i,r,o)});if("number"===r)return i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]);var a={};return i.reduce(function(t,e){for(var r=0,n=e.length;r=2?2*(0,nW.sA)(a[0]-a[1])*u:u,e&&(t.ticks||t.niceTicks))?(t.ticks||t.niceTicks).map(function(t){return{coordinate:n(o?o.indexOf(t):t)+u,value:t,offset:u}}).filter(function(t){return!np()(t.coordinate)}):t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(t,e){return{coordinate:n(t)+u,value:t,index:e,offset:u}}):n.ticks&&!r?n.ticks(t.tickCount).map(function(t){return{coordinate:n(t)+u,value:t,offset:u}}):n.domain().map(function(t,e){return{coordinate:n(t)+u,value:o?o[t]:t,index:e,offset:u}})},oe=new WeakMap,or=function(t,e){if("function"!=typeof e)return t;oe.has(t)||oe.set(t,new WeakMap);var r=oe.get(t);if(r.has(e))return r.get(e);var n=function(){t.apply(void 0,arguments),e.apply(void 0,arguments)};return r.set(e,n),n},on=function(t,e,r){var n=t.scale,o=t.type,i=t.layout,a=t.axisType;if("auto"===n)return"radial"===i&&"radiusAxis"===a?{scale:f.A(),realScaleType:"band"}:"radial"===i&&"angleAxis"===a?{scale:tB(),realScaleType:"linear"}:"category"===o&&e&&(e.indexOf("LineChart")>=0||e.indexOf("AreaChart")>=0||e.indexOf("ComposedChart")>=0&&!r)?{scale:f.z(),realScaleType:"point"}:"category"===o?{scale:f.A(),realScaleType:"band"}:{scale:tB(),realScaleType:"linear"};if(na()(n)){var c="scale".concat(ny()(n));return{scale:(s[c]||f.z)(),realScaleType:s[c]?c:"point"}}return no()(n)?{scale:n}:{scale:f.z(),realScaleType:"point"}},oo=function(t){var e=t.domain();if(e&&!(e.length<=2)){var r=e.length,n=t.range(),o=Math.min(n[0],n[1])-1e-4,i=Math.max(n[0],n[1])+1e-4,a=t(e[0]),c=t(e[r-1]);(ai||ci)&&t.domain([e[0],e[r-1]])}},oi=function(t,e){if(!t)return null;for(var r=0,n=t.length;rn)&&(o[1]=n),o[0]>n&&(o[0]=n),o[1]=0?(t[a][r][0]=o,t[a][r][1]=o+c,o=t[a][r][1]):(t[a][r][0]=i,t[a][r][1]=i+c,i=t[a][r][1])}},expand:function(t,e){if((n=t.length)>0){for(var r,n,o,i=0,a=t[0].length;i0){for(var r,n=0,o=t[e[0]],i=o.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,o,i=0,a=1;a=0?(t[i][r][0]=o,t[i][r][1]=o+a,o=t[i][r][1]):(t[i][r][0]=0,t[i][r][1]=0)}}},ou=function(t,e,r){var n=e.map(function(t){return t.props.dataKey}),o=oc[r];return(function(){var t=(0,r3.A)([]),e=r6,r=r1,n=r5;function o(o){var i,a,c=Array.from(t.apply(this,arguments),r7),u=c.length,l=-1;for(let t of o)for(i=0,++l;i=0?0:o<0?o:n}return r[0]},oy=function(t,e){var r,n=(null!=(r=t.type)&&r.defaultProps?nK(nK({},t.type.defaultProps),t.props):t.props).stackId;if((0,nW.vh)(n)){var o=e[n];if(o){var i=o.items.indexOf(t);return i>=0?o.stackedData[i]:null}}return null},od=function(t,e,r){return Object.keys(t).reduce(function(n,o){var i=t[o].stackedData.reduce(function(t,n){var o=n.slice(e,r+1).reduce(function(t,e){return[nt()(e.concat([t[0]]).filter(nW.Et)),r8()(e.concat([t[1]]).filter(nW.Et))]},[1/0,-1/0]);return[Math.min(t[0],o[0]),Math.max(t[1],o[1])]},[1/0,-1/0]);return[Math.min(i[0],n[0]),Math.max(i[1],n[1])]},[1/0,-1/0]).map(function(t){return t===1/0||t===-1/0?0:t})},ov=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,om=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ob=function(t,e,r){if(no()(t))return t(e,r);if(!Array.isArray(t))return e;var n=[];if((0,nW.Et)(t[0]))n[0]=r?t[0]:Math.min(t[0],e[0]);else if(ov.test(t[0])){var o=+ov.exec(t[0])[1];n[0]=e[0]-o}else no()(t[0])?n[0]=t[0](e[0]):n[0]=e[0];if((0,nW.Et)(t[1]))n[1]=r?t[1]:Math.max(t[1],e[1]);else if(om.test(t[1])){var i=+om.exec(t[1])[1];n[1]=e[1]+i}else no()(t[1])?n[1]=t[1](e[1]):n[1]=e[1];return n},og=function(t,e,r){if(t&&t.scale&&t.scale.bandwidth){var n=t.scale.bandwidth();if(!r||n>0)return n}if(t&&e&&e.length>=2){for(var o=nb()(e,function(t){return t.coordinate}),i=1/0,a=1,c=o.length;a{t.exports=r(39009)(r(72442),"Set")},1952:(t,e,r)=>{var n=r(34155),o=r(24917);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==n(t)}},2346:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},2645:t=>{t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},3072:t=>{t.exports=function(t,e){return function(r){return t(e(r))}}},3957:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}},4391:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r{var n=r(7091);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return -1}},6566:(t,e,r)=>{"use strict";r.d(e,{AW:()=>L,BU:()=>k,J9:()=>D,Me:()=>M,Mn:()=>j,OV:()=>I,X_:()=>R,aS:()=>E,ee:()=>B,sT:()=>T});var n=r(71247),o=r.n(n),i=r(76152),a=r.n(i),c=r(11172),u=r.n(c),l=r(38581),s=r.n(l),f=r(2346),p=r.n(f),h=r(29320),y=r(40288),d=r(73127),v=r(92786),m=r(427),b=["children"],g=["children"];function x(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var w={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},j=function(t){return"string"==typeof t?t:t?t.displayName||t.name||"Component":""},S=null,A=null,P=function t(e){if(e===S&&Array.isArray(A))return A;var r=[];return h.Children.forEach(e,function(e){a()(e)||((0,y.isFragment)(e)?r=r.concat(t(e.props.children)):r.push(e))}),A=r,S=e,r};function E(t,e){var r=[],n=[];return n=Array.isArray(e)?e.map(function(t){return j(t)}):[j(e)],P(t).forEach(function(t){var e=o()(t,"type.displayName")||o()(t,"type.name");-1!==n.indexOf(e)&&r.push(t)}),r}function k(t,e){var r=E(t,e);return r&&r[0]}var M=function(t){if(!t||!t.props)return!1;var e=t.props,r=e.width,n=e.height;return!!(0,d.Et)(r)&&!(r<=0)&&!!(0,d.Et)(n)&&!(n<=0)},_=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],T=function(t){return t&&"object"===O(t)&&"clipDot"in t},C=function(t,e,r,n){var o,i=null!=(o=null===m.VU||void 0===m.VU?void 0:m.VU[n])?o:[];return e.startsWith("data-")||!s()(t)&&(n&&i.includes(e)||m.QQ.includes(e))||r&&m.j2.includes(e)},D=function(t,e,r){if(!t||"function"==typeof t||"boolean"==typeof t)return null;var n=t;if((0,h.isValidElement)(t)&&(n=t.props),!p()(n))return null;var o={};return Object.keys(n).forEach(function(t){var i;C(null==(i=n)?void 0:i[t],t,e,r)&&(o[t]=n[t])}),o},I=function t(e,r){if(e===r)return!0;var n=h.Children.count(e);if(n!==h.Children.count(r))return!1;if(0===n)return!0;if(1===n)return N(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var o=0;o=0)r.push(t);else if(t){var i=j(t.type),a=e[i]||{},c=a.handler,l=a.once;if(c&&(!l||!n[i])){var s=c(t,i,o);r.push(s),n[i]=!0}}}),r},R=function(t){var e=t&&t.type;return e&&w[e]?w[e]:null},L=function(t,e){return P(e).indexOf(t)}},6572:(t,e,r)=>{var n=r(44493);t.exports=function(t,e,r){for(var o=-1,i=t.length;++o{var n=r(74691),o=r(47421),i=r(24670),a=r(84618),c=r(12146);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7453:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},7489:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},8104:(t,e,r)=>{"use strict";r.d(e,{s:()=>c});var n=r(53089),o=r.n(n),i=r(38581),a=r.n(i);function c(t,e,r){return!0===e?o()(t,r):a()(e)?o()(t,e):t}},8601:(t,e,r)=>{var n=r(62491),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)}),e})},8827:(t,e,r)=>{t.exports=r(9860)("toUpperCase")},8847:(t,e,r)=>{"use strict";r.d(e,{m:()=>$});var n=r(29320),o=r(91696),i=r.n(o),a=r(76152),c=r.n(a),u=r(46138),l=r(73127);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){return(f=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);ru[n]+s?Math.max(f,u[n]):Math.max(p,u[n])}function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function S(t){for(var e=1;e1||Math.abs(t.height-this.state.lastBoundingBox.height)>1)&&this.setState({lastBoundingBox:{width:t.width,height:t.height}})}else(-1!==this.state.lastBoundingBox.width||-1!==this.state.lastBoundingBox.height)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var t,e;this.props.active&&this.updateBBox(),this.state.dismissed&&((null==(t=this.props.coordinate)?void 0:t.x)!==this.state.dismissedAtCoordinate.x||(null==(e=this.props.coordinate)?void 0:e.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var t,e,r,o,i,a,c,s,f,p,h,y,d,v,m,w,j,A,P,E=this,k=this.props,M=k.active,_=k.allowEscapeViewBox,T=k.animationDuration,C=k.animationEasing,D=k.children,I=k.coordinate,N=k.hasPayload,B=k.isAnimationActive,R=k.offset,L=k.position,z=k.reverseDirection,U=k.useTranslate3d,F=k.viewBox,$=k.wrapperStyle,W=(y=(t={allowEscapeViewBox:_,coordinate:I,offsetTopLeft:R,position:L,reverseDirection:z,tooltipBox:this.state.lastBoundingBox,useTranslate3d:U,viewBox:F}).allowEscapeViewBox,d=t.coordinate,v=t.offsetTopLeft,m=t.position,w=t.reverseDirection,j=t.tooltipBox,A=t.useTranslate3d,P=t.viewBox,j.height>0&&j.width>0&&d?(r=(e={translateX:p=O({allowEscapeViewBox:y,coordinate:d,key:"x",offsetTopLeft:v,position:m,reverseDirection:w,tooltipDimension:j.width,viewBox:P,viewBoxDimension:P.width}),translateY:h=O({allowEscapeViewBox:y,coordinate:d,key:"y",offsetTopLeft:v,position:m,reverseDirection:w,tooltipDimension:j.height,viewBox:P,viewBoxDimension:P.height}),useTranslate3d:A}).translateX,o=e.translateY,f={transform:e.useTranslate3d?"translate3d(".concat(r,"px, ").concat(o,"px, 0)"):"translate(".concat(r,"px, ").concat(o,"px)")}):f=x,{cssProperties:f,cssClasses:(a=(i={translateX:p,translateY:h,coordinate:d}).coordinate,c=i.translateX,s=i.translateY,(0,u.A)(g,b(b(b(b({},"".concat(g,"-right"),(0,l.Et)(c)&&a&&(0,l.Et)(a.x)&&c>=a.x),"".concat(g,"-left"),(0,l.Et)(c)&&a&&(0,l.Et)(a.x)&&c=a.y),"".concat(g,"-top"),(0,l.Et)(s)&&a&&(0,l.Et)(a.y)&&s0;return n.createElement(_,{allowEscapeViewBox:i,animationDuration:a,animationEasing:c,isAnimationActive:f,active:o,coordinate:l,hasPayload:w,offset:p,position:d,reverseDirection:m,useTranslate3d:b,viewBox:g,wrapperStyle:x},(t=N(N({},this.props),{},{payload:O}),n.isValidElement(u)?n.cloneElement(u,t):"function"==typeof u?n.createElement(u,t):n.createElement(v,t)))}}],function(t,e){for(var r=0;r{t.exports=r(72442)["__core-js_shared__"]},9761:(t,e,r)=>{var n=r(37226),o=r(44493),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!!("number"==r||"symbol"==r||"boolean"==r||null==t||o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},9860:(t,e,r)=>{var n=r(67897),o=r(98757),i=r(76579),a=r(15197);t.exports=function(t){return function(e){var r=o(e=a(e))?i(e):void 0,c=r?r[0]:e.charAt(0),u=r?n(r,1).join(""):e.slice(1);return c[t]()+u}}},10005:(t,e,r)=>{var n=r(38581),o=r(3957);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},11172:(t,e,r)=>{var n=r(34155),o=r(37226),i=r(24917);t.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&"[object String]"==n(t)}},11233:(t,e,r)=>{var n=r(80005),o=r(45888),i=r(71503);t.exports=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:i},11452:(t,e,r)=>{"use strict";r.d(e,{N:()=>B});var n=r(29320),o=r(84680),i=r(38581),a=r.n(i),c=r(76152),u=r.n(c),l=r(95903),s=r.n(l),f=r(46138),p=r(88493),h=r(48882),y=r(54186),d=r(63633),v=r(78813),m=r(73127),b=r(6566),g=r(62005),x=r(1116),O=["type","layout","connectNulls","ref"],w=["key"];function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function A(){return(A=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);rc){l=[].concat(k(n.slice(0,s)),[c-f]);break}var p=l.length%2==0?[0,u]:[u];return[].concat(k(i.repeat(n,a)),k(l),p).map(function(t){return"".concat(t,"px")}).join(", ")}),I(t,"id",(0,m.NF)("recharts-line-")),I(t,"pathRef",function(e){t.mainCurve=e}),I(t,"handleAnimationEnd",function(){t.setState({isAnimationFinished:!0}),t.props.onAnimationEnd&&t.props.onAnimationEnd()}),I(t,"handleAnimationStart",function(){t.setState({isAnimationFinished:!1}),t.props.onAnimationStart&&t.props.onAnimationStart()}),t}if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");return i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),t&&D(i,t),e=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();this.setState({totalLength:t})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();t!==this.state.totalLength&&this.setState({totalLength:t})}}},{key:"getTotalLength",value:function(){var t=this.mainCurve;try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch(t){return 0}}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,o=r.points,i=r.xAxis,a=r.yAxis,c=r.layout,u=r.children,l=(0,b.aS)(u,v.u);if(!l)return null;var s=function(t,e){return{x:t.x,y:t.y,value:t.value,errorVal:(0,x.kr)(t.payload,e)}};return n.createElement(y.W,{clipPath:t?"url(#clipPath-".concat(e,")"):null},l.map(function(t){return n.cloneElement(t,{key:"bar-".concat(t.props.dataKey),data:o,xAxis:i,yAxis:a,layout:c,dataPointFormatter:s})}))}},{key:"renderDots",value:function(t,e,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,c=o.points,u=o.dataKey,l=(0,b.J9)(this.props,!1),s=(0,b.J9)(a,!0),f=c.map(function(t,e){var r=E(E(E({key:"dot-".concat(e),r:3},l),s),{},{index:e,cx:t.x,cy:t.y,value:t.value,dataKey:u,payload:t.payload,points:c});return i.renderDotItem(a,r)}),p={clipPath:t?"url(#clipPath-".concat(e?"":"dots-").concat(r,")"):null};return n.createElement(y.W,A({className:"recharts-line-dots",key:"dots"},p),f)}},{key:"renderCurveStatically",value:function(t,e,r,o){var i=this.props,a=i.type,c=i.layout,u=i.connectNulls,l=(i.ref,S(i,O)),s=E(E(E({},(0,b.J9)(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:e?"url(#clipPath-".concat(r,")"):null,points:t},o),{},{type:a,layout:c,connectNulls:u});return n.createElement(p.I,A({},s,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(t,e){var r=this,i=this.props,a=i.points,c=i.strokeDasharray,u=i.isAnimationActive,l=i.animationBegin,s=i.animationDuration,f=i.animationEasing,p=i.animationId,h=i.animateNewValues,y=i.width,d=i.height,v=this.state,b=v.prevPoints,g=v.totalLength;return n.createElement(o.Ay,{begin:l,duration:s,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(n){var o,i=n.t;if(b){var u=b.length/a.length,l=a.map(function(t,e){var r=Math.floor(e*u);if(b[r]){var n=b[r],o=(0,m.Dj)(n.x,t.x),a=(0,m.Dj)(n.y,t.y);return E(E({},t),{},{x:o(i),y:a(i)})}if(h){var c=(0,m.Dj)(2*y,t.x),l=(0,m.Dj)(d/2,t.y);return E(E({},t),{},{x:c(i),y:l(i)})}return E(E({},t),{},{x:t.x,y:t.y})});return r.renderCurveStatically(l,t,e)}var s=(0,m.Dj)(0,g)(i);if(c){var f="".concat(c).split(/[,\s]+/gim).map(function(t){return parseFloat(t)});o=r.getStrokeDasharray(s,g,f)}else o=r.generateSimpleStrokeDasharray(g,s);return r.renderCurveStatically(a,t,e,{strokeDasharray:o})})}},{key:"renderCurve",value:function(t,e){var r=this.props,n=r.points,o=r.isAnimationActive,i=this.state,a=i.prevPoints,c=i.totalLength;return o&&n&&n.length&&(!a&&c>0||!s()(a,n))?this.renderCurveWithAnimation(t,e):this.renderCurveStatically(n,t,e)}},{key:"render",value:function(){var t,e=this.props,r=e.hide,o=e.dot,i=e.points,a=e.className,c=e.xAxis,l=e.yAxis,s=e.top,p=e.left,h=e.width,v=e.height,m=e.isAnimationActive,g=e.id;if(r||!i||!i.length)return null;var x=this.state.isAnimationFinished,O=1===i.length,w=(0,f.A)("recharts-line",a),j=c&&c.allowDataOverflow,S=l&&l.allowDataOverflow,A=j||S,P=u()(g)?this.id:g,E=null!=(t=(0,b.J9)(o,!1))?t:{r:3,strokeWidth:2},k=E.r,M=E.strokeWidth,_=((0,b.sT)(o)?o:{}).clipDot,T=void 0===_||_,C=2*(void 0===k?3:k)+(void 0===M?2:M);return n.createElement(y.W,{className:w},j||S?n.createElement("defs",null,n.createElement("clipPath",{id:"clipPath-".concat(P)},n.createElement("rect",{x:j?p:p-h/2,y:S?s:s-v/2,width:j?h:2*h,height:S?v:2*v})),!T&&n.createElement("clipPath",{id:"clipPath-dots-".concat(P)},n.createElement("rect",{x:p-C/2,y:s-C/2,width:h+C,height:v+C}))):null,!O&&this.renderCurve(A,P),this.renderErrorBar(A,P),(O||o)&&this.renderDots(A,T,P),(!m||x)&&d.Z.renderCallByParent(this.props,i))}}],r=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curPoints:t.points,prevPoints:e.curPoints}:t.points!==e.curPoints?{curPoints:t.points}:null}},{key:"repeat",value:function(t,e){for(var r=t.length%2!=0?[].concat(k(t),[0]):t,n=[],o=0;o{var n=r(39189);t.exports=function(t,e){var r=this.__data__;return this.size+=+!this.has(t),r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},12644:(t,e,r)=>{"use strict";r.d(e,{P2:()=>te,pr:()=>J,bx:()=>tr,vh:()=>Q,sl:()=>Z});var n=r(24019),o=r.n(n),i=r(85072),a=r.n(i),c=r(1116),u=r(6566),l=r(73127),s=r(29320),f=r(46138),p=r(84680),h=r(95903),y=r.n(h),d=r(76152),v=r.n(d),m=r(54186),b=r(78813),g=function(t){return null};g.displayName="Cell";var x=r(63633),O=r(62005),w=r(427),j=r(72317),S=r(27637),A=["x","y"];function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(){return(E=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,A),i=parseInt("".concat(r),10),a=parseInt("".concat(n),10),c=parseInt("".concat(e.height||o.height),10),u=parseInt("".concat(e.width||o.width),10);return M(M(M(M(M({},e),o),i?{x:i}:{}),a?{y:a}:{}),{},{height:c,width:u,name:e.name,radius:e.radius})}function T(t){return s.createElement(S.yp,E({shapeType:"rectangle",propTransformer:_,activeClassName:"recharts-active-bar"},t))}var C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(r,n){if("number"==typeof t)return t;var o=(0,l.Et)(r)||(0,l.uy)(r);return o?t(r,n):(o||(0,j.A)(!1),e)}},D=["value","background"];function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(){return(N=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,D);if(!a)return null;var u=R(R(R(R(R({},c),{},{fill:"#eee"},a),i),(0,w.XC)(t.props,e,r)),{},{onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd,dataKey:n,index:r,className:"recharts-bar-background-rectangle"});return s.createElement(T,N({key:"background-bar-".concat(r),option:t.props.background,isActive:r===o},u))})}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,o=r.xAxis,i=r.yAxis,a=r.layout,l=r.children,f=(0,u.aS)(l,b.u);if(!f)return null;var p="vertical"===a?n[0].height/2:n[0].width/2,h=function(t,e){var r=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:r,errorVal:(0,c.kr)(t,e)}};return s.createElement(m.W,{clipPath:t?"url(#clipPath-".concat(e,")"):null},f.map(function(t){return s.cloneElement(t,{key:"error-bar-".concat(e,"-").concat(t.props.dataKey),data:n,xAxis:o,yAxis:i,layout:a,offset:p,dataPointFormatter:h})}))}},{key:"render",value:function(){var t=this.props,e=t.hide,r=t.data,n=t.className,o=t.xAxis,i=t.yAxis,a=t.left,c=t.top,u=t.width,l=t.height,p=t.isAnimationActive,h=t.background,y=t.id;if(e||!r||!r.length)return null;var d=this.state.isAnimationFinished,b=(0,f.A)("recharts-bar",n),g=o&&o.allowDataOverflow,O=i&&i.allowDataOverflow,w=g||O,j=v()(y)?this.id:y;return s.createElement(m.W,{className:b},g||O?s.createElement("defs",null,s.createElement("clipPath",{id:"clipPath-".concat(j)},s.createElement("rect",{x:g?a:a-u/2,y:O?c:c-l/2,width:g?u:2*u,height:O?l:2*l}))):null,s.createElement(m.W,{className:"recharts-bar-rectangles",clipPath:w?"url(#clipPath-".concat(j,")"):null},h?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(w,j),(!p||d)&&x.Z.renderCallByParent(this.props,r))}}],r=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curData:t.data,prevData:e.curData}:t.data!==e.curData?{curData:t.data}:null}}],e&&L(n.prototype,e),r&&L(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}(s.PureComponent);function q(t){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(t,e){for(var r=0;r0&&Math.abs(g)0&&Math.abs(b)0&&(P=Math.min((t||0)-(E[e-1]||0),P))}),Number.isFinite(P)){var k=P/A,M="vertical"===m.layout?r.height:r.width;if("gap"===m.padding&&(u=k*M/2),"no-gap"===m.padding){var _=(0,l.F4)(t.barCategoryGap,k*M),T=k*M/2;u=T-_-(T-_)/M*_}}}f="xAxis"===n?[r.left+(O.left||0)+(u||0),r.left+r.width-(O.right||0)-(u||0)]:"yAxis"===n?"horizontal"===s?[r.top+r.height-(O.bottom||0),r.top+(O.top||0)]:[r.top+(O.top||0)+(u||0),r.top+r.height-(O.bottom||0)-(u||0)]:m.range,j&&(f=[f[1],f[0]]);var C=(0,c.W7)(m,o,y),D=C.scale,I=C.realScaleType;D.domain(g).range(f),(0,c.YB)(D);var N=(0,c.w7)(D,G(G({},m),{},{realScaleType:I}));"xAxis"===n?(v="top"===b&&!w||"bottom"===b&&w,p=r.left,d=h[S]-v*m.height):"yAxis"===n&&(v="left"===b&&!w||"right"===b&&w,p=h[S]-v*m.width,d=r.top);var B=G(G(G({},m),N),{},{realScaleType:I,x:p,y:d,scale:D,width:"xAxis"===n?r.width:m.width,height:"yAxis"===n?r.height:m.height});return B.bandSize=(0,c.Hj)(B,N),m.hide||"xAxis"!==n?m.hide||(h[S]+=(v?-1:1)*B.width):h[S]+=(v?-1:1)*B.height,G(G({},i),{},Y({},a,B))},{})},Z=function(t,e){var r=t.x,n=t.y,o=e.x,i=e.y;return{x:Math.min(r,o),y:Math.min(n,i),width:Math.abs(o-r),height:Math.abs(i-n)}},Q=function(t){return Z({x:t.x1,y:t.y1},{x:t.x2,y:t.y2})},tt=function(){var t,e;function r(t){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");this.scale=t}return t=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.bandAware,n=e.position;if(void 0!==t){if(n)switch(n){case"start":default:return this.scale(t);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(t)+i}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}return this.scale(t)}}},{key:"isInRange",value:function(t){var e=this.range(),r=e[0],n=e[e.length-1];return r<=n?t>=r&&t<=n:t>=n&&t<=r}}],e=[{key:"create",value:function(t){return new r(t)}}],t&&H(r.prototype,t),e&&H(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}();Y(tt,"EPS",1e-4);var te=function(t){var e=Object.keys(t).reduce(function(e,r){return G(G({},e),{},Y({},r,tt.create(t[r])))},{});return G(G({},e),{},{apply:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,i=r.position;return o()(t,function(t,r){return e[r].apply(t,{bandAware:n,position:i})})},isInRange:function(t){return a()(t,function(t,r){return e[r].isInRange(t)})}})},tr=function(t){var e=t.width,r=t.height,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(n%180+180)%180*Math.PI/180,i=Math.atan(r/e);return Math.abs(o>i&&o{"use strict";r.d(e,{R:()=>n});var n=function(t,e){var r=t.alwaysShow,n=t.ifOverflow;return r&&(n="extendDomain"),n===e}},13724:(t,e,r)=>{var n=r(59578),o=r(56426),i=r(39554),a=i&&i.isTypedArray;t.exports=a?o(a):n},14761:t=>{t.exports=function(t){return t.split("")}},15168:(t,e,r)=>{var n=r(93638),o=r(92935),i=r(19136);function a(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e{var n=r(37251);t.exports=function(t){return null==t?"":n(t)}},16981:(t,e,r)=>{"use strict";function n(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}r.d(e,{A:()=>n}),Array.prototype.slice},17075:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(t,e,n,i,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var c=new o(n,i||t,a),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],c]:t._events[u].push(c):(t._events[u]=c,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function c(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),c.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},c.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=Array(i);o{"use strict";r.d(e,{i:()=>u});let n=Math.PI,o=2*n,i=o-1e-6;function a(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw Error(`invalid digits: ${t}`);if(e>15)return a;let r=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;e1e-6)if(Math.abs(f*u-l*s)>1e-6&&i){let h=r-a,y=o-c,d=u*u+l*l,v=Math.sqrt(d),m=Math.sqrt(p),b=i*Math.tan((n-Math.acos((d+p-(h*h+y*y))/(2*v*m)))/2),g=b/m,x=b/v;Math.abs(g-1)>1e-6&&this._append`L${t+g*s},${e+g*f}`,this._append`A${i},${i},0,0,${+(f*h>s*y)},${this._x1=t+x*u},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,r,a,c,u){if(t*=1,e*=1,r*=1,u=!!u,r<0)throw Error(`negative radius: ${r}`);let l=r*Math.cos(a),s=r*Math.sin(a),f=t+l,p=e+s,h=1^u,y=u?a-c:c-a;null===this._x1?this._append`M${f},${p}`:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-p)>1e-6)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%o+o),y>i?this._append`A${r},${r},0,1,${h},${t-l},${e-s}A${r},${r},0,1,${h},${this._x1=f},${this._y1=p}`:y>1e-6&&this._append`A${r},${r},0,${+(y>=n)},${h},${this._x1=t+r*Math.cos(c)},${this._y1=e+r*Math.sin(c)}`)}rect(t,e,r,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r*=1}v${+n}h${-r}Z`}toString(){return this._}}function u(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{let t=Math.floor(r);if(!(t>=0))throw RangeError(`invalid digits: ${r}`);e=t}return t},()=>new c(e)}c.prototype},17601:(t,e,r)=>{var n=r(6572),o=r(99444),i=r(71503);t.exports=function(t){return t&&t.length?n(t,i,o):void 0}},17728:(t,e,r)=>{"use strict";r.d(e,{d:()=>M});var n=r(29320),o=r(38581),i=r.n(o),a=r(22973),c=r(73127),u=r(6566),l=r(1116),s=r(79899),f=r(63065),p=r(28647),h=["x1","y1","x2","y2","key"],y=["offset"];function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function m(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var x=function(t){var e=t.fill;if(!e||"none"===e)return null;var r=t.fillOpacity,o=t.x,i=t.y,a=t.width,c=t.height,u=t.ry;return n.createElement("rect",{x:o,y:i,ry:u,width:a,height:c,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function O(t,e){var r;if(n.isValidElement(t))r=n.cloneElement(t,e);else if(i()(t))r=t(e);else{var o=e.x1,a=e.y1,c=e.x2,l=e.y2,s=e.key,f=g(e,h),p=(0,u.J9)(f,!1),d=(p.offset,g(p,y));r=n.createElement("line",b({},d,{x1:o,y1:a,x2:c,y2:l,fill:"none",key:s}))}return r}function w(t){var e=t.x,r=t.width,o=t.horizontal,i=void 0===o||o,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var c=a.map(function(n,o){return O(i,m(m({},t),{},{x1:e,y1:n,x2:e+r,y2:n,key:"line-".concat(o),index:o}))});return n.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function j(t){var e=t.y,r=t.height,o=t.vertical,i=void 0===o||o,a=t.verticalPoints;if(!i||!a||!a.length)return null;var c=a.map(function(n,o){return O(i,m(m({},t),{},{x1:n,y1:e,x2:n,y2:e+r,key:"line-".concat(o),index:o}))});return n.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function S(t){var e=t.horizontalFill,r=t.fillOpacity,o=t.x,i=t.y,a=t.width,c=t.height,u=t.horizontalPoints,l=t.horizontal;if(!(void 0===l||l)||!e||!e.length)return null;var s=u.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,u){var l=s[u+1]?s[u+1]-t:i+c-t;if(l<=0)return null;var f=u%e.length;return n.createElement("rect",{key:"react-".concat(u),y:t,x:o,height:l,width:a,stroke:"none",fill:e[f],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return n.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function A(t){var e=t.vertical,r=t.verticalFill,o=t.fillOpacity,i=t.x,a=t.y,c=t.width,u=t.height,l=t.verticalPoints;if(!(void 0===e||e)||!r||!r.length)return null;var s=l.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,e){var l=s[e+1]?s[e+1]-t:i+c-t;if(l<=0)return null;var f=e%r.length;return n.createElement("rect",{key:"react-".concat(e),x:t,y:a,width:l,height:u,stroke:"none",fill:r[f],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return n.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var P=function(t,e){var r=t.xAxis,n=t.width,o=t.height,i=t.offset;return(0,l.PW)((0,s.f)(m(m(m({},f.u.defaultProps),r),{},{ticks:(0,l.Rh)(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.left,i.left+i.width,e)},E=function(t,e){var r=t.yAxis,n=t.width,o=t.height,i=t.offset;return(0,l.PW)((0,s.f)(m(m(m({},f.u.defaultProps),r),{},{ticks:(0,l.Rh)(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.top,i.top+i.height,e)},k={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function M(t){var e,r,o,u,l,s,f=(0,p.yi)(),h=(0,p.rY)(),y=(0,p.hj)(),v=m(m({},t),{},{stroke:null!=(e=t.stroke)?e:k.stroke,fill:null!=(r=t.fill)?r:k.fill,horizontal:null!=(o=t.horizontal)?o:k.horizontal,horizontalFill:null!=(u=t.horizontalFill)?u:k.horizontalFill,vertical:null!=(l=t.vertical)?l:k.vertical,verticalFill:null!=(s=t.verticalFill)?s:k.verticalFill,x:(0,c.Et)(t.x)?t.x:y.left,y:(0,c.Et)(t.y)?t.y:y.top,width:(0,c.Et)(t.width)?t.width:y.width,height:(0,c.Et)(t.height)?t.height:y.height}),g=v.x,O=v.y,M=v.width,_=v.height,T=v.syncWithTicks,C=v.horizontalValues,D=v.verticalValues,I=(0,p.pj)(),N=(0,p.$G)();if(!(0,c.Et)(M)||M<=0||!(0,c.Et)(_)||_<=0||!(0,c.Et)(g)||g!==+g||!(0,c.Et)(O)||O!==+O)return null;var B=v.verticalCoordinatesGenerator||P,R=v.horizontalCoordinatesGenerator||E,L=v.horizontalPoints,z=v.verticalPoints;if((!L||!L.length)&&i()(R)){var U=C&&C.length,F=R({yAxis:N?m(m({},N),{},{ticks:U?C:N.ticks}):void 0,width:f,height:h,offset:y},!!U||T);(0,a.R)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(d(F),"]")),Array.isArray(F)&&(L=F)}if((!z||!z.length)&&i()(B)){var $=D&&D.length,W=B({xAxis:I?m(m({},I),{},{ticks:$?D:I.ticks}):void 0,width:f,height:h,offset:y},!!$||T);(0,a.R)(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(d(W),"]")),Array.isArray(W)&&(z=W)}return n.createElement("g",{className:"recharts-cartesian-grid"},n.createElement(x,{fill:v.fill,fillOpacity:v.fillOpacity,x:v.x,y:v.y,width:v.width,height:v.height,ry:v.ry}),n.createElement(w,b({},v,{offset:y,horizontalPoints:L,xAxis:I,yAxis:N})),n.createElement(j,b({},v,{offset:y,verticalPoints:z,xAxis:I,yAxis:N})),n.createElement(S,b({},v,{horizontalPoints:L})),n.createElement(A,b({},v,{verticalPoints:z})))}M.displayName="CartesianGrid"},19136:t=>{t.exports=function(t){return this.__data__.has(t)}},19299:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;ec,Kg:()=>a,yy:()=>f}),r(76152),r(29320),r(38581);var a=Math.PI/180,c=function(t,e,r,n){return{x:t+Math.cos(-a*n)*r,y:e+Math.sin(-a*n)*r}},u=function(t,e){var r=t.x,n=t.y;return Math.sqrt(Math.pow(r-e.x,2)+Math.pow(n-e.y,2))},l=function(t,e){var r=t.x,n=t.y,o=e.cx,i=e.cy,a=u({x:r,y:n},{x:o,y:i});if(a<=0)return{radius:a};var c=Math.acos((r-o)/a);return n>i&&(c=2*Math.PI-c),{radius:a,angle:180*c/Math.PI,angleInRadian:c}},s=function(t){var e=t.startAngle,r=t.endAngle,n=Math.min(Math.floor(e/360),Math.floor(r/360));return{startAngle:e-360*n,endAngle:r-360*n}},f=function(t,e){var r,n=l({x:t.x,y:t.y},e),o=n.radius,a=n.angle,c=e.innerRadius,u=e.outerRadius;if(ou)return!1;if(0===o)return!0;var f=s(e),p=f.startAngle,h=f.endAngle,y=a;if(p<=h){for(;y>h;)y-=360;for(;y=p&&y<=h}else{for(;y>p;)y-=360;for(;y=h&&y<=p}return r?i(i({},e),{},{radius:o,angle:y+360*Math.min(Math.floor(e.startAngle/360),Math.floor(e.endAngle/360))}):null}},20480:(t,e,r)=>{var n=r(32197),o=r(97035),i=r(67156),a=r(58528),c=r(98840);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},21237:(t,e,r)=>{var n=r(44493);t.exports=function(t,e){if(t!==e){var r=void 0!==t,o=null===t,i=t==t,a=n(t),c=void 0!==e,u=null===e,l=e==e,s=n(e);if(!u&&!s&&!a&&t>e||a&&c&&l&&!u&&!s||o&&c&&l||!r&&l||!i)return 1;if(!o&&!a&&!s&&t{var n=r(71503),o=r(78906),i=r(31542);t.exports=function(t,e){return i(o(t,e,n),t+"")}},22834:(t,e,r)=>{var n=r(89780),o=r(53994),i=r(48630),a=Math.max;t.exports=function(t,e,r){var c=null==t?0:t.length;if(!c)return -1;var u=null==r?0:i(r);return u<0&&(u=a(c+u,0)),n(t,o(e,3),u)}},22973:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});var n=function(t,e){for(var r=arguments.length,n=Array(r>2?r-2:0),o=2;o{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r{var n=r(42712),o=r(41543),i=r(41631);t.exports=function(t){return function(e,r,a){return a&&"number"!=typeof a&&o(e,r,a)&&(r=a=void 0),e=i(e),void 0===r?(r=e,e=0):r=i(r),a=void 0===a?e{var n=r(43235),o=r(29738),i=r(53994);t.exports=function(t,e){var r={};return e=i(e,3),o(t,function(t,o,i){n(r,o,e(t,o,i))}),r}},24670:(t,e,r)=>{var n=r(39189),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0}},24917:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},26359:(t,e,r)=>{var n=r(63857),o=r(28894),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(t){return null==t?[]:n(a(t=Object(t)),function(e){return i.call(t,e)})}:o},27066:(t,e,r)=>{t.exports=r(33694)()},27390:(t,e,r)=>{t.exports=r(72442).Symbol},27637:(t,e,r)=>{"use strict";r.d(e,{yp:()=>C,GG:()=>z,NE:()=>D,nZ:()=>I,xQ:()=>N});var n=r(29320),o=r(38581),i=r.n(o),a=r(35272),c=r.n(a),u=r(81575),l=r.n(u),s=r(95903),f=r.n(s),p=r(47060),h=r(46138),y=r(84680),d=r(6566);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(){return(m=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:u,y:l},to:{upperWidth:s,lowerWidth:f,height:p,x:u,y:l},duration:j,animationEasing:g,isActive:A},function(t){var e=t.upperWidth,i=t.lowerWidth,c=t.height,u=t.x,l=t.y;return n.createElement(y.Ay,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,easing:g},n.createElement("path",m({},(0,d.J9)(r,!0),{className:P,d:O(u,l,e,i,c),ref:o})))}):n.createElement("g",null,n.createElement("path",m({},(0,d.J9)(r,!0),{className:P,d:O(u,l,s,f,p)})))},S=r(94889),A=r(54186),P=r(33284),E=["option","shapeType","propTransformer","activeClassName","isActive"];function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,E);if((0,n.isValidElement)(r))e=(0,n.cloneElement)(r,_(_({},f),(0,n.isValidElement)(r)?r.props:r));else if(i()(r))e=r(f);else if(c()(r)&&!l()(r)){var p=(void 0===a?function(t,e){return _(_({},e),t)}:a)(r,f);e=n.createElement(T,{shapeType:o,elementProps:p})}else e=n.createElement(T,{shapeType:o,elementProps:f});return s?n.createElement(A.W,{className:void 0===u?"recharts-active-shape":u},e):e}function D(t,e){return null!=e&&"trapezoids"in t.props}function I(t,e){return null!=e&&"sectors"in t.props}function N(t,e){return null!=e&&"points"in t.props}function B(t,e){var r,n,o=t.x===(null==e||null==(r=e.labelViewBox)?void 0:r.x)||t.x===e.x,i=t.y===(null==e||null==(n=e.labelViewBox)?void 0:n.y)||t.y===e.y;return o&&i}function R(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function L(t,e){var r=t.x===e.x,n=t.y===e.y,o=t.z===e.z;return r&&n&&o}function z(t){var e,r,n,o=t.activeTooltipItem,i=t.graphicalItem,a=t.itemData,c=(D(i,o)?e="trapezoids":I(i,o)?e="sectors":N(i,o)&&(e="points"),e),u=D(i,o)?null==(r=o.tooltipPayload)||null==(r=r[0])||null==(r=r.payload)?void 0:r.payload:I(i,o)?null==(n=o.tooltipPayload)||null==(n=n[0])||null==(n=n.payload)?void 0:n.payload:N(i,o)?o.payload:{},l=a.filter(function(t,e){var r=f()(u,t),n=i.props[c].filter(function(t){var e;return(D(i,o)?e=B:I(i,o)?e=R:N(i,o)&&(e=L),e)(t,o)}),a=i.props[c].indexOf(n[n.length-1]);return r&&e===a});return a.indexOf(l[l.length-1])}},28379:(t,e,r)=>{var n=r(79892),o=r(78173),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},28647:(t,e,r)=>{"use strict";r.d(e,{DR:()=>g,pj:()=>w,rY:()=>k,yi:()=>E,Yp:()=>x,hj:()=>P,sk:()=>A,AF:()=>O,Nk:()=>S,$G:()=>j});var n=r(29320),o=r(72317),i=r(87182),a=r.n(i),c=r(85072),u=r.n(c),l=r(58535),s=r.n(l)()(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return"l"+t.left+"t"+t.top+"w"+t.width+"h"+t.height}),f=r(73127),p=(0,n.createContext)(void 0),h=(0,n.createContext)(void 0),y=(0,n.createContext)(void 0),d=(0,n.createContext)({}),v=(0,n.createContext)(void 0),m=(0,n.createContext)(0),b=(0,n.createContext)(0),g=function(t){var e=t.state,r=e.xAxisMap,o=e.yAxisMap,i=e.offset,a=t.clipPathId,c=t.children,u=t.width,l=t.height,f=s(i);return n.createElement(p.Provider,{value:r},n.createElement(h.Provider,{value:o},n.createElement(d.Provider,{value:i},n.createElement(y.Provider,{value:f},n.createElement(v.Provider,{value:a},n.createElement(m.Provider,{value:l},n.createElement(b.Provider,{value:u},c)))))))},x=function(){return(0,n.useContext)(v)},O=function(t){var e=(0,n.useContext)(p);null==e&&(0,o.A)(!1);var r=e[t];return null==r&&(0,o.A)(!1),r},w=function(){var t=(0,n.useContext)(p);return(0,f.lX)(t)},j=function(){var t=(0,n.useContext)(h);return a()(t,function(t){return u()(t.domain,Number.isFinite)})||(0,f.lX)(t)},S=function(t){var e=(0,n.useContext)(h);null==e&&(0,o.A)(!1);var r=e[t];return null==r&&(0,o.A)(!1),r},A=function(){return(0,n.useContext)(y)},P=function(){return(0,n.useContext)(d)},E=function(){return(0,n.useContext)(b)},k=function(){return(0,n.useContext)(m)}},28894:t=>{t.exports=function(){return[]}},28919:(t,e,r)=>{"use strict";r.d(e,{E:()=>R});var n=r(29320),o=r(76152),i=r.n(o),a=r(46138),c=r(73127),u=r(62005),l=r(6566),s=r(83411);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:[];return t.reduce(function(t,e){var i=e.word,a=e.width,c=t[t.length-1];return c&&(null==n||o||c.width+a+ra||e.reduce(function(t,e){return t.width>e.width?t:e}).width>Number(n),e]},d=0,v=u.length-1,m=0;d<=v&&m<=u.length-1;){var b=Math.floor((d+v)/2),g=M(y(b-1),2),x=g[0],O=g[1],w=M(y(b),1)[0];if(x||w||(d=b+1),x&&w&&(v=b-1),!x&&w){i=O;break}m++}return i||h},I=function(t){return[{words:i()(t)?[]:t.toString().split(T)}]},N=function(t){var e=t.width,r=t.scaleToFit,n=t.children,o=t.style,i=t.breakAll,a=t.maxLines;if((e||r)&&!u.m.isSsr){var c=C({breakAll:i,children:n,style:o});if(!c)return I(n);var l=c.wordsWithComputedWidth,s=c.spaceWidth;return D({breakAll:i,children:n,maxLines:a,style:o},l,s,e,r)}return I(n)},B="#808080",R=function(t){var e,r=t.x,o=void 0===r?0:r,i=t.y,u=void 0===i?0:i,s=t.lineHeight,f=void 0===s?"1em":s,p=t.capHeight,h=void 0===p?"0.71em":p,y=t.scaleToFit,d=void 0!==y&&y,v=t.textAnchor,m=t.verticalAnchor,b=t.fill,g=void 0===b?B:b,x=k(t,A),O=(0,n.useMemo)(function(){return N({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),w=x.dx,j=x.dy,M=x.angle,_=x.className,T=x.breakAll,C=k(x,P);if(!(0,c.vh)(o)||!(0,c.vh)(u))return null;var D=o+((0,c.Et)(w)?w:0),I=u+((0,c.Et)(j)?j:0);switch(void 0===m?"end":m){case"start":e=S("calc(".concat(h,")"));break;case"middle":e=S("calc(".concat((O.length-1)/2," * -").concat(f," + (").concat(h," / 2))"));break;default:e=S("calc(".concat(O.length-1," * -").concat(f,")"))}var R=[];if(d){var L=O[0].width,z=x.width;R.push("scale(".concat(((0,c.Et)(z)?z/L:1)/L,")"))}return M&&R.push("rotate(".concat(M,", ").concat(D,", ").concat(I,")")),R.length&&(C.transform=R.join(" ")),n.createElement("text",E({},(0,l.J9)(C,!0),{x:D,y:I,className:(0,a.A)("recharts-text",_),textAnchor:void 0===v?"start":v,fill:g.includes("url")?B:g}),O.map(function(t,r){var o=t.words.join(T?"":" ");return n.createElement("tspan",{x:D,dy:0===r?e:f,key:"".concat(o,"-").concat(r)},o)}))}},29511:(t,e,r)=>{var n=r(6634),o=r(20480),i=r(64700);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},29738:(t,e,r)=>{var n=r(27066),o=r(76385);t.exports=function(t,e){return t&&n(t,e,o)}},29902:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},30204:(t,e,r)=>{var n=r(41804),o=r(86075),i=r(37350);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(r){return r===t||n(r,t,e)}}},31542:(t,e,r)=>{var n=r(11233);t.exports=r(99604)(n)},31935:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},32197:t=>{t.exports=function(){this.__data__=[],this.size=0}},32573:(t,e,r)=>{var n=r(21237);t.exports=function(t,e,r){for(var o=-1,i=t.criteria,a=e.criteria,c=i.length,u=r.length;++o=u)return l;return l*("desc"==r[o]?-1:1)}}return t.index-e.index}},32767:(t,e,r)=>{var n=r(82499),o=r(82664);t.exports=function t(e,r,i,a,c){var u=-1,l=e.length;for(i||(i=o),c||(c=[]);++u0&&i(s)?r>1?t(s,r-1,i,a,c):n(c,s):a||(c[c.length]=s)}return c}},33284:(t,e,r)=>{"use strict";r.d(e,{i:()=>D});var n=r(29320),o=r(8827),i=r.n(o);let a=Math.cos,c=Math.sin,u=Math.sqrt,l=Math.PI,s=2*l,f={draw(t,e){let r=u(e/l);t.moveTo(r,0),t.arc(0,0,r,0,s)}},p=u(1/3),h=2*p,y=c(l/10)/c(7*l/10),d=c(s/10)*y,v=-a(s/10)*y,m=u(3),b=u(3)/2,g=1/u(12),x=(g/2+1)*3;var O=r(60672),w=r(17588);u(3),u(3);var j=r(46138),S=r(6566);function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var P=["type","size","sizeType"];function E(){return(E=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,P)),{},{type:o,size:c,sizeType:l}),p=s.className,h=s.cx,y=s.cy,d=(0,S.J9)(s,!0);return h===+h&&y===+y&&c===+c?n.createElement("path",E({},d,{className:(0,j.A)("recharts-symbols",p),transform:"translate(".concat(h,", ").concat(y,")"),d:(e=_["symbol".concat(i()(o))]||f,(function(t,e){let r=null,n=(0,w.i)(o);function o(){let o;if(r||(r=o=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),o)return r=null,o+""||null}return t="function"==typeof t?t:(0,O.A)(t||f),e="function"==typeof e?e:(0,O.A)(void 0===e?64:+e),o.type=function(e){return arguments.length?(t="function"==typeof e?e:(0,O.A)(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:(0,O.A)(+t),o):e},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o})().type(e).size(C(c,l,o))())})):null};D.registerSymbol=function(t,e){_["symbol".concat(i()(t))]=e}},33689:(t,e,r)=>{var n=r(34155),o=r(24917);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},33694:t=>{t.exports=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),c=a.length;c--;){var u=a[t?c:++o];if(!1===r(i[u],u,i))break}return e}}},34155:(t,e,r)=>{var n=r(27390),o=r(52528),i=r(7453),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},34375:(t,e,r)=>{var n=r(61187),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},34378:(t,e,r)=>{var n=r(15168),o=r(74342),i=r(74334),a=r(96792),c=r(96478),u=r(47968);t.exports=function(t,e,r){var l=-1,s=o,f=t.length,p=!0,h=[],y=h;if(r)p=!1,s=i;else if(f>=200){var d=e?null:c(t);if(d)return u(d);p=!1,s=a,y=new n}else y=e?[]:h;e:for(;++l{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},35272:(t,e,r)=>{var n=r(34155),o=r(99984),i=r(24917),a=Object.prototype,c=Function.prototype.toString,u=a.hasOwnProperty,l=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=n(t))return!1;var e=o(t);if(null===e)return!0;var r=u.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==l}},35280:(t,e,r)=>{var n=r(34997);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},36988:(t,e,r)=>{var n=r(92978),o=r(84441);t.exports=function(t,e){return null!=t&&o(t,e,n)}},37007:(t,e,r)=>{t=r.nmd(t);var n=r(72442),o=r(92268),i=e&&!e.nodeType&&e,a=i&&t&&!t.nodeType&&t,c=a&&a.exports===i?n.Buffer:void 0,u=c?c.isBuffer:void 0;t.exports=u||o},37226:t=>{t.exports=Array.isArray},37251:(t,e,r)=>{var n=r(27390),o=r(4391),i=r(37226),a=r(44493),c=1/0,u=n?n.prototype:void 0,l=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return l?l.call(e):"";var r=e+"";return"0"==r&&1/e==-c?"-0":r}},37350:t=>{t.exports=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}},37385:(t,e,r)=>{var n=r(4391),o=r(53994),i=r(45439),a=r(37226);t.exports=function(t,e){return(a(t)?n:i)(t,o(e,3))}},38581:(t,e,r)=>{var n=r(34155),o=r(2346);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},38808:(t,e,r)=>{var n=r(4391),o=r(71465),i=r(53994),a=r(45439),c=r(73538),u=r(56426),l=r(32573),s=r(71503),f=r(37226);t.exports=function(t,e,r){e=e.length?n(e,function(t){return f(t)?function(e){return o(e,1===t.length?t[0]:t)}:t}):[s];var p=-1;return e=n(e,u(i)),c(a(t,function(t,r,o){return{criteria:n(e,function(e){return e(t)}),index:++p,value:t}}),function(t,e){return l(t,e,r)})}},39009:(t,e,r)=>{var n=r(55840),o=r(88859);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},39189:(t,e,r)=>{t.exports=r(39009)(Object,"create")},39554:(t,e,r)=>{t=r.nmd(t);var n=r(56439),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&n.process,c=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=c},40230:(t,e,r)=>{var n=r(98017),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,i,a,c){var u=1&r,l=n(t),s=l.length;if(s!=n(e).length&&!u)return!1;for(var f=s;f--;){var p=l[f];if(!(u?p in e:o.call(e,p)))return!1}var h=c.get(t),y=c.get(e);if(h&&y)return h==e&&y==t;var d=!0;c.set(t,e),c.set(e,t);for(var v=u;++f{"use strict";t.exports=r(94756)},40325:(t,e,r)=>{"use strict";var n=r(68250);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,r,o,i,a){if(a!==n){var c=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function e(){return t}t.isRequired=t;var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},40794:(t,e,r)=>{var n=r(35280);t.exports=function(t){return n(this,t).get(t)}},41543:(t,e,r)=>{var n=r(7091),o=r(10005),i=r(45126),a=r(2346);t.exports=function(t,e,r){if(!a(r))return!1;var c=typeof e;return("number"==c?!!(o(r)&&i(e,r.length)):"string"==c&&e in r)&&n(r[e],t)}},41631:(t,e,r)=>{var n=r(99857),o=1/0;t.exports=function(t){return t?(t=n(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},41662:(t,e,r)=>{"use strict";r.d(e,{A:()=>i,z:()=>a});var n=r(75283),o=r(76554);function i(){var t,e,r=(0,o.A)().unknown(void 0),a=r.domain,c=r.range,u=0,l=1,s=!1,f=0,p=0,h=.5;function y(){var r=a().length,n=l{var n=r(80754),o=r(97313);t.exports=function(t,e,r,i){var a=r.length,c=a,u=!i;if(null==t)return!c;for(t=Object(t);a--;){var l=r[a];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a{var n=r(35280);t.exports=function(t){return n(this,t).has(t)}},42712:t=>{var e=Math.ceil,r=Math.max;t.exports=function(t,n,o,i){for(var a=-1,c=r(e((n-t)/(o||1)),0),u=Array(c);c--;)u[i?c:++a]=t,t+=o;return u}},42812:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43235:(t,e,r)=>{var n=r(45888);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},43431:(t,e,r)=>{var n=r(2346);t.exports=function(t){return t==t&&!n(t)}},44013:t=>{t.exports=function(){}},44493:(t,e,r)=>{var n=r(34155),o=r(24917);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},45126:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t{var n=r(72306),o=r(10005);t.exports=function(t,e){var r=-1,i=o(t)?Array(t.length):[];return n(t,function(t,n,o){i[++r]=e(t,n,o)}),i}},45713:(t,e,r)=>{var n=r(59622),o=r(2346);t.exports=function(t,e,r){var i=!0,a=!0;if("function"!=typeof t)throw TypeError("Expected a function");return o(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),n(t,e,{leading:i,maxWait:e,trailing:a})}},45773:(t,e,r)=>{"use strict";r.d(e,{e:()=>_});var n=r(29320),o=r(38581),i=r.n(o),a=r(54429),c=r.n(a),u=r(46138),l=r(54186),s=r(67241),f=r(12752),p=r(73127),h=r(12644),y=r(22973),d=r(6566),v=r(28647);function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(b=function(){return!!t})()}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function x(t,e){return(x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function w(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r{var n=r(39009);t.exports=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}()},46319:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},47060:(t,e,r)=>{"use strict";r.d(e,{J:()=>h,M:()=>d});var n=r(29320),o=r(46138),i=r(84680),a=r(6566);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(){return(u=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0?1:-1,u=r>=0?1:-1,l=+(n>=0&&r>=0||n<0&&r<0);if(a>0&&o instanceof Array){for(var s=[0,0,0,0],f=0;f<4;f++)s[f]=o[f]>a?a:o[f];i="M".concat(t,",").concat(e+c*s[0]),s[0]>0&&(i+="A ".concat(s[0],",").concat(s[0],",0,0,").concat(l,",").concat(t+u*s[0],",").concat(e)),i+="L ".concat(t+r-u*s[1],",").concat(e),s[1]>0&&(i+="A ".concat(s[1],",").concat(s[1],",0,0,").concat(l,",\n ").concat(t+r,",").concat(e+c*s[1])),i+="L ".concat(t+r,",").concat(e+n-c*s[2]),s[2]>0&&(i+="A ".concat(s[2],",").concat(s[2],",0,0,").concat(l,",\n ").concat(t+r-u*s[2],",").concat(e+n)),i+="L ".concat(t+u*s[3],",").concat(e+n),s[3]>0&&(i+="A ".concat(s[3],",").concat(s[3],",0,0,").concat(l,",\n ").concat(t,",").concat(e+n-c*s[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);i="M ".concat(t,",").concat(e+c*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+u*p,",").concat(e,"\n L ").concat(t+r-u*p,",").concat(e,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+r,",").concat(e+c*p,"\n L ").concat(t+r,",").concat(e+n-c*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+r-u*p,",").concat(e+n,"\n L ").concat(t+u*p,",").concat(e+n,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t,",").concat(e+n-c*p," Z")}else i="M ".concat(t,",").concat(e," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return i},h=function(t,e){if(!t||!e)return!1;var r=t.x,n=t.y,o=e.x,i=e.y,a=e.width,c=e.height;if(Math.abs(a)>0&&Math.abs(c)>0){var u=Math.min(o,o+a),l=Math.max(o,o+a),s=Math.min(i,i+c),f=Math.max(i,i+c);return r>=u&&r<=l&&n>=s&&n<=f}return!1},y={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},d=function(t){var e,r=f(f({},y),t),c=(0,n.useRef)(),s=function(t){if(Array.isArray(t))return t}(e=(0,n.useState)(-1))||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{i=(r=r.call(t)).next,!1;for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,2)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(t,e)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=s[0],d=s[1];(0,n.useEffect)(function(){if(c.current&&c.current.getTotalLength)try{var t=c.current.getTotalLength();t&&d(t)}catch(t){}},[]);var v=r.x,m=r.y,b=r.width,g=r.height,x=r.radius,O=r.className,w=r.animationEasing,j=r.animationDuration,S=r.animationBegin,A=r.isAnimationActive,P=r.isUpdateAnimationActive;if(v!==+v||m!==+m||b!==+b||g!==+g||0===b||0===g)return null;var E=(0,o.A)("recharts-rectangle",O);return P?n.createElement(i.Ay,{canBegin:h>0,from:{width:b,height:g,x:v,y:m},to:{width:b,height:g,x:v,y:m},duration:j,animationEasing:w,isActive:P},function(t){var e=t.width,o=t.height,l=t.x,s=t.y;return n.createElement(i.Ay,{canBegin:h>0,from:"0px ".concat(-1===h?1:h,"px"),to:"".concat(h,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,isActive:A,easing:w},n.createElement("path",u({},(0,a.J9)(r,!0),{className:E,d:p(l,s,e,o,x),ref:c})))}):n.createElement("path",u({},(0,a.J9)(r,!0),{className:E,d:p(v,m,b,g,x)}))}},47421:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=!!e,e}},47968:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},48512:(t,e,r)=>{var n=r(82411),o=r(61735),i=r(37226),a=r(37007),c=r(45126),u=r(13724),l=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=i(t),s=!r&&o(t),f=!r&&!s&&a(t),p=!r&&!s&&!f&&u(t),h=r||s||f||p,y=h?n(t.length,String):[],d=y.length;for(var v in t)(e||l.call(t,v))&&!(h&&("length"==v||f&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||c(v,d)))&&y.push(v);return y}},48630:(t,e,r)=>{var n=r(41631);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},48882:(t,e,r)=>{"use strict";r.d(e,{c:()=>u});var n=r(29320),o=r(46138),i=r(427),a=r(6566);function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;e{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},50582:(t,e,r)=>{var n=r(10005);t.exports=function(t,e){return function(r,o){if(null==r)return r;if(!n(r))return t(r,o);for(var i=r.length,a=e?i:-1,c=Object(r);(e?a--:++a{var n=r(53994),o=r(10005),i=r(76385);t.exports=function(t){return function(e,r,a){var c=Object(e);if(!o(e)){var u=n(r,3);e=i(e),r=function(t){return u(c[t],t,c)}}var l=t(e,r,a);return l>-1?c[u?e[l]:l]:void 0}}},51955:(t,e,r)=>{"use strict";r.d(e,{g:()=>l});var n=r(56357),o=r(1116),i=r(6566);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{var n=r(27390),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),r=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[c]=r:delete t[c]),o}},53089:(t,e,r)=>{var n=r(53994),o=r(34378);t.exports=function(t,e){return t&&t.length?o(t,n(e,2)):[]}},53994:(t,e,r)=>{var n=r(30204),o=r(77293),i=r(71503),a=r(37226),c=r(74732);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):n(t):c(t)}},54038:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r{"use strict";r.d(e,{W:()=>u});var n=r(29320),o=r(46138),i=r(6566),a=["children","className"];function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,a),s=(0,o.A)("recharts-layer",u);return n.createElement("g",c({className:s},(0,i.J9)(l,!0),{ref:e}),r)})},54429:(t,e,r)=>{var n=r(23183),o=r(53994),i=r(77607),a=r(37226),c=r(41543);t.exports=function(t,e,r){var u=a(t)?n:i;return r&&c(t,e,r)&&(e=void 0),u(t,o(e,3))}},55494:(t,e,r)=>{t.exports=r(23191)()},55840:(t,e,r)=>{var n=r(38581),o=r(59135),i=r(2346),a=r(68302),c=/^\[object .+?Constructor\]$/,u=Object.prototype,l=Function.prototype.toString,s=u.hasOwnProperty,f=RegExp("^"+l.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?f:c).test(a(t))}},56357:(t,e,r)=>{"use strict";r.d(e,{s:()=>D});var n=r(29320),o=r(38581),i=r.n(o),a=r(46138),c=r(22973),u=r(95008),l=r(33284),s=r(427);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(){return(p=Object.assign?Object.assign.bind():function(t){for(var e=1;e');var x=e.inactive?h:e.color;return n.createElement("li",p({className:b,style:d,key:"legend-item-".concat(r)},(0,s.XC)(t.props,e,r)),n.createElement(u.u,{width:o,height:o,viewBox:y,style:v},t.renderIcon(e)),n.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},l?l(g,e,r):g))})}},{key:"render",value:function(){var t=this.props,e=t.payload,r=t.layout,o=t.align;return e&&e.length?n.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===r?o:"left"}},this.renderItems()):null}}],function(t,e){for(var r=0;r1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height,t&&t(e)):(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,t&&t(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?A({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(t){var e,r,n=this.props,o=n.layout,i=n.align,a=n.verticalAlign,c=n.margin,u=n.chartWidth,l=n.chartHeight;return t&&(void 0!==t.left&&null!==t.left||void 0!==t.right&&null!==t.right)||(e="center"===i&&"vertical"===o?{left:((u||0)-this.getBBoxSnapshot().width)/2}:"right"===i?{right:c&&c.right||0}:{left:c&&c.left||0}),t&&(void 0!==t.top&&null!==t.top||void 0!==t.bottom&&null!==t.bottom)||(r="middle"===a?{top:((l||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:c&&c.bottom||0}:{top:c&&c.top||0}),A(A({},e),r)}},{key:"render",value:function(){var t=this,e=this.props,r=e.content,o=e.width,i=e.height,a=e.wrapperStyle,c=e.payloadUniqBy,u=e.payload,l=A(A({position:"absolute",width:o||"auto",height:i||"auto"},this.getDefaultPosition(a)),a);return n.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(e){t.wrapperNode=e}},function(t,e){if(n.isValidElement(t))return n.cloneElement(t,e);if("function"==typeof t)return n.createElement(t,e);e.ref;var r=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,j);return n.createElement(g,r)}(r,A(A({},this.props),{},{payload:(0,O.s)(u,c,C)})))}}],r=[{key:"getWithHeight",value:function(t,e){var r=A(A({},this.defaultProps),t.props).layout;return"vertical"===r&&(0,x.Et)(t.props.height)?{height:t.props.height}:"horizontal"===r?{width:t.props.width||e}:null}}],e&&P(o.prototype,e),r&&P(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(n.PureComponent);_(D,"displayName","Legend"),_(D,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},56426:t=>{t.exports=function(t){return function(e){return t(e)}}},56439:(t,e,r)=>{t.exports="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g},57475:(t,e,r)=>{"use strict";r.d(e,{W:()=>v});var n=r(29320),o=r(46138),i=r(28647),a=r(63065),c=r(1116);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e,r){return(e=h(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}function y(){return(y=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var n=r(5070);t.exports=function(t){return n(this.__data__,t)>-1}},58535:(t,e,r)=>{var n=r(93638);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(o.Cache||n),r}o.Cache=n,t.exports=o},59135:(t,e,r)=>{var n=r(9566),o=function(){var t=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!o&&o in t}},59578:(t,e,r)=>{var n=r(34155),o=r(3957),i=r(24917),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[n(t)]}},59622:(t,e,r)=>{var n=r(2346),o=r(70767),i=r(99857),a=Math.max,c=Math.min;t.exports=function(t,e,r){var u,l,s,f,p,h,y=0,d=!1,v=!1,m=!0;if("function"!=typeof t)throw TypeError("Expected a function");function b(e){var r=u,n=l;return u=l=void 0,y=e,f=t.apply(n,r)}function g(t){var r=t-h,n=t-y;return void 0===h||r>=e||r<0||v&&n>=s}function x(){var t,r,n,i=o();if(g(i))return O(i);p=setTimeout(x,(t=i-h,r=i-y,n=e-t,v?c(n,s-r):n))}function O(t){return(p=void 0,m&&u)?b(t):(u=l=void 0,f)}function w(){var t,r=o(),n=g(r);if(u=arguments,l=this,h=r,n){if(void 0===p)return y=t=h,p=setTimeout(x,e),d?b(t):f;if(v)return clearTimeout(p),p=setTimeout(x,e),b(h)}return void 0===p&&(p=setTimeout(x,e)),f}return e=i(e)||0,n(r)&&(d=!!r.leading,s=(v="maxWait"in r)?a(i(r.maxWait)||0,e):s,m="trailing"in r?!!r.trailing:m),w.cancel=function(){void 0!==p&&clearTimeout(p),y=0,u=h=l=p=void 0},w.flush=function(){return void 0===p?f:O(o())},w}},60672:(t,e,r)=>{"use strict";function n(t){return function(){return t}}r.d(e,{A:()=>n})},61187:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},61735:(t,e,r)=>{var n=r(33689),o=r(24917),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(t){return o(t)&&a.call(t,"callee")&&!c.call(t,"callee")}},62005:(t,e,r)=>{"use strict";r.d(e,{m:()=>n});var n={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(t){return n[t]},set:function(t,e){if("string"==typeof t)n[t]=e;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(e){n[e]=t[e]})}}}},62491:(t,e,r)=>{var n=r(58535);t.exports=function(t){var e=n(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}},63065:(t,e,r)=>{"use strict";r.d(e,{u:()=>T});var n=r(29320),o=r(38581),i=r.n(o),a=r(71247),c=r.n(a),u=r(46138),l=r(92786),s=r(54186),f=r(28919),p=r(67241),h=r(73127),y=r(427),d=r(6566),v=r(79899),m=["viewBox"],b=["viewBox"],g=["ticks"];function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(){return(O=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function A(t,e){for(var r=0;r0?this.props:y)),o<=0||a<=0||!d||!d.length)?null:n.createElement(s.W,{className:(0,u.A)("recharts-cartesian-axis",l),ref:function(e){t.layerReference=e}},r&&this.renderAxisLine(),this.renderTicks(d,this.state.fontSize,this.state.letterSpacing),p.J.renderCallByParent(this.props))}}],r=[{key:"renderTickItem",value:function(t,e,r){var o=(0,u.A)(e.className,"recharts-cartesian-axis-tick-value");return n.isValidElement(t)?n.cloneElement(t,j(j({},e),{},{className:o})):i()(t)?t(j(j({},e),{},{className:o})):n.createElement(f.E,O({},e,{className:"recharts-cartesian-axis-tick-value"}),r)}}],e&&A(o.prototype,e),r&&A(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(n.Component);M(T,"displayName","CartesianAxis"),M(T,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"})},63633:(t,e,r)=>{"use strict";r.d(e,{Z:()=>A});var n=r(29320),o=r(76152),i=r.n(o),a=r(2346),c=r.n(a),u=r(38581),l=r.n(u),s=r(91097),f=r.n(s),p=r(67241),h=r(54186),y=r(6566),d=r(1116);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=["valueAccessor"],b=["data","dataKey","clockWise","id","textBreakAll"];function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var S=function(t){return Array.isArray(t.value)?f()(t.value):t.value};function A(t){var e=t.valueAccessor,r=void 0===e?S:e,o=j(t,m),a=o.data,c=o.dataKey,u=o.clockWise,l=o.id,s=o.textBreakAll,f=j(o,b);return a&&a.length?n.createElement(h.W,{className:"recharts-label-list"},a.map(function(t,e){var o=i()(c)?r(t,e):(0,d.kr)(t&&t.payload,c),a=i()(l)?{}:{id:"".concat(l,"-").concat(e)};return n.createElement(p.J,x({},(0,y.J9)(t,!0),f,a,{parentViewBox:t.parentViewBox,value:o,textBreakAll:s,viewBox:p.J.parseViewBox(i()(u)?t:w(w({},t),{},{clockWise:u})),key:"label-".concat(e),index:e}))})):null}A.displayName="LabelList",A.renderCallByParent=function(t,e){var r,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&o&&!t.label)return null;var i=t.children,a=(0,y.aS)(i,A).map(function(t,r){return(0,n.cloneElement)(t,{data:e,key:"labelList-".concat(r)})});return o?[(r=t.label,!r?null:!0===r?n.createElement(A,{key:"labelList-implicit",data:e}):n.isValidElement(r)||l()(r)?n.createElement(A,{key:"labelList-implicit",data:e,content:r}):c()(r)?n.createElement(A,x({data:e},r,{key:"labelList-implicit"})):null)].concat(function(t){if(Array.isArray(t))return g(t)}(a)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return g(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(t,e)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):a}},63796:(t,e,r)=>{var n=r(71465);t.exports=function(t){return function(e){return n(e,t)}}},63857:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r{t.exports=r(39009)(r(72442),"Map")},64761:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});let n=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},65024:(t,e,r)=>{var n=r(15168),o=r(23183),i=r(96792);t.exports=function(t,e,r,a,c,u){var l=1&r,s=t.length,f=e.length;if(s!=f&&!(l&&f>s))return!1;var p=u.get(t),h=u.get(e);if(p&&h)return p==e&&h==t;var y=-1,d=!0,v=2&r?new n:void 0;for(u.set(t,e),u.set(e,t);++y{var n=r(82499),o=r(37226);t.exports=function(t,e,r){var i=e(t);return o(t)?i:n(i,r(t))}},67156:(t,e,r)=>{var n=r(5070);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},67225:(t,e,r)=>{var n=r(35280);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=!!e,e}},67241:(t,e,r)=>{"use strict";r.d(e,{J:()=>A});var n=r(29320),o=r(76152),i=r.n(o),a=r(38581),c=r.n(a),u=r(2346),l=r.n(u),s=r(46138),f=r(28919),p=r(6566),h=r(73127),y=r(19299);function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var v=["offset"];function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0?1:-1;"insideStart"===c?(o=b+S*l,a=O):"insideEnd"===c?(o=g-S*l,a=!O):"end"===c&&(o=g+S*l,a=O),a=j<=0?a:!a;var A=(0,y.IZ)(p,d,w,o),P=(0,y.IZ)(p,d,w,o+(a?1:-1)*359),E="M".concat(A.x,",").concat(A.y,"\n A").concat(w,",").concat(w,",0,1,").concat(+!a,",\n ").concat(P.x,",").concat(P.y),k=i()(t.id)?(0,h.NF)("recharts-radial-line-"):t.id;return n.createElement("text",x({},r,{dominantBaseline:"central",className:(0,s.A)("recharts-radial-bar-label",f)}),n.createElement("defs",null,n.createElement("path",{id:k,d:E})),n.createElement("textPath",{xlinkHref:"#".concat(k)},e))},j=function(t){var e=t.viewBox,r=t.offset,n=t.position,o=e.cx,i=e.cy,a=e.innerRadius,c=e.outerRadius,u=(e.startAngle+e.endAngle)/2;if("outside"===n){var l=(0,y.IZ)(o,i,c+r,u),s=l.x;return{x:s,y:l.y,textAnchor:s>=o?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"end"};var f=(0,y.IZ)(o,i,(a+c)/2,u);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},S=function(t){var e=t.viewBox,r=t.parentViewBox,n=t.offset,o=t.position,i=e.x,a=e.y,c=e.width,u=e.height,s=u>=0?1:-1,f=s*n,p=s>0?"end":"start",y=s>0?"start":"end",d=c>=0?1:-1,v=d*n,m=d>0?"end":"start",b=d>0?"start":"end";if("top"===o)return g(g({},{x:i+c/2,y:a-s*n,textAnchor:"middle",verticalAnchor:p}),r?{height:Math.max(a-r.y,0),width:c}:{});if("bottom"===o)return g(g({},{x:i+c/2,y:a+u+f,textAnchor:"middle",verticalAnchor:y}),r?{height:Math.max(r.y+r.height-(a+u),0),width:c}:{});if("left"===o){var x={x:i-v,y:a+u/2,textAnchor:m,verticalAnchor:"middle"};return g(g({},x),r?{width:Math.max(x.x-r.x,0),height:u}:{})}if("right"===o){var O={x:i+c+v,y:a+u/2,textAnchor:b,verticalAnchor:"middle"};return g(g({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:u}:{})}var w=r?{width:c,height:u}:{};return"insideLeft"===o?g({x:i+v,y:a+u/2,textAnchor:b,verticalAnchor:"middle"},w):"insideRight"===o?g({x:i+c-v,y:a+u/2,textAnchor:m,verticalAnchor:"middle"},w):"insideTop"===o?g({x:i+c/2,y:a+f,textAnchor:"middle",verticalAnchor:y},w):"insideBottom"===o?g({x:i+c/2,y:a+u-f,textAnchor:"middle",verticalAnchor:p},w):"insideTopLeft"===o?g({x:i+v,y:a+f,textAnchor:b,verticalAnchor:y},w):"insideTopRight"===o?g({x:i+c-v,y:a+f,textAnchor:m,verticalAnchor:y},w):"insideBottomLeft"===o?g({x:i+v,y:a+u-f,textAnchor:b,verticalAnchor:p},w):"insideBottomRight"===o?g({x:i+c-v,y:a+u-f,textAnchor:m,verticalAnchor:p},w):l()(o)&&((0,h.Et)(o.x)||(0,h._3)(o.x))&&((0,h.Et)(o.y)||(0,h._3)(o.y))?g({x:i+(0,h.F4)(o.x,c),y:a+(0,h.F4)(o.y,u),textAnchor:"end",verticalAnchor:"end"},w):g({x:i+c/2,y:a+u/2,textAnchor:"middle",verticalAnchor:"middle"},w)};function A(t){var e,r=t.offset,o=g({offset:void 0===r?5:r},function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,v)),a=o.viewBox,u=o.position,l=o.value,y=o.children,d=o.content,m=o.className,b=o.textBreakAll;if(!a||i()(l)&&i()(y)&&!(0,n.isValidElement)(d)&&!c()(d))return null;if((0,n.isValidElement)(d))return(0,n.cloneElement)(d,o);if(c()(d)){if(e=(0,n.createElement)(d,o),(0,n.isValidElement)(e))return e}else e=O(o);var A="cx"in a&&(0,h.Et)(a.cx),P=(0,p.J9)(o,!0);if(A&&("insideStart"===u||"insideEnd"===u||"end"===u))return w(o,e,P);var E=A?j(o):S(o);return n.createElement(f.E,x({className:(0,s.A)("recharts-label",void 0===m?"":m)},P,E,{breakAll:b}),e)}A.displayName="Label";var P=function(t){var e=t.cx,r=t.cy,n=t.angle,o=t.startAngle,i=t.endAngle,a=t.r,c=t.radius,u=t.innerRadius,l=t.outerRadius,s=t.x,f=t.y,p=t.top,y=t.left,d=t.width,v=t.height,m=t.clockWise,b=t.labelViewBox;if(b)return b;if((0,h.Et)(d)&&(0,h.Et)(v)){if((0,h.Et)(s)&&(0,h.Et)(f))return{x:s,y:f,width:d,height:v};if((0,h.Et)(p)&&(0,h.Et)(y))return{x:p,y:y,width:d,height:v}}return(0,h.Et)(s)&&(0,h.Et)(f)?{x:s,y:f,width:0,height:0}:(0,h.Et)(e)&&(0,h.Et)(r)?{cx:e,cy:r,startAngle:o||n||0,endAngle:i||n||0,innerRadius:u||0,outerRadius:l||c||a||0,clockWise:m}:t.viewBox?t.viewBox:{}};A.parseViewBox=P,A.renderCallByParent=function(t,e){var r,o,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&i&&!t.label)return null;var a=t.children,u=P(t),s=(0,p.aS)(a,A).map(function(t,r){return(0,n.cloneElement)(t,{viewBox:e||u,key:"label-".concat(r)})});if(!i)return s;return[(r=t.label,o=e||u,!r?null:!0===r?n.createElement(A,{key:"label-implicit",viewBox:o}):(0,h.vh)(r)?n.createElement(A,{key:"label-implicit",viewBox:o,value:r}):(0,n.isValidElement)(r)?r.type===A?(0,n.cloneElement)(r,{key:"label-implicit",viewBox:o}):n.createElement(A,{key:"label-implicit",content:r,viewBox:o}):c()(r)?n.createElement(A,{key:"label-implicit",content:r,viewBox:o}):l()(r)?n.createElement(A,x({viewBox:o},r,{key:"label-implicit"})):null)].concat(function(t){if(Array.isArray(t))return m(t)}(s)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(s)||function(t,e){if(t){if("string"==typeof t)return m(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}},67524:(t,e,r)=>{"use strict";r.d(e,{b:()=>eO});var n=r(29320),o=r(76152),i=r.n(o),a=r(38581),c=r.n(a),u=r(55494),l=r.n(u),s=r(71247),f=r.n(s),p=r(91696),h=r.n(p),y=r(45713),d=r.n(y),v=r(46138),m=r(72317),b=r(95008),g=r(54186),x=r(8847),O=r(56357),w=r(48882),j=r(47060),S=r(6566),A=r(41662),P=r(28919),E=r(1116),k=r(73127);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function T(t){for(var e=1;e0&&e.handleDrag(t.changedTouches[0])}),W(e,"handleDragEnd",function(){e.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var t=e.props,r=t.endIndex,n=t.onDragEnd,o=t.startIndex;null==n||n({endIndex:r,startIndex:o})}),e.detachDragEndListener()}),W(e,"handleLeaveWrapper",function(){(e.state.isTravellerMoving||e.state.isSlideMoving)&&(e.leaveTimer=window.setTimeout(e.handleDragEnd,e.props.leaveTimeOut))}),W(e,"handleEnterSlideOrTraveller",function(){e.setState({isTextActive:!0})}),W(e,"handleLeaveSlideOrTraveller",function(){e.setState({isTextActive:!1})}),W(e,"handleSlideDragStart",function(t){var r=H(t)?t.changedTouches[0]:t;e.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),e.attachDragEndListener()}),e.travellerDragStartHandlers={startX:e.handleTravellerDragStart.bind(e,"startX"),endX:e.handleTravellerDragStart.bind(e,"endX")},e.state={},e}if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");return o.prototype=Object.create(t&&t.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),t&&$(o,t),e=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(t){var e=t.startX,r=t.endX,n=this.state.scaleValues,i=this.props,a=i.gap,c=i.data.length-1,u=Math.min(e,r),l=Math.max(e,r),s=o.getIndexInRange(n,u),f=o.getIndexInRange(n,l);return{startIndex:s-s%a,endIndex:f===c?c:f-f%a}}},{key:"getTextOfTick",value:function(t){var e=this.props,r=e.data,n=e.tickFormatter,o=e.dataKey,i=(0,E.kr)(r[t],o,t);return c()(n)?n(i,t):i}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(t){var e=this.state,r=e.slideMoveStartX,n=e.startX,o=e.endX,i=this.props,a=i.x,c=i.width,u=i.travellerWidth,l=i.startIndex,s=i.endIndex,f=i.onChange,p=t.pageX-r;p>0?p=Math.min(p,a+c-u-o,a+c-u-n):p<0&&(p=Math.max(p,a-n,a-o));var h=this.getIndex({startX:n+p,endX:o+p});(h.startIndex!==l||h.endIndex!==s)&&f&&f(h),this.setState({startX:n+p,endX:o+p,slideMoveStartX:t.pageX})}},{key:"handleTravellerDragStart",value:function(t,e){var r=H(e)?e.changedTouches[0]:e;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:t,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(t){var e=this.state,r=e.brushMoveStartX,n=e.movingTravellerId,o=e.endX,i=e.startX,a=this.state[n],c=this.props,u=c.x,l=c.width,s=c.travellerWidth,f=c.onChange,p=c.gap,h=c.data,y={startX:this.state.startX,endX:this.state.endX},d=t.pageX-r;d>0?d=Math.min(d,u+l-s-a):d<0&&(d=Math.max(d,u-a)),y[n]=a+d;var v=this.getIndex(y),m=v.startIndex,b=v.endIndex,g=function(){var t=h.length-1;return"startX"===n&&(o>i?m%p==0:b%p==0)||!!(oi?b%p==0:m%p==0)||!!(o>i)&&b===t};this.setState(W(W({},n,a+d),"brushMoveStartX",t.pageX),function(){f&&g()&&f(v)})}},{key:"handleTravellerMoveKeyboard",value:function(t,e){var r=this,n=this.state,o=n.scaleValues,i=n.startX,a=n.endX,c=this.state[e],u=o.indexOf(c);if(-1!==u){var l=u+t;if(-1!==l&&!(l>=o.length)){var s=o[l];"startX"===e&&s>=a||"endX"===e&&s<=i||this.setState(W({},e,s),function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))})}}}},{key:"renderBackground",value:function(){var t=this.props,e=t.x,r=t.y,o=t.width,i=t.height,a=t.fill,c=t.stroke;return n.createElement("rect",{stroke:c,fill:a,x:e,y:r,width:o,height:i})}},{key:"renderPanorama",value:function(){var t=this.props,e=t.x,r=t.y,o=t.width,i=t.height,a=t.data,c=t.children,u=t.padding,l=n.Children.only(c);return l?n.cloneElement(l,{x:e,y:r,width:o,height:i,margin:u,compact:!0,data:a}):null}},{key:"renderTravellerLayer",value:function(t,e){var r,i,a=this,c=this.props,u=c.y,l=c.travellerWidth,s=c.height,f=c.traveller,p=c.ariaLabel,h=c.data,y=c.startIndex,d=c.endIndex,v=Math.max(t,this.props.x),m=L(L({},(0,S.J9)(this.props,!1)),{},{x:v,y:u,width:l,height:s}),b=p||"Min value: ".concat(null==(r=h[y])?void 0:r.name,", Max value: ").concat(null==(i=h[d])?void 0:i.name);return n.createElement(g.W,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":t,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[e],onTouchStart:this.travellerDragStartHandlers[e],onKeyDown:function(t){["ArrowLeft","ArrowRight"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),a.handleTravellerMoveKeyboard("ArrowRight"===t.key?1:-1,e))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},o.renderTraveller(f,m))}},{key:"renderSlide",value:function(t,e){var r=this.props,o=r.y,i=r.height,a=r.stroke,c=r.travellerWidth,u=Math.min(t,e)+c,l=Math.max(Math.abs(e-t)-c,0);return n.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:a,fillOpacity:.2,x:u,y:o,width:l,height:i})}},{key:"renderText",value:function(){var t=this.props,e=t.startIndex,r=t.endIndex,o=t.y,i=t.height,a=t.travellerWidth,c=t.stroke,u=this.state,l=u.startX,s=u.endX,f={pointerEvents:"none",fill:c};return n.createElement(g.W,{className:"recharts-brush-texts"},n.createElement(P.E,B({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:o+i/2},f),this.getTextOfTick(e)),n.createElement(P.E,B({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+a+5,y:o+i/2},f),this.getTextOfTick(r)))}},{key:"render",value:function(){var t=this.props,e=t.data,r=t.className,o=t.children,i=t.x,a=t.y,c=t.width,u=t.height,l=t.alwaysShowText,s=this.state,f=s.startX,p=s.endX,h=s.isTextActive,y=s.isSlideMoving,d=s.isTravellerMoving,m=s.isTravellerFocused;if(!e||!e.length||!(0,k.Et)(i)||!(0,k.Et)(a)||!(0,k.Et)(c)||!(0,k.Et)(u)||c<=0||u<=0)return null;var b=(0,v.A)("recharts-brush",r),x=1===n.Children.count(o),O=I("userSelect","none");return n.createElement(g.W,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:O},this.renderBackground(),x&&this.renderPanorama(),this.renderSlide(f,p),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(p,"endX"),(h||y||d||m||l)&&this.renderText())}}],r=[{key:"renderDefaultTraveller",value:function(t){var e=t.x,r=t.y,o=t.width,i=t.height,a=t.stroke,c=Math.floor(r+i/2)-1;return n.createElement(n.Fragment,null,n.createElement("rect",{x:e,y:r,width:o,height:i,fill:a,stroke:"none"}),n.createElement("line",{x1:e+1,y1:c,x2:e+o-1,y2:c,fill:"none",stroke:"#fff"}),n.createElement("line",{x1:e+1,y1:c+2,x2:e+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(t,e){return n.isValidElement(t)?n.cloneElement(t,e):c()(t)?t(e):o.renderDefaultTraveller(e)}},{key:"getDerivedStateFromProps",value:function(t,e){var r=t.data,n=t.width,o=t.x,i=t.travellerWidth,a=t.updateId,c=t.startIndex,u=t.endIndex;if(r!==e.prevData||a!==e.prevUpdateId)return L({prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n},r&&r.length?q({data:r,width:n,x:o,travellerWidth:i,startIndex:c,endIndex:u}):{scale:null,scaleValues:null});if(e.scale&&(n!==e.prevWidth||o!==e.prevX||i!==e.prevTravellerWidth)){e.scale.range([o,o+n-i]);var l=e.scale.domain().map(function(t){return e.scale(t)});return{prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n,startX:e.scale(t.startIndex),endX:e.scale(t.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(t,e){for(var r=t.length,n=0,o=r-1;o-n>1;){var i=Math.floor((n+o)/2);t[i]>e?o=i:n=i}return e>=t[o]?o:n}}],e&&z(o.prototype,e),r&&z(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(n.PureComponent);W(V,"displayName","Brush"),W(V,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var G=r(83411),Y=r(51955),K=r(67241),J=r(12752),Z=r(12644),Q=r(22973);function tt(){return(tt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,tz));return(0,k.Et)(r)&&(0,k.Et)(i)&&(0,k.Et)(f)&&(0,k.Et)(h)&&(0,k.Et)(c)&&(0,k.Et)(l)?n.createElement("path",tU({},(0,S.J9)(d,!0),{className:(0,v.A)("recharts-cross",y),d:"M".concat(r,",").concat(c,"v").concat(h,"M").concat(l,",").concat(i,"h").concat(f)})):null};function tW(t){var e=t.cx,r=t.cy,n=t.radius,o=t.startAngle,i=t.endAngle;return{points:[(0,tP.IZ)(e,r,n,o),(0,tP.IZ)(e,r,n,i)],cx:e,cy:r,radius:n,startAngle:o,endAngle:i}}var tX=r(94889);function tq(t){return(tq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tH(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function tV(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function t2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(t2=function(){return!!t})()}function t3(t){return(t3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t6(t,e){return(t6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function t5(t){return function(t){if(Array.isArray(t))return t4(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||t7(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t7(t,e){if(t){if("string"==typeof t)return t4(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t4(t,e)}}function t4(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0?i:t&&t.length&&(0,k.Et)(n)&&(0,k.Et)(o)?t.slice(n,o+1):[]};function eu(t){return"number"===t?[0,"auto"]:void 0}var el=function(t,e,r,n){var o=t.graphicalItems,i=t.tooltipAxis,a=ec(e,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(o,c){var u,l,s=null!=(u=c.props.data)?u:e;if(s&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(s=s.slice(t.dataStartIndex,t.dataEndIndex+1)),i.dataKey&&!i.allowDuplicatedCategory){var f=void 0===s?a:s;l=(0,k.eP)(f,i.dataKey,n)}else l=s&&s[r]||a[r];return l?[].concat(t5(o),[(0,E.zb)(c,l)]):o},[])},es=function(t,e,r,n){var o=n||{x:t.chartX,y:t.chartY},i="horizontal"===r?o.x:"vertical"===r?o.y:"centric"===r?o.angle:o.radius,a=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,l=(0,E.gH)(i,a,u,c);if(l>=0&&u){var s=u[l]&&u[l].value,f=el(t,e,l,s),p=ea(r,a,l,o);return{activeTooltipIndex:l,activeLabel:s,activePayload:f,activeCoordinate:p}}return null},ef=function(t,e){var r=e.axes,n=e.graphicalItems,o=e.axisType,a=e.axisIdKey,c=e.stackGroups,u=e.dataStartIndex,s=e.dataEndIndex,f=t.layout,p=t.children,h=t.stackOffset,y=(0,E._L)(f,o);return r.reduce(function(e,r){var d=void 0!==r.type.defaultProps?t9(t9({},r.type.defaultProps),r.props):r.props,v=d.type,m=d.dataKey,b=d.allowDataOverflow,g=d.allowDuplicatedCategory,x=d.scale,O=d.ticks,w=d.includeHidden,j=d[a];if(e[j])return e;var S=ec(t.data,{graphicalItems:n.filter(function(t){var e;return(a in t.props?t.props[a]:null==(e=t.type.defaultProps)?void 0:e[a])===j}),dataStartIndex:u,dataEndIndex:s}),A=S.length;(function(t,e,r){if("number"===r&&!0===e&&Array.isArray(t)){var n=null==t?void 0:t[0],o=null==t?void 0:t[1];if(n&&o&&(0,k.Et)(n)&&(0,k.Et)(o))return!0}return!1})(d.domain,b,v)&&(_=(0,E.AQ)(d.domain,null,b),y&&("number"===v||"auto"!==x)&&(C=(0,E.Ay)(S,m,"category")));var P=eu(v);if(!_||0===_.length){var M,_,T,C,D,I=null!=(D=d.domain)?D:P;if(m){if(_=(0,E.Ay)(S,m,v),"category"===v&&y){var N=(0,k.CG)(_);g&&N?(T=_,_=l()(0,A)):g||(_=(0,E.KC)(I,_,r).reduce(function(t,e){return t.indexOf(e)>=0?t:[].concat(t5(t),[e])},[]))}else if("category"===v)_=g?_.filter(function(t){return""!==t&&!i()(t)}):(0,E.KC)(I,_,r).reduce(function(t,e){return t.indexOf(e)>=0||""===e||i()(e)?t:[].concat(t5(t),[e])},[]);else if("number"===v){var B=(0,E.A1)(S,n.filter(function(t){var e,r,n=a in t.props?t.props[a]:null==(e=t.type.defaultProps)?void 0:e[a],o="hide"in t.props?t.props.hide:null==(r=t.type.defaultProps)?void 0:r.hide;return n===j&&(w||!o)}),m,o,f);B&&(_=B)}y&&("number"===v||"auto"!==x)&&(C=(0,E.Ay)(S,m,"category"))}else _=y?l()(0,A):c&&c[j]&&c[j].hasStack&&"number"===v?"expand"===h?[0,1]:(0,E.Mk)(c[j].stackGroups,u,s):(0,E.vf)(S,n.filter(function(t){var e=a in t.props?t.props[a]:t.type.defaultProps[a],r="hide"in t.props?t.props.hide:t.type.defaultProps.hide;return e===j&&(w||!r)}),v,f,!0);"number"===v?(_=tA(p,_,j,o,O),I&&(_=(0,E.AQ)(I,_,b))):"category"===v&&I&&_.every(function(t){return I.indexOf(t)>=0})&&(_=I)}return t9(t9({},e),{},et({},j,t9(t9({},d),{},{axisType:o,domain:_,categoricalDomain:C,duplicateDomain:T,originalDomain:null!=(M=d.domain)?M:P,isCategorical:y,layout:f})))},{})},ep=function(t,e){var r=e.graphicalItems,n=e.Axis,o=e.axisType,i=e.axisIdKey,a=e.stackGroups,c=e.dataStartIndex,u=e.dataEndIndex,s=t.layout,p=t.children,h=ec(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),y=h.length,d=(0,E._L)(s,o),v=-1;return r.reduce(function(t,e){var m,b=(void 0!==e.type.defaultProps?t9(t9({},e.type.defaultProps),e.props):e.props)[i],g=eu("number");return t[b]?t:(v++,m=d?l()(0,y):a&&a[b]&&a[b].hasStack?tA(p,m=(0,E.Mk)(a[b].stackGroups,c,u),b,o):tA(p,m=(0,E.AQ)(g,(0,E.vf)(h,r.filter(function(t){var e,r,n=i in t.props?t.props[i]:null==(e=t.type.defaultProps)?void 0:e[i],o="hide"in t.props?t.props.hide:null==(r=t.type.defaultProps)?void 0:r.hide;return n===b&&!o}),"number",s),n.defaultProps.allowDataOverflow),b,o),t9(t9({},t),{},et({},b,t9(t9({axisType:o},n.defaultProps),{},{hide:!0,orientation:f()(er,"".concat(o,".").concat(v%2),null),domain:m,originalDomain:g,isCategorical:d,layout:s}))))},{})},eh=function(t,e){var r=e.axisType,n=void 0===r?"xAxis":r,o=e.AxisComp,i=e.graphicalItems,a=e.stackGroups,c=e.dataStartIndex,u=e.dataEndIndex,l=t.children,s="".concat(n,"Id"),f=(0,S.aS)(l,o),p={};return f&&f.length?p=ef(t,{axes:f,graphicalItems:i,axisType:n,axisIdKey:s,stackGroups:a,dataStartIndex:c,dataEndIndex:u}):i&&i.length&&(p=ep(t,{Axis:o,graphicalItems:i,axisType:n,axisIdKey:s,stackGroups:a,dataStartIndex:c,dataEndIndex:u})),p},ey=function(t){var e=(0,k.lX)(t),r=(0,E.Rh)(e,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:h()(r,function(t){return t.coordinate}),tooltipAxis:e,tooltipAxisBandSize:(0,E.Hj)(e,r)}},ed=function(t){var e=t.children,r=t.defaultShowTooltip,n=(0,S.BU)(e,V),o=0,i=0;return t.data&&0!==t.data.length&&(i=t.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(o=n.props.startIndex),n.props.endIndex>=0&&(i=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!r}},ev=function(t){return"horizontal"===t?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===t?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===t?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},em=function(t,e){var r=t.props,n=t.graphicalItems,o=t.xAxisMap,i=void 0===o?{}:o,a=t.yAxisMap,c=void 0===a?{}:a,u=r.width,l=r.height,s=r.children,p=r.margin||{},h=(0,S.BU)(s,V),y=(0,S.BU)(s,O.s),d=Object.keys(c).reduce(function(t,e){var r=c[e],n=r.orientation;return r.mirror||r.hide?t:t9(t9({},t),{},et({},n,t[n]+r.width))},{left:p.left||0,right:p.right||0}),v=Object.keys(i).reduce(function(t,e){var r=i[e],n=r.orientation;return r.mirror||r.hide?t:t9(t9({},t),{},et({},n,f()(t,"".concat(n))+r.height))},{top:p.top||0,bottom:p.bottom||0}),m=t9(t9({},v),d),b=m.bottom;h&&(m.bottom+=h.props.height||V.defaultProps.height),y&&e&&(m=(0,E.s0)(m,n,r,e));var g=u-m.left-m.right,x=l-m.top-m.bottom;return t9(t9({brushBottom:b},m),{},{width:Math.max(g,0),height:Math.max(x,0)})},eb=r(11452),eg=r(57475),ex=r(77264),eO=function(t){var e=t.chartName,r=t.GraphicalChild,o=t.defaultTooltipEventType,a=void 0===o?"axis":o,u=t.validateTooltipEventTypes,l=void 0===u?["axis"]:u,s=t.axisComponents,p=t.legendContent,h=t.formatAxisMap,y=t.defaultProps,O=function(t,e){var r=e.graphicalItems,n=e.stackGroups,o=e.offset,a=e.updateId,c=e.dataStartIndex,u=e.dataEndIndex,l=t.barSize,f=t.layout,p=t.barGap,h=t.barCategoryGap,y=t.maxBarSize,d=ev(f),v=d.numericAxisName,b=d.cateAxisName,g=!!r&&!!r.length&&r.some(function(t){var e=(0,S.Mn)(t&&t.type);return e&&e.indexOf("Bar")>=0}),x=[];return r.forEach(function(r,d){var O=ec(t.data,{graphicalItems:[r],dataStartIndex:c,dataEndIndex:u}),w=void 0!==r.type.defaultProps?t9(t9({},r.type.defaultProps),r.props):r.props,j=w.dataKey,A=w.maxBarSize,P=w["".concat(v,"Id")],k=w["".concat(b,"Id")],M=s.reduce(function(t,r){var n=e["".concat(r.axisType,"Map")],o=w["".concat(r.axisType,"Id")];n&&n[o]||"zAxis"===r.axisType||(0,m.A)(!1);var i=n[o];return t9(t9({},t),{},et(et({},r.axisType,i),"".concat(r.axisType,"Ticks"),(0,E.Rh)(i)))},{}),_=M[b],T=M["".concat(b,"Ticks")],C=n&&n[P]&&n[P].hasStack&&(0,E.kA)(r,n[P].stackGroups),D=(0,S.Mn)(r.type).indexOf("Bar")>=0,I=(0,E.Hj)(_,T),N=[],B=g&&(0,E.tA)({barSize:l,stackGroups:n,totalSize:"xAxis"===b?M[b].width:"yAxis"===b?M[b].height:void 0});if(D){var R,L,z=i()(A)?y:A,U=null!=(R=null!=(L=(0,E.Hj)(_,T,!0))?L:z)?R:0;N=(0,E.BX)({barGap:p,barCategoryGap:h,bandSize:U!==I?U:I,sizeList:B[k],maxBarSize:z}),U!==I&&(N=N.map(function(t){return t9(t9({},t),{},{position:t9(t9({},t.position),{},{offset:t.position.offset-U/2})})}))}var F=r&&r.type&&r.type.getComposedData;F&&x.push({props:t9(t9({},F(t9(t9({},M),{},{displayedData:O,props:t,dataKey:j,item:r,bandSize:I,barPosition:N,offset:o,stackedData:C,layout:f,dataStartIndex:c,dataEndIndex:u}))),{},et(et(et({key:r.key||"item-".concat(d)},v,M[v]),b,M[b]),"animationId",a)),childIndex:(0,S.AW)(r,t.children),item:r})}),x},A=function(t,n){var o=t.props,i=t.dataStartIndex,a=t.dataEndIndex,c=t.updateId;if(!(0,S.Me)({props:o}))return null;var u=o.children,l=o.layout,f=o.stackOffset,p=o.data,y=o.reverseStackOrder,d=ev(l),v=d.numericAxisName,m=d.cateAxisName,b=(0,S.aS)(u,r),g=(0,E.Mn)(p,b,"".concat(v,"Id"),"".concat(m,"Id"),f,y),x=s.reduce(function(t,e){var r="".concat(e.axisType,"Map");return t9(t9({},t),{},et({},r,eh(o,t9(t9({},e),{},{graphicalItems:b,stackGroups:e.axisType===v&&g,dataStartIndex:i,dataEndIndex:a}))))},{}),w=em(t9(t9({},x),{},{props:o,graphicalItems:b}),null==n?void 0:n.legendBBox);Object.keys(x).forEach(function(t){x[t]=h(o,x[t],w,t.replace("Map",""),e)});var j=ey(x["".concat(m,"Map")]),A=O(o,t9(t9({},x),{},{dataStartIndex:i,dataEndIndex:a,updateId:c,graphicalItems:b,stackGroups:g,offset:w}));return t9(t9({formattedGraphicalItems:A,graphicalItems:b,offset:w,stackGroups:g},j),x)},P=function(t){var r;function o(t){var r,a,u,l,s;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return l=o,s=[t],l=t3(l),et(u=function(t,e){if(e&&("object"===tZ(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");var r=t;if(void 0===r)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(this,t2()?Reflect.construct(l,s||[],t3(this).constructor):l.apply(this,s)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),et(u,"accessibilityManager",new tN),et(u,"handleLegendBBoxUpdate",function(t){if(t){var e=u.state,r=e.dataStartIndex,n=e.dataEndIndex,o=e.updateId;u.setState(t9({legendBBox:t},A({props:u.props,dataStartIndex:r,dataEndIndex:n,updateId:o},t9(t9({},u.state),{},{legendBBox:t}))))}}),et(u,"handleReceiveSyncEvent",function(t,e,r){u.props.syncId===t&&(r!==u.eventEmitterSymbol||"function"==typeof u.props.syncMethod)&&u.applySyncEvent(e)}),et(u,"handleBrushChange",function(t){var e=t.startIndex,r=t.endIndex;if(e!==u.state.dataStartIndex||r!==u.state.dataEndIndex){var n=u.state.updateId;u.setState(function(){return t9({dataStartIndex:e,dataEndIndex:r},A({props:u.props,dataStartIndex:e,dataEndIndex:r,updateId:n},u.state))}),u.triggerSyncEvent({dataStartIndex:e,dataEndIndex:r})}}),et(u,"handleMouseEnter",function(t){var e=u.getMouseInfo(t);if(e){var r=t9(t9({},e),{},{isTooltipActive:!0});u.setState(r),u.triggerSyncEvent(r);var n=u.props.onMouseEnter;c()(n)&&n(r,t)}}),et(u,"triggeredAfterMouseMove",function(t){var e=u.getMouseInfo(t),r=e?t9(t9({},e),{},{isTooltipActive:!0}):{isTooltipActive:!1};u.setState(r),u.triggerSyncEvent(r);var n=u.props.onMouseMove;c()(n)&&n(r,t)}),et(u,"handleItemMouseEnter",function(t){u.setState(function(){return{isTooltipActive:!0,activeItem:t,activePayload:t.tooltipPayload,activeCoordinate:t.tooltipPosition||{x:t.cx,y:t.cy}}})}),et(u,"handleItemMouseLeave",function(){u.setState(function(){return{isTooltipActive:!1}})}),et(u,"handleMouseMove",function(t){t.persist(),u.throttleTriggeredAfterMouseMove(t)}),et(u,"handleMouseLeave",function(t){u.throttleTriggeredAfterMouseMove.cancel();var e={isTooltipActive:!1};u.setState(e),u.triggerSyncEvent(e);var r=u.props.onMouseLeave;c()(r)&&r(e,t)}),et(u,"handleOuterEvent",function(t){var e,r=(0,S.X_)(t),n=f()(u.props,"".concat(r));r&&c()(n)&&n(null!=(e=/.*touch.*/i.test(r)?u.getMouseInfo(t.changedTouches[0]):u.getMouseInfo(t))?e:{},t)}),et(u,"handleClick",function(t){var e=u.getMouseInfo(t);if(e){var r=t9(t9({},e),{},{isTooltipActive:!0});u.setState(r),u.triggerSyncEvent(r);var n=u.props.onClick;c()(n)&&n(r,t)}}),et(u,"handleMouseDown",function(t){var e=u.props.onMouseDown;c()(e)&&e(u.getMouseInfo(t),t)}),et(u,"handleMouseUp",function(t){var e=u.props.onMouseUp;c()(e)&&e(u.getMouseInfo(t),t)}),et(u,"handleTouchMove",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&u.throttleTriggeredAfterMouseMove(t.changedTouches[0])}),et(u,"handleTouchStart",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&u.handleMouseDown(t.changedTouches[0])}),et(u,"handleTouchEnd",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&u.handleMouseUp(t.changedTouches[0])}),et(u,"handleDoubleClick",function(t){var e=u.props.onDoubleClick;c()(e)&&e(u.getMouseInfo(t),t)}),et(u,"handleContextMenu",function(t){var e=u.props.onContextMenu;c()(e)&&e(u.getMouseInfo(t),t)}),et(u,"triggerSyncEvent",function(t){void 0!==u.props.syncId&&tM.emit(t_,u.props.syncId,t,u.eventEmitterSymbol)}),et(u,"applySyncEvent",function(t){var e=u.props,r=e.layout,n=e.syncMethod,o=u.state.updateId,i=t.dataStartIndex,a=t.dataEndIndex;if(void 0!==t.dataStartIndex||void 0!==t.dataEndIndex)u.setState(t9({dataStartIndex:i,dataEndIndex:a},A({props:u.props,dataStartIndex:i,dataEndIndex:a,updateId:o},u.state)));else if(void 0!==t.activeTooltipIndex){var c=t.chartX,l=t.chartY,s=t.activeTooltipIndex,f=u.state,p=f.offset,h=f.tooltipTicks;if(!p)return;if("function"==typeof n)s=n(h,t);else if("value"===n){s=-1;for(var y=0;y=0){if(s.dataKey&&!s.allowDuplicatedCategory){var T="function"==typeof s.dataKey?function(t){return"function"==typeof s.dataKey?s.dataKey(t.payload):null}:"payload.".concat(s.dataKey.toString());D=(0,k.eP)(v,T,p),I=m&&b&&(0,k.eP)(b,T,p)}else D=null==v?void 0:v[f],I=m&&b&&b[f];if(A||j){var C=void 0!==t.props.activeIndex?t.props.activeIndex:f;return[(0,n.cloneElement)(t,t9(t9(t9({},o.props),M),{},{activeIndex:C})),null,null]}if(!i()(D))return[_].concat(t5(u.renderActivePoints({item:o,activePoint:D,basePoint:I,childIndex:f,isRange:m})))}else{var D,I,N,B=(null!=(N=u.getItemByXY(u.state.activeCoordinate))?N:{graphicalItem:_}).graphicalItem,R=B.item,L=void 0===R?t:R,z=B.childIndex,U=t9(t9(t9({},o.props),M),{},{activeIndex:z});return[(0,n.cloneElement)(L,U),null,null]}return m?[_,null,null]:[_,null]}),et(u,"renderCustomized",function(t,e,r){return(0,n.cloneElement)(t,t9(t9({key:"recharts-customized-".concat(r)},u.props),u.state))}),et(u,"renderMap",{CartesianGrid:{handler:ei,once:!0},ReferenceArea:{handler:u.renderReferenceElement},ReferenceLine:{handler:ei},ReferenceDot:{handler:u.renderReferenceElement},XAxis:{handler:ei},YAxis:{handler:ei},Brush:{handler:u.renderBrush,once:!0},Bar:{handler:u.renderGraphicChild},Line:{handler:u.renderGraphicChild},Area:{handler:u.renderGraphicChild},Radar:{handler:u.renderGraphicChild},RadialBar:{handler:u.renderGraphicChild},Scatter:{handler:u.renderGraphicChild},Pie:{handler:u.renderGraphicChild},Funnel:{handler:u.renderGraphicChild},Tooltip:{handler:u.renderCursor,once:!0},PolarGrid:{handler:u.renderPolarGrid,once:!0},PolarAngleAxis:{handler:u.renderPolarAxis},PolarRadiusAxis:{handler:u.renderPolarAxis},Customized:{handler:u.renderCustomized}}),u.clipPathId="".concat(null!=(r=t.id)?r:(0,k.NF)("recharts"),"-clip"),u.throttleTriggeredAfterMouseMove=d()(u.triggeredAfterMouseMove,null!=(a=t.throttleDelay)?a:1e3/60),u.state={},u}if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");return o.prototype=Object.create(t&&t.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),t&&t6(o,t),r=[{key:"componentDidMount",value:function(){var t,e;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!=(t=this.props.margin.left)?t:0,top:null!=(e=this.props.margin.top)?e:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var t=this.props,e=t.children,r=t.data,n=t.height,o=t.layout,i=(0,S.BU)(e,x.m);if(i){var a=i.props.defaultIndex;if("number"==typeof a&&!(a<0)&&!(a>this.state.tooltipTicks.length-1)){var c=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,u=el(this.state,r,a,c),l=this.state.tooltipTicks[a].coordinate,s=(this.state.offset.top+n)/2,f="horizontal"===o?{x:l,y:s}:{y:l,x:s},p=this.state.formattedGraphicalItems.find(function(t){return"Scatter"===t.item.type.name});p&&(f=t9(t9({},f),p.props.points[a].tooltipPosition),u=p.props.points[a].tooltipPayload);var h={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:c,activePayload:u,activeCoordinate:f};this.setState(h),this.renderCursor(i),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(t,e){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==e.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==t.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==t.margin){var r,n;this.accessibilityManager.setDetails({offset:{left:null!=(r=this.props.margin.left)?r:0,top:null!=(n=this.props.margin.top)?n:0}})}return null}},{key:"componentDidUpdate",value:function(t){(0,S.OV)([(0,S.BU)(t.children,x.m)],[(0,S.BU)(this.props.children,x.m)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var t=(0,S.BU)(this.props.children,x.m);if(t&&"boolean"==typeof t.props.shared){var e=t.props.shared?"axis":"item";return l.indexOf(e)>=0?e:a}return a}},{key:"getMouseInfo",value:function(t){if(!this.container)return null;var e=this.container,r=e.getBoundingClientRect(),n=(0,G.A3)(r),o={chartX:Math.round(t.pageX-n.left),chartY:Math.round(t.pageY-n.top)},i=r.width/e.offsetWidth||1,a=this.inRange(o.chartX,o.chartY,i);if(!a)return null;var c=this.state,u=c.xAxisMap,l=c.yAxisMap,s=this.getTooltipEventType(),f=es(this.state,this.props.data,this.props.layout,a);if("axis"!==s&&u&&l){var p=(0,k.lX)(u).scale,h=(0,k.lX)(l).scale,y=p&&p.invert?p.invert(o.chartX):null,d=h&&h.invert?h.invert(o.chartY):null;return t9(t9({},o),{},{xValue:y,yValue:d},f)}return f?t9(t9({},o),f):null}},{key:"inRange",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,o=t/r,i=e/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return o>=a.left&&o<=a.left+a.width&&i>=a.top&&i<=a.top+a.height?{x:o,y:i}:null}var c=this.state,u=c.angleAxisMap,l=c.radiusAxisMap;if(u&&l){var s=(0,k.lX)(u);return(0,tP.yy)({x:o,y:i},s)}return null}},{key:"parseEventsOfWrapper",value:function(){var t=this.props.children,e=this.getTooltipEventType(),r=(0,S.BU)(t,x.m),n={};return r&&"axis"===e&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),t9(t9({},(0,tT._U)(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){tM.on(t_,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){tM.removeListener(t_,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(t,e,r){for(var n=this.state.formattedGraphicalItems,o=0,i=n.length;o{var n=r(85655);t.exports=function(t,e,r){var o=t.length;return r=void 0===r?o:r,!e&&r>=o?t:n(t,e,r)}},68250:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},68302:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},68654:(t,e,r)=>{var n=r(72306);t.exports=function(t,e){var r=!0;return n(t,function(t,n,o){return r=!!e(t,n,o)}),r}},69483:(t,e,r)=>{var n=r(20480);t.exports=function(){this.__data__=new n,this.size=0}},69575:(t,e,r)=>{t.exports=r(39009)(r(72442),"DataView")},70767:(t,e,r)=>{var n=r(72442);t.exports=function(){return n.Date.now()}},71247:(t,e,r)=>{var n=r(71465);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},71465:(t,e,r)=>{var n=r(92466),o=r(72522);t.exports=function(t,e){e=n(e,t);for(var r=0,i=e.length;null!=t&&r{t.exports=function(t){return t}},71852:(t,e,r)=>{var n=r(32767),o=r(37385);t.exports=function(t,e){return n(o(t,e),1)}},72306:(t,e,r)=>{var n=r(29738);t.exports=r(50582)(n)},72317:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});function n(t,e){if(!t)throw Error("Invariant failed")}},72442:(t,e,r)=>{var n=r(56439),o="object"==typeof self&&self&&self.Object===Object&&self;t.exports=n||o||Function("return this")()},72522:(t,e,r)=>{var n=r(44493),o=1/0;t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}},73127:(t,e,r)=>{"use strict";r.d(e,{CG:()=>w,Dj:()=>j,Et:()=>d,F4:()=>x,NF:()=>g,_3:()=>y,ck:()=>A,eP:()=>S,lX:()=>O,sA:()=>h,uy:()=>v,vh:()=>m});var n=r(11172),o=r.n(n),i=r(97262),a=r.n(i),c=r(71247),u=r.n(c),l=r(1952),s=r.n(l),f=r(76152),p=r.n(f),h=function(t){return 0===t?0:t>0?1:-1},y=function(t){return o()(t)&&t.indexOf("%")===t.length-1},d=function(t){return s()(t)&&!a()(t)},v=function(t){return p()(t)},m=function(t){return d(t)||o()(t)},b=0,g=function(t){var e=++b;return"".concat(t||"").concat(e)},x=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!d(t)&&!o()(t))return n;if(y(t)){var c=t.indexOf("%");r=e*parseFloat(t.slice(0,c))/100}else r=+t;return a()(r)&&(r=n),i&&r>e&&(r=e),r},O=function(t){if(!t)return null;var e=Object.keys(t);return e&&e.length?t[e[0]]:null},w=function(t){if(!Array.isArray(t))return!1;for(var e=t.length,r={},n=0;n{t.exports=function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}},74334:t=>{t.exports=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n{var n=r(89420);t.exports=function(t,e){return!!(null==t?0:t.length)&&n(t,e,0)>-1}},74691:(t,e,r)=>{var n=r(39189);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},74732:(t,e,r)=>{var n=r(20594),o=r(63796),i=r(9761),a=r(72522);t.exports=function(t){return i(t)?n(a(t)):o(t)}},75283:(t,e,r)=>{"use strict";function n(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function o(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}r.d(e,{C:()=>n,K:()=>o})},76152:t=>{t.exports=function(t){return null==t}},76173:(t,e,r)=>{var n=r(27390),o=r(81083),i=r(7091),a=r(65024),c=r(82226),u=r(47968),l=n?n.prototype:void 0,s=l?l.valueOf:void 0;t.exports=function(t,e,r,n,l,f,p){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)break;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":if(t.byteLength!=e.byteLength||!f(new o(t),new o(e)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var h=c;case"[object Set]":var y=1&n;if(h||(h=u),t.size!=e.size&&!y)break;var d=p.get(t);if(d)return d==e;n|=2,p.set(t,e);var v=a(h(t),h(e),n,l,f,p);return p.delete(t),v;case"[object Symbol]":if(s)return s.call(t)==s.call(e)}return!1}},76385:(t,e,r)=>{var n=r(48512),o=r(28379),i=r(10005);t.exports=function(t){return i(t)?n(t):o(t)}},76554:(t,e,r)=>{"use strict";r.d(e,{A:()=>function t(){var e=new n,r=[],o=[],i=c;function u(t){let n=e.get(t);if(void 0===n){if(i!==c)return i;e.set(t,n=r.push(t)-1)}return o[n%o.length]}return u.domain=function(t){if(!arguments.length)return r.slice();for(let o of(r=[],e=new n,t))e.has(o)||e.set(o,r.push(o)-1);return u},u.range=function(t){return arguments.length?(o=Array.from(t),u):o.slice()},u.unknown=function(t){return arguments.length?(i=t,u):i},u.copy=function(){return t(r,o).unknown(i)},a.C.apply(u,arguments),u},h:()=>c});class n extends Map{constructor(t,e=i){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(let[e,r]of t)this.set(e,r)}get(t){return super.get(o(this,t))}has(t){return super.has(o(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}(this,t))}}function o({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function i(t){return null!==t&&"object"==typeof t?t.valueOf():t}var a=r(75283);let c=Symbol("implicit")},76579:(t,e,r)=>{var n=r(14761),o=r(98757),i=r(98281);t.exports=function(t){return o(t)?i(t):n(t)}},77264:(t,e,r)=>{"use strict";r.d(e,{h:()=>v});var n=r(29320),o=r(46138),i=r(28647),a=r(63065),c=r(1116);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e,r){return(e=h(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}function y(){return(y=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var n=r(97313),o=r(71247),i=r(36988),a=r(9761),c=r(43431),u=r(37350),l=r(72522);t.exports=function(t,e){return a(t)&&c(e)?u(l(t),e):function(r){var a=o(r,t);return void 0===a&&a===e?i(r,t):n(e,a,3)}}},77607:(t,e,r)=>{var n=r(72306);t.exports=function(t,e){var r;return n(t,function(t,n,o){return!(r=e(t,n,o))}),!!r}},77796:t=>{t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n{t.exports=r(3072)(Object.keys,Object)},78813:(t,e,r)=>{"use strict";r.d(e,{u:()=>v});var n=r(29320),o=r(72317),i=r(54186),a=r(6566),c=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,c),m=(0,a.J9)(v,!1);"x"===this.props.direction&&"number"!==y.type&&(0,o.A)(!1);var b=p.map(function(t){var o,a,c=h(t,f),p=c.x,v=c.y,b=c.value,g=c.errorVal;if(!g)return null;var x=[];if(Array.isArray(g)){var O=function(t){if(Array.isArray(t))return t}(g)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{i=(r=r.call(t)).next,!1;for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(g,2)||function(t,e){if(t){if("string"==typeof t)return s(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}}(g,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=O[0],a=O[1]}else o=a=g;if("vertical"===r){var w=y.scale,j=v+e,S=j+u,A=j-u,P=w(b-o),E=w(b+a);x.push({x1:E,y1:S,x2:E,y2:A}),x.push({x1:P,y1:j,x2:E,y2:j}),x.push({x1:P,y1:S,x2:P,y2:A})}else if("horizontal"===r){var k=d.scale,M=p+e,_=M-u,T=M+u,C=k(b-o),D=k(b+a);x.push({x1:_,y1:D,x2:T,y2:D}),x.push({x1:M,y1:C,x2:M,y2:D}),x.push({x1:_,y1:C,x2:T,y2:C})}return n.createElement(i.W,l({className:"recharts-errorBar",key:"bar-".concat(x.map(function(t){return"".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))},m),x.map(function(t){return n.createElement("line",l({},t,{key:"line-".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))}))});return n.createElement(i.W,{className:"recharts-errorBars"},b)}}],function(t,e){for(var r=0;r{var n=r(80710),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,c=o(i.length-e,0),u=Array(c);++a{var n=r(20480),o=r(64700),i=r(93638);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(t,e),this.size=r.size,this}},79892:t=>{var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},79899:(t,e,r)=>{"use strict";r.d(e,{f:()=>y});var n=r(38581),o=r.n(n),i=r(73127),a=r(83411),c=r(62005),u=r(12644);function l(t,e,r){if(e<1)return[];if(1===e&&void 0===r)return t;for(var n=[],o=0;ot*o)return!1;var i=r();return t*(e-t*i/2-n)>=0&&t*(e+t*i/2-o)<=0}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var e=1;e=2?(0,i.sA)(m[1].coordinate-m[0].coordinate):1,M=(n="width"===A,f=b.x,p=b.y,y=b.width,d=b.height,1===k?{start:n?f:p,end:n?f+y:p+d}:{start:n?f+y:p+d,end:n?f:p});return"equidistantPreserveStart"===O?function(t,e,r,n,o){for(var i,a=(n||[]).slice(),c=e.start,u=e.end,f=0,p=1,h=c;p<=a.length;)if(i=function(){var e,i=null==n?void 0:n[f];if(void 0===i)return{v:l(n,p)};var a=f,y=function(){return void 0===e&&(e=r(i,a)),e},d=i.coordinate,v=0===f||s(t,d,y,h,u);v||(f=0,h=c,p+=1),v&&(h=d+t*(y()/2+o),f+=p)}())return i.v;return[]}(k,M,E,m,g):("preserveStart"===O||"preserveStartEnd"===O?function(t,e,r,n,o,i){var a=(n||[]).slice(),c=a.length,u=e.start,l=e.end;if(i){var f=n[c-1],p=r(f,c-1),y=t*(f.coordinate+t*p/2-l);a[c-1]=f=h(h({},f),{},{tickCoord:y>0?f.coordinate-y*t:f.coordinate}),s(t,f.tickCoord,function(){return p},u,l)&&(l=f.tickCoord-t*(p/2+o),a[c-1]=h(h({},f),{},{isShow:!0}))}for(var d=i?c-1:c,v=function(e){var n,i=a[e],c=function(){return void 0===n&&(n=r(i,e)),n};if(0===e){var f=t*(i.coordinate-t*c()/2-u);a[e]=i=h(h({},i),{},{tickCoord:f<0?i.coordinate-f*t:i.coordinate})}else a[e]=i=h(h({},i),{},{tickCoord:i.coordinate});s(t,i.tickCoord,c,u,l)&&(u=i.tickCoord+t*(c()/2+o),a[e]=h(h({},i),{},{isShow:!0}))},m=0;m0?l.coordinate-p*t:l.coordinate})}else i[e]=l=h(h({},l),{},{tickCoord:l.coordinate});s(t,l.tickCoord,f,c,u)&&(u=l.tickCoord-t*(f()/2+o),i[e]=h(h({},l),{},{isShow:!0}))},f=a-1;f>=0;f--)l(f);return i}(k,M,E,m,g)).filter(function(t){return t.isShow})}},80005:t=>{t.exports=function(t){return function(){return t}}},80710:t=>{t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},80754:(t,e,r)=>{var n=r(20480),o=r(69483),i=r(2645),a=r(98262),c=r(81618),u=r(79786);function l(t){var e=this.__data__=new n(t);this.size=e.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=c,l.prototype.set=u,t.exports=l},81083:(t,e,r)=>{t.exports=r(72442).Uint8Array},81575:(t,e,r)=>{var n=r(34155),o=r(24917);t.exports=function(t){return!0===t||!1===t||o(t)&&"[object Boolean]"==n(t)}},81618:t=>{t.exports=function(t){return this.__data__.has(t)}},82226:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}},82411:t=>{t.exports=function(t,e){for(var r=-1,n=Array(t);++r{t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r{var n=r(27390),o=r(61735),i=r(37226),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},83411:(t,e,r)=>{"use strict";r.d(e,{A3:()=>f,Pu:()=>s});var n=r(62005);function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||n.m.isSsr)return{width:0,height:0};var o=(Object.keys(e=a({},r)).forEach(function(t){e[t]||delete e[t]}),e),i=JSON.stringify({text:t,copyStyle:o});if(c.widthCache[i])return c.widthCache[i];try{var s=document.getElementById(l);s||((s=document.createElement("span")).setAttribute("id",l),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var f=a(a({},u),o);Object.assign(s.style,f),s.textContent="".concat(t);var p=s.getBoundingClientRect(),h={width:p.width,height:p.height};return c.widthCache[i]=h,++c.cacheCount>2e3&&(c.cacheCount=0,c.widthCache={}),h}catch(t){return{width:0,height:0}}},f=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}}},83487:(t,e,r)=>{t.exports=r(39009)(r(72442),"Promise")},83499:(t,e,r)=>{t.exports=r(40325)()},84441:(t,e,r)=>{var n=r(92466),o=r(61735),i=r(37226),a=r(45126),c=r(3957),u=r(72522);t.exports=function(t,e,r){e=n(e,t);for(var l=-1,s=e.length,f=!1;++l{var n=r(39189),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},84680:(t,e,r)=>{"use strict";r.d(e,{Ay:()=>tP});var n=r(29320),o=r(83499),i=r.n(o);let{getOwnPropertyNames:a,getOwnPropertySymbols:c}=Object,{hasOwnProperty:u}=Object.prototype;function l(t,e){return function(r,n,o){return t(r,n,o)&&e(r,n,o)}}function s(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);let{cache:o}=n,i=o.get(e),a=o.get(r);if(i&&a)return i===r&&a===e;o.set(e,r),o.set(r,e);let c=t(e,r,n);return o.delete(e),o.delete(r),c}}function f(t){return a(t).concat(c(t))}let p=Object.hasOwn||((t,e)=>u.call(t,e));function h(t,e){return t===e||!t&&!e&&t!=t&&e!=e}let y="undefined"!=typeof Float16Array,{getOwnPropertyDescriptor:d,keys:v}=Object;function m(t,e){return t.byteLength===e.byteLength&&M(new Uint8Array(t),new Uint8Array(e))}function b(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function g(t,e){return t.byteLength===e.byteLength&&M(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function x(t,e){return h(t.getTime(),e.getTime())}function O(t,e,r){return t.name===e.name&&t.message===e.message&&t.stack===e.stack&&r.equals(t.cause,e.cause,"cause","cause",t,e,r)}function w(t,e){return t===e}function j(t,e,r){let n,o,i=t.size;if(i!==e.size)return!1;if(!i)return!0;let a=Array(i),c=t.entries(),u=0;for(;(n=c.next())&&!n.done;){let i=e.entries(),c=!1,l=0;for(;(o=i.next())&&!o.done;){if(a[l]){l++;continue}let i=n.value,s=o.value;if(r.equals(i[0],s[0],u,l,t,e,r)&&r.equals(i[1],s[1],i[0],s[0],t,e,r)){c=a[l]=!0;break}l++}if(!c)return!1;u++}return!0}function S(t,e,r){let n=v(t),o=n.length;if(v(e).length!==o)return!1;for(;o-- >0;)if(!C(t,e,r,n[o]))return!1;return!0}function A(t,e,r){let n,o,i,a=f(t),c=a.length;if(f(e).length!==c)return!1;for(;c-- >0;)if(!C(t,e,r,n=a[c])||(o=d(t,n),i=d(e,n),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable)))return!1;return!0}function P(t,e){return h(t.valueOf(),e.valueOf())}function E(t,e){return t.source===e.source&&t.flags===e.flags}function k(t,e,r){let n,o,i=t.size;if(i!==e.size)return!1;if(!i)return!0;let a=Array(i),c=t.values();for(;(n=c.next())&&!n.done;){let i=e.values(),c=!1,u=0;for(;(o=i.next())&&!o.done;){if(!a[u]&&r.equals(n.value,o.value,n.value,o.value,t,e,r)){c=a[u]=!0;break}u++}if(!c)return!1}return!0}function M(t,e){let r=t.length;if(e.length!==r||t.byteOffset!==e.byteOffset)return!1;if(t instanceof Float64Array||t instanceof Float32Array||y&&t instanceof Float16Array){for(;r-- >0;)if(t[r]!==e[r]&&(t[r]==t[r]||e[r]==e[r]))return!1;return!0}for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function _(t,e){return t.href===e.href||t.protocol===e.protocol&&t.username===e.username&&t.password===e.password&&t.host===e.host&&t.pathname===e.pathname&&t.hash===e.hash&&function(t,e){let r=t.toString(),n=e.toString();return r===n||T(r)===T(n)}(t.searchParams,e.searchParams)}function T(t){return t.split("&").sort().join("&")}function C(t,e,r,n){return("_owner"===n||"__o"===n||"__v"===n)&&(!!t.$$typeof||!!e.$$typeof)||p(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}let D={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},I=Object.prototype.toString,N=B();function B(t={}){let{circular:e=!1,createInternalComparator:r,createState:n,strict:o=!1}=t,i=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:c,areObjectsEqual:u,arePrimitiveWrappersEqual:l,areRegExpsEqual:s,areSetsEqual:f,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:y}){return function(d,v,m){if(d===v)return!0;if(null==d||null==v)return!1;let b=typeof d;if(b!==typeof v)return!1;if("object"!==b)return"number"===b?c(d,v,m):"function"===b&&i(d,v,m);let g=d.constructor;if(g!==v.constructor)return!1;if(g===Object)return u(d,v,m);if(Array.isArray(d))return e(d,v,m);if(g===Date)return n(d,v,m);if(g===RegExp)return s(d,v,m);if(g===Map)return a(d,v,m);if(g===Set)return f(d,v,m);if(null==g)return u(d,v,m);let x=I.call(d);if("[object Date]"===x)return n(d,v,m);if("[object RegExp]"===x)return s(d,v,m);if("[object Map]"===x)return a(d,v,m);if("[object Set]"===x)return f(d,v,m);if("[object Object]"===x)return"function"!=typeof d.then&&"function"!=typeof v.then&&u(d,v,m);if("[object URL]"===x)return h(d,v,m);if("[object Error]"===x)return o(d,v,m);if("[object Arguments]"===x)return u(d,v,m);if(D[x])return p(d,v,m);if("[object ArrayBuffer]"===x)return t(d,v,m);if("[object DataView]"===x)return r(d,v,m);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(d,v,m);if(y){let t=y[x];if(!t){let e=null!=d?d[Symbol.toStringTag]:void 0;e&&(t=y[e])}if(t)return t(d,v,m)}return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:m,areArraysEqual:r?A:b,areDataViewsEqual:g,areDatesEqual:x,areErrorsEqual:r?l(O,A):l(O,S),areFunctionsEqual:w,areMapsEqual:r?l(j,A):j,areNumbersEqual:h,areObjectsEqual:r?A:S,arePrimitiveWrappersEqual:P,areRegExpsEqual:E,areSetsEqual:r?l(k,A):k,areTypedArraysEqual:r?l(M,A):M,areUrlsEqual:_,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){let t=s(n.areArraysEqual),e=s(n.areErrorsEqual),r=s(n.areMapsEqual),o=s(n.areObjectsEqual),i=s(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areErrorsEqual:e,areMapsEqual:r,areObjectsEqual:o,areSetsEqual:i})}return n}(t)),a=r?r(i):function(t,e,r,n,o,a,c){return i(t,e,c)};return function({circular:t,comparator:e,createState:r,equals:n,strict:o}){if(r)return function(i,a){let{cache:c=t?new WeakMap:void 0,meta:u}=r();return e(i,a,{cache:c,equals:n,meta:u,strict:o})};if(t)return function(t,r){return e(t,r,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let i={cache:void 0,equals:n,meta:void 0,strict:o};return function(t,r){return e(t,r,i)}}({circular:e,comparator:i,createState:n,equals:a,strict:o})}function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1;requestAnimationFrame(function n(o){if(r<0&&(r=o),o-r>e)t(o),r=-1;else{var i;i=n,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(i)}})}function L(t){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rh}),B({strict:!0,createInternalComparator:()=>h}),B({circular:!0,createInternalComparator:()=>h}),B({circular:!0,createInternalComparator:()=>h,strict:!0});var X=function(t){return t},q=function(t,e){return Object.keys(e).reduce(function(r,n){return $($({},r),{},W({},n,t(n,e[n])))},{})},H=function(t,e,r){return t.map(function(t){return"".concat(t.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})," ").concat(e,"ms ").concat(r)}).join(",")},V=function(t,e,r,n,o,i,a,c){};function G(t,e){if(t){if("string"==typeof t)return Y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y(t,e)}}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0&&t<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",n);var p=Z(i,c),h=Z(a,u),y=(t=i,e=c,function(r){var n;return J([].concat(function(t){if(Array.isArray(t))return Y(t)}(n=K(t,e).map(function(t,e){return t*e}).slice(1))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||G(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),r)}),d=function(t){for(var e=t>1?1:t,r=e,n=0;n<8;++n){var o,i=p(r)-e,a=y(r);if(1e-4>Math.abs(i-e)||a<1e-4)break;r=(o=r-i/a)>1?1:o<0?0:o}return h(r)};return d.isStepper=!1,d},tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiff,r=void 0===e?100:e,n=t.damping,o=void 0===n?8:n,i=t.dt,a=void 0===i?17:i,c=function(t,e,n){var i=n+(-(t-e)*r-n*o)*a/1e3,c=n*a/1e3+t;return 1e-4>Math.abs(c-e)&&1e-4>Math.abs(i)?[e,0]:[c,i]};return c.isStepper=!0,c.dt=a,c},te=function(){for(var t=arguments.length,e=Array(t),r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r0?r[o-1]:n,p=l||Object.keys(u);if("function"==typeof c||"spring"===c)return[].concat(td(t),[e.runJSAnimation.bind(e,{from:f.style,to:u,duration:i,easing:c}),i]);var h=H(p,i,c),y=tb(tb(tb({},f.style),u),{},{transition:h});return[].concat(td(t),[y,i,s]).filter(X)},[a,Math.max(void 0===c?0:c,n)])),[t.onAnimationEnd]))}},{key:"runAnimation",value:function(t){this.manager||(this.manager=(e=function(){return null},r=!1,n=function t(n){if(!r){if(Array.isArray(n)){if(!n.length)return;var o=function(t){if(Array.isArray(t))return t}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return z(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,e)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o.slice(1);return"number"==typeof i?void R(t.bind(null,a),i):(t(i),void R(t.bind(null,a)))}"object"===L(n)&&e(n),"function"==typeof n&&n()}},{stop:function(){r=!0},start:function(t){r=!1,n(t)},subscribe:function(t){return e=t,function(){e=function(){return null}}}}));var e,r,n,o=t.begin,i=t.duration,a=t.attributeName,c=t.to,u=t.easing,l=t.onAnimationStart,s=t.onAnimationEnd,f=t.steps,p=t.children,h=this.manager;if(this.unSubscribe=h.subscribe(this.handleStyleChange),"function"==typeof u||"function"==typeof p||"spring"===u)return void this.runJSAnimation(t);if(f.length>1)return void this.runStepAnimation(t);var y=a?tg({},a,c):c,d=H(Object.keys(y),i,u);h.start([l,o,tb(tb({},y),{},{transition:d}),i,s])}},{key:"render",value:function(){var t=this.props,e=t.children,r=(t.begin,t.duration),o=(t.attributeName,t.easing,t.isActive),i=(t.steps,t.from,t.to,t.canBegin,t.onAnimationEnd,t.shouldReAnimate,t.onAnimationReStart,function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,ty)),a=n.Children.count(e),c=this.state.style;if("function"==typeof e)return e(c);if(!o||0===a||r<=0)return e;var u=function(t){var e=t.props,r=e.style,o=e.className;return(0,n.cloneElement)(t,tb(tb({},i),{},{style:tb(tb({},void 0===r?{}:r),c),className:o}))};return 1===a?u(n.Children.only(e)):n.createElement("div",null,n.Children.map(e,function(t){return u(t)}))}}],function(t,e){for(var r=0;r{var n=r(54038),o=r(68654),i=r(53994),a=r(37226),c=r(41543);t.exports=function(t,e,r){var u=a(t)?n:o;return r&&c(t,e,r)&&(e=void 0),u(t,i(e,3))}},85655:t=>{t.exports=function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n{var n=r(43431),o=r(76385);t.exports=function(t){for(var e=o(t),r=e.length;r--;){var i=e[r],a=t[i];e[r]=[i,a,n(a)]}return e}},87046:(t,e,r)=>{var n=r(35280);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=+(r.size!=o),this}},87182:(t,e,r)=>{t.exports=r(50929)(r(22834))},88493:(t,e,r)=>{"use strict";r.d(e,{I:()=>V});var n=r(29320);function o(){}function i(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function a(t){this._context=t}function c(t){this._context=t}function u(t){this._context=t}a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:i(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},c.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},u.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class l{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function s(t){this._context=t}function f(t){this._context=t}function p(t){return new f(t)}s.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t*=1,e*=1,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function h(t,e,r){var n=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(n||o<0&&-0),a=(r-t._y1)/(o||n<0&&-0);return((i<0?-1:1)+(a<0?-1:1))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs((i*o+a*n)/(n+o)))||0}function y(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function d(t,e,r){var n=t._x0,o=t._y0,i=t._x1,a=t._y1,c=(i-n)/3;t._context.bezierCurveTo(n+c,o+c*e,i-c,a-c*r,i,a)}function v(t){this._context=t}function m(t){this._context=new b(t)}function b(t){this._context=t}function g(t){this._context=t}function x(t){var e,r,n=t.length-1,o=Array(n),i=Array(n),a=Array(n);for(o[0]=0,i[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)o[e]=(a[e]-o[e+1])/i[e];for(e=0,i[n-1]=(t[n]+o[n-1])/2;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}};var w=r(16981),j=r(60672),S=r(17588);function A(t){return t[0]}function P(t){return t[1]}function E(t,e){var r=(0,j.A)(!0),n=null,o=p,i=null,a=(0,S.i)(c);function c(c){var u,l,s,f=(c=(0,w.A)(c)).length,p=!1;for(null==n&&(i=o(s=a())),u=0;u<=f;++u)!(u=f;--p)c.point(m[p],b[p]);c.lineEnd(),c.areaEnd()}v&&(m[s]=+t(h,s,l),b[s]=+e(h,s,l),c.point(n?+n(h,s,l):m[s],r?+r(h,s,l):b[s]))}if(y)return c=null,y+""||null}function s(){return E().defined(o).curve(a).context(i)}return t="function"==typeof t?t:void 0===t?A:(0,j.A)(+t),e="function"==typeof e?e:void 0===e?(0,j.A)(0):(0,j.A)(+e),r="function"==typeof r?r:void 0===r?P:(0,j.A)(+r),l.x=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.A)(+e),n=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.A)(+e),l):t},l.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:(0,j.A)(+t),l):n},l.y=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.A)(+t),r=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.A)(+t),l):e},l.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:(0,j.A)(+t),l):r},l.lineX0=l.lineY0=function(){return s().x(t).y(e)},l.lineY1=function(){return s().x(t).y(r)},l.lineX1=function(){return s().x(n).y(e)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:(0,j.A)(!!t),l):o},l.curve=function(t){return arguments.length?(a=t,null!=i&&(c=a(i)),l):a},l.context=function(t){return arguments.length?(null==t?i=c=null:c=a(i=t),l):i},l}var M=r(8827),_=r.n(M),T=r(38581),C=r.n(T),D=r(46138),I=r(427),N=r(6566),B=r(73127);function R(t){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(){return(L=Object.assign?Object.assign.bind():function(t){for(var e=1;e(u=(a=Math.ceil(p/7))>u?a+1:u+1)&&(i=u,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((u=l.length)-(i=s.length)<0&&(i=u,n=s,s=l,l=n),r=0;i;)r=(l[--i]=l[i]+s[i]+r)/1e7|0,l[i]%=1e7;for(r&&(l.unshift(r),++o),u=l.length;0==l[--u];)l.pop();return e.d=l,e.e=o,c?P(e,p):e}function m(t,e,r){if(t!==~~t||tr)throw Error(l+t)}function b(t){var e,r,n,o=t.length-1,i="",a=t[0];if(o>0){for(i+=a,e=1;et.e^this.s<0?1:-1;for(e=0,r=(n=this.d.length)<(o=t.d.length)?n:o;et.d[e]^this.s<0?1:-1;return n===o?0:n>o^this.s<0?1:-1},d.decimalPlaces=d.dp=function(){var t=this.d.length-1,e=(t-this.e)*7;if(t=this.d[t])for(;t%10==0;t/=10)e--;return e<0?0:e},d.dividedBy=d.div=function(t){return g(this,new this.constructor(t))},d.dividedToIntegerBy=d.idiv=function(t){var e=this.constructor;return P(g(this,new e(t),0,1),e.precision)},d.equals=d.eq=function(t){return!this.cmp(t)},d.exponent=function(){return O(this)},d.greaterThan=d.gt=function(t){return this.cmp(t)>0},d.greaterThanOrEqualTo=d.gte=function(t){return this.cmp(t)>=0},d.isInteger=d.isint=function(){return this.e>this.d.length-2},d.isNegative=d.isneg=function(){return this.s<0},d.isPositive=d.ispos=function(){return this.s>0},d.isZero=function(){return 0===this.s},d.lessThan=d.lt=function(t){return 0>this.cmp(t)},d.lessThanOrEqualTo=d.lte=function(t){return 1>this.cmp(t)},d.logarithm=d.log=function(t){var e,r=this.constructor,n=r.precision,o=n+5;if(void 0===t)t=new r(10);else if((t=new r(t)).s<1||t.eq(i))throw Error(u+"NaN");if(this.s<1)throw Error(u+(this.s?"NaN":"-Infinity"));return this.eq(i)?new r(0):(c=!1,e=g(S(this,o),S(t,o),o),c=!0,P(e,n))},d.minus=d.sub=function(t){return t=new this.constructor(t),this.s==t.s?E(this,t):v(this,(t.s=-t.s,t))},d.modulo=d.mod=function(t){var e,r=this.constructor,n=r.precision;if(!(t=new r(t)).s)throw Error(u+"NaN");return this.s?(c=!1,e=g(this,t,0,1).times(t),c=!0,this.minus(e)):P(new r(this),n)},d.naturalExponential=d.exp=function(){return x(this)},d.naturalLogarithm=d.ln=function(){return S(this)},d.negated=d.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},d.plus=d.add=function(t){return t=new this.constructor(t),this.s==t.s?v(this,t):E(this,(t.s=-t.s,t))},d.precision=d.sd=function(t){var e,r,n;if(void 0!==t&&!!t!==t&&1!==t&&0!==t)throw Error(l+t);if(e=O(this)+1,r=7*(n=this.d.length-1)+1,n=this.d[n]){for(;n%10==0;n/=10)r--;for(n=this.d[0];n>=10;n/=10)r++}return t&&e>r?e:r},d.squareRoot=d.sqrt=function(){var t,e,r,n,o,i,a,l=this.constructor;if(this.s<1){if(!this.s)return new l(0);throw Error(u+"NaN")}for(t=O(this),c=!1,0==(o=Math.sqrt(+this))||o==1/0?(((e=b(this.d)).length+t)%2==0&&(e+="0"),o=Math.sqrt(e),t=f((t+1)/2)-(t<0||t%2),n=new l(e=o==1/0?"5e"+t:(e=o.toExponential()).slice(0,e.indexOf("e")+1)+t)):n=new l(o.toString()),o=a=(r=l.precision)+3;;)if(n=(i=n).plus(g(this,i,a+2)).times(.5),b(i.d).slice(0,a)===(e=b(n.d)).slice(0,a)){if(e=e.slice(a-3,a+1),o==a&&"4999"==e){if(P(i,r+1,0),i.times(i).eq(this)){n=i;break}}else if("9999"!=e)break;a+=4}return c=!0,P(n,r)},d.times=d.mul=function(t){var e,r,n,o,i,a,u,l,s,f=this.constructor,p=this.d,h=(t=new f(t)).d;if(!this.s||!t.s)return new f(0);for(t.s*=this.s,r=this.e+t.e,(l=p.length)<(s=h.length)&&(i=p,p=h,h=i,a=l,l=s,s=a),i=[],n=a=l+s;n--;)i.push(0);for(n=s;--n>=0;){for(e=0,o=l+n;o>n;)u=i[o]+h[n]*p[o-n-1]+e,i[o--]=u%1e7|0,e=u/1e7|0;i[o]=(i[o]+e)%1e7|0}for(;!i[--a];)i.pop();return e?++r:i.shift(),t.d=i,t.e=r,c?P(t,f.precision):t},d.toDecimalPlaces=d.todp=function(t,e){var r=this,n=r.constructor;return(r=new n(r),void 0===t)?r:(m(t,0,1e9),void 0===e?e=n.rounding:m(e,0,8),P(r,t+O(r)+1,e))},d.toExponential=function(t,e){var r,n=this,o=n.constructor;return void 0===t?r=k(n,!0):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),r=k(n=P(new o(n),t+1,e),!0,t+1)),r},d.toFixed=function(t,e){var r,n,o=this.constructor;return void 0===t?k(this):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),r=k((n=P(new o(this),t+O(this)+1,e)).abs(),!1,t+O(n)+1),this.isneg()&&!this.isZero()?"-"+r:r)},d.toInteger=d.toint=function(){var t=this.constructor;return P(new t(this),O(this)+1,t.rounding)},d.toNumber=function(){return+this},d.toPower=d.pow=function(t){var e,r,n,o,a,l,s=this,p=s.constructor,h=+(t=new p(t));if(!t.s)return new p(i);if(!(s=new p(s)).s){if(t.s<1)throw Error(u+"Infinity");return s}if(s.eq(i))return s;if(n=p.precision,t.eq(i))return P(s,n);if(l=(e=t.e)>=(r=t.d.length-1),a=s.s,l){if((r=h<0?-h:h)<=0x1fffffffffffff){for(o=new p(i),e=Math.ceil(n/7+4),c=!1;r%2&&M((o=o.times(s)).d,e),0!==(r=f(r/2));)M((s=s.times(s)).d,e);return c=!0,t.s<0?new p(i).div(o):P(o,n)}}else if(a<0)throw Error(u+"NaN");return a=a<0&&1&t.d[Math.max(e,r)]?-1:1,s.s=1,c=!1,o=t.times(S(s,n+12)),c=!0,(o=x(o)).s=a,o},d.toPrecision=function(t,e){var r,n,o=this,i=o.constructor;return void 0===t?(r=O(o),n=k(o,r<=i.toExpNeg||r>=i.toExpPos)):(m(t,1,1e9),void 0===e?e=i.rounding:m(e,0,8),r=O(o=P(new i(o),t,e)),n=k(o,t<=r||r<=i.toExpNeg,t)),n},d.toSignificantDigits=d.tosd=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(m(t,1,1e9),void 0===e?e=r.rounding:m(e,0,8)),P(new r(this),t,e)},d.toString=d.valueOf=d.val=d.toJSON=function(){var t=O(this),e=this.constructor;return k(this,t<=e.toExpNeg||t>=e.toExpPos)};var g=function(){function t(t,e){var r,n=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+n,t[o]=r%1e7|0,n=r/1e7|0;return n&&t.unshift(n),t}function e(t,e,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;oe[o]?1:-1;break}return i}function r(t,e,r){for(var n=0;r--;)t[r]-=n,n=+(t[r]1;)t.shift()}return function(n,o,i,a){var c,l,s,f,p,h,y,d,v,m,b,g,x,w,j,S,A,E,k=n.constructor,M=n.s==o.s?1:-1,_=n.d,T=o.d;if(!n.s)return new k(n);if(!o.s)throw Error(u+"Division by zero");for(s=0,l=n.e-o.e,A=T.length,j=_.length,d=(y=new k(M)).d=[];T[s]==(_[s]||0);)++s;if(T[s]>(_[s]||0)&&--l,(g=null==i?i=k.precision:a?i+(O(n)-O(o))+1:i)<0)return new k(0);if(g=g/7+2|0,s=0,1==A)for(f=0,T=T[0],g++;(s1&&(T=t(T,f),_=t(_,f),A=T.length,j=_.length),w=A,m=(v=_.slice(0,A)).length;m=1e7/2&&++S;do f=0,(c=e(T,v,A,m))<0?(b=v[0],A!=m&&(b=1e7*b+(v[1]||0)),(f=b/S|0)>1?(f>=1e7&&(f=1e7-1),h=(p=t(T,f)).length,m=v.length,1==(c=e(p,v,h,m))&&(f--,r(p,A16)throw Error(s+O(t));if(!t.s)return new h(i);for(null==e?(c=!1,u=y):u=e,a=new h(.03125);t.abs().gte(.1);)t=t.times(a),f+=5;for(u+=Math.log(p(2,f))/Math.LN10*2+5|0,r=n=o=new h(i),h.precision=u;;){if(n=P(n.times(t),u),r=r.times(++l),b((a=o.plus(g(n,r,u))).d).slice(0,u)===b(o.d).slice(0,u)){for(;f--;)o=P(o.times(o),u);return h.precision=y,null==e?(c=!0,P(o,y)):o}o=a}}function O(t){for(var e=7*t.e,r=t.d[0];r>=10;r/=10)e++;return e}function w(t,e,r){if(e>t.LN10.sd())throw c=!0,r&&(t.precision=r),Error(u+"LN10 precision limit exceeded");return P(new t(t.LN10),e)}function j(t){for(var e="";t--;)e+="0";return e}function S(t,e){var r,n,o,a,l,s,f,p,h,y=1,d=t,v=d.d,m=d.constructor,x=m.precision;if(d.s<1)throw Error(u+(d.s?"NaN":"-Infinity"));if(d.eq(i))return new m(0);if(null==e?(c=!1,p=x):p=e,d.eq(10))return null==e&&(c=!0),w(m,p);if(m.precision=p+=10,n=(r=b(v)).charAt(0),!(15e14>Math.abs(a=O(d))))return f=w(m,p+2,x).times(a+""),d=S(new m(n+"."+r.slice(1)),p-10).plus(f),m.precision=x,null==e?(c=!0,P(d,x)):d;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=b((d=d.times(t)).d)).charAt(0),y++;for(a=O(d),n>1?(d=new m("0."+r),a++):d=new m(n+"."+r.slice(1)),s=l=d=g(d.minus(i),d.plus(i),p),h=P(d.times(d),p),o=3;;){if(l=P(l.times(h),p),b((f=s.plus(g(l,new m(o),p))).d).slice(0,p)===b(s.d).slice(0,p))return s=s.times(2),0!==a&&(s=s.plus(w(m,p+2,x).times(a+""))),s=g(s,new m(y),p),m.precision=x,null==e?(c=!0,P(s,x)):s;s=f,o+=2}}function A(t,e){var r,n,o;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);)++n;for(o=e.length;48===e.charCodeAt(o-1);)--o;if(e=e.slice(n,o)){if(o-=n,t.e=f((r=r-n-1)/7),t.d=[],n=(r+1)%7,r<0&&(n+=7),ny||t.e<-y))throw Error(s+r)}else t.s=0,t.e=0,t.d=[0];return t}function P(t,e,r){var n,o,i,a,u,l,h,d,v=t.d;for(a=1,i=v[0];i>=10;i/=10)a++;if((n=e-a)<0)n+=7,o=e,h=v[d=0];else{if((d=Math.ceil((n+1)/7))>=(i=v.length))return t;for(a=1,h=i=v[d];i>=10;i/=10)a++;n%=7,o=n-7+a}if(void 0!==r&&(u=h/(i=p(10,a-o-1))%10|0,l=e<0||void 0!==v[d+1]||h%i,l=r<4?(u||l)&&(0==r||r==(t.s<0?3:2)):u>5||5==u&&(4==r||l||6==r&&(n>0?o>0?h/p(10,a-o):0:v[d-1])%10&1||r==(t.s<0?8:7))),e<1||!v[0])return l?(i=O(t),v.length=1,e=e-i-1,v[0]=p(10,(7-e%7)%7),t.e=f(-e/7)||0):(v.length=1,v[0]=t.e=t.s=0),t;if(0==n?(v.length=d,i=1,d--):(v.length=d+1,i=p(10,7-n),v[d]=o>0?(h/p(10,a-o)%p(10,o)|0)*i:0),l)for(;;)if(0==d){1e7==(v[0]+=i)&&(v[0]=1,++t.e);break}else{if(v[d]+=i,1e7!=v[d])break;v[d--]=0,i=1}for(n=v.length;0===v[--n];)v.pop();if(c&&(t.e>y||t.e<-y))throw Error(s+O(t));return t}function E(t,e){var r,n,o,i,a,u,l,s,f,p,h=t.constructor,y=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),c?P(e,y):e;if(l=t.d,p=e.d,n=e.e,s=t.e,l=l.slice(),a=s-n){for((f=a<0)?(r=l,a=-a,u=p.length):(r=p,n=s,u=l.length),a>(o=Math.max(Math.ceil(y/7),u)+2)&&(a=o,r.length=1),r.reverse(),o=a;o--;)r.push(0);r.reverse()}else{for((f=(o=l.length)<(u=p.length))&&(u=o),o=0;o0;--o)l[u++]=0;for(o=p.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+j(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+j(-o-1)+i,r&&(n=r-a)>0&&(i+=j(n))):o>=a?(i+=j(o+1-a),r&&(n=r-o-1)>0&&(i=i+"."+j(n))):((n=o+1)0&&(o+1===a&&(i+="."),i+=j(n))),t.s<0?"-"+i:i}function M(t,e){if(t.length>e)return t.length=e,!0}function _(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,r,n,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e=o[e+1]&&n<=o[e+2])this[r]=n;else throw Error(l+r+": "+n);if(void 0!==(n=t[r="LN10"]))if(n==Math.LN10)this[r]=new this(n);else throw Error(l+r+": "+n);return this}(a=function t(e){var r,n,o;function i(t){if(!(this instanceof i))return new i(t);if(this.constructor=i,t instanceof i){this.s=t.s,this.e=t.e,this.d=(t=t.d)?t.slice():t;return}if("number"==typeof t){if(0*t!=0)throw Error(l+t);if(t>0)this.s=1;else if(t<0)t=-t,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(t===~~t&&t<1e7){this.e=0,this.d=[t];return}return A(this,t.toString())}if("string"!=typeof t)throw Error(l+t);if(45===t.charCodeAt(0)?(t=t.slice(1),this.s=-1):this.s=1,h.test(t))A(this,t);else throw Error(l+t)}if(i.prototype=d,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=t,i.config=i.set=_,void 0===e&&(e={}),e)for(r=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];r{t.exports=function(t,e){return null==t?void 0:t[e]}},89420:(t,e,r)=>{var n=r(89780),o=r(95048),i=r(77796);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},89658:(t,e,r)=>{"use strict";r.d(e,{u:()=>y});var n=r(46138),o=r(29320),i=r(45713),a=r.n(i),c=r(73127),u=r(22973),l=r(6566);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function p(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&(t=a()(t,S,{trailing:!0,leading:!1}));var e=new ResizeObserver(t),r=M.current.getBoundingClientRect();return I(r.width,r.height),e.observe(M.current),function(){e.disconnect()}},[I,S]);var N=(0,o.useMemo)(function(){var t=C.containerWidth,e=C.containerHeight;if(t<0||e<0)return null;(0,u.R)((0,c._3)(d)||(0,c._3)(m),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",d,m),(0,u.R)(!i||i>0,"The aspect(%s) must be greater than zero.",i);var r=(0,c._3)(d)?t:d,n=(0,c._3)(m)?e:m;i&&i>0&&(r?n=r/i:n&&(r=n*i),O&&n>O&&(n=O)),(0,u.R)(r>0||n>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",r,n,d,m,g,x,i);var a=!Array.isArray(w)&&(0,l.Mn)(w.type).endsWith("Chart");return o.Children.map(w,function(t){return o.isValidElement(t)?(0,o.cloneElement)(t,p({width:r,height:n},a?{style:p({height:"100%",width:"100%",maxHeight:n,maxWidth:r},t.props.style)}:{})):t})},[i,w,m,O,x,g,C,d]);return o.createElement("div",{id:A?"".concat(A):void 0,className:(0,n.A)("recharts-responsive-container",P),style:p(p({},void 0===k?{}:k),{},{width:d,height:m,minWidth:g,minHeight:x,maxHeight:O}),ref:M},N)})},89780:t=>{t.exports=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i{t.exports=function(t,e){return t{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},91623:(t,e,r)=>{var n=r(80754),o=r(65024),i=r(76173),a=r(40230),c=r(92574),u=r(37226),l=r(37007),s=r(13724),f="[object Arguments]",p="[object Array]",h="[object Object]",y=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,d,v,m){var b=u(t),g=u(e),x=b?p:c(t),O=g?p:c(e);x=x==f?h:x,O=O==f?h:O;var w=x==h,j=O==h,S=x==O;if(S&&l(t)){if(!l(e))return!1;b=!0,w=!1}if(S&&!w)return m||(m=new n),b||s(t)?o(t,e,r,d,v,m):i(t,e,x,r,d,v,m);if(!(1&r)){var A=w&&y.call(t,"__wrapped__"),P=j&&y.call(e,"__wrapped__");if(A||P){var E=A?t.value():t,k=P?e.value():e;return m||(m=new n),v(E,k,r,d,m)}}return!!S&&(m||(m=new n),a(t,e,r,d,v,m))}},91696:(t,e,r)=>{var n=r(32767),o=r(38808),i=r(22153),a=r(41543);t.exports=i(function(t,e){if(null==t)return[];var r=e.length;return r>1&&a(t,e[0],e[1])?e=[]:r>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),o(t,n(e,1),[])})},92268:t=>{t.exports=function(){return!1}},92466:(t,e,r)=>{var n=r(37226),o=r(9761),i=r(8601),a=r(15197);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(a(t))}},92574:(t,e,r)=>{var n=r(69575),o=r(64700),i=r(83487),a=r(1778),c=r(97908),u=r(34155),l=r(68302),s="[object Map]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",y="[object DataView]",d=l(n),v=l(o),m=l(i),b=l(a),g=l(c),x=u;(n&&x(new n(new ArrayBuffer(1)))!=y||o&&x(new o)!=s||i&&x(i.resolve())!=f||a&&x(new a)!=p||c&&x(new c)!=h)&&(x=function(t){var e=u(t),r="[object Object]"==e?t.constructor:void 0,n=r?l(r):"";if(n)switch(n){case d:return y;case v:return s;case m:return f;case b:return p;case g:return h}return e}),t.exports=x},92786:(t,e,r)=>{"use strict";function n(t,e){for(var r in t)if(({}).hasOwnProperty.call(t,r)&&(!({}).hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if(({}).hasOwnProperty.call(e,n)&&!({}).hasOwnProperty.call(t,n))return!1;return!0}r.d(e,{b:()=>n})},92935:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},92978:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},93638:(t,e,r)=>{var n=r(29511),o=r(67225),i=r(40794),a=r(42046),c=r(87046);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e{var n=r(6572),o=r(90931),i=r(71503);t.exports=function(t){return t&&t.length?n(t,i,o):void 0}},94756:(t,e)=>{"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy");Symbol.for("react.offscreen");Symbol.for("react.module.reference"),e.isFragment=function(t){return function(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case o:case a:case i:case f:case p:return t;default:switch(t=t&&t.$$typeof){case l:case u:case s:case y:case h:case c:return t;default:return e}}case n:return e}}}(t)===o}},94889:(t,e,r)=>{"use strict";r.d(e,{h:()=>v});var n=r(29320),o=r(46138),i=r(6566),a=r(19299),c=r(73127);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(i>s),",\n ").concat(p.x,",").concat(p.y,"\n ");if(n>0){var y=(0,a.IZ)(e,r,n,i),d=(0,a.IZ)(e,r,n,s);h+="L ".concat(d.x,",").concat(d.y,"\n A ").concat(n,",").concat(n,",0,\n ").concat(+(Math.abs(l)>180),",").concat(+(i<=s),",\n ").concat(y.x,",").concat(y.y," Z")}else h+="L ".concat(e,",").concat(r," Z");return h},y=function(t){var e=t.cx,r=t.cy,n=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,a=t.forceCornerRadius,u=t.cornerIsExternal,l=t.startAngle,s=t.endAngle,f=(0,c.sA)(s-l),y=p({cx:e,cy:r,radius:o,angle:l,sign:f,cornerRadius:i,cornerIsExternal:u}),d=y.circleTangency,v=y.lineTangency,m=y.theta,b=p({cx:e,cy:r,radius:o,angle:s,sign:-f,cornerRadius:i,cornerIsExternal:u}),g=b.circleTangency,x=b.lineTangency,O=b.theta,w=u?Math.abs(l-s):Math.abs(l-s)-m-O;if(w<0)return a?"M ".concat(v.x,",").concat(v.y,"\n a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n a").concat(i,",").concat(i,",0,0,1,").concat(-(2*i),",0\n "):h({cx:e,cy:r,innerRadius:n,outerRadius:o,startAngle:l,endAngle:s});var j="M ".concat(v.x,",").concat(v.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,"\n A").concat(o,",").concat(o,",0,").concat(+(w>180),",").concat(+(f<0),",").concat(g.x,",").concat(g.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,"\n ");if(n>0){var S=p({cx:e,cy:r,radius:n,angle:l,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:u}),A=S.circleTangency,P=S.lineTangency,E=S.theta,k=p({cx:e,cy:r,radius:n,angle:s,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:u}),M=k.circleTangency,_=k.lineTangency,T=k.theta,C=u?Math.abs(l-s):Math.abs(l-s)-E-T;if(C<0&&0===i)return"".concat(j,"L").concat(e,",").concat(r,"Z");j+="L".concat(_.x,",").concat(_.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,"\n A").concat(n,",").concat(n,",0,").concat(+(C>180),",").concat(+(f>0),",").concat(A.x,",").concat(A.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else j+="L".concat(e,",").concat(r,"Z");return j},d={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},v=function(t){var e,r=f(f({},d),t),a=r.cx,u=r.cy,s=r.innerRadius,p=r.outerRadius,v=r.cornerRadius,m=r.forceCornerRadius,b=r.cornerIsExternal,g=r.startAngle,x=r.endAngle,O=r.className;if(p0&&360>Math.abs(g-x)?y({cx:a,cy:u,innerRadius:s,outerRadius:p,cornerRadius:Math.min(S,j/2),forceCornerRadius:m,cornerIsExternal:b,startAngle:g,endAngle:x}):h({cx:a,cy:u,innerRadius:s,outerRadius:p,startAngle:g,endAngle:x}),n.createElement("path",l({},(0,i.J9)(r,!0),{className:w,d:e,role:"img"}))}},95008:(t,e,r)=>{"use strict";r.d(e,{u:()=>u});var n=r(29320),o=r(46138),i=r(6566),a=["children","width","height","viewBox","className","style","title","desc"];function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,a),d=l||{width:r,height:u,x:0,y:0},v=(0,o.A)("recharts-surface",s);return n.createElement("svg",c({},(0,i.J9)(y,!0,"svg"),{className:v,width:r,height:u,style:f,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),n.createElement("title",null,p),n.createElement("desc",null,h),e)}},95048:t=>{t.exports=function(t){return t!=t}},95903:(t,e,r)=>{var n=r(97313);t.exports=function(t,e){return n(t,e)}},96478:(t,e,r)=>{var n=r(1778),o=r(44013),i=r(47968);t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(t){return new n(t)}:o},96792:t=>{t.exports=function(t,e){return t.has(e)}},97035:(t,e,r)=>{var n=r(5070),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)}},97262:(t,e,r)=>{var n=r(1952);t.exports=function(t){return n(t)&&t!=+t}},97313:(t,e,r)=>{var n=r(91623),o=r(24917);t.exports=function t(e,r,i,a,c){return e===r||(null!=e&&null!=r&&(o(e)||o(r))?n(e,r,i,a,t,c):e!=e&&r!=r)}},97908:(t,e,r)=>{t.exports=r(39009)(r(72442),"WeakMap")},98017:(t,e,r)=>{var n=r(66732),o=r(26359),i=r(76385);t.exports=function(t){return n(t,i,o)}},98262:t=>{t.exports=function(t){return this.__data__.get(t)}},98281:t=>{var e="\ud800-\udfff",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\ud83c[\udffb-\udfff]",o="[^"+e+"]",i="(?:\ud83c[\udde6-\uddff]){2}",a="[\ud800-\udbff][\udc00-\udfff]",c="(?:"+r+"|"+n+")?",u="[\\ufe0e\\ufe0f]?",l="(?:\\u200d(?:"+[o,i,a].join("|")+")"+u+c+")*",s=RegExp(n+"(?="+n+")|"+("(?:"+[o+r+"?",r,i,a,"["+e+"]"].join("|"))+")"+(u+c+l),"g");t.exports=function(t){return t.match(s)||[]}},98757:t=>{var e=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return e.test(t)}},98840:(t,e,r)=>{var n=r(5070);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},99444:t=>{t.exports=function(t,e){return t>e}},99604:t=>{var e=Date.now;t.exports=function(t){var r=0,n=0;return function(){var o=e(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}},99857:(t,e,r)=>{var n=r(34375),o=r(2346),i=r(44493),a=0/0,c=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return a;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=u.test(t);return r||l.test(t)?s(t.slice(2),r?2:8):c.test(t)?a:+t}},99984:(t,e,r)=>{t.exports=r(3072)(Object.getPrototypeOf,Object)}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2689-f9dac9488c272556.js b/pages/demo/_next/static/chunks/2689-f9dac9488c272556.js new file mode 100644 index 00000000..bfed7fdf --- /dev/null +++ b/pages/demo/_next/static/chunks/2689-f9dac9488c272556.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2689],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},91947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Scaling",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M14 15H9v-5",key:"pi4jk9"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M21 3 9 15",key:"15kdhq"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>R});var r=l(29320),n=l.t(r,2),a=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:n,...a}=t,i=null,o=!1,c=[];A(n)&&"function"==typeof w&&(n=w(n._payload)),r.Children.forEach(n,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(n)&&r.isValidElement(n)&&(i=n);let d=i?k(i):void 0,y=p(l,d);if(!i){if(n||0===n)throw Error(o?x(e):M(e));return n}let h=m(a,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:d),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(f,"createSlot");var u=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=u,t},"createSlottable");var s=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let l={...t};for(let r in t){let n=e[r],a=t[r];/^on[A-Z]/.test(r)?n&&a?l[r]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(l[r]=n):"style"===r?l[r]={...n,...a}:"className"===r&&(l[r]=[n,a].filter(Boolean).join(" "))}return{...e,...l}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}h(m,"mergeProps"),h(k,"getElementRef"),h(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}h(A,"isLazyComponent"),h(g,"isPromiseLike");var M=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=n[" use ".trim().toString()],S=l(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?l:t,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=r.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2718-f810e006b35713e1.js b/pages/demo/_next/static/chunks/2718-f810e006b35713e1.js deleted file mode 100644 index 40428626..00000000 --- a/pages/demo/_next/static/chunks/2718-f810e006b35713e1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2718],{7235:(e,t,a)=>{a.d(t,{d:()=>l});var s=a(95155);a(12115);var r=a(99587),n=a(25016);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.bL,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.zi,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},16981:(e,t,a)=>{a.d(t,{D:()=>l});var s=a(95155),r=a(90235),n=a(25016);function l(e){let{label:t,htmlFor:a,help:l,error:i,optional:d,children:o,className:c}=e;return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-1.5",c),children:[(0,s.jsxs)(r.J,{htmlFor:a,className:"text-sm font-medium",children:[t,d&&(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,s.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},50524:(e,t,a)=>{a.d(t,{F:()=>c,i:()=>u});var s=a(95155),r=a(12115),n=a(6132),l=a(61362),i=a(26667),d=a(97003),o=a(25016);function c(e){if(!e.trim())return"Document is empty";try{return JSON.parse(e),null}catch(e){return e instanceof Error?e.message:String(e)}}function u(e){let{value:t,onChange:a,rows:u=16,readOnly:m,validate:p,className:h,id:x}=e,f=(0,r.useMemo)(()=>{let e=c(t);return e||(p?p(JSON.parse(t)):null)},[t,p]),g=Math.max(t.split("\n").length,u);return(0,s.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-2",h),children:[(0,s.jsxs)("div",{className:(0,o.cn)("bg-muted/30 flex overflow-hidden rounded-md border font-mono text-[13px] leading-5",f&&!m&&"border-destructive/60"),children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"text-muted-foreground/60 bg-muted/50 border-r px-2 py-2 text-right select-none",children:Array.from({length:g},(e,t)=>(0,s.jsx)("div",{children:t+1},t))}),(0,s.jsx)("textarea",{id:x,value:t,readOnly:m,onChange:e=>null==a?void 0:a(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!m){e.preventDefault();let s=e.currentTarget,{selectionStart:r,selectionEnd:n}=s,l=t.slice(0,r)+" "+t.slice(n);null==a||a(l),requestAnimationFrame(()=>{s.selectionStart=s.selectionEnd=r+2})}},spellCheck:!1,rows:g,className:"min-w-0 flex-1 resize-none overflow-x-auto bg-transparent px-3 py-2 whitespace-pre outline-none"})]}),!m&&(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f?(0,s.jsxs)("span",{className:"text-destructive flex items-center gap-1",children:[(0,s.jsx)(n.A,{className:"size-3.5"})," ",f]}):(0,s.jsxs)("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[(0,s.jsx)(l.A,{className:"size-3.5"})," Valid JSON"]}),(0,s.jsxs)(d.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{try{null==a||a(JSON.stringify(JSON.parse(t),null,2))}catch(e){}},disabled:!!c(t),children:[(0,s.jsx)(i.A,{})," Format"]})]})]})}},62325:(e,t,a)=>{a.d(t,{w:()=>n});var s=a(95155),r=a(25016);function n(e){let{title:t,description:a,actions:n,children:l,className:i,bodyClassName:d,flush:o}=e;return(0,s.jsxs)("section",{className:(0,r.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||n)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),a&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:a})]}),n&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:n})]}),(0,s.jsx)("div",{className:(0,r.cn)(!o&&"p-4",d),children:l})]})}},62718:(e,t,a)=>{a.d(t,{H:()=>Y,RuleWizard:()=>Z});var s=a(95155),r=a(12115),n=a(52619),l=a.n(n),i=a(20063),d=a(6132),o=a(35626),c=a(29502),u=a(53854),m=a(5917),p=a(23327),h=a(35299),x=a(94374),f=a(61362),g=a(78874),v=a(6191),j=a(65229),b=a(18720),N=a(97003),y=a(33789),k=a(90235),w=a(47507),S=a(7235),_=a(67001),C=a(95567),O=a(97438),A=a(16981),J=a(50524),D=a(59516),q=a(17705),E=a(62325),F=a(37621),T=a(7e3),z=a(73697),M=a(25016),R=a(7935),$=a(44295);let P=()=>({kind:"lambda",arn:"",mode:"event",input:"",inputPath:"",pathsMap:"",template:"",retries:"",maxAge:"",dlq:""});function I(e){var t,a,s,r,n,l,i;let d=e.input_transformer;return{id:e.id,kind:null!=(s=(0,R.WL)(e.arn))?s:"lambda",arn:e.arn,mode:d?"transformer":e.input_path?"path":e.input?"constant":"event",input:null!=(r=e.input)?r:"",inputPath:null!=(n=e.input_path)?n:"",pathsMap:(null==d?void 0:d.input_paths_map)&&Object.keys(d.input_paths_map).length?JSON.stringify(d.input_paths_map,null,2):"",template:null!=(l=null==d?void 0:d.input_template)?l:"",retries:(null==(t=e.retry_policy)?void 0:t.maximum_retry_attempts)!=null?String(e.retry_policy.maximum_retry_attempts):"",maxAge:(null==(a=e.retry_policy)?void 0:a.maximum_event_age_in_seconds)!=null?String(e.retry_policy.maximum_event_age_in_seconds):"",dlq:null!=(i=e.dead_letter_arn)?i:"",extra:{role_arn:e.role_arn,message_group_id:e.message_group_id}}}function U(e){let t=e.retries.trim()||e.maxAge.trim()?{maximum_retry_attempts:e.retries.trim()?Number(e.retries):void 0,maximum_event_age_in_seconds:e.maxAge.trim()?Number(e.maxAge):void 0}:void 0;return{...e.extra,id:e.id,arn:e.arn,input:"constant"===e.mode?e.input.trim():void 0,input_path:"path"===e.mode?e.inputPath.trim():void 0,input_transformer:"transformer"===e.mode?{input_paths_map:e.pathsMap.trim()?JSON.parse(e.pathsMap):void 0,input_template:e.template}:void 0,retry_policy:t,dead_letter_arn:e.dlq||void 0}}let B=/^\$(\.[A-Za-z0-9_\-]+|\[\d+\])*$/,L=[["Every minute","rate(1 minute)"],["Every 5 minutes","rate(5 minutes)"],["Every 15 minutes","cron(0/15 * * * ? *)"],["Hourly","rate(1 hour)"],["Daily","rate(1 day)"],["Daily at 12:00 UTC","cron(0 12 * * ? *)"],["Weekdays at 09:00 UTC","cron(0 9 ? * MON-FRI *)"],["1st of the month, 00:00 UTC","cron(0 0 1 * ? *)"]],W=["0","12","*","*","?","*"],H=JSON.stringify({source:["my.app"],"detail-type":["order.paid"]},null,2),V=e=>!e||"object"!=typeof e||Array.isArray(e)?"Must be a JSON object":null;function G(e){let t=e.trim();if(!t.startsWith("cron(")||!t.endsWith(")"))return null;let a=t.slice(5,-1).trim().split(/\s+/);return 6===a.length?a:null}function Y(){var e,t,a,s;let r=(0,z.gf)("/api/v1/lambda/functions",{revalidateOnFocus:!1}),n=(0,z.gf)("/api/v1/sqs/queues",{revalidateOnFocus:!1}),l=(0,z.gf)("/api/v1/sns/topics",{revalidateOnFocus:!1}),i=(0,z.gf)("/api/v1/sfn/state-machines",{revalidateOnFocus:!1});return{lambda:{data:null==(e=r.data)?void 0:e.map(e=>({name:e.name,arn:e.arn})),error:r.error},sqs:{data:null==(t=n.data)?void 0:t.map(e=>({name:e.name,arn:e.arn})),error:n.error},sns:{data:null==(a=l.data)?void 0:a.map(e=>({name:e.name,arn:e.arn})),error:l.error},sfn:{data:null==(s=i.data)?void 0:s.map(e=>({name:e.name,arn:e.arn})),error:i.error}}}function Z(){var e;let t=(0,i.useRouter)(),a=(0,z.pE)("name"),n=!!a,j=(0,z.pE)("bus")||"default",[w,Z]=(0,r.useState)(j);(0,r.useEffect)(()=>Z(j),[j]);let K=(0,z.gf)(n?"".concat(R.MU,"/").concat((0,F.aJ)(a)):null,{revalidateOnFocus:!1,keepPreviousData:!1,query:(0,R.nq)(w)}),Q=(0,z.gf)(n?null:R.MU,{revalidateOnFocus:!1,query:(0,R.nq)(w)}),et=Y(),[ea,es]=(0,r.useState)(""),[er,en]=(0,r.useState)(""),[el,ei]=(0,r.useState)("schedule"),[ed,eo]=(0,r.useState)("rate(5 minutes)"),[ec,eu]=(0,r.useState)(W),[em,ep]=(0,r.useState)(!1),[eh,ex]=(0,r.useState)(H),[ef,eg]=(0,r.useState)(""),[ev,ej]=(0,r.useState)(null),[eb,eN]=(0,r.useState)(!1),[ey,ek]=(0,r.useState)([P()]),[ew,eS]=(0,r.useState)(!0),[e_,eC]=(0,r.useState)(!1),[eO,eA]=(0,r.useState)(!1),[eJ,eD]=(0,r.useState)(!1);(0,r.useEffect)(()=>{var e,t;return eg(JSON.stringify({version:"0",id:"6a7e8feb-b491-4cf7-a9f1-bf3703467718","detail-type":"order.paid",source:"my.app",account:null!=(t=null==(e=(0,F.Ht)())?void 0:e.account_id)?t:"000000000000",time:new Date().toISOString().replace(/\.\d+Z$/,"Z"),region:"us-east-1",resources:[],detail:{order_id:"o-1001",total:42}},null,2))},[]),(0,r.useEffect)(()=>{var e,t,a;let s=K.data;if(s&&!e_){if(es(s.name),en(null!=(e=s.description)?e:""),s.schedule_expression){ei("schedule"),eo(s.schedule_expression);let e=G(s.schedule_expression);e&&eu(e)}else ei("pattern"),ex(JSON.stringify(null!=(t=s.event_pattern)?t:{},null,2));ek((null!=(a=s.targets)?a:[]).map(I)),eS("DISABLED"!==s.state),eC(!0)}},[K.data,e_]);let eq=e=>{eo(e);let t=G(e);t&&eu(t)},eE=(0,r.useMemo)(()=>{var e,t;let a={};if(!n){let t=(0,R.qx)(ea);t?a.name=t:(null==(e=Q.data)?void 0:e.some(e=>e.name===ea))&&(a.name="A rule named ".concat(ea," already exists"))}if(er.length>512&&(a.description="Descriptions are at most 512 characters"),"schedule"===el){let e=(0,R.Me)(ed);e?a.schedule=e:"default"!==w&&(a.schedule="Schedules run on the default event bus only")}else{let e=null!=(t=(0,J.F)(eh))?t:V(JSON.parse(eh));e&&(a.pattern=e)}let s=new Set;return ey.forEach((e,t)=>{var r,n;if(e.arn?s.has(e.arn)&&(a["t".concat(t,"arn")]="This target is already added"):a["t".concat(t,"arn")]="Choose a ".concat(null!=(n=null==(r=R.aO.find(t=>t.kind===e.kind))?void 0:r.noun)?n:"target"),s.add(e.arn),"constant"===e.mode){let s=e.input.trim()?(0,J.F)(e.input):"Enter the JSON to send";s&&(a["t".concat(t,"input")]=e.input.trim()?"Invalid JSON: ".concat(s):s)}else if("path"===e.mode)B.test(e.inputPath.trim())||(a["t".concat(t,"input")]="Enter a JSONPath such as $.detail");else if("transformer"===e.mode){if(e.pathsMap.trim()){let s=(0,J.F)(e.pathsMap),r=s?null:JSON.parse(e.pathsMap);s?a["t".concat(t,"paths")]="Invalid JSON: ".concat(s):(!r||"object"!=typeof r||Array.isArray(r)||Object.values(r).some(e=>"string"!=typeof e||!B.test(e)))&&(a["t".concat(t,"paths")]='Must be an object of JSONPaths, e.g. {"id": "$.detail.id"}')}e.template.trim()||(a["t".concat(t,"template")]="The input template is required")}let l=Number(e.retries);e.retries.trim()&&(!Number.isInteger(l)||l<0||l>185)&&(a["t".concat(t,"retries")]="0 to 185");let i=Number(e.maxAge);e.maxAge.trim()&&(!Number.isInteger(i)||i<60||i>86400)&&(a["t".concat(t,"age")]="60 to 86400 seconds")}),a},[n,ea,Q.data,er,el,ed,eh,ey,w]),eF=e=>eO?eE[e]:void 0,eT=0===Object.keys(eE).length,ez=(0,r.useMemo)(()=>"schedule"!==el||(0,R.Me)(ed)?[]:(0,R.Oz)(ed,5),[el,ed]),eM=(0,r.useMemo)(()=>{try{return"rate"===(0,R.nP)(ed).kind}catch(e){return!1}},[ed]),eR=async()=>{var e,t;let a=null!=(e=(0,J.F)(eh))?e:V(JSON.parse(eh)),s=null!=(t=(0,J.F)(ef))?t:V(JSON.parse(ef));if(a||s)return void b.oR.error(a?"Event pattern: ".concat(a):"Sample event: ".concat(s));eN(!0);try{let e=await F.FH.post("".concat(R.W1,"/test-pattern"),{pattern:JSON.parse(eh),event:JSON.parse(ef)});ej(e.result)}catch(e){b.oR.error((0,F.gJ)(e))}finally{eN(!1)}},e$=async()=>{if(eA(!0),!eT)return void b.oR.error("Fix the highlighted fields before saving");let e={description:er.trim(),schedule_expression:"schedule"===el?ed.trim():void 0,event_pattern:"pattern"===el?JSON.parse(eh):void 0,state:ew?"ENABLED":"DISABLED",targets:ey.map(U)};eD(!0);try{let a=await F.FH.put("".concat(R.MU,"/").concat((0,F.aJ)(ea)),e,(0,R.nq)(w)),s=a.schedule_expression&&(0,R.xN)(a)?" Next run ".concat((0,T.Yq)(a.next_run)).concat("DISABLED"===a.state?" once enabled":"","."):"";b.oR.success("".concat(n?"Saved":"Created"," rule ").concat(a.name,".").concat(s)),await (0,z.Yi)(R.MU),t.push((0,R.Gd)(a.name,w))}catch(e){b.oR.error((0,F.gJ)(e)),eD(!1)}},eP=n?"Edit rule ".concat(a):"Create rule",eI=[{label:"EventBridge",href:"/events/"},{label:"Rules",href:"/events/"},...n?[{label:a,href:(0,R.Gd)(a,w)},{label:"Edit"}]:[{label:"Create rule"}]];if(n&&K.error&&!K.data){let e=K.error instanceof F.hD&&404===K.error.status;return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(q.z,{title:eP,breadcrumbs:eI}),e?(0,s.jsx)(E.w,{children:(0,s.jsx)(C.p,{icon:d.A,title:"Rule not found",description:"Rule ".concat(a," does not exist."),action:(0,s.jsx)(N.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)(l(),{href:"/events/",children:[(0,s.jsx)(o.A,{})," Back to rules"]})})})}):(0,s.jsx)(O.W,{error:K.error,onRetry:()=>K.mutate()})]})}return n&&!e_?(0,s.jsx)(D.P0,{}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(q.z,{title:eP,description:"A rule runs on a schedule or matches published events, then delivers to up to five targets.",breadcrumbs:eI}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),e$()},className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-[minmax(0,1fr)_320px]",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,s.jsx)(E.w,{title:"Rule details",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(A.D,{label:"Event bus",htmlFor:"rule-bus",help:n?"A rule's bus cannot be changed.":"Schedules run on the default bus only; event patterns work on any bus.",children:(0,s.jsx)($.z,{id:"rule-bus",value:w,onChange:Z,disabled:n,className:"max-w-md"})}),(0,s.jsx)(A.D,{label:"Name",htmlFor:"rule-name",error:eF("name"),help:n?"Rule names cannot be changed.":"Up to 64 letters, digits, dots, hyphens and underscores.",children:(0,s.jsx)(y.p,{id:"rule-name",value:ea,onChange:e=>es(e.target.value),disabled:n,placeholder:"e.g. nightly-report",autoFocus:!n,autoComplete:"off",spellCheck:!1,className:"max-w-md"})}),(0,s.jsx)(A.D,{label:"Description",htmlFor:"rule-desc",optional:!0,error:eF("description"),children:(0,s.jsx)(_.T,{id:"rule-desc",rows:2,value:er,onChange:e=>en(e.target.value),className:"max-w-xl"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Rule type"}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",role:"radiogroup","aria-label":"Rule type",children:[["schedule",c.A,"Schedule","Run the targets at a fixed rate or on a cron schedule (UTC)."],["pattern",u.A,"Event pattern","Run the targets when a published event matches a pattern."]].map(e=>{let[t,a,r,n]=e,l=el===t;return(0,s.jsxs)("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>ei(t),className:(0,M.cn)("relative flex gap-3 rounded-lg border p-3 text-left transition-colors",l?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,s.jsx)(a,{className:(0,M.cn)("mt-0.5 size-5 shrink-0",l?"text-primary":"text-muted-foreground")}),(0,s.jsxs)("span",{className:"flex flex-col gap-0.5 pr-6",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:r}),(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]}),l&&(0,s.jsx)("span",{className:"bg-primary text-primary-foreground absolute top-2 right-2 flex size-5 items-center justify-center rounded-full",children:(0,s.jsx)(m.A,{className:"size-3.5"})})]},t)})})]})]})}),"schedule"===el&&(0,s.jsx)(E.w,{title:"Schedule",description:"Times are UTC. The scheduler checks rules at the top of every minute.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:L.map(e=>{let[t,a]=e;return(0,s.jsx)(N.$,{type:"button",size:"sm",variant:ed.trim()===a?"secondary":"outline",className:"h-7 text-xs",onClick:()=>eq(a),title:a,children:t},a)})}),(0,s.jsx)(A.D,{label:"Schedule expression",htmlFor:"rule-schedule",error:null!=(e=eF("schedule"))?e:ed.trim()&&eE.schedule?eE.schedule:void 0,help:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-mono",children:"rate(N minute|minutes|hour|hours|day|days)"})," or"," ",(0,s.jsx)("span",{className:"font-mono",children:"cron(minutes hours day-of-month month day-of-week year)"})]}),children:(0,s.jsx)(y.p,{id:"rule-schedule",value:ed,onChange:e=>eq(e.target.value),placeholder:"rate(5 minutes)",spellCheck:!1,className:"max-w-md font-mono"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ep(!em),className:"text-primary w-fit text-sm hover:underline",children:em?"Hide cron builder":"Build a cron expression"}),em&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:R.fC.map((e,t)=>(0,s.jsx)(A.D,{label:(0,s.jsx)("span",{className:"text-xs",children:e.label}),htmlFor:"cron-".concat(t),help:e.hint,children:(0,s.jsx)(y.p,{id:"cron-".concat(t),value:ec[t],onChange:e=>((e,t)=>{let a=ec.map((a,s)=>s===e?t:a);eu(a),eo("cron(".concat(a.map(e=>e.trim()||"*").join(" "),")"))})(t,e.target.value),placeholder:e.placeholder,className:"h-8 font-mono",spellCheck:!1})},e.label))}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Use ",(0,s.jsx)("span",{className:"font-mono",children:"*"})," for any value, ",(0,s.jsx)("span",{className:"font-mono",children:"?"})," in exactly one of day-of-month and day-of-week, ranges ",(0,s.jsx)("span",{className:"font-mono",children:"MON-FRI"}),", lists ",(0,s.jsx)("span",{className:"font-mono",children:"1,15"})," and steps"," ",(0,s.jsx)("span",{className:"font-mono",children:"0/15"}),"."]})]})]}),(0,s.jsxs)("div",{className:"bg-muted/30 flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Next runs"," ",!eE.schedule&&(0,s.jsxs)("span",{className:"text-muted-foreground font-normal",children:["\xb7 ",(0,R.Bg)(ed)]})]}),ez.length?(0,s.jsx)("ol",{className:"flex flex-col gap-0.5 text-sm",children:ez.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap gap-x-3",children:[(0,s.jsx)("span",{className:"font-mono text-[13px]",children:(0,R.ay)(e)}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[(0,T.Yq)(e,!1)," local"]})]},e.getTime()))}):(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:eE.schedule?"Enter a valid expression to preview run times.":"No run in the next year."}),(0,s.jsxs)("p",{className:"text-muted-foreground flex gap-1.5 text-xs",children:[(0,s.jsx)(p.A,{className:"mt-px size-3.5 shrink-0"}),(0,s.jsxs)("span",{children:[eM?"Rates are counted from when the rule is saved (then from each run). ":"","This is an estimate: the server computes the exact next run, shown on the rule after saving."]})]})]})]})}),"pattern"===el&&(0,s.jsx)(E.w,{title:"Event pattern",description:"Every key in the pattern must match the event. Arrays list allowed values; nested objects match nested fields.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(A.D,{label:"Pattern",error:eF("pattern"),children:(0,s.jsx)(J.i,{value:eh,onChange:e=>(ex(e),ej(null)),rows:8,validate:V})}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Supported matchers: exact values ",(0,s.jsx)("span",{className:"font-mono",children:'["a","b"]'}),", ",(0,s.jsx)("span",{className:"font-mono",children:'{"prefix":"ord"}'}),","," ",(0,s.jsx)("span",{className:"font-mono",children:'{"exists":true}'}),", ",(0,s.jsx)("span",{className:"font-mono",children:'{"anything-but":["x"]}'})," and"," ",(0,s.jsx)("span",{className:"font-mono",children:'{"numeric":[">",0,"<=",100]}'}),"."]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Test with a sample event"}),(0,s.jsx)(J.i,{value:ef,onChange:e=>(eg(e),ej(null)),rows:12,validate:V}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(N.$,{type:"button",variant:"outline",size:"sm",onClick:eR,disabled:eb,children:[eb?(0,s.jsx)(h.A,{className:"animate-spin"}):(0,s.jsx)(x.A,{}),"Test pattern"]}),!0===ev&&(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-sm font-medium text-emerald-700 dark:text-emerald-400",children:[(0,s.jsx)(f.A,{className:"size-4"})," The sample event matches the pattern"]}),!1===ev&&(0,s.jsxs)("span",{className:"text-destructive flex items-center gap-1.5 text-sm font-medium",children:[(0,s.jsx)(g.A,{className:"size-4"})," The sample event does not match"]})]})]})]})}),(0,s.jsx)(E.w,{title:"Targets",description:"Each target receives the event JSON, part of it, a constant, or a transformed template. Failed deliveries are retried and can go to a dead-letter queue.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[0===ey.length&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"No targets: the rule will fire and count invocations but deliver nothing."}),ey.map((e,t)=>{var a,r,n;return(0,s.jsx)(X,{index:t,row:e,options:et[e.kind],onChange:e=>ek(ey.map((a,s)=>s===t?{...a,...e}:a)),onRemove:()=>ek(ey.filter((e,a)=>a!==t)),queues:et.sqs,errors:{arn:eF("t".concat(t,"arn")),input:eF("t".concat(t,"input")),paths:null!=(a=eF("t".concat(t,"paths")))?a:eE["t".concat(t,"paths")],template:eF("t".concat(t,"template")),retries:null!=(r=eF("t".concat(t,"retries")))?r:eE["t".concat(t,"retries")],age:null!=(n=eF("t".concat(t,"age")))?n:eE["t".concat(t,"age")]}},t)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(N.$,{type:"button",variant:"outline",size:"sm",disabled:ey.length>=5,onClick:()=>ek([...ey,P()]),children:[(0,s.jsx)(v.A,{})," Add target"]}),(0,s.jsxs)("span",{className:"text-muted-foreground text-xs",children:[ey.length," of 5"]})]})]})})]}),(0,s.jsx)("aside",{className:"xl:sticky xl:top-4",children:(0,s.jsx)(E.w,{title:"Summary",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(k.J,{htmlFor:"rule-enabled",className:"font-medium",children:"Enabled"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Disabled rules keep their configuration but never fire."})]}),(0,s.jsx)(S.d,{id:"rule-enabled",checked:ew,onCheckedChange:eS})]}),(0,s.jsxs)("dl",{className:"flex flex-col gap-3 border-t pt-3 text-sm",children:[(0,s.jsx)(ee,{label:"Name",children:(0,s.jsx)("span",{className:"font-mono text-[13px] break-all",children:ea||"-"})}),(0,s.jsx)(ee,{label:"Type",children:"schedule"===el?"Schedule":"Event pattern"}),"schedule"===el?(0,s.jsx)(ee,{label:"Schedule",children:(0,s.jsx)("span",{className:"font-mono text-[13px] break-all",children:ed||"-"})}):(0,s.jsx)(ee,{label:"Pattern",children:(0,s.jsx)("span",{className:"font-mono text-[12.5px] break-all",children:(0,J.F)(eh)?"Invalid JSON":(0,R.tJ)(JSON.parse(eh),140)})}),(0,s.jsx)(ee,{label:"Targets",children:ey.filter(e=>e.arn).length?(0,s.jsx)("ul",{className:"flex flex-col gap-0.5",children:ey.filter(e=>e.arn).map(e=>{var t;return(0,s.jsxs)("li",{className:"truncate",children:[(0,s.jsxs)("span",{className:"text-muted-foreground text-xs",children:[null==(t=R.aO.find(t=>t.kind===e.kind))?void 0:t.label,":"]})," ",(0,R.je)(e.arn)]},e.arn)})}):"None"})]}),eO&&!eT&&(0,s.jsx)("p",{className:"text-destructive text-xs",children:"Some settings need attention. Check the highlighted fields."}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,s.jsxs)(N.$,{type:"submit",disabled:eJ,children:[eJ&&(0,s.jsx)(h.A,{className:"animate-spin"}),n?"Save changes":"Create rule"]}),(0,s.jsx)(N.$,{type:"button",variant:"outline",asChild:!0,children:(0,s.jsx)(l(),{href:n?(0,R.Gd)(a,w):"/events/",children:"Cancel"})})]})]})})})]})]})}let K=[{value:"event",label:"Matched event",help:"The whole event JSON."},{value:"path",label:"Part of the matched event",help:"The value at a JSONPath of the event."},{value:"constant",label:"Constant (JSON text)",help:"Fixed JSON instead of the event."},{value:"transformer",label:"Input transformer",help:"Extract values into variables, then fill a template."}],Q="__none__";function X(e){var t,a,n;let{index:l,row:i,options:d,queues:o,onChange:c,onRemove:u,errors:m}=e,[p,h]=(0,r.useState)(!1),x=p||!!(i.retries||i.maxAge||i.dlq),f=R.aO.find(e=>e.kind===i.kind),g=null!=(t=d.data)?t:[],v=i.arn&&d.data&&!g.some(e=>e.arn===i.arn),b=null!=(a=o.data)?a:[],k=K.find(e=>e.value===i.mode);return(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Target ",l+1]}),(0,s.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",className:"size-7",onClick:u,"aria-label":"Remove target",children:(0,s.jsx)(j.A,{})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[12rem_minmax(0,1fr)]",children:[(0,s.jsx)(A.D,{label:"Target type",children:(0,s.jsxs)(w.l6,{value:i.kind,onValueChange:e=>c({kind:e,arn:""}),children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":"Target type",children:(0,s.jsx)(w.yv,{})}),(0,s.jsx)(w.gC,{children:R.aO.map(e=>(0,s.jsx)(w.eb,{value:e.kind,children:e.label},e.kind))})]})}),(0,s.jsx)(A.D,{label:f.label,error:null!=(n=m.arn)?n:d.error?(0,F.gJ)(d.error):void 0,help:i.arn?(0,s.jsx)("span",{className:"font-mono break-all",children:i.arn}):void 0,children:(0,s.jsxs)(w.l6,{value:i.arn,onValueChange:e=>c({arn:e}),disabled:!d.data,children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":f.label,children:(0,s.jsx)(w.yv,{placeholder:d.data?g.length?"Choose a ".concat(f.noun):"No ".concat(f.noun,"s found"):"Loading..."})}),(0,s.jsxs)(w.gC,{children:[v&&(0,s.jsxs)(w.eb,{value:i.arn,children:[(0,R.je)(i.arn)," ",(0,s.jsx)("span",{className:"text-destructive text-xs",children:"(not found)"})]}),g.map(e=>(0,s.jsx)(w.eb,{value:e.arn,children:e.name},e.arn))]})]})})]}),(0,s.jsx)(A.D,{label:"Configure target input",help:k.help,children:(0,s.jsxs)(w.l6,{value:i.mode,onValueChange:e=>c({mode:e}),children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full sm:w-72","aria-label":"Target input",children:(0,s.jsx)(w.yv,{})}),(0,s.jsx)(w.gC,{children:K.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})}),"constant"===i.mode&&(0,s.jsx)(A.D,{label:"Constant input (JSON)",error:m.input,children:(0,s.jsx)(_.T,{rows:3,value:i.input,onChange:e=>c({input:e.target.value}),placeholder:'{"task": "cleanup"}',className:"font-mono text-[13px]",spellCheck:!1})}),"path"===i.mode&&(0,s.jsx)(A.D,{label:"Input path",error:m.input,help:"For example $.detail sends only the event's detail object.",children:(0,s.jsx)(y.p,{value:i.inputPath,onChange:e=>c({inputPath:e.target.value}),placeholder:"$.detail",className:"h-8 font-mono text-[13px]",spellCheck:!1})}),"transformer"===i.mode&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A.D,{label:"Input path",optional:!0,error:m.paths,help:"A JSON object mapping variable names to JSONPaths into the event.",children:(0,s.jsx)(_.T,{rows:3,value:i.pathsMap,onChange:e=>c({pathsMap:e.target.value}),placeholder:'{\n "order": "$.detail.order_id",\n "source": "$.source"\n}',className:"font-mono text-[13px]",spellCheck:!1})}),(0,s.jsx)(A.D,{label:"Template",error:m.template,help:"Use placeholders. inserts the whole event, the rule name.",children:(0,s.jsx)(_.T,{rows:3,value:i.template,onChange:e=>c({template:e.target.value}),placeholder:'{"text": "Order from "}',className:"font-mono text-[13px]",spellCheck:!1})})]}),(0,s.jsxs)("label",{className:"flex w-fit items-center gap-2 text-sm",children:[(0,s.jsx)(S.d,{checked:x,onCheckedChange:e=>{h(e),e||c({retries:"",maxAge:"",dlq:""})},"aria-label":"Retry policy and dead-letter queue"}),"Retry policy and dead-letter queue"]}),x&&(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,s.jsx)(A.D,{label:"Maximum age of event",error:m.age,help:"Seconds, 60-86400 (default 86400).",children:(0,s.jsx)(y.p,{inputMode:"numeric",value:i.maxAge,onChange:e=>c({maxAge:e.target.value.replace(/[^\d]/g,"")}),placeholder:"86400",className:"h-8"})}),(0,s.jsx)(A.D,{label:"Retry attempts",error:m.retries,help:"0-185 (default 185).",children:(0,s.jsx)(y.p,{inputMode:"numeric",value:i.retries,onChange:e=>c({retries:e.target.value.replace(/[^\d]/g,"")}),placeholder:"185",className:"h-8"})}),(0,s.jsx)(A.D,{label:"Dead-letter queue",help:"Undeliverable events go to this SQS queue.",error:o.error?(0,F.gJ)(o.error):void 0,children:(0,s.jsxs)(w.l6,{value:i.dlq||Q,onValueChange:e=>c({dlq:e===Q?"":e}),disabled:!o.data,children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":"Dead-letter queue",children:(0,s.jsx)(w.yv,{placeholder:"None"})}),(0,s.jsxs)(w.gC,{children:[(0,s.jsx)(w.eb,{value:Q,children:"None"}),i.dlq&&!b.some(e=>e.arn===i.dlq)&&(0,s.jsx)(w.eb,{value:i.dlq,children:(0,R.je)(i.dlq)}),b.map(e=>(0,s.jsx)(w.eb,{value:e.arn,children:e.name},e.arn))]})]})})]})]})}function ee(e){let{label:t,children:a}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground text-xs font-medium",children:t}),(0,s.jsx)("dd",{className:"min-w-0 break-words",children:a})]})}},67001:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(95155);a(12115);var r=a(25016);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},90235:(e,t,a)=>{a.d(t,{J:()=>o});var s=a(95155),r=a(12115),n=a(43991),l=a(83101),i=a(25016);let d=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.b,{ref:t,className:(0,i.cn)(d(),a),...r})});o.displayName=n.b.displayName}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2798-e9971f13e2c8bb76.js b/pages/demo/_next/static/chunks/2798-e9971f13e2c8bb76.js new file mode 100644 index 00000000..5bd1004e --- /dev/null +++ b/pages/demo/_next/static/chunks/2798-e9971f13e2c8bb76.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2798],{11363:(e,t,n)=>{n.d(t,{T:()=>i});var a=n(26276);n(29320);var r=n(88674);function i(e){let{className:t,...n}=e;return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...n})}},22798:(e,t,n)=>{n.d(t,{CQ:()=>T,DZ:()=>R,HQ:()=>N,Oo:()=>_,V5:()=>M,V9:()=>D,Xc:()=>y,cW:()=>F,dq:()=>C,j4:()=>b,m6:()=>I,oe:()=>J,ss:()=>E,wl:()=>w,xE:()=>k,yQ:()=>B});var a=n(26276),r=n(29320),i=n(40688),s=n(34993),c=n(47045),o=n(64573),l=n(81155),u=n(11363),d=n(35833),m=n(62083),h=n(74875),f=n(17286),p=n(28971),g=n(22927),x=n(73062),v=n(30902);let b="/api/v1/ec2/instances",j=["pending","stopping","shutting-down"],y=e=>j.includes(e),w=e=>e.name||e.id,N=(e,t)=>"/ec2/instance/?id=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):"");function C(e){return e.some(y)?2e3:15e3}function F(e){return"".concat(e," vCPU").concat(1===e?"":"s")}function S(e){return"".concat(F(e.vcpus),", ").concat((0,x.qt)(e.memory_mb))}function T(e){var t;let{instance:n,empty:r="-",compact:i}=e,s=Object.entries(null!=(t=n.public_ports)?t:{}).sort((e,t)=>parseInt(e[0])-parseInt(t[0]));if(!s.length)return(0,a.jsx)("span",{className:"text-muted-foreground",children:r});let c=n.public_host||"localhost";return(0,a.jsx)("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:s.map(e=>{let[t,n]=e,r=t.endsWith("/tcp"),s=i?"".concat(t.split("/")[0]," → ").concat(n):"".concat(t," → ").concat(c,":").concat(n);return r?(0,a.jsx)("a",{href:"http://".concat(c,":").concat(n),target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),className:"text-primary font-mono text-[13px] whitespace-nowrap hover:underline",children:s},t):(0,a.jsx)("span",{className:"font-mono text-[13px] whitespace-nowrap",children:s},t)})})}let M=e=>"kvm"===e.virtualization||"emulated"===e.virtualization,k=e=>"vm"===e.virtualization||!!e.vm_base;function _(e){return M(e)?"kvm"===e.virtualization?"VM \xb7 KVM":"VM \xb7 emulated":"Container"}function D(e){let{instance:t}=e,n=M(t);return(0,a.jsx)(v.E,{variant:n?"secondary":"outline",title:"emulated"===t.virtualization?"No /dev/kvm on the host: the CPU is emulated, so this VM is slow":void 0,children:_(t)})}function I(){return(0,g.gf)("/api/v1/ec2/capabilities",{revalidateOnFocus:!1})}function B(){return(0,g.gf)("/api/v1/ec2/instance-types",{revalidateOnFocus:!1})}function R(e){var t;let n=new Map;for(let a of e)n.set(a.family,[...null!=(t=n.get(a.family))?t:[],a]);return[...n.entries()]}function E(e){let{value:t,onChange:n,id:r,exclude:i}=e,{data:s,isLoading:c}=B();return(0,a.jsxs)(d.l6,{value:t,onValueChange:n,disabled:c&&!s,children:[(0,a.jsx)(d.bq,{id:r,className:"w-full",children:(0,a.jsx)(d.yv,{placeholder:c?"Loading instance types...":"Choose an instance type"})}),(0,a.jsx)(d.gC,{children:R(null!=s?s:[]).map(e=>{let[t,n]=e;return(0,a.jsxs)(d.s3,{children:[(0,a.jsx)(d.TR,{className:"text-muted-foreground text-xs",children:t}),n.map(e=>(0,a.jsxs)(d.eb,{value:e.name,disabled:e.name===i,children:[(0,a.jsx)("span",{className:"font-mono text-[13px]",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:S(e)})]},e.name))]},t)})})]})}async function V(e,t,n){let a=Promise.allSettled(e.map(t));setTimeout(()=>(0,g.Yi)(b),400);let r=await a,i=r.filter(e=>"fulfilled"===e.status).length,c=r.filter(e=>"rejected"===e.status);for(let t of(i&&s.oR.success(1===e.length?"".concat(n," ").concat(e[0]):"".concat(n," ").concat((0,x.td)(i,"instance"))),c.slice(0,3)))s.oR.error((0,p.gJ)(t.reason));await (0,g.Yi)(b)}function J(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[n,i]=(0,r.useState)(!1),[c,o]=(0,r.useState)(null),[l,u]=(0,r.useState)(null),[d,h]=(0,r.useState)(null),v=(e,t)=>async n=>{if(n.length){i(!0);try{await V(n,e,t)}finally{i(!1)}}},j=v(e=>p.FH.post("".concat(b,"/").concat((0,p.aJ)(e),"/start")),"Started"),y=v(e=>p.FH.post("".concat(b,"/").concat((0,p.aJ)(e),"/stop")),"Stopped"),N=v(e=>p.FH.post("".concat(b,"/").concat((0,p.aJ)(e),"/reboot")),"Rebooted"),C=(null==c?void 0:c.length)===1?c[0]:null,F=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.T,{open:!!c,onOpenChange:e=>!e&&o(null),title:C?"Terminate ".concat(w(C),"?"):"Terminate ".concat((0,x.td)(null!=(e=null==c?void 0:c.length)?e:0,"instance"),"?"),description:(0,a.jsxs)(a.Fragment,{children:["Terminating removes the instance container and releases its private IP. Volumes marked ",(0,a.jsx)("em",{children:"delete on termination"})," are deleted; other volumes become available. This cannot be undone."]}),confirmText:C?w(C):"terminate",actionLabel:"Terminate",onConfirm:async()=>{var e;let n=null!=c?c:[],a=await Promise.allSettled(n.map(e=>p.FH.del("".concat(b,"/").concat((0,p.aJ)(e.id)))));await (0,g.Yi)("/api/v1/ec2");let r=a.filter(e=>"rejected"===e.status),i=n.length-r.length;if(i&&s.oR.success(1===n.length?"Terminated ".concat(n[0].id):"Terminated ".concat((0,x.td)(i,"instance"))),r.length)throw r[0].reason;null==(e=t.onTerminated)||e.call(t)},children:c&&c.length>1&&(0,a.jsx)("ul",{className:"bg-muted/40 max-h-40 overflow-y-auto rounded-md border p-2 text-sm",children:c.map(e=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 py-0.5",children:[(0,a.jsxs)("span",{className:"truncate",children:[e.name&&(0,a.jsx)("span",{className:"mr-2",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-[13px]",children:e.id})]}),(0,a.jsx)(f.Wh,{status:e.state})]},e.id))})}),(0,a.jsx)(P,{instance:l,onClose:()=>u(null)}),(0,a.jsx)(z,{instance:d,onClose:()=>h(null)})]});return{start:j,stop:y,reboot:N,terminate:e=>{e.length&&o(e)},changeType:u,createImage:h,busy:n,dialogs:F}}function P(e){let{instance:t,onClose:n}=e,[l,u]=(0,r.useState)(""),[d,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&u(t.instance_type)},[t]);let f=async e=>{if(e.preventDefault(),t&&l&&l!==t.instance_type){m(!0);try{await p.FH.patch("".concat(b,"/").concat((0,p.aJ)(t.id)),{instance_type:l}),s.oR.success("Changed ".concat(w(t)," to ").concat(l)),await (0,g.Yi)(b),n()}catch(e){s.oR.error((0,p.gJ)(e))}finally{m(!1)}}};return(0,a.jsx)(o.lG,{open:!!t,onOpenChange:e=>!e&&!d&&n(),children:(0,a.jsx)(o.Cf,{children:(0,a.jsxs)("form",{onSubmit:f,className:"flex flex-col gap-4",children:[(0,a.jsxs)(o.c7,{children:[(0,a.jsx)(o.L3,{children:"Change instance type"}),(0,a.jsx)(o.rr,{children:"The instance must be stopped. The new CPU and memory limits apply the next time it starts."})]}),t&&(0,a.jsxs)("p",{className:"text-sm",children:["Current type: ",(0,a.jsx)("span",{className:"font-mono text-[13px]",children:t.instance_type})," ",(0,a.jsxs)("span",{className:"text-muted-foreground",children:["(",S({vcpus:t.vcpus,memory_mb:t.memory_mb}),")"]})]}),(0,a.jsx)(h.D,{label:"New instance type",htmlFor:"new-type",children:(0,a.jsx)(E,{id:"new-type",value:l,onChange:u})}),(0,a.jsxs)(o.Es,{children:[(0,a.jsx)(c.$,{type:"button",variant:"outline",onClick:n,disabled:d,children:"Cancel"}),(0,a.jsxs)(c.$,{type:"submit",disabled:d||!t||l===t.instance_type,children:[d&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Apply"]})]})]})})})}function z(e){let{instance:t,onClose:n}=e,[d,m]=(0,r.useState)(""),[f,x]=(0,r.useState)(""),[v,j]=(0,r.useState)(null),[y,N]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&(m("".concat(w(t),"-image")),x(""),j(null))},[t]);let C=async e=>{if(e.preventDefault(),t){if(!d.trim())return void j("Enter an image name");if(d.length>128)return void j("Image names are at most 128 characters");N(!0);try{let e=await p.FH.post("".concat(b,"/").concat((0,p.aJ)(t.id),"/image"),{name:d.trim(),description:f.trim()});s.oR.success("Created image ".concat(e.id)),await (0,g.Yi)("/api/v1/ec2/images"),n()}catch(e){s.oR.error((0,p.gJ)(e))}finally{N(!1)}}};return(0,a.jsx)(o.lG,{open:!!t,onOpenChange:e=>!e&&!y&&n(),children:(0,a.jsx)(o.Cf,{children:(0,a.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-4",children:[(0,a.jsxs)(o.c7,{children:[(0,a.jsx)(o.L3,{children:"Create image"}),(0,a.jsx)(o.rr,{children:"Captures the instance's filesystem as a new AMI you can launch more instances from. Attached volumes are not included."})]}),(0,a.jsx)(h.D,{label:"Image name",htmlFor:"img-name",error:v,children:(0,a.jsx)(l.p,{id:"img-name",value:d,onChange:e=>(m(e.target.value),j(null)),autoFocus:!0})}),(0,a.jsx)(h.D,{label:"Description",htmlFor:"img-desc",optional:!0,children:(0,a.jsx)(u.T,{id:"img-desc",rows:3,value:f,onChange:e=>x(e.target.value)})}),(0,a.jsxs)(o.Es,{children:[(0,a.jsx)(c.$,{type:"button",variant:"outline",onClick:n,disabled:y,children:"Cancel"}),(0,a.jsxs)(c.$,{type:"submit",disabled:y,children:[y&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Create image"]})]})]})})})}},30902:(e,t,n)=>{n.d(t,{E:()=>o});var a=n(26276);n(29320);var r=n(18442),i=n(5820),s=n(88674);let c=(0,i.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:n,asChild:i=!1,...o}=e,l=i?r.DX:"span";return(0,a.jsx)(l,{"data-slot":"badge",className:(0,s.cn)(c({variant:n}),t),...o})}},73062:(e,t,n)=>{n.d(t,{Fl:()=>f,YI:()=>c,Yq:()=>l,ZV:()=>s,a3:()=>m,fF:()=>d,fU:()=>u,qt:()=>i,td:()=>h,z3:()=>r});let a=["B","KB","MB","GB","TB","PB"];function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),r=0;for(;n>=1024&&r=100?0:t);return"".concat(e<0?"-":"").concat(i," ").concat(a[r])}function i(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function c(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(s(e,1),"%");case"Bytes":return r(e);case"Bytes/Second":return"".concat(r(e),"/s");case"Milliseconds":return"".concat(s(e,0)," ms");case"Seconds":return"".concat(s(e,1)," s");default:return s(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function l(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=o(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function u(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=o(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,r=Math.abs(a),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(r<45||a>0&&a<60)return"just now";let s=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(s)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function f(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2811-15c9c2f02394d4cc.js b/pages/demo/_next/static/chunks/2811-15c9c2f02394d4cc.js new file mode 100644 index 00000000..6e0d99d1 --- /dev/null +++ b/pages/demo/_next/static/chunks/2811-15c9c2f02394d4cc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2811],{1211:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},1897:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},2430:(e,t,a)=>{a.d(t,{N:()=>c});var l=a(29320),d=a(65335),y=a(36103),r=a(18442),h=a(26276);function c(e){let t=e+"CollectionProvider",[a,c]=(0,d.A)(t),[k,p]=a(t,{collectionRef:{current:null},itemMap:new Map}),i=e=>{let{scope:t,children:a}=e,d=l.useRef(null),y=l.useRef(new Map).current;return(0,h.jsx)(k,{scope:t,itemMap:y,collectionRef:d,children:a})};i.displayName=t;let n=e+"CollectionSlot",o=l.forwardRef((e,t)=>{let{scope:a,children:l}=e,d=p(n,a),c=(0,y.s)(t,d.collectionRef);return(0,h.jsx)(r.DX,{ref:c,children:l})});o.displayName=n;let A=e+"CollectionItemSlot",u="data-radix-collection-item",m=l.forwardRef((e,t)=>{let{scope:a,children:d,...c}=e,k=l.useRef(null),i=(0,y.s)(t,k),n=p(A,a);return l.useEffect(()=>(n.itemMap.set(k,{ref:k,...c}),()=>void n.itemMap.delete(k))),(0,h.jsx)(r.DX,{...{[u]:""},ref:i,children:d})});return m.displayName=A,[{Provider:i,Slot:o,ItemSlot:m},function(t){let a=p(e+"CollectionConsumer",t);return l.useCallback(()=>{let e=a.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(u,"]")));return Array.from(a.itemMap.values()).sort((e,a)=>t.indexOf(e.ref.current)-t.indexOf(a.ref.current))},[a.collectionRef,a.itemMap])},c]}},7489:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},10002:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37111:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]])},37995:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39367:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},39727:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},59947:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},64761:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},77440:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},86931:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},89965:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},97645:(e,t,a)=>{a.d(t,{jH:()=>y});var l=a(29320);a(26276);var d=l.createContext(void 0);function y(e){let t=l.useContext(d);return e||t||"ltr"}},98123:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(14680).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2868-47f12b686ed1aebc.js b/pages/demo/_next/static/chunks/2868-47f12b686ed1aebc.js deleted file mode 100644 index a39a5c53..00000000 --- a/pages/demo/_next/static/chunks/2868-47f12b686ed1aebc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2868],{6132:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},23327:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},43465:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>M});var n=r(12115),l=r.t(n,2),o=r(47650),i=Object.defineProperty,a=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:l,...o}=t,i=null,a=!1,c=[];g(l)&&"function"==typeof S&&(l=S(l._payload)),n.Children.forEach(l,e=>{if(v(e)){a=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof S&&(t=S(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=n.cloneElement(i,void 0,c):!a&&1===n.Children.count(l)&&n.isValidElement(l)&&(i=l);let d=i?m(i):void 0,u=s(r,d);if(!i){if(l||0===l)throw Error(a?A(e):w(e));return l}let f=b(o,i.props??{});return i.type!==n.Fragment&&(f.ref=r?u:d),n.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}f(p,"createSlot");var y=Symbol.for("radix.slottable");f(function(e){let t=f(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=f((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}f(b,"mergeProps"),f(m,"getElementRef"),f(v,"isSlottable");var k=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===k&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}f(g,"isLazyComponent"),f(x,"isPromiseLike");var w=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),A=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=l[" use ".trim().toString()],E=r(95155),j=Object.defineProperty,R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),l=n.forwardRef((e,n)=>{let{asChild:l,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(l?r:t,{...o,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});j(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,M=n.forwardRef(C(function(e,t){return(0,E.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},71360:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},74054:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},86651:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>w,zi:()=>A});var n=r(12115),l=r(92556),o=r(94446),i=r(3468),a=r(70222),c=r(78108),d=r(4129),s=r(97602),u=r(95155),f="Switch",[p,y]=(0,i.A)(f),[h,b]=p(f),m=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:f,disabled:p,value:y="on",onCheckedChange:b,form:m,...v}=e,[k,w]=n.useState(null),A=(0,o.s)(t,e=>w(e)),S=n.useRef(!1),E=!k||m||!!k.closest("form"),[j=!1,R]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[l,o]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[l]=r,o=n.useRef(l),i=(0,a.c)(t);return n.useEffect(()=>{o.current!==l&&(i(l),o.current=l)},[l,o,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:l,d=(0,a.c)(r);return[c,n.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else o(t)},[i,e,o,d])]}({prop:c,defaultProp:d,onChange:b});return(0,u.jsxs)(h,{scope:r,checked:j,disabled:p,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":j,"aria-required":f,"data-state":x(j),"data-disabled":p?"":void 0,disabled:p,value:y,...v,ref:A,onClick:(0,l.m)(e.onClick,e=>{R(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,u.jsx)(g,{control:k,bubbles:!S.current,name:i,value:y,checked:j,required:f,disabled:p,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=f;var v="SwitchThumb",k=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,l=b(v,r);return(0,u.jsx)(s.sG.span,{"data-state":x(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:t})});k.displayName=v;var g=e=>{let{control:t,checked:r,bubbles:l=!0,...o}=e,i=n.useRef(null),a=(0,c.Z)(r),s=function(e){let[t,r]=n.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,l;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,l=t.blockSize}else n=e.offsetWidth,l=e.offsetHeight;r({width:n,height:l})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(a!==r&&t){let n=new Event("click",{bubbles:l});t.call(e,r),e.dispatchEvent(n)}},[a,r,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function x(e){return e?"checked":"unchecked"}var w=m,A=k}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2886-f35b181bb9b3e6f5.js b/pages/demo/_next/static/chunks/2886-f35b181bb9b3e6f5.js new file mode 100644 index 00000000..55f34a15 --- /dev/null +++ b/pages/demo/_next/static/chunks/2886-f35b181bb9b3e6f5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2886],{1211:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},37995:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>A});var n=r(29320),l=r(62315),o=r(36103),i=r(65335),a=r(82275),c=r(79225),d=r(96886),s=r(12377),u=r(26276),f="Switch",[p,h]=(0,i.A)(f),[y,b]=p(f),m=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:f,disabled:p,value:h="on",onCheckedChange:b,form:m,...v}=e,[k,x]=n.useState(null),A=(0,o.s)(t,e=>x(e)),S=n.useRef(!1),E=!k||m||!!k.closest("form"),[j=!1,R]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[l,o]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[l]=r,o=n.useRef(l),i=(0,a.c)(t);return n.useEffect(()=>{o.current!==l&&(i(l),o.current=l)},[l,o,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:l,d=(0,a.c)(r);return[c,n.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else o(t)},[i,e,o,d])]}({prop:c,defaultProp:d,onChange:b});return(0,u.jsxs)(y,{scope:r,checked:j,disabled:p,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":j,"aria-required":f,"data-state":w(j),"data-disabled":p?"":void 0,disabled:p,value:h,...v,ref:A,onClick:(0,l.m)(e.onClick,e=>{R(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,u.jsx)(g,{control:k,bubbles:!S.current,name:i,value:h,checked:j,required:f,disabled:p,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=f;var v="SwitchThumb",k=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,l=b(v,r);return(0,u.jsx)(s.sG.span,{"data-state":w(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:t})});k.displayName=v;var g=e=>{let{control:t,checked:r,bubbles:l=!0,...o}=e,i=n.useRef(null),a=(0,c.Z)(r),s=function(e){let[t,r]=n.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,l;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,l=t.blockSize}else n=e.offsetWidth,l=e.offsetHeight;r({width:n,height:l})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(a!==r&&t){let n=new Event("click",{bubbles:l});t.call(e,r),e.dispatchEvent(n)}},[a,r,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function w(e){return e?"checked":"unchecked"}var x=m,A=k},72474:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>P});var n=r(29320),l=r.t(n,2),o=r(93993),i=Object.defineProperty,a=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:l,...o}=t,i=null,a=!1,c=[];g(l)&&"function"==typeof S&&(l=S(l._payload)),n.Children.forEach(l,e=>{if(v(e)){a=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof S&&(t=S(t._payload)),i=y(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=n.cloneElement(i,void 0,c):!a&&1===n.Children.count(l)&&n.isValidElement(l)&&(i=l);let d=i?m(i):void 0,u=s(r,d);if(!i){if(l||0===l)throw Error(a?A(e):x(e));return l}let f=b(o,i.props??{});return i.type!==n.Fragment&&(f.ref=r?u:d),n.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}f(p,"createSlot");var h=Symbol.for("radix.slottable");f(function(e){let t=f(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var y=f((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}f(b,"mergeProps"),f(m,"getElementRef"),f(v,"isSlottable");var k=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===k&&"_payload"in e&&w(e._payload)}function w(e){return"object"==typeof e&&null!==e&&"then"in e}f(g,"isLazyComponent"),f(w,"isPromiseLike");var x=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),A=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=l[" use ".trim().toString()],E=r(26276),j=Object.defineProperty,R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),l=n.forwardRef((e,n)=>{let{asChild:l,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(l?r:t,{...o,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});j(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,P=n.forwardRef(C(function(e,t){return(0,E.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2897-1ffbde21ffffc29a.js b/pages/demo/_next/static/chunks/2897-1ffbde21ffffc29a.js new file mode 100644 index 00000000..8f229a45 --- /dev/null +++ b/pages/demo/_next/static/chunks/2897-1ffbde21ffffc29a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2897],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},44057:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},61427:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},79092:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>z});var r=l(29320),a=l.t(r,2),n=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let l=!1,r=e.map(e=>{let r=d(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function u(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,d=[];b(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;b(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=r.cloneElement(i,void 0,d):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let c=i?m(i):void 0,y=p(l,c);if(!i){if(a||0===a)throw Error(o?M(e):g(e));return a}let h=k(n,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:c),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(u,"createSlot");var f=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=f,t},"createSlottable");var s=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}h(k,"mergeProps"),h(m,"getElementRef"),h(v,"isSlottable");var A=Symbol.for("react.lazy");function b(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===A&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}h(b,"isLazyComponent"),h(x,"isPromiseLike");var g=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],C=l(26276),E=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=u(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,C.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});E(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,z=r.forwardRef(j(function(e,t){return(0,C.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2911-08266d2d9b9f028c.js b/pages/demo/_next/static/chunks/2911-08266d2d9b9f028c.js deleted file mode 100644 index f2adfc49..00000000 --- a/pages/demo/_next/static/chunks/2911-08266d2d9b9f028c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2911],{6132:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},14639:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])},20562:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},32978:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(12115),n=r.t(l,2),a=r(47650),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function u(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];g(n)&&"function"==typeof M&&(n=M(n._payload)),l.Children.forEach(n,e=>{if(m(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof M&&(t=M(t._payload)),i=f(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?b(i):void 0,s=p(r,d);if(!i){if(n||0===n)throw Error(o?w(e):A(e));return n}let y=k(a,i.props??{});return i.type!==l.Fragment&&(y.ref=r?s:d),l.cloneElement(i,y)});return t.displayName=`${e}.Slot`,t}y(u,"createSlot");var h=Symbol.for("radix.slottable");y(function(e){let t=y(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var f=y((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function m(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}y(k,"mergeProps"),y(b,"getElementRef"),y(m,"isSlottable");var v=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}y(g,"isLazyComponent"),y(x,"isPromiseLike");var A=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=r(95155),E=Object.defineProperty,j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=u(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,R=l.forwardRef(C(function(e,t){return(0,S.jsx)(j.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52056:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},61362:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},74054:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},78874:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},93499:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},97049:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]])},99051:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>A,zi:()=>w});var l=r(12115),n=r(92556),a=r(94446),i=r(3468),o=r(70222),c=r(78108),d=r(4129),p=r(97602),s=r(95155),y="Switch",[u,h]=(0,i.A)(y),[f,k]=u(y),b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:y,disabled:u,value:h="on",onCheckedChange:k,form:b,...m}=e,[v,A]=l.useState(null),w=(0,a.s)(t,e=>A(e)),M=l.useRef(!1),S=!v||b||!!v.closest("form"),[E=!1,j]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,s.jsxs)(f,{scope:r,checked:E,disabled:u,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":y,"data-state":x(E),"data-disabled":u?"":void 0,disabled:u,value:h,...m,ref:w,onClick:(0,n.m)(e.onClick,e=>{j(e=>!e),S&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),S&&(0,s.jsx)(g,{control:v,bubbles:!M.current,name:i,value:h,checked:E,required:y,disabled:u,form:b,style:{transform:"translateX(-100%)"}})]})});b.displayName=y;var m="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(m,r);return(0,s.jsx)(p.sG.span,{"data-state":x(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=m;var g=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function x(e){return e?"checked":"unchecked"}var A=b,w=v}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/2999-a21f98017c0bf06b.js b/pages/demo/_next/static/chunks/2999-a21f98017c0bf06b.js deleted file mode 100644 index 8151e33a..00000000 --- a/pages/demo/_next/static/chunks/2999-a21f98017c0bf06b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2999],{6132:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},21873:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},32978:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,l)=>{l.d(t,{b:()=>R});var r=l(12115),n=l.t(r,2),a=l(47650),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function u(e){let t=r.forwardRef((t,l)=>{let{children:n,...a}=t,i=null,o=!1,c=[];A(n)&&"function"==typeof w&&(n=w(n._payload)),r.Children.forEach(n,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(n)&&r.isValidElement(n)&&(i=n);let d=i?k(i):void 0,y=p(l,d);if(!i){if(n||0===n)throw Error(o?M(e):x(e));return n}let f=m(a,i.props??{});return i.type!==r.Fragment&&(f.ref=l?y:d),r.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}f(u,"createSlot");var s=Symbol.for("radix.slottable");f(function(e){let t=f(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var h=f((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let l={...t};for(let r in t){let n=e[r],a=t[r];/^on[A-Z]/.test(r)?n&&a?l[r]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(l[r]=n):"style"===r?l[r]={...n,...a}:"className"===r&&(l[r]=[n,a].filter(Boolean).join(" "))}return{...e,...l}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}f(m,"mergeProps"),f(k,"getElementRef"),f(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}f(A,"isLazyComponent"),f(g,"isPromiseLike");var x=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=n[" use ".trim().toString()],C=l(95155),E=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=u(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,C.jsx)(n?l:t,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=r.forwardRef(j(function(e,t){return(0,C.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52056:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},61362:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},74054:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},78874:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89559:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},99051:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3041-087b8498f815199e.js b/pages/demo/_next/static/chunks/3041-087b8498f815199e.js new file mode 100644 index 00000000..68f54acd --- /dev/null +++ b/pages/demo/_next/static/chunks/3041-087b8498f815199e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3041],{12373:(e,t,a)=>{a.d(t,{p:()=>l});var r=a(26276),n=a(72474),s=a(88674);function l(e){let{icon:t=n.A,title:a,description:l,action:o,className:c}=e;return(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-col items-center justify-center gap-2 px-6 py-12 text-center",c),children:[(0,r.jsx)("div",{className:"bg-muted text-muted-foreground mb-1 flex size-11 items-center justify-center rounded-full",children:(0,r.jsx)(t,{className:"size-5"})}),(0,r.jsx)("p",{className:"font-medium",children:a}),l&&(0,r.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}),o&&(0,r.jsx)("div",{className:"mt-2",children:o})]})}},28553:(e,t,a)=>{a.d(t,{LY:()=>u,O6:()=>c,_y:()=>i,fP:()=>d});var r=a(26276),n=a(15410),s=a(10002),l=a(47045),o=a(81155);function c(e){return Object.entries(null!=e?e:{}).map(e=>{let[t,a]=e;return{key:t,value:a}})}function i(e){let t={};for(let a of e)a.key.trim()&&(t[a.key.trim()]=a.value);return Object.keys(t).length?t:void 0}function d(e){let{rows:t,onChange:a,keyPlaceholder:c="Key",valuePlaceholder:i="Value",addLabel:d="Add tag",max:u=50}=e,h=(e,r)=>a(t.map((t,a)=>a===e?{...t,...r}:t));return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[t.length>0&&(0,r.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,r.jsx)("span",{children:c}),(0,r.jsx)("span",{children:i})]}),t.map((e,s)=>(0,r.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,r.jsx)(o.p,{value:e.key,onChange:e=>h(s,{key:e.target.value}),placeholder:c,className:"h-8"}),(0,r.jsx)(o.p,{value:e.value,onChange:e=>h(s,{value:e.target.value}),placeholder:i,className:"h-8"}),(0,r.jsx)(l.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>a(t.filter((e,t)=>t!==s)),"aria-label":"Remove",children:(0,r.jsx)(n.A,{})})]},s)),(0,r.jsx)("div",{children:(0,r.jsxs)(l.$,{type:"button",variant:"outline",size:"sm",onClick:()=>a([...t,{key:"",value:""}]),disabled:t.length>=u,children:[(0,r.jsx)(s.A,{})," ",d]})})]})}function u(e){let{tags:t}=e,a=Object.entries(null!=t?t:{});return a.length?(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(e=>{let[t,a]=e;return(0,r.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:t}),a&&(0,r.jsxs)("span",{children:["=",a]})]},t)})}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},58788:(e,t,a)=>{a.d(t,{c:()=>r});let r=["RUNNING","SUCCEEDED","FAILED","TIMED_OUT","ABORTED"]},62083:(e,t,a)=>{a.d(t,{T:()=>u});var r=a(26276),n=a(29320),s=a(40688),l=a(47045),o=a(64573),c=a(81155),i=a(28971),d=a(34993);function u(e){let{open:t,onOpenChange:a,title:u,description:h,children:x,confirmText:m,actionLabel:f="Delete",destructive:g=!0,onConfirm:p}=e,[y,v]=(0,n.useState)(""),[b,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&v("")},[t]);let N=!b&&(!m||y===m),k=async e=>{if(null==e||e.preventDefault(),N){j(!0);try{await p(),a(!1)}catch(e){d.oR.error((0,i.gJ)(e))}finally{j(!1)}}};return(0,r.jsx)(o.lG,{open:t,onOpenChange:e=>!b&&a(e),children:(0,r.jsx)(o.Cf,{className:"sm:max-w-lg",children:(0,r.jsxs)("form",{onSubmit:k,className:"flex flex-col gap-4",children:[(0,r.jsxs)(o.c7,{children:[(0,r.jsx)(o.L3,{children:u}),h&&(0,r.jsx)(o.rr,{asChild:!0,children:(0,r.jsx)("div",{children:h})})]}),x,m&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("label",{className:"text-sm",htmlFor:"confirm-input",children:["To confirm, type ",(0,r.jsx)("span",{className:"bg-muted rounded px-1 font-mono font-medium",children:m})," in the field."]}),(0,r.jsx)(c.p,{id:"confirm-input",autoFocus:!0,autoComplete:"off",value:y,onChange:e=>v(e.target.value),placeholder:m})]}),(0,r.jsxs)(o.Es,{children:[(0,r.jsx)(l.$,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:b,children:"Cancel"}),(0,r.jsxs)(l.$,{type:"submit",variant:g?"destructive":"default",disabled:!N,children:[b&&(0,r.jsx)(s.A,{className:"animate-spin"}),f]})]})]})})})}},64573:(e,t,a)=>{a.d(t,{Cf:()=>d,Es:()=>h,L3:()=>x,c7:()=>u,lG:()=>o,rr:()=>m});var r=a(26276);a(29320);var n=a(68779),s=a(15410),l=a(88674);function o(e){let{...t}=e;return(0,r.jsx)(n.bL,{"data-slot":"dialog",...t})}function c(e){let{...t}=e;return(0,r.jsx)(n.ZL,{"data-slot":"dialog-portal",...t})}function i(e){let{className:t,...a}=e;return(0,r.jsx)(n.hJ,{"data-slot":"dialog-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function d(e){let{className:t,children:a,showCloseButton:o=!0,...d}=e;return(0,r.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,r.jsx)(i,{}),(0,r.jsxs)(n.UC,{"data-slot":"dialog-content",className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...d,children:[a,o&&(0,r.jsxs)(n.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,r.jsx)(s.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,l.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function h(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-footer",className:(0,l.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function x(e){let{className:t,...a}=e;return(0,r.jsx)(n.hE,{"data-slot":"dialog-title",className:(0,l.cn)("text-lg leading-none font-semibold",t),...a})}function m(e){let{className:t,...a}=e;return(0,r.jsx)(n.VY,{"data-slot":"dialog-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...a})}},69298:(e,t,a)=>{a.d(t,{L3:()=>p,bH:()=>k});var r=a(26276),n=a(29320),s=a(7489),l=a(57275),o=a(79433),c=a(47045),i=a(88674);let d=e=>!!e&&"object"==typeof e&&!Array.isArray(e);class u extends Error{}let h={Equals:"==",LessThan:"<",GreaterThan:">",LessThanEquals:"<=",GreaterThanEquals:">=",Matches:"~"},x=(e,t)=>e.length>t?"".concat(e.slice(0,Math.max(1,t-1)),"…"):e;function m(e,t){let a=e[t];if(!d(a))return[];let r=[],n=(t,a,n)=>{"string"==typeof t&&t in e&&r.push({to:t,kind:a,label:n})};if(n(a.Next,"next"),Array.isArray(a.Choices))for(let e of a.Choices)d(e)&&n(e.Next,"choice",function e(t){if(!d(t))return"?";if(Array.isArray(t.And))return"And (".concat(t.And.length," rules)");if(Array.isArray(t.Or))return"Or (".concat(t.Or.length," rules)");if(d(t.Not))return"Not ".concat(e(t.Not));let a="string"==typeof t.Variable?t.Variable.replace(/^\$\.?/,"")||"$":"?",r=Object.keys(t).find(e=>"Variable"!==e&&"Next"!==e&&"Comment"!==e);if(!r)return a;let n=t[r],s=r.match(/^(String|Numeric|Boolean|Timestamp)(Equals|LessThan|GreaterThan|LessThanEquals|GreaterThanEquals|Matches)(Path)?$/);return s?"".concat(a," ").concat(h[s[2]]," ").concat(s[3]?String(n).replace(/^\$\.?/,""):JSON.stringify(n)):"".concat(a," ").concat(r).concat(!0===n?"":"=".concat(JSON.stringify(n)))}(e));if(n(a.Default,"default","Default"),Array.isArray(a.Catch))for(let e of a.Catch){if(!d(e))continue;let t=Array.isArray(e.ErrorEquals)?e.ErrorEquals.map(String).join(", "):"error";n(e.Next,"catch","Catch: ".concat(t))}return r}function f(e){return{w:216,h:56,nodes:[],edges:[],note:e}}function g(e,t,a,r,n){let s=1-e;return s*s*s*t+3*s*s*e*a+3*s*e*e*r+e*e*e*n}function p(e,t){let a=new Map;for(let t of null!=e?e:[]){var r;if(!t.state)continue;let e=null!=(r=a.get(t.state))?r:{entered:0,exited:0,failed:0,lastCaught:!1};t.type.endsWith("StateEntered")?e.entered++:t.type.endsWith("StateExited")?(e.exited++,e.lastCaught=d(t.details)&&"caught"in t.details):t.type.endsWith("StateFailed")&&e.failed++,a.set(t.state,e)}let n={};for(let[e,r]of a)r.entered>r.exited+r.failed?n[e]=t?"entered":"failed":r.failed>0?n[e]="failed":r.lastCaught?n[e]="caught":r.exited>0&&(n[e]="succeeded");return n}let y={entered:"stroke-amber-500 fill-amber-500/10 dark:stroke-amber-400",succeeded:"stroke-emerald-600 fill-emerald-500/10 dark:stroke-emerald-400",failed:"stroke-red-600 fill-red-500/10 dark:stroke-red-400",caught:"stroke-orange-500 fill-orange-500/10 dark:stroke-orange-400"},v=[{status:"entered",label:"In progress",swatch:"border-amber-500 bg-amber-500/10 dark:border-amber-400"},{status:"succeeded",label:"Succeeded",swatch:"border-emerald-600 bg-emerald-500/10 dark:border-emerald-400"},{status:"failed",label:"Failed",swatch:"border-red-600 bg-red-500/10 dark:border-red-400"},{status:"caught",label:"Caught error",swatch:"border-dashed border-orange-500 bg-orange-500/10 dark:border-orange-400"}];function b(e){let{x:t,y:a,text:n}=e,s=5.7*n.length+10;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:t-s/2,y:a-8,width:s,height:16,rx:4,fill:"var(--card)",stroke:"var(--border)"}),(0,r.jsx)("text",{x:t,y:a+3.5,textAnchor:"middle",fontSize:10,fill:"var(--muted-foreground)",children:n})]})}function j(e){var t;let{node:a,statuses:n,arrow:s}=e,l=null==n?void 0:n[a.name],{x:o,y:c,w:d,h:u}=a,h=(0,r.jsx)("title",{children:"".concat(a.name," (").concat(a.type,")").concat(l?" - ".concat(null==(t=v.find(e=>e.status===l))?void 0:t.label):"")}),m=l?y[l]:void 0,f="caught"===l?"5 3":void 0;if(a.groups)return(0,r.jsxs)("g",{children:[h,(0,r.jsx)("rect",{x:o,y:c,width:d,height:u,rx:10,fill:"var(--muted)",fillOpacity:l?void 0:.45,stroke:"var(--border)",strokeWidth:l?2:1.25,strokeDasharray:f,className:(0,i.cn)(m,"entered"===l&&"animate-pulse")}),(0,r.jsx)("text",{x:o+12,y:c+18,fontSize:12.5,fontWeight:600,fill:"var(--foreground)",children:x(a.name,Math.floor((d-24)/7.2))}),(0,r.jsx)("text",{x:o+12,y:c+32,fontSize:10.5,fill:"var(--muted-foreground)",children:"Map"===a.type?"Map \xb7 item processor":"Parallel \xb7 ".concat(a.groups.length," branch").concat(1===a.groups.length?"":"es")}),a.groups.map((e,t)=>(0,r.jsxs)("g",{transform:"translate(".concat(o+e.x," ").concat(c+e.y,")"),children:[(0,r.jsx)("rect",{width:e.block.w,height:e.block.h,rx:8,fill:"var(--card)",stroke:"var(--border)",strokeDasharray:"4 3"}),(0,r.jsx)(N,{block:e.block,statuses:n,arrow:s})]},t))]});let g="Fail"===a.type;return(0,r.jsxs)("g",{children:[h,"entered"===l&&(0,r.jsx)("rect",{x:o-4,y:c-4,width:d+8,height:u+8,rx:a.terminal?(u+8)/2:12,fill:"none",strokeWidth:2,className:"animate-pulse stroke-amber-400/70"}),(0,r.jsx)("rect",{x:o,y:c,width:d,height:u,rx:a.terminal?u/2:8,fill:"var(--card)",stroke:g?"var(--destructive)":a.terminal?"var(--muted-foreground)":"var(--border)",strokeOpacity:g&&!l?.7:1,strokeWidth:l?2.25:a.terminal?1.75:1.25,strokeDasharray:f,className:m}),(0,r.jsx)("text",{x:o+d/2,y:c+20,textAnchor:"middle",fontSize:12.5,fontWeight:600,fill:"var(--foreground)",children:x(a.name,Math.floor((d-20)/7.2))}),(0,r.jsxs)("text",{x:o+d/2,y:c+35,textAnchor:"middle",fontSize:10.5,fill:"var(--muted-foreground)",children:[a.type,"Succeed"!==a.type&&"Fail"!==a.type&&a.terminal?" \xb7 End":""]})]})}function N(e){let{block:t,statuses:a,arrow:n}=e;return t.note?(0,r.jsx)("text",{x:t.w/2,y:t.h/2+4,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",children:x(t.note,34)}):(0,r.jsxs)("g",{children:[t.edges.map((e,t)=>(0,r.jsx)("path",{d:e.path,fill:"none",stroke:"var(--muted-foreground)",strokeOpacity:.75,strokeWidth:1.4,strokeDasharray:e.dashed?"5 4":void 0,markerEnd:"url(#".concat(n,")")},t)),t.start&&(0,r.jsx)("circle",{cx:t.start.x,cy:t.start.y,r:7,fill:"var(--primary)"}),t.end&&(0,r.jsxs)("g",{children:[(0,r.jsx)("circle",{cx:t.end.x,cy:t.end.y,r:7,fill:"none",stroke:"var(--foreground)",strokeWidth:1.5}),(0,r.jsx)("circle",{cx:t.end.x,cy:t.end.y,r:4,fill:"var(--foreground)"})]}),t.nodes.map(e=>(0,r.jsx)(j,{node:e,statuses:a,arrow:n},e.name)),t.edges.map((e,t)=>e.label?(0,r.jsx)(b,{x:e.lx,y:e.ly,text:e.label},t):null)]})}function k(e){let{definition:t,statuses:a,className:h,toolbar:p}=e,y=(0,n.useId)(),b="sfn-arrow-".concat(y.replace(/[^a-zA-Z0-9_-]/g,"")),[j,k]=(0,n.useState)(!0),w=(0,n.useMemo)(()=>{try{return{block:function e(t){var a,r,n;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!d(t))throw new u("The definition must be a JSON object");let l=t.States;if(!d(l)||0===Object.keys(l).length)throw new u("The definition has no States");let o=Object.keys(l),c="string"==typeof t.StartAt&&t.StartAt in l?t.StartAt:null,i=new Map,h=[];if(c){let e=new Set([c]),t=[c];for(;t.length;){let a=t.shift();for(let r of(h.push(a),m(l,a)))e.has(r.to)||(e.add(r.to),t.push(r.to))}let a=new Set,r=new Set,n=new Set,s=e=>{for(let t of(r.add(e),m(l,e)))r.has(t.to)?a.add("".concat(e,"\0").concat(t.to)):n.has(t.to)||s(t.to);r.delete(e),n.add(e)};s(c);let o=new Map(h.map(e=>[e,0])),d=e=>m(l,e).filter(t=>!a.has("".concat(e,"\0").concat(t.to)));for(let e of h)for(let t of d(e))o.set(t.to,o.get(t.to)+1);for(let e of h)i.set(e,0);let u=h.filter(e=>0===o.get(e));for(;u.length;){let e=u.shift();for(let t of d(e))i.set(t.to,Math.max(i.get(t.to),i.get(e)+1)),o.set(t.to,o.get(t.to)-1),0===o.get(t.to)&&u.push(t.to)}}let p=h.length?Math.max(...i.values()):-1;for(let e of o)i.has(e)||(i.set(e,p+1),h.push(e));let y=new Map;for(let t of h)y.set(t,function(t,a,r){var n,s;let l=d(a)?a:{},o="string"==typeof l.Type?l.Type:"?",c="Succeed"===o||"Fail"===o||!0===l.End,i={name:t,type:o,x:0,y:0,w:184,h:46,terminal:c},u=null;if("Parallel"===o?u=Array.isArray(l.Branches)?l.Branches:[]:"Map"===o&&(u=(null!=(n=l.ItemProcessor)?n:l.Iterator)?[null!=(s=l.ItemProcessor)?s:l.Iterator]:[]),!u)return i;let h=u.length?u.map(t=>{if(r>=8)return f("Nested too deeply to draw");try{return e(t,r+1)}catch(e){return f(e instanceof Error?e.message:String(e))}}):[f("Map"===o?"No ItemProcessor":"No Branches")],x=h.reduce((e,t)=>e+t.w,0)+(h.length-1)*14,m=Math.max(...h.map(e=>e.h));i.w=Math.max(184,x+28),i.h=40+m+14;let g=(i.w-x)/2;return i.groups=h.map(e=>{let t={block:e,x:g,y:40};return g+=e.w+14,t}),i}(t,l[t],s));let v=[];for(let e of h)(null!=(r=v[a=i.get(e)])?r:v[a]=[]).push(y.get(e));let b=v.map(e=>e.reduce((e,t)=>e+t.w,0)+(e.length-1)*32),j=Math.max(...b,184),N=16+j/2,k=16+44*!!c;v.forEach((e,t)=>{let a=16+(j-b[t])/2,r=Math.max(...e.map(e=>e.h));for(let t of e)t.x=a,t.y=k,a+=t.w+32;k+=r+60});let w=k-60,S=[...y.values()].some(e=>e.terminal),E=c?{x:N,y:23}:void 0,A=S?{x:N,y:w+30+7}:void 0,C=[],T=0;if(E&&c){let e=y.get(c),t=e.x+e.w/2;C.push({path:"M ".concat(E.x," ").concat(E.y+7," C ").concat(E.x," ").concat(e.y-12,", ").concat(t," ").concat(E.y+12,", ").concat(t," ").concat(e.y),dashed:!1,lx:0,ly:0})}for(let e of h){let t=y.get(e),a=new Map;for(let t of m(l,e)){let e="".concat(t.to,"|").concat("catch"===t.kind),r=null!=(n=a.get(e))?n:{to:t.to,dashed:"catch"===t.kind,labels:[]};t.label&&r.labels.push(t.label),a.set(e,r)}let r=[...a.values()],s=a=>{let r=y.get(a.to),n=Math.min(t.x,r.x+r.w/2)-6,s=Math.max(t.x+t.w,r.x+r.w/2)+6,l=i.get(e),o=i.get(a.to);return[...y.values()].some(e=>e!==t&&e!==r&&i.get(e.name)>l&&i.get(e.name)n)},o=r.filter(t=>i.get(t.to)>i.get(e)&&!s(t)),c=o.length+(t.terminal&&A?1:0),d=0,u=()=>t.x+t.w*++d/(c+1);for(let e of r){let a=y.get(e.to),r=e.labels.length?x(e.labels.join(" / "),30):void 0;if(o.includes(e)){let n=u(),s=t.y+t.h,l=a.x+a.w/2,o=a.y,c=(s+o)/2,i=r?.42:.5;C.push({path:"M ".concat(n," ").concat(s," C ").concat(n," ").concat(c,", ").concat(l," ").concat(c,", ").concat(l," ").concat(o),dashed:e.dashed,label:r,lx:g(i,n,n,l,l),ly:g(i,s,c,c,o)})}else{let n=16+j+14+26*T;T++;let s=t.x+t.w,l=t.y+t.h/2+8*!!e.dashed,o=a.x+a.w,c=a.y+a.h/2-6;C.push({path:"M ".concat(s," ").concat(l," C ").concat(n+10," ").concat(l,", ").concat(n+10," ").concat(c,", ").concat(o," ").concat(c),dashed:e.dashed,label:r,lx:(s+o+6*(n+10))/8,ly:(l+c)/2})}}if(t.terminal&&A){let e=u(),a=t.y+t.h,r=(a+A.y)/2;C.push({path:"M ".concat(e," ").concat(a," C ").concat(e," ").concat(r,", ").concat(A.x," ").concat(r,", ").concat(A.x," ").concat(A.y-7),dashed:!1,lx:0,ly:0})}}return{w:32+j+(T?14+26*T+70:0),h:(A?A.y+7:w)+16,nodes:[...y.values()],edges:C,start:E,end:A}}(function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new u("The definition is not valid JSON")}}(t))}}catch(e){return{error:e instanceof u?e.message:"Cannot draw this definition: ".concat(e instanceof Error?e.message:String(e))}}},[t]);if(!w.block)return(0,r.jsxs)("div",{className:(0,i.cn)("text-muted-foreground flex min-h-40 flex-col items-center justify-center gap-2 rounded-md border border-dashed p-6 text-center text-sm",h),children:[(0,r.jsx)(s.A,{className:"size-5"}),(0,r.jsx)("span",{children:w.error})]});let S=w.block,E=a&&Object.keys(a).length>0;return(0,r.jsxs)("div",{className:(0,i.cn)("bg-muted/20 flex flex-col rounded-md border",h),children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 px-2 pt-2",children:[p,(0,r.jsxs)(c.$,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:()=>k(!j),title:j?"Show at actual size":"Scale to fit",children:[j?(0,r.jsx)(l.A,{}):(0,r.jsx)(o.A,{}),j?"Actual size":"Fit"]})]}),(0,r.jsx)("div",{className:"overflow-auto px-2 pb-2",children:(0,r.jsxs)("svg",{role:"img","aria-label":"State machine graph",viewBox:"0 0 ".concat(S.w," ").concat(S.h),width:j?"100%":S.w,height:j?void 0:S.h,style:j?{maxWidth:S.w,height:"auto"}:{maxWidth:"none"},className:"mx-auto block font-sans",children:[(0,r.jsx)("defs",{children:(0,r.jsx)("marker",{id:b,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:(0,r.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--muted-foreground)"})})}),(0,r.jsx)(N,{block:S,statuses:a,arrow:b})]})}),E&&(0,r.jsx)("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1 border-t px-3 py-2 text-xs",children:v.map(e=>(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:(0,i.cn)("inline-block size-3 rounded-sm border-2",e.swatch)}),e.label]},e.status))})]})}},69925:(e,t,a)=>{a.d(t,{Bd:()=>f,TR:()=>I,Te:()=>v,YH:()=>A,_E:()=>b,cv:()=>D,dL:()=>y,eA:()=>N,gz:()=>T,ij:()=>C,j9:()=>O,k$:()=>m,ko:()=>M,lg:()=>g,m8:()=>w,uL:()=>p,u_:()=>z,vZ:()=>S});var r=a(26276),n=a(29320),s=a(34993),l=a(47006),o=a(62083),c=a(17286),i=a(28971),d=a(73062),u=a(22927),h=a(58788),x=a(88674);let m="/api/v1/sfn",f="/api/v1/sfn/state-machines",g=e=>"".concat(f,"/").concat((0,i.aJ)(e)),p=e=>"".concat("/api/v1/sfn/executions","/").concat((0,i.aJ)(e)),y=(e,t)=>"/sfn/state-machine/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),v=e=>"/sfn/create/?name=".concat(encodeURIComponent(e)),b=e=>"/sfn/execution/?id=".concat(encodeURIComponent(e)),j=/^[a-zA-Z0-9_-]{1,80}$/;function N(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Names";return e?e.length>80?"".concat(t," are at most 80 characters"):j.test(e)?null:"Use only letters, digits, hyphens (-) and underscores (_)":"Enter a name"}let k={RUNNING:"info",SUCCEEDED:"success",FAILED:"danger",TIMED_OUT:"danger",ABORTED:"neutral"},w=e=>"TIMED_OUT"===e?"Timed out":e.charAt(0)+e.slice(1).toLowerCase();function S(e){var t;let{status:a,className:n}=e;return(0,r.jsx)(c.Wh,{status:a,tone:null!=(t=k[a])?t:"neutral",label:w(a),className:n})}let E={RUNNING:"text-blue-700 bg-blue-50 dark:text-blue-300 dark:bg-blue-500/10",SUCCEEDED:"text-emerald-700 bg-emerald-50 dark:text-emerald-300 dark:bg-emerald-500/10",FAILED:"text-red-700 bg-red-50 dark:text-red-300 dark:bg-red-500/10",TIMED_OUT:"text-orange-700 bg-orange-50 dark:text-orange-300 dark:bg-orange-500/10",ABORTED:"text-slate-600 bg-slate-100 dark:text-slate-300 dark:bg-slate-500/15"};function A(e){let{counts:t,className:a}=e,n=h.c.filter(e=>{var a;return(null!=(a=null==t?void 0:t[e])?a:0)>0});return n.length?(0,r.jsx)("span",{className:(0,x.cn)("flex flex-wrap items-center gap-1",a),children:n.map(e=>(0,r.jsxs)(l.m_,{children:[(0,r.jsx)(l.k$,{asChild:!0,children:(0,r.jsxs)("span",{className:(0,x.cn)("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium tabular-nums",E[e]),children:[t[e]," ",w(e).toLowerCase()]})}),(0,r.jsxs)(l.ZI,{children:[t[e]," ",w(e).toLowerCase()," execution",1===t[e]?"":"s"]})]},e))}):(0,r.jsx)("span",{className:"text-muted-foreground text-sm",children:"None"})}let C=e=>Object.values(null!=e?e:{}).reduce((e,t)=>e+(null!=t?t:0),0);function T(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=new Date(e).getTime(),n=t?new Date(t).getTime():a;if(Number.isNaN(r)||Number.isNaN(n))return"-";let s=Math.max(0,n-r);return s<1e3?"".concat(s," ms"):s<6e4?"".concat((s/1e3).toFixed(s<1e4?2:1)," s"):(0,d.a3)(s/1e3)}let O=e=>void 0===e?"":JSON.stringify(e,null,2);function M(){return{Comment:"Check an order total and route it",StartAt:"Prepare",States:{Prepare:{Type:"Pass",Parameters:{"order.$":"$","checkedAt.$":"$$.State.EnteredTime"},Next:"Is large order?"},"Is large order?":{Type:"Choice",Choices:[{Variable:"$.order.total",NumericGreaterThan:100,Next:"Needs review"}],Default:"Approved"},"Needs review":{Type:"Fail",Error:"Order.TooLarge",Cause:"Orders over 100 need a manual review"},Approved:{Type:"Succeed"}}}}function D(e){return{Comment:"Invoke a Lambda function and catch its errors",StartAt:"Invoke",States:{Invoke:{Type:"Task",Resource:e,ResultPath:"$.result",Retry:[{ErrorEquals:["States.TaskFailed"],IntervalSeconds:1,MaxAttempts:2}],Catch:[{ErrorEquals:["States.ALL"],ResultPath:"$.error",Next:"Handle error"}],Next:"Done"},"Handle error":{Type:"Fail",Error:"InvokeFailed",Cause:"The function returned an error"},Done:{Type:"Succeed"}}}}function z(){return{Comment:"Fan out: run two branches in parallel, then process each item",StartAt:"Fan out",States:{"Fan out":{Type:"Parallel",Branches:[{StartAt:"Price",States:{Price:{Type:"Pass",Result:{price:42},End:!0}}},{StartAt:"Stock",States:{Stock:{Type:"Pass",Result:{inStock:!0},End:!0}}}],ResultPath:"$.checks",Next:"Wait a moment"},"Wait a moment":{Type:"Wait",Seconds:1,Next:"Each item"},"Each item":{Type:"Map",ItemsPath:"$.items",ItemProcessor:{StartAt:"Tag item",States:{"Tag item":{Type:"Pass",Parameters:{"item.$":"$",processed:!0},End:!0}}},ResultPath:"$.processed",End:!0}}}}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,a]=(0,n.useState)(null),l=(0,r.jsx)(o.T,{open:!!t,onOpenChange:e=>!e&&a(null),title:"Delete state machine ".concat(null!=t?t:"","?"),description:"Running executions are stopped and the execution history of this state machine is deleted. EventBridge rules targeting it will fail to start executions.",confirmText:null!=t?t:void 0,onConfirm:async()=>{var a;t&&(await i.FH.del(g(t)),await (0,u.Yi)(m),s.oR.success("Deleted state machine ".concat(t)),null==(a=e.onDeleted)||a.call(e,t))}});return{remove:a,dialog:l}}},89839:(e,t,a)=>{a.d(t,{w:()=>s});var r=a(26276),n=a(88674);function s(e){let{title:t,description:a,actions:s,children:l,className:o,bodyClassName:c,flush:i}=e;return(0,r.jsxs)("section",{className:(0,n.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",o),children:[(t||s)&&(0,r.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[t&&(0,r.jsx)("h2",{className:"text-base font-semibold",children:t}),a&&(0,r.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:a})]}),s&&(0,r.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:s})]}),(0,r.jsx)("div",{className:(0,n.cn)(!i&&"p-4",c),children:l})]})}},97542:(e,t,a)=>{a.d(t,{F:()=>d,i:()=>u});var r=a(26276),n=a(29320),s=a(7489),l=a(48947),o=a(79092),c=a(47045),i=a(88674);function d(e){if(!e.trim())return"Document is empty";try{return JSON.parse(e),null}catch(e){return e instanceof Error?e.message:String(e)}}function u(e){let{value:t,onChange:a,rows:u=16,readOnly:h,validate:x,className:m,id:f}=e,g=(0,n.useMemo)(()=>{let e=d(t);return e||(x?x(JSON.parse(t)):null)},[t,x]),p=Math.max(t.split("\n").length,u);return(0,r.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-2",m),children:[(0,r.jsxs)("div",{className:(0,i.cn)("bg-muted/30 flex overflow-hidden rounded-md border font-mono text-[13px] leading-5",g&&!h&&"border-destructive/60"),children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"text-muted-foreground/60 bg-muted/50 border-r px-2 py-2 text-right select-none",children:Array.from({length:p},(e,t)=>(0,r.jsx)("div",{children:t+1},t))}),(0,r.jsx)("textarea",{id:f,value:t,readOnly:h,onChange:e=>null==a?void 0:a(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!h){e.preventDefault();let r=e.currentTarget,{selectionStart:n,selectionEnd:s}=r,l=t.slice(0,n)+" "+t.slice(s);null==a||a(l),requestAnimationFrame(()=>{r.selectionStart=r.selectionEnd=n+2})}},spellCheck:!1,rows:p,className:"min-w-0 flex-1 resize-none overflow-x-auto bg-transparent px-3 py-2 whitespace-pre outline-none"})]}),!h&&(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[g?(0,r.jsxs)("span",{className:"text-destructive flex items-center gap-1",children:[(0,r.jsx)(s.A,{className:"size-3.5"})," ",g]}):(0,r.jsxs)("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[(0,r.jsx)(l.A,{className:"size-3.5"})," Valid JSON"]}),(0,r.jsxs)(c.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{try{null==a||a(JSON.stringify(JSON.parse(t),null,2))}catch(e){}},disabled:!!d(t),children:[(0,r.jsx)(o.A,{})," Format"]})]})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3046-6dfc61495af485a7.js b/pages/demo/_next/static/chunks/3046-6dfc61495af485a7.js deleted file mode 100644 index f72076d6..00000000 --- a/pages/demo/_next/static/chunks/3046-6dfc61495af485a7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3046],{6132:(e,t,s)=>{s.d(t,{A:()=>n});let n=(0,s(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},7e3:(e,t,s)=>{s.d(t,{Fl:()=>x,YI:()=>i,Yq:()=>c,ZV:()=>l,a3:()=>m,fF:()=>u,fU:()=>d,qt:()=>r,td:()=>f,z3:()=>a});let n=["B","KB","MB","GB","TB","PB"];function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let s=Math.abs(e),a=0;for(;s>=1024&&a=100?0:t);return"".concat(e<0?"-":"").concat(r," ").concat(n[a])}function r(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function i(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return a(e);case"Bytes/Second":return"".concat(a(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=o(e);return s?s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),s=o(e);if(!s)return"-";let n=(s.getTime()-t)/1e3,a=Math.abs(n),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(a<45||n>0&&n<60)return"just now";let l=n;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:s)}function x(e){let t=e.endsWith("/")?e.slice(0,-1):e,s=t.lastIndexOf("/");return s>=0?t.slice(s+1):t}},17982:(e,t,s)=>{s.d(t,{C:()=>c,z:()=>o});var n=s(95155),a=s(12115),r=s(53789),l=s(99051),i=s(25016);let o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.bL,{className:(0,i.cn)("grid gap-2",s),...a,ref:t})});o.displayName=r.bL.displayName;let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.q7,{ref:t,className:(0,i.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:(0,n.jsx)(r.C1,{className:"flex items-center justify-center",children:(0,n.jsx)(l.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});c.displayName=r.q7.displayName},47507:(e,t,s)=>{s.d(t,{TR:()=>x,bq:()=>m,eb:()=>p,gC:()=>f,l6:()=>c,s3:()=>d,yv:()=>u});var n=s(95155);s(12115);var a=s(95435),r=s(24033),l=s(5917),i=s(12108),o=s(25016);function c(e){let{...t}=e;return(0,n.jsx)(a.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,n.jsx)(a.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,n.jsx)(a.WT,{"data-slot":"select-value",...t})}function m(e){let{className:t,size:s="default",children:l,...i}=e;return(0,n.jsxs)(a.l9,{"data-slot":"select-trigger","data-size":s,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[l,(0,n.jsx)(a.In,{asChild:!0,children:(0,n.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function f(e){let{className:t,children:s,position:r="popper",...l}=e;return(0,n.jsx)(a.ZL,{children:(0,n.jsxs)(a.UC,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...l,children:[(0,n.jsx)(h,{}),(0,n.jsx)(a.LM,{className:(0,o.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:s}),(0,n.jsx)(g,{})]})})}function x(e){let{className:t,...s}=e;return(0,n.jsx)(a.JU,{"data-slot":"select-label",className:(0,o.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...s})}function p(e){let{className:t,children:s,...r}=e;return(0,n.jsxs)(a.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,n.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,n.jsx)(a.VF,{children:(0,n.jsx)(l.A,{className:"size-4"})})}),(0,n.jsx)(a.p4,{children:s})]})}function h(e){let{className:t,...s}=e;return(0,n.jsx)(a.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,n.jsx)(i.A,{className:"size-4"})})}function g(e){let{className:t,...s}=e;return(0,n.jsx)(a.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,n.jsx)(r.A,{className:"size-4"})})}},90235:(e,t,s)=>{s.d(t,{J:()=>c});var n=s(95155),a=s(12115),r=s(43991),l=s(83101),i=s(25016);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.b,{ref:t,className:(0,i.cn)(o(),s),...a})});c.displayName=r.b.displayName},98351:(e,t,s)=>{s.d(t,{$s:()=>q,A9:()=>_,BY:()=>N,GV:()=>M,Hs:()=>y,JS:()=>b,NW:()=>w,Nj:()=>C,cP:()=>k,wZ:()=>j});var n=s(95155),a=s(12115),r=s(52619),l=s.n(r),i=s(35299),o=s(18720),c=s(97003),d=s(54679),u=s(90235),m=s(17982),f=s(47507),x=s(86233),p=s(37621),h=s(7e3),g=s(73697),v=s(25016);let b="/api/v1/sqs/queues",j=5e3,y=e=>"".concat(b,"/").concat((0,p.aJ)(e)),N=(e,t)=>"/sqs/queue/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),w=e=>e.slice(e.lastIndexOf(":")+1);function _(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;return(0,g.gf)(b,{refreshInterval:e})}function q(e){let{fifo:t,className:s}=e;return(0,n.jsx)("span",{className:(0,v.cn)("inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",t?"bg-violet-50 text-violet-700 ring-violet-600/20 dark:bg-violet-500/10 dark:text-violet-300 dark:ring-violet-400/20":"bg-muted text-muted-foreground ring-border",s),children:t?"FIFO":"Standard"})}function C(e){return 0===e?"0 seconds":e%86400==0?(0,h.td)(e/86400,"day"):e%3600==0?(0,h.td)(e/3600,"hour"):e%60==0?(0,h.td)(e/60,"minute"):(0,h.td)(e,"second")}function k(e){var t;let{queue:s,empty:a="-"}=e,r=null!=(t=s.dead_letter_source_queues)?t:[];return s.redrive_policy||r.length?(0,n.jsxs)("span",{className:"flex flex-col gap-0.5 text-[13px]",children:[s.redrive_policy&&(0,n.jsxs)("span",{className:"whitespace-nowrap",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"DLQ: "}),(0,n.jsx)(l(),{href:N(s.redrive_policy.dead_letter_queue),onClick:e=>e.stopPropagation(),className:"text-primary hover:underline",children:s.redrive_policy.dead_letter_queue})]}),r.length>0&&(0,n.jsxs)("span",{className:"whitespace-nowrap",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"DLQ for "}),r.map((e,t)=>(0,n.jsxs)("span",{children:[t>0&&", ",(0,n.jsx)(l(),{href:N(e),onClick:e=>e.stopPropagation(),className:"text-primary hover:underline",children:e})]},e))]})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:a})}function M(){var e,t,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[l,i]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),f=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.T,{open:!!l,onOpenChange:e=>!e&&i(null),title:"Purge ".concat(null!=(t=null==l?void 0:l.name)?t:"queue","?"),description:(0,n.jsxs)(n.Fragment,{children:["Deletes every message in the queue, including"," ",l?(0,h.td)(l.approximate_number_of_messages_not_visible,"in-flight message"):"in-flight messages",". This cannot be undone."]}),actionLabel:"Purge",onConfirm:async()=>{l&&(await p.FH.post("".concat(y(l.name),"/purge")),await (0,g.Yi)(b),o.oR.success("Purged ".concat(l.name)))}}),(0,n.jsx)(x.T,{open:!!c,onOpenChange:e=>!e&&d(null),title:"Delete ".concat(null!=(s=null==c?void 0:c.name)?s:"queue","?"),description:(0,n.jsxs)(n.Fragment,{children:["The queue and all of its messages are deleted permanently.",(null==c||null==(e=c.dead_letter_source_queues)?void 0:e.length)?(0,n.jsxs)("span",{className:"text-destructive mt-2 block",children:["This queue is the dead-letter queue of ",c.dead_letter_source_queues.join(", "),". Remove their redrive policy first."]}):null]}),confirmText:null==c?void 0:c.name,onConfirm:async()=>{var e;c&&(await p.FH.del(y(c.name)),await (0,g.Yi)(b),o.oR.success("Deleted queue ".concat(c.name)),null==(e=r.onDeleted)||e.call(r))}}),(0,n.jsx)(z,{queue:u,onClose:()=>m(null)})]});return{purge:i,remove:d,redrive:m,dialogs:f}}function z(e){var t,s;let{queue:r,onClose:l}=e,{data:x}=(0,g.gf)(r?b:null),[j,N]=(0,a.useState)("source"),[w,_]=(0,a.useState)(""),[q,C]=(0,a.useState)(!1),[k,M]=(0,a.useState)(null);(0,a.useEffect)(()=>{r&&(N("source"),_(""),M(null))},[r]);let z=null!=(t=null==r?void 0:r.dead_letter_source_queues)?t:[],F=(null!=x?x:[]).filter(e=>e.name!==(null==r?void 0:r.name)&&e.fifo===(null==r?void 0:r.fifo)),S=null!=(s=null==x?void 0:x.find(e=>e.name===(null==r?void 0:r.name)))?s:r,R=S?S.approximate_number_of_messages+S.approximate_number_of_messages_not_visible+S.approximate_number_of_messages_delayed:0,T=async e=>{if(e.preventDefault(),r&&("custom"!==j||w)){C(!0);try{let e=await p.FH.post("".concat(y(r.name),"/redrive"),"custom"===j?{destination:w}:{});M(e.moved),o.oR.success("Moved ".concat((0,h.td)(e.moved,"message")," out of ").concat(r.name)),await (0,g.Yi)(b)}catch(e){o.oR.error((0,p.gJ)(e))}finally{C(!1)}}};return(0,n.jsx)(d.lG,{open:!!r,onOpenChange:e=>!e&&!q&&l(),children:(0,n.jsx)(d.Cf,{className:"sm:max-w-lg",children:(0,n.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-4",children:[(0,n.jsxs)(d.c7,{children:[(0,n.jsx)(d.L3,{children:"Start DLQ redrive"}),(0,n.jsxs)(d.rr,{children:["Moves the messages in ",(0,n.jsx)("span",{className:"font-mono",children:null==r?void 0:r.name})," (",(0,h.ZV)(R)," now) to another queue. Their receive count is reset."]})]}),(0,n.jsxs)(m.z,{value:j,onValueChange:e=>N(e),className:"gap-3",children:[(0,n.jsxs)("label",{className:(0,v.cn)("flex cursor-pointer items-start gap-3 rounded-md border p-3","source"===j&&"border-primary bg-primary/5"),children:[(0,n.jsx)(m.C,{value:"source",className:"mt-0.5"}),(0,n.jsxs)("div",{className:"min-w-0 text-sm",children:[(0,n.jsx)("div",{className:"font-medium",children:"Redrive to source queue(s)"}),(0,n.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Each message goes back to the queue it was moved from",z.length?" (".concat(z.join(", "),")"):"",". Messages without a known source stay here."]})]})]}),(0,n.jsxs)("label",{className:(0,v.cn)("flex cursor-pointer items-start gap-3 rounded-md border p-3","custom"===j&&"border-primary bg-primary/5"),children:[(0,n.jsx)(m.C,{value:"custom",className:"mt-0.5"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2 text-sm",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium",children:"Redrive to a custom destination"}),(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:"Move every message to one queue of the same type."})]}),"custom"===j&&(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(u.J,{htmlFor:"redrive-dest",className:"sr-only",children:"Destination queue"}),(0,n.jsxs)(f.l6,{value:w,onValueChange:_,children:[(0,n.jsx)(f.bq,{id:"redrive-dest",className:"w-full",children:(0,n.jsx)(f.yv,{placeholder:"Choose a queue"})}),(0,n.jsx)(f.gC,{children:F.map(e=>(0,n.jsx)(f.eb,{value:e.name,children:e.name},e.name))})]})]})]})]})]}),null!==k&&(0,n.jsxs)("p",{className:"rounded-md border border-emerald-600/30 bg-emerald-50 p-3 text-sm text-emerald-800 dark:border-emerald-400/30 dark:bg-emerald-500/10 dark:text-emerald-300",children:["Moved ",(0,h.td)(k,"message"),"."]}),(0,n.jsxs)(d.Es,{children:[(0,n.jsx)(c.$,{type:"button",variant:"outline",onClick:l,disabled:q,children:null!==k?"Close":"Cancel"}),(0,n.jsxs)(c.$,{type:"submit",disabled:q||"custom"===j&&!w,children:[q&&(0,n.jsx)(i.A,{className:"animate-spin"}),null!==k?"Redrive again":"Redrive messages"]})]})]})})})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3116-5c1d4bdbae7e3fdf.js b/pages/demo/_next/static/chunks/3116-5c1d4bdbae7e3fdf.js deleted file mode 100644 index 9fff9b95..00000000 --- a/pages/demo/_next/static/chunks/3116-5c1d4bdbae7e3fdf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3116],{4774:(e,t,n)=>{n.d(t,{BC:()=>x,GM:()=>d,GN:()=>p,Kh:()=>w,aR:()=>v,dB:()=>b,fe:()=>f,h6:()=>j,nO:()=>y,qT:()=>m,sV:()=>u});var a=n(95155),o=n(32320),l=n(19408),r=n(20508),s=n(89470),c=n(39068),i=n(41183);let d=e=>"/iam/role/?name=".concat(encodeURIComponent(e)),u=e=>"/iam/roles/create/".concat(e?"?service=".concat(encodeURIComponent(e)):""),m=[{principal:"lambda.amazonaws.com",name:"Lambda",description:"Allows Lambda functions to call HomeCloud services on your behalf."},{principal:"ec2.amazonaws.com",name:"EC2",description:"Allows EC2 instances to call HomeCloud services on your behalf."},{principal:"ecs-tasks.amazonaws.com",name:"Elastic Container Service Task",description:"Allows ECS tasks to call HomeCloud services on your behalf."},{principal:"states.amazonaws.com",name:"Step Functions",description:"Allows state machines to invoke Lambda functions and other services."},{principal:"events.amazonaws.com",name:"EventBridge",description:"Allows EventBridge rules to deliver events to targets."},{principal:"apigateway.amazonaws.com",name:"API Gateway",description:"Allows API Gateway to call integrations and push logs to CloudWatch."},{principal:"cloudformation.amazonaws.com",name:"CloudFormation",description:"Allows CloudFormation to create and manage stack resources on your behalf."},{principal:"scheduler.amazonaws.com",name:"EventBridge Scheduler",description:"Allows schedules to invoke their targets."}],f=e=>{var t,n;return null!=(n=null==(t=m.find(t=>t.principal===e))?void 0:t.name)?n:e.replace(/\.amazonaws\.com$/,"")},h=e=>1===e.length?e[0]:e;function p(e){return{Version:"2012-10-17",Statement:[{Effect:"Allow",Principal:{Service:h(e)},Action:"sts:AssumeRole"}]}}function v(e,t){return{Version:"2012-10-17",Statement:[{Effect:"Allow",Principal:{AWS:h(t.length?t:["arn:aws:iam::".concat(e,":root")])},Action:"sts:AssumeRole"}]}}let g=e=>"string"==typeof e&&e.length>0||Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e&&e.length>0);function x(e){if(!e||"object"!=typeof e||Array.isArray(e))return"The trust policy must be a JSON object";let t=e.Statement;if(null==t)return"Statement is required";let n=Array.isArray(t)?t:[t];if(0===n.length)return"Statement must not be empty";for(let e=0;e!["AWS","Service","Federated"].includes(e));if(n)return"Statement[".concat(e,"].Principal.").concat(n,": use AWS, Service or Federated");if(!t.length)return"Statement[".concat(e,"].Principal must name at least one principal");for(let n of t)if(!g(a[n]))return"Statement[".concat(e,"].Principal.").concat(n," must be a string or a non-empty array of strings")}if(void 0!==t.Resource||void 0!==t.NotResource)return"Statement[".concat(e,"].Resource is not allowed in a trust policy");if(void 0!==t.Action&&void 0!==t.NotAction)return"Statement[".concat(e,"] cannot have both Action and NotAction");let o=void 0!==t.NotAction?"NotAction":"Action";if(!g(t[o]))return"Statement[".concat(e,"].").concat(o," must be a string or a non-empty array of strings");let l=(0,i.DD)(t[o]).find(e=>!e.toLowerCase().startsWith("sts:"));if(l)return"Statement[".concat(e,"].").concat(o,' "').concat(l,'": trust policies only grant sts: actions')}return null}function y(e){let t=[],n=new Set,a=e=>{let a="".concat(e.kind,":").concat(e.value);n.has(a)||(n.add(a),t.push(e))};for(let t of(0,i.GX)(e)){if(!t||"Allow"!==t.Effect)continue;let e=t.Principal;if("*"===e){a({kind:"any",label:"Anyone",value:"*"});continue}if(e&&"object"==typeof e){for(let t of(0,i.DD)(e.Service))a({kind:"service",label:"AWS service: ".concat(f(t)),value:t});for(let t of(0,i.DD)(e.AWS))a(function(e){if("*"===e)return{kind:"any",label:"Any AWS principal",value:e};if(/^\d{12}$/.test(e))return{kind:"account",label:"Account: ".concat(e),value:e};let t=/^arn:[\w-]+:(iam|sts)::(\d*):(.*)$/.exec(e);if(t){let[,,n,a]=t;if("root"===a)return{kind:"account",label:"Account: ".concat(n),value:e};if(a.startsWith("user/"))return{kind:"user",label:"User: ".concat(a.slice(a.lastIndexOf("/")+1)),value:e};if(a.startsWith("role/"))return{kind:"role",label:"Role: ".concat(a.slice(a.lastIndexOf("/")+1)),value:e}}return{kind:"other",label:e,value:e}}(t));for(let t of(0,i.DD)(e.Federated))a({kind:"federated",label:"Identity provider: ".concat(t),value:t})}}return t}let A={service:o.A,account:l.A,user:r.A,role:s.A,federated:c.A,any:c.A,other:c.A};function b(e){let{role:t,max:n=3}=e,o=y(t.assume_role_policy);if(!o.length)return(0,a.jsx)("span",{className:"text-muted-foreground",children:"None"});let l=o.slice(0,n);return(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[l.map(e=>{let t=A[e.kind];return(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",title:e.value,children:[(0,a.jsx)(t,{className:"text-muted-foreground size-3.5 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.label})]},"".concat(e.kind,":").concat(e.value))}),o.length>n&&(0,a.jsxs)("span",{className:"text-muted-foreground text-xs",children:["and ",o.length-n," more"]})]})}function w(e){let t=Math.floor(e/3600),n=Math.round(e%3600/60);return n?"".concat(t," h ").concat(n," min"):1===t?"1 hour":"".concat(t," hours")}let j=[1,2,4,6,8,12].map(e=>({value:3600*e,label:1===e?"1 hour":"".concat(e," hours")}))},73116:(e,t,n)=>{n.d(t,{RolesList:()=>N,f:()=>k});var a=n(95155),o=n(52619),l=n.n(o),r=n(12115),s=n(6191),c=n(71360),i=n(89470),d=n(18720),u=n(97003),m=n(84916),f=n(91615),h=n(86233),p=n(82523),v=n(95567),g=n(17705),x=n(11723),y=n(37621),A=n(7e3),b=n(73697),w=n(41183),j=n(4774);let S=e=>{var t;return e.attached_policies.length+Object.keys(null!=(t=e.inline_policies)?t:{}).length};function k(e){let{open:t,onOpenChange:n,roles:o,onDeleted:l}=e,[s,c]=(0,r.useState)(!0);(0,r.useEffect)(()=>{t&&c(!0)},[t]);let i=o.filter(e=>S(e)>0),u=1===o.length?o[0]:null;return(0,a.jsx)(h.T,{open:t,onOpenChange:n,title:u?"Delete ".concat(u.name,"?"):"Delete ".concat(o.length," roles?"),description:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("p",{children:"Deleting a role revokes its active sessions immediately. Services, functions and instances configured with the role can no longer assume it."}),!u&&(0,a.jsx)("p",{className:"text-foreground font-medium break-words",children:o.map(e=>e.name).join(", ")})]}),confirmText:u?u.name:"delete",onConfirm:async()=>{let e=0;try{for(let t of o)await y.FH.del("".concat(w.mP,"/roles/").concat((0,y.aJ)(t.name)),s?{force:"true"}:void 0),e++}catch(t){throw e&&l(),Error(u?(0,y.gJ)(t):"".concat(o[e].name,": ").concat((0,y.gJ)(t)))}d.oR.success(u?"Role ".concat(u.name," deleted"):"".concat((0,A.td)(e,"role")," deleted")),l()},children:i.length>0&&(0,a.jsxs)("label",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,a.jsx)(m.S,{checked:s,onCheckedChange:e=>c(!0===e),className:"mt-0.5"}),(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Detach policies and delete"}),(0,a.jsxs)("span",{className:"text-muted-foreground text-xs",children:[u?"".concat(u.name," has ").concat((0,A.td)(S(u),"policy","policies"),"."):"".concat((0,A.td)(i.length,"selected role")," ").concat(1===i.length?"has":"have"," policies.")," ","Managed policies are detached and inline policies deleted first. Without this, a role with policies cannot be deleted."]})]})]})})}function N(){let{data:e,error:t,isLoading:n,isValidating:o,mutate:d}=(0,b.gf)("".concat(w.mP,"/roles")),[m,h]=(0,r.useState)([]),[y,A]=(0,r.useState)(!1),S=(null!=e?e:[]).filter(e=>m.includes(e.name)),N=[{id:"name",header:"Role name",value:e=>e.name,cell:e=>(0,a.jsx)(l(),{href:(0,j.GM)(e.name),className:w.ps,children:e.name}),className:"whitespace-nowrap"},{id:"trusted",header:"Trusted entities",value:e=>(0,j.nO)(e.assume_role_policy).map(e=>"".concat(e.label," ").concat(e.value)).join(" "),cell:e=>(0,a.jsx)(j.dB,{role:e}),className:"max-w-72"},{id:"description",header:"Description",value:e=>e.description,cell:e=>(0,a.jsx)("span",{className:"text-muted-foreground line-clamp-2 max-w-48",children:e.description||"-"}),hideBelow:"lg"},{id:"last_used",header:"Last activity",value:e=>{var t;return null!=(t=e.last_used)?t:""},cell:e=>e.last_used?(0,a.jsx)(x.f,{value:e.last_used}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"Never"}),hideBelow:"sm"},{id:"created",header:"Created",value:e=>e.created_at,cell:e=>(0,a.jsx)(x.f,{value:e.created_at}),hideBelow:"md"}],C=(0,a.jsx)(u.$,{size:"sm",asChild:!0,children:(0,a.jsxs)(l(),{href:(0,j.sV)(),children:[(0,a.jsx)(s.A,{})," Create role"]})});return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(g.z,{title:"Roles",description:"A role is an identity with permissions that trusted entities - HomeCloud services such as Lambda or EC2, or users in this account - assume to get temporary credentials.",breadcrumbs:[{label:"IAM",href:"/iam/"},{label:"Roles"}]}),(0,a.jsx)(p.b,{title:"Roles",data:e,columns:N,rowId:e=>e.name,loading:n,error:t,onRetry:()=>d(),onRefresh:()=>d(),refreshing:o,selection:"multi",selected:m,onSelectedChange:h,searchPlaceholder:"Search roles by name or trusted entity",defaultSort:{id:"name"},actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.$,{disabled:!m.length,items:[{label:"Delete",icon:(0,a.jsx)(c.A,{}),destructive:!0,onSelect:()=>A(!0)}]}),C]}),empty:(0,a.jsx)(v.p,{icon:i.A,title:"No roles",description:"Create a role for each HomeCloud service or workload that needs to call other services, instead of embedding access keys.",action:C})}),(0,a.jsx)(k,{open:y,onOpenChange:A,roles:S,onDeleted:()=>{h([]),(0,b.Yi)(w.mP)}})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3134-6f6154684ee8fa7c.js b/pages/demo/_next/static/chunks/3134-6f6154684ee8fa7c.js deleted file mode 100644 index 863ee3f7..00000000 --- a/pages/demo/_next/static/chunks/3134-6f6154684ee8fa7c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3134],{6191:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},9295:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]])},20562:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},35626:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},43465:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},60356:(e,t,n)=>{n.d(t,{UC:()=>D,B8:()=>I,bL:()=>O,l9:()=>S});var r=n(12115),a=n(92556),i=n(3468),o=n(29525),l=n(94446),d=n(4129),s=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,i]=r.useState(),o=r.useRef({}),l=r.useRef(e),s=r.useRef("none"),[c,f]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=u(o.current);s.current="mounted"===c?e:"none"},[c]),(0,d.N)(()=>{let t=o.current,n=l.current;if(n!==e){let r=s.current,a=u(t);e?f("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?f("UNMOUNT"):n&&r!==a?f("ANIMATION_OUT"):f("UNMOUNT"),l.current=e}},[e,f]),(0,d.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=u(o.current).includes(e.animationName);if(e.target===a&&r&&(f("ANIMATION_END"),!l.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},i=e=>{e.target===a&&(s.current=u(o.current))};return a.addEventListener("animationstart",i),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",i),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{e&&(o.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),o=(0,l.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof n||a.isPresent?r.cloneElement(i,{ref:o}):null};function u(e){return(null==e?void 0:e.animationName)||"none"}s.displayName="Presence";var c=n(97602),f=n(66218),p=n(70222),h=n(68946),y=n(95155),m="Tabs",[v,b]=(0,i.A)(m,[o.RG]),k=(0,o.RG)(),[A,w]=v(m),N=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:d,activationMode:s="automatic",...u}=e,m=(0,f.jH)(d),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,i=r.useRef(a),o=(0,p.c)(t);return r.useEffect(()=>{i.current!==a&&(o(a),i.current=a)},[a,i,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:a,d=(0,p.c)(n);return[l,r.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else i(t)},[o,e,i,d])]}({prop:a,onChange:i,defaultProp:o});return(0,y.jsx)(A,{scope:n,baseId:(0,h.B)(),value:v,onValueChange:b,orientation:l,dir:m,activationMode:s,children:(0,y.jsx)(c.sG.div,{dir:m,"data-orientation":l,...u,ref:t})})});N.displayName=m;var x="TabsList",g=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,i=w(x,n),l=k(n);return(0,y.jsx)(o.bL,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:(0,y.jsx)(c.sG.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});g.displayName=x;var M="TabsTrigger",C=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...l}=e,d=w(M,n),s=k(n),u=R(d.baseId,r),f=j(d.baseId,r),p=r===d.value;return(0,y.jsx)(o.q7,{asChild:!0,...s,focusable:!i,active:p,children:(0,y.jsx)(c.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...l,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||i||!e||d.onValueChange(r)})})})});C.displayName=M;var E="TabsContent",T=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:i,children:o,...l}=e,d=w(E,n),u=R(d.baseId,a),f=j(d.baseId,a),p=a===d.value,h=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,y.jsx)(s,{present:i||p,children:n=>{let{present:r}=n;return(0,y.jsx)(c.sG.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&o})}})});function R(e,t){return"".concat(e,"-trigger-").concat(t)}function j(e,t){return"".concat(e,"-content-").concat(t)}T.displayName=E;var O=N,I=g,S=C,D=T},71360:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},74054:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},86651:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},90368:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},99587:(e,t,n)=>{n.d(t,{bL:()=>N,zi:()=>x});var r=n(12115),a=n(92556),i=n(94446),o=n(3468),l=n(70222),d=n(78108),s=n(4129),u=n(97602),c=n(95155),f="Switch",[p,h]=(0,o.A)(f),[y,m]=p(f),v=r.forwardRef((e,t)=>{let{__scopeSwitch:n,name:o,checked:d,defaultChecked:s,required:f,disabled:p,value:h="on",onCheckedChange:m,form:v,...b}=e,[k,N]=r.useState(null),x=(0,i.s)(t,e=>N(e)),g=r.useRef(!1),M=!k||v||!!k.closest("form"),[C=!1,E]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,i=r.useRef(a),o=(0,l.c)(t);return r.useEffect(()=>{i.current!==a&&(o(a),i.current=a)},[a,i,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,d=o?e:a,s=(0,l.c)(n);return[d,r.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s(n)}else i(t)},[o,e,i,s])]}({prop:d,defaultProp:s,onChange:m});return(0,c.jsxs)(y,{scope:n,checked:C,disabled:p,children:[(0,c.jsx)(u.sG.button,{type:"button",role:"switch","aria-checked":C,"aria-required":f,"data-state":w(C),"data-disabled":p?"":void 0,disabled:p,value:h,...b,ref:x,onClick:(0,a.m)(e.onClick,e=>{E(e=>!e),M&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),M&&(0,c.jsx)(A,{control:k,bubbles:!g.current,name:o,value:h,checked:C,required:f,disabled:p,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=f;var b="SwitchThumb",k=r.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=m(b,n);return(0,c.jsx)(u.sG.span,{"data-state":w(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});k.displayName=b;var A=e=>{let{control:t,checked:n,bubbles:a=!0,...i}=e,o=r.useRef(null),l=(0,d.Z)(n),u=function(e){let[t,n]=r.useState(void 0);return(0,s.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(t);return r.useEffect(()=>{let e=o.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(l!==n&&t){let r=new Event("click",{bubbles:a});t.call(e,n),e.dispatchEvent(r)}},[l,n,a]),(0,c.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function w(e){return e?"checked":"unchecked"}var N=v,x=k}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3169-c2032f7edc6d8fe2.js b/pages/demo/_next/static/chunks/3169-c2032f7edc6d8fe2.js deleted file mode 100644 index 21eb17e7..00000000 --- a/pages/demo/_next/static/chunks/3169-c2032f7edc6d8fe2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3169],{39171:(e,t,a)=>{a.d(t,{Bg:()=>D,aM:()=>j,qg:()=>N});var r=a(95707),s=a(34655),i=a(20523),o=a(85710),n=a(17280),l=a(11002),c=a(14639),d=a(11696),m=a(76907),h=a(55867),u=a(50906),p=a(84114),f=a(97239),g=a(403),b=a(22840),y=a(14174),v=a(26617),x=a(58734),k=a(35633),C=a(84472),S=a(66630),A=a(53854),w=a(79397),I=a(39068),R=a(78435),E=a(52020);let M=["Compute","Containers","Storage","Database","Networking & Content Delivery","Security, Identity & Compliance","Management & Governance","Application Integration"],D=[{id:"ec2",name:"EC2",short:"EC2",description:"Virtual servers in the cloud",category:"Compute",icon:r.A,color:"bg-orange-500/10 text-orange-600 dark:text-orange-400",href:"/ec2/",paths:["/ec2"],nav:[{title:"Instances",items:[{label:"Instances",href:"/ec2/",match:["/ec2/instance/","/ec2/launch/"]},{label:"Instance types",href:"/ec2/instance-types/"}]},{title:"Images",items:[{label:"AMIs",href:"/ec2/images/"}]},{title:"Auto Scaling",items:[{label:"Auto Scaling groups",href:"/ec2/autoscaling/",match:["/ec2/autoscaling/group/","/ec2/autoscaling/create/"]}]},{title:"Elastic Block Store",items:[{label:"Volumes",href:"/ec2/volumes/"},{label:"Snapshots",href:"/ec2/snapshots/"}]},{title:"Load Balancing",items:[{label:"Load balancers",href:"/elb/"},{label:"Target groups",href:"/elb/target-groups/"}]},{title:"Network & Security",items:[{label:"Security groups",href:"/vpc/security-groups/"},{label:"Key pairs",href:"/ec2/key-pairs/"},{label:"Elastic IPs",href:"/ec2/elastic-ips/"},{label:"VPCs",href:"/vpc/"}]}]},{id:"lambda",name:"Lambda",short:"Lambda",description:"Run code without thinking about servers",category:"Compute",icon:s.A,color:"bg-orange-500/10 text-orange-600 dark:text-orange-400",href:"/lambda/",paths:["/lambda"],nav:[{title:"Lambda",items:[{label:"Functions",href:"/lambda/",match:["/lambda/function/","/lambda/create/"]},{label:"Event source mappings",href:"/lambda/triggers/"}]},{title:"Additional resources",items:[{label:"Layers",href:"/lambda/layers/"}]},{title:"Related",items:[{label:"API Gateway",href:"/apigateway/"}]}]},{id:"s3",name:"S3",short:"Amazon S3",description:"Scalable object storage",category:"Storage",icon:i.A,color:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",href:"/s3/",paths:["/s3"],nav:[{items:[{label:"Buckets",href:"/s3/",match:["/s3/bucket/"]}]}]},{id:"rds",name:"RDS",short:"RDS",description:"Managed relational and document databases",category:"Database",icon:o.A,color:"bg-blue-500/10 text-blue-600 dark:text-blue-400",href:"/rds/",paths:["/rds"],nav:[{items:[{label:"Databases",href:"/rds/",match:["/rds/instance/","/rds/create/"]},{label:"Snapshots",href:"/rds/snapshots/"}]},{title:"Related",items:[{label:"ElastiCache",href:"/elasticache/"}]}]},{id:"elasticache",name:"ElastiCache",short:"ElastiCache",description:"In-memory caching (Redis, Valkey, Memcached)",category:"Database",icon:n.A,color:"bg-blue-500/10 text-blue-600 dark:text-blue-400",href:"/elasticache/",paths:["/elasticache"],nav:[{title:"Resources",items:[{label:"Clusters",href:"/elasticache/",match:["/elasticache/cluster/","/elasticache/create/"]},{label:"Backups",href:"/elasticache/backups/"}]}]},{id:"dynamodb",name:"DynamoDB",short:"DynamoDB",description:"Managed NoSQL key-value database",category:"Database",icon:l.A,color:"bg-blue-500/10 text-blue-600 dark:text-blue-400",href:"/dynamodb/",paths:["/dynamodb"],nav:[{items:[{label:"Tables",href:"/dynamodb/",match:["/dynamodb/table/","/dynamodb/create/"]}]}]},{id:"vpc",name:"VPC",short:"VPC",description:"Isolated virtual networks",category:"Networking & Content Delivery",icon:c.A,color:"bg-violet-500/10 text-violet-600 dark:text-violet-400",href:"/vpc/",paths:["/vpc"],nav:[{title:"Virtual private cloud",items:[{label:"Your VPCs",href:"/vpc/"},{label:"Subnets",href:"/vpc/subnets/"},{label:"Route tables",href:"/vpc/route-tables/"},{label:"Internet gateways",href:"/vpc/internet-gateways/"}]},{title:"Security",items:[{label:"Security groups",href:"/vpc/security-groups/",match:["/vpc/security-group/"]}]}]},{id:"apigateway",name:"API Gateway",short:"API Gateway",description:"Create, publish and secure APIs",category:"Networking & Content Delivery",icon:d.A,color:"bg-violet-500/10 text-violet-600 dark:text-violet-400",href:"/apigateway/",paths:["/apigateway"],nav:[{items:[{label:"APIs",href:"/apigateway/",match:["/apigateway/api/"]}]},{title:"Related",items:[{label:"Cognito user pools",href:"/cognito/"}]}]},{id:"iam",name:"IAM",short:"IAM",description:"Manage access to HomeCloud resources",category:"Security, Identity & Compliance",icon:m.A,color:"bg-red-500/10 text-red-600 dark:text-red-400",href:"/iam/",paths:["/iam"],nav:[{items:[{label:"Dashboard",href:"/iam/"}]},{title:"Access management",items:[{label:"Users",href:"/iam/users/",match:["/iam/user/"]},{label:"User groups",href:"/iam/groups/",match:["/iam/group/"]},{label:"Roles",href:"/iam/roles/",match:["/iam/role/","/iam/roles/"]},{label:"Policies",href:"/iam/policies/",match:["/iam/policy/"]},{label:"Instance profiles",href:"/iam/instance-profiles/",match:["/iam/instance-profile/"]}]},{title:"Tools",items:[{label:"Policy simulator",href:"/iam/simulator/"}]}]},{id:"secrets",name:"Secrets Manager",short:"Secrets Manager",description:"Store and rotate credentials securely",category:"Security, Identity & Compliance",icon:h.A,color:"bg-red-500/10 text-red-600 dark:text-red-400",href:"/secrets/",paths:["/secrets"],nav:[{items:[{label:"Secrets",href:"/secrets/",match:["/secrets/secret/","/secrets/create/"]}]}]},{id:"cloudwatch",name:"CloudWatch",short:"CloudWatch",description:"Metrics, logs and alarms",category:"Management & Governance",icon:u.A,color:"bg-pink-500/10 text-pink-600 dark:text-pink-400",href:"/cloudwatch/",paths:["/cloudwatch"],nav:[{items:[{label:"Overview",href:"/cloudwatch/"}]},{title:"Alarms",items:[{label:"All alarms",href:"/cloudwatch/alarms/"}]},{title:"Logs",items:[{label:"Log groups",href:"/cloudwatch/logs/",match:["/cloudwatch/logs/group/"]},{label:"Logs Insights",href:"/cloudwatch/insights/"}]},{title:"Metrics",items:[{label:"All metrics",href:"/cloudwatch/metrics/"}]}]},{id:"cloudtrail",name:"CloudTrail",short:"CloudTrail",description:"Audit log of every API call",category:"Management & Governance",icon:p.A,color:"bg-pink-500/10 text-pink-600 dark:text-pink-400",href:"/cloudtrail/",paths:["/cloudtrail"],nav:[{items:[{label:"Event history",href:"/cloudtrail/"}]}]},{id:"sqs",name:"SQS",short:"SQS",description:"Managed message queues",category:"Application Integration",icon:f.A,color:"bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400",href:"/sqs/",paths:["/sqs"],nav:[{items:[{label:"Queues",href:"/sqs/",match:["/sqs/queue/","/sqs/create/"]}]}]},{id:"sns",name:"SNS",short:"SNS",description:"Pub/sub notifications",category:"Application Integration",icon:g.A,color:"bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400",href:"/sns/",paths:["/sns"],nav:[{items:[{label:"Topics",href:"/sns/",match:["/sns/topic/"]},{label:"Subscriptions",href:"/sns/subscriptions/"}]}]},{id:"eventbridge",name:"EventBridge",short:"EventBridge",description:"Serverless event bus and schedules",category:"Application Integration",icon:b.A,color:"bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400",href:"/events/",paths:["/events"],nav:[{title:"Buses",items:[{label:"Rules",href:"/events/",match:["/events/rule/","/events/create/"]},{label:"Event buses",href:"/events/buses/"},{label:"Send events",href:"/events/send/"}]},{title:"Scheduler",items:[{label:"Schedules",href:"/events/scheduler/"}]}]},{id:"ecs",name:"ECS",short:"Elastic Container Service",description:"Run containerized services and tasks",category:"Containers",icon:y.A,color:"bg-orange-500/10 text-orange-600 dark:text-orange-400",href:"/ecs/",paths:["/ecs"],nav:[{items:[{label:"Services",href:"/ecs/",match:["/ecs/service/","/ecs/create/"]},{label:"Task definitions",href:"/ecs/task-definitions/",match:["/ecs/task-definition/"]},{label:"Tasks",href:"/ecs/tasks/",match:["/ecs/task/"]}]},{title:"Related",items:[{label:"ECR repositories",href:"/ecr/"},{label:"Load balancers",href:"/elb/"}]}]},{id:"ecr",name:"ECR",short:"Elastic Container Registry",description:"Private Docker image registry",category:"Containers",icon:v.A,color:"bg-orange-500/10 text-orange-600 dark:text-orange-400",href:"/ecr/",paths:["/ecr"],nav:[{items:[{label:"Repositories",href:"/ecr/",match:["/ecr/repository/"]}]}]},{id:"efs",name:"EFS",short:"Elastic File System",description:"Shared file systems for instances",category:"Storage",icon:x.A,color:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",href:"/efs/",paths:["/efs"],nav:[{items:[{label:"File systems",href:"/efs/",match:["/efs/file-system/"]}]}]},{id:"elb",name:"ELB",short:"Elastic Load Balancing",description:"Load balancers and target groups",category:"Networking & Content Delivery",icon:k.A,color:"bg-violet-500/10 text-violet-600 dark:text-violet-400",href:"/elb/",paths:["/elb"],nav:[{title:"Load balancing",items:[{label:"Load balancers",href:"/elb/",match:["/elb/load-balancer/","/elb/create/"]},{label:"Target groups",href:"/elb/target-groups/",match:["/elb/target-group/"]}]},{title:"Related",items:[{label:"Certificates (ACM)",href:"/acm/"},{label:"Hosted zones (Route 53)",href:"/route53/"}]}]},{id:"kms",name:"KMS",short:"Key Management Service",description:"Create and control encryption keys",category:"Security, Identity & Compliance",icon:C.A,color:"bg-red-500/10 text-red-600 dark:text-red-400",href:"/kms/",paths:["/kms"],nav:[{items:[{label:"Customer managed keys",href:"/kms/",match:["/kms/key/"]},{label:"Encrypt / decrypt",href:"/kms/crypto/"}]}]},{id:"ssm",name:"Systems Manager",short:"Systems Manager",description:"Parameter Store for configuration and secrets",category:"Management & Governance",icon:S.A,color:"bg-pink-500/10 text-pink-600 dark:text-pink-400",href:"/ssm/",paths:["/ssm"],nav:[{title:"Application management",items:[{label:"Parameter Store",href:"/ssm/",match:["/ssm/parameter/","/ssm/create/"]}]}]},{id:"sfn",name:"Step Functions",short:"Step Functions",description:"Visual workflows for distributed applications",category:"Application Integration",icon:A.A,color:"bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400",href:"/sfn/",paths:["/sfn"],nav:[{items:[{label:"State machines",href:"/sfn/",match:["/sfn/state-machine/","/sfn/create/","/sfn/execution/"]}]}]},{id:"cloudformation",name:"CloudFormation",short:"CloudFormation",description:"Model and provision resources with templates",category:"Management & Governance",icon:w.A,color:"bg-pink-500/10 text-pink-600 dark:text-pink-400",href:"/cloudformation/",paths:["/cloudformation"],nav:[{items:[{label:"Stacks",href:"/cloudformation/",match:["/cloudformation/stack/","/cloudformation/create/"]},{label:"Resource types",href:"/cloudformation/resource-types/"}]}]},{id:"route53",name:"Route 53",short:"Route 53",description:"DNS hosted zones for your VPCs and LAN",category:"Networking & Content Delivery",icon:I.A,color:"bg-violet-500/10 text-violet-600 dark:text-violet-400",href:"/route53/",paths:["/route53"],nav:[{title:"DNS management",items:[{label:"Hosted zones",href:"/route53/",match:["/route53/zone/"]}]},{title:"Related",items:[{label:"Load balancers",href:"/elb/"},{label:"VPCs",href:"/vpc/"}]}]},{id:"acm",name:"Certificate Manager",short:"Certificate Manager",description:"TLS certificates from a private CA or imported",category:"Security, Identity & Compliance",icon:R.A,color:"bg-red-500/10 text-red-600 dark:text-red-400",href:"/acm/",paths:["/acm"],nav:[{items:[{label:"Certificates",href:"/acm/",match:["/acm/certificate/"]}]},{title:"Related",items:[{label:"Load balancers",href:"/elb/"}]}]},{id:"cognito",name:"Cognito",short:"Cognito",description:"User sign-up, sign-in and JWTs for your apps",category:"Security, Identity & Compliance",icon:E.A,color:"bg-red-500/10 text-red-600 dark:text-red-400",href:"/cognito/",paths:["/cognito"],nav:[{items:[{label:"User pools",href:"/cognito/",match:["/cognito/pool/"]}]},{title:"Related",items:[{label:"API Gateway",href:"/apigateway/"}]}]}];function N(e){let t=e.endsWith("/")?e:"".concat(e,"/");return D.find(e=>e.paths.some(e=>t==="".concat(e,"/")||t.startsWith("".concat(e,"/"))))}function j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;return M.map(t=>({category:t,services:e.filter(e=>e.category===t)})).filter(e=>e.services.length>0)}},57610:(e,t,a)=>{a.d(t,{i:()=>n,w:()=>l});var r=a(95155),s=a(12115),i=a(37621);let o=(0,s.createContext)({session:null,ready:!1});function n(e){let{children:t,fallback:a}=e,[n,l]=(0,s.useState)({session:null,ready:!1});return((0,s.useEffect)(()=>{let e=(0,i.Ht)();if(l({session:e,ready:!0}),!e){let e=window.location.pathname+window.location.search;window.location.replace("/login/?next=".concat(encodeURIComponent(e)))}return(0,i._W)(e=>l({session:e,ready:!0}))},[]),n.ready&&n.session)?(0,r.jsx)(o.Provider,{value:n,children:t}):(0,r.jsx)(r.Fragment,{children:null!=a?a:null})}function l(){let{session:e}=(0,s.useContext)(o);return e||{token:"",expires:"",account_id:"",user:{name:"",id:"",arn:"",root:!1}}}},82180:(e,t,a)=>{a.d(t,{Bc:()=>o,ZI:()=>c,k$:()=>l,m_:()=>n});var r=a(95155);a(12115);var s=a(79209),i=a(25016);function o(e){let{delayDuration:t=0,...a}=e;return(0,r.jsx)(s.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function n(e){let{...t}=e;return(0,r.jsx)(o,{children:(0,r.jsx)(s.bL,{"data-slot":"tooltip",...t})})}function l(e){let{...t}=e;return(0,r.jsx)(s.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:a=0,children:o,...n}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsxs)(s.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,i.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[o,(0,r.jsx)(s.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},99116:(e,t,a)=>{a.d(t,{Dk:()=>m,i8:()=>h,xh:()=>u});var r=a(95155),s=a(12115),i=a(5917),o=a(75426),n=a(18720),l=a(97003),c=a(82180),d=a(25016);async function m(e){try{return await navigator.clipboard.writeText(e),!0}catch(r){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let a=document.execCommand("copy");return document.body.removeChild(t),a}}function h(e){let{value:t,label:a,className:h,size:u="icon",toastMessage:p}=e,[f,g]=(0,s.useState)(!1),b=async e=>{e.stopPropagation(),e.preventDefault(),await m(t)?(g(!0),p&&n.oR.success(p),setTimeout(()=>g(!1),1500)):n.oR.error("Could not copy to the clipboard")},y=f?i.A:o.A;return"sm"===u?(0,r.jsxs)(l.$,{type:"button",variant:"outline",size:"sm",onClick:b,className:h,children:[(0,r.jsx)(y,{className:(0,d.cn)(f&&"text-emerald-600")}),null!=a?a:"Copy"]}):(0,r.jsxs)(c.m_,{children:[(0,r.jsx)(c.k$,{asChild:!0,children:(0,r.jsx)("button",{type:"button",onClick:b,"aria-label":null!=a?a:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",h),children:(0,r.jsx)(y,{className:(0,d.cn)("size-3.5",f&&"text-emerald-600")})})}),(0,r.jsx)(c.ZI,{children:f?"Copied":null!=a?a:"Copy"})]})}function u(e){let{value:t,mono:a=!0,className:s,display:i}=e;return t?(0,r.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",s),children:[(0,r.jsx)("span",{className:(0,d.cn)("truncate",a&&"font-mono text-[0.8125rem]"),title:t,children:null!=i?i:t}),(0,r.jsx)(h,{value:t})]}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3198-085a52b0ea5869cc.js b/pages/demo/_next/static/chunks/3198-085a52b0ea5869cc.js new file mode 100644 index 00000000..a49440f5 --- /dev/null +++ b/pages/demo/_next/static/chunks/3198-085a52b0ea5869cc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3198],{11363:(e,t,s)=>{s.d(t,{T:()=>r});var a=s(26276);s(29320);var n=s(88674);function r(e){let{className:t,...s}=e;return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,n.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...s})}},17286:(e,t,s)=>{s.d(t,{Rh:()=>g,Wh:()=>j});var a=s(26276),n=s(40688),r=s(48947),i=s(31935),l=s(64761),o=s(64206),c=s(46319),d=s(42812),u=s(88674);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},x={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),p={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function g(e){let t=p[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let s=e.toLowerCase().replace(/[_]+/g," ").trim();return s.charAt(0).toUpperCase()+s.slice(1)}function f(e){let{tone:t,spinning:s}=e,m="size-3.5 shrink-0";if(s)return(0,a.jsx)(n.A,{className:(0,u.cn)(m,"animate-spin")});switch(t){case"success":return(0,a.jsx)(r.A,{className:m});case"danger":return(0,a.jsx)(i.A,{className:m});case"warning":return(0,a.jsx)(l.A,{className:m});case"info":return(0,a.jsx)(o.A,{className:(0,u.cn)(m,"fill-current")});default:return"neutral"===t?(0,a.jsx)(c.A,{className:m}):(0,a.jsx)(d.A,{className:m})}}function j(e){var t;let{status:s,label:n,tone:r,className:i}=e,l=null!=r?r:null!=(t=x[s.toLowerCase()])?t:"neutral",o=null!=n?n:g(s);return(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[l],i),children:[(0,a.jsx)(f,{tone:l,spinning:h.has(s.toLowerCase())}),(0,a.jsx)("span",{children:o})]})}},28553:(e,t,s)=>{s.d(t,{LY:()=>u,O6:()=>o,_y:()=>c,fP:()=>d});var a=s(26276),n=s(15410),r=s(10002),i=s(47045),l=s(81155);function o(e){return Object.entries(null!=e?e:{}).map(e=>{let[t,s]=e;return{key:t,value:s}})}function c(e){let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]=s.value);return Object.keys(t).length?t:void 0}function d(e){let{rows:t,onChange:s,keyPlaceholder:o="Key",valuePlaceholder:c="Value",addLabel:d="Add tag",max:u=50}=e,m=(e,a)=>s(t.map((t,s)=>s===e?{...t,...a}:t));return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[t.length>0&&(0,a.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,a.jsx)("span",{children:o}),(0,a.jsx)("span",{children:c})]}),t.map((e,r)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,a.jsx)(l.p,{value:e.key,onChange:e=>m(r,{key:e.target.value}),placeholder:o,className:"h-8"}),(0,a.jsx)(l.p,{value:e.value,onChange:e=>m(r,{value:e.target.value}),placeholder:c,className:"h-8"}),(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>s(t.filter((e,t)=>t!==r)),"aria-label":"Remove",children:(0,a.jsx)(n.A,{})})]},r)),(0,a.jsx)("div",{children:(0,a.jsxs)(i.$,{type:"button",variant:"outline",size:"sm",onClick:()=>s([...t,{key:"",value:""}]),disabled:t.length>=u,children:[(0,a.jsx)(r.A,{})," ",d]})})]})}function u(e){let{tags:t}=e,s=Object.entries(null!=t?t:{});return s.length?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.map(e=>{let[t,s]=e;return(0,a.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:t}),s&&(0,a.jsxs)("span",{children:["=",s]})]},t)})}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},36337:(e,t,s)=>{s.d(t,{f:()=>l});var a=s(26276),n=s(47006),r=s(73062),i=s(22927);function l(e){let{value:t,className:s}=e,l=(0,i.cB)(3e4);return t?(0,a.jsxs)(n.m_,{children:[(0,a.jsx)(n.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=s?s:"whitespace-nowrap",children:(0,r.fF)(t,l)})}),(0,a.jsx)(n.ZI,{children:(0,r.Yq)(t)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},50565:(e,t,s)=>{s.d(t,{d:()=>i});var a=s(26276);s(29320);var n=s(63240),r=s(88674);function i(e){let{className:t,...s}=e;return(0,a.jsx)(n.bL,{"data-slot":"switch",className:(0,r.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:(0,a.jsx)(n.zi,{"data-slot":"switch-thumb",className:(0,r.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,t,s)=>{s.d(t,{J:()=>c});var a=s(26276),n=s(29320),r=s(95774),i=s(5820),l=s(88674);let o=(0,i.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)(r.b,{ref:t,className:(0,l.cn)(o(),s),...n})});c.displayName=r.b.displayName},73062:(e,t,s)=>{s.d(t,{Fl:()=>h,YI:()=>l,Yq:()=>c,ZV:()=>i,a3:()=>m,fF:()=>u,fU:()=>d,qt:()=>r,td:()=>x,z3:()=>n});let a=["B","KB","MB","GB","TB","PB"];function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let s=Math.abs(e),n=0;for(;s>=1024&&n=100?0:t);return"".concat(e<0?"-":"").concat(r," ").concat(a[n])}function r(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function l(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(i(e,1),"%");case"Bytes":return n(e);case"Bytes/Second":return"".concat(n(e),"/s");case"Milliseconds":return"".concat(i(e,0)," ms");case"Seconds":return"".concat(i(e,1)," s");default:return i(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=o(e);return s?s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),s=o(e);if(!s)return"-";let a=(s.getTime()-t)/1e3,n=Math.abs(a),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(n<45||a>0&&a<60)return"just now";let i=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(i)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:s)}function h(e){let t=e.endsWith("/")?e.slice(0,-1):e,s=t.lastIndexOf("/");return s>=0?t.slice(s+1):t}},74875:(e,t,s)=>{s.d(t,{D:()=>i});var a=s(26276),n=s(50985),r=s(88674);function i(e){let{label:t,htmlFor:s,help:i,error:l,optional:o,children:c,className:d}=e;return(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",d),children:[(0,a.jsxs)(n.J,{htmlFor:s,className:"text-sm font-medium",children:[t,o&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,l?(0,a.jsx)("p",{className:"text-destructive text-xs",children:l}):i?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:i}):null]})}},76962:(e,t,s)=>{s.d(t,{Dk:()=>u,i8:()=>m,xh:()=>x});var a=s(26276),n=s(29320),r=s(72538),i=s(37995),l=s(34993),o=s(47045),c=s(47006),d=s(88674);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(a){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}}function m(e){let{value:t,label:s,className:m,size:x="icon",toastMessage:h}=e,[p,g]=(0,n.useState)(!1),f=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(g(!0),h&&l.oR.success(h),setTimeout(()=>g(!1),1500)):l.oR.error("Could not copy to the clipboard")},j=p?r.A:i.A;return"sm"===x?(0,a.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:f,className:m,children:[(0,a.jsx)(j,{className:(0,d.cn)(p&&"text-emerald-600")}),null!=s?s:"Copy"]}):(0,a.jsxs)(c.m_,{children:[(0,a.jsx)(c.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:f,"aria-label":null!=s?s:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,a.jsx)(j,{className:(0,d.cn)("size-3.5",p&&"text-emerald-600")})})}),(0,a.jsx)(c.ZI,{children:p?"Copied":null!=s?s:"Copy"})]})}function x(e){let{value:t,mono:s=!0,className:n,display:r}=e;return t?(0,a.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",n),children:[(0,a.jsx)("span",{className:(0,d.cn)("truncate",s&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,a.jsx)(m,{value:t})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},86686:(e,t,s)=>{s.d(t,{OX:()=>O,TD:()=>S,Tm:()=>Y,Uh:()=>D,VK:()=>B,WM:()=>P,aK:()=>_,hY:()=>$,lG:()=>E,oJ:()=>F});var a=s(26276),n=s(29320),r=s(78113),i=s(40688),l=s(53630),o=s(48947),c=s(64206),d=s(64761),u=s(34993),m=s(47045),x=s(10646),h=s(64573),p=s(81155),g=s(50985),f=s(60528),j=s(50565),b=s(11363),y=s(62083),N=s(76962),v=s(21444),w=s(74875),k=s(89839),C=s(17286),R=s(28553),T=s(28971),z=s(22927),A=s(88674);let S="/api/v1/ecr",D="".concat(S,"/repositories"),_=e=>"".concat(D,"/").concat(e.split("/").map(encodeURIComponent).join("/")),F=e=>"/ecr/repository/?name=".concat(encodeURIComponent(e)),B=e=>e.startsWith("sha256:")?"sha256:".concat(e.slice(7,19)):e.slice(0,19),I=/^[a-z0-9]+(?:[._-][a-z0-9]+)*(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/;function M(e){return[{label:"2 to 256 characters",ok:e.length>=2&&e.length<=256},{label:"Lowercase letters, digits and . _ - separators",ok:/^[a-z0-9._\-/]+$/.test(e)},{label:"Namespaces separated by / (e.g. team/app); no leading, trailing or doubled separators",ok:I.test(e)}]}function L(e){let{command:t,className:s}=e;return(0,a.jsxs)("div",{className:(0,A.cn)("bg-muted/50 flex items-start gap-2 rounded-md border px-3 py-2",s),children:[(0,a.jsx)("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-[12.5px] leading-5 whitespace-pre",children:t}),(0,a.jsx)(N.i8,{value:t,label:"Copy command",className:"mt-px"})]})}function E(e){let{steps:t}=e;return(0,a.jsx)("ol",{className:"flex flex-col gap-4",children:t.map((e,t)=>(0,a.jsxs)("li",{className:"flex gap-3",children:[(0,a.jsx)("span",{className:"bg-primary/10 text-primary flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold",children:t+1}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,a.jsx)("p",{className:"text-sm",children:e.title}),(0,a.jsx)(L,{command:e.command})]})]},t))})}function P(){let{data:e,error:t,isLoading:s,mutate:n}=(0,z.gf)("".concat(S,"/status"),{refreshInterval:e=>(null==e?void 0:e.status)==="available"?6e4:3e3});return(0,a.jsx)(k.w,{title:"Registry",description:"A private Docker registry on this host. Repositories appear here automatically after the first docker push.",children:t?(0,a.jsx)(v.W,{error:t,onRetry:()=>n()}):s||!e?(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(f.E,{className:"h-5 w-64"}),(0,a.jsx)(f.E,{className:"h-10 w-full"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("dl",{className:"grid grid-cols-1 gap-x-8 gap-y-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:"Registry host"}),(0,a.jsx)("dd",{className:"text-sm",children:(0,a.jsx)(N.xh,{value:e.registry})})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:"Status"}),(0,a.jsx)("dd",{className:"text-sm",children:(0,a.jsx)(C.Wh,{status:e.status})})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:"Authentication"}),(0,a.jsx)("dd",{className:"text-sm",children:"None (loopback only)"})]})]}),"available"!==e.status&&(0,a.jsxs)("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[(0,a.jsx)(i.A,{className:"size-4 animate-spin"})," The registry container is ",e.status,". Pushes and image listings work once it is available."]}),(0,a.jsx)(E,{steps:[{title:"Tag a local image with the registry host",command:"docker tag myapp:latest ".concat(e.registry,"/myapp:latest")},{title:"Push it. The repository is created on first push.",command:"docker push ".concat(e.registry,"/myapp:latest")},{title:"Pull it anywhere on this machine",command:"docker pull ".concat(e.registry,"/myapp:latest")}]}),(0,a.jsxs)("p",{className:"text-muted-foreground flex gap-1.5 text-xs",children:[(0,a.jsx)(l.A,{className:"mt-px size-3.5 shrink-0"}),(0,a.jsxs)("span",{children:["No ",(0,a.jsx)("span",{className:"font-mono",children:"docker login"})," is needed: the registry listens on 127.0.0.1 only and Docker trusts"," ",(0,a.jsx)("span",{className:"font-mono",children:"localhost"})," registries over plain HTTP. Namespaced names such as"," ",(0,a.jsxs)("span",{className:"font-mono",children:[e.registry,"/team/app"]})," work too."]})]})]})})}function $(e){let{open:t,onOpenChange:s}=e,l=(0,r.useRouter)(),[d,x]=(0,n.useState)(""),[f,y]=(0,n.useState)(!0),[N,v]=(0,n.useState)(""),[k,C]=(0,n.useState)([]),[_,B]=(0,n.useState)(!1),[I,L]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&(x(""),y(!0),v(""),C([]),L(!1))},[t]);let E=M(d),P=M(d).every(e=>e.ok),$=async e=>{if(e.preventDefault(),L(!0),P){B(!0);try{await T.FH.post(D,{name:d,tag_mutable:f,description:N.trim()||void 0,tags:(0,R._y)(k)}),u.oR.success("Repository ".concat(d," created")),await (0,z.Yi)(S),s(!1),l.push(F(d))}catch(e){u.oR.error((0,T.gJ)(e))}finally{B(!1)}}};return(0,a.jsx)(h.lG,{open:t,onOpenChange:e=>!_&&s(e),children:(0,a.jsx)(h.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:(0,a.jsxs)("form",{onSubmit:$,className:"flex flex-col gap-5",children:[(0,a.jsxs)(h.c7,{children:[(0,a.jsx)(h.L3,{children:"Create repository"}),(0,a.jsx)(h.rr,{children:"Creating a repository first is optional: pushing an image to a new name creates its repository automatically."})]}),(0,a.jsxs)(w.D,{label:"Repository name",htmlFor:"repo-name",children:[(0,a.jsx)(p.p,{id:"repo-name",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:d,onChange:e=>x(e.target.value),onBlur:()=>L(!0),placeholder:"team/my-app",className:"font-mono","aria-invalid":I&&!P}),(0,a.jsx)("ul",{className:"mt-1 flex flex-col gap-1 text-xs",children:E.map(e=>(0,a.jsxs)("li",{className:(0,A.cn)("flex items-center gap-1.5",e.ok?"text-emerald-600 dark:text-emerald-400":I||d?"text-destructive":"text-muted-foreground"),children:[e.ok?(0,a.jsx)(o.A,{className:"size-3.5 shrink-0"}):(0,a.jsx)(c.A,{className:"size-3.5 shrink-0"}),e.label]},e.label))})]}),(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(g.J,{htmlFor:"repo-mutable",className:"font-medium",children:["Tag mutability: ",f?"Mutable":"Immutable"]}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Recorded as repository metadata. The registry itself always accepts re-pushed tags."})]}),(0,a.jsx)(j.d,{id:"repo-mutable",checked:f,onCheckedChange:y})]}),(0,a.jsx)(w.D,{label:"Description",htmlFor:"repo-desc",optional:!0,children:(0,a.jsx)(b.T,{id:"repo-desc",rows:2,value:N,onChange:e=>v(e.target.value),placeholder:"What this image is for"})}),(0,a.jsx)(w.D,{label:"Tags",optional:!0,children:(0,a.jsx)(R.fP,{rows:k,onChange:C})}),(0,a.jsxs)(h.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:_,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:_||I&&!P,children:[_&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Create repository"]})]})]})})})}function O(e){let{name:t,imageCount:s,open:r,onOpenChange:i,onDeleted:l}=e,[o,c]=(0,n.useState)(!1),[m,h]=(0,n.useState)(null);return(0,n.useEffect)(()=>{r&&(c(!1),h(null))},[r]),(0,a.jsxs)(y.T,{open:r,onOpenChange:i,title:"Delete repository ".concat(t,"?"),description:s?"The repository holds ".concat(1===s?"1 image":"".concat(s," images"),". A repository with images can only be deleted together with them."):"Deleting a repository cannot be undone.",confirmText:t,actionLabel:"Delete repository",onConfirm:async()=>{h(null);try{await T.FH.del(_(t),o?{force:"true"}:void 0)}catch(e){throw e instanceof T.hD&&"RepositoryNotEmptyException"===e.code?h("The repository still has images. Select “Force delete” to delete the images together with the repository."):h((0,T.gJ)(e)),e}u.oR.success("Repository ".concat(t," deleted")),await (0,z.Yi)(S),null==l||l()},children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,a.jsx)(x.S,{id:"repo-force",checked:o,onCheckedChange:e=>c(!0===e),className:"mt-0.5"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(g.J,{htmlFor:"repo-force",className:"font-medium",children:"Force delete (also delete images)"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Every image and tag in the repository is permanently deleted from the registry."})]})]}),m&&(0,a.jsxs)("div",{className:"border-destructive/30 bg-destructive/5 text-destructive flex items-start gap-2 rounded-md border p-3 text-sm",children:[(0,a.jsx)(d.A,{className:"mt-0.5 size-4 shrink-0"}),(0,a.jsx)("span",{children:m})]})]})}function Y(e){let{repo:t,commands:s,open:n,onOpenChange:r}=e,i=["Build your image (skip if it already exists locally)","Tag it with the repository URI","Push it to the registry"];return(0,a.jsx)(h.lG,{open:n,onOpenChange:r,children:(0,a.jsxs)(h.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[(0,a.jsxs)(h.c7,{children:[(0,a.jsxs)(h.L3,{children:["Push commands for ",t.name]}),(0,a.jsx)(h.rr,{children:"Run these from the directory that holds your Dockerfile, on the machine running HomeCloud."})]}),(0,a.jsx)(E,{steps:s.map((e,t)=>{var s;return{title:null!=(s=i[t])?s:"Step ".concat(t+1),command:e}})}),(0,a.jsxs)("p",{className:"text-muted-foreground flex gap-1.5 text-xs",children:[(0,a.jsx)(l.A,{className:"mt-px size-3.5 shrink-0"}),(0,a.jsxs)("span",{children:["Replace ",(0,a.jsx)("span",{className:"font-mono",children:"latest"})," with any tag. No ",(0,a.jsx)("span",{className:"font-mono",children:"docker login"})," is required for this local registry."]})]}),(0,a.jsx)(h.Es,{children:(0,a.jsx)(m.$,{variant:"outline",onClick:()=>r(!1),children:"Close"})})]})})}},89839:(e,t,s)=>{s.d(t,{w:()=>r});var a=s(26276),n=s(88674);function r(e){let{title:t,description:s,actions:r,children:i,className:l,bodyClassName:o,flush:c}=e;return(0,a.jsxs)("section",{className:(0,n.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",l),children:[(t||r)&&(0,a.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[t&&(0,a.jsx)("h2",{className:"text-base font-semibold",children:t}),s&&(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:s})]}),r&&(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]}),(0,a.jsx)("div",{className:(0,n.cn)(!c&&"p-4",o),children:i})]})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3238-8e56b6f34ccc89f3.js b/pages/demo/_next/static/chunks/3238-8e56b6f34ccc89f3.js deleted file mode 100644 index 55436590..00000000 --- a/pages/demo/_next/static/chunks/3238-8e56b6f34ccc89f3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3238],{6132:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},43465:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>P});var n=r(12115),l=r.t(n,2),o=r(47650),i=Object.defineProperty,a=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:l,...o}=t,i=null,a=!1,c=[];g(l)&&"function"==typeof S&&(l=S(l._payload)),n.Children.forEach(l,e=>{if(v(e)){a=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof S&&(t=S(t._payload)),i=y(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=n.cloneElement(i,void 0,c):!a&&1===n.Children.count(l)&&n.isValidElement(l)&&(i=l);let d=i?m(i):void 0,u=s(r,d);if(!i){if(l||0===l)throw Error(a?A(e):x(e));return l}let f=b(o,i.props??{});return i.type!==n.Fragment&&(f.ref=r?u:d),n.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}f(p,"createSlot");var h=Symbol.for("radix.slottable");f(function(e){let t=f(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var y=f((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}f(b,"mergeProps"),f(m,"getElementRef"),f(v,"isSlottable");var k=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===k&&"_payload"in e&&w(e._payload)}function w(e){return"object"==typeof e&&null!==e&&"then"in e}f(g,"isLazyComponent"),f(w,"isPromiseLike");var x=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),A=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=l[" use ".trim().toString()],E=r(95155),j=Object.defineProperty,R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),l=n.forwardRef((e,n)=>{let{asChild:l,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(l?r:t,{...o,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});j(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,P=n.forwardRef(C(function(e,t){return(0,E.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},74054:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},86651:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>A});var n=r(12115),l=r(92556),o=r(94446),i=r(3468),a=r(70222),c=r(78108),d=r(4129),s=r(97602),u=r(95155),f="Switch",[p,h]=(0,i.A)(f),[y,b]=p(f),m=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:f,disabled:p,value:h="on",onCheckedChange:b,form:m,...v}=e,[k,x]=n.useState(null),A=(0,o.s)(t,e=>x(e)),S=n.useRef(!1),E=!k||m||!!k.closest("form"),[j=!1,R]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[l,o]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[l]=r,o=n.useRef(l),i=(0,a.c)(t);return n.useEffect(()=>{o.current!==l&&(i(l),o.current=l)},[l,o,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:l,d=(0,a.c)(r);return[c,n.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else o(t)},[i,e,o,d])]}({prop:c,defaultProp:d,onChange:b});return(0,u.jsxs)(y,{scope:r,checked:j,disabled:p,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":j,"aria-required":f,"data-state":w(j),"data-disabled":p?"":void 0,disabled:p,value:h,...v,ref:A,onClick:(0,l.m)(e.onClick,e=>{R(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,u.jsx)(g,{control:k,bubbles:!S.current,name:i,value:h,checked:j,required:f,disabled:p,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=f;var v="SwitchThumb",k=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,l=b(v,r);return(0,u.jsx)(s.sG.span,{"data-state":w(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:t})});k.displayName=v;var g=e=>{let{control:t,checked:r,bubbles:l=!0,...o}=e,i=n.useRef(null),a=(0,c.Z)(r),s=function(e){let[t,r]=n.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,l;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,l=t.blockSize}else n=e.offsetWidth,l=e.offsetHeight;r({width:n,height:l})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(a!==r&&t){let n=new Event("click",{bubbles:l});t.call(e,r),e.dispatchEvent(n)}},[a,r,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function w(e){return e?"checked":"unchecked"}var x=m,A=k}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3254-b7a579fa88ceb3e7.js b/pages/demo/_next/static/chunks/3254-b7a579fa88ceb3e7.js deleted file mode 100644 index 651a19b5..00000000 --- a/pages/demo/_next/static/chunks/3254-b7a579fa88ceb3e7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3238,3254],{6132:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},24033:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},32978:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>E});var l=r(12115),n=r.t(l,2),o=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...o}=t,a=null,i=!1,c=[];A(n)&&"function"==typeof M&&(n=M(n._payload)),l.Children.forEach(n,e=>{if(k(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof M&&(t=M(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=l.cloneElement(a,void 0,c):!i&&1===l.Children.count(n)&&l.isValidElement(n)&&(a=n);let d=a?v(a):void 0,s=u(r,d);if(!a){if(n||0===n)throw Error(i?w(e):g(e));return n}let p=m(o,a.props??{});return a.type!==l.Fragment&&(p.ref=r?s:d),l.cloneElement(a,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let l in t){let n=e[l],o=t[l];/^on[A-Z]/.test(l)?n&&o?r[l]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...o}:"className"===l&&(r[l]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(m,"mergeProps"),p(v,"getElementRef"),p(k,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}p(A,"isLazyComponent"),p(x,"isPromiseLike");var g=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=r(95155),C=Object.defineProperty,R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...o,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});C(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,E=l.forwardRef(j(function(e,t){return(0,S.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52020:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},52056:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},61362:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},66218:(e,t,r)=>{r.d(t,{jH:()=>o});var l=r(12115);r(95155);var n=l.createContext(void 0);function o(e){let t=l.useContext(n);return e||t||"ltr"}},74054:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78108:(e,t,r)=>{r.d(t,{Z:()=>n});var l=r(12115);function n(e){let t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},78874:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},88167:(e,t,r)=>{r.d(t,{N:()=>c});var l=r(12115),n=r(3468),o=r(94446),a=r(32467),i=r(95155);function c(e){let t=e+"CollectionProvider",[r,c]=(0,n.A)(t),[d,u]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:r}=e,n=l.useRef(null),o=l.useRef(new Map).current;return(0,i.jsx)(d,{scope:t,itemMap:o,collectionRef:n,children:r})};s.displayName=t;let p=e+"CollectionSlot",f=l.forwardRef((e,t)=>{let{scope:r,children:l}=e,n=u(p,r),c=(0,o.s)(t,n.collectionRef);return(0,i.jsx)(a.DX,{ref:c,children:l})});f.displayName=p;let y=e+"CollectionItemSlot",h="data-radix-collection-item",m=l.forwardRef((e,t)=>{let{scope:r,children:n,...c}=e,d=l.useRef(null),s=(0,o.s)(t,d),p=u(y,r);return l.useEffect(()=>(p.itemMap.set(d,{ref:d,...c}),()=>void p.itemMap.delete(d))),(0,i.jsx)(a.DX,{...{[h]:""},ref:s,children:n})});return m.displayName=y,[{Provider:s,Slot:f,ItemSlot:m},function(t){let r=u(e+"CollectionConsumer",t);return l.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(h,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},c]}},89559:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},99051:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>g,zi:()=>w});var l=r(12115),n=r(92556),o=r(94446),a=r(3468),i=r(70222),c=r(78108),d=r(4129),u=r(97602),s=r(95155),p="Switch",[f,y]=(0,a.A)(p),[h,m]=f(p),v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:a,checked:c,defaultChecked:d,required:p,disabled:f,value:y="on",onCheckedChange:m,form:v,...k}=e,[b,g]=l.useState(null),w=(0,o.s)(t,e=>g(e)),M=l.useRef(!1),S=!b||v||!!b.closest("form"),[C=!1,R]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,o]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,o=l.useRef(n),a=(0,i.c)(t);return l.useEffect(()=>{o.current!==n&&(a(n),o.current=n)},[n,o,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,c=a?e:n,d=(0,i.c)(r);return[c,l.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else o(t)},[a,e,o,d])]}({prop:c,defaultProp:d,onChange:m});return(0,s.jsxs)(h,{scope:r,checked:C,disabled:f,children:[(0,s.jsx)(u.sG.button,{type:"button",role:"switch","aria-checked":C,"aria-required":p,"data-state":x(C),"data-disabled":f?"":void 0,disabled:f,value:y,...k,ref:w,onClick:(0,n.m)(e.onClick,e=>{R(e=>!e),S&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),S&&(0,s.jsx)(A,{control:b,bubbles:!M.current,name:a,value:y,checked:C,required:p,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=p;var k="SwitchThumb",b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=m(k,r);return(0,s.jsx)(u.sG.span,{"data-state":x(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});b.displayName=k;var A=e=>{let{control:t,checked:r,bubbles:n=!0,...o}=e,a=l.useRef(null),i=(0,c.Z)(r),u=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=a.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(i!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[i,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:a,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function x(e){return e?"checked":"unchecked"}var g=v,w=b}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3323-152d836556796a7c.js b/pages/demo/_next/static/chunks/3323-152d836556796a7c.js new file mode 100644 index 00000000..c5296e62 --- /dev/null +++ b/pages/demo/_next/static/chunks/3323-152d836556796a7c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3323],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),p=r(12377),s=r(26276),u="Switch",[f,h]=(0,i.A)(u),[y,m]=f(u),k=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:f,value:h="on",onCheckedChange:m,form:k,...b}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),S=l.useRef(!1),M=!v||k||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:m});return(0,s.jsxs)(y,{scope:r,checked:E,disabled:f,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":g(E),"data-disabled":f?"":void 0,disabled:f,value:h,...b,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),M&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),M&&(0,s.jsx)(A,{control:v,bubbles:!S.current,name:i,value:h,checked:E,required:u,disabled:f,form:k,style:{transform:"translateX(-100%)"}})]})});k.displayName=u;var b="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=m(b,r);return(0,s.jsx)(p.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=b;var A=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var x=k,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},71857:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},78341:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},82932:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];A(n)&&"function"==typeof S&&(n=S(n._payload)),l.Children.forEach(n,e=>{if(b(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof S&&(t=S(t._payload)),i=y(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?k(i):void 0,s=p(r,d);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=m(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?s:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var h=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var y=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}u(m,"mergeProps"),u(k,"getElementRef"),u(b,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(g,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=n[" use ".trim().toString()],M=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,M.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,M.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3403-cbe788ef3ee0085f.js b/pages/demo/_next/static/chunks/3403-cbe788ef3ee0085f.js new file mode 100644 index 00000000..6113c167 --- /dev/null +++ b/pages/demo/_next/static/chunks/3403-cbe788ef3ee0085f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3403],{2222:(e,t,a)=>{a.d(t,{SQ:()=>l,_2:()=>r,lp:()=>c,mB:()=>u,rI:()=>o,ty:()=>i});var s=a(26276);a(29320);var n=a(56128),d=a(88674);function o(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,s.jsx)(n.l9,{"data-slot":"dropdown-menu-trigger",...t})}function l(e){let{className:t,sideOffset:a=4,...o}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...o})})}function r(e){let{className:t,inset:a,variant:o="default",...i}=e;return(0,s.jsx)(n.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i})}function c(e){let{className:t,inset:a,...o}=e;return(0,s.jsx)(n.JU,{"data-slot":"dropdown-menu-label","data-inset":a,className:(0,d.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...o})}function u(e){let{className:t,...a}=e;return(0,s.jsx)(n.wv,{"data-slot":"dropdown-menu-separator",className:(0,d.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},12373:(e,t,a)=>{a.d(t,{p:()=>o});var s=a(26276),n=a(72474),d=a(88674);function o(e){let{icon:t=n.A,title:a,description:o,action:i,className:l}=e;return(0,s.jsxs)("div",{className:(0,d.cn)("flex flex-col items-center justify-center gap-2 px-6 py-12 text-center",l),children:[(0,s.jsx)("div",{className:"bg-muted text-muted-foreground mb-1 flex size-11 items-center justify-center rounded-full",children:(0,s.jsx)(t,{className:"size-5"})}),(0,s.jsx)("p",{className:"font-medium",children:a}),o&&(0,s.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:o}),i&&(0,s.jsx)("div",{className:"mt-2",children:i})]})}},47353:(e,t,a)=>{a.d(t,{$:()=>i});var s=a(26276),n=a(77440),d=a(47045),o=a(2222);function i(e){let{items:t,label:a="Actions",disabled:i,size:l="sm"}=e;return(0,s.jsxs)(o.rI,{children:[(0,s.jsx)(o.ty,{asChild:!0,children:(0,s.jsxs)(d.$,{variant:"outline",size:l,disabled:i,children:[a," ",(0,s.jsx)(n.A,{className:"opacity-60"})]})}),(0,s.jsx)(o.SQ,{align:"end",className:"min-w-52",children:t.map((e,t)=>"separator"in e?(0,s.jsx)(o.mB,{},"sep-".concat(t)):"heading"in e?(0,s.jsx)(o.lp,{className:"text-muted-foreground text-xs",children:e.heading},"h-".concat(t)):(0,s.jsxs)(o._2,{disabled:e.disabled,variant:e.destructive?"destructive":"default",onSelect:()=>e.onSelect(),title:e.hint,children:[e.icon,e.label]},e.label))})]})}},62083:(e,t,a)=>{a.d(t,{T:()=>u});var s=a(26276),n=a(29320),d=a(40688),o=a(47045),i=a(64573),l=a(81155),r=a(28971),c=a(34993);function u(e){let{open:t,onOpenChange:a,title:u,description:m,children:f,confirmText:x,actionLabel:p="Delete",destructive:g=!0,onConfirm:h}=e,[v,j]=(0,n.useState)(""),[b,N]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&j("")},[t]);let w=!b&&(!x||v===x),y=async e=>{if(null==e||e.preventDefault(),w){N(!0);try{await h(),a(!1)}catch(e){c.oR.error((0,r.gJ)(e))}finally{N(!1)}}};return(0,s.jsx)(i.lG,{open:t,onOpenChange:e=>!b&&a(e),children:(0,s.jsx)(i.Cf,{className:"sm:max-w-lg",children:(0,s.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4",children:[(0,s.jsxs)(i.c7,{children:[(0,s.jsx)(i.L3,{children:u}),m&&(0,s.jsx)(i.rr,{asChild:!0,children:(0,s.jsx)("div",{children:m})})]}),f,x&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("label",{className:"text-sm",htmlFor:"confirm-input",children:["To confirm, type ",(0,s.jsx)("span",{className:"bg-muted rounded px-1 font-mono font-medium",children:x})," in the field."]}),(0,s.jsx)(l.p,{id:"confirm-input",autoFocus:!0,autoComplete:"off",value:v,onChange:e=>j(e.target.value),placeholder:x})]}),(0,s.jsxs)(i.Es,{children:[(0,s.jsx)(o.$,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:b,children:"Cancel"}),(0,s.jsxs)(o.$,{type:"submit",variant:g?"destructive":"default",disabled:!w,children:[b&&(0,s.jsx)(d.A,{className:"animate-spin"}),p]})]})]})})})}},64573:(e,t,a)=>{a.d(t,{Cf:()=>c,Es:()=>m,L3:()=>f,c7:()=>u,lG:()=>i,rr:()=>x});var s=a(26276);a(29320);var n=a(68779),d=a(15410),o=a(88674);function i(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"dialog",...t})}function l(e){let{...t}=e;return(0,s.jsx)(n.ZL,{"data-slot":"dialog-portal",...t})}function r(e){let{className:t,...a}=e;return(0,s.jsx)(n.hJ,{"data-slot":"dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function c(e){let{className:t,children:a,showCloseButton:i=!0,...c}=e;return(0,s.jsxs)(l,{"data-slot":"dialog-portal",children:[(0,s.jsx)(r,{}),(0,s.jsxs)(n.UC,{"data-slot":"dialog-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...c,children:[a,i&&(0,s.jsxs)(n.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(d.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(n.hE,{"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(n.VY,{"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...a})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/344-222bd6e3df1f0184.js b/pages/demo/_next/static/chunks/344-222bd6e3df1f0184.js deleted file mode 100644 index 5e7d6137..00000000 --- a/pages/demo/_next/static/chunks/344-222bd6e3df1f0184.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[344],{63963:(e,t,r)=>{r.d(t,{Ge:()=>C,HH:()=>g,NK:()=>A,TD:()=>v,WL:()=>w,X6:()=>_,XZ:()=>u,Zg:()=>d,aM:()=>S,dl:()=>j,e2:()=>m,eF:()=>x,er:()=>h,i6:()=>q,it:()=>T,iw:()=>I,j0:()=>p,jE:()=>E,jw:()=>b,lr:()=>R,mG:()=>f,qR:()=>i,uD:()=>F,vs:()=>M,x6:()=>k,xD:()=>H});var o=r(95155),n=r(52619),a=r.n(n),l=r(47507),c=r(73864),s=r(73697);let i="/api/v1/elb/load-balancers",d="/api/v1/elb/target-groups",p="/api/v1/elb",h=(e,t)=>"/elb/load-balancer/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),u=(e,t)=>"/elb/target-group/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),m=e=>"/ecs/service/?name=".concat(encodeURIComponent(e)),g=e=>"/vpc/?id=".concat(encodeURIComponent(e)),f=e=>"/vpc/subnets/?vpc_id=".concat(encodeURIComponent(e)),x=/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,30}[a-zA-Z0-9])?$/,v=e=>"provisioning"===e;function b(e){return e.some(v)?2e3:15e3}function j(e){let{state:t}=e;return"provisioning"===t?(0,o.jsx)(c.Wh,{status:"pending",label:"Provisioning",tone:"warning"}):(0,o.jsx)(c.Wh,{status:t})}let P={healthy:"success",unhealthy:"danger",unavailable:"warning",initial:"warning",unused:"neutral"};function T(e){var t;let{health:r}=e,n=null!=(t=P[r])?t:"neutral";return(0,o.jsx)(c.Wh,{status:r,tone:n})}let N=e=>/^[0-9a-f]{32}$/.test(e),y=e=>e.startsWith("i-");function w(e){return y(e)?"Instance":N(e)?"ECS task":"Target"}function C(e){let{id:t,className:r}=e,n=y(t)?"/ec2/instance/?id=".concat(encodeURIComponent(t)):N(t)?"/ecs/task/?id=".concat(encodeURIComponent(t)):null,l=N(t)?t.slice(0,12):t,c="font-mono text-[13px] whitespace-nowrap ".concat(null!=r?r:"");return n?(0,o.jsx)(a(),{href:n,title:t,onClick:e=>e.stopPropagation(),className:"text-primary hover:underline ".concat(c),children:l}):(0,o.jsx)("span",{className:c,children:t})}function S(e){let{name:t}=e;return(0,o.jsx)(a(),{href:u(t),onClick:e=>e.stopPropagation(),className:"text-primary font-medium whitespace-nowrap hover:underline",children:t})}function _(e){let{name:t}=e;return(0,o.jsx)(a(),{href:h(t),onClick:e=>e.stopPropagation(),className:"text-primary font-medium whitespace-nowrap hover:underline",children:t})}function H(e,t){var r;return null==(r=e.public_ports)?void 0:r["".concat(t.port,"/tcp")]}function k(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"".concat(r?"https":"http","://").concat(e.public_host||"localhost",":").concat(t)}let D=(e,t)=>{var r;return(null!=(r=e.listeners)?r:[]).some(e=>"".concat(e.port,"/tcp")===t&&"HTTPS"===e.protocol)};function F(e){var t;let{lb:r,empty:n="-",compact:a}=e,l=Object.entries(null!=(t=r.public_ports)?t:{}).sort((e,t)=>parseInt(e[0])-parseInt(t[0]));if(!l.length)return(0,o.jsx)("span",{className:"text-muted-foreground",children:n});let c=r.public_host||"localhost";return(0,o.jsx)("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:l.map(e=>{let[t,n]=e;return(0,o.jsx)("a",{href:k(r,n,D(r,t)),target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),className:"text-primary font-mono text-[13px] whitespace-nowrap hover:underline",children:a?"".concat(t.split("/")[0]," → ").concat(n):"".concat(D(r,t)?"https://":"").concat(c,":").concat(n)},t)})})}function R(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,s.gf)(i,{refreshInterval:e?e=>b((null!=e?e:[]).map(e=>e.state)):0})}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return(0,s.gf)(d,{refreshInterval:e})}function I(){return(0,s.gf)("/api/v1/ec2/instances",{refreshInterval:3e4})}function q(e,t){return(null!=t?t:[]).filter(t=>(function(e){var t,r;let o=new Set;for(let n of null!=(t=e.listeners)?t:[])for(let e of(n.default_target_group&&o.add(n.default_target_group),null!=(r=n.rules)?r:[]))o.add(e.target_group);return[...o]})(t).includes(e)).map(e=>e.name)}function E(e){let t={total:e.length,healthy:0,unhealthy:0,other:0};for(let r of e)"healthy"===r.health?t.healthy++:"unhealthy"===r.health?t.unhealthy++:t.other++;return t}function M(e){let{id:t,value:r,onChange:n,vpcId:a,placeholder:c="Choose a target group",invalid:s}=e,{data:i,isLoading:d}=A(),p=(null!=i?i:[]).filter(e=>!a||e.vpc_id===a).sort((e,t)=>e.name.localeCompare(t.name));return(0,o.jsxs)(l.l6,{value:r,onValueChange:e=>e&&n(e),disabled:d&&!i,children:[(0,o.jsx)(l.bq,{id:t,className:"w-full","aria-invalid":s,children:(0,o.jsx)(l.yv,{placeholder:d&&!i?"Loading target groups...":p.length?c:"No target groups in this VPC"})}),(0,o.jsx)(l.gC,{children:p.map(e=>(0,o.jsxs)(l.eb,{value:e.name,children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:[e.protocol,":",e.port," \xb7 ",e.targets.length," target",1===e.targets.length?"":"s"]})]},e.name))})]})}},80344:(e,t,r)=>{r.d(t,{K8:()=>C,aK:()=>S,cl:()=>w,fP:()=>T,hD:()=>y,kZ:()=>_,sI:()=>k,tq:()=>N});var o=r(95155),n=r(12115),a=r(52619),l=r.n(a),c=r(52056),s=r(35299),i=r(18720),d=r(32559),p=r(97003),h=r(54679),u=r(33789),m=r(47507),g=r(69445),f=r(16981),x=r(37621),v=r(73697),b=r(25016),j=r(63963);let P=e=>/^\d+$/.test(e)&&Number(e)>=1&&65535>=Number(e);function T(e){let{lb:t}=e;return(0,o.jsxs)(d.Fc,{className:"border-amber-600/30 bg-amber-50 text-amber-800 dark:border-amber-400/30 dark:bg-amber-500/10 dark:text-amber-300",children:[(0,o.jsx)(c.A,{}),(0,o.jsx)(d.XL,{children:"Re-provisions the load balancer"}),(0,o.jsxs)(d.TN,{className:"text-current/90",children:["Adding or removing a listener recreates the load balancer container, so all listeners drop traffic for a few seconds.","internet-facing"===t.scheme&&" Listeners without a fixed host port may be published on a different host port afterwards."]})]})}let N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"80",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return{protocol:"HTTP",port:e,publicPort:"",cert:"",action:"forward",tg:t,redirectPort:"443"}};function y(e,t){let r={};return P(e.port)?t.usedPorts.includes(e.port)&&(r.port="Port ".concat(e.port," is already used by another listener")):r.port="1-65535","internet-facing"===t.scheme&&e.publicPort&&!P(e.publicPort)&&(r.pub="1-65535, or empty for any free port"),"HTTPS"!==e.protocol||e.cert||(r.cert="Choose a certificate"),"HTTPS"===e.protocol||"forward"===e.action?e.tg||(r.tg="Choose a target group"):P(e.redirectPort)?e.redirectPort===e.port&&(r.redirect="Redirect to a different port than this listener's"):r.redirect="Enter the HTTPS listener port",r}function w(e,t){let r="HTTP"===e.protocol&&"redirect"===e.action;return{port:Number(e.port),protocol:e.protocol,certificate_arn:"HTTPS"===e.protocol?e.cert:void 0,redirect_https_port:r?Number(e.redirectPort):void 0,public_port:"internet-facing"===t&&e.publicPort?Number(e.publicPort):void 0,default_target_group:r?"":e.tg}}function C(e){return"HTTP"===e.protocol&&"redirect"===e.action?"".concat(e.protocol,":").concat(e.port||"?"," → redirect to HTTPS:").concat(e.redirectPort||"?"):"".concat(e.protocol,":").concat(e.port||"?"," → ").concat(e.tg||"?")}function S(e){let{draft:t,onChange:r,idPrefix:n,vpcId:a,scheme:c,errors:s,httpsPorts:i,compact:d}=e,p=e=>r({...t,...e}),h="HTTP"===t.protocol&&"redirect"===t.action;return(0,o.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,o.jsxs)("div",{className:(0,b.cn)("grid grid-cols-2 items-start gap-3",!d&&"sm:grid-cols-[8rem_7rem_9rem]"),children:[(0,o.jsx)(f.D,{label:"Protocol",htmlFor:"".concat(n,"-proto"),children:(0,o.jsxs)(m.l6,{value:t.protocol,onValueChange:e=>{let r={protocol:e};"HTTPS"===e&&"80"===t.port&&(r.port="443"),"HTTP"===e&&"443"===t.port&&(r.port="80"),p(r)},children:[(0,o.jsx)(m.bq,{id:"".concat(n,"-proto"),className:"h-8 w-full font-mono",children:(0,o.jsx)(m.yv,{})}),(0,o.jsxs)(m.gC,{children:[(0,o.jsx)(m.eb,{value:"HTTP",className:"font-mono",children:"HTTP"}),(0,o.jsx)(m.eb,{value:"HTTPS",className:"font-mono",children:"HTTPS"})]})]})}),(0,o.jsx)(f.D,{label:"Port",htmlFor:"".concat(n,"-port"),error:s.port,children:(0,o.jsx)(u.p,{id:"".concat(n,"-port"),inputMode:"numeric",value:t.port,onChange:e=>p({port:e.target.value}),className:"h-8"})}),(0,o.jsx)(f.D,{label:"Host port",htmlFor:"".concat(n,"-pub"),optional:!0,error:s.pub,className:(0,b.cn)(d&&"col-span-2"),children:(0,o.jsx)(u.p,{id:"".concat(n,"-pub"),inputMode:"numeric",value:"internal"===c?"":t.publicPort,disabled:"internal"===c,onChange:e=>p({publicPort:e.target.value}),placeholder:"internal"===c?"Not published":"Any free port",className:"h-8"})})]}),"HTTPS"===t.protocol&&(0,o.jsx)(f.D,{label:"Certificate (from ACM)",htmlFor:"".concat(n,"-cert"),error:s.cert,help:(0,o.jsxs)(o.Fragment,{children:["TLS 1.2/1.3 terminates at the load balancer; targets receive plain HTTP."," ",(0,o.jsx)(l(),{href:"/acm/?request=1",className:"text-primary hover:underline",target:"_blank",children:"Request a certificate"})]}),children:(0,o.jsx)(g.SV,{id:"".concat(n,"-cert"),value:t.cert,onChange:e=>p({cert:e}),invalid:!!s.cert})}),"HTTP"===t.protocol&&(0,o.jsx)(f.D,{label:"Default action",htmlFor:"".concat(n,"-action"),children:(0,o.jsxs)(m.l6,{value:t.action,onValueChange:e=>p({action:e,redirectPort:t.redirectPort||i[0]||"443"}),children:[(0,o.jsx)(m.bq,{id:"".concat(n,"-action"),className:"h-8 w-full",children:(0,o.jsx)(m.yv,{})}),(0,o.jsxs)(m.gC,{children:[(0,o.jsx)(m.eb,{value:"forward",children:"Forward to a target group"}),(0,o.jsx)(m.eb,{value:"redirect",children:"Redirect to HTTPS (301)"})]})]})}),h?(0,o.jsx)(f.D,{label:"HTTPS port to redirect to",htmlFor:"".concat(n,"-redir"),error:s.redirect,help:t.redirectPort&&!i.includes(t.redirectPort)?"There is no HTTPS listener on port ".concat(t.redirectPort," yet; add one or the redirect leads nowhere."):"Every request gets a 301 to https://: with the same path. Internet-facing redirects use the HTTPS listener's host port.",children:(0,o.jsx)(u.p,{id:"".concat(n,"-redir"),inputMode:"numeric",value:t.redirectPort,onChange:e=>p({redirectPort:e.target.value}),className:"h-8 w-32"})}):(0,o.jsx)(f.D,{label:"Forward to",htmlFor:"".concat(n,"-tg"),error:s.tg,children:(0,o.jsx)(j.vs,{id:"".concat(n,"-tg"),value:t.tg,onChange:e=>p({tg:e}),vpcId:a,invalid:!!s.tg})})]})}function _(e){let{lb:t,open:r,onOpenChange:a}=e,[l,c]=(0,n.useState)(N()),[d,u]=(0,n.useState)(!1),[m,g]=(0,n.useState)(!1);(0,n.useEffect)(()=>{var e,o,n,a,l;if(!r)return;let s=new Set(t.listeners.map(e=>String(e.port))),i=t.listeners.some(e=>"HTTPS"===e.protocol),d=N(null!=(n=["80","8080","8000","8081","8888","3000"].find(e=>!s.has(e)))?n:"",null!=(a=null==(e=t.listeners.find(e=>e.default_target_group))?void 0:e.default_target_group)?a:"");i||s.has("443")||(d.protocol="HTTPS",d.port="443"),d.redirectPort=String(null!=(l=null==(o=t.listeners.find(e=>"HTTPS"===e.protocol))?void 0:o.port)?l:443),c(d),u(!1)},[r,t]);let f=y(l,{scheme:t.scheme,usedPorts:t.listeners.map(e=>String(e.port))}),b=d?f:{},P=t.listeners.filter(e=>"HTTPS"===e.protocol).map(e=>String(e.port)),C=async e=>{if(e.preventDefault(),u(!0),!Object.keys(f).length){g(!0);try{await x.FH.post("".concat(j.qR,"/").concat((0,x.aJ)(t.name),"/listeners"),w(l,t.scheme)),i.oR.success("Added listener ".concat(l.protocol,":").concat(l.port,"; re-provisioning ").concat(t.name)),await (0,v.Yi)(j.j0),a(!1)}catch(e){i.oR.error((0,x.gJ)(e))}finally{g(!1)}}};return(0,o.jsx)(h.lG,{open:r,onOpenChange:e=>!m&&a(e),children:(0,o.jsx)(h.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-lg",children:(0,o.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-4",children:[(0,o.jsxs)(h.c7,{children:[(0,o.jsx)(h.L3,{children:"Add listener"}),(0,o.jsx)(h.rr,{children:"Accept HTTP or HTTPS on another port and forward it to a target group, or redirect plain HTTP to HTTPS."})]}),(0,o.jsx)(S,{draft:l,onChange:c,idPrefix:"al",vpcId:t.vpc_id,scheme:t.scheme,errors:b,httpsPorts:P,compact:!0}),(0,o.jsx)(T,{lb:t}),(0,o.jsxs)(h.Es,{children:[(0,o.jsx)(p.$,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:m,children:"Cancel"}),(0,o.jsxs)(p.$,{type:"submit",disabled:m,children:[m&&(0,o.jsx)(s.A,{className:"animate-spin"}),"Add listener"]})]})]})})})}let H=/[\s;{}'"\\]/;function k(e){var t,r;let{lb:a,listener:l,onClose:c}=e,[d,m]=(0,n.useState)(""),[g,b]=(0,n.useState)(""),[P,T]=(0,n.useState)(""),[N,y]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[S,_]=(0,n.useState)(!1),[k,D]=(0,n.useState)(null);(0,n.useEffect)(()=>{l&&(D(null),m(""),b(""),T(""),y(""),C(!1))},[l]);let F={},R=g.trim(),A=P.trim().toLowerCase();R||A||(F.cond="Add a path prefix, a host header, or both"),R&&!R.startsWith("/")?F.path="Must start with /":H.test(R)&&(F.path="No spaces, quotes, braces or semicolons"),H.test(A)&&(F.host="No spaces, quotes, braces or semicolons"),d&&(!/^\d+$/.test(d)||1>Number(d)||Number(d)>5e4)&&(F.priority="1-50000"),N||(F.tg="Choose a target group");let I=!l||F.cond||F.path||F.host?void 0:function(e,t,r){var o;let n=t||"/";return null!=(o=e.rules.find(e=>{var t;return(e.path_prefix||"/")===n&&(null!=(t=e.host_header)?t:"")===r}))?o:e.rules.find(e=>(e.path_prefix||"/")===n&&(!e.host_header||!r))}(l,R,A);I&&(F.cond="Overlaps rule ".concat(I.priority," (").concat([I.host_header&&"host ".concat(I.host_header),"path ".concat(I.path_prefix||"/")].filter(Boolean).join(", "),"): nginx cannot route the same path twice for one host. Delete that rule first."));let q=e=>w?F[e]:void 0,E=async e=>{if(e.preventDefault(),C(!0),!l||Object.keys(F).length)return;let t={priority:d?Number(d):void 0,path_prefix:R||void 0,host_header:A||void 0,target_group:N};_(!0);try{D(null),await x.FH.post("".concat(j.qR,"/").concat((0,x.aJ)(a.name),"/listeners/").concat((0,x.aJ)(l.id),"/rules"),t),i.oR.success("Added rule to listener ".concat(l.protocol,":").concat(l.port)),await (0,v.Yi)(j.j0),c()}catch(e){e instanceof x.hD&&409===e.status?D((0,x.gJ)(e)):i.oR.error((0,x.gJ)(e))}finally{_(!1)}};return(0,o.jsx)(h.lG,{open:!!l,onOpenChange:e=>!e&&!S&&c(),children:(0,o.jsx)(h.Cf,{className:"sm:max-w-lg",children:(0,o.jsxs)("form",{onSubmit:E,className:"flex flex-col gap-4",children:[(0,o.jsxs)(h.c7,{children:[(0,o.jsxs)(h.L3,{children:["Add rule to ",null!=(t=null==l?void 0:l.protocol)?t:"HTTP",":",null==l?void 0:l.port]}),(0,o.jsx)(h.rr,{children:"Requests matching every condition are forwarded to the rule's target group; everything else goes to the default action. Applied without downtime."})]}),(0,o.jsx)(f.D,{label:"Path prefix",htmlFor:"ar-path",optional:!0,error:q("path"),help:"Matches request paths starting with this prefix, e.g. /api/.",children:(0,o.jsx)(u.p,{id:"ar-path",value:g,onChange:e=>b(e.target.value),placeholder:"/api/",className:"font-mono",autoFocus:!0,spellCheck:!1})}),(0,o.jsx)(f.D,{label:"Host header",htmlFor:"ar-host",optional:!0,error:q("host"),help:"Matches the Host header exactly, e.g. api.example.com.",children:(0,o.jsx)(u.p,{id:"ar-host",value:P,onChange:e=>T(e.target.value),placeholder:"api.example.com",className:"font-mono",spellCheck:!1})}),q("cond")&&(0,o.jsx)("p",{className:"text-destructive -mt-2 text-xs",children:q("cond")}),k&&(0,o.jsx)("p",{className:"text-destructive text-xs",role:"alert",children:k}),(0,o.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[8rem_minmax(0,1fr)]",children:[(0,o.jsx)(f.D,{label:"Priority",htmlFor:"ar-priority",optional:!0,error:q("priority"),children:(0,o.jsx)(u.p,{id:"ar-priority",inputMode:"numeric",value:d,onChange:e=>m(e.target.value),placeholder:String((null!=(r=null==l?void 0:l.rules.length)?r:0)+1)})}),(0,o.jsx)(f.D,{label:"Forward to",htmlFor:"ar-tg",error:q("tg"),children:(0,o.jsx)(j.vs,{id:"ar-tg",value:N,onChange:y,vpcId:a.vpc_id,invalid:!!q("tg")})})]}),(0,o.jsx)("p",{className:"text-muted-foreground text-xs",children:"Path rules use nginx prefix matching: the longest matching prefix wins, so priority only orders rules in the list and in the generated config."}),(0,o.jsxs)(h.Es,{children:[(0,o.jsx)(p.$,{type:"button",variant:"outline",onClick:c,disabled:S,children:"Cancel"}),(0,o.jsxs)(p.$,{type:"submit",disabled:S,children:[S&&(0,o.jsx)(s.A,{className:"animate-spin"}),"Add rule"]})]})]})})})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3486-bbe949347b1e81f8.js b/pages/demo/_next/static/chunks/3486-bbe949347b1e81f8.js deleted file mode 100644 index cecfcc43..00000000 --- a/pages/demo/_next/static/chunks/3486-bbe949347b1e81f8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3486],{11723:(e,t,a)=>{a.d(t,{f:()=>c});var n=a(95155),i=a(82180),s=a(7e3),l=a(73697);function c(e){let{value:t,className:a}=e,c=(0,l.cB)(3e4);return t?(0,n.jsxs)(i.m_,{children:[(0,n.jsx)(i.k$,{asChild:!0,children:(0,n.jsx)("span",{className:null!=a?a:"whitespace-nowrap",children:(0,s.fF)(t,c)})}),(0,n.jsx)(i.ZI,{children:(0,s.Yq)(t)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}},74462:(e,t,a)=>{a.d(t,{$9:()=>O,B:()=>S,FS:()=>z,Fg:()=>L,IW:()=>W,LT:()=>k,NH:()=>E,Pc:()=>P,VK:()=>$,Xg:()=>f,ZE:()=>F,_i:()=>A,jV:()=>y,oM:()=>T,q1:()=>M,wp:()=>R,yB:()=>C,zm:()=>w});var n=a(95155),i=a(12115),s=a(20063),l=a(65229),c=a(35299),r=a(6191),o=a(18720),d=a(97003),m=a(54679),u=a(33789),h=a(47507),g=a(86233),p=a(16981),x=a(73864),j=a(37621),v=a(7e3),b=a(73697);let f="/api/v1/autoscaling",N="".concat(f,"/groups"),w=e=>"".concat(N,"/").concat((0,j.aJ)(e)),y=e=>"/ec2/autoscaling/group/?name=".concat(encodeURIComponent(e)),C=/^[\w.-]{1,255}$/,_=[{value:"CPUUtilization",label:"Average CPU utilization"},{value:"MemoryUtilization",label:"Average memory utilization"}],S=e=>{var t,a;return null!=(a=null==(t=_.find(t=>t.value===e))?void 0:t.label)?a:e};function k(e){return(null!=e?e:[]).some(e=>{var t,a;return"Active"!==e.status||(null!=(t=e.instances)?t:[]).length!==e.desired_capacity||(null!=(a=e.instances)?a:[]).some(e=>"pending"===e.state)})?3e3:15e3}function A(){return(0,b.gf)(N,{refreshInterval:k})}function F(e){var t,a;let{g:i}=e;if("Active"!==i.status)return(0,n.jsx)(x.Wh,{status:"deleting",label:i.status});let s=(null!=(t=i.instances)?t:[]).length;return s"pending"===e.state)?(0,n.jsx)(x.Wh,{status:"updating",label:"Updating capacity"}):s>i.desired_capacity?(0,n.jsx)(x.Wh,{status:"updating",label:"Scaling in"}):i.suspended?(0,n.jsx)(x.Wh,{status:"suspended",label:"Active, scaling suspended"}):(0,n.jsx)(x.Wh,{status:"active",label:"Active"})}function z(e){let{status:t}=e;return(0,n.jsx)(x.Wh,{status:t.toLowerCase(),label:t,tone:"Successful"===t?"success":"Failed"===t?"danger":"neutral"})}let D=(e,t,a)=>/^\d+$/.test(e)&&Number(e)>=t&&Number(e)<=a;function M(e,t,a){let n={};return D(e,0,50)||(n.min="0-".concat(50)),D(a,0,50)||(n.max="0-".concat(50)),D(t,0,50)||(n.desired="0-".concat(50)),!n.min&&!n.max&&Number(a)Number(a))&&(n.desired="Must be between the minimum and maximum"),n}function R(e){let{min:t,desired:a,max:i,onChange:s,errors:l,idPrefix:c}=e;return(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,n.jsx)(p.D,{label:"Minimum",htmlFor:"".concat(c,"-min"),error:l.min,children:(0,n.jsx)(u.p,{id:"".concat(c,"-min"),inputMode:"numeric",value:t,onChange:e=>s({min:e.target.value,desired:a,max:i})})}),(0,n.jsx)(p.D,{label:"Desired",htmlFor:"".concat(c,"-desired"),error:l.desired,children:(0,n.jsx)(u.p,{id:"".concat(c,"-desired"),inputMode:"numeric",value:a,onChange:e=>s({min:t,desired:e.target.value,max:i})})}),(0,n.jsx)(p.D,{label:"Maximum",htmlFor:"".concat(c,"-max"),error:l.max,children:(0,n.jsx)(u.p,{id:"".concat(c,"-max"),inputMode:"numeric",value:i,onChange:e=>s({min:t,desired:a,max:e.target.value})})})]})}let U=e=>({name:e.name,metric:e.metric,target:String(e.target_value),cooldown:String(e.cooldown_seconds||180)});function $(e){let t={},a=Number(e.target);return(!e.target||Number.isNaN(a)||a<1||a>100)&&(t.target="1-100 %"),e.cooldown&&!D(e.cooldown,60,86400)&&(t.cooldown="60-86400 s"),t}let E=e=>({metric:e.metric,target_value:Number(e.target),cooldown_seconds:e.cooldown?Number(e.cooldown):void 0});function T(e){let{draft:t,onChange:a,errors:i,idPrefix:s,onRemove:c}=e;return(0,n.jsxs)("div",{className:"grid grid-cols-2 items-start gap-3 rounded-md border p-3 sm:grid-cols-[minmax(0,1fr)_6rem_7rem_auto]",children:[(0,n.jsx)(p.D,{label:"Metric",htmlFor:"".concat(s,"-metric"),className:"col-span-2 sm:col-span-1",children:(0,n.jsxs)(h.l6,{value:t.metric,onValueChange:e=>a({...t,metric:e}),children:[(0,n.jsx)(h.bq,{id:"".concat(s,"-metric"),className:"h-8 w-full",children:(0,n.jsx)(h.yv,{})}),(0,n.jsx)(h.gC,{children:_.map(e=>(0,n.jsx)(h.eb,{value:e.value,children:e.label},e.value))})]})}),(0,n.jsx)(p.D,{label:"Target %",htmlFor:"".concat(s,"-target"),error:i.target,children:(0,n.jsx)(u.p,{id:"".concat(s,"-target"),inputMode:"decimal",value:t.target,onChange:e=>a({...t,target:e.target.value}),className:"h-8"})}),(0,n.jsx)(p.D,{label:"Cooldown (s)",htmlFor:"".concat(s,"-cool"),error:i.cooldown,children:(0,n.jsx)(u.p,{id:"".concat(s,"-cool"),inputMode:"numeric",value:t.cooldown,onChange:e=>a({...t,cooldown:e.target.value}),className:"h-8",placeholder:"180"})}),c&&(0,n.jsx)(d.$,{type:"button",variant:"ghost",size:"icon",className:"col-start-2 row-start-1 size-8 justify-self-end sm:col-start-4 sm:mt-6",onClick:c,"aria-label":"Remove policy",children:(0,n.jsx)(l.A,{})})]})}let W=()=>({name:"",metric:"CPUUtilization",target:"50",cooldown:"180"});function O(e){var t;let{group:a,onClose:s}=e,[l,r]=(0,i.useState)({min:"",desired:"",max:""}),[u,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{a&&r({min:String(a.min_size),desired:String(a.desired_capacity),max:String(a.max_size)})},[a]);let g=M(l.min,l.desired,l.max),p=async e=>{if(e.preventDefault(),a&&!Object.keys(g).length){h(!0);try{await j.FH.patch(w(a.name),{min_size:Number(l.min),max_size:Number(l.max),desired_capacity:Number(l.desired)}),o.oR.success("Updated capacity of ".concat(a.name)),await (0,b.Yi)(f),await (0,b.Yi)("/api/v1/ec2"),s()}catch(e){o.oR.error((0,j.gJ)(e))}finally{h(!1)}}},x=a?(null!=(t=a.instances)?t:[]).length:0,N=Number(l.desired);return(0,n.jsx)(m.lG,{open:!!a,onOpenChange:e=>!e&&!u&&s(),children:(0,n.jsx)(m.Cf,{className:"sm:max-w-md",children:(0,n.jsxs)("form",{onSubmit:p,className:"flex flex-col gap-4",children:[(0,n.jsxs)(m.c7,{children:[(0,n.jsxs)(m.L3,{children:["Edit capacity of ",null==a?void 0:a.name]}),(0,n.jsx)(m.rr,{children:"Target tracking policies adjust the desired capacity between the minimum and maximum."})]}),(0,n.jsx)(R,{min:l.min,desired:l.desired,max:l.max,onChange:r,errors:g,idPrefix:"cap"}),!g.desired&&a&&N!==x&&(0,n.jsxs)("p",{className:"text-muted-foreground text-xs",children:[N>x?"Launches ".concat((0,v.td)(N-x,"instance"),"."):"Terminates the ".concat((0,v.td)(x-N,"newest instance"),".")," Takes effect within about 10 seconds."]}),(0,n.jsxs)(m.Es,{children:[(0,n.jsx)(d.$,{type:"button",variant:"outline",onClick:s,disabled:u,children:"Cancel"}),(0,n.jsxs)(d.$,{type:"submit",disabled:u||Object.keys(g).length>0,children:[u&&(0,n.jsx)(c.A,{className:"animate-spin"}),"Update"]})]})]})})})}function P(e){let{group:t,onClose:a}=e,[s,l]=(0,i.useState)([]),[u,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{var e;t&&l((null!=(e=t.policies)?e:[]).map(U))},[t]);let g=s.map($),p=g.some(e=>Object.keys(e).length),x=async e=>{if(e.preventDefault(),t&&!p){h(!0);try{await j.FH.patch(w(t.name),{policies:s.map(E)}),o.oR.success(s.length?"Saved ".concat((0,v.td)(s.length,"scaling policy","scaling policies")):"Removed scaling policies"),await (0,b.Yi)(f),a()}catch(e){o.oR.error((0,j.gJ)(e))}finally{h(!1)}}};return(0,n.jsx)(m.lG,{open:!!t,onOpenChange:e=>!e&&!u&&a(),children:(0,n.jsx)(m.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:(0,n.jsxs)("form",{onSubmit:x,className:"flex flex-col gap-4",children:[(0,n.jsxs)(m.c7,{children:[(0,n.jsx)(m.L3,{children:"Dynamic scaling policies"}),(0,n.jsx)(m.rr,{children:"Target tracking keeps the average metric of running instances near the target by changing the desired capacity (within min and max), at most once per cooldown."})]}),0===s.length&&(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:"No policies: the group keeps its desired capacity."}),s.map((e,t)=>(0,n.jsx)(T,{draft:e,onChange:e=>l(s.map((a,n)=>n===t?e:a)),errors:g[t],idPrefix:"pol-".concat(t),onRemove:()=>l(s.filter((e,a)=>a!==t))},t)),(0,n.jsx)("div",{children:(0,n.jsxs)(d.$,{type:"button",variant:"outline",size:"sm",onClick:()=>l([...s,W()]),disabled:s.length>=4,children:[(0,n.jsx)(r.A,{})," Add target tracking policy"]})}),(0,n.jsxs)(m.Es,{children:[(0,n.jsx)(d.$,{type:"button",variant:"outline",onClick:a,disabled:u,children:"Cancel"}),(0,n.jsxs)(d.$,{type:"submit",disabled:u||p,children:[u&&(0,n.jsx)(c.A,{className:"animate-spin"}),"Save policies"]})]})]})})})}function L(e){var t,a;let{group:i,onClose:l,redirect:c}=e,r=(0,s.useRouter)(),d=(null!=(t=null==i?void 0:i.instances)?t:[]).length;return(0,n.jsx)(g.T,{open:!!i,onOpenChange:e=>!e&&l(),title:"Delete Auto Scaling group ".concat(null!=(a=null==i?void 0:i.name)?a:""),confirmText:null==i?void 0:i.name,description:(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("p",{className:"text-destructive",children:[d?"The group's ".concat((0,v.td)(d,"instance")," will be terminated"):"Any instances the group launches will be terminated"," and deregistered from its target groups."]}),(0,n.jsx)("p",{children:"Volumes and EFS file systems are not deleted."})]}),onConfirm:async()=>{i&&(await j.FH.del(w(i.name)),o.oR.success("Deleting Auto Scaling group ".concat(i.name)),c&&r.push("/ec2/autoscaling/"),await (0,b.Yi)(f))}})}}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3536-bf5cb635d8c9dd51.js b/pages/demo/_next/static/chunks/3536-bf5cb635d8c9dd51.js new file mode 100644 index 00000000..b6079ed9 --- /dev/null +++ b/pages/demo/_next/static/chunks/3536-bf5cb635d8c9dd51.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3536],{1947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},53630:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>A,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),p=r(12377),s=r(26276),u="Switch",[f,y]=(0,i.A)(u),[h,b]=f(u),k=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:f,value:y="on",onCheckedChange:b,form:k,...m}=e,[v,A]=l.useState(null),w=(0,a.s)(t,e=>A(e)),S=l.useRef(!1),M=!v||k||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:b});return(0,s.jsxs)(h,{scope:r,checked:E,disabled:f,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":g(E),"data-disabled":f?"":void 0,disabled:f,value:y,...m,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),M&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),M&&(0,s.jsx)(x,{control:v,bubbles:!S.current,name:i,value:y,checked:E,required:u,disabled:f,form:k,style:{transform:"translateX(-100%)"}})]})});k.displayName=u;var m="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=b(m,r);return(0,s.jsx)(p.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=m;var x=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var A=k,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},68673:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},85469:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];x(n)&&"function"==typeof S&&(n=S(n._payload)),l.Children.forEach(n,e=>{if(m(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof S&&(t=S(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?k(i):void 0,s=p(r,d);if(!i){if(n||0===n)throw Error(o?w(e):A(e));return n}let u=b(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?s:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var y=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function m(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}u(b,"mergeProps"),u(k,"getElementRef"),u(m,"isSlottable");var v=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}u(x,"isLazyComponent"),u(g,"isPromiseLike");var A=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=n[" use ".trim().toString()],M=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,M.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,M.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/3577-e0b740bef33bfd9e.js b/pages/demo/_next/static/chunks/3577-e0b740bef33bfd9e.js new file mode 100644 index 00000000..8681e0da --- /dev/null +++ b/pages/demo/_next/static/chunks/3577-e0b740bef33bfd9e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3577],{6778:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},44057:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},51203:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},78410:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>z});var r=l(29320),a=l.t(r,2),n=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,c=[];A(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let d=i?m(i):void 0,y=p(l,d);if(!i){if(a||0===a)throw Error(o?g(e):x(e));return a}let h=k(n,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:d),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(f,"createSlot");var u=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=u,t},"createSlottable");var s=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}h(k,"mergeProps"),h(m,"getElementRef"),h(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&M(e._payload)}function M(e){return"object"==typeof e&&null!==e&&"then"in e}h(A,"isLazyComponent"),h(M,"isPromiseLike");var x=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),g=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(26276),S=Object.defineProperty,j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});S(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,z=r.forwardRef(C(function(e,t){return(0,E.jsx)(j.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},98123:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}}]); \ No newline at end of file diff --git a/pages/demo/_next/static/chunks/359-5e183b68b52b5075.js b/pages/demo/_next/static/chunks/359-5e183b68b52b5075.js new file mode 100644 index 00000000..b73670be --- /dev/null +++ b/pages/demo/_next/static/chunks/359-5e183b68b52b5075.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[359],{17286:(e,a,n)=>{n.d(a,{Rh:()=>x,Wh:()=>b});var t=n(26276),s=n(40688),i=n(48947),r=n(31935),l=n(64761),c=n(64206),o=n(46319),d=n(42812),u=n(88674);let h={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},p={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},m=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),g={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function x(e){let a=g[e.toLowerCase()];if(a)return a;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function f(e){let{tone:a,spinning:n}=e,h="size-3.5 shrink-0";if(n)return(0,t.jsx)(s.A,{className:(0,u.cn)(h,"animate-spin")});switch(a){case"success":return(0,t.jsx)(i.A,{className:h});case"danger":return(0,t.jsx)(r.A,{className:h});case"warning":return(0,t.jsx)(l.A,{className:h});case"info":return(0,t.jsx)(c.A,{className:(0,u.cn)(h,"fill-current")});default:return"neutral"===a?(0,t.jsx)(o.A,{className:h}):(0,t.jsx)(d.A,{className:h})}}function b(e){var a;let{status:n,label:s,tone:i,className:r}=e,l=null!=i?i:null!=(a=p[n.toLowerCase()])?a:"neutral",c=null!=s?s:x(n);return(0,t.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",h[l],r),children:[(0,t.jsx)(f,{tone:l,spinning:m.has(n.toLowerCase())}),(0,t.jsx)("span",{children:c})]})}},30902:(e,a,n)=>{n.d(a,{E:()=>c});var t=n(26276);n(29320);var s=n(18442),i=n(5820),r=n(88674);let l=(0,i.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function c(e){let{className:a,variant:n,asChild:i=!1,...c}=e,o=i?s.DX:"span";return(0,t.jsx)(o,{"data-slot":"badge",className:(0,r.cn)(l({variant:n}),a),...c})}},36337:(e,a,n)=>{n.d(a,{f:()=>l});var t=n(26276),s=n(47006),i=n(73062),r=n(22927);function l(e){let{value:a,className:n}=e,l=(0,r.cB)(3e4);return a?(0,t.jsxs)(s.m_,{children:[(0,t.jsx)(s.k$,{asChild:!0,children:(0,t.jsx)("span",{className:null!=n?n:"whitespace-nowrap",children:(0,i.fF)(a,l)})}),(0,t.jsx)(s.ZI,{children:(0,i.Yq)(a)})]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"-"})}},50565:(e,a,n)=>{n.d(a,{d:()=>r});var t=n(26276);n(29320);var s=n(63240),i=n(88674);function r(e){let{className:a,...n}=e;return(0,t.jsx)(s.bL,{"data-slot":"switch",className:(0,i.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",a),...n,children:(0,t.jsx)(s.zi,{"data-slot":"switch-thumb",className:(0,i.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,a,n)=>{n.d(a,{J:()=>o});var t=n(26276),s=n(29320),i=n(95774),r=n(5820),l=n(88674);let c=(0,r.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=s.forwardRef((e,a)=>{let{className:n,...s}=e;return(0,t.jsx)(i.b,{ref:a,className:(0,l.cn)(c(),n),...s})});o.displayName=i.b.displayName},74875:(e,a,n)=>{n.d(a,{D:()=>r});var t=n(26276),s=n(50985),i=n(88674);function r(e){let{label:a,htmlFor:n,help:r,error:l,optional:c,children:o,className:d}=e;return(0,t.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",d),children:[(0,t.jsxs)(s.J,{htmlFor:n,className:"text-sm font-medium",children:[a,c&&(0,t.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,l?(0,t.jsx)("p",{className:"text-destructive text-xs",children:l}):r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:r}):null]})}},80359:(e,a,n)=>{n.d(a,{L:()=>L,SnapshotsPage:()=>B});var t=n(26276),s=n(29320),i=n(91052),r=n.n(i),l=n(78113),c=n(78341),o=n(82932),d=n(71857),u=n(40688),h=n(34993),p=n(30902),m=n(47045),g=n(64573),x=n(81155),f=n(50985),b=n(35833),v=n(50565),j=n(47006),k=n(47353),y=n(62083),w=n(79181),N=n(12373),C=n(74875),S=n(21195),_=n(17286),A=n(36337),D=n(28971),R=n(73062),F=n(22927),T=n(7655);function $(e,a,n){let s=[{id:"id",header:"".concat(e.Snap," ID"),cell:e=>(0,t.jsx)("span",{className:"font-mono text-[13px] font-medium",children:e.id}),value:e=>e.id}];return a&&s.push({id:"source",header:"Source ".concat(e.noun),cell:e=>(0,t.jsx)(r(),{href:(0,T.YW)(e.kind,e.source_instance),onClick:e=>e.stopPropagation(),className:"text-primary font-mono text-[13px] hover:underline",children:e.source_instance}),value:e=>e.source_instance},{id:"engine",header:"Engine",cell:e=>(0,t.jsx)(T.Pk,{engine:e.engine,version:e.engine_version,engines:null==n?void 0:n.engines}),value:e=>"".concat(e.engine," ").concat(e.engine_version),hideBelow:"md"}),s.push({id:"type",header:"Type",cell:e=>(0,t.jsx)(p.E,{variant:"manual"===e.type?"outline":"secondary",children:"manual"===e.type?"Manual":"Automated"}),value:e=>e.type,hideBelow:"sm"},{id:"status",header:"Status",cell:e=>e.status_reason?(0,t.jsxs)(j.m_,{children:[(0,t.jsx)(j.k$,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(_.Wh,{status:e.status})})}),(0,t.jsx)(j.ZI,{className:"max-w-sm",children:e.status_reason})]}):(0,t.jsx)(_.Wh,{status:e.status}),value:e=>e.status},{id:"size",header:"Size",cell:e=>(0,R.z3)(e.size_bytes),value:e=>e.size_bytes,hideBelow:"sm"},{id:"created",header:"Created",cell:e=>(0,t.jsx)("span",{title:(0,R.Yq)(e.created_at),children:(0,t.jsx)(A.f,{value:e.created_at})}),value:e=>e.created_at,hideBelow:"md"}),s}function z(e){var a;let[n,i]=(0,s.useState)(null),[r,l]=(0,s.useState)(null),c=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{snapshot:n,onClose:()=>i(null)}),(0,t.jsx)(y.T,{open:!!r,onOpenChange:e=>!e&&l(null),title:"Delete ".concat(e.snap," ").concat(null!=(a=null==r?void 0:r.id)?a:"","?"),description:"The ".concat(e.snap," file is removed from disk. ").concat(e.Nouns," already restored from it are not affected."),confirmText:null==r?void 0:r.id,onConfirm:async()=>{r&&(await D.FH.del("".concat(T.$f,"/").concat((0,D.aJ)(r.id))),h.oR.success("Deleted ".concat(e.snap," ").concat(r.id)),await (0,F.Yi)(T.$f))}})]});return{restore:i,remove:l,dialogs:c}}function I(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a||(null!=e?e:[]).some(e=>"creating"===e.status)?2e3:15e3}function B(e){var a;let{family:n}=e,i=T.BU[n],l=(0,T.hT)(),{data:d,error:u,isLoading:h,isValidating:p,mutate:g}=(0,F.gf)(T.$f,{refreshInterval:e=>I(e)}),[x,f]=(0,s.useState)([]),[v,j]=(0,s.useState)("all"),y=z(i),C=(0,s.useMemo)(()=>(null!=d?d:[]).filter(e=>(0,T.WD)(i,e.kind)),[d,i]),_=(0,s.useMemo)(()=>"all"===v?C:C.filter(e=>e.type===v),[C,v]),A=(0,s.useMemo)(()=>$(i,!0,l.data),[i,l.data]),D=null!=(a=_.find(e=>x.includes(e.id)))?a:null,R=[{label:"Restore ".concat(i.snap),onSelect:()=>D&&y.restore(D),disabled:!D||"available"!==D.status},{separator:!0},{label:"Delete ".concat(i.snap),destructive:!0,onSelect:()=>D&&y.remove(D),disabled:!D||"creating"===D.status}];return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(S.z,{title:i.Snaps,description:"rds"===n?"Point-in-time dumps of your databases. Restore a snapshot to create a new database with the same engine, data and master credentials.":"Point-in-time RDB dumps of your Redis and Valkey clusters. Restore a backup to create a new cluster with the same data and auth token.",breadcrumbs:[{label:i.service,href:i.base},{label:i.Snaps}]}),(0,t.jsx)(w.b,{title:i.Snaps,data:d?_:void 0,columns:A,rowId:e=>e.id,loading:h,error:u,onRefresh:()=>g(),refreshing:p,selection:"single",selected:x,onSelectedChange:f,searchPlaceholder:"Find ".concat(i.snaps," by ID, source or engine"),defaultSort:{id:"created",desc:!0},actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.$,{items:R,disabled:!D}),(0,t.jsxs)(m.$,{size:"sm",disabled:!D||"available"!==D.status,onClick:()=>D&&y.restore(D),children:[(0,t.jsx)(c.A,{})," Restore"]})]}),filters:(0,t.jsxs)(b.l6,{value:v,onValueChange:j,children:[(0,t.jsx)(b.bq,{size:"sm",className:"h-8 w-40","aria-label":"Type filter",children:(0,t.jsx)(b.yv,{})}),(0,t.jsxs)(b.gC,{children:[(0,t.jsx)(b.eb,{value:"all",children:"All types"}),(0,t.jsx)(b.eb,{value:"manual",children:"Manual"}),(0,t.jsx)(b.eb,{value:"automated",children:"Automated"})]})]}),empty:C.length>0?(0,t.jsx)(N.p,{icon:o.A,title:"No ".concat(v," ").concat(i.snaps),action:(0,t.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>j("all"),children:"Show all"})}):(0,t.jsx)(N.p,{icon:o.A,title:"No ".concat(i.snaps),description:"Take a manual ".concat(i.snap," from a ").concat(i.noun,"'s ").concat(i.Snaps," tab. ").concat(i.Nouns," with a backup retention period also get a daily automated ").concat(i.snap,"."),action:(0,t.jsx)(m.$,{size:"sm",variant:"outline",asChild:!0,children:(0,t.jsxs)(r(),{href:i.base,children:["Go to ",i.nouns]})})})}),y.dialogs]})}function L(e){var a,n;let{cfg:i,inst:r}=e,[l,c]=(0,s.useState)(!1),[u,h]=(0,s.useState)(!1),{data:p,error:g,isLoading:x,isValidating:f,mutate:b}=(0,F.gf)(T.$f,{query:{instance:r.id},refreshInterval:e=>I(e,u)}),[v,j]=(0,s.useState)([]),y=z(i),C=(0,s.useMemo)(()=>$(i,!1,void 0),[i]),S=null!=(a=(null!=p?p:[]).find(e=>v.includes(e.id)))?a:null,_=[{label:"Restore ".concat(i.snap),onSelect:()=>S&&y.restore(S),disabled:!S||"available"!==S.status},{separator:!0},{label:"Delete ".concat(i.snap),destructive:!0,onSelect:()=>S&&y.remove(S),disabled:!S||"creating"===S.status}];return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(w.b,{title:i.Snaps,description:r.backup_retention_days>0?"Automated ".concat(i.snaps," run daily and are kept for ").concat(r.backup_retention_days," day").concat(1===r.backup_retention_days?"":"s",". Manual ").concat(i.snaps," are kept until you delete them."):"Automated ".concat(i.snaps," are off (retention 0 days). Manual ").concat(i.snaps," are kept until you delete them."),data:p,columns:C,rowId:e=>e.id,loading:x,error:g,onRefresh:()=>b(),refreshing:f,selection:"single",selected:v,onSelectedChange:j,noSearch:(null!=(n=null==p?void 0:p.length)?n:0)<6,defaultSort:{id:"created",desc:!0},actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.$,{items:_,disabled:!S}),(0,t.jsxs)(m.$,{size:"sm",onClick:()=>c(!0),disabled:"available"!==r.status,title:"available"!==r.status?"The ".concat(i.noun," must be available"):void 0,children:[(0,t.jsx)(d.A,{})," Take ",i.snap]})]}),empty:(0,t.jsx)(N.p,{icon:o.A,title:"No ".concat(i.snaps," yet"),description:"A ".concat(i.snap," captures the ").concat(i.noun,"'s data so you can restore it into a new ").concat(i.noun,"."),action:(0,t.jsxs)(m.$,{size:"sm",variant:"outline",onClick:()=>c(!0),disabled:"available"!==r.status,children:[(0,t.jsx)(d.A,{})," Take ",i.snap]})})}),(0,t.jsx)(E,{cfg:i,inst:l?r:null,onClose:()=>c(!1),onBusy:h}),y.dialogs]})}function E(e){var a,n;let{cfg:i,inst:r,onClose:l,onBusy:c}=e,[o,d]=(0,s.useState)(""),[p,f]=(0,s.useState)(),[b,v]=(0,s.useState)(!1);(0,s.useEffect)(()=>{r&&(d(""),f(void 0))},[r]);let j=async e=>{if(e.preventDefault(),!r)return;let a=o.trim(),n=a?(0,T.MQ)(a,"".concat(i.Snap," ID")):void 0;if(n)return void f(n);v(!0),c(!0);let t=setTimeout(()=>(0,F.Yi)(T.A4),400);try{let e=await D.FH.post("".concat(T.Ic,"/").concat((0,D.aJ)(r.id),"/snapshots"),a?{id:a}:{});h.oR.success("Created ".concat(i.snap," ").concat(e.id)),l()}catch(e){h.oR.error((0,D.gJ)(e))}finally{clearTimeout(t),v(!1),c(!1),await (0,F.Yi)(T.A4)}};return(0,t.jsx)(g.lG,{open:!!r,onOpenChange:e=>!e&&!b&&l(),children:(0,t.jsx)(g.Cf,{children:(0,t.jsxs)("form",{onSubmit:j,className:"flex flex-col gap-4",children:[(0,t.jsxs)(g.c7,{children:[(0,t.jsxs)(g.L3,{children:["Take ",i.snap]}),(0,t.jsxs)(g.rr,{children:["Dumps the ",i.noun,"'s data to a file on this host. The ",i.noun," shows ",(0,t.jsx)("em",{children:"Backing up"})," until the dump finishes; it stays online."]})]}),(0,t.jsx)(C.D,{label:"".concat(i.Snap," ID"),htmlFor:"snap-id",optional:!0,error:p,help:"Lowercase letters, digits and hyphens. Leave empty for ".concat(null!=(a=null==r?void 0:r.id)?a:"","--