diff --git a/cmd/hive/cmd/admin.go b/cmd/hive/cmd/admin.go index 7451ca80c..b095bdeb9 100644 --- a/cmd/hive/cmd/admin.go +++ b/cmd/hive/cmd/admin.go @@ -19,6 +19,7 @@ import ( "bytes" "context" _ "embed" + "encoding/base64" "encoding/json" "fmt" "io" @@ -31,9 +32,12 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" "github.com/mulgadc/hive/hive/admin" "github.com/mulgadc/hive/hive/config" "github.com/mulgadc/hive/hive/formation" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" "github.com/mulgadc/hive/hive/utils" "github.com/mulgadc/viperblock/viperblock" "github.com/mulgadc/viperblock/viperblock/backends/s3" @@ -128,6 +132,28 @@ var imagesListCmd = &cobra.Command{ Run: runimagesListCmd, } +var accountCmd = &cobra.Command{ + Use: "account", + Short: "Manage Hive accounts", + Long: `Create and manage Hive accounts. Each account namespaces IAM users, policies, and resources.`, +} + +var accountCreateCmd = &cobra.Command{ + Use: "create", + Short: "Create a new account with an admin user", + Long: `Create a new Hive account. This creates an account with a sequential 12-digit ID, +an admin user, and an AdministratorAccess policy attached to the admin user. +Requires the cluster to be running (connects to NATS).`, + Run: runAccountCreate, +} + +var accountListCmd = &cobra.Command{ + Use: "list", + Short: "List all accounts", + Long: `List all Hive accounts with their ID, name, status, and creation time.`, + Run: runAccountList, +} + /* CLI ideas @@ -162,6 +188,12 @@ func init() { imagesCmd.AddCommand(imagesImportCmd) imagesCmd.AddCommand(imagesListCmd) + adminCmd.AddCommand(accountCmd) + accountCmd.AddCommand(accountCreateCmd) + accountCmd.AddCommand(accountListCmd) + accountCreateCmd.Flags().String("name", "", "Account name (required)") + accountCreateCmd.MarkFlagRequired("name") + homeDir, _ := os.UserHomeDir() configDir := fmt.Sprintf("%s/hive/config", homeDir) hiveDir := fmt.Sprintf("%s/hive/", homeDir) @@ -421,8 +453,8 @@ func runimagesImportCmd(cmd *cobra.Command, args []string) { VolumeSize: utils.SafeInt64ToUint64(imageStat.Size()), Bucket: appConfig.Nodes[appConfig.Node].Predastore.Bucket, Region: appConfig.Nodes[appConfig.Node].Predastore.Region, - AccessKey: appConfig.Nodes[appConfig.Node].AccessKey, - SecretKey: appConfig.Nodes[appConfig.Node].SecretKey, + AccessKey: appConfig.Nodes[appConfig.Node].Predastore.AccessKey, + SecretKey: appConfig.Nodes[appConfig.Node].Predastore.SecretKey, Host: appConfig.Nodes[appConfig.Node].Predastore.Host, } @@ -565,11 +597,25 @@ func runAdminInit(cmd *cobra.Command, args []string) { secretKey := admin.GenerateAWSSecretKey() accountID := admin.GenerateAccountID() - fmt.Println("\nšŸ”‘ Generated AWS credentials:") + fmt.Println("\nšŸ”‘ Generated root credentials (save these — they won't be shown again):") fmt.Printf(" Access Key: %s\n", accessKey) fmt.Printf(" Secret Key: %s\n", secretKey) fmt.Printf(" Account ID: %s\n", accountID) + // Generate IAM master key (AES-256, used to encrypt secrets in NATS KV) + masterKey, err := handlers_iam.GenerateMasterKey() + if err != nil { + fmt.Fprintf(os.Stderr, "Error generating IAM master key: %v\n", err) + os.Exit(1) + } + if err := writeBootstrapFiles(configDir, masterKey, accessKey, secretKey, accountID); err != nil { + fmt.Fprintf(os.Stderr, "Error writing bootstrap files: %v\n", err) + os.Exit(1) + } + fmt.Println("\nšŸ” Generated IAM master key") + fmt.Printf(" Master key: %s\n", filepath.Join(configDir, "master.key")) + fmt.Printf(" Bootstrap: %s\n", filepath.Join(configDir, "bootstrap.json")) + // Generate SSL certificates (with bind IP in SANs for multi-node support) certPath := admin.GenerateCertificatesIfNeeded(configDir, force, bindIP) @@ -689,8 +735,7 @@ func runAdminInit(cmd *cobra.Command, args []string) { }) } - err := admin.GenerateConfigFiles(configs, configSettings) - if err != nil { + if err := admin.GenerateConfigFiles(configs, configSettings); err != nil { fmt.Fprintf(os.Stderr, "Error generating configuration files: %v\n", err) os.Exit(1) } @@ -734,6 +779,19 @@ func runAdminInitMultiNode(cmd *cobra.Command, accessKey, secretKey, accountID, os.Exit(1) } + // Generate IAM master key for the cluster + masterKey, err := handlers_iam.GenerateMasterKey() + if err != nil { + fmt.Fprintf(os.Stderr, "āŒ Error generating IAM master key: %v\n", err) + os.Exit(1) + } + if err := writeBootstrapFiles(configDir, masterKey, accessKey, secretKey, accountID); err != nil { + fmt.Fprintf(os.Stderr, "āŒ Error writing bootstrap files: %v\n", err) + os.Exit(1) + } + fmt.Println("\nšŸ” Generated IAM master key") + fmt.Printf(" Bootstrap: %s\n", filepath.Join(configDir, "bootstrap.json")) + // Read CA cert/key for distribution to joining nodes caCertData, err := os.ReadFile(filepath.Join(configDir, "ca.pem")) if err != nil { @@ -757,6 +815,9 @@ func runAdminInitMultiNode(cmd *cobra.Command, accessKey, secretKey, accountID, fs := formation.NewFormationServer(expectedNodes, creds, string(caCertData), string(caKeyData)) + // Include master key in formation server for distribution to joining nodes + fs.SetMasterKey(base64.StdEncoding.EncodeToString(masterKey)) + // Register self (init node) as the first node selfNode := formation.NodeInfo{ Name: node, @@ -1083,6 +1144,23 @@ func runAdminJoin(cmd *cobra.Command, args []string) { } fmt.Printf("āœ… CA certificate received from leader: %s\n", caCertPath) + // Extract and write master key from formation server + if statusResp.MasterKey == "" { + fmt.Fprintf(os.Stderr, "āŒ Error: formation server did not return master key\n") + os.Exit(1) + } + masterKeyBytes, err := base64.StdEncoding.DecodeString(statusResp.MasterKey) + if err != nil { + fmt.Fprintf(os.Stderr, "āŒ Error decoding master key: %v\n", err) + os.Exit(1) + } + if err := writeBootstrapFiles(configDir, masterKeyBytes, creds.AccessKey, creds.SecretKey, creds.AccountID); err != nil { + fmt.Fprintf(os.Stderr, "āŒ Error writing bootstrap files: %v\n", err) + os.Exit(1) + } + fmt.Println("āœ… IAM master key received from leader") + fmt.Printf("āœ… Bootstrap file written: %s\n", filepath.Join(configDir, "bootstrap.json")) + // Generate server cert signed by CA with this node's bind IP if err := admin.GenerateServerCertOnly(configDir, bindIP); err != nil { fmt.Fprintf(os.Stderr, "Error generating server certificate: %v\n", err) @@ -1223,3 +1301,178 @@ func buildRemoteNodes(allNodes map[string]formation.NodeInfo, localNode string) }) return remote } + +// initIAMServiceFromConfig loads config, connects to NATS, loads the master +// key, and returns an initialised IAMServiceImpl. Callers must defer nc.Close(). +func initIAMServiceFromConfig() (*handlers_iam.IAMServiceImpl, *config.ClusterConfig, func(), error) { + cfg, nc, err := loadConfigAndConnect() + if err != nil { + return nil, nil, nil, fmt.Errorf("connect to cluster: %w", err) + } + + masterKeyPath := filepath.Join(cfg.NodeBaseDir(), "config", "master.key") + masterKey, err := handlers_iam.LoadMasterKey(masterKeyPath) + if err != nil { + nc.Close() + return nil, nil, nil, fmt.Errorf("load master key: %w", err) + } + + svc, err := handlers_iam.NewIAMServiceImpl(nc, masterKey) + if err != nil { + nc.Close() + return nil, nil, nil, fmt.Errorf("init IAM service: %w", err) + } + + return svc, cfg, func() { nc.Close() }, nil +} + +// adminAccessPolicyDocument is the AdministratorAccess policy document that +// grants full access to all actions and resources. +const adminAccessPolicyDocument = `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}` + +func runAccountCreate(cmd *cobra.Command, args []string) { + name, _ := cmd.Flags().GetString("name") + + svc, cfg, cleanup, err := initIAMServiceFromConfig() + if err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } + defer cleanup() + + // 1. Create the account + account, err := svc.CreateAccount(name) + if err != nil { + fmt.Fprintf(os.Stderr, "Error creating account: %v\n", err) + os.Exit(1) + } + accountID := account.AccountID + + // 2. Create admin user + _, err = svc.CreateUser(accountID, &iam.CreateUserInput{ + UserName: aws.String("admin"), + }) + if err != nil { + fmt.Fprintf(os.Stderr, "Error creating admin user: %v\n", err) + os.Exit(1) + } + + // 3. Create access key for admin user + akOut, err := svc.CreateAccessKey(accountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("admin"), + }) + if err != nil { + fmt.Fprintf(os.Stderr, "Error creating access key: %v\n", err) + os.Exit(1) + } + + // 4. Create AdministratorAccess policy scoped to this account + policyARN := fmt.Sprintf("arn:aws:iam::%s:policy/AdministratorAccess", accountID) + _, err = svc.CreatePolicy(accountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("AdministratorAccess"), + PolicyDocument: aws.String(adminAccessPolicyDocument), + }) + if err != nil { + fmt.Fprintf(os.Stderr, "Error creating admin policy: %v\n", err) + os.Exit(1) + } + + // 5. Attach policy to admin user + _, err = svc.AttachUserPolicy(accountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("admin"), + PolicyArn: aws.String(policyARN), + }) + if err != nil { + fmt.Fprintf(os.Stderr, "Error attaching policy: %v\n", err) + os.Exit(1) + } + + // Configure AWS CLI profile automatically + profileName := "hive-" + strings.ToLower(strings.ReplaceAll(name, " ", "-")) + homeDir, _ := os.UserHomeDir() + + endpointHost := "localhost" + certPath := filepath.Join(cfg.NodeBaseDir(), "config", "ca.pem") + nodeConfig := cfg.Nodes[cfg.Node] + if h, _, err := net.SplitHostPort(nodeConfig.AWSGW.Host); err == nil { + if h != "" && h != "0.0.0.0" { + endpointHost = h + } + } + endpointURL := fmt.Sprintf("https://%s:9999", endpointHost) + + credPath := filepath.Join(homeDir, ".aws", "credentials") + configPath := filepath.Join(homeDir, ".aws", "config") + + if err := admin.UpdateAWSINIFile(credPath, profileName, map[string]string{ + "aws_access_key_id": *akOut.AccessKey.AccessKeyId, + "aws_secret_access_key": *akOut.AccessKey.SecretAccessKey, + }); err != nil { + fmt.Fprintf(os.Stderr, "Warning: could not update AWS credentials: %v\n", err) + } + if err := admin.UpdateAWSINIFile(configPath, "profile "+profileName, map[string]string{ + "region": "us-east-1", + "endpoint_url": endpointURL, + "ca_bundle": certPath, + "output": "json", + }); err != nil { + fmt.Fprintf(os.Stderr, "Warning: could not update AWS config: %v\n", err) + } + + // Print credentials + fmt.Println("\nAccount created successfully!") + fmt.Printf(" Account ID: %s\n", accountID) + fmt.Printf(" Account Name: %s\n", name) + fmt.Printf(" Admin User: admin\n") + fmt.Printf(" Access Key ID: %s\n", *akOut.AccessKey.AccessKeyId) + fmt.Printf(" Secret Access Key: %s\n", *akOut.AccessKey.SecretAccessKey) + fmt.Printf(" AWS Profile: %s\n", profileName) + fmt.Println("\nUse with:") + fmt.Printf(" AWS_PROFILE=%s aws ec2 describe-instances\n", profileName) +} + +func runAccountList(cmd *cobra.Command, args []string) { + svc, _, cleanup, err := initIAMServiceFromConfig() + if err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } + defer cleanup() + + accounts, err := svc.ListAccounts() + if err != nil { + fmt.Fprintf(os.Stderr, "Error listing accounts: %v\n", err) + os.Exit(1) + } + + if len(accounts) == 0 { + fmt.Println("No accounts found.") + return + } + + fmt.Printf("%-14s %-20s %-10s %s\n", "ACCOUNT ID", "NAME", "STATUS", "CREATED") + fmt.Printf("%-14s %-20s %-10s %s\n", "----------", "----", "------", "-------") + for _, a := range accounts { + created := a.CreatedAt + if t, err := time.Parse(time.RFC3339, a.CreatedAt); err == nil { + created = t.Format("2006-01-02 15:04") + } + fmt.Printf("%-14s %-20s %-10s %s\n", a.AccountID, a.AccountName, a.Status, created) + } +} + +func writeBootstrapFiles(configDir string, masterKey []byte, accessKey, secretKey, accountID string) error { + if err := handlers_iam.SaveMasterKey(filepath.Join(configDir, "master.key"), masterKey); err != nil { + return fmt.Errorf("saving master key: %w", err) + } + encryptedSecret, err := handlers_iam.EncryptSecret(secretKey, masterKey) + if err != nil { + return fmt.Errorf("encrypting root secret: %w", err) + } + return handlers_iam.SaveBootstrapData( + filepath.Join(configDir, "bootstrap.json"), + &handlers_iam.BootstrapData{ + AccessKeyID: accessKey, EncryptedSecret: encryptedSecret, AccountID: accountID, + }, + ) +} diff --git a/cmd/hive/cmd/get.go b/cmd/hive/cmd/get.go index 958f3eb28..5ab1267c3 100644 --- a/cmd/hive/cmd/get.go +++ b/cmd/hive/cmd/get.go @@ -19,6 +19,7 @@ import ( "encoding/json" "fmt" "os" + "path/filepath" "sort" "strings" "time" @@ -73,6 +74,13 @@ func loadConfigAndConnect() (*config.ClusterConfig, *nats.Conn, error) { return nil, nil, fmt.Errorf("failed to load config: %w", err) } + // Backfill BaseDir from config file path when not set in the config. + // Config lives at /config/hive.toml, so baseDir is two levels up. + if nodeConfig, ok := cfg.Nodes[cfg.Node]; ok && nodeConfig.BaseDir == "" { + nodeConfig.BaseDir = filepath.Dir(filepath.Dir(cfgPath)) + cfg.Nodes[cfg.Node] = nodeConfig + } + nodeConfig := cfg.Nodes[cfg.Node] nc, err := utils.ConnectNATS(nodeConfig.NATS.Host, nodeConfig.NATS.ACL.Token) if err != nil { diff --git a/cmd/hive/cmd/service.go b/cmd/hive/cmd/service.go index 58a944b32..4d464ae9e 100644 --- a/cmd/hive/cmd/service.go +++ b/cmd/hive/cmd/service.go @@ -530,7 +530,7 @@ var awsgwStartCmd = &cobra.Command{ baseDir := viper.GetString("base-dir") - if awsgwTlsKey != "" { + if baseDir != "" { fmt.Println("Overwriting awsgw base-dir to:", baseDir) nodeConfig.BaseDir = baseDir } diff --git a/cmd/hive/cmd/templates/awsgw.toml b/cmd/hive/cmd/templates/awsgw.toml index 49fc72226..7d96f2c9e 100644 --- a/cmd/hive/cmd/templates/awsgw.toml +++ b/cmd/hive/cmd/templates/awsgw.toml @@ -4,10 +4,3 @@ region = "{{.Region}}" # Enable verbose debugging debug = false - -[[auth]] -access_key_id = "{{.AccessKey}}" -secret_access_key = "{{.SecretKey}}" -policy = [ - { bucket = "predastore", actions = ["s3:ListBucket", "s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:ListAllMyBuckets"] }, -] diff --git a/cmd/hive/cmd/templates/hive.toml b/cmd/hive/cmd/templates/hive.toml index 8e4799701..6cbc27b24 100644 --- a/cmd/hive/cmd/templates/hive.toml +++ b/cmd/hive/cmd/templates/hive.toml @@ -13,8 +13,6 @@ services = [{{range $i, $s := .Services}}{{if $i}}, {{end}}"{{$s}}"{{end}}] {{- end}} account_id = "{{.AccountID}}" -accesskey = "{{.AccessKey}}" -secretkey = "{{.SecretKey}}" [nodes.{{.Node}}.daemon] host = "{{.BindIP}}:{{.Port}}" diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index a62468dea..c8c379c84 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -1,6 +1,82 @@ -# AWS Command Implementation Matrix +# Command Implementation Matrix -## EC2 - Instance Management +## Hive Admin CLI + +Platform management commands not exposed via the AWS gateway API. These are CLI-only commands. + +### Service Management + +Service lifecycle commands for starting, stopping, and checking status of all Hive cluster services. Each service subcommand supports `start`, `stop`, and `status` operations. + +| Command | Flags | Prerequisites | Basic Logic | Status | +|---------|-------|---------------|-------------|--------| +| `hive service predastore start` | `--port` (default: 8443), `--host` (default: 0.0.0.0), `--base-path`, `--config-path`, `--debug`, `--tls-cert`, `--tls-key`, `--backend` (distributed/filesystem, default: distributed), `--node-id` (default: 0), `--pprof`, `--pprof-output` | TLS cert/key, base-path, config-path required | Creates predastore service instance with S3-compatible storage backend → starts service | **DONE** | +| `hive service predastore stop` | — | Predastore must be running | Stops the predastore service | **DONE** | +| `hive service predastore status` | — | None | Reports predastore service status | **DONE** | +| `hive service viperblock start` | `--s3-host` (default: 0.0.0.0:8443), `--s3-bucket` (default: predastore), `--s3-region` (default: ap-southeast-2), `--plugin-path` (default: /opt/hive/lib/nbdkit-viperblock-plugin.so) | `--config` required, plugin-path must exist on disk | Loads cluster config → connects to NATS and Predastore → starts viperblock block storage service with NBD plugin | **DONE** | +| `hive service viperblock stop` | — | Viperblock must be running | Stops the viperblock service | **DONE** | +| `hive service viperblock status` | — | None | Reports viperblock service status | **DONE** | +| `hive service nats start` | `--port` (default: 4222), `--host` (default: 0.0.0.0), `--debug`, `--data-dir`, `--jetstream` | None | Starts embedded NATS server with optional JetStream | **DONE** | +| `hive service nats stop` | — | NATS must be running | Stops the NATS service | **DONE** | +| `hive service nats status` | — | None | Reports NATS service status | **DONE** | +| `hive service hive start` | `--wal-dir` | `--config` required | Loads cluster config → starts hive daemon (VM orchestration, NATS subscriptions, health endpoint) | **DONE** | +| `hive service hive stop` | — | Hive daemon must be running | Stops the hive daemon service | **DONE** | +| `hive service hive status` | — | None | Reports hive daemon service status | **DONE** | +| `hive service awsgw start` | `--host` (default: 0.0.0.0:9999), `--tls-cert`, `--tls-key`, `--debug` | `--config` required | Loads cluster config → starts AWS-compatible gateway with SigV4 auth, IAM policy enforcement, TLS | **DONE** | +| `hive service awsgw stop` | — | AWS gateway must be running | Stops the AWS gateway service | **DONE** | +| `hive service awsgw status` | — | None | Reports AWS gateway service status | **DONE** | +| `hive service hive-ui start` | `--port` (default: 3000), `--host` (default: 0.0.0.0), `--tls-cert`, `--tls-key` | None | Starts embedded web UI server serving the React frontend. Aliases: `ui`, `hiveui` | **DONE** | +| `hive service hive-ui stop` | — | hive-ui must be running | Stops the hive-ui service | **DONE** | +| `hive service hive-ui status` | — | None | Reports hive-ui service status | **DONE** | +| `hive service vpcd start` | — | `--config` required, OVN/OVS installed | Loads cluster config → starts VPC daemon (subscribes to `vpc.*` NATS events, translates to OVN logical switches/ports/routers) | **DONE** | +| `hive service vpcd stop` | — | vpcd must be running | Stops the vpcd service | **DONE** | +| `hive service vpcd status` | — | None | Reports vpcd service status | **DONE** | + +### Cluster Inspection + +Operational commands for inspecting cluster state. These fan out NATS requests to all nodes and aggregate responses. + +| Command | Flags | Prerequisites | Basic Logic | Output Columns | Status | +|---------|-------|---------------|-------------|----------------|--------| +| `hive get nodes` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Loads config → publishes to `hive.node.status` fan-out topic → collects responses within timeout → merges config-known nodes with NATS responders → nodes that don't respond shown as `NotReady` | NAME, STATUS, IP, REGION, AZ, UPTIME, VMs, SERVICES | **DONE** | +| `hive get vms` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Publishes to `hive.node.vms` fan-out topic → collects VM info from all nodes → sorts by node then instance ID → prints table. Alias: `hive get instances` | INSTANCE, STATUS, TYPE, VCPU, MEM, NODE, IP, AGE | **DONE** | + +### Resource Monitoring + +| Command | Flags | Prerequisites | Basic Logic | Output | Status | +|---------|-------|---------------|-------------|--------|--------| +| `hive top nodes` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Publishes to `hive.node.status` fan-out topic → collects CPU/memory usage per node → aggregates instance type capacity across all nodes → prints two tables: per-node resource usage and cluster-wide instance type availability | Table 1: NAME, CPU (used/total), MEM (used/total), VMs. Table 2: INSTANCE TYPE, AVAILABLE, VCPU, MEMORY | **DONE** | + +### Cluster Initialization + +| Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------|---------------|-------------|------------|--------| +| `hive admin init` | `--nodes`, `--node`, `--bind`, `--port`, `--region`, `--az`, `--cluster-name`, `--cluster-bind`, `--cluster-routes`, `--predastore-nodes`, `--services`, `--formation-timeout`, `--force` | None (first-time setup) | Generates root IAM credentials (AKIA-prefixed access key + secret) → creates master.key (AES-256, 32 bytes, 0600) → writes bootstrap.json (consumed on first start) → generates CA + server TLS certificates → creates NATS config with auth token → writes hive.toml, awsgw.toml, predastore.toml → configures AWS CLI `hive` profile → creates directory structure under `~/hive/` | 1. Init creates all config files
2. Root credentials printed once
3. master.key is 32 bytes, mode 0600
4. bootstrap.json consumed on first start
5. `--force` re-initializes existing config
6. AWS CLI profile `hive` auto-configured | **DONE** | +| `hive admin join` | `--host` (required), `--node` (required), `--bind`, `--port`, `--region`, `--az`, `--cluster-bind`, `--cluster-routes`, `--data-dir`, `--services` | Leader node must be running | Connects to leader node → retrieves cluster configuration → configures local node to join cluster and participate in distributed operations | 1. Join existing cluster
2. Missing host (error)
3. Missing node name (error) | **DONE** | + +### Cluster Operations + +| Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------|---------------|-------------|------------|--------| +| `hive admin cluster shutdown` | — | Cluster must be running | Gracefully shuts down the entire cluster | 1. Shutdown running cluster
2. All nodes stop cleanly | **DONE** | + +### Account Management + +| Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------|---------------|-------------|------------|--------| +| `hive admin account create` | `--name` | Cluster must be running (NATS), master key must exist | Connects to NATS → CAS loop on `hive-account-counter:next_id` for sequential 12-digit ID → creates Account record in `hive-accounts` KV → creates `admin` user in new account → creates access key for admin → creates AdministratorAccess policy (Action:*, Resource:*) → attaches policy → prints credentials | 1. Create first account (ID 000000000001)
2. Sequential IDs (000000000002, etc.)
3. Admin user has full access
4. Credentials printed once | **DONE** | +| `hive admin account list` | — | Cluster must be running (NATS), master key must exist | Connects to NATS → IAMService.ListAccounts() → prints table with Account ID, Name, Status, Created | 1. List all accounts
2. Empty list (only global account) | **DONE** | + +### Image Management + +| Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------|---------------|-------------|------------|--------| +| `hive admin images import` | `--name` | Cluster must be running, image file must exist locally | Imports a local disk image (QCOW2) as an AMI → uploads to Predastore S3 → registers as available AMI | 1. Import valid QCOW2 image
2. Image appears in `describe-images` | **DONE** | +| `hive admin images list` | — | None | Lists available OS images that can be imported or downloaded | 1. List available images | **DONE** | + +## AWS Commands + +### EC2 - Instance Management | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -16,7 +92,7 @@ | `monitor-instances` | — | `--instance-ids` | Instance must exist | Enable basic monitoring (CPU, disk, network) → store metrics in NATS KV → return monitoring state | 1. Enable monitoring
2. Verify monitoring state in describe-instances | **NOT STARTED** | | `unmonitor-instances` | — | `--instance-ids` | Instance must exist | Disable detailed monitoring → revert to basic monitoring → return monitoring state | 1. Disable monitoring
2. Verify monitoring state reverts in describe-instances | **NOT STARTED** | -## EC2 - Key Pair Management +### EC2 - Key Pair Management | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -25,7 +101,7 @@ | `delete-key-pair` | `--key-name`, `--key-pair-id` | `--dry-run` | Key must exist | NATS `ec2.DeleteKeyPair` → daemon deletes public key from Predastore S3 → returns success | 1. Delete existing key pair
2. Delete non-existent key (idempotent, no error)
3. Verify key no longer in describe-key-pairs | **DONE** | | `import-key-pair` | `--key-name`, `--public-key-material` | `--tag-specifications`, `--dry-run` | None | NATS `ec2.ImportKeyPair` → daemon stores provided public key in Predastore S3 → returns key name and fingerprint | 1. Import valid SSH public key
2. Import invalid key material (error)
3. Import duplicate name (error)
4. Verify imported key usable with run-instances | **DONE** | -## EC2 - AMI Image Management +### EC2 - AMI Image Management | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -39,7 +115,7 @@ | `modify-image-attribute` | — | `--image-id`, `--launch-permission`, `--description`, `--operation-type`, `--user-ids`, `--user-groups`, `--organization-arns`, `--dry-run` | AMI must exist | Update specific attribute in AMI metadata → persist to S3 | 1. Add launch permission
2. Modify description
3. Invalid AMI (error) | **NOT STARTED** | | `reset-image-attribute` | — | `--image-id`, `--attribute`, `--dry-run` | AMI must exist | Reset attribute to default value in AMI metadata | 1. Reset launch permission to owner-only
2. Invalid AMI (error) | **NOT STARTED** | -## EC2 - Volume (EBS) Management +### EC2 - Volume (EBS) Management | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -52,7 +128,7 @@ | `describe-volume-status` | `--volume-ids` | `--filters`, `--max-results`, `--next-token`, `--dry-run` | None | Gateway validates vol- prefix → NATS `ec2.DescribeVolumeStatus` → daemon fetches VolumeConfig from Predastore S3 (parallel for specific IDs, sequential list-all for no IDs) → builds VolumeStatusItem per volume (status=ok, io-enabled=passed, io-performance=not-applicable) → returns InvalidVolume.NotFound for missing explicit IDs → skips internal sub-volumes (-efi, -cloudinit) | 1. List all volume statuses
2. Filter by specific volume IDs (fast path)
3. Non-existent volume ID returns InvalidVolume.NotFound
4. Invalid volume ID format (InvalidVolume.Malformed)
5. Internal sub-volumes excluded from listing
6. Nil/empty input defaults to all volumes | **DONE** | | `describe-volumes-modifications` | — | `--volume-ids`, `--filters`, `--max-results` | None | Query pending/completed volume modifications → return modification state, progress, original/target size | 1. Check in-progress modification
2. Check completed modification
3. No modifications returns empty | **NOT STARTED** | -## EC2 - Snapshot Management +### EC2 - Snapshot Management | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -62,7 +138,7 @@ | `describe-snapshots` | `--snapshot-ids` | `--owner-ids`, `--filters`, `--max-results`, `--dry-run` | None | Gateway validates snap- prefix on IDs → NATS `ec2.DescribeSnapshots` → daemon lists snap- prefixed objects in Predastore → reads SnapshotConfig for each → filters by snapshot ID if specified → returns snapshot list | 1. List all snapshots
2. Filter by snapshot ID
3. Empty snapshot list
4. Invalid snapshot ID format (InvalidSnapshot.Malformed) | **DONE** | | `copy-snapshot` | `--source-snapshot-id`, `--source-region`, `--description` | `--encrypted`, `--dry-run` | Source snapshot must exist | Gateway validates snap- prefix + source region → NATS `ec2.CopySnapshot` → daemon reads source SnapshotConfig → generates new snap-ID → copies metadata (preserves tags, description override) → stores as completed → returns new snapshot ID | 1. Copy within same region
2. Copy non-existent snapshot (InvalidSnapshot.NotFound)
3. Missing source ID (InvalidParameterValue)
4. Missing source region (MissingParameter)
5. Copy preserves tags
6. Copy with description override | **DONE** | -## EC2 - Tags +### EC2 - Tags | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -70,20 +146,20 @@ | `delete-tags` | `--resources`, `--tags` | `--dry-run` | None | Gateway validates input (resources non-empty) → NATS `ec2.DeleteTags` → daemon removes specified tag keys from resource JSON, or all tags if no keys specified → return success | 1. Delete specific tag by key
2. Delete all tags (no tags specified)
3. Empty resources list (error: MissingParameter) | **DONE** | | `describe-tags` | `--filters` (resource-id, resource-type, key, value) | `--max-results`, `--next-token`, `--dry-run` | None | NATS `ec2.DescribeTags` → daemon lists all `tags/*.json` from Predastore S3 → applies filters (resource-id, resource-type, key, value) → returns tag list with resource type auto-detected from ID prefix | 1. List all tags
2. Filter by resource-id
3. Filter by resource-type (instance, volume, image, snapshot, vpc, subnet, security-group, route-table, internet-gateway, egress-only-internet-gateway)
4. Filter by key
5. Filter by value
6. Empty result when no tags exist | **DONE** | -## EC2 - Regions & Availability Zones +### EC2 - Regions & Availability Zones | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| | `describe-regions` | *(returns configured region, endpoint, opt-in status from config — input params ignored)* | `--region-names`, `--filters`, `--all-regions`, `--dry-run` | None | Return configured region from hive init config with Endpoint and OptInStatus → local-only response, no NATS | 1. List all regions
2. Filter by region name
3. Verify endpoint URL returned
4. Verify OptInStatus returned | **DONE** | | `describe-availability-zones` | *(returns configured AZ, region, zone ID, state, opt-in status from config — input params ignored)* | `--zone-names`, `--filters`, `--all-availability-zones` | None | Return configured AZ from hive init config with zone ID, state, group name, network border group → local-only response, no NATS | 1. List all AZs
2. Filter by zone name
3. Verify zone state is available
4. Verify region name matches config | **DONE** | -## EC2 - Account Attributes +### EC2 - Account Attributes | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| | `describe-account-attributes` | `--attribute-names` | `--dry-run` | None | Gateway parses input → returns static account attributes: supported-platforms=VPC, default-vpc=none, max-instances=100, vpc-max-security-groups-per-interface=5, max-elastic-ips=5, vpc-max-elastic-ips=20 → local-only response, no NATS | 1. List all account attributes
2. Filter by attribute name
3. Verify all 6 attributes returned with correct values | **DONE** | -## EC2 - Account Settings (Deferred) +### EC2 - Account Settings (Deferred) Persistence layer works (NATS JetStream KV), but stored values are not yet enforced by downstream services. Will be completed post-merge. @@ -104,15 +180,17 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `modify-instance-metadata-defaults` | — | `--http-tokens`, `--http-put-response-hop-limit`, `--http-endpoint`, `--instance-metadata-tags` | None | Store instance metadata defaults in JetStream KV | 1. Set httpTokens=required
2. Set hop limit | **NOT STARTED** (enforcement pending) | | `get-instance-metadata-defaults` | — | `--dry-run` | None | Read instance metadata defaults from JetStream KV | 1. Get current defaults | **NOT STARTED** (enforcement pending) | -## EC2 - Egress-Only Internet Gateway +### EC2 - Egress-Only Internet Gateway + +Gateway routing and KV CRUD are wired up but no OVN/OVS integration exists. EIGWs are stored in `hive-eigw` KV bucket but have no effect on network topology (no vpcd events published, unlike IGW which publishes `vpc.igw-attach`/`vpc.igw-detach`). | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-egress-only-internet-gateway` | — | `--vpc-id`, `--client-token`, `--tag-specifications`, `--dry-run` | VPC must exist | NATS `ec2.CreateEgressOnlyInternetGateway` → daemon generates eigw-ID → creates record in NATS JetStream KV with state=attached → returns EgressOnlyInternetGateway with attachment | 1. Create with valid VpcId
2. Missing VpcId (error: MissingParameter)
3. Create with inline tags
4. Verify ID format eigw-{16hex} | **NOT STARTED** | -| `delete-egress-only-internet-gateway` | — | `--egress-only-internet-gateway-id`, `--dry-run` | EIGW must exist | NATS `ec2.DeleteEgressOnlyInternetGateway` → daemon verifies EIGW exists in KV → deletes from KV → returns ReturnCode=true | 1. Delete existing EIGW
2. Delete non-existent EIGW (error)
3. Missing ID (error: MissingParameter) | **NOT STARTED** | -| `describe-egress-only-internet-gateways` | — | `--egress-only-internet-gateway-ids`, `--filters`, `--max-results`, `--next-token`, `--dry-run` | None | NATS `ec2.DescribeEgressOnlyInternetGateways` → daemon lists all keys from KV bucket → filters by ID if specified → returns list | 1. Describe all EIGWs
2. Filter by specific ID
3. Non-existent ID returns empty list | **NOT STARTED** | +| `create-egress-only-internet-gateway` | `--vpc-id`, `--tag-specifications` | `--client-token`, `--dry-run` | VPC must exist | Gateway validates VpcId → NATS `ec2.CreateEgressOnlyInternetGateway` → daemon generates eigw-ID → creates EgressOnlyIGWRecord in `hive-eigw` KV bucket with state=attached (always attached at creation, unlike IGW) → returns EgressOnlyInternetGateway with attachment | 1. Create with valid VpcId
2. Missing VpcId (error: MissingParameter)
3. Create with inline tags
4. Verify ID format eigw-{16hex} | **STARTED** (KV only, no OVN) | +| `delete-egress-only-internet-gateway` | `--egress-only-internet-gateway-id` | `--dry-run` | EIGW must exist | NATS `ec2.DeleteEgressOnlyInternetGateway` → daemon verifies EIGW exists in KV → deletes from `hive-eigw` KV → returns ReturnCode=true. No detach required (unlike IGW). | 1. Delete existing EIGW
2. Delete non-existent EIGW (error)
3. Missing ID (error: MissingParameter) | **STARTED** (KV only, no OVN) | +| `describe-egress-only-internet-gateways` | `--egress-only-internet-gateway-ids` | `--filters`, `--max-results`, `--next-token`, `--dry-run` | None | NATS `ec2.DescribeEgressOnlyInternetGateways` → daemon lists all keys from `hive-eigw` KV bucket → filters by ID if specified → always includes Attachments array → returns list | 1. Describe all EIGWs
2. Filter by specific ID
3. Non-existent ID returns empty list | **STARTED** (KV only, no OVN) | -## EC2 - Placement Groups +### EC2 - Placement Groups | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -120,7 +198,7 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `delete-placement-group` | — | `--group-name`, `--dry-run` | Group must exist, no instances in group | NATS `ec2.DeletePlacementGroup` → daemon verifies group exists and is empty → delete from KV → return success | 1. Delete empty group
2. Delete group with instances (error)
3. Delete non-existent group (error) | **NOT STARTED** | | `describe-placement-groups` | — | `--group-names`, `--group-ids`, `--filters` | None | NATS `ec2.DescribePlacementGroups` → daemon lists groups from KV → return list with strategy and state | 1. List all groups
2. Filter by name
3. Filter by strategy | **NOT STARTED** | -## EC2 - Dedicated Hosts +### EC2 - Dedicated Hosts | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -128,7 +206,7 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `describe-hosts` | — | `--host-ids`, `--filters`, `--max-results` | None | NATS `ec2.DescribeHosts` → daemon lists hosts from KV → return host list with capacity and instance info | 1. List all hosts
2. Filter by host ID
3. Filter by instance type | **NOT STARTED** | | `release-hosts` | — | `--host-ids` | Host must exist, no running instances | NATS `ec2.ReleaseHosts` → daemon verifies no instances on host → delete from KV → return success/failure per host | 1. Release empty host
2. Release host with instances (error)
3. Release non-existent host (error) | **NOT STARTED** | -## EC2 - IPv4 Pools +### EC2 - IPv4 Pools | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -136,7 +214,7 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `delete-public-ipv4-pool` | — | `--pool-id`, `--dry-run` | Pool must exist and be empty | NATS `ec2.DeletePublicIpv4Pool` → daemon verifies pool empty → delete from KV → return success | 1. Delete empty pool
2. Delete pool with addresses (error) | **NOT STARTED** | | `describe-public-ipv4-pools` | — | `--pool-ids`, `--filters`, `--max-results` | None | NATS `ec2.DescribePublicIpv4Pools` → daemon lists pools from KV → return pool list with address counts | 1. List all pools
2. Filter by pool ID | **NOT STARTED** | -## EC2 - DHCP Options +### EC2 - DHCP Options | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -145,7 +223,7 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `describe-dhcp-options` | — | `--dhcp-options-ids`, `--filters`, `--max-results` | None | NATS `ec2.DescribeDhcpOptions` → daemon lists DHCP options from KV → return list with configurations | 1. List all DHCP options
2. Filter by ID | **NOT STARTED** | | `associate-dhcp-options` | — | `--dhcp-options-id`, `--vpc-id`, `--dry-run` | DHCP options and VPC must exist | NATS `ec2.AssociateDhcpOptions` → daemon links DHCP options to VPC → update VPC metadata → return success | 1. Associate with VPC
2. Missing DHCP options ID (error)
3. Missing VPC ID (error) | **NOT STARTED** | -## EC2 - Capacity Reservations +### EC2 - Capacity Reservations | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -154,7 +232,7 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `describe-capacity-reservations` | — | `--capacity-reservation-ids`, `--filters`, `--max-results` | None | NATS `ec2.DescribeCapacityReservations` → daemon lists reservations from KV → return list with state and counts | 1. List all reservations
2. Filter by ID
3. Filter by instance type | **NOT STARTED** | | `modify-capacity-reservation` | — | `--capacity-reservation-id`, `--instance-count`, `--end-date`, `--end-date-type` | Reservation must exist | NATS `ec2.ModifyCapacityReservation` → daemon updates reservation in KV → return success | 1. Modify instance count
2. Modify end date
3. Missing reservation ID (error) | **NOT STARTED** | -## EC2 - Elastic IP +### EC2 - Elastic IP | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -164,7 +242,7 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `disassociate-address` | — | `--association-id`, `--dry-run` | Association must exist | NATS `ec2.DisassociateAddress` → daemon unlinks EIP from instance/ENI → remove OVS DNAT/SNAT rules → return success | 1. Disassociate existing
2. Disassociate non-existent (error) | **NOT STARTED** | | `describe-addresses` | — | `--allocation-ids`, `--filters`, `--public-ips` | None | NATS `ec2.DescribeAddresses` → daemon lists EIPs from KV → return list with association info | 1. List all EIPs
2. Filter by allocation ID
3. Filter by public IP | **NOT STARTED** | -## EC2 - NAT Gateway +### EC2 - NAT Gateway | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -174,21 +252,21 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | `assign-private-nat-gateway-address` | — | `--nat-gateway-id`, `--private-ip-addresses` | NAT gateway must exist (private type) | NATS `ec2.AssignPrivateNatGatewayAddress` → daemon assigns private IPs to NAT gateway → return assigned addresses | 1. Assign address
2. Missing NAT gateway ID (error) | **NOT STARTED** | | `associate-nat-gateway-address` | — | `--nat-gateway-id`, `--allocation-ids` | NAT gateway and EIPs must exist | NATS `ec2.AssociateNatGatewayAddress` → daemon associates EIPs with NAT gateway → return association info | 1. Associate EIP
2. Missing NAT gateway ID (error) | **NOT STARTED** | -## EC2 - VPC Networking (Core) +### EC2 - VPC Networking (Core) -Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Single AZ for Hive v1. +Requires OVN/OVS (`apt install openvswitch-switch ovn-host`). VPC/Subnet/ENI CRUD stores metadata in NATS KV and publishes events to vpcd (the network topology daemon) which translates to OVN logical switches, ports, and routers. Single AZ for Hive v1. IPAM uses CAS-based allocation from NATS KV (`hive-vpc-ipam` bucket). | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-vpc` | — | `--cidr-block`, `--tag-specifications`, `--instance-tenancy` | None | Create OVS bridge for VPC → assign vpc-ID → store VPC metadata in NATS KV → configure CIDR range → return VPC with state=available | 1. Create VPC with /16 CIDR
2. Overlapping CIDR (error)
3. Invalid CIDR format (error)
4. Verify in describe-vpcs | **NOT STARTED** | -| `delete-vpc` | — | `--vpc-id` | VPC must be empty (no subnets, gateways, instances) | Verify no dependent resources → delete OVS bridge → remove metadata → return success | 1. Delete empty VPC
2. Delete VPC with subnets (error: DependencyViolation)
3. Delete non-existent VPC (error) | **NOT STARTED** | -| `describe-vpcs` | — | `--vpc-ids`, `--filters`, `--max-results` | None | Query NATS KV for VPC metadata → return VPC list with CIDR, state, tags | 1. List all VPCs
2. Filter by VPC ID
3. Filter by CIDR block | **NOT STARTED** | +| `create-vpc` | `--cidr-block`, `--tag-specifications` | `--instance-tenancy`, `--dry-run` | None | Gateway validates CidrBlock (required, valid CIDR, /16–/28 prefix) → NATS `ec2.CreateVpc` → daemon allocates unique VNI from `hive-vpc-vni-counter` KV → generates vpc-ID → stores VPCRecord in `hive-vpc-vpcs` KV → publishes `vpc.create` event to vpcd (creates OVN logical switch) → returns VPC with state=available | 1. Create VPC with /16 CIDR
2. Invalid CIDR format (error: InvalidVpcRange)
3. CIDR prefix outside /16–/28 (error)
4. Verify in describe-vpcs
5. Tags applied at creation | **DONE** | +| `delete-vpc` | `--vpc-id` | `--dry-run` | VPC must be empty (no subnets) | Gateway validates VpcId → NATS `ec2.DeleteVpc` → daemon checks for dependent subnets in `hive-vpc-subnets` KV → returns DependencyViolation if subnets exist → deletes from `hive-vpc-vpcs` KV → publishes `vpc.delete` event to vpcd (removes OVN resources) | 1. Delete empty VPC
2. Delete VPC with subnets (DependencyViolation)
3. Delete non-existent VPC (error) | **DONE** | +| `describe-vpcs` | `--vpc-ids` | `--filters`, `--max-results`, `--dry-run` | None | NATS `ec2.DescribeVpcs` → daemon lists all keys from `hive-vpc-vpcs` KV → filters by VPC IDs if specified → returns error for non-existent requested IDs → returns VPC list with CIDR, state, CIDR associations | 1. List all VPCs
2. Filter by VPC ID
3. Non-existent VPC ID returns error | **DONE** | | `modify-vpc-attribute` | — | `--vpc-id`, `--enable-dns-support`, `--enable-dns-hostnames` | VPC must exist | NATS `ec2.ModifyVpcAttribute` → daemon updates VPC attribute in KV → return success | 1. Enable DNS support
2. Enable DNS hostnames
3. Missing VPC ID (error) | **NOT STARTED** | | `associate-vpc-cidr-block` | — | `--vpc-id`, `--cidr-block` | VPC must exist | NATS `ec2.AssociateVpcCidrBlock` → daemon adds secondary CIDR to VPC metadata → return association | 1. Add secondary CIDR
2. Overlapping CIDR (error)
3. Max CIDR blocks exceeded (error) | **NOT STARTED** | | `disassociate-vpc-cidr-block` | — | `--association-id` | Association must exist | NATS `ec2.DisassociateVpcCidrBlock` → daemon removes secondary CIDR from VPC → return success | 1. Remove secondary CIDR
2. Remove primary CIDR (error) | **NOT STARTED** | -| `create-subnet` | — | `--vpc-id`, `--cidr-block`, `--availability-zone`, `--tag-specifications` | VPC must exist | Validate CIDR within VPC range → create OVS port group with VLAN tag → assign subnet-ID → store metadata | 1. Create subnet within VPC CIDR
2. Subnet CIDR outside VPC range (error)
3. Overlapping subnet CIDRs (error) | **NOT STARTED** | -| `delete-subnet` | — | `--subnet-id` | Subnet must be empty (no instances) | Verify no instances in subnet → remove OVS port group → delete metadata | 1. Delete empty subnet
2. Delete subnet with instances (error) | **NOT STARTED** | -| `describe-subnets` | — | `--subnet-ids`, `--filters`, `--max-results` | None | Query NATS KV for subnet metadata → return subnet list | 1. List all subnets
2. Filter by VPC ID
3. Filter by AZ | **NOT STARTED** | +| `create-subnet` | `--vpc-id`, `--cidr-block`, `--availability-zone`, `--tag-specifications` | `--dry-run` | VPC must exist | Gateway validates VpcId + CidrBlock (required, valid CIDR, /16–/28 prefix) → NATS `ec2.CreateSubnet` → daemon verifies parent VPC exists → validates subnet CIDR is within VPC CIDR range → checks for overlapping subnets in same VPC → calculates available IPs (total hosts - 5 AWS-reserved: .0/.1/.2/.3/.255) → generates subnet-ID → stores SubnetRecord in `hive-vpc-subnets` KV → publishes `vpc.create-subnet` event to vpcd → defaults AZ from config if omitted | 1. Create subnet within VPC CIDR
2. Subnet CIDR outside VPC range (error: InvalidSubnetRange)
3. Overlapping subnet CIDRs (error: InvalidSubnetConflict)
4. CIDR prefix outside /16–/28 (error)
5. Missing VPC or CIDR (error: MissingParameter) | **DONE** | +| `delete-subnet` | `--subnet-id` | `--dry-run` | Subnet must exist | NATS `ec2.DeleteSubnet` → daemon verifies subnet exists → deletes from `hive-vpc-subnets` KV → publishes `vpc.delete-subnet` event to vpcd | 1. Delete existing subnet
2. Delete non-existent subnet (error) | **DONE** | +| `describe-subnets` | `--subnet-ids`, `--filters` (vpc-id) | `--max-results`, `--dry-run` | None | NATS `ec2.DescribeSubnets` → daemon lists all keys from `hive-vpc-subnets` KV → applies vpc-id filter if present → filters by subnet IDs if specified → recalculates available IPs from CIDR → returns error for non-existent requested IDs | 1. List all subnets
2. Filter by VPC ID
3. Filter by subnet ID
4. Non-existent subnet returns error | **DONE** | | `modify-subnet-attribute` | — | `--subnet-id`, `--map-public-ip-on-launch`, `--assign-ipv6-address-on-creation` | Subnet must exist | NATS `ec2.ModifySubnetAttribute` → daemon updates subnet attribute in KV → return success | 1. Enable auto-assign public IP
2. Missing subnet ID (error) | **NOT STARTED** | | `associate-subnet-cidr-block` | — | `--subnet-id`, `--ipv6-cidr-block` | Subnet must exist | NATS `ec2.AssociateSubnetCidrBlock` → daemon adds IPv6 CIDR to subnet → return association | 1. Add IPv6 CIDR
2. Missing subnet ID (error) | **NOT STARTED** | | `disassociate-subnet-cidr-block` | — | `--association-id` | Association must exist | NATS `ec2.DisassociateSubnetCidrBlock` → daemon removes IPv6 CIDR from subnet → return success | 1. Remove IPv6 CIDR
2. Invalid association (error) | **NOT STARTED** | @@ -199,13 +277,13 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `authorize-security-group-egress` | — | `--group-id`, `--protocol`, `--port`, `--cidr` | SG must exist | Add outbound rule → create OVS OpenFlow rule → persist to metadata | 1. Allow HTTPS outbound
2. Restrict to specific CIDR | **NOT STARTED** | | `revoke-security-group-ingress` | — | `--group-id`, `--protocol`, `--port`, `--cidr` | SG must exist, rule must exist | Remove inbound rule → delete OVS OpenFlow rule → update metadata | 1. Revoke existing rule
2. Revoke non-existent rule (error) | **NOT STARTED** | | `revoke-security-group-egress` | — | `--group-id`, `--protocol`, `--port`, `--cidr` | SG must exist, rule must exist | Remove outbound rule → delete OVS OpenFlow rule → update metadata | 1. Revoke existing rule
2. Revoke non-existent rule (error) | **NOT STARTED** | -| `create-internet-gateway` | — | `--tag-specifications` | None | Create IGW metadata → assign igw-ID → configure OVS NAT bridge for external access | 1. Create IGW
2. Verify in describe-internet-gateways | **NOT STARTED** | -| `attach-internet-gateway` | — | `--internet-gateway-id`, `--vpc-id` | IGW and VPC must exist | Link IGW to VPC → configure OVS flows for internet routing → update metadata | 1. Attach IGW to VPC
2. Attach already-attached IGW (error)
3. Attach to non-existent VPC (error) | **NOT STARTED** | -| `detach-internet-gateway` | — | `--internet-gateway-id`, `--vpc-id` | IGW must be attached to VPC | Unlink IGW from VPC → remove OVS internet routing flows | 1. Detach attached IGW
2. Detach unattached IGW (error) | **NOT STARTED** | -| `delete-internet-gateway` | — | `--internet-gateway-id` | IGW must be detached | Verify IGW detached → remove OVS NAT bridge → delete metadata | 1. Delete detached IGW
2. Delete attached IGW (error) | **NOT STARTED** | -| `describe-internet-gateways` | — | `--internet-gateway-ids`, `--filters`, `--max-results` | None | Query NATS KV for IGW metadata → return list with attachment info | 1. List all IGWs
2. Filter by attachment VPC | **NOT STARTED** | +| `create-internet-gateway` | `--tag-specifications` | `--dry-run` | None | NATS `ec2.CreateInternetGateway` → daemon generates igw-ID → creates IGWRecord in `hive-igw` KV bucket with state=available (not attached) → returns InternetGateway with empty Attachments | 1. Create IGW
2. Verify in describe-internet-gateways
3. Tags applied at creation | **DONE** | +| `attach-internet-gateway` | `--internet-gateway-id`, `--vpc-id` | `--dry-run` | IGW and VPC must exist | NATS `ec2.AttachInternetGateway` → daemon validates IGW exists and is not already attached (ResourceAlreadyAssociated) → sets VpcId on record → state=attached → publishes `vpc.igw-attach` event to vpcd (creates OVN external switch, gateway port, SNAT rules) | 1. Attach IGW to VPC
2. Attach already-attached IGW (ResourceAlreadyAssociated)
3. Non-existent IGW (error)
4. Missing params (MissingParameter) | **DONE** | +| `detach-internet-gateway` | `--internet-gateway-id`, `--vpc-id` | `--dry-run` | IGW must be attached to specified VPC | NATS `ec2.DetachInternetGateway` → daemon validates IGW exists and is attached to specified VPC (GatewayNotAttached if wrong VPC) → clears VpcId → state=available → publishes `vpc.igw-detach` event to vpcd (removes OVN resources) | 1. Detach attached IGW
2. Detach from wrong VPC (GatewayNotAttached)
3. Detach unattached IGW (error) | **DONE** | +| `delete-internet-gateway` | `--internet-gateway-id` | `--dry-run` | IGW must be detached | NATS `ec2.DeleteInternetGateway` → daemon validates IGW exists and VpcId is empty (DependencyViolation if attached) → deletes from `hive-igw` KV | 1. Delete detached IGW
2. Delete attached IGW (DependencyViolation)
3. Delete non-existent (error) | **DONE** | +| `describe-internet-gateways` | `--internet-gateway-ids` | `--filters`, `--max-results`, `--dry-run` | None | NATS `ec2.DescribeInternetGateways` → daemon lists all keys from `hive-igw` KV → filters by IGW IDs if specified → returns list with Attachments array (if attached) | 1. List all IGWs
2. Filter by IGW ID
3. Verify attachment info | **DONE** | -## EC2 - Route Tables +### EC2 - Route Tables | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -218,7 +296,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `associate-route-table` | — | `--route-table-id`, `--subnet-id` or `--gateway-id` | Route table and target must exist | NATS `ec2.AssociateRouteTable` → daemon links route table to subnet/gateway → return rtbassoc-ID | 1. Associate with subnet
2. Missing route table ID (error) | **NOT STARTED** | | `disassociate-route-table` | — | `--association-id` | Association must exist, not main table association | NATS `ec2.DisassociateRouteTable` → daemon unlinks route table → return success | 1. Disassociate existing
2. Disassociate main table (error) | **NOT STARTED** | -## EC2 - VPC Peering +### EC2 - VPC Peering | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -229,7 +307,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `describe-vpc-peering-connections` | — | `--vpc-peering-connection-ids`, `--filters`, `--max-results` | None | NATS `ec2.DescribeVpcPeeringConnections` → daemon lists peerings from KV → return list with state | 1. List all peerings
2. Filter by ID
3. Filter by VPC | **NOT STARTED** | | `modify-vpc-peering-connection-options` | — | `--vpc-peering-connection-id`, `--requester-peering-connection-options`, `--accepter-peering-connection-options` | Peering must be active | NATS `ec2.ModifyVpcPeeringConnectionOptions` → daemon updates peering options in KV → return modified options | 1. Enable DNS resolution
2. Missing peering ID (error) | **NOT STARTED** | -## EC2 - VPC Endpoints +### EC2 - VPC Endpoints | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -239,7 +317,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `describe-vpc-endpoint-services` | — | `--service-names`, `--filters`, `--max-results` | None | NATS `ec2.DescribeVpcEndpointServices` → daemon returns available services (S3, DynamoDB equivalents) → return service list | 1. List available services
2. Filter by service name | **NOT STARTED** | | `modify-vpc-endpoint` | — | `--vpc-endpoint-id`, `--add-route-table-ids`, `--remove-route-table-ids`, `--add-subnet-ids`, `--remove-subnet-ids` | Endpoint must exist | NATS `ec2.ModifyVpcEndpoint` → daemon updates endpoint route tables/subnets in KV → return success | 1. Add route table
2. Remove subnet
3. Missing endpoint ID (error) | **NOT STARTED** | -## EC2 - VPN Gateway & Customer Gateway +### EC2 - VPN Gateway & Customer Gateway | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -252,7 +330,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `detach-vpn-gateway` | — | `--vpn-gateway-id`, `--vpc-id` | Must be attached | NATS `ec2.DetachVpnGateway` → daemon unlinks VPN gateway from VPC → return success | 1. Detach from VPC
2. Not attached (error) | **NOT STARTED** | | `describe-vpn-gateways` | — | `--vpn-gateway-ids`, `--filters` | None | NATS `ec2.DescribeVpnGateways` → daemon lists from KV → return list with attachment info | 1. List all
2. Filter by VPC attachment | **NOT STARTED** | -## EC2 - VPN Connections +### EC2 - VPN Connections | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -262,7 +340,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `modify-vpn-connection` | — | `--vpn-connection-id`, `--vpn-gateway-id`, `--customer-gateway-id` | Connection must exist | NATS `ec2.ModifyVpnConnection` → daemon updates connection target in KV → return modified connection | 1. Change VPN gateway
2. Missing connection ID (error) | **NOT STARTED** | | `modify-vpn-connection-options` | — | `--vpn-connection-id`, `--local-ipv4-network-cidr`, `--remote-ipv4-network-cidr` | Connection must exist | NATS `ec2.ModifyVpnConnectionOptions` → daemon updates tunnel options in KV → return modified connection | 1. Modify CIDR ranges
2. Missing connection ID (error) | **NOT STARTED** | -## EC2 - Network ACLs +### EC2 - Network ACLs | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -274,7 +352,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `replace-network-acl-association` | — | `--association-id`, `--network-acl-id` | Both must exist | NATS `ec2.ReplaceNetworkAclAssociation` → daemon swaps NACL for subnet → return new association ID | 1. Replace association
2. Missing association ID (error) | **NOT STARTED** | | `replace-network-acl-entry` | — | `--network-acl-id`, `--rule-number`, `--protocol`, `--rule-action`, `--cidr-block`, `--ingress`/`--egress`, `--port-range` | Entry must exist | NATS `ec2.ReplaceNetworkAclEntry` → daemon replaces rule in KV → update OVS flow → return success | 1. Replace existing entry
2. Replace non-existent entry (error) | **NOT STARTED** | -## EC2 - Prefix Lists +### EC2 - Prefix Lists | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -285,20 +363,22 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `get-managed-prefix-list-entries` | — | `--prefix-list-id`, `--target-version`, `--max-results` | Prefix list must exist | NATS `ec2.GetManagedPrefixListEntries` → daemon reads entries from KV → return entry list | 1. List entries
2. List entries at specific version | **NOT STARTED** | | `get-managed-prefix-list-associations` | — | `--prefix-list-id`, `--max-results` | Prefix list must exist | NATS `ec2.GetManagedPrefixListAssociations` → daemon finds references in SGs/route tables → return association list | 1. List associations
2. No associations returns empty | **NOT STARTED** | -## EC2 - Network Interfaces +### EC2 - Network Interfaces + +ENIs are managed via `hive-vpc-enis` KV bucket with CAS-based IPAM allocation from `hive-vpc-ipam`. ENIs are auto-created by `run-instances --subnet-id` and auto-deleted on termination. MAC addresses are deterministically generated from the ENI ID. Attach/detach are internal operations used by instance lifecycle — no standalone attach/detach API yet. | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-network-interface` | — | `--subnet-id`, `--description`, `--private-ip-address`, `--groups`, `--tag-specifications` | Subnet must exist | NATS `ec2.CreateNetworkInterface` → daemon creates ENI in KV with eni-ID → assign private IP from subnet pool → return ENI | 1. Create in subnet
2. Create with specific private IP
3. Missing subnet ID (error) | **NOT STARTED** | -| `delete-network-interface` | — | `--network-interface-id`, `--dry-run` | Must not be attached | NATS `ec2.DeleteNetworkInterface` → daemon verifies detached → release IP → delete from KV → return success | 1. Delete detached ENI
2. Delete attached ENI (error) | **NOT STARTED** | -| `describe-network-interfaces` | — | `--network-interface-ids`, `--filters`, `--max-results` | None | NATS `ec2.DescribeNetworkInterfaces` → daemon lists ENIs from KV → return list with IP/attachment info | 1. List all ENIs
2. Filter by subnet
3. Filter by attachment | **NOT STARTED** | -| `attach-network-interface` | — | `--network-interface-id`, `--instance-id`, `--device-index` | ENI and instance must exist | NATS `ec2.AttachNetworkInterface` → daemon attaches OVS port to instance QEMU process → configure MAC/IP → return eni-attach-ID | 1. Attach ENI to instance
2. Already attached (error)
3. Missing device index (error) | **NOT STARTED** | -| `detach-network-interface` | — | `--attachment-id`, `--force` | ENI must be attached | NATS `ec2.DetachNetworkInterface` → daemon detaches OVS port from instance → return success | 1. Detach ENI
2. Force detach
3. Not attached (error) | **NOT STARTED** | +| `create-network-interface` | `--subnet-id`, `--private-ip-address`, `--description`, `--tag-specifications` | `--groups`, `--dry-run` | Subnet must exist | Gateway validates SubnetId (required) → NATS `ec2.CreateNetworkInterface` → daemon verifies subnet exists in `hive-vpc-subnets` KV → if no PrivateIpAddress, allocates from IPAM pool (CAS-based, up to 5 retries) → generates eni-ID → generates deterministic MAC from ENI ID → stores ENIRecord in `hive-vpc-enis` KV → publishes `vpc.create-port` event to vpcd (creates OVN logical port) → returns NetworkInterface with status=available | 1. Create in subnet (auto-allocate IP)
2. Create with specific private IP
3. Missing subnet ID (MissingParameter)
4. Non-existent subnet (error)
5. Tags applied at creation | **DONE** | +| `delete-network-interface` | `--network-interface-id` | `--dry-run` | Must not be attached (status != in-use) | NATS `ec2.DeleteNetworkInterface` → daemon verifies ENI exists and status is not "in-use" (InvalidNetworkInterfaceInUse) → releases IP back to IPAM pool → deletes from `hive-vpc-enis` KV → publishes `vpc.delete-port` event to vpcd | 1. Delete detached ENI
2. Delete attached ENI (InvalidNetworkInterfaceInUse)
3. Delete non-existent (error) | **DONE** | +| `describe-network-interfaces` | `--network-interface-ids`, `--filters` (subnet-id, vpc-id, attachment.instance-id) | `--max-results`, `--dry-run` | None | NATS `ec2.DescribeNetworkInterfaces` → daemon lists all keys from `hive-vpc-enis` KV → applies filters (subnet-id, vpc-id, attachment.instance-id) → filters by ENI IDs if specified → returns error for non-existent requested IDs | 1. List all ENIs
2. Filter by subnet-id
3. Filter by vpc-id
4. Filter by attachment.instance-id
5. Non-existent ENI returns error | **DONE** | +| `attach-network-interface` | — | `--network-interface-id`, `--instance-id`, `--device-index` | ENI and instance must exist | Internal operation used by `run-instances --subnet-id`. Marks ENI as "in-use", sets instance attachment, generates attachment ID. No standalone API endpoint yet. | 1. Attach ENI to instance
2. Already attached (error)
3. Missing device index (error) | **NOT STARTED** (internal only) | +| `detach-network-interface` | — | `--attachment-id`, `--force` | ENI must be attached | Internal operation used by terminate-instances. Marks ENI as "available", clears attachment info. No standalone API endpoint yet. | 1. Detach ENI
2. Force detach
3. Not attached (error) | **NOT STARTED** (internal only) | | `modify-network-interface-attribute` | — | `--network-interface-id`, `--description`, `--source-dest-check`, `--groups` | ENI must exist | NATS `ec2.ModifyNetworkInterfaceAttribute` → daemon updates ENI attributes in KV → return success | 1. Modify description
2. Toggle source/dest check
3. Update security groups | **NOT STARTED** | | `assign-private-ip-addresses` | — | `--network-interface-id`, `--private-ip-addresses` or `--secondary-private-ip-address-count` | ENI must exist | NATS `ec2.AssignPrivateIpAddresses` → daemon allocates IPs from subnet pool → assign to ENI → return assigned IPs | 1. Assign specific IPs
2. Assign by count
3. Cannot specify both (error) | **NOT STARTED** | | `unassign-private-ip-addresses` | — | `--network-interface-id`, `--private-ip-addresses` | IPs must be assigned to ENI | NATS `ec2.UnassignPrivateIpAddresses` → daemon releases IPs → return success | 1. Unassign secondary IP
2. Unassign primary IP (error) | **NOT STARTED** | -## EC2 - Launch Templates +### EC2 - Launch Templates | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -308,7 +388,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `describe-launch-templates` | — | `--launch-template-ids`, `--launch-template-names`, `--filters` | None | NATS `ec2.DescribeLaunchTemplates` → daemon lists templates from KV → return list | 1. List all templates
2. Filter by name
3. Filter by ID | **NOT STARTED** | | `describe-launch-template-versions` | — | `--launch-template-id` or `--launch-template-name`, `--versions`, `--min-version`, `--max-version` | Template must exist | NATS `ec2.DescribeLaunchTemplateVersions` → daemon lists versions from KV → return version list with data | 1. List all versions
2. List specific version
3. Template not found (error) | **NOT STARTED** | -## EC2 - Misc Operations +### EC2 - Misc Operations | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -316,7 +396,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `enable-address-transfer` | — | `--allocation-id`, `--transfer-account-id` | EIP must exist | NATS `ec2.EnableAddressTransfer` → daemon stores transfer in JetStream KV with 7-day expiration → return AllocationId and TransferAccountId | 1. Enable transfer
2. Verify transfer stored with expiration | **NOT STARTED** | | `disable-address-transfer` | — | `--allocation-id` | Transfer must exist | NATS `ec2.DisableAddressTransfer` → daemon updates transfer status to disabled in KV → return status | 1. Disable active transfer
2. Disable non-existent transfer (error) | **NOT STARTED** | -## EBS Direct API +### EBS Direct API | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| @@ -327,7 +407,7 @@ Requires Open vSwitch (`apt install openvswitch-switch openvswitch-common`). Sin | `list-snapshot-blocks` | — | `--snapshot-id`, `--max-results`, `--next-token` | Snapshot must exist | List all non-empty blocks in snapshot with tokens and sizes | 1. List blocks of populated snapshot
2. List blocks of empty snapshot | **NOT STARTED** | | `list-changed-blocks` | — | `--second-snapshot-id`, `--first-snapshot-id`, `--max-results` | Snapshots must exist | Compare two snapshots → return list of differing block indexes | 1. Compare parent and child snapshots
2. Compare unrelated snapshots | **NOT STARTED** | -## S3 (via Predastore) +### S3 (via Predastore) Currently S3 operations are handled directly by Predastore. Consider moving control/data plane to Hive format for AWS gateway integration. @@ -340,19 +420,60 @@ Currently S3 operations are handled directly by Predastore. Consider moving cont | `s3 rm` (DeleteObject) | — | `s3://bucket/key`, `--recursive` | Object must exist | NATS `s3.deleteobject` → Predastore deletes object shards | 1. Delete single object
2. Recursive delete
3. Delete non-existent (idempotent) | **NOT STARTED** | | `s3 sync` | — | `source dest`, `--delete`, `--exclude`, `--include` | Bucket must exist | Compare source and dest → upload changed/new files → optionally delete removed files | 1. Sync local dir to S3
2. Sync with --delete
3. Sync with exclude filter | **NOT STARTED** | -## IAM +### IAM - User Management + +All IAM operations are account-scoped. Users, policies, and access keys are namespaced per account. The gateway extracts the account ID from the authenticated access key via `c.Locals("sigv4.accountId")` and passes it to all IAM service methods. Root user (account `000000000000`) bypasses policy evaluation entirely. | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-user` | — | `--user-name`, `--path`, `--tags` | None | Store user in JetStream KV → generate AIDA-prefixed UserId → return User with ARN | 1. Create user
2. Duplicate name (EntityAlreadyExists)
3. Missing username (error) | **NOT STARTED** | -| `get-user` | — | `--user-name` | User must exist | Read user from JetStream KV → return User details | 1. Get existing user
2. Get non-existent user (NoSuchEntity) | **NOT STARTED** | -| `list-users` | — | `--path-prefix`, `--max-items`, `--marker` | None | List users from JetStream KV → return user list | 1. List all users
2. List with path prefix
3. Empty list | **NOT STARTED** | -| `delete-user` | — | `--user-name` | User must exist, no access keys/policies | Remove user from JetStream KV → return success | 1. Delete user with no keys
2. Delete user with keys (error)
3. Delete non-existent (NoSuchEntity) | **NOT STARTED** | -| `create-access-key` | — | `--user-name` | User must exist | Generate access key ID (AKIA prefix) and secret → store in JetStream KV → return credentials | 1. Create key for user
2. Max keys exceeded (error) | **NOT STARTED** (gateway stub exists) | -| `delete-access-key` | — | `--access-key-id`, `--user-name` | Key must exist | Remove access key from JetStream KV → return success | 1. Delete existing key
2. Delete non-existent key (error) | **NOT STARTED** | -| `list-access-keys` | — | `--user-name`, `--max-items` | None | Query JetStream KV for user's access keys → return list | 1. List keys for user
2. No keys returns empty | **NOT STARTED** | -| `create-policy` | — | `--policy-name`, `--policy-document`, `--path`, `--description`, `--tags` | None | Validate JSON policy document → store in JetStream KV → generate policy ARN → return Policy | 1. Create with valid document
2. Invalid JSON (error)
3. Duplicate name (EntityAlreadyExists) | **NOT STARTED** | -| `delete-policy` | — | `--policy-arn` | Policy must exist, not attached to any user | Remove policy from JetStream KV → return success | 1. Delete unattached policy
2. Delete attached policy (error) | **NOT STARTED** | -| `attach-user-policy` | — | `--user-name`, `--policy-arn` | User and policy must exist | Link policy to user in JetStream KV → return success | 1. Attach policy
2. Already attached (idempotent)
3. Non-existent user (NoSuchEntity) | **NOT STARTED** | -| `detach-user-policy` | — | `--user-name`, `--policy-arn` | User and policy must exist, policy attached | Unlink policy from user in JetStream KV → return success | 1. Detach attached policy
2. Not attached (error) | **NOT STARTED** | -| `list-attached-user-policies` | — | `--user-name`, `--path-prefix`, `--max-items` | User must exist | List policies attached to user from JetStream KV → return policy list | 1. List attached policies
2. No policies returns empty | **NOT STARTED** | +| `create-user` | `--user-name`, `--path` | `--tags`, `--permissions-boundary` | None | Gateway validates UserName non-empty → IAMService.CreateUser(accountID, input) → generates AIDA-prefixed UserId → stores in KV at key `{accountID}.{userName}` → ARN includes real account ID → conditional create for race safety | 1. Create user
2. Duplicate name in same account (EntityAlreadyExists)
3. Same name in different account (succeeds)
4. Missing username (InvalidInput)
5. Default path is `/` | **DONE** | +| `get-user` | `--user-name` | — | User must exist in caller's account | Gateway validates UserName → IAMService.GetUser(accountID, input) → reads from KV at `{accountID}.{userName}` → returns User with ARN, Path, CreateDate | 1. Get existing user
2. Get non-existent user (NoSuchEntity)
3. Cannot see user in different account (NoSuchEntity) | **DONE** | +| `list-users` | `--path-prefix` | `--max-items`, `--marker` | None | IAMService.ListUsers(accountID, input) → prefix-scans KV for `{accountID}.*` → filters by path prefix if specified → returns user list scoped to caller's account | 1. List all users in account
2. List with path prefix filter
3. Empty list
4. Does not show other accounts' users | **DONE** | +| `delete-user` | `--user-name` | — | User must exist, no access keys attached | Gateway validates UserName → IAMService.DeleteUser(accountID, input) → checks user has no access keys → deletes from KV | 1. Delete user with no keys
2. Delete user with keys attached (DeleteConflict)
3. Delete non-existent user (NoSuchEntity) | **DONE** | + +### IAM - Access Key Management + +Access keys are globally unique (keyed by AccessKeyID) but associated with an account. Max 2 keys per user. Secrets encrypted with AES-256-GCM using master key. + +| Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------------------|---------------|---------------|-------------|------------|--------| +| `create-access-key` | `--user-name` | — | User must exist | IAMService.CreateAccessKey(accountID, input) → generates AKIA-prefixed key ID + random secret → encrypts secret with master key → stores in KV (globally unique key ID) → updates user's AccessKeys list → returns plaintext secret (one-time only) | 1. Create key for user (AKIA prefix)
2. Max 2 keys per user (LimitExceeded on 3rd)
3. Non-existent user (NoSuchEntity)
4. Secret only returned on creation | **DONE** | +| `list-access-keys` | `--user-name` | `--max-items`, `--marker` | None | IAMService.ListAccessKeys(accountID, input) → reads user's AccessKeys list → fetches each key's metadata → returns key IDs and status (no secrets) | 1. List keys for user
2. No keys returns empty list
3. Shows Status (Active/Inactive) but not secrets | **DONE** | +| `delete-access-key` | `--access-key-id`, `--user-name` | — | Key must exist | IAMService.DeleteAccessKey(accountID, input) → removes key from global KV → removes key ID from user's AccessKeys list | 1. Delete existing key
2. Delete non-existent key (NoSuchEntity) | **DONE** | +| `update-access-key` | `--access-key-id`, `--user-name`, `--status` (Active/Inactive) | — | Key must exist | IAMService.UpdateAccessKey(input) → reads key from global KV (key ID is globally unique, no accountID needed) → updates Status field → inactive keys rejected at SigV4 auth | 1. Deactivate key (Inactive)
2. Reactivate key (Active)
3. Non-existent key (NoSuchEntity)
4. Inactive key → auth returns InvalidClientTokenId | **DONE** | + +### IAM - Policy Management + +Policies are account-scoped. KV key is `{accountID}.{policyName}`. Policy documents require `Version: "2012-10-17"` and valid Statement array. Supports wildcard action matching (`ec2:*`, `ec2:Describe*`, `*`). Evaluation order: explicit Deny > explicit Allow > implicit Deny. + +| Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------------------|---------------|---------------|-------------|------------|--------| +| `create-policy` | `--policy-name`, `--policy-document`, `--path`, `--description` | `--tags` | None | Gateway validates PolicyName and PolicyDocument non-empty → IAMService.CreatePolicy(accountID, input) → validates JSON (Version, Statement with Effect/Action/Resource) → generates ANPA-prefixed PolicyId → stores at `{accountID}.{policyName}` → ARN includes real account ID | 1. Create with valid document
2. Malformed JSON (MalformedPolicyDocument)
3. Missing Effect/Action/Resource (MalformedPolicyDocument)
4. Duplicate name in same account (EntityAlreadyExists)
5. Same name in different account (succeeds)
6. With path and description | **DONE** | +| `get-policy` | `--policy-arn` | — | Policy must exist | Gateway validates PolicyArn → extracts account ID and policy name from ARN → IAMService.GetPolicy(accountID, input) → returns policy metadata (no document) with AttachmentCount | 1. Get existing policy
2. Non-existent policy (NoSuchEntity)
3. Returns metadata only, not document | **DONE** | +| `get-policy-version` | `--policy-arn`, `--version-id` | — | Policy must exist | Gateway validates PolicyArn and VersionId → IAMService.GetPolicyVersion(accountID, input) → returns PolicyVersion with URL-encoded Document, VersionId, IsDefaultVersion | 1. Get version v1 (returns document)
2. Non-existent version (NoSuchEntity)
3. Non-existent policy (NoSuchEntity) | **DONE** | +| `list-policies` | — | `--scope`, `--only-attached`, `--path-prefix`, `--max-items`, `--marker` | None | IAMService.ListPolicies(accountID, input) → prefix-scans KV for `{accountID}.*` → returns all policies in caller's account | 1. List all policies in account
2. Empty list
3. Does not show other accounts' policies | **DONE** | +| `delete-policy` | `--policy-arn` | — | Policy must exist, not attached to any user | Gateway validates PolicyArn → IAMService.DeletePolicy(accountID, input) → checks no users have this policy attached (scans account's users) → deletes from KV | 1. Delete unattached policy
2. Delete attached policy (DeleteConflict)
3. Delete non-existent (NoSuchEntity) | **DONE** | + +### IAM - Policy Attachment + +| Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | +|---------|-------------------|---------------|---------------|-------------|------------|--------| +| `attach-user-policy` | `--user-name`, `--policy-arn` | — | User and policy must exist in caller's account | Gateway validates both params → IAMService.AttachUserPolicy(accountID, input) → verifies policy exists → adds policy ARN to user's AttachedPolicies list → idempotent (re-attach succeeds without duplicate) | 1. Attach policy to user
2. Already attached (idempotent, no error)
3. Non-existent user (NoSuchEntity)
4. Non-existent policy (NoSuchEntity) | **DONE** | +| `detach-user-policy` | `--user-name`, `--policy-arn` | — | Policy must be attached to user | Gateway validates both params → IAMService.DetachUserPolicy(accountID, input) → removes policy ARN from user's AttachedPolicies list | 1. Detach attached policy
2. Policy not attached (NoSuchEntity)
3. Non-existent user (NoSuchEntity) | **DONE** | +| `list-attached-user-policies` | `--user-name` | `--path-prefix`, `--max-items`, `--marker` | User must exist | IAMService.ListAttachedUserPolicies(accountID, input) → reads user's AttachedPolicies list → returns policy ARNs and names | 1. List attached policies
2. No policies returns empty list | **DONE** | + + +### IAM - Policy Evaluation + +The gateway evaluates IAM policies on every request (except root user bypass). Policy evaluation is internal — not an AWS API. + +| Feature | Description | Status | +|---------|-------------|--------| +| Root user bypass | Root user (`000000000000:root`) skips all policy checks | **DONE** | +| Default deny | Users with no attached policies are denied all actions | **DONE** | +| Explicit allow | Matching Allow statement grants access | **DONE** | +| Explicit deny | Deny statements override Allow (deny wins) | **DONE** | +| Wildcard matching | `*` matches all, `ec2:*` matches all EC2, `ec2:Describe*` matches prefix | **DONE** | +| Account-scoped evaluation | Policies resolved from caller's account context | **DONE** | +| EC2 action mapping | 54 EC2 actions mapped to IAM policy strings | **DONE** | +| IAM action mapping | 16 IAM actions mapped to IAM policy strings | **DONE** | diff --git a/hive/admin/admin.go b/hive/admin/admin.go index a27356fba..0d9977fa7 100644 --- a/hive/admin/admin.go +++ b/hive/admin/admin.go @@ -264,12 +264,11 @@ func GenerateAWSSecretKey() string { return base64.StdEncoding.EncodeToString(bytes) } -// generateAccountID generates a 12-digit AWS account ID +// GenerateAccountID returns the global platform account ID (000000000000). +// This is used during bootstrap (hive admin init) for the root/platform account. +// Customer accounts are created via IAMService.CreateAccount() with sequential IDs. func GenerateAccountID() string { - // Generate random 12-digit number - num, _ := rand.Int(rand.Reader, big.NewInt(900000000000)) - accountID := num.Int64() + 100000000000 // Ensure it's 12 digits - return fmt.Sprintf("%012d", accountID) + return "000000000000" } // generateNATSToken generates a secure random token for NATS diff --git a/hive/admin/admin_test.go b/hive/admin/admin_test.go index e7f638bfb..5ecf02c84 100644 --- a/hive/admin/admin_test.go +++ b/hive/admin/admin_test.go @@ -42,18 +42,14 @@ func TestGenerateAWSSecretKey_Uniqueness(t *testing.T) { assert.NotEqual(t, GenerateAWSSecretKey(), GenerateAWSSecretKey()) } -func TestGenerateAccountID_Format(t *testing.T) { +func TestGenerateAccountID_ReturnsGlobalID(t *testing.T) { id := GenerateAccountID() + assert.Equal(t, "000000000000", id) assert.Len(t, id, 12) - for _, c := range id { - assert.True(t, c >= '0' && c <= '9', "expected digit, got %c", c) - } - // First digit should not be 0 - assert.NotEqual(t, byte('0'), id[0], "12-digit account ID should not start with 0") } -func TestGenerateAccountID_Uniqueness(t *testing.T) { - assert.NotEqual(t, GenerateAccountID(), GenerateAccountID()) +func TestGenerateAccountID_Deterministic(t *testing.T) { + assert.Equal(t, GenerateAccountID(), GenerateAccountID()) } func TestGenerateNATSToken_Format(t *testing.T) { diff --git a/hive/awserrors/awserrors.go b/hive/awserrors/awserrors.go index 29e1e9b58..adf1bdd26 100644 --- a/hive/awserrors/awserrors.go +++ b/hive/awserrors/awserrors.go @@ -423,6 +423,15 @@ var ( ErrorVpnGatewayAttachmentLimitExceeded = "VpnGatewayAttachmentLimitExceeded" ErrorVpnGatewayLimitExceeded = "VpnGatewayLimitExceeded" ErrorZonesMismatched = "ZonesMismatched" + + // IAM-specific error codes + ErrorIAMNoSuchEntity = "NoSuchEntity" + ErrorIAMEntityAlreadyExists = "EntityAlreadyExists" + ErrorIAMDeleteConflict = "DeleteConflict" + ErrorIAMLimitExceeded = "LimitExceeded" + ErrorIAMInvalidInput = ErrorInvalidInput // alias for IAM usage + ErrorIAMMalformedPolicyDocument = "MalformedPolicyDocument" + ErrorAccessDenied = "AccessDenied" ) // ValidErrorCode returns the error code if it exists in ErrorLookup, @@ -853,4 +862,12 @@ var ErrorLookup = map[string]ErrorMessage{ ErrorVpnGatewayAttachmentLimitExceeded: {HTTPCode: 400, Message: "You've reached the limit on the number of VPCs that can be attached to the specified virtual private gateway."}, ErrorVpnGatewayLimitExceeded: {HTTPCode: 400, Message: "You've reached the limit on the number of virtual private gateways that you can create. For more information about limits, see Amazon VPC quotas."}, ErrorZonesMismatched: {HTTPCode: 400, Message: "The Availability Zone for the instance does not match that of the Dedicated Host"}, + + // IAM error codes + ErrorIAMNoSuchEntity: {HTTPCode: 404, Message: "The request was rejected because it referenced a resource entity that does not exist."}, + ErrorIAMEntityAlreadyExists: {HTTPCode: 409, Message: "The request was rejected because it attempted to create a resource that already exists."}, + ErrorIAMDeleteConflict: {HTTPCode: 409, Message: "The request was rejected because it attempted to delete a resource that has attached subordinate entities."}, + ErrorIAMLimitExceeded: {HTTPCode: 409, Message: "The request was rejected because it attempted to create resources beyond the current AWS account limits."}, + ErrorIAMMalformedPolicyDocument: {HTTPCode: 400, Message: "The policy document is malformed."}, + ErrorAccessDenied: {HTTPCode: 403, Message: "User is not authorized to perform this action."}, } diff --git a/hive/awserrors/awserrors_test.go b/hive/awserrors/awserrors_test.go index 4ca00e494..9f57520db 100644 --- a/hive/awserrors/awserrors_test.go +++ b/hive/awserrors/awserrors_test.go @@ -425,6 +425,14 @@ func TestErrorLookup(t *testing.T) { {code: "VpnGatewayAttachmentLimitExceeded", http: 400, message: "You've reached the limit on the number of VPCs that can be attached to the specified virtual private gateway."}, {code: "VpnGatewayLimitExceeded", http: 400, message: "You've reached the limit on the number of virtual private gateways that you can create. For more information about limits, see Amazon VPC quotas."}, {code: "ZonesMismatched", http: 400, message: "The Availability Zone for the instance does not match that of the Dedicated Host"}, + + // IAM error codes + {code: "NoSuchEntity", http: 404, message: "The request was rejected because it referenced a resource entity that does not exist."}, + {code: "EntityAlreadyExists", http: 409, message: "The request was rejected because it attempted to create a resource that already exists."}, + {code: "DeleteConflict", http: 409, message: "The request was rejected because it attempted to delete a resource that has attached subordinate entities."}, + {code: "LimitExceeded", http: 409, message: "The request was rejected because it attempted to create resources beyond the current AWS account limits."}, + {code: "MalformedPolicyDocument", http: 400, message: "The policy document is malformed."}, + {code: "AccessDenied", http: 403, message: "User is not authorized to perform this action."}, } if len(ErrorLookup) != len(expected) { diff --git a/hive/config/config.go b/hive/config/config.go index 51e7f2bad..41131a000 100644 --- a/hive/config/config.go +++ b/hive/config/config.go @@ -36,12 +36,8 @@ type Config struct { AWSGW AWSGWConfig `mapstructure:"awsgw"` VPCD VPCDConfig `mapstructure:"vpcd"` - // Authentication - // TODO: Move to more appropriate setting above - AccessKey string `mapstructure:"accesskey"` - SecretKey string `mapstructure:"secretkey"` - BaseDir string `mapstructure:"base_dir"` - WalDir string `mapstructure:"wal_dir"` + BaseDir string `mapstructure:"base_dir"` + WalDir string `mapstructure:"wal_dir"` } // NodeBaseDir returns the BaseDir for the current node, or "" if the config diff --git a/hive/config/config_test.go b/hive/config/config_test.go index 0176ae3ed..4fcaf6abb 100644 --- a/hive/config/config_test.go +++ b/hive/config/config_test.go @@ -32,9 +32,6 @@ node = "node1" node = "node1" region = "us-east-1" az = "us-east-1a" -accesskey = "AKIATEST" -secretkey = "SECRET" - [nodes.node1.daemon] host = "127.0.0.1:8080" @@ -63,7 +60,6 @@ region = "us-east-1" require.True(t, ok, "node1 should exist in Nodes map") assert.Equal(t, "us-east-1", node.Region) assert.Equal(t, "us-east-1a", node.AZ) - assert.Equal(t, "AKIATEST", node.AccessKey) assert.Equal(t, "127.0.0.1:8080", node.Daemon.Host) assert.Equal(t, "127.0.0.1:4222", node.NATS.Host) assert.Equal(t, "nats_testtoken", node.NATS.ACL.Token) diff --git a/hive/daemon/daemon.go b/hive/daemon/daemon.go index 6eca534c4..fc061f800 100644 --- a/hive/daemon/daemon.go +++ b/hive/daemon/daemon.go @@ -450,7 +450,7 @@ func (d *Daemon) Start() error { } // Create services before loading/launching instances, since LaunchInstance depends on them - store := objectstore.NewS3ObjectStoreFromConfig(d.config.Predastore.Host, d.config.Predastore.Region, d.config.AccessKey, d.config.SecretKey) + store := objectstore.NewS3ObjectStoreFromConfig(d.config.Predastore.Host, d.config.Predastore.Region, d.config.Predastore.AccessKey, d.config.Predastore.SecretKey) d.instanceService = handlers_ec2_instance.NewInstanceServiceImpl(d.config, d.resourceMgr.instanceTypes, d.natsConn, &d.Instances, store) d.keyService = handlers_ec2_key.NewKeyServiceImpl(d.config) d.imageService = handlers_ec2_image.NewImageServiceImpl(d.config, d.natsConn) @@ -1097,8 +1097,6 @@ func (d *Daemon) ClusterManager() error { NATS: d.config.NATS, Predastore: d.config.Predastore, AWSGW: d.config.AWSGW, - AccessKey: d.config.AccessKey, - SecretKey: d.config.SecretKey, BaseDir: req.DataDir, } diff --git a/hive/daemon/daemon_test.go b/hive/daemon/daemon_test.go index 05b60a99b..df5fd5564 100644 --- a/hive/daemon/daemon_test.go +++ b/hive/daemon/daemon_test.go @@ -60,8 +60,6 @@ func createTestDaemon(t *testing.T, natsURL string) *Daemon { SecretKey: "test-secret-key", BaseDir: tmpDir, }, - AccessKey: "test-access-key", - SecretKey: "test-secret-key", } clusterCfg.Nodes["node-1"] = *cfg @@ -359,8 +357,6 @@ func TestDaemon_Initialization(t *testing.T) { NATS: config.NATSConfig{ Host: "nats://localhost:4222", }, - AccessKey: "test-key", - SecretKey: "test-secret", } clusterCfg.Nodes["node-1"] = *cfg diff --git a/hive/formation/formation.go b/hive/formation/formation.go index 78c42c725..2ab83f905 100644 --- a/hive/formation/formation.go +++ b/hive/formation/formation.go @@ -45,6 +45,7 @@ type StatusResponse struct { Credentials *SharedCredentials `json:"credentials,omitempty"` CACert string `json:"ca_cert,omitempty"` CAKey string `json:"ca_key,omitempty"` + MasterKey string `json:"master_key,omitempty"` } // SharedCredentials contains the cluster-wide credentials distributed during formation. @@ -68,6 +69,7 @@ type FormationServer struct { credentials *SharedCredentials caCert string caKey string + masterKey string done chan struct{} server *http.Server } @@ -152,6 +154,13 @@ func (fs *FormationServer) Nodes() map[string]NodeInfo { return out } +// SetMasterKey sets the base64-encoded IAM master key for distribution to joining nodes. +func (fs *FormationServer) SetMasterKey(key string) { + fs.mu.Lock() + defer fs.mu.Unlock() + fs.masterKey = key +} + // Start launches the HTTP server on the given address (e.g. "10.0.0.1:4432"). func (fs *FormationServer) Start(bindAddr string) error { mux := http.NewServeMux() @@ -238,6 +247,7 @@ func (fs *FormationServer) handleStatus(w http.ResponseWriter, r *http.Request) resp.Credentials = fs.credentials resp.CACert = fs.caCert resp.CAKey = fs.caKey + resp.MasterKey = fs.masterKey } writeJSON(w, http.StatusOK, resp) diff --git a/hive/formation/formation_test.go b/hive/formation/formation_test.go index 78a1247b9..bae3456db 100644 --- a/hive/formation/formation_test.go +++ b/hive/formation/formation_test.go @@ -207,6 +207,34 @@ func TestStatusEndpointComplete(t *testing.T) { assert.Equal(t, "ca-key-data", sr.CAKey) } +func TestStatusEndpointMasterKey(t *testing.T) { + t.Parallel() + fs := NewFormationServer(2, testCreds(), "ca-cert", "ca-key") + fs.SetMasterKey("dGVzdC1tYXN0ZXIta2V5LWJhc2U2NC1lbmNvZGVk") + ts := testServer(t, fs) + defer ts.Close() + + // Before completion: master key should not be exposed + resp, err := http.Get(ts.URL + "/formation/status") + require.NoError(t, err) + var sr StatusResponse + require.NoError(t, json.NewDecoder(resp.Body).Decode(&sr)) + resp.Body.Close() + assert.Empty(t, sr.MasterKey) + + // Complete formation + require.NoError(t, fs.RegisterNode(testNode("node1", "10.0.0.1"))) + require.NoError(t, fs.RegisterNode(testNode("node2", "10.0.0.2"))) + + // After completion: master key should be present + resp, err = http.Get(ts.URL + "/formation/status") + require.NoError(t, err) + defer resp.Body.Close() + require.NoError(t, json.NewDecoder(resp.Body).Decode(&sr)) + assert.True(t, sr.Complete) + assert.Equal(t, "dGVzdC1tYXN0ZXIta2V5LWJhc2U2NC1lbmNvZGVk", sr.MasterKey) +} + func TestHealthEndpoint(t *testing.T) { t.Parallel() fs := NewFormationServer(1, testCreds(), "", "") diff --git a/hive/gateway/auth.go b/hive/gateway/auth.go index 5d6e296e7..f00e7a2de 100644 --- a/hive/gateway/auth.go +++ b/hive/gateway/auth.go @@ -11,6 +11,7 @@ import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" "github.com/mulgadc/predastore/auth" ) @@ -76,13 +77,32 @@ func (gw *GatewayConfig) SigV4AuthMiddleware() fiber.Handler { return gw.writeSigV4Error(c, awserrors.ErrorIncompleteSignature) } - // Verify access key matches configured credentials - fmt.Println("accessKey", accessKey, "gw.AccessKey", gw.AccessKey) - if accessKey != gw.AccessKey { - slog.Debug("Invalid access key", "provided", accessKey, "expected", gw.AccessKey) + // Lookup access key in IAM KV store + if gw.IAMService == nil { + slog.Error("SigV4 auth: IAM service not initialized") + return gw.writeSigV4Error(c, awserrors.ErrorInternalError) + } + + ak, err := gw.IAMService.LookupAccessKey(accessKey) + if err != nil { + if strings.Contains(err.Error(), awserrors.ErrorIAMNoSuchEntity) { + slog.Debug("Access key not found", "accessKeyID", accessKey) + return gw.writeSigV4Error(c, awserrors.ErrorInvalidClientTokenId) + } + slog.Error("IAM lookup failed", "accessKeyID", accessKey, "err", err) + return gw.writeSigV4Error(c, awserrors.ErrorInternalError) + } + if ak.Status != handlers_iam.AccessKeyStatusActive { + slog.Debug("Access key inactive", "accessKeyID", accessKey) return gw.writeSigV4Error(c, awserrors.ErrorInvalidClientTokenId) } + secret, err := gw.IAMService.DecryptSecret(ak.SecretAccessKey) + if err != nil { + slog.Error("Failed to decrypt IAM secret", "accessKeyID", accessKey, "err", err) + return gw.writeSigV4Error(c, awserrors.ErrorInternalError) + } + // Get timestamp from X-Amz-Date header timestamp := c.Get("X-Amz-Date") if timestamp == "" { @@ -100,8 +120,8 @@ func (gw *GatewayConfig) SigV4AuthMiddleware() fiber.Handler { return gw.writeSigV4Error(c, awserrors.ErrorSignatureDoesNotMatch) } - // Compute expected signature - expectedSignature := gw.computeSignature(c, date, timestamp, region, service, signedHeaders) + // Compute expected signature using decrypted secret + expectedSignature := computeSignatureWithSecret(c, secret, date, timestamp, region, service, signedHeaders) // Compare signatures using constant-time comparison to prevent timing attacks if subtle.ConstantTimeCompare([]byte(expectedSignature), []byte(providedSignature)) != 1 { @@ -113,17 +133,20 @@ func (gw *GatewayConfig) SigV4AuthMiddleware() fiber.Handler { } // Store parsed auth data in context for downstream handlers + c.Locals("sigv4.identity", ak.UserName) + c.Locals("sigv4.accountId", ak.AccountID) c.Locals("sigv4.service", service) c.Locals("sigv4.region", region) c.Locals("sigv4.accessKey", accessKey) - slog.Debug("SigV4 authentication successful", "accessKey", accessKey) + slog.Debug("SigV4 authentication successful", "accessKey", accessKey, "identity", ak.UserName) return c.Next() } } -// computeSignature builds the canonical request and computes the AWS Signature V4 signature. -func (gw *GatewayConfig) computeSignature(c *fiber.Ctx, date, timestamp, region, service, signedHeaders string) string { +// computeSignatureWithSecret builds the canonical request and computes the AWS Signature V4 signature +// using the provided secret key. +func computeSignatureWithSecret(c *fiber.Ctx, secretKey, date, timestamp, region, service, signedHeaders string) string { // Build canonical URI (URI-encoded path) path := c.Path() if path == "" { @@ -184,7 +207,7 @@ func (gw *GatewayConfig) computeSignature(c *fiber.Ctx, date, timestamp, region, ) // Derive signing key and compute signature - signingKey := auth.GetSigningKey(gw.SecretKey, date, region, service) + signingKey := auth.GetSigningKey(secretKey, date, region, service) signature := auth.HmacSHA256Hex(signingKey, stringToSign) return signature diff --git a/hive/gateway/auth_test.go b/hive/gateway/auth_test.go index ae9670d5d..d6350e0bb 100644 --- a/hive/gateway/auth_test.go +++ b/hive/gateway/auth_test.go @@ -1,6 +1,7 @@ package gateway import ( + "errors" "fmt" "io" "net/http/httptest" @@ -8,7 +9,10 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/service/iam" "github.com/gofiber/fiber/v2" + "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" "github.com/mulgadc/predastore/auth" ) @@ -19,6 +23,93 @@ const ( testService = "ec2" ) +// mockIAMService implements handlers_iam.IAMService for auth tests. +type mockIAMService struct { + accessKeys map[string]*handlers_iam.AccessKey + masterKey []byte +} + +func (m *mockIAMService) LookupAccessKey(accessKeyID string) (*handlers_iam.AccessKey, error) { + ak, ok := m.accessKeys[accessKeyID] + if !ok { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + return ak, nil +} + +func (m *mockIAMService) CreateUser(_ string, _ *iam.CreateUserInput) (*iam.CreateUserOutput, error) { + return nil, nil +} +func (m *mockIAMService) GetUser(_ string, _ *iam.GetUserInput) (*iam.GetUserOutput, error) { + return nil, nil +} +func (m *mockIAMService) ListUsers(_ string, _ *iam.ListUsersInput) (*iam.ListUsersOutput, error) { + return nil, nil +} +func (m *mockIAMService) DeleteUser(_ string, _ *iam.DeleteUserInput) (*iam.DeleteUserOutput, error) { + return nil, nil +} +func (m *mockIAMService) CreateAccessKey(_ string, _ *iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) { + return nil, nil +} +func (m *mockIAMService) ListAccessKeys(_ string, _ *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) { + return nil, nil +} +func (m *mockIAMService) DeleteAccessKey(_ string, _ *iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) { + return nil, nil +} +func (m *mockIAMService) UpdateAccessKey(_ string, _ *iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) { + return nil, nil +} +func (m *mockIAMService) CreatePolicy(_ string, _ *iam.CreatePolicyInput) (*iam.CreatePolicyOutput, error) { + return nil, nil +} +func (m *mockIAMService) GetPolicy(_ string, _ *iam.GetPolicyInput) (*iam.GetPolicyOutput, error) { + return nil, nil +} +func (m *mockIAMService) GetPolicyVersion(_ string, _ *iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error) { + return nil, nil +} +func (m *mockIAMService) ListPolicies(_ string, _ *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) { + return nil, nil +} +func (m *mockIAMService) DeletePolicy(_ string, _ *iam.DeletePolicyInput) (*iam.DeletePolicyOutput, error) { + return nil, nil +} +func (m *mockIAMService) AttachUserPolicy(_ string, _ *iam.AttachUserPolicyInput) (*iam.AttachUserPolicyOutput, error) { + return nil, nil +} +func (m *mockIAMService) DetachUserPolicy(_ string, _ *iam.DetachUserPolicyInput) (*iam.DetachUserPolicyOutput, error) { + return nil, nil +} +func (m *mockIAMService) ListAttachedUserPolicies(_ string, _ *iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) { + return nil, nil +} +func (m *mockIAMService) GetUserPolicies(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return nil, nil +} +func (m *mockIAMService) DecryptSecret(ciphertext string) (string, error) { + return handlers_iam.DecryptSecret(ciphertext, m.masterKey) +} +func (m *mockIAMService) SeedRootUser(_ *handlers_iam.BootstrapData) error { return nil } +func (m *mockIAMService) IsEmpty() (bool, error) { return true, nil } +func (m *mockIAMService) CreateAccount(_ string) (*handlers_iam.Account, error) { + return nil, nil +} +func (m *mockIAMService) GetAccount(_ string) (*handlers_iam.Account, error) { return nil, nil } +func (m *mockIAMService) ListAccounts() ([]*handlers_iam.Account, error) { return nil, nil } + +// testMasterKey is a fixed 32-byte key for deterministic tests. +var testMasterKey []byte + +func init() { + var err error + testMasterKey, err = handlers_iam.GenerateMasterKey() + if err != nil { + panic("failed to generate test master key: " + err.Error()) + } +} + // generateTestAuthHeader creates a valid AWS SigV4 Authorization header for testing. func generateTestAuthHeader(method, path, queryString, body, accessKey, secretKey, region, service string) (authHeader, timestamp string) { now := time.Now().UTC() @@ -83,11 +174,27 @@ func generateTestAuthHeader(method, path, queryString, body, accessKey, secretKe } func setupTestApp(accessKey, secretKey string) *fiber.App { + encryptedSecret, err := handlers_iam.EncryptSecret(secretKey, testMasterKey) + if err != nil { + panic("failed to encrypt test secret: " + err.Error()) + } + + mockSvc := &mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + accessKey: { + AccessKeyID: accessKey, + SecretAccessKey: encryptedSecret, + UserName: "root", + Status: "Active", + }, + }, + } + gw := &GatewayConfig{ DisableLogging: true, - AccessKey: accessKey, - SecretKey: secretKey, Region: testRegion, + IAMService: mockSvc, } app := fiber.New() @@ -309,6 +416,156 @@ func TestSigV4Auth_ValidSignatureWithQueryString(t *testing.T) { } } +func TestSigV4Auth_InactiveAccessKey(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "root", + Status: "Inactive", + }, + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 403 { + t.Errorf("Expected status 403 for inactive key, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "InvalidClientTokenId") { + t.Errorf("Expected InvalidClientTokenId error, got: %s", string(body)) + } +} + +func TestSigV4Auth_NilIAMService(t *testing.T) { + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: nil, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 500 { + t.Errorf("Expected status 500 for nil IAM service, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "InternalError") { + t.Errorf("Expected InternalError, got: %s", string(body)) + } +} + +func TestSigV4Auth_CallerIdentity(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + Status: "Active", + }, + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + identity := c.Locals("sigv4.identity") + return c.SendString(fmt.Sprintf("identity=%v", identity)) + }) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Fatalf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } + + body, _ := io.ReadAll(resp.Body) + if string(body) != "identity=alice" { + t.Errorf("Expected identity=alice, got: %s", string(body)) + } +} + func TestParseAWSQueryArgs_URLDecoding(t *testing.T) { testCases := []struct { name string @@ -360,6 +617,66 @@ func TestBuildCanonicalQueryString(t *testing.T) { } } +func TestSigV4Auth_DecryptFailure(t *testing.T) { + // Encrypt secret with a DIFFERENT master key so decryption fails + otherKey, err := handlers_iam.GenerateMasterKey() + if err != nil { + t.Fatalf("GenerateMasterKey() error: %v", err) + } + encryptedWithOther, err := handlers_iam.EncryptSecret(testSecretKey, otherKey) + if err != nil { + t.Fatalf("EncryptSecret() error: %v", err) + } + + mockSvc := &mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedWithOther, // encrypted with wrong key + UserName: "root", + Status: "Active", + }, + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 500 { + t.Errorf("Expected status 500 for decrypt failure, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "InternalError") { + t.Errorf("Expected InternalError, got: %s", string(body)) + } +} + func TestCanonicalHeaderName(t *testing.T) { testCases := []struct { input string @@ -379,3 +696,979 @@ func TestCanonicalHeaderName(t *testing.T) { }) } } + +// generateTestAuthHeaderAt creates a valid AWS SigV4 Authorization header at a specific time. +func generateTestAuthHeaderAt(method, path, queryString, body, accessKey, secretKey, region, service string, at time.Time) (authHeader, timestamp string) { + timestamp = at.Format(auth.TimeFormat) + date := at.Format(auth.ShortTimeFormat) + + canonicalURI := auth.UriEncode(path, false) + if canonicalURI == "" { + canonicalURI = "/" + } + + canonicalQueryString := buildCanonicalQueryString(queryString) + + host := "localhost:9999" + canonicalHeaders := fmt.Sprintf("host:%s\nx-amz-date:%s\n", host, timestamp) + signedHeaders := "host;x-amz-date" + payloadHash := auth.HashSHA256(body) + + canonicalRequest := fmt.Sprintf( + "%s\n%s\n%s\n%s\n%s\n%s", + method, canonicalURI, canonicalQueryString, canonicalHeaders, signedHeaders, payloadHash, + ) + + hashedCanonicalRequest := auth.HashSHA256(canonicalRequest) + scope := fmt.Sprintf("%s/%s/%s/aws4_request", date, region, service) + stringToSign := fmt.Sprintf("AWS4-HMAC-SHA256\n%s\n%s\n%s", timestamp, scope, hashedCanonicalRequest) + + signingKey := auth.GetSigningKey(secretKey, date, region, service) + signature := auth.HmacSHA256Hex(signingKey, stringToSign) + + authHeader = fmt.Sprintf( + "AWS4-HMAC-SHA256 Credential=%s/%s/%s/%s/aws4_request, SignedHeaders=%s, Signature=%s", + accessKey, date, region, service, signedHeaders, signature, + ) + return authHeader, timestamp +} + +// generateTestAuthHeaderWithSignedHeaders creates a SigV4 header with custom signed headers. +func generateTestAuthHeaderWithSignedHeaders(method, path, queryString, body, accessKey, secretKey, region, service string, headers map[string]string, signedHeadersList string) (authHeader, timestamp string) { + now := time.Now().UTC() + timestamp = now.Format(auth.TimeFormat) + date := now.Format(auth.ShortTimeFormat) + + canonicalURI := auth.UriEncode(path, false) + if canonicalURI == "" { + canonicalURI = "/" + } + + canonicalQueryString := buildCanonicalQueryString(queryString) + + // Build canonical headers from the signed headers list + headerNames := strings.Split(signedHeadersList, ";") + var canonicalHeaders strings.Builder + for _, h := range headerNames { + h = strings.TrimSpace(h) + value := headers[h] + canonicalHeaders.WriteString(h) + canonicalHeaders.WriteString(":") + canonicalHeaders.WriteString(value) + canonicalHeaders.WriteString("\n") + } + + payloadHash := auth.HashSHA256(body) + + canonicalRequest := fmt.Sprintf( + "%s\n%s\n%s\n%s\n%s\n%s", + method, canonicalURI, canonicalQueryString, canonicalHeaders.String(), signedHeadersList, payloadHash, + ) + + hashedCanonicalRequest := auth.HashSHA256(canonicalRequest) + scope := fmt.Sprintf("%s/%s/%s/aws4_request", date, region, service) + stringToSign := fmt.Sprintf("AWS4-HMAC-SHA256\n%s\n%s\n%s", timestamp, scope, hashedCanonicalRequest) + + signingKey := auth.GetSigningKey(secretKey, date, region, service) + signature := auth.HmacSHA256Hex(signingKey, stringToSign) + + authHeader = fmt.Sprintf( + "AWS4-HMAC-SHA256 Credential=%s/%s/%s/%s/aws4_request, SignedHeaders=%s, Signature=%s", + accessKey, date, region, service, signedHeadersList, signature, + ) + return authHeader, timestamp +} + +// --- Clock Skew / Replay Protection Tests --- + +func TestSigV4Auth_ExpiredTimestamp(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + // 6 minutes in the past — exceeds the 5-minute maxClockSkew + past := time.Now().UTC().Add(-6 * time.Minute) + authHeader, timestamp := generateTestAuthHeaderAt( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, past, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 403 { + t.Errorf("Expected status 403, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "SignatureDoesNotMatch") { + t.Errorf("Expected SignatureDoesNotMatch error, got: %s", string(body)) + } +} + +func TestSigV4Auth_FutureTimestamp(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + // 6 minutes in the future — exceeds the 5-minute maxClockSkew + future := time.Now().UTC().Add(6 * time.Minute) + authHeader, timestamp := generateTestAuthHeaderAt( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, future, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 403 { + t.Errorf("Expected status 403, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "SignatureDoesNotMatch") { + t.Errorf("Expected SignatureDoesNotMatch error, got: %s", string(body)) + } +} + +func TestSigV4Auth_TimestampWithinSkew(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + // 4 minutes ago — within the 5-minute window + recent := time.Now().UTC().Add(-4 * time.Minute) + authHeader, timestamp := generateTestAuthHeaderAt( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, recent, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } +} + +func TestSigV4Auth_MissingXAmzDate(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + authHeader, _ := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + // Deliberately omit X-Amz-Date + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 400 { + t.Errorf("Expected status 400, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "IncompleteSignature") { + t.Errorf("Expected IncompleteSignature error, got: %s", string(body)) + } +} + +func TestSigV4Auth_MalformedTimestamp(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + authHeader, _ := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", "not-a-valid-date") + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 400 { + t.Errorf("Expected status 400, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "IncompleteSignature") { + t.Errorf("Expected IncompleteSignature error, got: %s", string(body)) + } +} + +// --- Context Propagation Tests --- + +func TestSigV4Auth_ContextPropagation(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + AccountID: "123456789012", + Status: "Active", + }, + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + identity := c.Locals("sigv4.identity") + accountId := c.Locals("sigv4.accountId") + service := c.Locals("sigv4.service") + region := c.Locals("sigv4.region") + accessKey := c.Locals("sigv4.accessKey") + return c.SendString(fmt.Sprintf( + "identity=%v|accountId=%v|service=%v|region=%v|accessKey=%v", + identity, accountId, service, region, accessKey, + )) + }) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Fatalf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } + + body, _ := io.ReadAll(resp.Body) + result := string(body) + + checks := []struct { + label string + expected string + }{ + {"identity", "identity=alice"}, + {"accountId", "accountId=123456789012"}, + {"service", "service=ec2"}, + {"region", "region=us-east-1"}, + {"accessKey", "accessKey=" + testAccessKey}, + } + for _, check := range checks { + if !strings.Contains(result, check.expected) { + t.Errorf("Expected %s in response, got: %s", check.expected, result) + } + } +} + +// --- LookupAccessKey Error Variants --- + +func TestSigV4Auth_LookupAccessKeyUnexpectedError(t *testing.T) { + // A non-NoSuchEntity error from LookupAccessKey should yield 500 InternalError. + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: &errorLookupMockIAMService{err: errors.New("nats: connection closed")}, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 500 { + t.Errorf("Expected status 500 for unexpected lookup error, got %d", resp.StatusCode) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "InternalError") { + t.Errorf("Expected InternalError, got: %s", string(body)) + } +} + +// --- Signature Edge Cases --- + +func TestSigV4Auth_PathWithSpecialCharacters(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + testCases := []struct { + name string + path string + }{ + {"encoded space", "/my%20resource"}, + {"nested slashes", "/a/b/c/d"}, + {"trailing slash", "/path/"}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + authHeader, timestamp := generateTestAuthHeader( + "GET", tc.path, "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", tc.path, nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } + }) + } +} + +func TestSigV4Auth_SignedContentType(t *testing.T) { + // Verify signature works when content-type is included in signed headers. + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "root", + Status: "Active", + }, + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := fiber.New() + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + + body := "Action=DescribeInstances" + headers := map[string]string{ + "content-type": "application/x-www-form-urlencoded", + "host": "localhost:9999", + } + + // Include content-type in signed headers + now := time.Now().UTC() + headers["x-amz-date"] = now.Format(auth.TimeFormat) + authHeader, timestamp := generateTestAuthHeaderWithSignedHeaders( + "POST", "/", "", body, + testAccessKey, testSecretKey, testRegion, testService, + headers, "content-type;host;x-amz-date", + ) + + req := httptest.NewRequest("POST", "/", strings.NewReader(body)) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + respBody, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200, got %d, body: %s", resp.StatusCode, string(respBody)) + } +} + +func TestSigV4Auth_EmptyBodyPOST(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + // POST with empty body — payload hash is hash of "" + authHeader, timestamp := generateTestAuthHeader( + "POST", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("POST", "/", strings.NewReader("")) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } +} + +func TestSigV4Auth_QueryStringEdgeCases(t *testing.T) { + app := setupTestApp(testAccessKey, testSecretKey) + + testCases := []struct { + name string + queryString string + }{ + {"empty value", "key="}, + {"special chars in value", "Name=hello%20world&Tag=foo%2Fbar"}, + {"duplicate keys", "Filter=a&Filter=b"}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", tc.queryString, "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/?"+tc.queryString, nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } + }) + } +} + +// --- Policy Enforcement Tests (checkPolicy) --- + +// policyMockIAMService extends mockIAMService with configurable GetUserPolicies. +type policyMockIAMService struct { + mockIAMService + getUserPoliciesFn func(accountID, userName string) ([]handlers_iam.PolicyDocument, error) +} + +func (m *policyMockIAMService) GetUserPolicies(accountID, userName string) ([]handlers_iam.PolicyDocument, error) { + if m.getUserPoliciesFn != nil { + return m.getUserPoliciesFn(accountID, userName) + } + return nil, nil +} + +// errorLookupMockIAMService returns a configurable error from LookupAccessKey. +type errorLookupMockIAMService struct { + mockIAMService + err error +} + +func (m *errorLookupMockIAMService) LookupAccessKey(_ string) (*handlers_iam.AccessKey, error) { + return nil, m.err +} + +// setupPolicyTestApp creates a Fiber app that authenticates with SigV4 then calls checkPolicy. +func setupPolicyTestApp(gw *GatewayConfig) *fiber.App { + app := fiber.New(fiber.Config{ + ErrorHandler: func(ctx *fiber.Ctx, err error) error { + return gw.ErrorHandler(ctx, err) + }, + }) + app.Use(gw.SigV4AuthMiddleware()) + app.All("/*", func(c *fiber.Ctx) error { + if err := gw.checkPolicy(c, "ec2", "RunInstances"); err != nil { + return err + } + return c.SendString("OK") + }) + return app +} + +func TestCheckPolicy_NonRootNoPolicies_Denied(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + AccountID: "123456789012", + Status: "Active", + }, + }, + }, + getUserPoliciesFn: func(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return nil, nil // no policies + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 403 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 403, got %d, body: %s", resp.StatusCode, string(body)) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "AccessDenied") { + t.Errorf("Expected AccessDenied error, got: %s", string(body)) + } +} + +func TestCheckPolicy_NonRootWithAllow_Passes(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + AccountID: "123456789012", + Status: "Active", + }, + }, + }, + getUserPoliciesFn: func(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return []handlers_iam.PolicyDocument{ + { + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + { + Effect: "Allow", + Action: handlers_iam.StringOrArr{"ec2:RunInstances"}, + Resource: handlers_iam.StringOrArr{"*"}, + }, + }, + }, + }, nil + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200, got %d, body: %s", resp.StatusCode, string(body)) + } +} + +func TestCheckPolicy_NonRootWithExplicitDeny_Denied(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + AccountID: "123456789012", + Status: "Active", + }, + }, + }, + getUserPoliciesFn: func(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return []handlers_iam.PolicyDocument{ + { + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + { + Effect: "Allow", + Action: handlers_iam.StringOrArr{"ec2:*"}, + Resource: handlers_iam.StringOrArr{"*"}, + }, + { + Effect: "Deny", + Action: handlers_iam.StringOrArr{"ec2:RunInstances"}, + Resource: handlers_iam.StringOrArr{"*"}, + }, + }, + }, + }, nil + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 403 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 403, got %d, body: %s", resp.StatusCode, string(body)) + } + + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), "AccessDenied") { + t.Errorf("Expected AccessDenied error, got: %s", string(body)) + } +} + +func TestCheckPolicy_RootGlobalAccount_Bypasses(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "root", + AccountID: handlers_iam.GlobalAccountID, + Status: "Active", + }, + }, + }, + getUserPoliciesFn: func(_, _ string) ([]handlers_iam.PolicyDocument, error) { + // Return explicit deny — root should bypass anyway + return []handlers_iam.PolicyDocument{ + { + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + { + Effect: "Deny", + Action: handlers_iam.StringOrArr{"*"}, + Resource: handlers_iam.StringOrArr{"*"}, + }, + }, + }, + }, nil + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 200 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 200 (root bypass), got %d, body: %s", resp.StatusCode, string(body)) + } +} + +func TestCheckPolicy_MissingAccountID_InternalError(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + // AccessKey with empty AccountID — checkPolicy should return InternalError + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + AccountID: "", // empty + Status: "Active", + }, + }, + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 500 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 500, got %d, body: %s", resp.StatusCode, string(body)) + } +} + +func TestCheckPolicy_GetUserPoliciesError_InternalError(t *testing.T) { + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "alice", + AccountID: "123456789012", + Status: "Active", + }, + }, + }, + getUserPoliciesFn: func(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return nil, errors.New("nats: timeout") + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + if resp.StatusCode != 500 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 500, got %d, body: %s", resp.StatusCode, string(body)) + } +} + +func TestCheckPolicy_RootNonGlobalAccount_StillEvaluated(t *testing.T) { + // A user named "root" but on a non-global account should still have + // policies evaluated (only root + GlobalAccountID bypasses). + encryptedSecret, err := handlers_iam.EncryptSecret(testSecretKey, testMasterKey) + if err != nil { + t.Fatalf("Failed to encrypt secret: %v", err) + } + + mockSvc := &policyMockIAMService{ + mockIAMService: mockIAMService{ + masterKey: testMasterKey, + accessKeys: map[string]*handlers_iam.AccessKey{ + testAccessKey: { + AccessKeyID: testAccessKey, + SecretAccessKey: encryptedSecret, + UserName: "root", + AccountID: "999999999999", // not GlobalAccountID + Status: "Active", + }, + }, + }, + getUserPoliciesFn: func(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return nil, nil // no policies → should deny + }, + } + + gw := &GatewayConfig{ + DisableLogging: true, + Region: testRegion, + IAMService: mockSvc, + } + + app := setupPolicyTestApp(gw) + + authHeader, timestamp := generateTestAuthHeader( + "GET", "/", "", "", + testAccessKey, testSecretKey, testRegion, testService, + ) + + req := httptest.NewRequest("GET", "/", nil) + req.Host = "localhost:9999" + req.Header.Set("Authorization", authHeader) + req.Header.Set("X-Amz-Date", timestamp) + + resp, err := app.Test(req) + if err != nil { + t.Fatalf("Failed to test request: %v", err) + } + + // root on non-global account is evaluated by the policy engine like any + // other user. With no policies attached, the default deny applies. + if resp.StatusCode != 403 { + body, _ := io.ReadAll(resp.Body) + t.Errorf("Expected status 403, got %d, body: %s", resp.StatusCode, string(body)) + } +} diff --git a/hive/gateway/ec2.go b/hive/gateway/ec2.go index ccdf981c0..01cb45f64 100644 --- a/hive/gateway/ec2.go +++ b/hive/gateway/ec2.go @@ -236,6 +236,10 @@ func (gw *GatewayConfig) EC2_Request(ctx *fiber.Ctx) error { return errors.New(awserrors.ErrorInvalidAction) } + if err := gw.checkPolicy(ctx, "ec2", action); err != nil { + return err + } + if gw.NATSConn == nil && !ec2LocalActions[action] { return errors.New(awserrors.ErrorServerInternal) } diff --git a/hive/gateway/gateway.go b/hive/gateway/gateway.go index e39d89e40..88a849f12 100644 --- a/hive/gateway/gateway.go +++ b/hive/gateway/gateway.go @@ -4,6 +4,7 @@ import ( "encoding/json" "encoding/xml" "errors" + "fmt" "log/slog" "net/url" "os" @@ -16,6 +17,8 @@ import ( "github.com/google/uuid" "github.com/mulgadc/hive/hive/awsec2query" "github.com/mulgadc/hive/hive/awserrors" + "github.com/mulgadc/hive/hive/gateway/policy" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" "github.com/nats-io/nats.go" ) @@ -27,8 +30,7 @@ type GatewayConfig struct { ExpectedNodes int // Number of expected hive nodes for multi-node operations Region string // Region this gateway is running in AZ string // Availability zone this gateway is running in - AccessKey string // AWS Access Key ID for authentication - SecretKey string // AWS Secret Access Key for authentication + IAMService handlers_iam.IAMService } var supportedServices = map[string]bool{ @@ -169,14 +171,59 @@ func (gw *GatewayConfig) GetService(ctx *fiber.Ctx) (string, error) { return svc, nil } -func (gw *GatewayConfig) ErrorHandler(ctx *fiber.Ctx, err error) error { - // TODO: Support service type specific errors (e.g EC2, S3, IAM, differ) +// checkPolicy evaluates IAM policies for the current request. Returns nil +// if access is allowed, or an ErrorAccessDenied error if denied. +// Root users bypass evaluation entirely. If the IAM service is unavailable, +// access is allowed (pre-IAM compatibility). +func (gw *GatewayConfig) checkPolicy(ctx *fiber.Ctx, service, action string) error { + if gw.IAMService == nil { + slog.Warn("checkPolicy: IAM service not available, skipping policy check", + "service", service, "action", action) + return nil + } + identityVal := ctx.Locals("sigv4.identity") + if identityVal == nil { + // No auth context — pre-IAM compatibility + return nil + } + identity, ok := identityVal.(string) + if !ok { + slog.Error("checkPolicy: identity has unexpected type", "type", fmt.Sprintf("%T", identityVal)) + return errors.New(awserrors.ErrorInternalError) + } + // Extract account ID from auth context + accountID, _ := ctx.Locals("sigv4.accountId").(string) + if accountID == "" { + slog.Error("checkPolicy: no account ID in auth context", "user", identity) + return errors.New(awserrors.ErrorInternalError) + } + + if identity == "" || (identity == "root" && accountID == handlers_iam.GlobalAccountID) { + return nil + } + + // Resolve the IAM action string (e.g. "ec2:RunInstances") + iamAction := policy.IAMAction(service, action) + + policies, err := gw.IAMService.GetUserPolicies(accountID, identity) + if err != nil { + slog.Error("checkPolicy: failed to get user policies", "user", identity, "err", err) + return errors.New(awserrors.ErrorInternalError) + } + + if policy.EvaluateAccess(identity, iamAction, "*", policies) == policy.Deny { + slog.Info("checkPolicy: access denied", "user", identity, "action", iamAction) + return errors.New(awserrors.ErrorAccessDenied) + } + + return nil +} + +func (gw *GatewayConfig) ErrorHandler(ctx *fiber.Ctx, err error) error { svc, _ := gw.GetService(ctx) slog.Debug("ErrorHandler", "service", svc, "error", err.Error()) - // Status code defaults to 500 - // Get the request ID var requestId = uuid.NewString() requestId = ctx.Get("x-amz-request-id", requestId) @@ -191,7 +238,13 @@ func (gw *GatewayConfig) ErrorHandler(ctx *fiber.Ctx, err error) error { errorMsg = awserrors.ErrorLookup[err.Error()] - xmlError := GenerateEC2ErrorResponse(err.Error(), errorMsg.Message, requestId) + // IAM uses a different error XML format than EC2 + var xmlError []byte + if svc == "iam" { + xmlError = GenerateIAMErrorResponse(err.Error(), errorMsg.Message, requestId) + } else { + xmlError = GenerateEC2ErrorResponse(err.Error(), errorMsg.Message, requestId) + } slog.Debug("Generated error response", "error", err.Error(), "xml", string(xmlError), "requestId", requestId) @@ -199,7 +252,6 @@ func (gw *GatewayConfig) ErrorHandler(ctx *fiber.Ctx, err error) error { errorMsg.HTTPCode = 500 } - // Set standard S3 error response headers ctx.Set("Content-Type", "application/xml") return ctx.Status(errorMsg.HTTPCode).Send(xmlError) } @@ -239,7 +291,7 @@ func GenerateEC2ErrorResponse(code, message, requestID string) (output []byte) { if err != nil { slog.Error("Failed to build XML", "error", err) - return nil + return []byte(xml.Header + "InternalErrorInternal error" + requestID + "") } // Add XML header @@ -248,6 +300,40 @@ func GenerateEC2ErrorResponse(code, message, requestID string) (output []byte) { return output } +// IAMErrorResponse represents the IAM-style error XML format: +// Sender......... +type IAMErrorResponse struct { + XMLName xml.Name `xml:"ErrorResponse"` + Error IAMErrorDetail `xml:"Error"` + RequestID string `xml:"RequestId"` +} + +type IAMErrorDetail struct { + Type string `xml:"Type"` + Code string `xml:"Code"` + Message string `xml:"Message"` +} + +func GenerateIAMErrorResponse(code, message, requestID string) (output []byte) { + errorXml := IAMErrorResponse{ + Error: IAMErrorDetail{ + Type: "Sender", + Code: code, + Message: message, + }, + RequestID: requestID, + } + + output, err := xml.MarshalIndent(errorXml, "", " ") + if err != nil { + slog.Error("Failed to build IAM error XML", "error", err) + return []byte(xml.Header + "SenderInternalErrorInternal error" + requestID + "") + } + + output = append([]byte(xml.Header), output...) + return output +} + func ParseArgsToStruct(input *any, args map[string]string) (err error) { // Generated from input shape: RunInstancesRequest diff --git a/hive/gateway/gateway_test.go b/hive/gateway/gateway_test.go index ac077797c..e8eeb5bb9 100644 --- a/hive/gateway/gateway_test.go +++ b/hive/gateway/gateway_test.go @@ -3,11 +3,15 @@ package gateway import ( "encoding/json" "encoding/xml" + "errors" "io" + "net/http/httptest" "strings" "testing" "time" + "github.com/gofiber/fiber/v2" + "github.com/mulgadc/hive/hive/awserrors" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" @@ -85,6 +89,97 @@ func TestGenerateEC2ErrorResponse_ValidXML(t *testing.T) { } } +func TestGenerateIAMErrorResponse_Structure(t *testing.T) { + tests := []struct { + name string + code string + message string + requestID string + }{ + { + name: "entity not found", + code: "NoSuchEntity", + message: "The request was rejected because it referenced a resource entity that does not exist.", + requestID: "req-iam-001", + }, + { + name: "entity already exists", + code: "EntityAlreadyExists", + message: "The request was rejected because it attempted to create a resource that already exists.", + requestID: "req-iam-002", + }, + { + name: "empty fields", + code: "", + message: "", + requestID: "", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + output := GenerateIAMErrorResponse(tc.code, tc.message, tc.requestID) + require.NotNil(t, output) + + xmlStr := string(output) + + // Verify XML header + assert.True(t, strings.HasPrefix(xmlStr, xml.Header)) + + // IAM uses root, not + assert.Contains(t, xmlStr, "") + assert.Contains(t, xmlStr, "") + assert.NotContains(t, xmlStr, "") + + // Verify IAM-specific structure + assert.Contains(t, xmlStr, "Sender") + assert.Contains(t, xmlStr, ""+tc.code+"") + assert.Contains(t, xmlStr, ""+tc.requestID+"") + }) + } +} + +func TestGenerateIAMErrorResponse_ValidXML(t *testing.T) { + output := GenerateIAMErrorResponse("NoSuchEntity", "Entity not found", "req-iam-999") + require.NotNil(t, output) + + xmlBody := strings.TrimPrefix(string(output), xml.Header) + decoder := xml.NewDecoder(strings.NewReader(xmlBody)) + for { + _, err := decoder.Token() + if err != nil { + assert.ErrorIs(t, err, io.EOF) + break + } + } +} + +func TestErrorHandler_IAMService(t *testing.T) { + gw := &GatewayConfig{DisableLogging: true} + app := fiber.New(fiber.Config{ + ErrorHandler: func(ctx *fiber.Ctx, err error) error { + return gw.ErrorHandler(ctx, err) + }, + }) + app.Get("/", func(c *fiber.Ctx) error { + c.Locals("sigv4.service", "iam") + return errors.New(awserrors.ErrorIAMNoSuchEntity) + }) + + req := httptest.NewRequest("GET", "/", nil) + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 404, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + xmlStr := string(body) + // IAM format uses not + assert.Contains(t, xmlStr, "") + assert.Contains(t, xmlStr, "Sender") + assert.Contains(t, xmlStr, "NoSuchEntity") + assert.NotContains(t, xmlStr, "") +} + func startTestNATS(t *testing.T) *nats.Conn { t.Helper() ns, err := server.NewServer(&server.Options{ diff --git a/hive/gateway/iam.go b/hive/gateway/iam.go index d6d98c6fd..30a3ffb79 100644 --- a/hive/gateway/iam.go +++ b/hive/gateway/iam.go @@ -1,8 +1,127 @@ package gateway -import "github.com/gofiber/fiber/v2" +import ( + "errors" + "log/slog" + + "github.com/aws/aws-sdk-go/service/iam" + "github.com/gofiber/fiber/v2" + "github.com/mulgadc/hive/hive/awsec2query" + "github.com/mulgadc/hive/hive/awserrors" + gateway_iam "github.com/mulgadc/hive/hive/gateway/iam" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" + "github.com/mulgadc/hive/hive/utils" +) + +// IAMHandler processes parsed query args and returns XML response bytes. +type IAMHandler func(action string, q map[string]string, gw *GatewayConfig, accountID string) ([]byte, error) + +// iamHandler creates a type-safe IAMHandler that allocates the typed input struct, +// parses query params into it, calls the handler, and marshals the output to XML. +func iamHandler[In any](handler func(string, *In, handlers_iam.IAMService) (any, error)) IAMHandler { + return func(action string, q map[string]string, gw *GatewayConfig, accountID string) ([]byte, error) { + input := new(In) + if err := awsec2query.QueryParamsToStruct(q, input); err != nil { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + output, err := handler(accountID, input, gw.IAMService) + if err != nil { + return nil, err + } + payload := utils.GenerateIAMXMLPayload(action, output) + xmlOutput, err := utils.MarshalToXML(payload) + if err != nil { + return nil, errors.New(awserrors.ErrorInternalError) + } + return xmlOutput, nil + } +} + +var iamActions = map[string]IAMHandler{ + "CreateUser": iamHandler(func(accountID string, input *iam.CreateUserInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.CreateUser(accountID, input, svc) + }), + "GetUser": iamHandler(func(accountID string, input *iam.GetUserInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.GetUser(accountID, input, svc) + }), + "ListUsers": iamHandler(func(accountID string, input *iam.ListUsersInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.ListUsers(accountID, input, svc) + }), + "DeleteUser": iamHandler(func(accountID string, input *iam.DeleteUserInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.DeleteUser(accountID, input, svc) + }), + "CreateAccessKey": iamHandler(func(accountID string, input *iam.CreateAccessKeyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.CreateAccessKey(accountID, input, svc) + }), + "ListAccessKeys": iamHandler(func(accountID string, input *iam.ListAccessKeysInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.ListAccessKeys(accountID, input, svc) + }), + "DeleteAccessKey": iamHandler(func(accountID string, input *iam.DeleteAccessKeyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.DeleteAccessKey(accountID, input, svc) + }), + "UpdateAccessKey": iamHandler(func(accountID string, input *iam.UpdateAccessKeyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.UpdateAccessKey(accountID, input, svc) + }), + + // Policy CRUD + "CreatePolicy": iamHandler(func(accountID string, input *iam.CreatePolicyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.CreatePolicy(accountID, input, svc) + }), + "GetPolicy": iamHandler(func(accountID string, input *iam.GetPolicyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.GetPolicy(accountID, input, svc) + }), + "GetPolicyVersion": iamHandler(func(accountID string, input *iam.GetPolicyVersionInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.GetPolicyVersion(accountID, input, svc) + }), + "ListPolicies": iamHandler(func(accountID string, input *iam.ListPoliciesInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.ListPolicies(accountID, input, svc) + }), + "DeletePolicy": iamHandler(func(accountID string, input *iam.DeletePolicyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.DeletePolicy(accountID, input, svc) + }), + + // Policy attachment + "AttachUserPolicy": iamHandler(func(accountID string, input *iam.AttachUserPolicyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.AttachUserPolicy(accountID, input, svc) + }), + "DetachUserPolicy": iamHandler(func(accountID string, input *iam.DetachUserPolicyInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.DetachUserPolicy(accountID, input, svc) + }), + "ListAttachedUserPolicies": iamHandler(func(accountID string, input *iam.ListAttachedUserPoliciesInput, svc handlers_iam.IAMService) (any, error) { + return gateway_iam.ListAttachedUserPolicies(accountID, input, svc) + }), +} func (gw *GatewayConfig) IAM_Request(ctx *fiber.Ctx) error { + queryArgs := ParseAWSQueryArgs(string(ctx.Body())) - return nil + action := queryArgs["Action"] + handler, ok := iamActions[action] + if !ok { + slog.Debug("IAM: unknown action", "action", action) + return errors.New(awserrors.ErrorInvalidAction) + } + + if gw.IAMService == nil { + slog.Error("IAM: service not initialized") + return errors.New(awserrors.ErrorInternalError) + } + + if err := gw.checkPolicy(ctx, "iam", action); err != nil { + return err + } + + // Extract account ID from auth context + accountID, _ := ctx.Locals("sigv4.accountId").(string) + if accountID == "" { + slog.Error("IAM_Request: no account ID in auth context") + return errors.New(awserrors.ErrorInternalError) + } + + xmlOutput, err := handler(action, queryArgs, gw, accountID) + if err != nil { + return err + } + + return ctx.Status(fiber.StatusOK).Type("text/xml").Send(xmlOutput) } diff --git a/hive/gateway/iam/handler_test.go b/hive/gateway/iam/handler_test.go new file mode 100644 index 000000000..3a0af2388 --- /dev/null +++ b/hive/gateway/iam/handler_test.go @@ -0,0 +1,466 @@ +package gateway_iam + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" + "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +const testAccountID = "000000000000" + +// stubIAMService returns empty non-nil outputs for all methods. +type stubIAMService struct{} + +func (s *stubIAMService) CreateUser(_ string, _ *iam.CreateUserInput) (*iam.CreateUserOutput, error) { + return &iam.CreateUserOutput{}, nil +} + +func (s *stubIAMService) GetUser(_ string, _ *iam.GetUserInput) (*iam.GetUserOutput, error) { + return &iam.GetUserOutput{}, nil +} + +func (s *stubIAMService) ListUsers(_ string, _ *iam.ListUsersInput) (*iam.ListUsersOutput, error) { + return &iam.ListUsersOutput{}, nil +} + +func (s *stubIAMService) DeleteUser(_ string, _ *iam.DeleteUserInput) (*iam.DeleteUserOutput, error) { + return &iam.DeleteUserOutput{}, nil +} + +func (s *stubIAMService) CreateAccessKey(_ string, _ *iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) { + return &iam.CreateAccessKeyOutput{}, nil +} + +func (s *stubIAMService) ListAccessKeys(_ string, _ *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) { + return &iam.ListAccessKeysOutput{}, nil +} + +func (s *stubIAMService) DeleteAccessKey(_ string, _ *iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) { + return &iam.DeleteAccessKeyOutput{}, nil +} + +func (s *stubIAMService) UpdateAccessKey(_ string, _ *iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) { + return &iam.UpdateAccessKeyOutput{}, nil +} + +func (s *stubIAMService) CreatePolicy(_ string, _ *iam.CreatePolicyInput) (*iam.CreatePolicyOutput, error) { + return &iam.CreatePolicyOutput{}, nil +} + +func (s *stubIAMService) GetPolicy(_ string, _ *iam.GetPolicyInput) (*iam.GetPolicyOutput, error) { + return &iam.GetPolicyOutput{}, nil +} + +func (s *stubIAMService) GetPolicyVersion(_ string, _ *iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error) { + return &iam.GetPolicyVersionOutput{}, nil +} + +func (s *stubIAMService) ListPolicies(_ string, _ *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) { + return &iam.ListPoliciesOutput{}, nil +} + +func (s *stubIAMService) DeletePolicy(_ string, _ *iam.DeletePolicyInput) (*iam.DeletePolicyOutput, error) { + return &iam.DeletePolicyOutput{}, nil +} + +func (s *stubIAMService) AttachUserPolicy(_ string, _ *iam.AttachUserPolicyInput) (*iam.AttachUserPolicyOutput, error) { + return &iam.AttachUserPolicyOutput{}, nil +} + +func (s *stubIAMService) DetachUserPolicy(_ string, _ *iam.DetachUserPolicyInput) (*iam.DetachUserPolicyOutput, error) { + return &iam.DetachUserPolicyOutput{}, nil +} + +func (s *stubIAMService) ListAttachedUserPolicies(_ string, _ *iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) { + return &iam.ListAttachedUserPoliciesOutput{}, nil +} + +func (s *stubIAMService) GetUserPolicies(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return nil, nil +} + +func (s *stubIAMService) LookupAccessKey(_ string) (*handlers_iam.AccessKey, error) { + return nil, nil +} + +func (s *stubIAMService) DecryptSecret(_ string) (string, error) { return "", nil } +func (s *stubIAMService) SeedRootUser(_ *handlers_iam.BootstrapData) error { return nil } +func (s *stubIAMService) IsEmpty() (bool, error) { return true, nil } + +func (s *stubIAMService) CreateAccount(_ string) (*handlers_iam.Account, error) { + return nil, nil +} +func (s *stubIAMService) GetAccount(_ string) (*handlers_iam.Account, error) { return nil, nil } +func (s *stubIAMService) ListAccounts() ([]*handlers_iam.Account, error) { return nil, nil } + +func TestCreateUser(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.CreateUserInput + wantErr string + }{ + {"nil UserName", &iam.CreateUserInput{}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.CreateUserInput{UserName: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.CreateUserInput{UserName: aws.String("alice")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := CreateUser(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestGetUser(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.GetUserInput + wantErr string + }{ + {"nil UserName", &iam.GetUserInput{}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.GetUserInput{UserName: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.GetUserInput{UserName: aws.String("alice")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := GetUser(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestListUsers(t *testing.T) { + svc := &stubIAMService{} + _, err := ListUsers(testAccountID, &iam.ListUsersInput{}, svc) + require.NoError(t, err) +} + +func TestDeleteUser(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.DeleteUserInput + wantErr string + }{ + {"nil UserName", &iam.DeleteUserInput{}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.DeleteUserInput{UserName: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.DeleteUserInput{UserName: aws.String("alice")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := DeleteUser(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestCreateAccessKey(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.CreateAccessKeyInput + wantErr string + }{ + {"nil UserName", &iam.CreateAccessKeyInput{}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.CreateAccessKeyInput{UserName: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.CreateAccessKeyInput{UserName: aws.String("alice")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := CreateAccessKey(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestListAccessKeys(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.ListAccessKeysInput + wantErr string + }{ + {"nil UserName", &iam.ListAccessKeysInput{}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.ListAccessKeysInput{UserName: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.ListAccessKeysInput{UserName: aws.String("alice")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := ListAccessKeys(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestDeleteAccessKey(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.DeleteAccessKeyInput + wantErr string + }{ + {"nil UserName", &iam.DeleteAccessKeyInput{AccessKeyId: aws.String("AKIA123")}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.DeleteAccessKeyInput{UserName: aws.String(""), AccessKeyId: aws.String("AKIA123")}, awserrors.ErrorMissingParameter}, + {"nil AccessKeyId", &iam.DeleteAccessKeyInput{UserName: aws.String("alice")}, awserrors.ErrorMissingParameter}, + {"empty AccessKeyId", &iam.DeleteAccessKeyInput{UserName: aws.String("alice"), AccessKeyId: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.DeleteAccessKeyInput{UserName: aws.String("alice"), AccessKeyId: aws.String("AKIA123")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := DeleteAccessKey(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestUpdateAccessKey(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.UpdateAccessKeyInput + wantErr string + }{ + {"nil AccessKeyId", &iam.UpdateAccessKeyInput{Status: aws.String("Active")}, awserrors.ErrorMissingParameter}, + {"empty AccessKeyId", &iam.UpdateAccessKeyInput{AccessKeyId: aws.String(""), Status: aws.String("Active")}, awserrors.ErrorMissingParameter}, + {"nil Status", &iam.UpdateAccessKeyInput{AccessKeyId: aws.String("AKIA123")}, awserrors.ErrorMissingParameter}, + {"empty Status", &iam.UpdateAccessKeyInput{AccessKeyId: aws.String("AKIA123"), Status: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.UpdateAccessKeyInput{AccessKeyId: aws.String("AKIA123"), Status: aws.String("Active")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := UpdateAccessKey(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +// --- Policy CRUD --- + +func TestCreatePolicy(t *testing.T) { + svc := &stubIAMService{} + doc := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}` + tests := []struct { + name string + input *iam.CreatePolicyInput + wantErr string + }{ + {"nil PolicyName", &iam.CreatePolicyInput{PolicyDocument: aws.String(doc)}, awserrors.ErrorMissingParameter}, + {"empty PolicyName", &iam.CreatePolicyInput{PolicyName: aws.String(""), PolicyDocument: aws.String(doc)}, awserrors.ErrorMissingParameter}, + {"nil PolicyDocument", &iam.CreatePolicyInput{PolicyName: aws.String("mypolicy")}, awserrors.ErrorMissingParameter}, + {"empty PolicyDocument", &iam.CreatePolicyInput{PolicyName: aws.String("mypolicy"), PolicyDocument: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.CreatePolicyInput{PolicyName: aws.String("mypolicy"), PolicyDocument: aws.String(doc)}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := CreatePolicy(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestGetPolicy(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.GetPolicyInput + wantErr string + }{ + {"nil PolicyArn", &iam.GetPolicyInput{}, awserrors.ErrorMissingParameter}, + {"empty PolicyArn", &iam.GetPolicyInput{PolicyArn: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.GetPolicyInput{PolicyArn: aws.String("arn:aws:iam::000000000000:policy/mypolicy")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := GetPolicy(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestGetPolicyVersion(t *testing.T) { + svc := &stubIAMService{} + arn := "arn:aws:iam::000000000000:policy/mypolicy" + tests := []struct { + name string + input *iam.GetPolicyVersionInput + wantErr string + }{ + {"nil PolicyArn", &iam.GetPolicyVersionInput{VersionId: aws.String("v1")}, awserrors.ErrorMissingParameter}, + {"empty PolicyArn", &iam.GetPolicyVersionInput{PolicyArn: aws.String(""), VersionId: aws.String("v1")}, awserrors.ErrorMissingParameter}, + {"nil VersionId", &iam.GetPolicyVersionInput{PolicyArn: aws.String(arn)}, awserrors.ErrorMissingParameter}, + {"empty VersionId", &iam.GetPolicyVersionInput{PolicyArn: aws.String(arn), VersionId: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.GetPolicyVersionInput{PolicyArn: aws.String(arn), VersionId: aws.String("v1")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := GetPolicyVersion(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestListPolicies(t *testing.T) { + svc := &stubIAMService{} + _, err := ListPolicies(testAccountID, &iam.ListPoliciesInput{}, svc) + require.NoError(t, err) +} + +func TestDeletePolicy(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.DeletePolicyInput + wantErr string + }{ + {"nil PolicyArn", &iam.DeletePolicyInput{}, awserrors.ErrorMissingParameter}, + {"empty PolicyArn", &iam.DeletePolicyInput{PolicyArn: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.DeletePolicyInput{PolicyArn: aws.String("arn:aws:iam::000000000000:policy/mypolicy")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := DeletePolicy(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +// --- Policy Attachment --- + +func TestAttachUserPolicy(t *testing.T) { + svc := &stubIAMService{} + arn := "arn:aws:iam::000000000000:policy/mypolicy" + tests := []struct { + name string + input *iam.AttachUserPolicyInput + wantErr string + }{ + {"nil UserName", &iam.AttachUserPolicyInput{PolicyArn: aws.String(arn)}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.AttachUserPolicyInput{UserName: aws.String(""), PolicyArn: aws.String(arn)}, awserrors.ErrorMissingParameter}, + {"nil PolicyArn", &iam.AttachUserPolicyInput{UserName: aws.String("alice")}, awserrors.ErrorMissingParameter}, + {"empty PolicyArn", &iam.AttachUserPolicyInput{UserName: aws.String("alice"), PolicyArn: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.AttachUserPolicyInput{UserName: aws.String("alice"), PolicyArn: aws.String(arn)}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := AttachUserPolicy(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestDetachUserPolicy(t *testing.T) { + svc := &stubIAMService{} + arn := "arn:aws:iam::000000000000:policy/mypolicy" + tests := []struct { + name string + input *iam.DetachUserPolicyInput + wantErr string + }{ + {"nil UserName", &iam.DetachUserPolicyInput{PolicyArn: aws.String(arn)}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.DetachUserPolicyInput{UserName: aws.String(""), PolicyArn: aws.String(arn)}, awserrors.ErrorMissingParameter}, + {"nil PolicyArn", &iam.DetachUserPolicyInput{UserName: aws.String("alice")}, awserrors.ErrorMissingParameter}, + {"empty PolicyArn", &iam.DetachUserPolicyInput{UserName: aws.String("alice"), PolicyArn: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.DetachUserPolicyInput{UserName: aws.String("alice"), PolicyArn: aws.String(arn)}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := DetachUserPolicy(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestListAttachedUserPolicies(t *testing.T) { + svc := &stubIAMService{} + tests := []struct { + name string + input *iam.ListAttachedUserPoliciesInput + wantErr string + }{ + {"nil UserName", &iam.ListAttachedUserPoliciesInput{}, awserrors.ErrorMissingParameter}, + {"empty UserName", &iam.ListAttachedUserPoliciesInput{UserName: aws.String("")}, awserrors.ErrorMissingParameter}, + {"valid", &iam.ListAttachedUserPoliciesInput{UserName: aws.String("alice")}, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + _, err := ListAttachedUserPolicies(testAccountID, tc.input, svc) + if tc.wantErr != "" { + require.Error(t, err) + assert.Equal(t, tc.wantErr, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/hive/gateway/iam/key.go b/hive/gateway/iam/key.go new file mode 100644 index 000000000..3bb5af066 --- /dev/null +++ b/hive/gateway/iam/key.go @@ -0,0 +1,43 @@ +package gateway_iam + +import ( + "errors" + + "github.com/aws/aws-sdk-go/service/iam" + "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" +) + +func CreateAccessKey(accountID string, input *iam.CreateAccessKeyInput, svc handlers_iam.IAMService) (*iam.CreateAccessKeyOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.CreateAccessKey(accountID, input) +} + +func ListAccessKeys(accountID string, input *iam.ListAccessKeysInput, svc handlers_iam.IAMService) (*iam.ListAccessKeysOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.ListAccessKeys(accountID, input) +} + +func DeleteAccessKey(accountID string, input *iam.DeleteAccessKeyInput, svc handlers_iam.IAMService) (*iam.DeleteAccessKeyOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + if input.AccessKeyId == nil || *input.AccessKeyId == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.DeleteAccessKey(accountID, input) +} + +func UpdateAccessKey(accountID string, input *iam.UpdateAccessKeyInput, svc handlers_iam.IAMService) (*iam.UpdateAccessKeyOutput, error) { + if input.AccessKeyId == nil || *input.AccessKeyId == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + if input.Status == nil || *input.Status == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.UpdateAccessKey(accountID, input) +} diff --git a/hive/gateway/iam/policy.go b/hive/gateway/iam/policy.go new file mode 100644 index 000000000..e7e515ca9 --- /dev/null +++ b/hive/gateway/iam/policy.go @@ -0,0 +1,74 @@ +package gateway_iam + +import ( + "errors" + + "github.com/aws/aws-sdk-go/service/iam" + "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" +) + +func CreatePolicy(accountID string, input *iam.CreatePolicyInput, svc handlers_iam.IAMService) (*iam.CreatePolicyOutput, error) { + if input.PolicyName == nil || *input.PolicyName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + if input.PolicyDocument == nil || *input.PolicyDocument == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.CreatePolicy(accountID, input) +} + +func GetPolicy(accountID string, input *iam.GetPolicyInput, svc handlers_iam.IAMService) (*iam.GetPolicyOutput, error) { + if input.PolicyArn == nil || *input.PolicyArn == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.GetPolicy(accountID, input) +} + +func GetPolicyVersion(accountID string, input *iam.GetPolicyVersionInput, svc handlers_iam.IAMService) (*iam.GetPolicyVersionOutput, error) { + if input.PolicyArn == nil || *input.PolicyArn == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + if input.VersionId == nil || *input.VersionId == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.GetPolicyVersion(accountID, input) +} + +func ListPolicies(accountID string, input *iam.ListPoliciesInput, svc handlers_iam.IAMService) (*iam.ListPoliciesOutput, error) { + return svc.ListPolicies(accountID, input) +} + +func DeletePolicy(accountID string, input *iam.DeletePolicyInput, svc handlers_iam.IAMService) (*iam.DeletePolicyOutput, error) { + if input.PolicyArn == nil || *input.PolicyArn == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.DeletePolicy(accountID, input) +} + +func AttachUserPolicy(accountID string, input *iam.AttachUserPolicyInput, svc handlers_iam.IAMService) (*iam.AttachUserPolicyOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + if input.PolicyArn == nil || *input.PolicyArn == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.AttachUserPolicy(accountID, input) +} + +func DetachUserPolicy(accountID string, input *iam.DetachUserPolicyInput, svc handlers_iam.IAMService) (*iam.DetachUserPolicyOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + if input.PolicyArn == nil || *input.PolicyArn == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.DetachUserPolicy(accountID, input) +} + +func ListAttachedUserPolicies(accountID string, input *iam.ListAttachedUserPoliciesInput, svc handlers_iam.IAMService) (*iam.ListAttachedUserPoliciesOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.ListAttachedUserPolicies(accountID, input) +} diff --git a/hive/gateway/iam/user.go b/hive/gateway/iam/user.go new file mode 100644 index 000000000..694dae9cc --- /dev/null +++ b/hive/gateway/iam/user.go @@ -0,0 +1,34 @@ +package gateway_iam + +import ( + "errors" + + "github.com/aws/aws-sdk-go/service/iam" + "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" +) + +func CreateUser(accountID string, input *iam.CreateUserInput, svc handlers_iam.IAMService) (*iam.CreateUserOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.CreateUser(accountID, input) +} + +func GetUser(accountID string, input *iam.GetUserInput, svc handlers_iam.IAMService) (*iam.GetUserOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.GetUser(accountID, input) +} + +func ListUsers(accountID string, input *iam.ListUsersInput, svc handlers_iam.IAMService) (*iam.ListUsersOutput, error) { + return svc.ListUsers(accountID, input) +} + +func DeleteUser(accountID string, input *iam.DeleteUserInput, svc handlers_iam.IAMService) (*iam.DeleteUserOutput, error) { + if input.UserName == nil || *input.UserName == "" { + return nil, errors.New(awserrors.ErrorMissingParameter) + } + return svc.DeleteUser(accountID, input) +} diff --git a/hive/gateway/iam_request_test.go b/hive/gateway/iam_request_test.go new file mode 100644 index 000000000..73f18b13d --- /dev/null +++ b/hive/gateway/iam_request_test.go @@ -0,0 +1,301 @@ +package gateway + +import ( + "errors" + "io" + "net/http/httptest" + "strings" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" + "github.com/gofiber/fiber/v2" + "github.com/mulgadc/hive/hive/awserrors" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// flexMockIAMService is a configurable mock with per-method overrides. +type flexMockIAMService struct { + createUserFn func(string, *iam.CreateUserInput) (*iam.CreateUserOutput, error) + getUserFn func(string, *iam.GetUserInput) (*iam.GetUserOutput, error) + listUsersFn func(string, *iam.ListUsersInput) (*iam.ListUsersOutput, error) + deleteUserFn func(string, *iam.DeleteUserInput) (*iam.DeleteUserOutput, error) + createAccessKeyFn func(string, *iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) + listAccessKeysFn func(string, *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) + deleteAccessKeyFn func(string, *iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) + updateAccessKeyFn func(string, *iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) +} + +func (m *flexMockIAMService) CreateUser(accountID string, input *iam.CreateUserInput) (*iam.CreateUserOutput, error) { + if m.createUserFn != nil { + return m.createUserFn(accountID, input) + } + return &iam.CreateUserOutput{}, nil +} + +func (m *flexMockIAMService) GetUser(accountID string, input *iam.GetUserInput) (*iam.GetUserOutput, error) { + if m.getUserFn != nil { + return m.getUserFn(accountID, input) + } + return &iam.GetUserOutput{}, nil +} + +func (m *flexMockIAMService) ListUsers(accountID string, input *iam.ListUsersInput) (*iam.ListUsersOutput, error) { + if m.listUsersFn != nil { + return m.listUsersFn(accountID, input) + } + return &iam.ListUsersOutput{}, nil +} + +func (m *flexMockIAMService) DeleteUser(accountID string, input *iam.DeleteUserInput) (*iam.DeleteUserOutput, error) { + if m.deleteUserFn != nil { + return m.deleteUserFn(accountID, input) + } + return &iam.DeleteUserOutput{}, nil +} + +func (m *flexMockIAMService) CreateAccessKey(accountID string, input *iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) { + if m.createAccessKeyFn != nil { + return m.createAccessKeyFn(accountID, input) + } + return &iam.CreateAccessKeyOutput{}, nil +} + +func (m *flexMockIAMService) ListAccessKeys(accountID string, input *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) { + if m.listAccessKeysFn != nil { + return m.listAccessKeysFn(accountID, input) + } + return &iam.ListAccessKeysOutput{}, nil +} + +func (m *flexMockIAMService) DeleteAccessKey(accountID string, input *iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) { + if m.deleteAccessKeyFn != nil { + return m.deleteAccessKeyFn(accountID, input) + } + return &iam.DeleteAccessKeyOutput{}, nil +} + +func (m *flexMockIAMService) UpdateAccessKey(accountID string, input *iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) { + if m.updateAccessKeyFn != nil { + return m.updateAccessKeyFn(accountID, input) + } + return &iam.UpdateAccessKeyOutput{}, nil +} + +func (m *flexMockIAMService) CreatePolicy(_ string, _ *iam.CreatePolicyInput) (*iam.CreatePolicyOutput, error) { + return &iam.CreatePolicyOutput{}, nil +} + +func (m *flexMockIAMService) GetPolicy(_ string, _ *iam.GetPolicyInput) (*iam.GetPolicyOutput, error) { + return &iam.GetPolicyOutput{}, nil +} + +func (m *flexMockIAMService) GetPolicyVersion(_ string, _ *iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error) { + return &iam.GetPolicyVersionOutput{}, nil +} + +func (m *flexMockIAMService) ListPolicies(_ string, _ *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) { + return &iam.ListPoliciesOutput{}, nil +} + +func (m *flexMockIAMService) DeletePolicy(_ string, _ *iam.DeletePolicyInput) (*iam.DeletePolicyOutput, error) { + return &iam.DeletePolicyOutput{}, nil +} + +func (m *flexMockIAMService) AttachUserPolicy(_ string, _ *iam.AttachUserPolicyInput) (*iam.AttachUserPolicyOutput, error) { + return &iam.AttachUserPolicyOutput{}, nil +} + +func (m *flexMockIAMService) DetachUserPolicy(_ string, _ *iam.DetachUserPolicyInput) (*iam.DetachUserPolicyOutput, error) { + return &iam.DetachUserPolicyOutput{}, nil +} + +func (m *flexMockIAMService) ListAttachedUserPolicies(_ string, _ *iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) { + return &iam.ListAttachedUserPoliciesOutput{}, nil +} + +func (m *flexMockIAMService) GetUserPolicies(_, _ string) ([]handlers_iam.PolicyDocument, error) { + return nil, nil +} + +func (m *flexMockIAMService) LookupAccessKey(_ string) (*handlers_iam.AccessKey, error) { + return nil, errors.New("not implemented") +} + +func (m *flexMockIAMService) DecryptSecret(_ string) (string, error) { return "", nil } +func (m *flexMockIAMService) SeedRootUser(_ *handlers_iam.BootstrapData) error { return nil } +func (m *flexMockIAMService) IsEmpty() (bool, error) { return true, nil } + +func (m *flexMockIAMService) CreateAccount(_ string) (*handlers_iam.Account, error) { + return nil, nil +} +func (m *flexMockIAMService) GetAccount(_ string) (*handlers_iam.Account, error) { return nil, nil } +func (m *flexMockIAMService) ListAccounts() ([]*handlers_iam.Account, error) { return nil, nil } + +// setupIAMRequestApp creates a Fiber app wired for IAM_Request testing. +func setupIAMRequestApp(svc handlers_iam.IAMService) *fiber.App { + gw := &GatewayConfig{ + DisableLogging: true, + IAMService: svc, + } + app := fiber.New(fiber.Config{ + ErrorHandler: func(ctx *fiber.Ctx, err error) error { + return gw.ErrorHandler(ctx, err) + }, + }) + app.Post("/", func(c *fiber.Ctx) error { + c.Locals("sigv4.service", "iam") + c.Locals("sigv4.accountId", "000000000000") + return gw.IAM_Request(c) + }) + return app +} + +func TestIAMRequest_CreateUser_Success(t *testing.T) { + svc := &flexMockIAMService{ + createUserFn: func(_ string, input *iam.CreateUserInput) (*iam.CreateUserOutput, error) { + return &iam.CreateUserOutput{ + User: &iam.User{ + UserName: input.UserName, + UserId: aws.String("AIDAEXAMPLE123"), + Arn: aws.String("arn:aws:iam::000000000000:user/alice"), + Path: aws.String("/"), + }, + }, nil + }, + } + app := setupIAMRequestApp(svc) + + req := httptest.NewRequest("POST", "/", strings.NewReader("Action=CreateUser&UserName=alice")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + xmlStr := string(body) + assert.Contains(t, xmlStr, "CreateUserResult") + assert.Contains(t, xmlStr, "alice") +} + +func TestIAMRequest_ListUsers_Success(t *testing.T) { + svc := &flexMockIAMService{ + listUsersFn: func(_ string, _ *iam.ListUsersInput) (*iam.ListUsersOutput, error) { + return &iam.ListUsersOutput{ + Users: []*iam.User{ + {UserName: aws.String("alice"), UserId: aws.String("AID1")}, + {UserName: aws.String("bob"), UserId: aws.String("AID2")}, + }, + IsTruncated: aws.Bool(false), + }, nil + }, + } + app := setupIAMRequestApp(svc) + + req := httptest.NewRequest("POST", "/", strings.NewReader("Action=ListUsers")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + xmlStr := string(body) + assert.Contains(t, xmlStr, "ListUsersResult") + assert.Contains(t, xmlStr, "alice") + assert.Contains(t, xmlStr, "bob") +} + +func TestIAMRequest_UnknownAction(t *testing.T) { + app := setupIAMRequestApp(&flexMockIAMService{}) + + req := httptest.NewRequest("POST", "/", strings.NewReader("Action=DoesNotExist")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 400, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + assert.Contains(t, string(body), "InvalidAction") +} + +func TestIAMRequest_EmptyAction(t *testing.T) { + app := setupIAMRequestApp(&flexMockIAMService{}) + + req := httptest.NewRequest("POST", "/", strings.NewReader("UserName=alice")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 400, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + assert.Contains(t, string(body), "InvalidAction") +} + +func TestIAMRequest_NilService(t *testing.T) { + gw := &GatewayConfig{ + DisableLogging: true, + IAMService: nil, + } + app := fiber.New(fiber.Config{ + ErrorHandler: func(ctx *fiber.Ctx, err error) error { + return gw.ErrorHandler(ctx, err) + }, + }) + app.Post("/", func(c *fiber.Ctx) error { + c.Locals("sigv4.service", "iam") + c.Locals("sigv4.accountId", "000000000000") + return gw.IAM_Request(c) + }) + + req := httptest.NewRequest("POST", "/", strings.NewReader("Action=CreateUser&UserName=alice")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 500, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + assert.Contains(t, string(body), "InternalError") +} + +func TestIAMRequest_ServiceError(t *testing.T) { + svc := &flexMockIAMService{ + createUserFn: func(_ string, _ *iam.CreateUserInput) (*iam.CreateUserOutput, error) { + return nil, errors.New(awserrors.ErrorIAMEntityAlreadyExists) + }, + } + app := setupIAMRequestApp(svc) + + req := httptest.NewRequest("POST", "/", strings.NewReader("Action=CreateUser&UserName=alice")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 409, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + xmlStr := string(body) + assert.Contains(t, xmlStr, "EntityAlreadyExists") + assert.Contains(t, xmlStr, "") +} + +func TestIAMRequest_ValidationError(t *testing.T) { + // CreateUser with missing UserName should return MissingParameter + app := setupIAMRequestApp(&flexMockIAMService{}) + + req := httptest.NewRequest("POST", "/", strings.NewReader("Action=CreateUser")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := app.Test(req) + require.NoError(t, err) + assert.Equal(t, 400, resp.StatusCode) + + body, _ := io.ReadAll(resp.Body) + assert.Contains(t, string(body), "MissingParameter") +} diff --git a/hive/gateway/policy/actions.go b/hive/gateway/policy/actions.go new file mode 100644 index 000000000..6f724d82d --- /dev/null +++ b/hive/gateway/policy/actions.go @@ -0,0 +1,8 @@ +package policy + +// IAMAction converts a gateway service name and action name into the +// IAM policy action format "service:ActionName". +// For example: ("ec2", "RunInstances") -> "ec2:RunInstances" +func IAMAction(service, action string) string { + return service + ":" + action +} diff --git a/hive/gateway/policy/evaluator.go b/hive/gateway/policy/evaluator.go new file mode 100644 index 000000000..0b846aa30 --- /dev/null +++ b/hive/gateway/policy/evaluator.go @@ -0,0 +1,93 @@ +// Package policy implements IAM policy evaluation for access control decisions. +package policy + +import ( + "log/slog" + "strings" + + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" +) + +// Decision represents the outcome of a policy evaluation. +type Decision int + +const ( + // Deny is the default — no matching Allow, or an explicit Deny. + Deny Decision = iota + // Allow means an explicit Allow was found with no overriding Deny. + Allow +) + +// EvaluateAccess checks whether the given identity is permitted to perform +// the specified action on the specified resource, based on the supplied +// policy documents. It follows AWS's evaluation order: +// +// 1. Explicit Deny in any statement → Deny (wins immediately). +// 2. Explicit Allow in any statement → Allow. +// 3. No matching statement → Deny (implicit default). +// +// Root bypass is handled by the gateway before this function is called. +func EvaluateAccess(identity, action, resource string, policies []handlers_iam.PolicyDocument) Decision { + hasAllow := false + for i := range policies { + for j := range policies[i].Statement { + stmt := &policies[i].Statement[j] + + if !matchesAny(stmt.Action, action) { + continue + } + if !matchesAny(stmt.Resource, resource) { + continue + } + switch stmt.Effect { + case handlers_iam.PolicyEffectDeny: + return Deny + case handlers_iam.PolicyEffectAllow: + hasAllow = true + default: + slog.Warn("EvaluateAccess: unrecognized Effect, treating as Deny", + "effect", stmt.Effect, "action", action, "identity", identity) + return Deny + } + } + } + + if hasAllow { + return Allow + } + return Deny +} + +// matchesAny returns true if any pattern in patterns matches the given value. +// Supports the same wildcard matching for both actions and resources: +// - "*" — matches everything +// - "ec2:*" — matches all actions in the ec2 service +// - "s3:Get*" — matches s3:GetObject, s3:GetBucketPolicy, etc. +// - "ec2:RunInstances" — exact match +func matchesAny(patterns []string, value string) bool { + for _, p := range patterns { + if matchWildcard(p, value) { + return true + } + } + return false +} + +// matchWildcard performs simple wildcard matching where "*" can appear at the +// end of a pattern as a suffix wildcard, or alone to match everything. +// Examples: +// +// "*" matches anything +// "ec2:*" matches "ec2:RunInstances" +// "s3:Get*" matches "s3:GetObject" +// "ec2:RunInstances" matches only "ec2:RunInstances" +func matchWildcard(pattern, value string) bool { + if pattern == "*" { + return true + } + if strings.HasSuffix(pattern, "*") { + prefix := pattern[:len(pattern)-1] + return strings.HasPrefix(value, prefix) + } + return strings.EqualFold(pattern, value) +} diff --git a/hive/gateway/policy/evaluator_test.go b/hive/gateway/policy/evaluator_test.go new file mode 100644 index 000000000..cb990a2ab --- /dev/null +++ b/hive/gateway/policy/evaluator_test.go @@ -0,0 +1,333 @@ +package policy + +import ( + "testing" + + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" +) + +// helper to build a single-statement policy document. +func doc(effect, action, resource string) handlers_iam.PolicyDocument { + return handlers_iam.PolicyDocument{ + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + {Effect: effect, Action: handlers_iam.StringOrArr{action}, Resource: handlers_iam.StringOrArr{resource}}, + }, + } +} + +// Root bypass is tested at the gateway layer (checkPolicy), not in the evaluator. + +func TestEvaluateAccess_DefaultDeny(t *testing.T) { + // Non-root with no policies → default deny. + got := EvaluateAccess("alice", "ec2:RunInstances", "*", nil) + if got != Deny { + t.Fatalf("expected default Deny with no policies, got %v", got) + } +} + +func TestEvaluateAccess_DefaultDenyEmptyPolicies(t *testing.T) { + // Non-root with empty policy list → default deny. + got := EvaluateAccess("alice", "ec2:RunInstances", "*", []handlers_iam.PolicyDocument{}) + if got != Deny { + t.Fatalf("expected default Deny with empty policies, got %v", got) + } +} + +func TestEvaluateAccess_ExplicitAllow(t *testing.T) { + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "ec2:RunInstances", "*"), + } + got := EvaluateAccess("alice", "ec2:RunInstances", "*", policies) + if got != Allow { + t.Fatalf("expected Allow, got %v", got) + } +} + +func TestEvaluateAccess_ExplicitDenyWins(t *testing.T) { + // Explicit deny overrides an explicit allow. + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "ec2:*", "*"), + doc("Deny", "ec2:TerminateInstances", "*"), + } + got := EvaluateAccess("alice", "ec2:TerminateInstances", "*", policies) + if got != Deny { + t.Fatalf("expected Deny (explicit deny wins), got %v", got) + } +} + +func TestEvaluateAccess_ExplicitDenyWinsSamePolicy(t *testing.T) { + // Deny and Allow in the same policy document — Deny wins. + policies := []handlers_iam.PolicyDocument{ + { + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + {Effect: "Allow", Action: handlers_iam.StringOrArr{"ec2:*"}, Resource: handlers_iam.StringOrArr{"*"}}, + {Effect: "Deny", Action: handlers_iam.StringOrArr{"ec2:TerminateInstances"}, Resource: handlers_iam.StringOrArr{"*"}}, + }, + }, + } + got := EvaluateAccess("alice", "ec2:TerminateInstances", "*", policies) + if got != Deny { + t.Fatalf("expected Deny (same-policy explicit deny), got %v", got) + } +} + +func TestEvaluateAccess_NoMatchingAction(t *testing.T) { + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "s3:GetObject", "*"), + } + got := EvaluateAccess("alice", "ec2:RunInstances", "*", policies) + if got != Deny { + t.Fatalf("expected Deny (no matching action), got %v", got) + } +} + +func TestEvaluateAccess_WildcardAllActions(t *testing.T) { + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "*", "*"), + } + got := EvaluateAccess("alice", "ec2:RunInstances", "*", policies) + if got != Allow { + t.Fatalf("expected Allow with wildcard *, got %v", got) + } +} + +func TestEvaluateAccess_ServiceWildcard(t *testing.T) { + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "ec2:*", "*"), + } + + tests := []struct { + action string + want Decision + }{ + {"ec2:RunInstances", Allow}, + {"ec2:DescribeInstances", Allow}, + {"s3:GetObject", Deny}, + {"iam:CreateUser", Deny}, + } + + for _, tt := range tests { + got := EvaluateAccess("alice", tt.action, "*", policies) + if got != tt.want { + t.Errorf("ec2:* policy, action=%s: expected %v, got %v", tt.action, tt.want, got) + } + } +} + +func TestEvaluateAccess_PrefixWildcard(t *testing.T) { + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "s3:Get*", "*"), + } + + tests := []struct { + action string + want Decision + }{ + {"s3:GetObject", Allow}, + {"s3:GetBucketPolicy", Allow}, + {"s3:PutObject", Deny}, + {"s3:DeleteObject", Deny}, + } + + for _, tt := range tests { + got := EvaluateAccess("alice", tt.action, "*", policies) + if got != tt.want { + t.Errorf("s3:Get* policy, action=%s: expected %v, got %v", tt.action, tt.want, got) + } + } +} + +func TestEvaluateAccess_MultipleActions(t *testing.T) { + // A statement with multiple actions. + policies := []handlers_iam.PolicyDocument{ + { + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + { + Effect: "Allow", + Action: handlers_iam.StringOrArr{"ec2:DescribeInstances", "ec2:RunInstances"}, + Resource: handlers_iam.StringOrArr{"*"}, + }, + }, + }, + } + + tests := []struct { + action string + want Decision + }{ + {"ec2:DescribeInstances", Allow}, + {"ec2:RunInstances", Allow}, + {"ec2:TerminateInstances", Deny}, + } + + for _, tt := range tests { + got := EvaluateAccess("alice", tt.action, "*", policies) + if got != tt.want { + t.Errorf("multi-action policy, action=%s: expected %v, got %v", tt.action, tt.want, got) + } + } +} + +func TestEvaluateAccess_MultiplePolicies(t *testing.T) { + // Permissions spread across multiple policy documents. + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "ec2:DescribeInstances", "*"), + doc("Allow", "s3:GetObject", "*"), + } + + tests := []struct { + action string + want Decision + }{ + {"ec2:DescribeInstances", Allow}, + {"s3:GetObject", Allow}, + {"iam:CreateUser", Deny}, + } + + for _, tt := range tests { + got := EvaluateAccess("alice", tt.action, "*", policies) + if got != tt.want { + t.Errorf("multi-policy, action=%s: expected %v, got %v", tt.action, tt.want, got) + } + } +} + +func TestEvaluateAccess_ResourceMismatch(t *testing.T) { + // Allow only on a specific resource, request uses "*". + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "s3:GetObject", "arn:aws:s3:::my-bucket/*"), + } + got := EvaluateAccess("alice", "s3:GetObject", "*", policies) + if got != Deny { + t.Fatalf("expected Deny (resource mismatch), got %v", got) + } +} + +func TestEvaluateAccess_CaseInsensitiveAction(t *testing.T) { + // Action matching should be case-insensitive for exact matches. + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "EC2:RunInstances", "*"), + } + got := EvaluateAccess("alice", "ec2:RunInstances", "*", policies) + if got != Allow { + t.Fatalf("expected Allow (case-insensitive match), got %v", got) + } +} + +// --- matchWildcard tests --- + +func TestMatchWildcard(t *testing.T) { + tests := []struct { + pattern string + value string + want bool + }{ + // Global wildcard + {"*", "anything", true}, + {"*", "", true}, + + // Service wildcard + {"ec2:*", "ec2:RunInstances", true}, + {"ec2:*", "ec2:DescribeInstances", true}, + {"ec2:*", "s3:GetObject", false}, + + // Prefix wildcard + {"s3:Get*", "s3:GetObject", true}, + {"s3:Get*", "s3:GetBucketPolicy", true}, + {"s3:Get*", "s3:PutObject", false}, + + // Exact match + {"ec2:RunInstances", "ec2:RunInstances", true}, + {"ec2:RunInstances", "ec2:StopInstances", false}, + + // Case insensitive exact match + {"EC2:RunInstances", "ec2:RunInstances", true}, + {"ec2:runinstances", "ec2:RunInstances", true}, + + // Edge cases + {"", "", true}, + {"", "something", false}, + } + + for _, tt := range tests { + got := matchWildcard(tt.pattern, tt.value) + if got != tt.want { + t.Errorf("matchWildcard(%q, %q) = %v, want %v", tt.pattern, tt.value, got, tt.want) + } + } +} + +// --- Action mapping tests --- + +func TestIAMAction(t *testing.T) { + got := IAMAction("ec2", "RunInstances") + if got != "ec2:RunInstances" { + t.Fatalf("IAMAction(ec2, RunInstances) = %q, want %q", got, "ec2:RunInstances") + } +} + +// --- Realistic scenario tests --- + +func TestEvaluateAccess_ReadOnlyUser(t *testing.T) { + // Simulate a read-only user: allow all Describe* actions, deny everything else. + policies := []handlers_iam.PolicyDocument{ + { + Version: "2012-10-17", + Statement: []handlers_iam.Statement{ + { + Effect: "Allow", + Action: handlers_iam.StringOrArr{"ec2:Describe*"}, + Resource: handlers_iam.StringOrArr{"*"}, + }, + }, + }, + } + + tests := []struct { + action string + want Decision + }{ + {"ec2:DescribeInstances", Allow}, + {"ec2:DescribeVolumes", Allow}, + {"ec2:DescribeVpcs", Allow}, + {"ec2:RunInstances", Deny}, + {"ec2:TerminateInstances", Deny}, + {"iam:CreateUser", Deny}, + } + + for _, tt := range tests { + got := EvaluateAccess("viewer", tt.action, "*", policies) + if got != tt.want { + t.Errorf("read-only user, action=%s: expected %v, got %v", tt.action, tt.want, got) + } + } +} + +func TestEvaluateAccess_AdminWithDenyTerminate(t *testing.T) { + // Admin that can do everything except terminate instances. + policies := []handlers_iam.PolicyDocument{ + doc("Allow", "*", "*"), + doc("Deny", "ec2:TerminateInstances", "*"), + } + + tests := []struct { + action string + want Decision + }{ + {"ec2:RunInstances", Allow}, + {"ec2:DescribeInstances", Allow}, + {"s3:GetObject", Allow}, + {"iam:CreateUser", Allow}, + {"ec2:TerminateInstances", Deny}, // explicit deny + } + + for _, tt := range tests { + got := EvaluateAccess("admin", tt.action, "*", policies) + if got != tt.want { + t.Errorf("admin-no-terminate, action=%s: expected %v, got %v", tt.action, tt.want, got) + } + } +} diff --git a/hive/handlers/ec2/instance/service_impl.go b/hive/handlers/ec2/instance/service_impl.go index 8fbb81ec2..aaf678b88 100644 --- a/hive/handlers/ec2/instance/service_impl.go +++ b/hive/handlers/ec2/instance/service_impl.go @@ -257,8 +257,8 @@ func (s *InstanceServiceImpl) newViperblock(volumeName string, size int, volumeC VolumeSize: utils.SafeIntToUint64(size), Bucket: s.config.Predastore.Bucket, Region: s.config.Predastore.Region, - AccessKey: s.config.AccessKey, - SecretKey: s.config.SecretKey, + AccessKey: s.config.Predastore.AccessKey, + SecretKey: s.config.Predastore.SecretKey, Host: s.config.Predastore.Host, } diff --git a/hive/handlers/iam/account_test.go b/hive/handlers/iam/account_test.go new file mode 100644 index 000000000..f4be841bf --- /dev/null +++ b/hive/handlers/iam/account_test.go @@ -0,0 +1,256 @@ +package handlers_iam + +import ( + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// ============================================================================ +// Account CRUD Tests +// ============================================================================ + +func TestCreateAccount(t *testing.T) { + svc := setupTestIAMService(t) + + acc1, err := svc.CreateAccount("Team Alpha") + require.NoError(t, err) + assert.Equal(t, "000000000001", acc1.AccountID) + assert.Equal(t, "Team Alpha", acc1.AccountName) + assert.Equal(t, "ACTIVE", acc1.Status) + assert.NotEmpty(t, acc1.CreatedAt) + + // Second account gets sequential ID + acc2, err := svc.CreateAccount("Team Beta") + require.NoError(t, err) + assert.Equal(t, "000000000002", acc2.AccountID) + assert.Equal(t, "Team Beta", acc2.AccountName) +} + +func TestCreateAccount_SequentialIDs(t *testing.T) { + svc := setupTestIAMService(t) + + var prevID string + for range 5 { + acc, err := svc.CreateAccount("account") + require.NoError(t, err) + assert.Len(t, acc.AccountID, 12) + if prevID != "" { + assert.Greater(t, acc.AccountID, prevID) + } + prevID = acc.AccountID + } +} + +func TestGetAccount(t *testing.T) { + svc := setupTestIAMService(t) + + created, err := svc.CreateAccount("Lookup Test") + require.NoError(t, err) + + got, err := svc.GetAccount(created.AccountID) + require.NoError(t, err) + assert.Equal(t, created.AccountID, got.AccountID) + assert.Equal(t, "Lookup Test", got.AccountName) + assert.Equal(t, "ACTIVE", got.Status) +} + +func TestGetAccount_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.GetAccount("999999999999") + assert.Error(t, err) +} + +func TestListAccounts(t *testing.T) { + svc := setupTestIAMService(t) + + svc.CreateAccount("Acct1") + svc.CreateAccount("Acct2") + svc.CreateAccount("Acct3") + + accounts, err := svc.ListAccounts() + require.NoError(t, err) + assert.Len(t, accounts, 3) + + names := make(map[string]bool) + for _, a := range accounts { + names[a.AccountName] = true + } + assert.True(t, names["Acct1"]) + assert.True(t, names["Acct2"]) + assert.True(t, names["Acct3"]) +} + +func TestListAccounts_Empty(t *testing.T) { + svc := setupTestIAMService(t) + + accounts, err := svc.ListAccounts() + require.NoError(t, err) + assert.Len(t, accounts, 0) +} + +// ============================================================================ +// Account-Scoped User Tests +// ============================================================================ + +func TestAccountScopedUsers(t *testing.T) { + svc := setupTestIAMService(t) + + acc1, err := svc.CreateAccount("Org A") + require.NoError(t, err) + acc2, err := svc.CreateAccount("Org B") + require.NoError(t, err) + + // Create same username in both accounts + _, err = svc.CreateUser(acc1.AccountID, &iam.CreateUserInput{ + UserName: aws.String("admin"), + }) + require.NoError(t, err) + + _, err = svc.CreateUser(acc2.AccountID, &iam.CreateUserInput{ + UserName: aws.String("admin"), + }) + require.NoError(t, err) + + // Both should be independently retrievable + out1, err := svc.GetUser(acc1.AccountID, &iam.GetUserInput{ + UserName: aws.String("admin"), + }) + require.NoError(t, err) + assert.Contains(t, *out1.User.Arn, acc1.AccountID) + + out2, err := svc.GetUser(acc2.AccountID, &iam.GetUserInput{ + UserName: aws.String("admin"), + }) + require.NoError(t, err) + assert.Contains(t, *out2.User.Arn, acc2.AccountID) + + // Listing users in acc1 should only return acc1's user + list1, err := svc.ListUsers(acc1.AccountID, &iam.ListUsersInput{}) + require.NoError(t, err) + assert.Len(t, list1.Users, 1) + + list2, err := svc.ListUsers(acc2.AccountID, &iam.ListUsersInput{}) + require.NoError(t, err) + assert.Len(t, list2.Users, 1) + + // Deleting in one account shouldn't affect the other + _, err = svc.DeleteUser(acc1.AccountID, &iam.DeleteUserInput{ + UserName: aws.String("admin"), + }) + require.NoError(t, err) + + _, err = svc.GetUser(acc2.AccountID, &iam.GetUserInput{ + UserName: aws.String("admin"), + }) + require.NoError(t, err) // acc2's admin still exists +} + +// ============================================================================ +// Account-Scoped Policy Tests +// ============================================================================ + +func TestAccountScopedPolicies(t *testing.T) { + svc := setupTestIAMService(t) + + acc1, err := svc.CreateAccount("Policy Org A") + require.NoError(t, err) + acc2, err := svc.CreateAccount("Policy Org B") + require.NoError(t, err) + + doc := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}` + + // Create same policy name in both accounts + p1, err := svc.CreatePolicy(acc1.AccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("AdminAccess"), + PolicyDocument: aws.String(doc), + }) + require.NoError(t, err) + assert.Contains(t, *p1.Policy.Arn, acc1.AccountID) + + p2, err := svc.CreatePolicy(acc2.AccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("AdminAccess"), + PolicyDocument: aws.String(doc), + }) + require.NoError(t, err) + assert.Contains(t, *p2.Policy.Arn, acc2.AccountID) + + // Listing in each account should be independent + list1, err := svc.ListPolicies(acc1.AccountID, &iam.ListPoliciesInput{}) + require.NoError(t, err) + assert.Len(t, list1.Policies, 1) + + list2, err := svc.ListPolicies(acc2.AccountID, &iam.ListPoliciesInput{}) + require.NoError(t, err) + assert.Len(t, list2.Policies, 1) +} + +// ============================================================================ +// Access Key Account ID Tests +// ============================================================================ + +func TestAccessKeyReturnsAccountID(t *testing.T) { + svc := setupTestIAMService(t) + + acc, err := svc.CreateAccount("Key Org") + require.NoError(t, err) + + _, err = svc.CreateUser(acc.AccountID, &iam.CreateUserInput{ + UserName: aws.String("keyuser"), + }) + require.NoError(t, err) + + akOut, err := svc.CreateAccessKey(acc.AccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("keyuser"), + }) + require.NoError(t, err) + + // LookupAccessKey should return the correct account ID + ak, err := svc.LookupAccessKey(*akOut.AccessKey.AccessKeyId) + require.NoError(t, err) + assert.Equal(t, acc.AccountID, ak.AccountID) + assert.Equal(t, "keyuser", ak.UserName) +} + +// ============================================================================ +// SeedRootUser Account-Scoped Tests +// ============================================================================ + +func TestSeedRootUser_AccountScoped(t *testing.T) { + svc := setupTestIAMService(t) + + encryptedSecret, err := EncryptSecret("root-secret", svc.masterKey) + require.NoError(t, err) + + err = svc.SeedRootUser(&BootstrapData{ + AccessKeyID: "AKIAROOTEXAMPLE12345", + EncryptedSecret: encryptedSecret, + AccountID: GlobalAccountID, + }) + require.NoError(t, err) + + // Root user stored at 000000000000:root + out, err := svc.GetUser(GlobalAccountID, &iam.GetUserInput{ + UserName: aws.String("root"), + }) + require.NoError(t, err) + assert.Equal(t, "root", *out.User.UserName) + assert.Contains(t, *out.User.Arn, GlobalAccountID) + + // Access key has correct AccountID + ak, err := svc.LookupAccessKey("AKIAROOTEXAMPLE12345") + require.NoError(t, err) + assert.Equal(t, GlobalAccountID, ak.AccountID) + assert.Equal(t, "root", ak.UserName) + + // Global account record was created + account, err := svc.GetAccount(GlobalAccountID) + require.NoError(t, err) + assert.Equal(t, GlobalAccountID, account.AccountID) + assert.Equal(t, "Global", account.AccountName) + assert.Equal(t, "ACTIVE", account.Status) +} diff --git a/hive/handlers/iam/crypto.go b/hive/handlers/iam/crypto.go new file mode 100644 index 000000000..187c44c3c --- /dev/null +++ b/hive/handlers/iam/crypto.go @@ -0,0 +1,142 @@ +package handlers_iam + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "encoding/base64" + "encoding/json" + "fmt" + "os" +) + +const masterKeySize = 32 // AES-256 + +// GenerateMasterKey returns 32 cryptographically random bytes suitable +// for use as an AES-256-GCM key. +func GenerateMasterKey() ([]byte, error) { + key := make([]byte, masterKeySize) + if _, err := rand.Read(key); err != nil { + return nil, fmt.Errorf("generate master key: %w", err) + } + return key, nil +} + +// LoadMasterKey reads a master key from disk and validates it is exactly 32 bytes. +func LoadMasterKey(path string) ([]byte, error) { + key, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("read master key: %w", err) + } + if len(key) != masterKeySize { + return nil, fmt.Errorf("master key must be %d bytes, got %d", masterKeySize, len(key)) + } + return key, nil +} + +// SaveMasterKey writes a master key to disk with 0600 permissions. +func SaveMasterKey(path string, key []byte) error { + if len(key) != masterKeySize { + return fmt.Errorf("master key must be %d bytes, got %d", masterKeySize, len(key)) + } + if err := os.WriteFile(path, key, 0600); err != nil { + return fmt.Errorf("write master key: %w", err) + } + return nil +} + +// EncryptSecret encrypts a plaintext secret with AES-256-GCM. +// Returns base64(nonce + ciphertext + tag). +func EncryptSecret(plaintext string, key []byte) (string, error) { + block, err := aes.NewCipher(key) + if err != nil { + return "", fmt.Errorf("create cipher: %w", err) + } + + gcm, err := cipher.NewGCM(block) + if err != nil { + return "", fmt.Errorf("create GCM: %w", err) + } + + nonce := make([]byte, gcm.NonceSize()) + if _, err := rand.Read(nonce); err != nil { + return "", fmt.Errorf("generate nonce: %w", err) + } + + // Seal appends ciphertext+tag to nonce + ciphertext := gcm.Seal(nonce, nonce, []byte(plaintext), nil) + return base64.StdEncoding.EncodeToString(ciphertext), nil +} + +// Decrypter holds a pre-computed AES-256-GCM cipher for repeated decryption. +// Create once at startup with NewDecrypter and reuse across requests. +type Decrypter struct { + gcm cipher.AEAD +} + +// NewDecrypter creates a Decrypter with a pre-computed AES-GCM cipher from the given key. +func NewDecrypter(key []byte) (*Decrypter, error) { + block, err := aes.NewCipher(key) + if err != nil { + return nil, fmt.Errorf("create cipher: %w", err) + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, fmt.Errorf("create GCM: %w", err) + } + return &Decrypter{gcm: gcm}, nil +} + +// Decrypt decrypts a base64-encoded AES-256-GCM ciphertext using the pre-computed cipher. +func (d *Decrypter) Decrypt(ciphertext string) (string, error) { + data, err := base64.StdEncoding.DecodeString(ciphertext) + if err != nil { + return "", fmt.Errorf("base64 decode: %w", err) + } + + nonceSize := d.gcm.NonceSize() + if len(data) < nonceSize { + return "", fmt.Errorf("ciphertext too short") + } + + nonce, sealed := data[:nonceSize], data[nonceSize:] + plaintext, err := d.gcm.Open(nil, nonce, sealed, nil) + if err != nil { + return "", fmt.Errorf("decrypt: %w", err) + } + return string(plaintext), nil +} + +// DecryptSecret decrypts a base64-encoded AES-256-GCM ciphertext. +func DecryptSecret(ciphertext string, key []byte) (string, error) { + d, err := NewDecrypter(key) + if err != nil { + return "", err + } + return d.Decrypt(ciphertext) +} + +// SaveBootstrapData writes bootstrap data as JSON to disk with 0600 permissions. +func SaveBootstrapData(path string, data *BootstrapData) error { + b, err := json.Marshal(data) + if err != nil { + return fmt.Errorf("marshal bootstrap data: %w", err) + } + if err := os.WriteFile(path, b, 0600); err != nil { + return fmt.Errorf("write bootstrap data: %w", err) + } + return nil +} + +// LoadBootstrapData reads and parses a bootstrap JSON file from disk. +func LoadBootstrapData(path string) (*BootstrapData, error) { + data, err := os.ReadFile(path) + if err != nil { + return nil, err + } + var bd BootstrapData + if err := json.Unmarshal(data, &bd); err != nil { + return nil, fmt.Errorf("parse bootstrap data: %w", err) + } + return &bd, nil +} diff --git a/hive/handlers/iam/crypto_test.go b/hive/handlers/iam/crypto_test.go new file mode 100644 index 000000000..c58e3a414 --- /dev/null +++ b/hive/handlers/iam/crypto_test.go @@ -0,0 +1,283 @@ +package handlers_iam + +import ( + "encoding/json" + "os" + "path/filepath" + "testing" +) + +func TestGenerateMasterKey(t *testing.T) { + key, err := GenerateMasterKey() + if err != nil { + t.Fatalf("GenerateMasterKey() error: %v", err) + } + if len(key) != 32 { + t.Fatalf("expected 32 bytes, got %d", len(key)) + } + + // Two generated keys should differ + key2, err := GenerateMasterKey() + if err != nil { + t.Fatalf("GenerateMasterKey() second call error: %v", err) + } + if string(key) == string(key2) { + t.Fatal("two generated keys should not be identical") + } +} + +func TestSaveLoadMasterKey(t *testing.T) { + key, err := GenerateMasterKey() + if err != nil { + t.Fatalf("GenerateMasterKey() error: %v", err) + } + + dir := t.TempDir() + path := filepath.Join(dir, "master.key") + + if err := SaveMasterKey(path, key); err != nil { + t.Fatalf("SaveMasterKey() error: %v", err) + } + + // Check file permissions + info, err := os.Stat(path) + if err != nil { + t.Fatalf("stat master.key: %v", err) + } + if perm := info.Mode().Perm(); perm != 0600 { + t.Fatalf("expected permissions 0600, got %04o", perm) + } + + loaded, err := LoadMasterKey(path) + if err != nil { + t.Fatalf("LoadMasterKey() error: %v", err) + } + if string(loaded) != string(key) { + t.Fatal("loaded key does not match saved key") + } +} + +func TestLoadMasterKeyWrongSize(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "bad.key") + + if err := os.WriteFile(path, []byte("too-short"), 0600); err != nil { + t.Fatal(err) + } + + _, err := LoadMasterKey(path) + if err == nil { + t.Fatal("LoadMasterKey() should fail for wrong-size key") + } +} + +func TestLoadMasterKeyNotFound(t *testing.T) { + _, err := LoadMasterKey("/nonexistent/master.key") + if err == nil { + t.Fatal("LoadMasterKey() should fail for missing file") + } +} + +func TestSaveMasterKeyWrongSize(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "bad.key") + + err := SaveMasterKey(path, []byte("too-short")) + if err == nil { + t.Fatal("SaveMasterKey() should fail for wrong-size key") + } +} + +func TestEncryptDecryptRoundTrip(t *testing.T) { + key, err := GenerateMasterKey() + if err != nil { + t.Fatalf("GenerateMasterKey() error: %v", err) + } + + secret := "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" + + encrypted, err := EncryptSecret(secret, key) + if err != nil { + t.Fatalf("EncryptSecret() error: %v", err) + } + + if encrypted == secret { + t.Fatal("encrypted output should differ from plaintext") + } + + decrypted, err := DecryptSecret(encrypted, key) + if err != nil { + t.Fatalf("DecryptSecret() error: %v", err) + } + + if decrypted != secret { + t.Fatalf("expected %q, got %q", secret, decrypted) + } +} + +func TestEncryptProducesDifferentCiphertexts(t *testing.T) { + key, _ := GenerateMasterKey() + secret := "test-secret" + + ct1, _ := EncryptSecret(secret, key) + ct2, _ := EncryptSecret(secret, key) + + if ct1 == ct2 { + t.Fatal("encrypting the same plaintext twice should produce different ciphertexts (random nonce)") + } +} + +func TestDecryptWrongKey(t *testing.T) { + key1, _ := GenerateMasterKey() + key2, _ := GenerateMasterKey() + secret := "test-secret" + + encrypted, err := EncryptSecret(secret, key1) + if err != nil { + t.Fatalf("EncryptSecret() error: %v", err) + } + + _, err = DecryptSecret(encrypted, key2) + if err == nil { + t.Fatal("DecryptSecret() should fail with wrong key") + } +} + +func TestDecryptTamperedCiphertext(t *testing.T) { + key, _ := GenerateMasterKey() + secret := "test-secret" + + encrypted, _ := EncryptSecret(secret, key) + + // Tamper with the ciphertext by flipping a character + tampered := []byte(encrypted) + if tampered[len(tampered)-2] == 'A' { + tampered[len(tampered)-2] = 'B' + } else { + tampered[len(tampered)-2] = 'A' + } + + _, err := DecryptSecret(string(tampered), key) + if err == nil { + t.Fatal("DecryptSecret() should fail with tampered ciphertext") + } +} + +func TestDecryptInvalidBase64(t *testing.T) { + key, _ := GenerateMasterKey() + _, err := DecryptSecret("not-valid-base64!!!", key) + if err == nil { + t.Fatal("DecryptSecret() should fail with invalid base64") + } +} + +func TestDecryptTooShort(t *testing.T) { + key, _ := GenerateMasterKey() + // Valid base64 but too short for nonce + ciphertext + _, err := DecryptSecret("AQID", key) + if err == nil { + t.Fatal("DecryptSecret() should fail with too-short ciphertext") + } +} + +func TestLoadBootstrapData(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "bootstrap.json") + + bd := BootstrapData{ + AccessKeyID: "AKIAIOSFODNN7EXAMPLE", + EncryptedSecret: "dGVzdC1lbmNyeXB0ZWQ=", + AccountID: "000000000000", + } + data, _ := json.Marshal(bd) + if err := os.WriteFile(path, data, 0600); err != nil { + t.Fatal(err) + } + + loaded, err := LoadBootstrapData(path) + if err != nil { + t.Fatalf("LoadBootstrapData() error: %v", err) + } + + if loaded.AccessKeyID != bd.AccessKeyID { + t.Fatalf("AccessKeyID: expected %q, got %q", bd.AccessKeyID, loaded.AccessKeyID) + } + if loaded.EncryptedSecret != bd.EncryptedSecret { + t.Fatalf("EncryptedSecret mismatch") + } + if loaded.AccountID != bd.AccountID { + t.Fatalf("AccountID: expected %q, got %q", bd.AccountID, loaded.AccountID) + } +} + +func TestLoadBootstrapDataNotFound(t *testing.T) { + _, err := LoadBootstrapData("/nonexistent/bootstrap.json") + if err == nil { + t.Fatal("LoadBootstrapData() should fail for missing file") + } +} + +func TestLoadBootstrapDataInvalidJSON(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "bootstrap.json") + + if err := os.WriteFile(path, []byte("{invalid"), 0600); err != nil { + t.Fatal(err) + } + + _, err := LoadBootstrapData(path) + if err == nil { + t.Fatal("LoadBootstrapData() should fail for invalid JSON") + } +} + +func TestSaveBootstrapData_RoundTrip(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "bootstrap.json") + + data := &BootstrapData{ + AccessKeyID: "AKIAIOSFODNN7EXAMPLE", + EncryptedSecret: "dGVzdC1lbmNyeXB0ZWQ=", + AccountID: "000000000000", + } + + if err := SaveBootstrapData(path, data); err != nil { + t.Fatalf("SaveBootstrapData() error: %v", err) + } + + // Verify file permissions + info, err := os.Stat(path) + if err != nil { + t.Fatalf("stat bootstrap.json: %v", err) + } + if perm := info.Mode().Perm(); perm != 0600 { + t.Fatalf("expected permissions 0600, got %04o", perm) + } + + // Verify round-trip + loaded, err := LoadBootstrapData(path) + if err != nil { + t.Fatalf("LoadBootstrapData() error: %v", err) + } + if loaded.AccessKeyID != data.AccessKeyID { + t.Fatalf("AccessKeyID: expected %q, got %q", data.AccessKeyID, loaded.AccessKeyID) + } + if loaded.EncryptedSecret != data.EncryptedSecret { + t.Fatalf("EncryptedSecret: expected %q, got %q", data.EncryptedSecret, loaded.EncryptedSecret) + } + if loaded.AccountID != data.AccountID { + t.Fatalf("AccountID: expected %q, got %q", data.AccountID, loaded.AccountID) + } +} + +func TestSaveBootstrapData_InvalidPath(t *testing.T) { + data := &BootstrapData{ + AccessKeyID: "AKIAIOSFODNN7EXAMPLE", + EncryptedSecret: "dGVzdA==", + AccountID: "000000000000", + } + err := SaveBootstrapData("/nonexistent/dir/bootstrap.json", data) + if err == nil { + t.Fatal("SaveBootstrapData() should fail for invalid path") + } +} diff --git a/hive/handlers/iam/service.go b/hive/handlers/iam/service.go new file mode 100644 index 000000000..fa4211f00 --- /dev/null +++ b/hive/handlers/iam/service.go @@ -0,0 +1,46 @@ +package handlers_iam + +import ( + "github.com/aws/aws-sdk-go/service/iam" +) + +// IAMService defines the interface for IAM operations. +type IAMService interface { + // User CRUD — account-scoped + CreateUser(accountID string, input *iam.CreateUserInput) (*iam.CreateUserOutput, error) + GetUser(accountID string, input *iam.GetUserInput) (*iam.GetUserOutput, error) + ListUsers(accountID string, input *iam.ListUsersInput) (*iam.ListUsersOutput, error) + DeleteUser(accountID string, input *iam.DeleteUserInput) (*iam.DeleteUserOutput, error) + + // Access key lifecycle — account-scoped + CreateAccessKey(accountID string, input *iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) + ListAccessKeys(accountID string, input *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) + DeleteAccessKey(accountID string, input *iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) + UpdateAccessKey(accountID string, input *iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) + + // Policy CRUD — account-scoped + CreatePolicy(accountID string, input *iam.CreatePolicyInput) (*iam.CreatePolicyOutput, error) + GetPolicy(accountID string, input *iam.GetPolicyInput) (*iam.GetPolicyOutput, error) + GetPolicyVersion(accountID string, input *iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error) + ListPolicies(accountID string, input *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) + DeletePolicy(accountID string, input *iam.DeletePolicyInput) (*iam.DeletePolicyOutput, error) + + // Policy attachment — account-scoped + AttachUserPolicy(accountID string, input *iam.AttachUserPolicyInput) (*iam.AttachUserPolicyOutput, error) + DetachUserPolicy(accountID string, input *iam.DetachUserPolicyInput) (*iam.DetachUserPolicyOutput, error) + ListAttachedUserPolicies(accountID string, input *iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) + + // Policy evaluation (internal — used by gateway enforcement) + GetUserPolicies(accountID, userName string) ([]PolicyDocument, error) + + // Auth (internal — used by SigV4 middleware and bootstrap, not exposed via gateway) + LookupAccessKey(accessKeyID string) (*AccessKey, error) + DecryptSecret(ciphertext string) (string, error) + SeedRootUser(data *BootstrapData) error + IsEmpty() (bool, error) + + // Account operations + CreateAccount(name string) (*Account, error) + GetAccount(accountID string) (*Account, error) + ListAccounts() ([]*Account, error) +} diff --git a/hive/handlers/iam/service_impl.go b/hive/handlers/iam/service_impl.go new file mode 100644 index 000000000..5723467ad --- /dev/null +++ b/hive/handlers/iam/service_impl.go @@ -0,0 +1,1269 @@ +package handlers_iam + +import ( + "crypto/rand" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "log/slog" + "slices" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" + "github.com/mulgadc/hive/hive/admin" + "github.com/mulgadc/hive/hive/awserrors" + "github.com/nats-io/nats.go" +) + +const ( + KVBucketUsers = "hive-iam-users" + KVBucketAccessKeys = "hive-iam-access-keys" + KVBucketPolicies = "hive-iam-policies" + KVBucketAccounts = "hive-accounts" + KVBucketAccountCounter = "hive-account-counter" + + GlobalAccountID = "000000000000" + + maxAccessKeysPerUser = 2 +) + +// IAMServiceImpl implements IAM operations using NATS JetStream KV. +type IAMServiceImpl struct { + js nats.JetStreamContext + usersBucket nats.KeyValue + accessKeysBucket nats.KeyValue + policiesBucket nats.KeyValue + accountsBucket nats.KeyValue + accountCounterBucket nats.KeyValue + masterKey []byte + decrypter *Decrypter +} + +// NewIAMServiceImpl creates a new IAM service backed by NATS JetStream KV. +func NewIAMServiceImpl(natsConn *nats.Conn, masterKey []byte) (*IAMServiceImpl, error) { + if len(masterKey) != 32 { + return nil, fmt.Errorf("master key must be 32 bytes, got %d", len(masterKey)) + } + + js, err := natsConn.JetStream() + if err != nil { + return nil, fmt.Errorf("get JetStream context: %w", err) + } + + usersBucket, err := getOrCreateBucket(js, KVBucketUsers, 10) + if err != nil { + return nil, fmt.Errorf("init users bucket: %w", err) + } + + accessKeysBucket, err := getOrCreateBucket(js, KVBucketAccessKeys, 5) + if err != nil { + return nil, fmt.Errorf("init access keys bucket: %w", err) + } + + policiesBucket, err := getOrCreateBucket(js, KVBucketPolicies, 10) + if err != nil { + return nil, fmt.Errorf("init policies bucket: %w", err) + } + + accountsBucket, err := getOrCreateBucket(js, KVBucketAccounts, 5) + if err != nil { + return nil, fmt.Errorf("init accounts bucket: %w", err) + } + + accountCounterBucket, err := getOrCreateBucket(js, KVBucketAccountCounter, 5) + if err != nil { + return nil, fmt.Errorf("init account counter bucket: %w", err) + } + + decrypter, err := NewDecrypter(masterKey) + if err != nil { + return nil, fmt.Errorf("init decrypter: %w", err) + } + + slog.Info("IAM service initialized", + "users_bucket", KVBucketUsers, + "access_keys_bucket", KVBucketAccessKeys, + "policies_bucket", KVBucketPolicies, + "accounts_bucket", KVBucketAccounts) + + return &IAMServiceImpl{ + js: js, + usersBucket: usersBucket, + accessKeysBucket: accessKeysBucket, + policiesBucket: policiesBucket, + accountsBucket: accountsBucket, + accountCounterBucket: accountCounterBucket, + masterKey: masterKey, + decrypter: decrypter, + }, nil +} + +func getOrCreateBucket(js nats.JetStreamContext, name string, history uint8) (nats.KeyValue, error) { + kv, err := js.CreateKeyValue(&nats.KeyValueConfig{ + Bucket: name, + History: history, + }) + if err != nil { + kv, err = js.KeyValue(name) + if err != nil { + return nil, err + } + } + return kv, nil +} + +// --------------------------------------------------------------------------- +// User CRUD +// --------------------------------------------------------------------------- + +func (s *IAMServiceImpl) CreateUser(accountID string, input *iam.CreateUserInput) (*iam.CreateUserOutput, error) { + userName := *input.UserName + if err := validateUserName(userName); err != nil { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + + path := "/" + if input.Path != nil { + path = *input.Path + if err := validatePath(path); err != nil { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + } + + kvKey := accountID + "." + userName + user := User{ + UserName: userName, + UserID: generateIAMID("AIDA"), + AccountID: accountID, + ARN: fmt.Sprintf("arn:aws:iam::%s:user%s%s", accountID, path, userName), + Path: path, + CreatedAt: time.Now().UTC().Format(time.RFC3339), + AccessKeys: []string{}, + Tags: []Tag{}, + AttachedPolicies: []string{}, + } + + for _, tag := range input.Tags { + if tag.Key != nil && tag.Value != nil { + user.Tags = append(user.Tags, Tag{Key: *tag.Key, Value: *tag.Value}) + } + } + + data, err := json.Marshal(user) + if err != nil { + return nil, fmt.Errorf("marshal user: %w", err) + } + + // Atomic create — fails if key already exists (race-safe) + if _, err := s.usersBucket.Create(kvKey, data); err != nil { + if errors.Is(err, nats.ErrKeyExists) { + return nil, errors.New(awserrors.ErrorIAMEntityAlreadyExists) + } + return nil, fmt.Errorf("store user: %w", err) + } + + slog.Info("IAM user created", "accountID", accountID, "userName", userName, "userID", user.UserID) + + createdAt := parseCreatedAt(user.CreatedAt) + return &iam.CreateUserOutput{ + User: &iam.User{ + UserName: aws.String(user.UserName), + UserId: aws.String(user.UserID), + Arn: aws.String(user.ARN), + Path: aws.String(user.Path), + CreateDate: aws.Time(createdAt), + }, + }, nil +} + +func (s *IAMServiceImpl) GetUser(accountID string, input *iam.GetUserInput) (*iam.GetUserOutput, error) { + user, err := s.getUser(accountID, *input.UserName) + if err != nil { + return nil, err + } + + createdAt := parseCreatedAt(user.CreatedAt) + return &iam.GetUserOutput{ + User: &iam.User{ + UserName: aws.String(user.UserName), + UserId: aws.String(user.UserID), + Arn: aws.String(user.ARN), + Path: aws.String(user.Path), + CreateDate: aws.Time(createdAt), + }, + }, nil +} + +func (s *IAMServiceImpl) ListUsers(accountID string, input *iam.ListUsersInput) (*iam.ListUsersOutput, error) { + keys, err := s.usersBucket.Keys() + if err != nil { + if errors.Is(err, nats.ErrNoKeysFound) { + return &iam.ListUsersOutput{ + Users: []*iam.User{}, + IsTruncated: aws.Bool(false), + }, nil + } + return nil, fmt.Errorf("list user keys: %w", err) + } + + pathPrefix := "/" + if input.PathPrefix != nil { + pathPrefix = *input.PathPrefix + } + + keyPrefix := accountID + "." + var users []*iam.User + for _, key := range keys { + if !strings.HasPrefix(key, keyPrefix) { + continue + } + + entry, err := s.usersBucket.Get(key) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + slog.Debug("ListUsers: user key disappeared (concurrent delete)", "key", key) + } else { + slog.Warn("ListUsers: failed to get user", "key", key, "err", err) + } + continue + } + + var user User + if err := json.Unmarshal(entry.Value(), &user); err != nil { + slog.Warn("ListUsers: failed to unmarshal user", "key", key, "err", err) + continue + } + + if !strings.HasPrefix(user.Path, pathPrefix) { + continue + } + + createdAt := parseCreatedAt(user.CreatedAt) + users = append(users, &iam.User{ + UserName: aws.String(user.UserName), + UserId: aws.String(user.UserID), + Arn: aws.String(user.ARN), + Path: aws.String(user.Path), + CreateDate: aws.Time(createdAt), + }) + } + + return &iam.ListUsersOutput{ + Users: users, + IsTruncated: aws.Bool(false), + }, nil +} + +func (s *IAMServiceImpl) DeleteUser(accountID string, input *iam.DeleteUserInput) (*iam.DeleteUserOutput, error) { + userName := *input.UserName + kvKey := accountID + "." + userName + + user, err := s.getUser(accountID, userName) + if err != nil { + return nil, err + } + + if len(user.AccessKeys) > 0 { + return nil, errors.New(awserrors.ErrorIAMDeleteConflict) + } + if len(user.AttachedPolicies) > 0 { + return nil, errors.New(awserrors.ErrorIAMDeleteConflict) + } + + if err := s.usersBucket.Delete(kvKey); err != nil { + return nil, fmt.Errorf("delete user: %w", err) + } + + slog.Info("IAM user deleted", "accountID", accountID, "userName", userName) + return &iam.DeleteUserOutput{}, nil +} + +// --------------------------------------------------------------------------- +// Access Key Lifecycle +// --------------------------------------------------------------------------- + +func (s *IAMServiceImpl) CreateAccessKey(accountID string, input *iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) { + userName := *input.UserName + userKVKey := accountID + "." + userName + + user, err := s.getUser(accountID, userName) + if err != nil { + return nil, err + } + + if len(user.AccessKeys) >= maxAccessKeysPerUser { + return nil, errors.New(awserrors.ErrorIAMLimitExceeded) + } + + accessKeyID := generateAccessKeyID() + secretAccessKey := admin.GenerateAWSSecretKey() + + encryptedSecret, err := EncryptSecret(secretAccessKey, s.masterKey) + if err != nil { + return nil, fmt.Errorf("encrypt secret: %w", err) + } + + ak := AccessKey{ + AccessKeyID: accessKeyID, + SecretAccessKey: encryptedSecret, + UserName: userName, + AccountID: accountID, + Status: AccessKeyStatusActive, + CreatedAt: time.Now().UTC().Format(time.RFC3339), + } + + akData, err := json.Marshal(ak) + if err != nil { + return nil, fmt.Errorf("marshal access key: %w", err) + } + + if _, err := s.accessKeysBucket.Put(accessKeyID, akData); err != nil { + return nil, fmt.Errorf("store access key: %w", err) + } + + // Update user's access key list + user.AccessKeys = append(user.AccessKeys, accessKeyID) + userData, err := json.Marshal(user) + if err != nil { + if rbErr := s.accessKeysBucket.Delete(accessKeyID); rbErr != nil { + slog.Error("Rollback failed: orphaned access key", "accessKeyID", accessKeyID, "err", rbErr) + } + return nil, fmt.Errorf("marshal user: %w", err) + } + + if _, err := s.usersBucket.Put(userKVKey, userData); err != nil { + if rbErr := s.accessKeysBucket.Delete(accessKeyID); rbErr != nil { + slog.Error("Rollback failed: orphaned access key", "accessKeyID", accessKeyID, "err", rbErr) + } + return nil, fmt.Errorf("update user: %w", err) + } + + slog.Info("IAM access key created", "accountID", accountID, "userName", userName, "accessKeyID", accessKeyID) + + createdAt := parseCreatedAt(ak.CreatedAt) + return &iam.CreateAccessKeyOutput{ + AccessKey: &iam.AccessKey{ + AccessKeyId: aws.String(accessKeyID), + SecretAccessKey: aws.String(secretAccessKey), // plaintext — only time it's returned + UserName: aws.String(userName), + Status: aws.String(AccessKeyStatusActive), + CreateDate: aws.Time(createdAt), + }, + }, nil +} + +func (s *IAMServiceImpl) ListAccessKeys(accountID string, input *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) { + user, err := s.getUser(accountID, *input.UserName) + if err != nil { + return nil, err + } + + var metadata []*iam.AccessKeyMetadata + for _, keyID := range user.AccessKeys { + entry, err := s.accessKeysBucket.Get(keyID) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + slog.Debug("ListAccessKeys: access key disappeared (concurrent delete)", "keyID", keyID) + } else { + slog.Warn("ListAccessKeys: failed to get access key", "keyID", keyID, "err", err) + } + continue + } + + var ak AccessKey + if err := json.Unmarshal(entry.Value(), &ak); err != nil { + slog.Warn("ListAccessKeys: failed to unmarshal access key", "keyID", keyID, "err", err) + continue + } + + createdAt := parseCreatedAt(ak.CreatedAt) + metadata = append(metadata, &iam.AccessKeyMetadata{ + AccessKeyId: aws.String(ak.AccessKeyID), + UserName: aws.String(ak.UserName), + Status: aws.String(ak.Status), + CreateDate: aws.Time(createdAt), + }) + } + + return &iam.ListAccessKeysOutput{ + AccessKeyMetadata: metadata, + IsTruncated: aws.Bool(false), + }, nil +} + +func (s *IAMServiceImpl) DeleteAccessKey(accountID string, input *iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) { + userName := *input.UserName + accessKeyID := *input.AccessKeyId + userKVKey := accountID + "." + userName + + user, err := s.getUser(accountID, userName) + if err != nil { + return nil, err + } + + // Find and remove the access key reference from the user + found := false + remaining := make([]string, 0, len(user.AccessKeys)) + for _, keyID := range user.AccessKeys { + if keyID == accessKeyID { + found = true + } else { + remaining = append(remaining, keyID) + } + } + + if !found { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + + if err := s.accessKeysBucket.Delete(accessKeyID); err != nil { + return nil, fmt.Errorf("delete access key: %w", err) + } + + user.AccessKeys = remaining + userData, err := json.Marshal(user) + if err != nil { + return nil, fmt.Errorf("marshal user: %w", err) + } + + if _, err := s.usersBucket.Put(userKVKey, userData); err != nil { + return nil, fmt.Errorf("update user: %w", err) + } + + slog.Info("IAM access key deleted", "accountID", accountID, "userName", userName, "accessKeyID", accessKeyID) + return &iam.DeleteAccessKeyOutput{}, nil +} + +func (s *IAMServiceImpl) UpdateAccessKey(accountID string, input *iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) { + status := *input.Status + if status != AccessKeyStatusActive && status != AccessKeyStatusInactive { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + + accessKeyID := *input.AccessKeyId + + entry, err := s.accessKeysBucket.Get(accessKeyID) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + return nil, fmt.Errorf("get access key: %w", err) + } + + var ak AccessKey + if err := json.Unmarshal(entry.Value(), &ak); err != nil { + return nil, fmt.Errorf("unmarshal access key: %w", err) + } + + if ak.AccountID != accountID { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + + ak.Status = status + data, err := json.Marshal(ak) + if err != nil { + return nil, fmt.Errorf("marshal access key: %w", err) + } + + if _, err := s.accessKeysBucket.Put(accessKeyID, data); err != nil { + return nil, fmt.Errorf("update access key: %w", err) + } + + slog.Info("IAM access key updated", "accountID", accountID, "accessKeyID", accessKeyID, "status", status) + return &iam.UpdateAccessKeyOutput{}, nil +} + +// --------------------------------------------------------------------------- +// Auth (internal — used by SigV4 middleware and bootstrap) +// --------------------------------------------------------------------------- + +// LookupAccessKey retrieves an access key by its ID. Returns the full record +// including the encrypted secret, for use by the SigV4 middleware. +func (s *IAMServiceImpl) LookupAccessKey(accessKeyID string) (*AccessKey, error) { + entry, err := s.accessKeysBucket.Get(accessKeyID) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + return nil, fmt.Errorf("lookup access key: %w", err) + } + + var ak AccessKey + if err := json.Unmarshal(entry.Value(), &ak); err != nil { + return nil, fmt.Errorf("unmarshal access key: %w", err) + } + return &ak, nil +} + +// DecryptSecret decrypts a base64-encoded AES-256-GCM ciphertext using the +// pre-computed cipher initialized at startup. +func (s *IAMServiceImpl) DecryptSecret(ciphertext string) (string, error) { + return s.decrypter.Decrypt(ciphertext) +} + +// SeedRootUser consumes bootstrap data to create the root IAM user and access +// key in NATS KV. Uses conditional create (put-if-not-exists) for multi-node +// race safety — the first node to call this wins; others skip silently. +// Also creates the global account record (000000000000) if it doesn't exist. +func (s *IAMServiceImpl) SeedRootUser(data *BootstrapData) error { + // Ensure the global account record exists + globalAccount := Account{ + AccountID: GlobalAccountID, + AccountName: "Global", + Status: AccountStatusActive, + CreatedAt: time.Now().UTC().Format(time.RFC3339), + } + accountData, err := json.Marshal(globalAccount) + if err != nil { + return fmt.Errorf("marshal global account: %w", err) + } + if _, err := s.accountsBucket.Create(GlobalAccountID, accountData); err != nil && !errors.Is(err, nats.ErrKeyExists) { + return fmt.Errorf("seed global account: %w", err) + } + + kvKey := GlobalAccountID + ".root" + rootUser := User{ + UserName: "root", + UserID: "AIDAAAAAAAAAAAAAAAAA", + AccountID: GlobalAccountID, + ARN: fmt.Sprintf("arn:aws:iam::%s:root", GlobalAccountID), + Path: "/", + CreatedAt: time.Now().UTC().Format(time.RFC3339), + AccessKeys: []string{data.AccessKeyID}, + Tags: []Tag{}, + AttachedPolicies: []string{}, + } + + userData, err := json.Marshal(rootUser) + if err != nil { + return fmt.Errorf("marshal root user: %w", err) + } + + // Conditional create — fails if key already exists (another node seeded first) + _, err = s.usersBucket.Create(kvKey, userData) + if errors.Is(err, nats.ErrKeyExists) { + slog.Info("Root user already seeded by another node, skipping") + return nil + } + if err != nil { + return fmt.Errorf("seed root user: %w", err) + } + + // Create access key entry (also conditional) + ak := AccessKey{ + AccessKeyID: data.AccessKeyID, + SecretAccessKey: data.EncryptedSecret, + UserName: "root", + AccountID: GlobalAccountID, + Status: AccessKeyStatusActive, + CreatedAt: rootUser.CreatedAt, + } + + akData, err := json.Marshal(ak) + if err != nil { + return fmt.Errorf("marshal root access key: %w", err) + } + + _, err = s.accessKeysBucket.Create(data.AccessKeyID, akData) + if errors.Is(err, nats.ErrKeyExists) { + slog.Info("Root access key already seeded by another node, skipping") + return nil + } + if err != nil { + return fmt.Errorf("seed root access key: %w", err) + } + + slog.Info("Root IAM user seeded", "accountID", GlobalAccountID, "accessKeyID", data.AccessKeyID) + return nil +} + +// IsEmpty returns true if the users bucket has no entries. +func (s *IAMServiceImpl) IsEmpty() (bool, error) { + keys, err := s.usersBucket.Keys() + if err != nil { + if errors.Is(err, nats.ErrNoKeysFound) { + return true, nil + } + return false, fmt.Errorf("check users bucket: %w", err) + } + return len(keys) == 0, nil +} + +// --------------------------------------------------------------------------- +// Account Operations +// --------------------------------------------------------------------------- + +// CreateAccount creates a new account with a sequentially assigned 12-digit ID. +// Uses a CAS loop on the counter bucket for safe concurrent ID assignment. +func (s *IAMServiceImpl) CreateAccount(name string) (*Account, error) { + if name == "" { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + + var accountID string + for { + // Read current counter value + entry, err := s.accountCounterBucket.Get("next_id") + if errors.Is(err, nats.ErrKeyNotFound) { + // First account ever — start at 1 (000000000000 is the global account) + accountID = fmt.Sprintf("%012d", 1) + if _, err := s.accountCounterBucket.Create("next_id", []byte("2")); err != nil { + if errors.Is(err, nats.ErrKeyExists) { + continue // Another node raced us, retry + } + return nil, fmt.Errorf("init account counter: %w", err) + } + break + } + if err != nil { + return nil, fmt.Errorf("read account counter: %w", err) + } + + nextID, err := strconv.ParseInt(string(entry.Value()), 10, 64) + if err != nil { + return nil, fmt.Errorf("parse account counter: %w", err) + } + accountID = fmt.Sprintf("%012d", nextID) + + // CAS update: increment counter, fail if revision changed + newVal := []byte(strconv.FormatInt(nextID+1, 10)) + if _, err := s.accountCounterBucket.Update("next_id", newVal, entry.Revision()); err != nil { + if errors.Is(err, nats.ErrKeyExists) { + continue // CAS conflict, retry + } + return nil, fmt.Errorf("update account counter: %w", err) + } + break + } + + account := Account{ + AccountID: accountID, + AccountName: name, + Status: AccountStatusActive, + CreatedAt: time.Now().UTC().Format(time.RFC3339), + } + + data, err := json.Marshal(account) + if err != nil { + return nil, fmt.Errorf("marshal account: %w", err) + } + + if _, err := s.accountsBucket.Create(accountID, data); err != nil { + return nil, fmt.Errorf("store account: %w", err) + } + + slog.Info("Account created", "accountID", accountID, "name", name) + return &account, nil +} + +// GetAccount retrieves an account by its 12-digit ID. +func (s *IAMServiceImpl) GetAccount(accountID string) (*Account, error) { + entry, err := s.accountsBucket.Get(accountID) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + return nil, fmt.Errorf("get account: %w", err) + } + + var account Account + if err := json.Unmarshal(entry.Value(), &account); err != nil { + return nil, fmt.Errorf("unmarshal account: %w", err) + } + return &account, nil +} + +// ListAccounts returns all accounts. +func (s *IAMServiceImpl) ListAccounts() ([]*Account, error) { + keys, err := s.accountsBucket.Keys() + if err != nil { + if errors.Is(err, nats.ErrNoKeysFound) { + return []*Account{}, nil + } + return nil, fmt.Errorf("list account keys: %w", err) + } + + accounts := make([]*Account, 0, len(keys)) + for _, key := range keys { + entry, err := s.accountsBucket.Get(key) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + continue + } + return nil, fmt.Errorf("get account %s: %w", key, err) + } + + var account Account + if err := json.Unmarshal(entry.Value(), &account); err != nil { + slog.Warn("ListAccounts: failed to unmarshal account", "key", key, "err", err) + continue + } + accounts = append(accounts, &account) + } + return accounts, nil +} + +// --------------------------------------------------------------------------- +// Policy CRUD +// --------------------------------------------------------------------------- + +func (s *IAMServiceImpl) CreatePolicy(accountID string, input *iam.CreatePolicyInput) (*iam.CreatePolicyOutput, error) { + policyName := *input.PolicyName + if err := validatePolicyName(policyName); err != nil { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + + kvKey := accountID + "." + policyName + + if _, err := ValidatePolicyDocument(*input.PolicyDocument); err != nil { + slog.Debug("CreatePolicy: invalid policy document", "policyName", policyName, "err", err) + return nil, errors.New(awserrors.ErrorIAMMalformedPolicyDocument) + } + + path := aws.StringValue(input.Path) + if path == "" { + path = "/" + } else if err := validatePath(path); err != nil { + return nil, errors.New(awserrors.ErrorIAMInvalidInput) + } + + policy := Policy{ + PolicyName: policyName, + PolicyID: generateIAMID("ANPA"), + ARN: fmt.Sprintf("arn:aws:iam::%s:policy%s%s", accountID, path, policyName), + Path: path, + Description: aws.StringValue(input.Description), + PolicyDocument: *input.PolicyDocument, + CreatedAt: time.Now().UTC().Format(time.RFC3339), + DefaultVersion: "v1", + Tags: []Tag{}, + } + + data, err := json.Marshal(policy) + if err != nil { + return nil, fmt.Errorf("marshal policy: %w", err) + } + + if _, err := s.policiesBucket.Create(kvKey, data); err != nil { + if errors.Is(err, nats.ErrKeyExists) { + return nil, errors.New(awserrors.ErrorIAMEntityAlreadyExists) + } + return nil, fmt.Errorf("store policy: %w", err) + } + + slog.Info("IAM policy created", "accountID", accountID, "policyName", policyName, "policyID", policy.PolicyID) + + createdAt := parseCreatedAt(policy.CreatedAt) + return &iam.CreatePolicyOutput{ + Policy: &iam.Policy{ + PolicyName: aws.String(policy.PolicyName), + PolicyId: aws.String(policy.PolicyID), + Arn: aws.String(policy.ARN), + Path: aws.String(policy.Path), + Description: aws.String(policy.Description), + DefaultVersionId: aws.String(policy.DefaultVersion), + CreateDate: aws.Time(createdAt), + AttachmentCount: aws.Int64(0), + IsAttachable: aws.Bool(true), + }, + }, nil +} + +func (s *IAMServiceImpl) GetPolicy(accountID string, input *iam.GetPolicyInput) (*iam.GetPolicyOutput, error) { + policy, err := s.getPolicyByARN(accountID, *input.PolicyArn) + if err != nil { + return nil, err + } + + attachmentCount, err := s.countPolicyAttachments(accountID, policy.ARN) + if err != nil { + return nil, fmt.Errorf("check policy attachments: %w", err) + } + + createdAt := parseCreatedAt(policy.CreatedAt) + return &iam.GetPolicyOutput{ + Policy: &iam.Policy{ + PolicyName: aws.String(policy.PolicyName), + PolicyId: aws.String(policy.PolicyID), + Arn: aws.String(policy.ARN), + Path: aws.String(policy.Path), + Description: aws.String(policy.Description), + DefaultVersionId: aws.String(policy.DefaultVersion), + CreateDate: aws.Time(createdAt), + AttachmentCount: aws.Int64(attachmentCount), + IsAttachable: aws.Bool(true), + }, + }, nil +} + +func (s *IAMServiceImpl) GetPolicyVersion(accountID string, input *iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error) { + policy, err := s.getPolicyByARN(accountID, *input.PolicyArn) + if err != nil { + return nil, err + } + + // We only support v1 — reject other version IDs + if *input.VersionId != "v1" { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + + createdAt := parseCreatedAt(policy.CreatedAt) + return &iam.GetPolicyVersionOutput{ + PolicyVersion: &iam.PolicyVersion{ + Document: aws.String(policy.PolicyDocument), + VersionId: aws.String("v1"), + IsDefaultVersion: aws.Bool(true), + CreateDate: aws.Time(createdAt), + }, + }, nil +} + +func (s *IAMServiceImpl) ListPolicies(accountID string, input *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) { + keys, err := s.policiesBucket.Keys() + if err != nil { + if errors.Is(err, nats.ErrNoKeysFound) { + return &iam.ListPoliciesOutput{ + Policies: []*iam.Policy{}, + IsTruncated: aws.Bool(false), + }, nil + } + return nil, fmt.Errorf("list policy keys: %w", err) + } + + // Build attachment counts once for the whole account instead of per-policy. + attachCounts, err := s.buildAttachmentCounts(accountID) + if err != nil { + return nil, fmt.Errorf("build attachment counts: %w", err) + } + + keyPrefix := accountID + "." + var policies []*iam.Policy + for _, key := range keys { + if !strings.HasPrefix(key, keyPrefix) { + continue + } + + entry, err := s.policiesBucket.Get(key) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + slog.Debug("ListPolicies: policy key disappeared (concurrent delete)", "key", key) + } else { + slog.Warn("ListPolicies: failed to get policy", "key", key, "err", err) + } + continue + } + + var policy Policy + if err := json.Unmarshal(entry.Value(), &policy); err != nil { + slog.Warn("ListPolicies: failed to unmarshal policy", "key", key, "err", err) + continue + } + + createdAt := parseCreatedAt(policy.CreatedAt) + policies = append(policies, &iam.Policy{ + PolicyName: aws.String(policy.PolicyName), + PolicyId: aws.String(policy.PolicyID), + Arn: aws.String(policy.ARN), + Path: aws.String(policy.Path), + DefaultVersionId: aws.String(policy.DefaultVersion), + CreateDate: aws.Time(createdAt), + AttachmentCount: aws.Int64(attachCounts[policy.ARN]), + IsAttachable: aws.Bool(true), + }) + } + + return &iam.ListPoliciesOutput{ + Policies: policies, + IsTruncated: aws.Bool(false), + }, nil +} + +func (s *IAMServiceImpl) DeletePolicy(accountID string, input *iam.DeletePolicyInput) (*iam.DeletePolicyOutput, error) { + policy, err := s.getPolicyByARN(accountID, *input.PolicyArn) + if err != nil { + return nil, err + } + + attachCount, err := s.countPolicyAttachments(accountID, policy.ARN) + if err != nil { + return nil, fmt.Errorf("check policy attachments: %w", err) + } + if attachCount > 0 { + return nil, errors.New(awserrors.ErrorIAMDeleteConflict) + } + + kvKey := accountID + "." + policy.PolicyName + if err := s.policiesBucket.Delete(kvKey); err != nil { + return nil, fmt.Errorf("delete policy: %w", err) + } + + slog.Info("IAM policy deleted", "accountID", accountID, "policyName", policy.PolicyName) + return &iam.DeletePolicyOutput{}, nil +} + +// --------------------------------------------------------------------------- +// Policy Attachment +// --------------------------------------------------------------------------- + +func (s *IAMServiceImpl) AttachUserPolicy(accountID string, input *iam.AttachUserPolicyInput) (*iam.AttachUserPolicyOutput, error) { + userName := *input.UserName + policyARN := *input.PolicyArn + userKVKey := accountID + "." + userName + + // Verify policy exists + if _, err := s.getPolicyByARN(accountID, policyARN); err != nil { + return nil, err + } + + user, err := s.getUser(accountID, userName) + if err != nil { + return nil, err + } + + // Idempotent — if already attached, succeed silently + if slices.Contains(user.AttachedPolicies, policyARN) { + return &iam.AttachUserPolicyOutput{}, nil + } + + user.AttachedPolicies = append(user.AttachedPolicies, policyARN) + userData, err := json.Marshal(user) + if err != nil { + return nil, fmt.Errorf("marshal user: %w", err) + } + + if _, err := s.usersBucket.Put(userKVKey, userData); err != nil { + return nil, fmt.Errorf("update user: %w", err) + } + + slog.Info("IAM policy attached to user", "accountID", accountID, "userName", userName, "policyArn", policyARN) + return &iam.AttachUserPolicyOutput{}, nil +} + +func (s *IAMServiceImpl) DetachUserPolicy(accountID string, input *iam.DetachUserPolicyInput) (*iam.DetachUserPolicyOutput, error) { + userName := *input.UserName + policyARN := *input.PolicyArn + userKVKey := accountID + "." + userName + + user, err := s.getUser(accountID, userName) + if err != nil { + return nil, err + } + + found := false + remaining := make([]string, 0, len(user.AttachedPolicies)) + for _, arn := range user.AttachedPolicies { + if arn == policyARN { + found = true + } else { + remaining = append(remaining, arn) + } + } + + if !found { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + + user.AttachedPolicies = remaining + userData, err := json.Marshal(user) + if err != nil { + return nil, fmt.Errorf("marshal user: %w", err) + } + + if _, err := s.usersBucket.Put(userKVKey, userData); err != nil { + return nil, fmt.Errorf("update user: %w", err) + } + + slog.Info("IAM policy detached from user", "accountID", accountID, "userName", userName, "policyArn", policyARN) + return &iam.DetachUserPolicyOutput{}, nil +} + +func (s *IAMServiceImpl) ListAttachedUserPolicies(accountID string, input *iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) { + user, err := s.getUser(accountID, *input.UserName) + if err != nil { + return nil, err + } + + var attached []*iam.AttachedPolicy + for _, arn := range user.AttachedPolicies { + policy, err := s.getPolicyByARN(accountID, arn) + if err != nil { + slog.Warn("ListAttachedUserPolicies: policy not found for ARN", "arn", arn, "err", err) + continue + } + attached = append(attached, &iam.AttachedPolicy{ + PolicyArn: aws.String(policy.ARN), + PolicyName: aws.String(policy.PolicyName), + }) + } + + return &iam.ListAttachedUserPoliciesOutput{ + AttachedPolicies: attached, + IsTruncated: aws.Bool(false), + }, nil +} + +// GetUserPolicies resolves all policy documents attached to a user. +// Used internally by the gateway for policy evaluation. +func (s *IAMServiceImpl) GetUserPolicies(accountID, userName string) ([]PolicyDocument, error) { + user, err := s.getUser(accountID, userName) + if err != nil { + return nil, err + } + + var docs []PolicyDocument + for _, arn := range user.AttachedPolicies { + policy, err := s.getPolicyByARN(accountID, arn) + if err != nil { + // Fail closed: if we can't resolve a policy, we can't make a safe + // access decision. Return an error so the caller denies access. + return nil, fmt.Errorf("resolve policy %s: %w", arn, err) + } + + // policy already validated at creation, so we skip validating again + var doc PolicyDocument + if err := json.Unmarshal([]byte(policy.PolicyDocument), &doc); err != nil { + return nil, fmt.Errorf("parse policy %s: %w", policy.PolicyName, err) + } + docs = append(docs, doc) + } + + return docs, nil +} + +// --------------------------------------------------------------------------- +// Helpers +// --------------------------------------------------------------------------- + +func (s *IAMServiceImpl) getPolicyByARN(accountID, policyARN string) (*Policy, error) { + // Extract policy name from ARN: arn:aws:iam::000000000000:policy/path/PolicyName + parts := strings.SplitN(policyARN, ":policy", 2) + if len(parts) != 2 || parts[1] == "" { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + // The name is the last segment after the final / + segments := strings.Split(parts[1], "/") + policyName := segments[len(segments)-1] + if policyName == "" { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + + kvKey := accountID + "." + policyName + entry, err := s.policiesBucket.Get(kvKey) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + return nil, fmt.Errorf("get policy: %w", err) + } + + var policy Policy + if err := json.Unmarshal(entry.Value(), &policy); err != nil { + return nil, fmt.Errorf("unmarshal policy: %w", err) + } + + // Verify the full ARN matches (path may differ) + if policy.ARN != policyARN { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + + return &policy, nil +} + +// buildAttachmentCounts fetches all users for the account once and returns a +// map of policyARN -> number of users that have it attached. This avoids the +// N+1 pattern of calling countPolicyAttachments per policy in ListPolicies. +func (s *IAMServiceImpl) buildAttachmentCounts(accountID string) (map[string]int64, error) { + keys, err := s.usersBucket.Keys() + if err != nil { + if errors.Is(err, nats.ErrNoKeysFound) { + return nil, nil + } + return nil, fmt.Errorf("build attachment counts: %w", err) + } + + counts := make(map[string]int64) + keyPrefix := accountID + "." + for _, key := range keys { + if !strings.HasPrefix(key, keyPrefix) { + continue + } + + entry, err := s.usersBucket.Get(key) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + slog.Debug("buildAttachmentCounts: user key disappeared", "key", key) + continue + } + slog.Warn("buildAttachmentCounts: failed to get user", "key", key, "err", err) + continue + } + var user User + if err := json.Unmarshal(entry.Value(), &user); err != nil { + slog.Warn("buildAttachmentCounts: failed to unmarshal user", "key", key, "err", err) + continue + } + for _, arn := range user.AttachedPolicies { + counts[arn]++ + } + } + return counts, nil +} + +// countPolicyAttachments counts how many users in this account have this policy attached. +func (s *IAMServiceImpl) countPolicyAttachments(accountID, policyARN string) (int64, error) { + keys, err := s.usersBucket.Keys() + if err != nil { + if errors.Is(err, nats.ErrNoKeysFound) { + return 0, nil + } + return 0, fmt.Errorf("count policy attachments: %w", err) + } + + keyPrefix := accountID + "." + var count int64 + for _, key := range keys { + if !strings.HasPrefix(key, keyPrefix) { + continue + } + + entry, err := s.usersBucket.Get(key) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + slog.Debug("countPolicyAttachments: user key disappeared", "key", key) + continue + } + slog.Warn("countPolicyAttachments: failed to get user", "key", key, "err", err) + continue + } + var user User + if err := json.Unmarshal(entry.Value(), &user); err != nil { + slog.Warn("countPolicyAttachments: failed to unmarshal user", "key", key, "err", err) + continue + } + if slices.Contains(user.AttachedPolicies, policyARN) { + count++ + } + } + return count, nil +} + +func (s *IAMServiceImpl) getUser(accountID, userName string) (*User, error) { + kvKey := accountID + "." + userName + entry, err := s.usersBucket.Get(kvKey) + if err != nil { + if errors.Is(err, nats.ErrKeyNotFound) { + return nil, errors.New(awserrors.ErrorIAMNoSuchEntity) + } + return nil, fmt.Errorf("get user: %w", err) + } + + var user User + if err := json.Unmarshal(entry.Value(), &user); err != nil { + return nil, fmt.Errorf("unmarshal user: %w", err) + } + return &user, nil +} + +func generateIAMID(prefix string) string { + b := make([]byte, 16) + if _, err := rand.Read(b); err != nil { + panic("crypto/rand failed: " + err.Error()) + } + return prefix + strings.ToUpper(hex.EncodeToString(b))[:17] +} + +func generateAccessKeyID() string { + b := make([]byte, 10) + if _, err := rand.Read(b); err != nil { + panic("crypto/rand failed: " + err.Error()) + } + return "AKIA" + strings.ToUpper(hex.EncodeToString(b)) +} + +func parseCreatedAt(raw string) time.Time { + t, err := time.Parse(time.RFC3339, raw) + if err != nil { + slog.Warn("parseCreatedAt: invalid RFC3339", "raw", raw, "err", err) + } + return t +} + +const maxPolicyDocumentSize = 6144 + +// isIAMNameChar returns true if c is allowed in IAM user/policy names. +func isIAMNameChar(c byte) bool { + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || + c == '+' || c == '=' || c == ',' || c == '.' || c == '@' || c == '-' || c == '_' +} + +func validateUserName(name string) error { + if len(name) == 0 || len(name) > 64 { + return fmt.Errorf("user name must be between 1 and 64 characters") + } + for i := range len(name) { + if !isIAMNameChar(name[i]) { + return fmt.Errorf("user name contains invalid character: %q", name[i]) + } + } + return nil +} + +func validatePolicyName(name string) error { + if len(name) == 0 || len(name) > 128 { + return fmt.Errorf("policy name must be between 1 and 128 characters") + } + for i := range len(name) { + if !isIAMNameChar(name[i]) { + return fmt.Errorf("policy name contains invalid character: %q", name[i]) + } + } + return nil +} + +func validatePath(path string) error { + if !strings.HasPrefix(path, "/") || !strings.HasSuffix(path, "/") { + return fmt.Errorf("path must begin and end with /") + } + if len(path) > 512 { + return fmt.Errorf("path exceeds maximum length of 512") + } + return nil +} + +// ValidatePolicyDocument parses and validates an IAM policy document JSON string. +func ValidatePolicyDocument(docJSON string) (*PolicyDocument, error) { + if len(docJSON) > maxPolicyDocumentSize { + return nil, fmt.Errorf("policy document exceeds maximum size of %d bytes", maxPolicyDocumentSize) + } + + var doc PolicyDocument + if err := json.Unmarshal([]byte(docJSON), &doc); err != nil { + return nil, fmt.Errorf("invalid JSON: %w", err) + } + + if doc.Version != "2012-10-17" { + return nil, fmt.Errorf("unsupported policy version: %q", doc.Version) + } + + if len(doc.Statement) == 0 { + return nil, fmt.Errorf("policy must contain at least one statement") + } + + for i, stmt := range doc.Statement { + if stmt.Effect != PolicyEffectAllow && stmt.Effect != PolicyEffectDeny { + return nil, fmt.Errorf("statement %d: Effect must be Allow or Deny, got %q", i, stmt.Effect) + } + if len(stmt.Action) == 0 { + return nil, fmt.Errorf("statement %d: Action is required", i) + } + if len(stmt.Resource) == 0 { + return nil, fmt.Errorf("statement %d: Resource is required", i) + } + } + + return &doc, nil +} diff --git a/hive/handlers/iam/service_impl_test.go b/hive/handlers/iam/service_impl_test.go new file mode 100644 index 000000000..812e70c9f --- /dev/null +++ b/hive/handlers/iam/service_impl_test.go @@ -0,0 +1,1320 @@ +package handlers_iam + +import ( + "strings" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" + "github.com/mulgadc/hive/hive/admin" + "github.com/mulgadc/hive/hive/awserrors" + "github.com/nats-io/nats-server/v2/server" + "github.com/nats-io/nats.go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// Interface compliance check +var _ IAMService = (*IAMServiceImpl)(nil) + +const testAccountID = GlobalAccountID + +func setupTestIAMService(t *testing.T) *IAMServiceImpl { + t.Helper() + opts := &server.Options{ + Host: "127.0.0.1", + Port: -1, + JetStream: true, + StoreDir: t.TempDir(), + NoLog: true, + NoSigs: true, + } + ns, err := server.NewServer(opts) + require.NoError(t, err) + go ns.Start() + require.True(t, ns.ReadyForConnections(5*time.Second)) + t.Cleanup(func() { ns.Shutdown() }) + + nc, err := nats.Connect(ns.ClientURL()) + require.NoError(t, err) + t.Cleanup(func() { nc.Close() }) + + masterKey, err := GenerateMasterKey() + require.NoError(t, err) + + svc, err := NewIAMServiceImpl(nc, masterKey) + require.NoError(t, err) + return svc +} + +func createTestUser(t *testing.T, svc *IAMServiceImpl, userName string) *iam.User { + t.Helper() + out, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String(userName), + }) + require.NoError(t, err) + return out.User +} + +// ============================================================================ +// User CRUD Tests +// ============================================================================ + +func TestCreateUser(t *testing.T) { + svc := setupTestIAMService(t) + + out, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("testuser"), + Path: aws.String("/developers/"), + Tags: []*iam.Tag{ + {Key: aws.String("team"), Value: aws.String("backend")}, + }, + }) + require.NoError(t, err) + require.NotNil(t, out.User) + assert.Equal(t, "testuser", *out.User.UserName) + assert.Contains(t, *out.User.Arn, "testuser") + assert.Equal(t, "/developers/", *out.User.Path) + assert.True(t, len(*out.User.UserId) > 4) + assert.Equal(t, "AIDA", (*out.User.UserId)[:4]) +} + +func TestCreateUser_DefaultPath(t *testing.T) { + svc := setupTestIAMService(t) + + out, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("defaultpath"), + }) + require.NoError(t, err) + assert.Equal(t, "/", *out.User.Path) +} + +func TestCreateUser_Duplicate(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("duplicateuser"), + }) + require.NoError(t, err) + + _, err = svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("duplicateuser"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMEntityAlreadyExists) +} + +func TestGetUser(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "getuser") + + out, err := svc.GetUser(testAccountID, &iam.GetUserInput{ + UserName: aws.String("getuser"), + }) + require.NoError(t, err) + assert.Equal(t, "getuser", *out.User.UserName) +} + +func TestGetUser_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.GetUser(testAccountID, &iam.GetUserInput{ + UserName: aws.String("nonexistent"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestListUsers(t *testing.T) { + svc := setupTestIAMService(t) + + createTestUser(t, svc, "user1") + createTestUser(t, svc, "user2") + createTestUser(t, svc, "user3") + + out, err := svc.ListUsers(testAccountID, &iam.ListUsersInput{}) + require.NoError(t, err) + assert.Len(t, out.Users, 3) + + names := make(map[string]bool) + for _, u := range out.Users { + names[*u.UserName] = true + } + assert.True(t, names["user1"]) + assert.True(t, names["user2"]) + assert.True(t, names["user3"]) +} + +func TestListUsers_Empty(t *testing.T) { + svc := setupTestIAMService(t) + + out, err := svc.ListUsers(testAccountID, &iam.ListUsersInput{}) + require.NoError(t, err) + assert.Len(t, out.Users, 0) +} + +func TestListUsers_PathFilter(t *testing.T) { + svc := setupTestIAMService(t) + + svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("dev1"), + Path: aws.String("/developers/"), + }) + svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("admin1"), + Path: aws.String("/admins/"), + }) + + out, err := svc.ListUsers(testAccountID, &iam.ListUsersInput{ + PathPrefix: aws.String("/developers/"), + }) + require.NoError(t, err) + assert.Len(t, out.Users, 1) + assert.Equal(t, "dev1", *out.Users[0].UserName) +} + +func TestDeleteUser(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "deleteuser") + + _, err := svc.DeleteUser(testAccountID, &iam.DeleteUserInput{ + UserName: aws.String("deleteuser"), + }) + require.NoError(t, err) + + _, err = svc.GetUser(testAccountID, &iam.GetUserInput{ + UserName: aws.String("deleteuser"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestDeleteUser_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.DeleteUser(testAccountID, &iam.DeleteUserInput{ + UserName: aws.String("nonexistent"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestDeleteUser_WithAccessKeys(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "userWithKeys") + + _, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("userWithKeys"), + }) + require.NoError(t, err) + + _, err = svc.DeleteUser(testAccountID, &iam.DeleteUserInput{ + UserName: aws.String("userWithKeys"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMDeleteConflict) +} + +func TestDeleteUser_WithAttachedPolicies(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "policyuser") + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("TestPolicy"), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}`), + }) + require.NoError(t, err) + + policyARN := "arn:aws:iam::" + testAccountID + ":policy/TestPolicy" + _, err = svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("policyuser"), + PolicyArn: aws.String(policyARN), + }) + require.NoError(t, err) + + _, err = svc.DeleteUser(testAccountID, &iam.DeleteUserInput{ + UserName: aws.String("policyuser"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMDeleteConflict) +} + +// ============================================================================ +// Input Validation Tests +// ============================================================================ + +func TestCreateUser_InvalidName_TooLong(t *testing.T) { + svc := setupTestIAMService(t) + longName := strings.Repeat("a", 65) + + _, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String(longName), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMInvalidInput) +} + +func TestCreateUser_InvalidName_BadChars(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("user name!"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMInvalidInput) +} + +func TestCreateUser_InvalidPath(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreateUser(testAccountID, &iam.CreateUserInput{ + UserName: aws.String("validuser"), + Path: aws.String("no-leading-slash/"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMInvalidInput) +} + +func TestCreatePolicy_InvalidName(t *testing.T) { + svc := setupTestIAMService(t) + longName := strings.Repeat("a", 129) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String(longName), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMInvalidInput) +} + +func TestCreatePolicy_InvalidPath(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("ValidPolicy"), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}`), + Path: aws.String("bad-path"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMInvalidInput) +} + +func TestValidatePolicyDocument_TooLarge(t *testing.T) { + largeDoc := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"` + strings.Repeat("a", maxPolicyDocumentSize) + `"}]}` + _, err := ValidatePolicyDocument(largeDoc) + assert.Error(t, err) + assert.Contains(t, err.Error(), "exceeds maximum size") +} + +// ============================================================================ +// Access Key Tests +// ============================================================================ + +func TestCreateAccessKey(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "keyuser") + + out, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("keyuser"), + }) + require.NoError(t, err) + require.NotNil(t, out.AccessKey) + + assert.Equal(t, "keyuser", *out.AccessKey.UserName) + assert.Equal(t, "Active", *out.AccessKey.Status) + assert.True(t, len(*out.AccessKey.AccessKeyId) >= 20) + assert.Equal(t, "AKIA", (*out.AccessKey.AccessKeyId)[:4]) + assert.True(t, len(*out.AccessKey.SecretAccessKey) >= 30) +} + +func TestCreateAccessKey_SecretIsDecryptable(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "decryptuser") + + out, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("decryptuser"), + }) + require.NoError(t, err) + + plaintextSecret := *out.AccessKey.SecretAccessKey + accessKeyID := *out.AccessKey.AccessKeyId + + // Look up the stored key and verify the encrypted secret can be decrypted + ak, err := svc.LookupAccessKey(accessKeyID) + require.NoError(t, err) + + decrypted, err := DecryptSecret(ak.SecretAccessKey, svc.masterKey) + require.NoError(t, err) + assert.Equal(t, plaintextSecret, decrypted) +} + +func TestCreateAccessKey_UserNotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("nonexistent"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestCreateAccessKey_MaxLimit(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "limituser") + + _, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("limituser"), + }) + require.NoError(t, err) + + _, err = svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("limituser"), + }) + require.NoError(t, err) + + // Third key should fail (AWS limit is 2) + _, err = svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("limituser"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMLimitExceeded) +} + +func TestListAccessKeys(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "listkeysuser") + + key1, _ := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("listkeysuser"), + }) + key2, _ := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("listkeysuser"), + }) + + out, err := svc.ListAccessKeys(testAccountID, &iam.ListAccessKeysInput{ + UserName: aws.String("listkeysuser"), + }) + require.NoError(t, err) + assert.Len(t, out.AccessKeyMetadata, 2) + + keyIDs := make(map[string]bool) + for _, k := range out.AccessKeyMetadata { + keyIDs[*k.AccessKeyId] = true + } + assert.True(t, keyIDs[*key1.AccessKey.AccessKeyId]) + assert.True(t, keyIDs[*key2.AccessKey.AccessKeyId]) +} + +func TestDeleteAccessKey(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "delkeyuser") + + keyOut, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("delkeyuser"), + }) + require.NoError(t, err) + keyID := *keyOut.AccessKey.AccessKeyId + + _, err = svc.DeleteAccessKey(testAccountID, &iam.DeleteAccessKeyInput{ + UserName: aws.String("delkeyuser"), + AccessKeyId: aws.String(keyID), + }) + require.NoError(t, err) + + listOut, err := svc.ListAccessKeys(testAccountID, &iam.ListAccessKeysInput{ + UserName: aws.String("delkeyuser"), + }) + require.NoError(t, err) + assert.Len(t, listOut.AccessKeyMetadata, 0) + + // User should now be deletable (no access keys) + _, err = svc.DeleteUser(testAccountID, &iam.DeleteUserInput{ + UserName: aws.String("delkeyuser"), + }) + require.NoError(t, err) +} + +func TestDeleteAccessKey_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "delnotfounduser") + + _, err := svc.DeleteAccessKey(testAccountID, &iam.DeleteAccessKeyInput{ + UserName: aws.String("delnotfounduser"), + AccessKeyId: aws.String("AKIANONEXISTENT12345"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestUpdateAccessKey(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "updatekeyuser") + + keyOut, _ := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("updatekeyuser"), + }) + keyID := *keyOut.AccessKey.AccessKeyId + + // Deactivate + _, err := svc.UpdateAccessKey(testAccountID, &iam.UpdateAccessKeyInput{ + AccessKeyId: aws.String(keyID), + Status: aws.String("Inactive"), + }) + require.NoError(t, err) + + // Verify status changed + listOut, _ := svc.ListAccessKeys(testAccountID, &iam.ListAccessKeysInput{ + UserName: aws.String("updatekeyuser"), + }) + assert.Equal(t, "Inactive", *listOut.AccessKeyMetadata[0].Status) + + // Reactivate + _, err = svc.UpdateAccessKey(testAccountID, &iam.UpdateAccessKeyInput{ + AccessKeyId: aws.String(keyID), + Status: aws.String("Active"), + }) + require.NoError(t, err) + + listOut, _ = svc.ListAccessKeys(testAccountID, &iam.ListAccessKeysInput{ + UserName: aws.String("updatekeyuser"), + }) + assert.Equal(t, "Active", *listOut.AccessKeyMetadata[0].Status) +} + +func TestUpdateAccessKey_InvalidStatus(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "invalidstatususer") + + keyOut, _ := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("invalidstatususer"), + }) + + _, err := svc.UpdateAccessKey(testAccountID, &iam.UpdateAccessKeyInput{ + AccessKeyId: keyOut.AccessKey.AccessKeyId, + Status: aws.String("Invalid"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMInvalidInput) +} + +func TestUpdateAccessKey_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.UpdateAccessKey(testAccountID, &iam.UpdateAccessKeyInput{ + AccessKeyId: aws.String("AKIANONEXISTENT12345"), + Status: aws.String("Inactive"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +// ============================================================================ +// Auth Tests (LookupAccessKey) +// ============================================================================ + +func TestLookupAccessKey(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "lookupuser") + + keyOut, err := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("lookupuser"), + }) + require.NoError(t, err) + + ak, err := svc.LookupAccessKey(*keyOut.AccessKey.AccessKeyId) + require.NoError(t, err) + assert.Equal(t, "lookupuser", ak.UserName) + assert.Equal(t, "Active", ak.Status) + assert.NotEmpty(t, ak.SecretAccessKey) // encrypted secret +} + +func TestLookupAccessKey_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.LookupAccessKey("AKIANONEXISTENT12345") + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestLookupAccessKey_InactiveKey(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "inactiveuser") + + keyOut, _ := svc.CreateAccessKey(testAccountID, &iam.CreateAccessKeyInput{ + UserName: aws.String("inactiveuser"), + }) + keyID := *keyOut.AccessKey.AccessKeyId + + svc.UpdateAccessKey(testAccountID, &iam.UpdateAccessKeyInput{ + AccessKeyId: aws.String(keyID), + Status: aws.String("Inactive"), + }) + + // LookupAccessKey should still return the key — status check is the caller's job + ak, err := svc.LookupAccessKey(keyID) + require.NoError(t, err) + assert.Equal(t, "Inactive", ak.Status) +} + +// ============================================================================ +// SeedRootUser Tests +// ============================================================================ + +func TestSeedRootUser(t *testing.T) { + svc := setupTestIAMService(t) + + encryptedSecret, err := EncryptSecret("test-secret-key", svc.masterKey) + require.NoError(t, err) + + err = svc.SeedRootUser(&BootstrapData{ + AccessKeyID: "AKIAEXAMPLE123456789", + EncryptedSecret: encryptedSecret, + AccountID: GlobalAccountID, + }) + require.NoError(t, err) + + // Verify root user exists at account-scoped key + out, err := svc.GetUser(GlobalAccountID, &iam.GetUserInput{ + UserName: aws.String("root"), + }) + require.NoError(t, err) + assert.Equal(t, "root", *out.User.UserName) + assert.Contains(t, *out.User.Arn, GlobalAccountID) + assert.Contains(t, *out.User.Arn, "root") + + // Verify access key exists with AccountID + ak, err := svc.LookupAccessKey("AKIAEXAMPLE123456789") + require.NoError(t, err) + assert.Equal(t, "root", ak.UserName) + assert.Equal(t, GlobalAccountID, ak.AccountID) + assert.Equal(t, "Active", ak.Status) + + // Verify secret is decryptable + decrypted, err := DecryptSecret(ak.SecretAccessKey, svc.masterKey) + require.NoError(t, err) + assert.Equal(t, "test-secret-key", decrypted) + + // Verify global account record was created + account, err := svc.GetAccount(GlobalAccountID) + require.NoError(t, err) + assert.Equal(t, GlobalAccountID, account.AccountID) + assert.Equal(t, "Global", account.AccountName) + assert.Equal(t, "ACTIVE", account.Status) +} + +func TestSeedRootUser_Idempotent(t *testing.T) { + svc := setupTestIAMService(t) + + encryptedSecret, _ := EncryptSecret("test-secret", svc.masterKey) + data := &BootstrapData{ + AccessKeyID: "AKIAEXAMPLE123456789", + EncryptedSecret: encryptedSecret, + AccountID: GlobalAccountID, + } + + // First call seeds + err := svc.SeedRootUser(data) + require.NoError(t, err) + + // Second call should succeed (no-op, idempotent) + err = svc.SeedRootUser(data) + require.NoError(t, err) + + // Root user should still exist with original data + out, err := svc.GetUser(GlobalAccountID, &iam.GetUserInput{ + UserName: aws.String("root"), + }) + require.NoError(t, err) + assert.Equal(t, "root", *out.User.UserName) +} + +// ============================================================================ +// IsEmpty Tests +// ============================================================================ + +func TestIsEmpty_True(t *testing.T) { + svc := setupTestIAMService(t) + + empty, err := svc.IsEmpty() + require.NoError(t, err) + assert.True(t, empty) +} + +func TestIsEmpty_False(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "notempty") + + empty, err := svc.IsEmpty() + require.NoError(t, err) + assert.False(t, empty) +} + +// ============================================================================ +// Helper Function Tests +// ============================================================================ + +func TestGenerateIAMID(t *testing.T) { + id := generateIAMID("AIDA") + assert.Equal(t, "AIDA", id[:4]) + assert.True(t, len(id) == 21) // AIDA + 17 hex chars + + // Two IDs should differ + id2 := generateIAMID("AIDA") + assert.NotEqual(t, id, id2) + + // Policy ID prefix + pid := generateIAMID("ANPA") + assert.Equal(t, "ANPA", pid[:4]) + assert.Len(t, pid, 21) +} + +func TestGenerateAccessKeyID(t *testing.T) { + id := generateAccessKeyID() + assert.Equal(t, "AKIA", id[:4]) + assert.True(t, len(id) == 24) // AKIA + 20 hex chars + + id2 := generateAccessKeyID() + assert.NotEqual(t, id, id2) +} + +func TestGenerateSecretAccessKey(t *testing.T) { + secret := admin.GenerateAWSSecretKey() + assert.Len(t, secret, 40) + + secret2 := admin.GenerateAWSSecretKey() + assert.NotEqual(t, secret, secret2) +} + +// ============================================================================ +// Policy CRUD Tests +// ============================================================================ + +// validPolicyDocument returns a valid IAM policy document JSON string. +func validPolicyDocument() string { + return `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ec2:DescribeInstances","Resource":"*"}]}` +} + +func createTestPolicy(t *testing.T, svc *IAMServiceImpl, name string) *iam.Policy { + t.Helper() + out, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String(name), + PolicyDocument: aws.String(validPolicyDocument()), + }) + require.NoError(t, err) + return out.Policy +} + +func TestCreatePolicy(t *testing.T) { + svc := setupTestIAMService(t) + + out, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("AllowEC2"), + PolicyDocument: aws.String(validPolicyDocument()), + Path: aws.String("/devteam/"), + Description: aws.String("Allow EC2 describe"), + }) + require.NoError(t, err) + require.NotNil(t, out.Policy) + assert.Equal(t, "AllowEC2", *out.Policy.PolicyName) + assert.Equal(t, "/devteam/", *out.Policy.Path) + assert.Equal(t, "Allow EC2 describe", *out.Policy.Description) + assert.Equal(t, "v1", *out.Policy.DefaultVersionId) + assert.Contains(t, *out.Policy.Arn, "policy/devteam/AllowEC2") + assert.True(t, len(*out.Policy.PolicyId) > 4) + assert.Equal(t, "ANPA", (*out.Policy.PolicyId)[:4]) + assert.Equal(t, int64(0), *out.Policy.AttachmentCount) + assert.True(t, *out.Policy.IsAttachable) +} + +func TestCreatePolicy_DefaultPath(t *testing.T) { + svc := setupTestIAMService(t) + + out, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("DefaultPath"), + PolicyDocument: aws.String(validPolicyDocument()), + }) + require.NoError(t, err) + assert.Equal(t, "/", *out.Policy.Path) + assert.Contains(t, *out.Policy.Arn, "policy/DefaultPath") +} + +func TestCreatePolicy_InvalidJSON(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("BadJSON"), + PolicyDocument: aws.String(`{not valid json`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMMalformedPolicyDocument) +} + +func TestCreatePolicy_InvalidVersion(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("BadVersion"), + PolicyDocument: aws.String(`{"Version":"2008-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMMalformedPolicyDocument) +} + +func TestCreatePolicy_NoStatements(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("NoStmts"), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[]}`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMMalformedPolicyDocument) +} + +func TestCreatePolicy_InvalidEffect(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("BadEffect"), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[{"Effect":"Maybe","Action":"*","Resource":"*"}]}`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMMalformedPolicyDocument) +} + +func TestCreatePolicy_MissingAction(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("NoAction"), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Resource":"*"}]}`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMMalformedPolicyDocument) +} + +func TestCreatePolicy_MissingResource(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("NoResource"), + PolicyDocument: aws.String(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*"}]}`), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMMalformedPolicyDocument) +} + +func TestCreatePolicy_Duplicate(t *testing.T) { + svc := setupTestIAMService(t) + + createTestPolicy(t, svc, "DupPolicy") + + _, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("DupPolicy"), + PolicyDocument: aws.String(validPolicyDocument()), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMEntityAlreadyExists) +} + +func TestCreatePolicy_ArrayActions(t *testing.T) { + svc := setupTestIAMService(t) + + doc := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["ec2:DescribeInstances","ec2:RunInstances"],"Resource":"*"}]}` + out, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("ArrayActions"), + PolicyDocument: aws.String(doc), + }) + require.NoError(t, err) + assert.Equal(t, "ArrayActions", *out.Policy.PolicyName) +} + +func TestGetPolicy(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "GetMe") + + out, err := svc.GetPolicy(testAccountID, &iam.GetPolicyInput{ + PolicyArn: created.Arn, + }) + require.NoError(t, err) + assert.Equal(t, "GetMe", *out.Policy.PolicyName) + assert.Equal(t, *created.PolicyId, *out.Policy.PolicyId) + assert.Equal(t, *created.Arn, *out.Policy.Arn) + assert.Equal(t, "v1", *out.Policy.DefaultVersionId) + assert.Equal(t, int64(0), *out.Policy.AttachmentCount) +} + +func TestGetPolicy_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.GetPolicy(testAccountID, &iam.GetPolicyInput{ + PolicyArn: aws.String("arn:aws:iam::000000000000:policy/Nonexistent"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestGetPolicy_MalformedARN(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.GetPolicy(testAccountID, &iam.GetPolicyInput{ + PolicyArn: aws.String("not-an-arn"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestGetPolicy_WithAttachments(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "AttachedPolicy") + createTestUser(t, svc, "attachuser1") + createTestUser(t, svc, "attachuser2") + + svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("attachuser1"), + PolicyArn: created.Arn, + }) + svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("attachuser2"), + PolicyArn: created.Arn, + }) + + out, err := svc.GetPolicy(testAccountID, &iam.GetPolicyInput{ + PolicyArn: created.Arn, + }) + require.NoError(t, err) + assert.Equal(t, int64(2), *out.Policy.AttachmentCount) +} + +func TestGetPolicyVersion(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "VersionPolicy") + + out, err := svc.GetPolicyVersion(testAccountID, &iam.GetPolicyVersionInput{ + PolicyArn: created.Arn, + VersionId: aws.String("v1"), + }) + require.NoError(t, err) + assert.Equal(t, "v1", *out.PolicyVersion.VersionId) + assert.True(t, *out.PolicyVersion.IsDefaultVersion) + assert.NotEmpty(t, *out.PolicyVersion.Document) + + // Verify the returned document is valid JSON + doc, err := ValidatePolicyDocument(*out.PolicyVersion.Document) + require.NoError(t, err) + assert.Equal(t, "2012-10-17", doc.Version) + assert.Len(t, doc.Statement, 1) +} + +func TestGetPolicyVersion_InvalidVersion(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "VersionPolicy2") + + _, err := svc.GetPolicyVersion(testAccountID, &iam.GetPolicyVersionInput{ + PolicyArn: created.Arn, + VersionId: aws.String("v2"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestGetPolicyVersion_PolicyNotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.GetPolicyVersion(testAccountID, &iam.GetPolicyVersionInput{ + PolicyArn: aws.String("arn:aws:iam::000000000000:policy/Ghost"), + VersionId: aws.String("v1"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestListPolicies(t *testing.T) { + svc := setupTestIAMService(t) + + createTestPolicy(t, svc, "Policy1") + createTestPolicy(t, svc, "Policy2") + createTestPolicy(t, svc, "Policy3") + + out, err := svc.ListPolicies(testAccountID, &iam.ListPoliciesInput{}) + require.NoError(t, err) + assert.Len(t, out.Policies, 3) + + names := make(map[string]bool) + for _, p := range out.Policies { + names[*p.PolicyName] = true + } + assert.True(t, names["Policy1"]) + assert.True(t, names["Policy2"]) + assert.True(t, names["Policy3"]) +} + +func TestListPolicies_Empty(t *testing.T) { + svc := setupTestIAMService(t) + + out, err := svc.ListPolicies(testAccountID, &iam.ListPoliciesInput{}) + require.NoError(t, err) + assert.Len(t, out.Policies, 0) +} + +func TestDeletePolicy(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "DeleteMe") + + _, err := svc.DeletePolicy(testAccountID, &iam.DeletePolicyInput{ + PolicyArn: created.Arn, + }) + require.NoError(t, err) + + // Confirm it's gone + _, err = svc.GetPolicy(testAccountID, &iam.GetPolicyInput{ + PolicyArn: created.Arn, + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestDeletePolicy_NotFound(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.DeletePolicy(testAccountID, &iam.DeletePolicyInput{ + PolicyArn: aws.String("arn:aws:iam::000000000000:policy/Ghost"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestDeletePolicy_AttachedConflict(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "Attached") + createTestUser(t, svc, "conflictuser") + + _, err := svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("conflictuser"), + PolicyArn: created.Arn, + }) + require.NoError(t, err) + + _, err = svc.DeletePolicy(testAccountID, &iam.DeletePolicyInput{ + PolicyArn: created.Arn, + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMDeleteConflict) + + // Detach, then delete should succeed + _, err = svc.DetachUserPolicy(testAccountID, &iam.DetachUserPolicyInput{ + UserName: aws.String("conflictuser"), + PolicyArn: created.Arn, + }) + require.NoError(t, err) + + _, err = svc.DeletePolicy(testAccountID, &iam.DeletePolicyInput{ + PolicyArn: created.Arn, + }) + require.NoError(t, err) +} + +// ============================================================================ +// Policy Attachment Tests +// ============================================================================ + +func TestAttachUserPolicy(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "AttachPolicy") + createTestUser(t, svc, "attachme") + + _, err := svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("attachme"), + PolicyArn: created.Arn, + }) + require.NoError(t, err) + + // Verify via list + out, err := svc.ListAttachedUserPolicies(testAccountID, &iam.ListAttachedUserPoliciesInput{ + UserName: aws.String("attachme"), + }) + require.NoError(t, err) + require.Len(t, out.AttachedPolicies, 1) + assert.Equal(t, "AttachPolicy", *out.AttachedPolicies[0].PolicyName) + assert.Equal(t, *created.Arn, *out.AttachedPolicies[0].PolicyArn) +} + +func TestAttachUserPolicy_Idempotent(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "IdempotentPolicy") + createTestUser(t, svc, "idempotentuser") + + input := &iam.AttachUserPolicyInput{ + UserName: aws.String("idempotentuser"), + PolicyArn: created.Arn, + } + + _, err := svc.AttachUserPolicy(testAccountID, input) + require.NoError(t, err) + + // Attach same policy again — should succeed silently + _, err = svc.AttachUserPolicy(testAccountID, input) + require.NoError(t, err) + + // Should still have exactly 1 attachment + out, err := svc.ListAttachedUserPolicies(testAccountID, &iam.ListAttachedUserPoliciesInput{ + UserName: aws.String("idempotentuser"), + }) + require.NoError(t, err) + assert.Len(t, out.AttachedPolicies, 1) +} + +func TestAttachUserPolicy_NonexistentPolicy(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "orphanuser") + + _, err := svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("orphanuser"), + PolicyArn: aws.String("arn:aws:iam::000000000000:policy/Ghost"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestAttachUserPolicy_NonexistentUser(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "OrphanPolicy") + + _, err := svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("ghostuser"), + PolicyArn: created.Arn, + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestDetachUserPolicy(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "DetachPolicy") + createTestUser(t, svc, "detachme") + + _, err := svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("detachme"), + PolicyArn: created.Arn, + }) + require.NoError(t, err) + + _, err = svc.DetachUserPolicy(testAccountID, &iam.DetachUserPolicyInput{ + UserName: aws.String("detachme"), + PolicyArn: created.Arn, + }) + require.NoError(t, err) + + // Verify detached + out, err := svc.ListAttachedUserPolicies(testAccountID, &iam.ListAttachedUserPoliciesInput{ + UserName: aws.String("detachme"), + }) + require.NoError(t, err) + assert.Len(t, out.AttachedPolicies, 0) +} + +func TestDetachUserPolicy_NotAttached(t *testing.T) { + svc := setupTestIAMService(t) + created := createTestPolicy(t, svc, "NeverAttached") + createTestUser(t, svc, "cleanuser") + + _, err := svc.DetachUserPolicy(testAccountID, &iam.DetachUserPolicyInput{ + UserName: aws.String("cleanuser"), + PolicyArn: created.Arn, + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestDetachUserPolicy_NonexistentUser(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.DetachUserPolicy(testAccountID, &iam.DetachUserPolicyInput{ + UserName: aws.String("ghostuser"), + PolicyArn: aws.String("arn:aws:iam::000000000000:policy/Whatever"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +func TestListAttachedUserPolicies(t *testing.T) { + svc := setupTestIAMService(t) + + p1 := createTestPolicy(t, svc, "ListPolicy1") + p2 := createTestPolicy(t, svc, "ListPolicy2") + createTestUser(t, svc, "listpuser") + + svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("listpuser"), + PolicyArn: p1.Arn, + }) + svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("listpuser"), + PolicyArn: p2.Arn, + }) + + out, err := svc.ListAttachedUserPolicies(testAccountID, &iam.ListAttachedUserPoliciesInput{ + UserName: aws.String("listpuser"), + }) + require.NoError(t, err) + assert.Len(t, out.AttachedPolicies, 2) + + names := make(map[string]bool) + for _, p := range out.AttachedPolicies { + names[*p.PolicyName] = true + } + assert.True(t, names["ListPolicy1"]) + assert.True(t, names["ListPolicy2"]) +} + +func TestListAttachedUserPolicies_Empty(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "nopolicies") + + out, err := svc.ListAttachedUserPolicies(testAccountID, &iam.ListAttachedUserPoliciesInput{ + UserName: aws.String("nopolicies"), + }) + require.NoError(t, err) + assert.Len(t, out.AttachedPolicies, 0) +} + +func TestListAttachedUserPolicies_NonexistentUser(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.ListAttachedUserPolicies(testAccountID, &iam.ListAttachedUserPoliciesInput{ + UserName: aws.String("ghostuser"), + }) + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +// ============================================================================ +// GetUserPolicies (internal) Tests +// ============================================================================ + +func TestGetUserPolicies(t *testing.T) { + svc := setupTestIAMService(t) + + doc := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ec2:DescribeInstances","Resource":"*"}]}` + p1, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("InternalPolicy1"), + PolicyDocument: aws.String(doc), + }) + require.NoError(t, err) + + doc2 := `{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Action":"ec2:TerminateInstances","Resource":"*"}]}` + p2, err := svc.CreatePolicy(testAccountID, &iam.CreatePolicyInput{ + PolicyName: aws.String("InternalPolicy2"), + PolicyDocument: aws.String(doc2), + }) + require.NoError(t, err) + + createTestUser(t, svc, "evaluser") + + svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("evaluser"), + PolicyArn: p1.Policy.Arn, + }) + svc.AttachUserPolicy(testAccountID, &iam.AttachUserPolicyInput{ + UserName: aws.String("evaluser"), + PolicyArn: p2.Policy.Arn, + }) + + docs, err := svc.GetUserPolicies(testAccountID, "evaluser") + require.NoError(t, err) + assert.Len(t, docs, 2) + assert.Equal(t, "2012-10-17", docs[0].Version) + assert.Equal(t, "2012-10-17", docs[1].Version) +} + +func TestGetUserPolicies_NoPolicies(t *testing.T) { + svc := setupTestIAMService(t) + createTestUser(t, svc, "emptyuser") + + docs, err := svc.GetUserPolicies(testAccountID, "emptyuser") + require.NoError(t, err) + assert.Len(t, docs, 0) +} + +func TestGetUserPolicies_NonexistentUser(t *testing.T) { + svc := setupTestIAMService(t) + + _, err := svc.GetUserPolicies(testAccountID, "ghostuser") + assert.Error(t, err) + assert.Contains(t, err.Error(), awserrors.ErrorIAMNoSuchEntity) +} + +// ============================================================================ +// ValidatePolicyDocument Tests +// ============================================================================ + +func TestValidatePolicyDocument_Valid(t *testing.T) { + doc, err := ValidatePolicyDocument(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}`) + require.NoError(t, err) + assert.Equal(t, "2012-10-17", doc.Version) + assert.Len(t, doc.Statement, 1) + assert.Equal(t, "Allow", doc.Statement[0].Effect) +} + +func TestValidatePolicyDocument_MultipleStatements(t *testing.T) { + doc, err := ValidatePolicyDocument(`{ + "Version":"2012-10-17", + "Statement":[ + {"Sid":"AllowEC2","Effect":"Allow","Action":["ec2:DescribeInstances","ec2:RunInstances"],"Resource":"*"}, + {"Effect":"Deny","Action":"ec2:TerminateInstances","Resource":"*"} + ] + }`) + require.NoError(t, err) + assert.Len(t, doc.Statement, 2) + assert.Equal(t, "AllowEC2", doc.Statement[0].Sid) + assert.Len(t, doc.Statement[0].Action, 2) +} + +func TestValidatePolicyDocument_BadJSON(t *testing.T) { + _, err := ValidatePolicyDocument(`{broken`) + assert.Error(t, err) +} + +func TestValidatePolicyDocument_WrongVersion(t *testing.T) { + _, err := ValidatePolicyDocument(`{"Version":"2008-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}`) + assert.Error(t, err) + assert.Contains(t, err.Error(), "unsupported policy version") +} + +func TestValidatePolicyDocument_EmptyStatements(t *testing.T) { + _, err := ValidatePolicyDocument(`{"Version":"2012-10-17","Statement":[]}`) + assert.Error(t, err) + assert.Contains(t, err.Error(), "at least one statement") +} + +func TestValidatePolicyDocument_BadEffect(t *testing.T) { + _, err := ValidatePolicyDocument(`{"Version":"2012-10-17","Statement":[{"Effect":"Maybe","Action":"*","Resource":"*"}]}`) + assert.Error(t, err) + assert.Contains(t, err.Error(), "Effect must be Allow or Deny") +} + +func TestValidatePolicyDocument_MissingAction(t *testing.T) { + _, err := ValidatePolicyDocument(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Resource":"*"}]}`) + assert.Error(t, err) + assert.Contains(t, err.Error(), "Action is required") +} + +func TestValidatePolicyDocument_MissingResource(t *testing.T) { + _, err := ValidatePolicyDocument(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*"}]}`) + assert.Error(t, err) + assert.Contains(t, err.Error(), "Resource is required") +} + +// ============================================================================ +// Helper Function Tests (Policy) +// ============================================================================ + +func TestGeneratePolicyID(t *testing.T) { + id := generateIAMID("ANPA") + assert.Equal(t, "ANPA", id[:4]) + assert.Len(t, id, 21) // ANPA + 17 hex chars + + id2 := generateIAMID("ANPA") + assert.NotEqual(t, id, id2) +} diff --git a/hive/handlers/iam/types.go b/hive/handlers/iam/types.go new file mode 100644 index 000000000..75c3f22a1 --- /dev/null +++ b/hive/handlers/iam/types.go @@ -0,0 +1,118 @@ +package handlers_iam + +import "encoding/json" + +const ( + AccessKeyStatusActive = "Active" + AccessKeyStatusInactive = "Inactive" + + AccountStatusActive = "ACTIVE" + AccountStatusSuspended = "SUSPENDED" + + PolicyEffectAllow = "Allow" + PolicyEffectDeny = "Deny" +) + +// User represents an IAM user stored in JetStream KV. +type User struct { + UserName string `json:"user_name"` + UserID string `json:"user_id"` + AccountID string `json:"account_id"` + ARN string `json:"arn"` + Path string `json:"path"` + CreatedAt string `json:"created_at"` + AccessKeys []string `json:"access_keys"` + Tags []Tag `json:"tags"` + AttachedPolicies []string `json:"attached_policies"` // policy ARNs +} + +// AccessKey represents an IAM access key stored in JetStream KV. +// SecretAccessKey is AES-256-GCM encrypted (base64-encoded), not hashed, +// so the SigV4 middleware can recover the plaintext for signature verification. +type AccessKey struct { + AccessKeyID string `json:"access_key_id"` + SecretAccessKey string `json:"secret_access_key"` // AES-256-GCM encrypted, base64-encoded + UserName string `json:"user_name"` + AccountID string `json:"account_id"` + Status string `json:"status"` // Active or Inactive + CreatedAt string `json:"created_at"` +} + +// Tag represents a key-value tag on an IAM resource. +type Tag struct { + Key string `json:"key"` + Value string `json:"value"` +} + +// Policy represents a managed IAM policy stored in JetStream KV. +type Policy struct { + PolicyName string `json:"policy_name"` + PolicyID string `json:"policy_id"` + ARN string `json:"arn"` + Path string `json:"path"` + Description string `json:"description,omitempty"` + PolicyDocument string `json:"policy_document"` // JSON string + CreatedAt string `json:"created_at"` + DefaultVersion string `json:"default_version"` // always "v1" + Tags []Tag `json:"tags"` +} + +// PolicyDocument is the parsed IAM policy JSON structure. +type PolicyDocument struct { + Version string `json:"Version"` + Statement []Statement `json:"Statement"` +} + +// Statement is a single statement within a policy document. +type Statement struct { + Sid string `json:"Sid,omitempty"` + Effect string `json:"Effect"` + Action StringOrArr `json:"Action"` + Resource StringOrArr `json:"Resource"` +} + +// StringOrArr handles JSON fields that can be either a string or an array of strings. +type StringOrArr []string + +// UnmarshalJSON implements custom unmarshaling for string-or-array fields. +func (s *StringOrArr) UnmarshalJSON(data []byte) error { + // Try string first + var single string + if err := json.Unmarshal(data, &single); err == nil { + *s = []string{single} + return nil + } + + // Try array + var arr []string + if err := json.Unmarshal(data, &arr); err != nil { + return err + } + *s = arr + return nil +} + +// MarshalJSON marshals as a string if single element, otherwise as an array. +func (s StringOrArr) MarshalJSON() ([]byte, error) { + if len(s) == 1 { + return json.Marshal(s[0]) + } + return json.Marshal([]string(s)) +} + +// BootstrapData is the on-disk JSON file consumed on first gateway start +// to seed the root IAM user into NATS KV. +type BootstrapData struct { + AccessKeyID string `json:"access_key_id"` + EncryptedSecret string `json:"encrypted_secret"` + AccountID string `json:"account_id"` +} + +// Account represents a Hive account. Accounts namespace IAM users, +// policies, and resources. Created via CLI only in v1. +type Account struct { + AccountID string `json:"account_id"` // 12-digit zero-padded, sequential + AccountName string `json:"account_name"` // Friendly name + Status string `json:"status"` // "ACTIVE" or "SUSPENDED" + CreatedAt string `json:"created_at"` // RFC3339 +} diff --git a/hive/services/awsgw/awsgw.go b/hive/services/awsgw/awsgw.go index 26a99f239..863b8c070 100644 --- a/hive/services/awsgw/awsgw.go +++ b/hive/services/awsgw/awsgw.go @@ -4,11 +4,15 @@ import ( "fmt" "log/slog" "os" + "path/filepath" "strings" + "time" "github.com/mulgadc/hive/hive/config" "github.com/mulgadc/hive/hive/gateway" + handlers_iam "github.com/mulgadc/hive/hive/handlers/iam" "github.com/mulgadc/hive/hive/utils" + "github.com/nats-io/nats.go" ) var serviceName = "awsgw" @@ -52,14 +56,14 @@ func (svc *Service) Reload() (err error) { return nil } -func launchService(config *config.ClusterConfig) (err error) { +func launchService(config *config.ClusterConfig) error { nodeConfig := config.Nodes[config.Node] - // Connect to NATS for service communication - natsConn, err := utils.ConnectNATS(nodeConfig.NATS.Host, nodeConfig.NATS.ACL.Token) + // Connect to NATS for service communication. On concurrent startup the + // local NATS server may not be listening yet, so retry with backoff. + natsConn, err := connectNATS(nodeConfig.NATS.Host, nodeConfig.NATS.ACL.Token) if err != nil { - slog.Error("Failed to connect to NATS", "err", err) return err } defer natsConn.Close() @@ -69,6 +73,34 @@ func launchService(config *config.ClusterConfig) (err error) { nodeConfig.AWSGW.Config = fmt.Sprintf("%s/%s", nodeConfig.BaseDir, nodeConfig.AWSGW.Config) } + // Load IAM master key from disk (required for all authenticated requests) + masterKeyPath := filepath.Join(nodeConfig.BaseDir, "config", "master.key") + masterKey, err := handlers_iam.LoadMasterKey(masterKeyPath) + if err != nil { + return fmt.Errorf("load IAM master key from %s: %w", masterKeyPath, err) + } + + // Initialize IAM service with NATS KV backend (required for auth). + // On multi-node clusters, JetStream KV requires cluster quorum which may + // not be available yet if nodes start concurrently. Retry with backoff. + iamService, err := initIAMService(natsConn, masterKey) + if err != nil { + return fmt.Errorf("initialize IAM service: %w", err) + } + + // First boot: consume bootstrap.json → seed root user into NATS KV → delete file + bootstrapPath := filepath.Join(nodeConfig.BaseDir, "config", "bootstrap.json") + if data, err := handlers_iam.LoadBootstrapData(bootstrapPath); err == nil { + slog.Info("Bootstrap file found, seeding root IAM user") + if err := iamService.SeedRootUser(data); err != nil { + return fmt.Errorf("seed root user from bootstrap.json: %w", err) + } + if err := os.Remove(bootstrapPath); err != nil { + slog.Warn("Failed to delete bootstrap file", "path", bootstrapPath, "err", err) + } + slog.Info("Bootstrap complete, bootstrap.json deleted") + } + // Create gateway with NATS connection gw := gateway.GatewayConfig{ Debug: nodeConfig.AWSGW.Debug, @@ -78,17 +110,11 @@ func launchService(config *config.ClusterConfig) (err error) { ExpectedNodes: len(config.Nodes), Region: nodeConfig.Region, AZ: nodeConfig.AZ, - AccessKey: nodeConfig.AccessKey, - SecretKey: nodeConfig.SecretKey, + IAMService: iamService, } app := gw.SetupRoutes() - if err != nil { - slog.Warn("Failed to setup gateway routes", "err", err) - return err - } - if err := app.ListenTLS(nodeConfig.AWSGW.Host, nodeConfig.AWSGW.TLSCert, nodeConfig.AWSGW.TLSKey); err != nil { slog.Error("Failed to start TLS listener", "err", err) os.Exit(1) @@ -97,3 +123,60 @@ func launchService(config *config.ClusterConfig) (err error) { return nil } + +// connectNATS establishes a connection to NATS with retry/backoff. On concurrent +// startup the local NATS server may not be listening yet. +func connectNATS(host, token string) (*nats.Conn, error) { + const maxWait = 5 * time.Minute + retryDelay := 500 * time.Millisecond + start := time.Now() + + for { + nc, err := utils.ConnectNATS(host, token) + if err == nil { + if time.Since(start) > time.Second { + slog.Info("NATS connection established", "elapsed", time.Since(start).Round(time.Second)) + } + return nc, nil + } + + elapsed := time.Since(start) + if elapsed >= maxWait { + return nil, fmt.Errorf("NATS connect failed after %s: %w", elapsed.Round(time.Second), err) + } + + slog.Warn("NATS not ready, retrying...", "error", err, "elapsed", elapsed.Round(time.Second), "retryIn", retryDelay) + time.Sleep(retryDelay) + retryDelay = min(retryDelay*2, 10*time.Second) + } +} + +// initIAMService initializes the IAM service with retry/backoff. On multi-node +// clusters, JetStream requires NATS cluster quorum before KV buckets can be +// created. This retries for up to 5 minutes to allow late-joining nodes. +func initIAMService(natsConn *nats.Conn, masterKey []byte) (*handlers_iam.IAMServiceImpl, error) { + const maxWait = 5 * time.Minute + retryDelay := 500 * time.Millisecond + start := time.Now() + attempt := 0 + + for { + attempt++ + svc, err := handlers_iam.NewIAMServiceImpl(natsConn, masterKey) + if err == nil { + if attempt > 1 { + slog.Info("IAM service initialized after retry", "attempts", attempt, "elapsed", time.Since(start).Round(time.Second)) + } + return svc, nil + } + + elapsed := time.Since(start) + if elapsed >= maxWait { + return nil, fmt.Errorf("IAM service unavailable after %s (%d attempts): %w", elapsed.Round(time.Second), attempt, err) + } + + slog.Warn("IAM service not ready (waiting for JetStream cluster quorum)", "error", err, "attempt", attempt, "elapsed", elapsed.Round(time.Second), "retryIn", retryDelay) + time.Sleep(retryDelay) + retryDelay = min(retryDelay*2, 10*time.Second) + } +} diff --git a/hive/services/hiveui/README.md b/hive/services/hiveui/README.md index f1c0e33a8..50d8adb90 100644 --- a/hive/services/hiveui/README.md +++ b/hive/services/hiveui/README.md @@ -41,12 +41,6 @@ Note: This is not needed for actually building hive-ui and running it. We commit 5. **Launch Server** - For production, build the static assets and launch the `go` webservice for serving traffic: - - ```sh - make run - ``` - For development use: ```sh diff --git a/hive/services/hiveui/frontend/dist/assets/index.js b/hive/services/hiveui/frontend/dist/assets/index.js index 56103854c..4579a2225 100644 --- a/hive/services/hiveui/frontend/dist/assets/index.js +++ b/hive/services/hiveui/frontend/dist/assets/index.js @@ -1,13 +1,13 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login.js","assets/zod.js","assets/field.js","assets/input.js","assets/index3.js","assets/useSuspenseQuery.js","assets/page-heading.js","assets/index4.js","assets/list-card.js","assets/create-bucket.js","assets/back-link.js","assets/error-banner.js","assets/s3.js","assets/create-vpc.js","assets/ec2.js","assets/ec22.js","assets/create-volume.js","assets/select.js","assets/check.js","assets/create-subnet.js","assets/create-snapshot.js","assets/textarea.js","assets/import-key-pair.js","assets/create-key-pair.js","assets/alert-dialog.js","assets/download.js","assets/run-instances.js","assets/index5.js","assets/upload-button.js","assets/trash-2.js","assets/index6.js","assets/state-badge.js","assets/index7.js","assets/index8.js","assets/index9.js","assets/index10.js","assets/index11.js","assets/index12.js","assets/_.js","assets/_id.js","assets/detail-row.js","assets/_id2.js","assets/_id3.js","assets/_id4.js","assets/_id5.js","assets/_id6.js","assets/_id7.js","assets/ami-details.js","assets/_id8.js"])))=>i.map(i=>d[i]); -function O$(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(i){if(i.ep)return;i.ep=!0;const c=n(i);fetch(i.href,c)}})();var _Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function O2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wRe(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var O0={exports:{}},ef={};var mC;function M$(){if(mC)return ef;mC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,c){var l=null;if(c!==void 0&&(l=""+c),i.key!==void 0&&(l=""+i.key),"key"in i){c={};for(var f in i)f!=="key"&&(c[f]=i[f])}else c=i;return i=c.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:c}}return ef.Fragment=t,ef.jsx=n,ef.jsxs=n,ef}var gC;function D$(){return gC||(gC=1,O0.exports=M$()),O0.exports}var N=D$(),pm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},k$={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},P$=class{#e=k$;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Kb=new P$;function N$(e){setTimeout(e,0)}var hm=typeof window>"u"||"Deno"in globalThis;function Nr(){}function L$(e,t){return typeof e=="function"?e(t):e}function z$(e){return typeof e=="number"&&e>=0&&e!==1/0}function B$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qb(e,t){return typeof e=="function"?e(t):e}function $$(e,t){return typeof e=="function"?e(t):e}function yC(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:c,queryKey:l,stale:f}=e;if(l){if(r){if(t.queryHash!==Lv(l,t.options))return!1}else if(!Mf(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||i&&i!==t.state.fetchStatus||c&&!c(t))}function bC(e,t){const{exact:n,status:r,predicate:i,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(n){if(Of(t.options.mutationKey)!==Of(c))return!1}else if(!Mf(t.options.mutationKey,c))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Lv(e,t){return(t?.queryKeyHashFn||Of)(e)}function Of(e){return JSON.stringify(e,(t,n)=>Yb(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Mf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mf(e[n],t[n])):!1}var U$=Object.prototype.hasOwnProperty;function M2(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=vC(e)&&vC(t);if(!r&&!(Yb(e)&&Yb(t)))return t;const c=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),f=l.length,d=r?new Array(f):{};let p=0;for(let b=0;b{Kb.setTimeout(t,e)})}function H$(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?M2(e,t):t}function V$(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function F$(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zv=Symbol();function D2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xRe(e,t){return typeof e=="function"?e(...t):!!e}function q$(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var G$=class extends pm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!hm&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},k2=new G$;function Z$(){let e,t;const n=new Promise((i,c)=>{e=i,t=c});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var K$=N$;function Q$(){let e=[],t=0,n=f=>{f()},r=f=>{f()},i=K$;const c=f=>{t?e.push(f):i(()=>{n(f)})},l=()=>{const f=e;e=[],f.length&&i(()=>{r(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||l()}return d},batchCalls:f=>(...d)=>{c(()=>{f(...d)})},schedule:c,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:f=>{i=f}}}var cs=Q$(),Y$=class extends pm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!hm&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Ch=new Y$;function X$(e){return Math.min(1e3*2**e,3e4)}function P2(e){return(e??"online")==="online"?Ch.isOnline():!0}var Xb=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function N2(e){let t=!1,n=0,r;const i=Z$(),c=()=>i.status!=="pending",l=E=>{if(!c()){const R=new Xb(E);v(R),e.onCancel?.(R)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>k2.isFocused()&&(e.networkMode==="always"||Ch.isOnline())&&e.canRun(),b=()=>P2(e.networkMode)&&e.canRun(),g=E=>{c()||(r?.(),i.resolve(E))},v=E=>{c()||(r?.(),i.reject(E))},S=()=>new Promise(E=>{r=R=>{(c()||p())&&E(R)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),w=()=>{if(c())return;let E;const R=n===0?e.initialPromise:void 0;try{E=R??e.fn()}catch(C){E=Promise.reject(C)}Promise.resolve(E).then(g).catch(C=>{if(c())return;const O=e.retry??(hm?0:3),k=e.retryDelay??X$,T=typeof k=="function"?k(n,C):k,$=O===!0||typeof O=="number"&&np()?void 0:S()).then(()=>{t?v(C):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:f,continueRetry:d,canStart:b,start:()=>(b()?w():S().then(w),i)}}var L2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),z$(this.gcTime)&&(this.#e=Kb.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Kb.clearTimeout(this.#e),this.#e=void 0)}},W$=class extends L2{#e;#n;#t;#r;#s;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#t=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wC(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=wC(this.options);t.data!==void 0&&(this.setState(_C(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=H$(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(Nr).catch(Nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>$$(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qb(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!B$(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,r=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const f=D2(this.options,t),p=(()=>{const b={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(b),b})();return this.#a=!1,this.options.persister?this.options.persister(f,p,this):f(p)},l=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(f),f})();this.options.behavior?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta}),this.#s=N2({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof Xb&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#t.config.onSuccess?.(f,this),this.#t.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof Xb){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#t.config.onError?.(f,this),this.#t.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...J$(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,..._C(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),cs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function J$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _C(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function EC(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const p=async()=>{let b=!1;const g=w=>{q$(w,()=>t.signal,()=>b=!0)},v=D2(t.options,t.fetchOptions),S=async(w,E,R)=>{if(b)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const O=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:E,direction:R?"backward":"forward",meta:t.options.meta};return g(j),j})(),k=await v(O),{maxPages:T}=t.options,$=R?F$:V$;return{pages:$(w.pages,k,T),pageParams:$(w.pageParams,E,T)}};if(i&&c.length){const w=i==="backward",E=w?e6:xC,R={pages:c,pageParams:l},C=E(r,R);f=await S(R,C,w)}else{const w=e??c.length;do{const E=d===0?l[0]??r.initialPageParam:xC(r,f);if(d>0&&E==null)break;f=await S(f,E),d++}while(dt.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=p}}}function xC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function e6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var t6=class extends L2{#e;#n;#t;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||n6(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=N2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(c,l)=>{this.#s({type:"failed",failureCount:c,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#s({type:"pending",variables:e,isPaused:i}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#s({type:"pending",context:l,variables:e,isPaused:i})}const c=await this.#r.start();return await this.#t.config.onSuccess?.(c,e,this.state.context,this,n),await this.options.onSuccess?.(c,e,this.state.context,n),await this.#t.config.onSettled?.(c,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(c,null,e,this.state.context,n),this.#s({type:"success",data:c}),c}catch(c){try{await this.#t.config.onError?.(c,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(c,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#t.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#s({type:"error",error:c}),c}finally{this.#t.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),cs.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function n6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s6=class extends pm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new t6({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Vp(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Vp(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Vp(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Vp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){cs.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>bC(t,n))}findAll(e={}){return this.getAll().filter(t=>bC(e,t))}notify(e){cs.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return cs.batch(()=>Promise.all(e.map(t=>t.continue().catch(Nr))))}};function Vp(e){return e.options.scope?.id}var r6=class extends pm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Lv(r,t);let c=this.get(i);return c||(c=new W$({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){cs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>yC(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>yC(e,n)):t}notify(e){cs.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o6=class{#e;#n;#t;#r;#s;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new r6,this.#n=e.mutationCache||new s6,this.#t=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=k2.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ch.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Qb(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(r.queryHash)?.state.data,l=L$(t,c);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return cs.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;cs.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return cs.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=cs.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nr).catch(Nr)}invalidateQueries(e,t={}){return cs.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=cs.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let c=i.fetch(void 0,n);return n.throwOnError||(c=c.catch(Nr)),i.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(r).then(Nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Qb(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nr).catch(Nr)}fetchInfiniteQuery(e){return e.behavior=EC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nr).catch(Nr)}ensureInfiniteQueryData(e){return e.behavior=EC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ch.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#r.set(Of(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Mf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(Of(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Mf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zv&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},M0={exports:{}},Ze={};var RC;function i6(){if(RC)return Ze;RC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function S(B){return B===null||typeof B!="object"?null:(B=v&&B[v]||B["@@iterator"],typeof B=="function"?B:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function C(B,ee,ge){this.props=B,this.context=ee,this.refs=R,this.updater=ge||w}C.prototype.isReactComponent={},C.prototype.setState=function(B,ee){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,ee,"setState")},C.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function O(){}O.prototype=C.prototype;function k(B,ee,ge){this.props=B,this.context=ee,this.refs=R,this.updater=ge||w}var T=k.prototype=new O;T.constructor=k,E(T,C.prototype),T.isPureReactComponent=!0;var $=Array.isArray;function j(){}var H={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function Y(B,ee,ge){var be=ge.ref;return{$$typeof:e,type:B,key:ee,ref:be!==void 0?be:null,props:ge}}function ne(B,ee){return Y(B.type,ee,B.props)}function re(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function G(B){var ee={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ge){return ee[ge]})}var te=/\/+/g;function ue(B,ee){return typeof B=="object"&&B!==null&&B.key!=null?G(""+B.key):ee.toString(36)}function ye(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(j,j):(B.status="pending",B.then(function(ee){B.status==="pending"&&(B.status="fulfilled",B.value=ee)},function(ee){B.status==="pending"&&(B.status="rejected",B.reason=ee)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function V(B,ee,ge,be,xe){var _e=typeof B;(_e==="undefined"||_e==="boolean")&&(B=null);var Te=!1;if(B===null)Te=!0;else switch(_e){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(B.$$typeof){case e:case t:Te=!0;break;case b:return Te=B._init,V(Te(B._payload),ee,ge,be,xe)}}if(Te)return xe=xe(B),Te=be===""?"."+ue(B,0):be,$(xe)?(ge="",Te!=null&&(ge=Te.replace(te,"$&/")+"/"),V(xe,ee,ge,"",function(Xe){return Xe})):xe!=null&&(re(xe)&&(xe=ne(xe,ge+(xe.key==null||B&&B.key===xe.key?"":(""+xe.key).replace(te,"$&/")+"/")+Te)),ee.push(xe)),1;Te=0;var Fe=be===""?".":be+":";if($(B))for(var Se=0;Se{const t=M.useContext(z2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},a6=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),N.jsx(z2.Provider,{value:e,children:t}));var Yt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Yt||{});function $2({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:c,checkDirty:l,shallowPropagate:f};function r(p,b,g){const v=b.depsTail;if(v!==void 0&&v.dep===p)return;const S=v!==void 0?v.nextDep:b.deps;if(S!==void 0&&S.dep===p){S.version=g,b.depsTail=S;return}const w=p.subsTail;if(w!==void 0&&w.version===g&&w.sub===b)return;const E=b.depsTail=p.subsTail={version:g,dep:p,sub:b,prevDep:v,nextDep:S,prevSub:w,nextSub:void 0};S!==void 0&&(S.prevDep=E),v!==void 0?v.nextDep=E:b.deps=E,w!==void 0?w.nextSub=E:p.subs=E}function i(p,b=p.sub){const g=p.dep,v=p.prevDep,S=p.nextDep,w=p.nextSub,E=p.prevSub;return S!==void 0?S.prevDep=v:b.depsTail=v,v!==void 0?v.nextDep=S:b.deps=S,w!==void 0?w.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=w:(g.subs=w)===void 0&&n(g),S}function c(p){let b=p.nextSub,g;e:do{const v=p.sub;let S=v.flags;if(S&60?S&12?S&4?!(S&48)&&d(p,v)?(v.flags=S|40,S&=1):S=0:v.flags=S&-9|32:S=0:v.flags=S|32,S&2&&t(v),S&1){const w=v.subs;if(w!==void 0){const E=(p=w).nextSub;E!==void 0&&(g={value:b,prev:g},b=E);continue}}if((p=b)!==void 0){b=p.nextSub;continue}for(;g!==void 0;)if(p=g.value,g=g.prev,p!==void 0){b=p.nextSub;continue e}break}while(!0)}function l(p,b){let g,v=0,S=!1;e:do{const w=p.dep,E=w.flags;if(b.flags&16)S=!0;else if((E&17)===17){if(e(w)){const R=w.subs;R.nextSub!==void 0&&f(R),S=!0}}else if((E&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(g={value:p,prev:g}),p=w.deps,b=w,++v;continue}if(!S){const R=p.nextDep;if(R!==void 0){p=R;continue}}for(;v--;){const R=b.subs,C=R.nextSub!==void 0;if(C?(p=g.value,g=g.prev):p=R,S){if(e(b)){C&&f(R),b=p.sub;continue}S=!1}else b.flags&=-33;b=p.sub;const O=p.nextDep;if(O!==void 0){p=O;continue e}}return S}while(!0)}function f(p){do{const b=p.sub,g=b.flags;(g&48)===32&&(b.flags=g|16,(g&6)===2&&t(b))}while((p=p.nextSub)!==void 0)}function d(p,b){let g=b.depsTail;for(;g!==void 0;){if(g===p)return!0;g=g.prevDep}return!1}}let $v=0,Va=0,vf=0;const Po=[],{link:RRe,unlink:U2,propagate:CRe,checkDirty:c6,shallowPropagate:ARe}=$2({update(e){return e.depsTail!==void 0?d6(e):p6(e)},notify(e){let t=vf,n=t;do if(Po[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(vf=t;n<--t;){const r=Po[n];Po[n++]=Po[t],Po[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,mm(e)):g6.call(e)}});function l6(){return $v}function u6(){++$v}function f6(){--$v||m6()}function d6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,mm(e)}}function p6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function h6(e){const t=e.flags;if(t&16||t&32&&c6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,mm(e)}}else e.flags=2}function m6(){try{for(;Va0)){for(;Fp{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(c){const l=Zr,f=Object.is;Zr=i,++hh,i.depsTail=void 0,n&&(i.flags=Yt.Mutable|Yt.RecursedCheck);try{const d=i._snapshot,p=typeof c=="function"?c(d):c===void 0&&n?r(d):c;return d===void 0||!f(d,p)?(i._snapshot=p,!0):!1}finally{Zr=l,n&&(i.flags&=~Yt.RecursedCheck),Ah(i)}}};return n?(i.flags=Yt.Mutable|Yt.Dirty,i.get=function(){const c=i.flags;if(c&Yt.Dirty||c&Yt.Pending&&H2(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&TC(l)}}else c&Yt.Pending&&(i.flags=c&~Yt.Pending);return Zr!==void 0&&AC(i,Zr,hh),i._snapshot}):i.set=function(c){if(i._update(c)){const l=i.subs;l!==void 0&&(b6(l),TC(l),V2())}},i}function S6(e){const t=()=>{const r=Zr;Zr=n,++hh,n.depsTail=void 0,n.flags=Yt.Watching|Yt.RecursedCheck;try{return e()}finally{Zr=r,n.flags&=~Yt.RecursedCheck,Ah(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Yt.Watching|Yt.RecursedCheck,notify(){const r=this.flags;r&Yt.Dirty||r&Yt.Pending&&H2(this.deps,this)?t():this.flags=Yt.Watching},stop(){this.flags=Yt.None,this.depsTail=void 0,Ah(this)}};return t(),n}let _6=class{constructor(t){this.atom=v6(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(j2(t))}};function w6(e){try{u6(),e()}finally{f6(),V2()}}const Xi="__TSR_index",IC="popstate",OC="beforeunload";function E6(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},c=async({task:l,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){l();return}const b=e.getBlockers?.()??[],g=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&b.length&&g)for(const v of b){const S=Th(d.path,d.state);if(await v.blockerFn({currentLocation:t,nextLocation:S,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,f,d)=>{const p=t.state[Xi];f=MC(p+1,f),c({task:()=>{e.pushState(l,f),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const p=t.state[Xi];f=MC(p,f),c({task:()=>{e.replaceState(l,f),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:f})},go:(l,f)=>{c({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:f,type:"GO"})},back:l=>{c({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{c({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Xi]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function MC(e,t){t||(t={});const n=Uv();return{...t,key:n,__TSR_key:n,[Xi]:e}}function x6(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const c=()=>i,l=P=>i=P,f=(P=>P),d=(()=>Th(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=Uv();t.history.replaceState({[Xi]:0,key:P,__TSR_key:P},"")}let p=d(),b,g=!1,v=!1,S=!1,w=!1;const E=()=>p;let R,C;const O=()=>{R&&(H._ignoreSubscribers=!0,(R.isPush?t.history.pushState:t.history.replaceState)(R.state,"",R.href),H._ignoreSubscribers=!1,R=void 0,C=void 0,b=void 0)},k=(P,Y,ne)=>{const re=f(Y);C||(b=p),p=Th(Y,ne),R={href:re,state:ne,isPush:R?.isPush||P==="push"},C||(C=Promise.resolve().then(()=>O()))},T=P=>{p=d(),H.notify({type:P})},$=async()=>{if(v){v=!1;return}const P=d(),Y=P.state[Xi]-p.state[Xi],ne=Y===1,re=Y===-1,G=!ne&&!re||g;g=!1;const te=G?"GO":re?"BACK":"FORWARD",ue=G?{type:"GO",index:Y}:{type:re?"BACK":"FORWARD"};if(S)S=!1;else{const ye=c();if(typeof document<"u"&&ye.length){for(const V of ye)if(await V.blockerFn({currentLocation:p,nextLocation:P,action:te})){v=!0,t.history.go(1),H.notify(ue);return}}}p=d(),H.notify(ue)},j=P=>{if(w){w=!1;return}let Y=!1;const ne=c();if(typeof document<"u"&&ne.length)for(const re of ne){const G=re.enableBeforeUnload??!0;if(G===!0){Y=!0;break}if(typeof G=="function"&&G()===!0){Y=!0;break}}if(Y)return P.preventDefault(),P.returnValue=""},H=E6({getLocation:E,getLength:()=>t.history.length,pushState:(P,Y)=>k("push",P,Y),replaceState:(P,Y)=>k("replace",P,Y),back:P=>(P&&(S=!0),w=!0,t.history.back()),forward:P=>{P&&(S=!0),w=!0,t.history.forward()},go:P=>{g=!0,t.history.go(P)},createHref:P=>f(P),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(OC,j,{capture:!0}),t.removeEventListener(IC,$)},onBlocked:()=>{b&&p!==b&&(p=b)},getBlockers:c,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(OC,j,{capture:!0}),t.addEventListener(IC,$),t.history.pushState=function(...P){const Y=n.apply(t.history,P);return H._ignoreSubscribers||T("PUSH"),Y},t.history.replaceState=function(...P){const Y=r.apply(t.history,P);return H._ignoreSubscribers||T("REPLACE"),Y},H}function R6(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Th(e,t){const n=R6(e),r=n.indexOf("#"),i=n.indexOf("?"),c=Uv();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[Xi]:0,key:c,__TSR_key:c}}}function Uv(){return(Math.random()+1).toString(36).substring(7)}const C6=!1;function Sf(e){let t;return w6(()=>{t=e()}),t}function Df(e){return e[e.length-1]}function A6(e){return typeof e=="function"}function Gi(e,t){return A6(e)?e(t):e}const T6=Object.prototype.hasOwnProperty,DC=Object.prototype.propertyIsEnumerable;function Bs(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,i=NC(e)&&NC(r);if(!i&&!(Ih(e)&&Ih(r)))return r;const c=i?e:kC(e);if(!c)return r;const l=i?r:kC(r);if(!l)return r;const f=c.length,d=l.length,p=i?new Array(d):{};let b=0;for(let g=0;g"u")return!0;const n=t.prototype;return!(!PC(n)||!n.hasOwnProperty("isPrototypeOf"))}function PC(e){return Object.prototype.toString.call(e)==="[object Object]"}function NC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xa(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;ri||!Xa(e[l],t[l],n)))return!1;return i===c}return!1}function Cl(e){let t,n;const r=new Promise((i,c)=>{t=i,n=c});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function I6(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function yl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function O6(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function LC(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return O6(t)}const M6=["http:","https:","mailto:","tel:"];function Oh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}const D6={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},k6=/[&><\u2028\u2029]/g;function P6(e){return e.replace(k6,t=>D6[t])}function tf(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=LC(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+LC(n?e.slice(n):e);let c=!1;return r.startsWith("//")&&(c=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:c}}function N6(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var L6="Invariant failed";function $o(e,t){if(!e)throw new Error(L6)}function Mh(e){const t=new Map;let n,r;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,r&&(r.next=c,c.prev=r)):(c.next.prev=void 0,n=c.next,c.next=void 0,r&&(c.prev=r,r.next=c)),r=c)};return{get(c){const l=t.get(c);if(l)return i(l),l.value},set(c,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const f=t.get(c);if(f)f.value=l,i(f);else{const d={key:c,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(c,d)}},clear(){t.clear(),n=void 0,r=void 0}}}const Al=0,nc=1,sc=2,kf=3,Za=4,F2=5;function z6(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function jv(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,c=e.substring(t,i);if(!c||!c.includes("$"))return n[0]=Al,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(c==="$"){const f=e.length;return n[0]=sc,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(c.charCodeAt(0)===36)return n[0]=nc,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=z6(c);if(l){const[f,d]=l,p=c.charCodeAt(f+1);if(p===45){if(f+2!P.skipOnParamError&&P.caseSensitive===T&&P.prefix===$&&P.suffix===j);if(H)w=H;else{const P=k0(nc,n.fullPath??n.from,T,$,j);w=P,P.depth=c,P.parent=i,i.dynamic??=[],i.dynamic.push(P)}break}case kf:{const O=d.substring(E,S[1]),k=d.substring(S[4],R),T=b&&!!(O||k),$=O?T?O:O.toLowerCase():void 0,j=k?T?k:k.toLowerCase():void 0,H=!g&&i.optional?.find(P=>!P.skipOnParamError&&P.caseSensitive===T&&P.prefix===$&&P.suffix===j);if(H)w=H;else{const P=k0(kf,n.fullPath??n.from,T,$,j);w=P,P.parent=i,P.depth=c,i.optional??=[],i.optional.push(P)}break}case sc:{const O=d.substring(E,S[1]),k=d.substring(S[4],R),T=b&&!!(O||k),$=O?T?O:O.toLowerCase():void 0,j=k?T?k:k.toLowerCase():void 0,H=k0(sc,n.fullPath??n.from,T,$,j);w=H,H.parent=i,H.depth=c,i.wildcard??=[],i.wildcard.push(H)}}i=w}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const S=Ka(n.fullPath??n.from);S.kind=F2,S.parent=i,c++,S.depth=c,i.pathless??=[],i.pathless.push(S),i=S}const v=(n.path||!n.children)&&!n.isRoot;if(v&&d.endsWith("/")){const S=Ka(n.fullPath??n.from);S.kind=Za,S.parent=i,c++,S.depth=c,i.index=S,i=S}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,v&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)gm(e,t,d,f,i,c,l)}function D0(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qi(e){if(e.pathless)for(const t of e.pathless)qi(t);if(e.static)for(const t of e.static.values())qi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())qi(t);if(e.dynamic?.length){e.dynamic.sort(D0);for(const t of e.dynamic)qi(t)}if(e.optional?.length){e.optional.sort(D0);for(const t of e.optional)qi(t)}if(e.wildcard?.length){e.wildcard.sort(D0);for(const t of e.wildcard)qi(t)}}function Ka(e){return{kind:Al,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function k0(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function B6(e,t){const n=Ka("/"),r=new Uint16Array(6);for(const i of e)gm(!1,r,i,1,n,0);qi(n),t.masksTree=n,t.flatCache=Mh(1e3)}function $6(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Hv(e,t.masksTree);return t.flatCache.set(e,r),r}function U6(e,t,n,r,i){e||="/",r||="/";const c=t?`case\0${e}`:e;let l=i.singleCache.get(c);if(!l){l=Ka("/");const f=new Uint16Array(6);gm(t,f,{from:e},1,l,0),i.singleCache.set(c,l)}return Hv(r,l,n)}function j6(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let c;try{c=Hv(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)c=null;else throw l}return c&&(c.branch=F6(c.route)),t.matchCache.set(r,c),c}function H6(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function V6(e,t=!1,n){const r=Ka(e.fullPath),i=new Uint16Array(6),c={},l={};let f=0;return gm(t,i,e,1,r,0,p=>{if(n?.(p,f),$o(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const b=H6(p.fullPath);(!l[b]||p.fullPath.endsWith("/"))&&(l[b]=p)}f++}),qi(r),{processedTree:{segmentTree:r,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:l}}function Hv(e,t,n=!1){const r=e.split("/"),i=G6(e,r,t,n);if(!i)return null;const[c]=q2(e,r,i);return{route:i.node.route,rawParams:c,parsedParams:i.parsedParams}}function q2(e,t,n){const r=q6(n.node);let i=null;const c={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f=0;re--){const G=v.optional[re];f.push({node:G,index:S,skipped:Y,depth:ne,statics:R,dynamics:C,optionals:O,extract:k,rawParams:T,parsedParams:$})}if(!j)for(let re=v.optional.length-1;re>=0;re--){const G=v.optional[re],{prefix:te,suffix:ue}=G;if(te||ue){const ye=G.caseSensitive?H:P??=H.toLowerCase();if(te&&!ye.startsWith(te)||ue&&!ye.endsWith(ue))continue}f.push({node:G,index:S+1,skipped:w,depth:ne,statics:R,dynamics:C,optionals:O+1,extract:k,rawParams:T,parsedParams:$})}}if(!j&&v.dynamic&&H)for(let Y=v.dynamic.length-1;Y>=0;Y--){const ne=v.dynamic[Y],{prefix:re,suffix:G}=ne;if(re||G){const te=ne.caseSensitive?H:P??=H.toLowerCase();if(re&&!te.startsWith(re)||G&&!te.endsWith(G))continue}f.push({node:ne,index:S+1,skipped:w,depth:E+1,statics:R,dynamics:C+1,optionals:O,extract:k,rawParams:T,parsedParams:$})}if(!j&&v.staticInsensitive){const Y=v.staticInsensitive.get(P??=H.toLowerCase());Y&&f.push({node:Y,index:S+1,skipped:w,depth:E+1,statics:R+1,dynamics:C,optionals:O,extract:k,rawParams:T,parsedParams:$})}if(!j&&v.static){const Y=v.static.get(H);Y&&f.push({node:Y,index:S+1,skipped:w,depth:E+1,statics:R+1,dynamics:C,optionals:O,extract:k,rawParams:T,parsedParams:$})}if(v.pathless){const Y=E+1;for(let ne=v.pathless.length-1;ne>=0;ne--){const re=v.pathless[ne];f.push({node:re,index:S,skipped:w,depth:Y,statics:R,dynamics:C,optionals:O,extract:k,rawParams:T,parsedParams:$})}}}if(b&&d)return nf(d,b)?b:d;if(b)return b;if(d)return d;if(r&&p){let g=p.index;for(let S=0;Se.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Za)>(e.node.kind===Za)||t.node.kind===Za==(e.node.kind===Za)&&t.depth>e.depth))):!0}function mh(e){return Vv(e.filter(t=>t!==void 0).join("/"))}function Vv(e){return e.replace(/\/{2,}/g,"/")}function G2(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Lo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Z2(e){return Lo(G2(e))}function Dh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Z6(e,t,n){return Dh(e,n)===Dh(t,n)}function K6({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),c=!i&&t===".";let l;if(r){l=i?t:c?e:e+"\0"+t;const g=r.get(l);if(g)return g}let f;if(c)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&Df(f)==="";)f.pop();const g=t.split("/");for(let v=0,S=g.length;v1&&(Df(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let g=0;g0&&(p+="/");const v=f[g];if(!v)continue;d=jv(v,0,d);const S=d[0];if(S===Al){p+=v;continue}const w=d[5],E=v.substring(0,d[1]),R=v.substring(d[4],w),C=v.substring(d[2],d[3]);S===nc?p+=E||R?`${E}{$${C}}${R}`:`$${C}`:S===sc?p+=E||R?`${E}{$}${R}`:"$":p+=`${E}{-$${C}}${R}`}p=Vv(p);const b=p||"/";return l&&r&&r.set(l,b),b}function Q6(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,c=>t.get(c)??c)}function N0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>zC(i,n)).join("/"):zC(r,n)}function L0({path:e,params:t,decoder:n,...r}){let i=!1;const c={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const l=e.length;let f=0,d,p="";for(;f{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function W6(){const e=Y6();if(!e)return null;const t=e.getItem(ev);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Gi(r,n)||n;try{e.setItem(ev,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const qp=W6(),J6=e=>e.state.__TSR_key||e.href;function eU(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let kh=!1;function tU({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:c}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=l[f];kh=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const g in d){const v=d[g];if(g==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(g){const S=document.querySelector(g);S&&(S.scrollLeft=v.scrollX,S.scrollTop=v.scrollY)}}break e}const p=(c??window.location).hash.split("#",2)[1];if(p){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const v=document.getElementById(p);v&&v.scrollIntoView(g)}break e}const b={top:0,left:0,behavior:n};if(window.scrollTo(b),i)for(const g of i){if(g==="window")continue;const v=typeof g=="function"?g():document.querySelector(g);v&&v.scrollTo(b)}}kh=!1}function nU(e,t){if(!qp||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!qp))return;e.isScrollRestorationSetup=!0,kh=!1;const r=e.options.getScrollRestorationKey||J6;window.history.scrollRestoration="manual";const i=c=>{if(kh||!e.isScrollRestoring)return;let l="";if(c.target===document||c.target===window)l="window";else{const d=c.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=eU(c.target)}const f=r(e.state.location);qp.set(d=>{const p=d[f]||={},b=p[l]||={};if(l==="window")b.scrollX=window.scrollX||0,b.scrollY=window.scrollY||0;else if(l){const g=document.querySelector(l);g&&(b.scrollX=g.scrollLeft||0,b.scrollY=g.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",X6(i,100),!0),e.subscribe("onRendered",c=>{const l=r(c.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(tU({storageKey:ev,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&qp.set(f=>(f[l]||={},f)))})}function sU(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function rU(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function z0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function oU(e){const t=new URLSearchParams(e),n={};for(const[r,i]of t.entries()){const c=n[r];c==null?n[r]=z0(i):Array.isArray(c)?c.push(z0(i)):n[r]=[c,z0(i)]}return n}const iU=cU(JSON.parse),aU=lU(JSON.stringify,JSON.parse);function cU(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=oU(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function lU(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const c=rU(i,r);return c?`?${c}`:""}}const hr="__root__";function Fv(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function yr(e){return e instanceof Response&&!!e.options}const gh=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ym=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),bl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let c=0;c<=i;c++){const l=e.matches[c];if(!l)continue;const f=e.router.getMatch(l.id);f&&Object.assign(r,f.__routeContext,f.__beforeLoadContext)}return r},K2=(e,t,n)=>{const r=e.router.routesById[t.routeId??""]??e.router.routeTree;!r.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(r.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const i=n==="BEFORE_LOAD"&&r.parentRoute;i||$o(r.options.notFoundComponent);const c=e.matches.find(l=>l.routeId===r.id);$o(c,"Could not find match for route: "+r.id),e.updateMatch(c.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=r.parentRoute.id,K2(e,t,n))},Zi=(e,t,n,r)=>{if(!(!yr(n)&&!Fs(n))){if(yr(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const i=yr(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,c=>({...c,status:i,context:bl(e,t.index),isFetching:!1,error:n})),Fs(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw yr(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(K2(e,n,r),n)}},Q2=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,sf=(e,t,n,r)=>{const{id:i,routeId:c}=e.matches[t],l=e.router.looseRoutesById[c];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Zi(e,e.router.getMatch(i),n,r);try{l.options.onError?.(n)}catch(f){n=f,Zi(e,e.router.getMatch(i),n,r)}e.updateMatch(i,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Y2=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!ym(e,t)&&(n.options.loader||n.options.beforeLoad||J2(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{gh(e)},i);r._nonReactive.pendingTimeout=l}},uU=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Y2(e,t,n,r);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Zi(e,c,c.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},fU=(e,t,n,r)=>{const i=e.router.getMatch(t),c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Cl(()=>{c?.resolve()});const{paramsError:l,searchError:f}=i;l&&sf(e,n,l,"PARSE_PARAMS"),f&&sf(e,n,f,"VALIDATE_SEARCH"),Y2(e,t,r,i);const d=new AbortController;let p=!1;const b=()=>{p||(p=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:d})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){Sf(()=>{b(),g()});return}i._nonReactive.beforeLoadPromise=Cl();const v={...bl(e,n,!1),...i.__routeContext},{search:S,params:w,cause:E}=i,R=ym(e,t),C={search:S,abortController:d,params:w,preload:R,context:v,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:R?"preload":E,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},O=T=>{if(T===void 0){Sf(()=>{b(),g()});return}(yr(T)||Fs(T))&&(b(),sf(e,n,T,"BEFORE_LOAD")),Sf(()=>{b(),e.updateMatch(t,$=>({...$,__beforeLoadContext:T})),g()})};let k;try{if(k=r.options.beforeLoad(C),yl(k))return b(),k.catch(T=>{sf(e,n,T,"BEFORE_LOAD")}).then(O)}catch(T){b(),sf(e,n,T,"BEFORE_LOAD")}O(k)},dU=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],c=()=>f(),l=()=>fU(e,n,t,i),f=()=>{if(Q2(e,n))return;const d=uU(e,n,i);return yl(d)?d.then(l):l()};return c()},pU=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([c,l,f])=>{const d=c?.meta,p=c?.links,b=c?.scripts,g=c?.styles;return{meta:d,links:p,headScripts:b,headers:f,scripts:l,styles:g}})},X2=(e,t,n,r)=>{const i=e.matchPromises[n-1],{params:c,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),p=bl(e,n),b=ym(e,t);return{params:c,deps:l,preload:!!b,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:b?"preload":d,route:r,...e.router.options.additionalContext}},BC=async(e,t,n,r)=>{try{const i=e.router.getMatch(t);try{(!(C6??e.router.isServer)||i.ssr===!0)&&W2(r);const c=r.options.loader?.(X2(e,t,n,r)),l=r.options.loader&&yl(c);if((l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),r.options.loader){const p=l?await c:c;Zi(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,b=>({...b,loaderData:p}))}r._lazyPromise&&await r._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:bl(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let l=c;if(l?.name==="AbortError"){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:bl(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,Fs(c)&&await r.options.notFoundComponent?.preload?.(),Zi(e,e.router.getMatch(t),c);try{r.options.onError?.(c)}catch(d){l=d,Zi(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:bl(e,n),status:"error",isFetching:!1}))}}catch(i){const c=e.router.getMatch(t);c&&(c._nonReactive.loaderPromise=void 0),Zi(e,c,i)}},hU=async(e,t)=>{async function n(b,g,v,S){const w=Date.now()-g.updatedAt,E=b?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,R=S.options.shouldReload,C=typeof R=="function"?R(X2(e,r,t,S)):R,{status:O,invalid:k}=v;c=O==="success"&&(k||(C??w>E)),b&&S.options.preload===!1||(c&&!e.sync?(l=!0,(async()=>{try{await BC(e,r,t,S);const T=e.router.getMatch(r);T._nonReactive.loaderPromise?.resolve(),T._nonReactive.loadPromise?.resolve(),T._nonReactive.loaderPromise=void 0}catch(T){yr(T)&&await e.router.navigate(T.options)}})()):(O!=="success"||c&&e.sync)&&await BC(e,r,t,S))}const{id:r,routeId:i}=e.matches[t];let c=!1,l=!1;const f=e.router.looseRoutesById[i];if(!Q2(e,r)){const b=e.router.getMatch(r),g=ym(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload)return b;await b._nonReactive.loaderPromise;const v=e.router.getMatch(r),S=v._nonReactive.error||v.error;S&&Zi(e,v,S),v.status==="pending"&&await n(g,b,v,f)}else{const v=g&&!e.router.state.matches.some(w=>w.id===r),S=e.router.getMatch(r);S._nonReactive.loaderPromise=Cl(),v!==S.preload&&e.updateMatch(r,w=>({...w,preload:v})),await n(g,b,S,f)}}const d=e.router.getMatch(r);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const p=l?d.isFetching:!1;return p!==d.isFetching||d.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:p,invalid:!1})),e.router.getMatch(r)):d};async function $C(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&gh(t);try{for(let f=0;ff.status==="rejected").map(f=>f.reason);let c;for(const f of i){if(yr(f))throw f;!c&&Fs(f)&&(c=f)}for(const f of t.matches){const{id:d,routeId:p}=f,b=t.router.looseRoutesById[p];try{const g=pU(t,d,b);if(g){const v=await g;t.updateMatch(d,S=>({...S,...v}))}}catch(g){console.error(`Error executing head for route ${p}:`,g)}}if(c)throw c;const l=gh(t);yl(l)&&await l}catch(n){if(Fs(n)&&!t.preload){const r=gh(t);throw yl(r)&&await r,n}if(yr(n))throw n}return t.matches}async function W2(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of eO){const i=e.options[r]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function J2(e){for(const t of eO)if(e.options[t]?.preload)return!0;return!1}const eO=["component","errorComponent","pendingComponent","notFoundComponent"];function mU(e){return{input:({url:t})=>{for(const n of e)t=tv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=tO(e[n],t);return t}}}function gU(e){const t=Z2(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),c=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const f=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return f===i?l.pathname="/":f.startsWith(c)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=mh(["/",t,l.pathname]),l)}}function tv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function tO(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Wa(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,i=t?.href!==n.href,c=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:i,hashChanged:c}}function yU(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class bU{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,i=this.basepath??r?.basepath??"/",c=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Q6(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=x6()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let v;this.resolvePathCache=Mh(1e3),v=this.buildRouteTree(),this.setRoutes(v)}!this.__store&&this.latestLocation&&(this.__store=new _6(SU(this.latestLocation)),nU(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(c||i!==d||l!==p){this.basepath=d;const v=[],S=Z2(d);S&&S!=="/"&&v.push(gU({basepath:d})),p&&v.push(p),this.rewrite=v.length===0?void 0:v.length===1?v[0]:mU(v),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&this.__store.setState(v=>({...v,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=V6(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&B6(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:d,search:p,hash:b,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const O=this.options.parseSearch(p),k=this.options.stringifySearch(O);return{href:d+k+b,publicHref:g,pathname:tf(d).path,external:!1,searchStr:k,search:Bs(r?.search,O),hash:tf(b.slice(1)).path,state:Bs(r?.state,v)}}const S=new URL(g,this.origin),w=tv(this.rewrite,S),E=this.options.parseSearch(w.search),R=this.options.stringifySearch(E);return w.search=R,{href:w.href.replace(w.origin,""),publicHref:g,pathname:tf(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:R,search:Bs(r?.search,E),hash:tf(w.hash.slice(1)).path,state:Bs(r?.state,v)}},c=i(n),{__tempLocation:l,__tempKey:f}=c.state;if(l&&(!f||f===this.tempLocationKey)){const d=i(l);return d.state.key=c.state.key,d.state.__TSR_key=c.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:c}}return c},this.resolvePathWithBase=(n,r)=>K6({base:n,to:Vv(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>_U({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(c=>c.status==="pending"),r=this.state.matches.filter(c=>c.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(c=>{this.cancelMatch(c.id)})},this.buildLocation=n=>{const r=(c={})=>{const l=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(l);c.from;const d=c.unsafeRelative==="path"?l.pathname:c.from??f.fullPath,p=this.resolvePathWithBase(d,"."),b=f.search,g={...f.params},v=c.to?this.resolvePathWithBase(p,`${c.to}`):this.resolvePathWithBase(p,"."),S=c.params===!1||c.params===null?{}:(c.params??!0)===!0?g:Object.assign(g,Gi(c.params,g)),w=L0({path:v,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,E=this.getMatchedRoutes(w);let R=E.matchedRoutes;(E.foundRoute?E.foundRoute.path!=="/"&&E.routeParams["**"]:Lo(w))&&this.options.notFoundRoute&&(R=[...R,this.options.notFoundRoute]);let O=!1;if(Object.keys(S).length>0)for(const te of R){const ue=te.options.params?.stringify??te.options.stringifyParams;if(ue)try{Object.assign(S,ue(S)),O=!0}catch{}}const k=n.leaveParams?v:tf(O?L0({path:v,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:w).path;let T=b;if(n._includeValidateSearch&&this.options.search?.strict){const te={};R.forEach(ue=>{if(ue.options.validateSearch)try{Object.assign(te,yh(ue.options.validateSearch,{...te,...T}))}catch{}}),T=te}T=wU({search:T,dest:c,destRoutes:R,_includeValidateSearch:n._includeValidateSearch}),T=Bs(b,T);const $=this.options.stringifySearch(T),j=c.hash===!0?l.hash:c.hash?Gi(c.hash,l.hash):void 0,H=j?`#${j}`:"";let P=c.state===!0?l.state:c.state?Gi(c.state,l.state):{};P=Bs(l.state,P);const Y=`${k}${$}${H}`;let ne,re,G=!1;if(this.rewrite){const te=new URL(Y,this.origin),ue=tO(this.rewrite,te);ne=te.href.replace(te.origin,""),ue.origin!==this.origin?(re=ue.href,G=!0):re=ue.pathname+ue.search+ue.hash}else ne=N6(Y),re=ne;return{publicHref:re,href:ne,pathname:k,search:T,searchStr:$,state:P,hash:j??"",external:G,unmaskOnReload:c.unmaskOnReload}},i=(c={},l)=>{const f=r(c);let d=l?r(l):void 0;if(!d){const p={};if(this.options.routeMasks){const b=$6(f.pathname,this.processedTree);if(b){Object.assign(p,b.rawParams);const{from:g,params:v,...S}=b.route,w=v===!1||v===null?{}:(v??!0)===!0?p:Object.assign(p,Gi(v,p));l={from:n.from,...S,params:w},d=r(l)}}}return d&&(f.maskedLocation=d),f};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{const c=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(b=>{i.state[b]=this.latestLocation.state[b]});const p=Xa(i.state,this.latestLocation.state);return d.forEach(b=>{delete i.state[b]}),p},l=Lo(this.latestLocation.href)===Lo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Cl(()=>{f?.resolve()}),l&&c())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...b}=i;d&&(b={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...b,search:b.searchStr,state:{...b.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(b.unmaskOnReload??this.options.unmaskOnReload??!1)&&(b.state.__tempKey=this.tempLocationKey)),b.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](b.publicHref,b.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:l,href:f,...d}={})=>{if(f){const g=this.history.location.state.__TSR_index,v=Th(f,{__TSR_index:n?g:g+1}),S=new URL(v.pathname,this.origin),w=tv(this.rewrite,S);d.to=w.pathname,d.search=this.options.parseSearch(v.search),d.hash=v.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const b=this.commitLocation({...p,viewTransition:c,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),b},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:c,...l})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!r&&(r=!0),r){if(n!==void 0||!i){const p=this.buildLocation({to:n,...l});i=i??p.publicHref,c=c??p.publicHref}const d=!f&&c?c:i;if(Oh(d,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const b=this.history.getBlockers?.()??[];for(const g of b)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(i=>!n.some(c=>c.id===i.id))}))},this.load=async n=>{let r,i,c;for(c=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Wa({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...Wa({resolvedLocation:p,location:d})}),await $C({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=[],g=[],v=[];Sf(()=>{this.__store.setState(S=>{const w=S.matches,E=S.pendingMatches||S.matches;return b=w.filter(R=>!E.some(C=>C.id===R.id)),g=E.filter(R=>!w.some(C=>C.id===R.id)),v=E.filter(R=>w.some(C=>C.id===R.id)),{...S,isLoading:!1,loadedAt:Date.now(),matches:E,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...b.filter(R=>R.status!=="error"&&R.status!=="notFound"&&R.status!=="redirected")]}}),this.clearExpiredCache()}),[[b,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([S,w])=>{S.forEach(E=>{this.looseRoutesById[E.routeId].options[w]?.(E)})})})})}})}catch(d){yr(d)?(r=d,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Fs(d)&&(i=d),this.__store.setState(p=>({...p,statusCode:r?r.status:i?404:p.matches.some(b=>b.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===c&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=c,await c;this.latestLoadPromise&&c!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(f=>f.status==="error")&&(l=500),l!==void 0&&this.__store.setState(f=>({...f,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,l=this.state.resolvedLocation,f=typeof r.types=="function"?r.types(Wa({resolvedLocation:l,location:c})):r.types;if(f===!1){n();return}i={update:n,types:f}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(c=>c.id===n)?"pendingMatches":this.state.matches.some(c=>c.id===n)?"matches":this.state.cachedMatches.some(c=>c.id===n)?"cachedMatches":"";i&&(i==="cachedMatches"?this.__store.setState(c=>({...c,cachedMatches:yU(c.cachedMatches.map(l=>l.id===n?r(l):l))})):this.__store.setState(c=>({...c,[i]:c[i]?.map(l=>l.id===n?r(l):l)})))})},this.getMatch=n=>{const r=i=>i.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(r),cachedMatches:i.cachedMatches.map(r),pendingMatches:i.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),c=this.getParsedLocationHref(i);n.options.href=c,n.headers.set("Location",c)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;n.options.href=c,n.headers.set("Location",c)}}catch{}if(n.options.href&&!n.options._builtLocation&&Oh(n.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${n.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(c=>!r(c))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!0;const c=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=c};this.clearCache({filter:n})},this.loadRouteChunk=W2,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const c=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),l=new Set([...c,...this.state.cachedMatches.map(f=>f.id)]);Sf(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await $C({router:this,matches:i,location:r,preload:!0,updateMatch:(f,d)=>{c.has(f)?i=i.map(p=>p.id===f?d(p):p):this.updateMatch(f,d)}}),i}catch(f){if(yr(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:r});Fs(f)||console.error(f);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},c=this.buildLocation(i);if(r?.pending&&this.state.status!=="pending")return!1;const f=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=U6(c.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!Xa(d.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Xa(f.search,c.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??aU,parseSearch:t.parseSearch??iU,protocolAllowlist:t.protocolAllowlist??M6}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:c,parsedParams:l}=r;let{matchedRoutes:f}=r,d=!1;(i?i.path!=="/"&&c["**"]:Lo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?xU(this.options.notFoundMode,f):void 0,b=new Array(f.length),g=new Map(this.state.matches.map(v=>[v.routeId,v]));for(let v=0;vthis.navigate({...T,_fromLocation:t}),buildLocation:this.buildLocation,cause:S.cause,abortController:S.abortController,preload:!!S.preload,matches:b,routeId:w.id};S.__routeContext=w.options.context(k)??void 0}S.context={...O,...S.__routeContext,...S.__beforeLoadContext}}}return b}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:i}=this.getMatchedRoutes(t.pathname),c=Df(n),l={...t.search};for(const b of n)try{Object.assign(l,yh(b.options.validateSearch,l))}catch{}const f=Df(this.state.matches),d=f&&f.routeId===c.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const b={...r};for(const g of n)try{UC(g,r,i??{},b)}catch{}p=b}return{matchedRoutes:n,fullPath:c.fullPath,search:l,params:p}}}class Ph extends Error{}class vU extends Error{}function SU(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function yh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ph("Async validation not supported");if(n.issues)throw new Ph(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function _U({pathname:e,routesById:t,processedTree:n}){const r={},i=Lo(e);let c,l;const f=j6(i,n,!0);return f&&(c=f.route,Object.assign(r,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[hr]],routeParams:r,foundRoute:c,parsedParams:l}}function wU({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return EU(n)(e,t,r??!1)}function EU(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const c=({search:l,next:f})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((b,g)=>g(b),l));const p=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((b,g)=>g(b),p):p};t.middlewares.push(c)}if(i.options.validateSearch){const c=({search:l,next:f})=>{const d=f(l);if(!t._includeValidateSearch)return d;try{return{...d,...yh(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(c)}}const n=({search:i})=>{const c=t.dest;return c.search?c.search===!0?i:Gi(c.search,i):{}};t.middlewares.push(n);const r=(i,c,l)=>{if(i>=l.length)return c;const f=l[i];return f({search:c,next:p=>r(i+1,p,l)})};return function(c,l,f){return t.dest=l,t._includeValidateSearch=f,r(0,c,t.middlewares)}}function xU(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return hr}function UC(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const c in t)c in n&&(r[c]=n[c]);else{const c=i(r);Object.assign(r,c)}}const RU="Error preloading route! ā˜ļø";class nO{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,i=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=hr:this.parentRoute||$o(!1);let c=i?hr:r?.path;c&&c!=="/"&&(c=G2(c));const l=r?.id||c;let f=i?hr:mh([this.parentRoute.id===hr?"":this.parentRoute.id,l]);c===hr&&(c="/"),f!==hr&&(f=mh(["/",f]));const d=f===hr?"/":mh([this.parentRoute.fullPath,c]);this._path=c,this._id=f,this._fullPath=d,this._to=Lo(d)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Fv({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class CU extends nO{constructor(t){super(t)}}const AU="use",jC=Bv[AU],Gp=typeof window<"u"?M.useLayoutEffect:M.useEffect;function B0(e){const t=M.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function TU(e,t,n={},r={}){M.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function IU(e){const t=M.useRef(null);return M.useImperativeHandle(e,()=>t.current,[]),t}function qv(e){const t=e.errorComponent??Gv;return N.jsx(OU,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?M.createElement(t,{error:n,reset:r}):e.children})}class OU extends M.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Gv({error:e}){const[t,n]=M.useState(!1);return N.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[N.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),N.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),N.jsx("div",{style:{height:".25rem"}}),t?N.jsx("div",{children:N.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?N.jsx("code",{children:e.message}):null})}):null]})}function MU({children:e,fallback:t=null}){return Zv()?N.jsx(Rl.Fragment,{children:e}):N.jsx(Rl.Fragment,{children:t})}function Zv(){return Rl.useSyncExternalStore(DU,()=>!0,()=>!1)}function DU(){return()=>{}}var $0={exports:{}},U0={},j0={exports:{}},H0={};var HC;function kU(){if(HC)return H0;HC=1;var e=zl();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue;function f(g,v){var S=v(),w=r({inst:{value:S,getSnapshot:v}}),E=w[0].inst,R=w[1];return c(function(){E.value=S,E.getSnapshot=v,d(E)&&R({inst:E})},[g,S,v]),i(function(){return d(E)&&R({inst:E}),g(function(){d(E)&&R({inst:E})})},[g]),l(S),S}function d(g){var v=g.getSnapshot;g=g.value;try{var S=v();return!n(g,S)}catch{return!0}}function p(g,v){return v()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return H0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,H0}var VC;function sO(){return VC||(VC=1,j0.exports=kU()),j0.exports}var FC;function PU(){if(FC)return U0;FC=1;var e=zl(),t=sO();function n(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,c=e.useRef,l=e.useEffect,f=e.useMemo,d=e.useDebugValue;return U0.useSyncExternalStoreWithSelector=function(p,b,g,v,S){var w=c(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function C(j){if(!O){if(O=!0,k=j,j=v(j),S!==void 0&&E.hasValue){var H=E.value;if(S(H,j))return T=H}return T=j}if(H=T,r(k,j))return H;var P=v(j);return S!==void 0&&S(H,P)?(k=j,H):(k=j,T=P)}var O=!1,k,T,$=g===void 0?null:g;return[function(){return C(b())},$===null?void 0:function(){return C($())}]},[b,g,v,S]);var R=i(p,w[0],w[1]);return l(function(){E.hasValue=!0,E.value=R},[R]),d(R),R},U0}var qC;function NU(){return qC||(qC=1,$0.exports=PU()),$0.exports}var rO=NU();function LU(e,t){return e===t}function zU(e,t,n=LU){const r=M.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=M.useCallback(()=>e?.get(),[e]);return rO.useSyncExternalStoreWithSelector(r,i,i,t,n)}const V0=M.createContext(null);function oO(){return typeof document>"u"?V0:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=V0,V0)}function ns(e){const t=M.useContext(oO());return e?.warn,t}function Mn(e){const t=ns({warn:e?.router===void 0}),n=e?.router||t,r=M.useRef(void 0);return zU(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const c=Bs(r.current,e.select(i));return r.current=c,c}return e.select(i)}return i})}const bm=M.createContext(void 0),BU=M.createContext(void 0);function Wr(e){const t=M.useContext(e.from?BU:bm);return Mn({select:r=>{const i=r.matches.find(c=>e.from?e.from===c.routeId:c.id===t);if($o(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Kv(e){return Wr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Qv(e){const{select:t,...n}=e;return Wr({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Yv(e){return Wr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Xv(e){return Wr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function vm(e){const t=ns();return M.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var F0={exports:{}},Qn={};var GC;function $U(){if(GC)return Qn;GC=1;var e=zl();function t(d){var p="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),F0.exports=$U(),F0.exports}var na=iO();function UU(e,t){const n=ns(),r=IU(t),{activeProps:i,inactiveProps:c,activeOptions:l,to:f,preload:d,preloadDelay:p,hashScrollIntoView:b,replace:g,startTransition:v,resetScroll:S,viewTransition:w,children:E,target:R,disabled:C,style:O,className:k,onClick:T,onFocus:$,onMouseEnter:j,onMouseLeave:H,onTouchStart:P,ignoreBlocker:Y,params:ne,search:re,hash:G,state:te,mask:ue,reloadDocument:ye,unsafeRelative:V,from:oe,_fromLocation:J,...ve}=e,fe=Zv(),B=Mn({select:dt=>{const $t=dt.matches[dt.matches.length-1];return{search:$t?.search,hash:dt.location.hash,path:$t?.pathname}},structuralSharing:!0}),ee=e.from,ge=M.useMemo(()=>({...e,from:ee}),[n,B,ee,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),be=M.useMemo(()=>n.buildLocation({...ge}),[n,ge]),xe=be.maskedLocation?be.maskedLocation.publicHref:be.publicHref,_e=be.maskedLocation?be.maskedLocation.external:be.external,Te=M.useMemo(()=>GU(xe,_e,n.history,C),[C,_e,xe,n.history]),Fe=M.useMemo(()=>{if(Te?.external)return Oh(Te.href,n.protocolAllowlist)?void 0:Te.href;if(!ZU(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Oh(f,n.protocolAllowlist)?void 0:f}catch{}},[f,Te,n.protocolAllowlist]),Se=Mn({select:dt=>{if(Fe)return!1;if(l?.exact){if(!Z6(dt.location.pathname,be.pathname,n.basepath))return!1}else{const $t=Dh(dt.location.pathname,n.basepath),mt=Dh(be.pathname,n.basepath);if(!($t.startsWith(mt)&&($t.length===mt.length||$t[mt.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Xa(dt.location.search,be.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?fe&&dt.location.hash===be.hash:!0}}),Xe=Se?Gi(i,{})??jU:q0,_t=Se?q0:Gi(c,{})??q0,me=[k,Xe.className,_t.className].filter(Boolean).join(" "),Ee=(O||Xe.style||_t.style)&&{...O,...Xe.style,..._t.style},[we,qe]=M.useState(!1),Oe=M.useRef(!1),je=e.reloadDocument||Fe?!1:d??n.options.defaultPreload,De=p??n.options.defaultPreloadDelay??0,nt=M.useCallback(()=>{n.preloadRoute({...ge,_builtLocation:be}).catch(dt=>{console.warn(dt),console.warn(RU)})},[n,ge,be]),Bt=M.useCallback(dt=>{dt?.isIntersecting&&nt()},[nt]);TU(r,Bt,qU,{disabled:!!C||je!=="viewport"}),M.useEffect(()=>{Oe.current||!C&&je==="render"&&(nt(),Oe.current=!0)},[C,nt,je]);const We=dt=>{const $t=dt.currentTarget.getAttribute("target"),mt=R!==void 0?R:$t;if(!C&&!KU(dt)&&!dt.defaultPrevented&&(!mt||mt==="_self")&&dt.button===0){dt.preventDefault(),na.flushSync(()=>{qe(!0)});const Os=n.subscribe("onResolved",()=>{Os(),qe(!1)});n.navigate({...ge,replace:g,resetScroll:S,hashScrollIntoView:b,startTransition:v,viewTransition:w,ignoreBlocker:Y})}};if(Fe)return{...ve,ref:r,href:Fe,...E&&{children:E},...R&&{target:R},...C&&{disabled:C},...O&&{style:O},...k&&{className:k},...T&&{onClick:T},...$&&{onFocus:$},...j&&{onMouseEnter:j},...H&&{onMouseLeave:H},...P&&{onTouchStart:P}};const Tt=dt=>{C||je&&nt()},Rn=Tt,It=dt=>{if(!(C||!je))if(!De)nt();else{const $t=dt.target;if(rf.has($t))return;const mt=setTimeout(()=>{rf.delete($t),nt()},De);rf.set($t,mt)}},Tr=dt=>{if(C||!je||!De)return;const $t=dt.target,mt=rf.get($t);mt&&(clearTimeout(mt),rf.delete($t))};return{...ve,...Xe,..._t,href:Te?.href,ref:r,onClick:of([T,We]),onFocus:of([$,Tt]),onMouseEnter:of([j,It]),onMouseLeave:of([H,Tr]),onTouchStart:of([P,Rn]),disabled:!!C,target:R,...Ee&&{style:Ee},...me&&{className:me},...C&&HU,...Se&&VU,...fe&&we&&FU}}const q0={},jU={className:"active"},HU={role:"link","aria-disabled":!0},VU={"data-status":"active","aria-current":"page"},FU={"data-transitioning":"transitioning"},rf=new WeakMap,qU={rootMargin:"100px"},of=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function GU(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ZU(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const $s=M.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...c}=UU(r,t),l=typeof r.children=="function"?r.children({isActive:c["data-status"]==="active"}):r.children;if(!n){const{disabled:f,...d}=c;return M.createElement("a",d,l)}return M.createElement(n,c,l)});function KU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let QU=class extends nO{constructor(t){super(t),this.useMatch=n=>Wr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Wr({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Xv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Yv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Qv({...n,from:this.id}),this.useLoaderData=n=>Kv({...n,from:this.id}),this.useNavigate=()=>vm({from:this.fullPath}),this.Link=Rl.forwardRef((n,r)=>N.jsx($s,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function YU(e){return new QU(e)}function XU(){return e=>JU(e)}class WU extends CU{constructor(t){super(t),this.useMatch=n=>Wr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Wr({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Xv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Yv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Qv({...n,from:this.id}),this.useLoaderData=n=>Kv({...n,from:this.id}),this.useNavigate=()=>vm({from:this.fullPath}),this.Link=Rl.forwardRef((n,r)=>N.jsx($s,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function JU(e){return new WU(e)}function St(e){return typeof e=="object"?new KC(e,{silent:!0}).createRoute(e):new KC(e,{silent:!0}).createRoute}class KC{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const i=YU(r);return i.isRoot=!1,i},this.silent=n?.silent}}class QC{constructor(t){this.useMatch=n=>Wr({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Wr({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Xv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Yv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Qv({...n,from:this.options.id}),this.useLoaderData=n=>Kv({...n,from:this.options.id}),this.useNavigate=()=>{const n=ns();return vm({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function YC(e){return typeof e=="object"?new QC(e):t=>new QC({id:e,...t})}function At(e,t){let n,r,i,c;const l=()=>(n||(n=e().then(d=>{n=void 0,r=d[t]}).catch(d=>{if(i=d,I6(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const p=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(p)||(sessionStorage.setItem(p,"1"),c=!0)}})),n),f=function(p){if(c)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(jC)jC(l());else throw l();return M.createElement(r,p)};return f.preload=l,f}function e5(){const e=ns(),t=M.useRef({router:e,mounted:!1}),[n,r]=M.useState(!1),{hasPendingMatches:i,isLoading:c}=Mn({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),l=B0(c),f=c||n||i,d=B0(f),p=c||i,b=B0(p);return e.startTransition=g=>{r(!0),M.startTransition(()=>{g(),r(!1)})},M.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Lo(e.latestLocation.publicHref)!==Lo(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),Gp(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),Gp(()=>{l&&!c&&e.emit({type:"onLoad",...Wa(e.state)})},[l,e,c]),Gp(()=>{b&&!p&&e.emit({type:"onBeforeRouteMount",...Wa(e.state)})},[p,b,e]),Gp(()=>{if(d&&!f){const g=Wa(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),g.hrefChanged&&sU(e)}},[f,d,e]),null}function t5(e){const t=Mn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return N.jsx(qv,{getResetKey:()=>t,onCatch:(n,r)=>{if(Fs(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Fs(n))return e.fallback?.(n);throw n},children:e.children})}function n5(){return N.jsx("p",{children:"Not Found"})}function hl(e){return N.jsx(N.Fragment,{children:e.children})}function aO(e,t,n){return t.options.notFoundComponent?N.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?N.jsx(e.options.defaultNotFoundComponent,{...n}):N.jsx(n5,{})}function s5(){return ns().isScrollRestoring,null}const cO=M.memo(function({matchId:t}){const n=ns(),r=Mn({select:E=>{const R=E.matches.findIndex(O=>O.id===t),C=E.matches[R];return $o(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:E.loadedAt,parentRouteId:E.matches[R-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],c=i.options.pendingComponent??n.options.defaultPendingComponent,l=c?N.jsx(c,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,b=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||b)&&(i.options.wrapInSuspense??c??(i.options.errorComponent?.preload||b))?M.Suspense:hl,v=f?qv:hl,S=p?t5:hl,w=i.isRoot?i.options.shellComponent??hl:hl;return N.jsxs(w,{children:[N.jsx(bm.Provider,{value:t,children:N.jsx(g,{fallback:l,children:N.jsx(v,{getResetKey:()=>r.resetKey,errorComponent:f||Gv,onCatch:(E,R)=>{if(Fs(E))throw E;d?.(E,R)},children:N.jsx(S,{fallback:E=>{if(!p||E.routeId&&E.routeId!==r.routeId||!E.routeId&&!i.isRoot)throw E;return M.createElement(p,E)},children:b||r._displayPending?N.jsx(MU,{fallback:l,children:N.jsx(XC,{matchId:t})}):N.jsx(XC,{matchId:t})})})})}),r.parentRouteId===hr&&n.options.scrollRestoration?N.jsxs(N.Fragment,{children:[N.jsx(r5,{}),N.jsx(s5,{})]}):null]})});function r5(){const e=ns(),t=M.useRef(void 0);return N.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Wa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const XC=M.memo(function({matchId:t}){const n=ns(),{match:r,key:i,routeId:c}=Mn({select:d=>{const p=d.matches.find(w=>w.id===t),b=p.routeId,v=(n.routesById[b].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:b,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:b,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),l=n.routesById[c],f=M.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?N.jsx(d,{},i):N.jsx(lO,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const p=n.getMatch(r.id);if(p&&!p._nonReactive.minPendingPromise){const b=Cl();p._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return $o(Fs(r.error)),aO(n,l,r.error);if(r.status==="redirected")throw $o(yr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return f}),lO=M.memo(function(){const t=ns(),n=M.useContext(bm),r=Mn({select:p=>p.matches.find(b=>b.id===n)?.routeId}),i=t.routesById[r],c=Mn({select:p=>{const g=p.matches.find(v=>v.id===n);return $o(g),g.globalNotFound}}),l=Mn({select:p=>{const b=p.matches,g=b.findIndex(v=>v.id===n);return b[g+1]?.id}}),f=t.options.defaultPendingComponent?N.jsx(t.options.defaultPendingComponent,{}):null;if(c)return aO(t,i,void 0);if(!l)return null;const d=N.jsx(cO,{matchId:l});return r===hr?N.jsx(M.Suspense,{fallback:f,children:d}):d});function o5(){const e=ns(),n=e.routesById[hr].options.pendingComponent??e.options.defaultPendingComponent,r=n?N.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?hl:M.Suspense,c=N.jsxs(i,{fallback:r,children:[N.jsx(e5,{}),N.jsx(i5,{})]});return e.options.InnerWrap?N.jsx(e.options.InnerWrap,{children:c}):c}function i5(){const e=ns(),t=Mn({select:i=>i.matches[0]?.id}),n=Mn({select:i=>i.loadedAt}),r=t?N.jsx(cO,{matchId:t}):null;return N.jsx(bm.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:N.jsx(qv,{getResetKey:()=>n,errorComponent:Gv,onCatch:i=>{i.message||i.toString()},children:r})})}const a5=e=>new c5(e);class c5 extends bU{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=St,globalThis.createLazyFileRoute=YC):typeof window<"u"&&(window.createFileRoute=St,window.createLazyFileRoute=YC);function l5({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=oO(),i=N.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?N.jsx(e.options.Wrap,{children:i}):i}function u5({router:e,...t}){return N.jsx(l5,{router:e,...t,children:N.jsx(o5,{})})}function f5(e){return Mn({select:t=>e?.select?e.select(t.location):t.location})}function d5({tag:e,attrs:t,children:n,nonce:r}){switch(e){case"title":return N.jsx("title",{...t,suppressHydrationWarning:!0,children:n});case"meta":return N.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return N.jsx("link",{...t,nonce:r,suppressHydrationWarning:!0});case"style":return N.jsx("style",{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case"script":return N.jsx(p5,{attrs:t,children:n});default:return null}}function p5({attrs:e,children:t}){ns();const n=Zv(),r=typeof e?.type=="string"&&e.type!==""&&e.type!=="text/javascript"&&e.type!=="module";if(M.useEffect(()=>{if(!r){if(e?.src){const i=(()=>{try{const f=document.baseURI||window.location.href;return new URL(e.src,f).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(f=>f.src===i))return;const l=document.createElement("script");for(const[f,d]of Object.entries(e))f!=="suppressHydrationWarning"&&d!==void 0&&d!==!1&&l.setAttribute(f,typeof d=="boolean"?"":String(d));return document.head.appendChild(l),()=>{l.parentNode&&l.parentNode.removeChild(l)}}if(typeof t=="string"){const i=typeof e?.type=="string"?e.type:"text/javascript",c=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(d=>{if(!(d instanceof HTMLScriptElement))return!1;const p=d.getAttribute("type")??"text/javascript",b=d.getAttribute("nonce")??void 0;return d.textContent===t&&p===i&&b===c}))return;const f=document.createElement("script");if(f.textContent=t,e)for(const[d,p]of Object.entries(e))d!=="suppressHydrationWarning"&&p!==void 0&&p!==!1&&f.setAttribute(d,typeof p=="boolean"?"":String(p));return document.head.appendChild(f),()=>{f.parentNode&&f.parentNode.removeChild(f)}}}},[e,t,r]),r&&typeof t=="string")return N.jsx("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!n){if(e?.src)return N.jsx("script",{...e,suppressHydrationWarning:!0});if(typeof t=="string")return N.jsx("script",{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}const h5=()=>{const e=ns(),t=e.options.ssr?.nonce,n=Mn({select:d=>d.matches.map(p=>p.meta).filter(Boolean)}),r=M.useMemo(()=>{const d=[],p={};let b;for(let g=n.length-1;g>=0;g--){const v=n[g];for(let S=v.length-1;S>=0;S--){const w=v[S];if(w)if(w.title)b||(b={tag:"title",children:w.title});else if("script:ld+json"in w)try{const E=JSON.stringify(w["script:ld+json"]);d.push({tag:"script",attrs:{type:"application/ld+json"},children:P6(E)})}catch{}else{const E=w.name??w.property;if(E){if(p[E])continue;p[E]=!0}d.push({tag:"meta",attrs:{...w,nonce:t}})}}}return b&&d.push(b),t&&d.push({tag:"meta",attrs:{property:"csp-nonce",content:t}}),d.reverse(),d},[n,t]),i=Mn({select:d=>{const p=d.matches.map(v=>v.links).filter(Boolean).flat(1).map(v=>({tag:"link",attrs:{...v,nonce:t}})),b=e.ssr?.manifest,g=d.matches.map(v=>b?.routes[v.routeId]?.assets??[]).filter(Boolean).flat(1).filter(v=>v.tag==="link").map(v=>({tag:"link",attrs:{...v.attrs,suppressHydrationWarning:!0,nonce:t}}));return[...p,...g]},structuralSharing:!0}),c=Mn({select:d=>{const p=[];return d.matches.map(b=>e.looseRoutesById[b.routeId]).forEach(b=>e.ssr?.manifest?.routes[b.id]?.preloads?.filter(Boolean).forEach(g=>{p.push({tag:"link",attrs:{rel:"modulepreload",href:g,nonce:t}})})),p},structuralSharing:!0}),l=Mn({select:d=>d.matches.map(p=>p.styles).flat(1).filter(Boolean).map(({children:p,...b})=>({tag:"style",attrs:{...b,nonce:t},children:p})),structuralSharing:!0}),f=Mn({select:d=>d.matches.map(p=>p.headScripts).flat(1).filter(Boolean).map(({children:p,...b})=>({tag:"script",attrs:{...b,nonce:t},children:p})),structuralSharing:!0});return m5([...r,...c,...i,...l,...f],d=>JSON.stringify(d))};function m5(e,t){const n=new Set;return e.filter(r=>{const i=t(r);return n.has(i)?!1:(n.add(i),!0)})}function g5(){const e=h5(),n=ns().options.ssr?.nonce;return N.jsx(N.Fragment,{children:e.map(r=>M.createElement(d5,{...r,key:`tsr-meta-${JSON.stringify(r)}`,nonce:n}))})}var G0={exports:{}},af={},Z0={exports:{}},K0={};var WC;function y5(){return WC||(WC=1,(function(e){function t(V,oe){var J=V.length;V.push(oe);e:for(;0>>1,fe=V[ve];if(0>>1;vei(ge,J))bei(xe,ge)?(V[ve]=xe,V[be]=J,ve=be):(V[ve]=ge,V[ee]=J,ve=ee);else if(bei(xe,J))V[ve]=xe,V[be]=J,ve=be;else break e}}return oe}function i(V,oe){var J=V.sortIndex-oe.sortIndex;return J!==0?J:V.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var d=[],p=[],b=1,g=null,v=3,S=!1,w=!1,E=!1,R=!1,C=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function T(V){for(var oe=n(p);oe!==null;){if(oe.callback===null)r(p);else if(oe.startTime<=V)r(p),oe.sortIndex=oe.expirationTime,t(d,oe);else break;oe=n(p)}}function $(V){if(E=!1,T(V),!w)if(n(d)!==null)w=!0,j||(j=!0,G());else{var oe=n(p);oe!==null&&ye($,oe.startTime-V)}}var j=!1,H=-1,P=5,Y=-1;function ne(){return R?!0:!(e.unstable_now()-YV&&ne());){var ve=g.callback;if(typeof ve=="function"){g.callback=null,v=g.priorityLevel;var fe=ve(g.expirationTime<=V);if(V=e.unstable_now(),typeof fe=="function"){g.callback=fe,T(V),oe=!0;break t}g===n(d)&&r(d),T(V)}else r(d);g=n(d)}if(g!==null)oe=!0;else{var B=n(p);B!==null&&ye($,B.startTime-V),oe=!1}}break e}finally{g=null,v=J,S=!1}oe=void 0}}finally{oe?G():j=!1}}}var G;if(typeof k=="function")G=function(){k(re)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,ue=te.port2;te.port1.onmessage=re,G=function(){ue.postMessage(null)}}else G=function(){C(re,0)};function ye(V,oe){H=C(function(){V(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125ve?(V.sortIndex=J,t(p,V),n(d)===null&&V===n(p)&&(E?(O(H),H=-1):E=!0,ye($,J-ve))):(V.sortIndex=fe,t(d,V),w||S||(w=!0,j||(j=!0,G()))),V},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(V){var oe=v;return function(){var J=v;v=oe;try{return V.apply(this,arguments)}finally{v=J}}}})(K0)),K0}var JC;function b5(){return JC||(JC=1,Z0.exports=y5()),Z0.exports}var eA;function v5(){if(eA)return af;eA=1;var e=b5(),t=zl(),n=iO();function r(s){var o="https://react.dev/errors/"+s;if(1fe||(s.current=ve[fe],ve[fe]=null,fe--)}function ge(s,o){fe++,ve[fe]=s.current,s.current=o}var be=B(null),xe=B(null),_e=B(null),Te=B(null);function Fe(s,o){switch(ge(_e,o),ge(xe,s),ge(be,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?BR(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=BR(o),s=$R(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}ee(be),ge(be,s)}function Se(){ee(be),ee(xe),ee(_e)}function Xe(s){s.memoizedState!==null&&ge(Te,s);var o=be.current,a=$R(o,s.type);o!==a&&(ge(xe,s),ge(be,a))}function _t(s){xe.current===s&&(ee(be),ee(xe)),Te.current===s&&(ee(Te),Yu._currentValue=J)}var me,Ee;function we(s){if(me===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);me=o&&o[1]||"",Ee=-1r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(i){if(i.ep)return;i.ep=!0;const c=n(i);fetch(i.href,c)}})();var gRe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yRe(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var O0={exports:{}},ef={};var hC;function O$(){if(hC)return ef;hC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,c){var l=null;if(c!==void 0&&(l=""+c),i.key!==void 0&&(l=""+i.key),"key"in i){c={};for(var f in i)f!=="key"&&(c[f]=i[f])}else c=i;return i=c.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:c}}return ef.Fragment=t,ef.jsx=n,ef.jsxs=n,ef}var pC;function M$(){return pC||(pC=1,O0.exports=O$()),O0.exports}var N=M$(),dm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},D$={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},k$=class{#e=D$;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Gb=new k$;function P$(e){setTimeout(e,0)}var hm=typeof window>"u"||"Deno"in globalThis;function Nr(){}function N$(e,t){return typeof e=="function"?e(t):e}function L$(e){return typeof e=="number"&&e>=0&&e!==1/0}function z$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zb(e,t){return typeof e=="function"?e(t):e}function B$(e,t){return typeof e=="function"?e(t):e}function mC(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:c,queryKey:l,stale:f}=e;if(l){if(r){if(t.queryHash!==Pv(l,t.options))return!1}else if(!Of(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||i&&i!==t.state.fetchStatus||c&&!c(t))}function gC(e,t){const{exact:n,status:r,predicate:i,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(n){if(If(t.options.mutationKey)!==If(c))return!1}else if(!Of(t.options.mutationKey,c))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Pv(e,t){return(t?.queryKeyHashFn||If)(e)}function If(e){return JSON.stringify(e,(t,n)=>Kb(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Of(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Of(e[n],t[n])):!1}var $$=Object.prototype.hasOwnProperty;function I2(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=yC(e)&&yC(t);if(!r&&!(Kb(e)&&Kb(t)))return t;const c=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),f=l.length,d=r?new Array(f):{};let h=0;for(let b=0;b{Gb.setTimeout(t,e)})}function j$(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?I2(e,t):t}function H$(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function V$(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Nv=Symbol();function O2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Nv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function vRe(e,t){return typeof e=="function"?e(...t):!!e}function q$(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var F$=class extends dm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!hm&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},M2=new F$;function G$(){let e,t;const n=new Promise((i,c)=>{e=i,t=c});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Z$=P$;function K$(){let e=[],t=0,n=f=>{f()},r=f=>{f()},i=Z$;const c=f=>{t?e.push(f):i(()=>{n(f)})},l=()=>{const f=e;e=[],f.length&&i(()=>{r(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||l()}return d},batchCalls:f=>(...d)=>{c(()=>{f(...d)})},schedule:c,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:f=>{i=f}}}var cs=K$(),Q$=class extends dm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!hm&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Cp=new Q$;function Y$(e){return Math.min(1e3*2**e,3e4)}function D2(e){return(e??"online")==="online"?Cp.isOnline():!0}var Qb=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function k2(e){let t=!1,n=0,r;const i=G$(),c=()=>i.status!=="pending",l=E=>{if(!c()){const R=new Qb(E);v(R),e.onCancel?.(R)}},f=()=>{t=!0},d=()=>{t=!1},h=()=>M2.isFocused()&&(e.networkMode==="always"||Cp.isOnline())&&e.canRun(),b=()=>D2(e.networkMode)&&e.canRun(),g=E=>{c()||(r?.(),i.resolve(E))},v=E=>{c()||(r?.(),i.reject(E))},_=()=>new Promise(E=>{r=R=>{(c()||h())&&E(R)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),w=()=>{if(c())return;let E;const R=n===0?e.initialPromise:void 0;try{E=R??e.fn()}catch(C){E=Promise.reject(C)}Promise.resolve(E).then(g).catch(C=>{if(c())return;const I=e.retry??(hm?0:3),k=e.retryDelay??Y$,T=typeof k=="function"?k(n,C):k,$=I===!0||typeof I=="number"&&nh()?void 0:_()).then(()=>{t?v(C):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:f,continueRetry:d,canStart:b,start:()=>(b()?w():_().then(w),i)}}var P2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),L$(this.gcTime)&&(this.#e=Gb.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Gb.clearTimeout(this.#e),this.#e=void 0)}},X$=class extends P2{#e;#n;#t;#r;#s;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#t=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=SC(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=SC(this.options);t.data!==void 0&&(this.setState(vC(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=j$(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(Nr).catch(Nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>B$(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zb(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!z$(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,r=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const f=O2(this.options,t),h=(()=>{const b={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(b),b})();return this.#a=!1,this.options.persister?this.options.persister(f,h,this):f(h)},l=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(f),f})();this.options.behavior?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta}),this.#s=k2({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof Qb&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#t.config.onSuccess?.(f,this),this.#t.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof Qb){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#t.config.onError?.(f,this),this.#t.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...W$(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...vC(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),cs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function W$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function SC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function _C(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const h=async()=>{let b=!1;const g=w=>{q$(w,()=>t.signal,()=>b=!0)},v=O2(t.options,t.fetchOptions),_=async(w,E,R)=>{if(b)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const I=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:E,direction:R?"backward":"forward",meta:t.options.meta};return g(j),j})(),k=await v(I),{maxPages:T}=t.options,$=R?V$:H$;return{pages:$(w.pages,k,T),pageParams:$(w.pageParams,E,T)}};if(i&&c.length){const w=i==="backward",E=w?J$:wC,R={pages:c,pageParams:l},C=E(r,R);f=await _(R,C,w)}else{const w=e??c.length;do{const E=d===0?l[0]??r.initialPageParam:wC(r,f);if(d>0&&E==null)break;f=await _(f,E),d++}while(dt.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function wC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function J$(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var e6=class extends P2{#e;#n;#t;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||t6(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=k2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(c,l)=>{this.#s({type:"failed",failureCount:c,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#s({type:"pending",variables:e,isPaused:i}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#s({type:"pending",context:l,variables:e,isPaused:i})}const c=await this.#r.start();return await this.#t.config.onSuccess?.(c,e,this.state.context,this,n),await this.options.onSuccess?.(c,e,this.state.context,n),await this.#t.config.onSettled?.(c,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(c,null,e,this.state.context,n),this.#s({type:"success",data:c}),c}catch(c){try{await this.#t.config.onError?.(c,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(c,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#t.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#s({type:"error",error:c}),c}finally{this.#t.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),cs.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function t6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var n6=class extends dm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new e6({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Vh(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Vh(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Vh(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Vh(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){cs.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>gC(t,n))}findAll(e={}){return this.getAll().filter(t=>gC(e,t))}notify(e){cs.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return cs.batch(()=>Promise.all(e.map(t=>t.continue().catch(Nr))))}};function Vh(e){return e.options.scope?.id}var s6=class extends dm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Pv(r,t);let c=this.get(i);return c||(c=new X$({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){cs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>mC(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>mC(e,n)):t}notify(e){cs.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},r6=class{#e;#n;#t;#r;#s;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new s6,this.#n=e.mutationCache||new n6,this.#t=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=M2.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Cp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zb(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(r.queryHash)?.state.data,l=N$(t,c);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return cs.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;cs.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return cs.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=cs.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nr).catch(Nr)}invalidateQueries(e,t={}){return cs.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=cs.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let c=i.fetch(void 0,n);return n.throwOnError||(c=c.catch(Nr)),i.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(r).then(Nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Zb(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nr).catch(Nr)}fetchInfiniteQuery(e){return e.behavior=_C(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nr).catch(Nr)}ensureInfiniteQueryData(e){return e.behavior=_C(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Cp.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#r.set(If(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Of(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(If(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Of(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Pv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Nv&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},M0={exports:{}},Ze={};var EC;function o6(){if(EC)return Ze;EC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function _(z){return z===null||typeof z!="object"?null:(z=v&&z[v]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function C(z,ee,ye){this.props=z,this.context=ee,this.refs=R,this.updater=ye||w}C.prototype.isReactComponent={},C.prototype.setState=function(z,ee){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,ee,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function I(){}I.prototype=C.prototype;function k(z,ee,ye){this.props=z,this.context=ee,this.refs=R,this.updater=ye||w}var T=k.prototype=new I;T.constructor=k,E(T,C.prototype),T.isPureReactComponent=!0;var $=Array.isArray;function j(){}var H={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function Q(z,ee,ye){var we=ye.ref;return{$$typeof:e,type:z,key:ee,ref:we!==void 0?we:null,props:ye}}function ne(z,ee){return Q(z.type,ee,z.props)}function te(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function F(z){var ee={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ye){return ee[ye]})}var oe=/\/+/g;function me(z,ee){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):ee.toString(36)}function ge(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(j,j):(z.status="pending",z.then(function(ee){z.status==="pending"&&(z.status="fulfilled",z.value=ee)},function(ee){z.status==="pending"&&(z.status="rejected",z.reason=ee)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function V(z,ee,ye,we,Ee){var Se=typeof z;(Se==="undefined"||Se==="boolean")&&(z=null);var Ie=!1;if(z===null)Ie=!0;else switch(Se){case"bigint":case"string":case"number":Ie=!0;break;case"object":switch(z.$$typeof){case e:case t:Ie=!0;break;case b:return Ie=z._init,V(Ie(z._payload),ee,ye,we,Ee)}}if(Ie)return Ee=Ee(z),Ie=we===""?"."+me(z,0):we,$(Ee)?(ye="",Ie!=null&&(ye=Ie.replace(oe,"$&/")+"/"),V(Ee,ee,ye,"",function(Je){return Je})):Ee!=null&&(te(Ee)&&(Ee=ne(Ee,ye+(Ee.key==null||z&&z.key===Ee.key?"":(""+Ee.key).replace(oe,"$&/")+"/")+Ie)),ee.push(Ee)),1;Ie=0;var qe=we===""?".":we+":";if($(z))for(var ve=0;ve{const t=M.useContext(N2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i6=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),N.jsx(N2.Provider,{value:e,children:t}));var Yt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Yt||{});function z2({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:c,checkDirty:l,shallowPropagate:f};function r(h,b,g){const v=b.depsTail;if(v!==void 0&&v.dep===h)return;const _=v!==void 0?v.nextDep:b.deps;if(_!==void 0&&_.dep===h){_.version=g,b.depsTail=_;return}const w=h.subsTail;if(w!==void 0&&w.version===g&&w.sub===b)return;const E=b.depsTail=h.subsTail={version:g,dep:h,sub:b,prevDep:v,nextDep:_,prevSub:w,nextSub:void 0};_!==void 0&&(_.prevDep=E),v!==void 0?v.nextDep=E:b.deps=E,w!==void 0?w.nextSub=E:h.subs=E}function i(h,b=h.sub){const g=h.dep,v=h.prevDep,_=h.nextDep,w=h.nextSub,E=h.prevSub;return _!==void 0?_.prevDep=v:b.depsTail=v,v!==void 0?v.nextDep=_:b.deps=_,w!==void 0?w.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=w:(g.subs=w)===void 0&&n(g),_}function c(h){let b=h.nextSub,g;e:do{const v=h.sub;let _=v.flags;if(_&60?_&12?_&4?!(_&48)&&d(h,v)?(v.flags=_|40,_&=1):_=0:v.flags=_&-9|32:_=0:v.flags=_|32,_&2&&t(v),_&1){const w=v.subs;if(w!==void 0){const E=(h=w).nextSub;E!==void 0&&(g={value:b,prev:g},b=E);continue}}if((h=b)!==void 0){b=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){b=h.nextSub;continue e}break}while(!0)}function l(h,b){let g,v=0,_=!1;e:do{const w=h.dep,E=w.flags;if(b.flags&16)_=!0;else if((E&17)===17){if(e(w)){const R=w.subs;R.nextSub!==void 0&&f(R),_=!0}}else if((E&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=w.deps,b=w,++v;continue}if(!_){const R=h.nextDep;if(R!==void 0){h=R;continue}}for(;v--;){const R=b.subs,C=R.nextSub!==void 0;if(C?(h=g.value,g=g.prev):h=R,_){if(e(b)){C&&f(R),b=h.sub;continue}_=!1}else b.flags&=-33;b=h.sub;const I=h.nextDep;if(I!==void 0){h=I;continue e}}return _}while(!0)}function f(h){do{const b=h.sub,g=b.flags;(g&48)===32&&(b.flags=g|16,(g&6)===2&&t(b))}while((h=h.nextSub)!==void 0)}function d(h,b){let g=b.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}let zv=0,Va=0,bf=0;const Po=[],{link:SRe,unlink:B2,propagate:_Re,checkDirty:a6,shallowPropagate:wRe}=z2({update(e){return e.depsTail!==void 0?f6(e):d6(e)},notify(e){let t=bf,n=t;do if(Po[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(bf=t;n<--t;){const r=Po[n];Po[n++]=Po[t],Po[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,pm(e)):m6.call(e)}});function c6(){return zv}function l6(){++zv}function u6(){--zv||p6()}function f6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,pm(e)}}function d6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function h6(e){const t=e.flags;if(t&16||t&32&&a6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,pm(e)}}else e.flags=2}function p6(){try{for(;Va0)){for(;qh{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(c){const l=Zr,f=Object.is;Zr=i,++pp,i.depsTail=void 0,n&&(i.flags=Yt.Mutable|Yt.RecursedCheck);try{const d=i._snapshot,h=typeof c=="function"?c(d):c===void 0&&n?r(d):c;return d===void 0||!f(d,h)?(i._snapshot=h,!0):!1}finally{Zr=l,n&&(i.flags&=~Yt.RecursedCheck),Ap(i)}}};return n?(i.flags=Yt.Mutable|Yt.Dirty,i.get=function(){const c=i.flags;if(c&Yt.Dirty||c&Yt.Pending&&$2(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&CC(l)}}else c&Yt.Pending&&(i.flags=c&~Yt.Pending);return Zr!==void 0&&RC(i,Zr,pp),i._snapshot}):i.set=function(c){if(i._update(c)){const l=i.subs;l!==void 0&&(y6(l),CC(l),U2())}},i}function b6(e){const t=()=>{const r=Zr;Zr=n,++pp,n.depsTail=void 0,n.flags=Yt.Watching|Yt.RecursedCheck;try{return e()}finally{Zr=r,n.flags&=~Yt.RecursedCheck,Ap(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Yt.Watching|Yt.RecursedCheck,notify(){const r=this.flags;r&Yt.Dirty||r&Yt.Pending&&$2(this.deps,this)?t():this.flags=Yt.Watching},stop(){this.flags=Yt.None,this.depsTail=void 0,Ap(this)}};return t(),n}let v6=class{constructor(t){this.atom=j2(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Bv(t))}};class S6{constructor(t){this.atom=j2(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Bv(t))}}function _6(e){return typeof e=="function"?new S6(e):new v6(e)}function w6(e){try{l6(),e()}finally{u6(),U2()}}const Yi="__TSR_index",AC="popstate",TC="beforeunload";function E6(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},c=async({task:l,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){l();return}const b=e.getBlockers?.()??[],g=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&b.length&&g)for(const v of b){const _=Tp(d.path,d.state);if(await v.blockerFn({currentLocation:t,nextLocation:_,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,f,d)=>{const h=t.state[Yi];f=IC(h+1,f),c({task:()=>{e.pushState(l,f),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const h=t.state[Yi];f=IC(h,f),c({task:()=>{e.replaceState(l,f),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:f})},go:(l,f)=>{c({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:f,type:"GO"})},back:l=>{c({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{c({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Yi]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function IC(e,t){t||(t={});const n=$v();return{...t,key:n,__TSR_key:n,[Yi]:e}}function x6(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const c=()=>i,l=P=>i=P,f=(P=>P),d=(()=>Tp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=$v();t.history.replaceState({[Yi]:0,key:P,__TSR_key:P},"")}let h=d(),b,g=!1,v=!1,_=!1,w=!1;const E=()=>h;let R,C;const I=()=>{R&&(H._ignoreSubscribers=!0,(R.isPush?t.history.pushState:t.history.replaceState)(R.state,"",R.href),H._ignoreSubscribers=!1,R=void 0,C=void 0,b=void 0)},k=(P,Q,ne)=>{const te=f(Q);C||(b=h),h=Tp(Q,ne),R={href:te,state:ne,isPush:R?.isPush||P==="push"},C||(C=Promise.resolve().then(()=>I()))},T=P=>{h=d(),H.notify({type:P})},$=async()=>{if(v){v=!1;return}const P=d(),Q=P.state[Yi]-h.state[Yi],ne=Q===1,te=Q===-1,F=!ne&&!te||g;g=!1;const oe=F?"GO":te?"BACK":"FORWARD",me=F?{type:"GO",index:Q}:{type:te?"BACK":"FORWARD"};if(_)_=!1;else{const ge=c();if(typeof document<"u"&&ge.length){for(const V of ge)if(await V.blockerFn({currentLocation:h,nextLocation:P,action:oe})){v=!0,t.history.go(1),H.notify(me);return}}}h=d(),H.notify(me)},j=P=>{if(w){w=!1;return}let Q=!1;const ne=c();if(typeof document<"u"&&ne.length)for(const te of ne){const F=te.enableBeforeUnload??!0;if(F===!0){Q=!0;break}if(typeof F=="function"&&F()===!0){Q=!0;break}}if(Q)return P.preventDefault(),P.returnValue=""},H=E6({getLocation:E,getLength:()=>t.history.length,pushState:(P,Q)=>k("push",P,Q),replaceState:(P,Q)=>k("replace",P,Q),back:P=>(P&&(_=!0),w=!0,t.history.back()),forward:P=>{P&&(_=!0),w=!0,t.history.forward()},go:P=>{g=!0,t.history.go(P)},createHref:P=>f(P),flush:I,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(TC,j,{capture:!0}),t.removeEventListener(AC,$)},onBlocked:()=>{b&&h!==b&&(h=b)},getBlockers:c,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(TC,j,{capture:!0}),t.addEventListener(AC,$),t.history.pushState=function(...P){const Q=n.apply(t.history,P);return H._ignoreSubscribers||T("PUSH"),Q},t.history.replaceState=function(...P){const Q=r.apply(t.history,P);return H._ignoreSubscribers||T("REPLACE"),Q},H}function R6(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Tp(e,t){const n=R6(e),r=n.indexOf("#"),i=n.indexOf("?"),c=$v();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[Yi]:0,key:c,__TSR_key:c}}}function $v(){return(Math.random()+1).toString(36).substring(7)}const C6=!1;function vf(e){let t;return w6(()=>{t=e()}),t}function Mf(e){return e[e.length-1]}function A6(e){return typeof e=="function"}function Fi(e,t){return A6(e)?e(t):e}const T6=Object.prototype.hasOwnProperty,OC=Object.prototype.propertyIsEnumerable;function Bs(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,i=kC(e)&&kC(r);if(!i&&!(Ip(e)&&Ip(r)))return r;const c=i?e:MC(e);if(!c)return r;const l=i?r:MC(r);if(!l)return r;const f=c.length,d=l.length,h=i?new Array(d):{};let b=0;for(let g=0;g"u")return!0;const n=t.prototype;return!(!DC(n)||!n.hasOwnProperty("isPrototypeOf"))}function DC(e){return Object.prototype.toString.call(e)==="[object Object]"}function kC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xa(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;ri||!Xa(e[l],t[l],n)))return!1;return i===c}return!1}function Al(e){let t,n;const r=new Promise((i,c)=>{t=i,n=c});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function I6(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function bl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function O6(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function PC(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return O6(t)}const M6=["http:","https:","mailto:","tel:"];function Op(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}const D6={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},k6=/[&><\u2028\u2029]/g;function P6(e){return e.replace(k6,t=>D6[t])}function tf(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=PC(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+PC(n?e.slice(n):e);let c=!1;return r.startsWith("//")&&(c=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:c}}function N6(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var L6="Invariant failed";function Bo(e,t){if(!e)throw new Error(L6)}function Mp(e){const t=new Map;let n,r;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,r&&(r.next=c,c.prev=r)):(c.next.prev=void 0,n=c.next,c.next=void 0,r&&(c.prev=r,r.next=c)),r=c)};return{get(c){const l=t.get(c);if(l)return i(l),l.value},set(c,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const f=t.get(c);if(f)f.value=l,i(f);else{const d={key:c,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(c,d)}},clear(){t.clear(),n=void 0,r=void 0}}}const Tl=0,nc=1,sc=2,Df=3,Za=4,H2=5;function z6(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Uv(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,c=e.substring(t,i);if(!c||!c.includes("$"))return n[0]=Tl,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(c==="$"){const f=e.length;return n[0]=sc,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(c.charCodeAt(0)===36)return n[0]=nc,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=z6(c);if(l){const[f,d]=l,h=c.charCodeAt(f+1);if(h===45){if(f+2!P.skipOnParamError&&P.caseSensitive===T&&P.prefix===$&&P.suffix===j);if(H)w=H;else{const P=k0(nc,n.fullPath??n.from,T,$,j);w=P,P.depth=c,P.parent=i,i.dynamic??=[],i.dynamic.push(P)}break}case Df:{const I=d.substring(E,_[1]),k=d.substring(_[4],R),T=b&&!!(I||k),$=I?T?I:I.toLowerCase():void 0,j=k?T?k:k.toLowerCase():void 0,H=!g&&i.optional?.find(P=>!P.skipOnParamError&&P.caseSensitive===T&&P.prefix===$&&P.suffix===j);if(H)w=H;else{const P=k0(Df,n.fullPath??n.from,T,$,j);w=P,P.parent=i,P.depth=c,i.optional??=[],i.optional.push(P)}break}case sc:{const I=d.substring(E,_[1]),k=d.substring(_[4],R),T=b&&!!(I||k),$=I?T?I:I.toLowerCase():void 0,j=k?T?k:k.toLowerCase():void 0,H=k0(sc,n.fullPath??n.from,T,$,j);w=H,H.parent=i,H.depth=c,i.wildcard??=[],i.wildcard.push(H)}}i=w}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const _=Ka(n.fullPath??n.from);_.kind=H2,_.parent=i,c++,_.depth=c,i.pathless??=[],i.pathless.push(_),i=_}const v=(n.path||!n.children)&&!n.isRoot;if(v&&d.endsWith("/")){const _=Ka(n.fullPath??n.from);_.kind=Za,_.parent=i,c++,_.depth=c,i.index=_,i=_}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,v&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)mm(e,t,d,f,i,c,l)}function D0(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qi(e){if(e.pathless)for(const t of e.pathless)qi(t);if(e.static)for(const t of e.static.values())qi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())qi(t);if(e.dynamic?.length){e.dynamic.sort(D0);for(const t of e.dynamic)qi(t)}if(e.optional?.length){e.optional.sort(D0);for(const t of e.optional)qi(t)}if(e.wildcard?.length){e.wildcard.sort(D0);for(const t of e.wildcard)qi(t)}}function Ka(e){return{kind:Tl,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function k0(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function B6(e,t){const n=Ka("/"),r=new Uint16Array(6);for(const i of e)mm(!1,r,i,1,n,0);qi(n),t.masksTree=n,t.flatCache=Mp(1e3)}function $6(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=jv(e,t.masksTree);return t.flatCache.set(e,r),r}function U6(e,t,n,r,i){e||="/",r||="/";const c=t?`case\0${e}`:e;let l=i.singleCache.get(c);if(!l){l=Ka("/");const f=new Uint16Array(6);mm(t,f,{from:e},1,l,0),i.singleCache.set(c,l)}return jv(r,l,n)}function j6(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let c;try{c=jv(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)c=null;else throw l}return c&&(c.branch=q6(c.route)),t.matchCache.set(r,c),c}function H6(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function V6(e,t=!1,n){const r=Ka(e.fullPath),i=new Uint16Array(6),c={},l={};let f=0;return mm(t,i,e,1,r,0,h=>{if(n?.(h,f),Bo(!(h.id in c),`Duplicate routes found with id: ${String(h.id)}`),c[h.id]=h,f!==0&&h.path){const b=H6(h.fullPath);(!l[b]||h.fullPath.endsWith("/"))&&(l[b]=h)}f++}),qi(r),{processedTree:{segmentTree:r,singleCache:Mp(1e3),matchCache:Mp(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:l}}function jv(e,t,n=!1){const r=e.split("/"),i=G6(e,r,t,n);if(!i)return null;const[c]=V2(e,r,i);return{route:i.node.route,rawParams:c,parsedParams:i.parsedParams}}function V2(e,t,n){const r=F6(n.node);let i=null;const c={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,h=n.extract?.segment??0;for(;f=0;te--){const F=v.optional[te];f.push({node:F,index:_,skipped:Q,depth:ne,statics:R,dynamics:C,optionals:I,extract:k,rawParams:T,parsedParams:$})}if(!j)for(let te=v.optional.length-1;te>=0;te--){const F=v.optional[te],{prefix:oe,suffix:me}=F;if(oe||me){const ge=F.caseSensitive?H:P??=H.toLowerCase();if(oe&&!ge.startsWith(oe)||me&&!ge.endsWith(me))continue}f.push({node:F,index:_+1,skipped:w,depth:ne,statics:R,dynamics:C,optionals:I+1,extract:k,rawParams:T,parsedParams:$})}}if(!j&&v.dynamic&&H)for(let Q=v.dynamic.length-1;Q>=0;Q--){const ne=v.dynamic[Q],{prefix:te,suffix:F}=ne;if(te||F){const oe=ne.caseSensitive?H:P??=H.toLowerCase();if(te&&!oe.startsWith(te)||F&&!oe.endsWith(F))continue}f.push({node:ne,index:_+1,skipped:w,depth:E+1,statics:R,dynamics:C+1,optionals:I,extract:k,rawParams:T,parsedParams:$})}if(!j&&v.staticInsensitive){const Q=v.staticInsensitive.get(P??=H.toLowerCase());Q&&f.push({node:Q,index:_+1,skipped:w,depth:E+1,statics:R+1,dynamics:C,optionals:I,extract:k,rawParams:T,parsedParams:$})}if(!j&&v.static){const Q=v.static.get(H);Q&&f.push({node:Q,index:_+1,skipped:w,depth:E+1,statics:R+1,dynamics:C,optionals:I,extract:k,rawParams:T,parsedParams:$})}if(v.pathless){const Q=E+1;for(let ne=v.pathless.length-1;ne>=0;ne--){const te=v.pathless[ne];f.push({node:te,index:_,skipped:w,depth:Q,statics:R,dynamics:C,optionals:I,extract:k,rawParams:T,parsedParams:$})}}}if(b&&d)return nf(d,b)?b:d;if(b)return b;if(d)return d;if(r&&h){let g=h.index;for(let _=0;_e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Za)>(e.node.kind===Za)||t.node.kind===Za==(e.node.kind===Za)&&t.depth>e.depth))):!0}function mp(e){return Hv(e.filter(t=>t!==void 0).join("/"))}function Hv(e){return e.replace(/\/{2,}/g,"/")}function q2(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Xi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function F2(e){return Xi(q2(e))}function Dp(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Z6(e,t,n){return Dp(e,n)===Dp(t,n)}function K6({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),c=!i&&t===".";let l;if(r){l=i?t:c?e:e+"\0"+t;const g=r.get(l);if(g)return g}let f;if(c)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&Mf(f)==="";)f.pop();const g=t.split("/");for(let v=0,_=g.length;v<_;v++){const w=g[v];w===""?v?v===_-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Mf(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,h="";for(let g=0;g0&&(h+="/");const v=f[g];if(!v)continue;d=Uv(v,0,d);const _=d[0];if(_===Tl){h+=v;continue}const w=d[5],E=v.substring(0,d[1]),R=v.substring(d[4],w),C=v.substring(d[2],d[3]);_===nc?h+=E||R?`${E}{$${C}}${R}`:`$${C}`:_===sc?h+=E||R?`${E}{$}${R}`:"$":h+=`${E}{-$${C}}${R}`}h=Hv(h);const b=h||"/";return l&&r&&r.set(l,b),b}function Q6(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,c=>t.get(c)??c)}function N0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>LC(i,n)).join("/"):LC(r,n)}function NC({path:e,params:t,decoder:n,...r}){let i=!1;const c={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const l=e.length;let f=0,d,h="";for(;f{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function W6(){const e=Y6();if(!e)return null;const t=e.getItem(Wb);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Fi(r,n)||n;try{e.setItem(Wb,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Fh=W6(),J6=e=>e.state.__TSR_key||e.href;function eU(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let kp=!1;function tU({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:c}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const f=t||window.history.state?.__TSR_key,d=l[f];kp=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const g in d){const v=d[g];if(g==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(g){const _=document.querySelector(g);_&&(_.scrollLeft=v.scrollX,_.scrollTop=v.scrollY)}}break e}const h=(c??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const v=document.getElementById(h);v&&v.scrollIntoView(g)}break e}const b={top:0,left:0,behavior:n};if(window.scrollTo(b),i)for(const g of i){if(g==="window")continue;const v=typeof g=="function"?g():document.querySelector(g);v&&v.scrollTo(b)}}kp=!1}function nU(e,t){if(!Fh||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Fh))return;e.isScrollRestorationSetup=!0,kp=!1;const r=e.options.getScrollRestorationKey||J6;window.history.scrollRestoration="manual";const i=c=>{if(kp||!e.isScrollRestoring)return;let l="";if(c.target===document||c.target===window)l="window";else{const d=c.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=eU(c.target)}const f=r(e.state.location);Fh.set(d=>{const h=d[f]||={},b=h[l]||={};if(l==="window")b.scrollX=window.scrollX||0,b.scrollY=window.scrollY||0;else if(l){const g=document.querySelector(l);g&&(b.scrollX=g.scrollLeft||0,b.scrollY=g.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",X6(i,100),!0),e.subscribe("onRendered",c=>{const l=r(c.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(tU({storageKey:Wb,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Fh.set(f=>(f[l]||={},f)))})}function sU(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function rU(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function L0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function oU(e){const t=new URLSearchParams(e),n={};for(const[r,i]of t.entries()){const c=n[r];c==null?n[r]=L0(i):Array.isArray(c)?c.push(L0(i)):n[r]=[c,L0(i)]}return n}const iU=cU(JSON.parse),aU=lU(JSON.stringify,JSON.parse);function cU(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=oU(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function lU(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const c=rU(i,r);return c?`?${c}`:""}}const mr="__root__";function Vv(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function br(e){return e instanceof Response&&!!e.options}const gp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},gm=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),vl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let c=0;c<=i;c++){const l=e.matches[c];if(!l)continue;const f=e.router.getMatch(l.id);f&&Object.assign(r,f.__routeContext,f.__beforeLoadContext)}return r},G2=(e,t,n)=>{const r=e.router.routesById[t.routeId??""]??e.router.routeTree;!r.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(r.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const i=n==="BEFORE_LOAD"&&r.parentRoute;i||Bo(r.options.notFoundComponent);const c=e.matches.find(l=>l.routeId===r.id);Bo(c,"Could not find match for route: "+r.id),e.updateMatch(c.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=r.parentRoute.id,G2(e,t,n))},Gi=(e,t,n,r)=>{if(!(!br(n)&&!qs(n))){if(br(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const i=br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,c=>({...c,status:i,context:vl(e,t.index),isFetching:!1,error:n})),qs(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(G2(e,n,r),n)}},Z2=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,sf=(e,t,n,r)=>{const{id:i,routeId:c}=e.matches[t],l=e.router.looseRoutesById[c];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Gi(e,e.router.getMatch(i),n,r);try{l.options.onError?.(n)}catch(f){n=f,Gi(e,e.router.getMatch(i),n,r)}e.updateMatch(i,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},K2=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!gm(e,t)&&(n.options.loader||n.options.beforeLoad||X2(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{gp(e)},i);r._nonReactive.pendingTimeout=l}},uU=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;K2(e,t,n,r);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Gi(e,c,c.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},fU=(e,t,n,r)=>{const i=e.router.getMatch(t),c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Al(()=>{c?.resolve()});const{paramsError:l,searchError:f}=i;l&&sf(e,n,l,"PARSE_PARAMS"),f&&sf(e,n,f,"VALIDATE_SEARCH"),K2(e,t,r,i);const d=new AbortController;let h=!1;const b=()=>{h||(h=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:d})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){vf(()=>{b(),g()});return}i._nonReactive.beforeLoadPromise=Al();const v={...vl(e,n,!1),...i.__routeContext},{search:_,params:w,cause:E}=i,R=gm(e,t),C={search:_,abortController:d,params:w,preload:R,context:v,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:R?"preload":E,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},I=T=>{if(T===void 0){vf(()=>{b(),g()});return}(br(T)||qs(T))&&(b(),sf(e,n,T,"BEFORE_LOAD")),vf(()=>{b(),e.updateMatch(t,$=>({...$,__beforeLoadContext:T})),g()})};let k;try{if(k=r.options.beforeLoad(C),bl(k))return b(),k.catch(T=>{sf(e,n,T,"BEFORE_LOAD")}).then(I)}catch(T){b(),sf(e,n,T,"BEFORE_LOAD")}I(k)},dU=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],c=()=>f(),l=()=>fU(e,n,t,i),f=()=>{if(Z2(e,n))return;const d=uU(e,n,i);return bl(d)?d.then(l):l()};return c()},hU=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([c,l,f])=>{const d=c?.meta,h=c?.links,b=c?.scripts,g=c?.styles;return{meta:d,links:h,headScripts:b,headers:f,scripts:l,styles:g}})},Q2=(e,t,n,r)=>{const i=e.matchPromises[n-1],{params:c,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),h=vl(e,n),b=gm(e,t);return{params:c,deps:l,preload:!!b,parentMatchPromise:i,abortController:f,context:h,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:b?"preload":d,route:r,...e.router.options.additionalContext}},zC=async(e,t,n,r)=>{try{const i=e.router.getMatch(t);try{(!(C6??e.router.isServer)||i.ssr===!0)&&Y2(r);const c=r.options.loader?.(Q2(e,t,n,r)),l=r.options.loader&&bl(c);if((l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),r.options.loader){const h=l?await c:c;Gi(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,b=>({...b,loaderData:h}))}r._lazyPromise&&await r._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,context:vl(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let l=c;if(l?.name==="AbortError"){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:vl(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,qs(c)&&await r.options.notFoundComponent?.preload?.(),Gi(e,e.router.getMatch(t),c);try{r.options.onError?.(c)}catch(d){l=d,Gi(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:vl(e,n),status:"error",isFetching:!1}))}}catch(i){const c=e.router.getMatch(t);c&&(c._nonReactive.loaderPromise=void 0),Gi(e,c,i)}},pU=async(e,t)=>{async function n(b,g,v,_){const w=Date.now()-g.updatedAt,E=b?_.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:_.options.staleTime??e.router.options.defaultStaleTime??0,R=_.options.shouldReload,C=typeof R=="function"?R(Q2(e,r,t,_)):R,{status:I,invalid:k}=v;c=I==="success"&&(k||(C??w>E)),b&&_.options.preload===!1||(c&&!e.sync?(l=!0,(async()=>{try{await zC(e,r,t,_);const T=e.router.getMatch(r);T._nonReactive.loaderPromise?.resolve(),T._nonReactive.loadPromise?.resolve(),T._nonReactive.loaderPromise=void 0}catch(T){br(T)&&await e.router.navigate(T.options)}})()):(I!=="success"||c&&e.sync)&&await zC(e,r,t,_))}const{id:r,routeId:i}=e.matches[t];let c=!1,l=!1;const f=e.router.looseRoutesById[i];if(!Z2(e,r)){const b=e.router.getMatch(r),g=gm(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload)return b;await b._nonReactive.loaderPromise;const v=e.router.getMatch(r),_=v._nonReactive.error||v.error;_&&Gi(e,v,_),v.status==="pending"&&await n(g,b,v,f)}else{const v=g&&!e.router.state.matches.some(w=>w.id===r),_=e.router.getMatch(r);_._nonReactive.loaderPromise=Al(),v!==_.preload&&e.updateMatch(r,w=>({...w,preload:v})),await n(g,b,_,f)}}const d=e.router.getMatch(r);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:h,invalid:!1})),e.router.getMatch(r)):d};async function BC(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&gp(t);try{for(let f=0;ff.status==="rejected").map(f=>f.reason);let c;for(const f of i){if(br(f))throw f;!c&&qs(f)&&(c=f)}for(const f of t.matches){const{id:d,routeId:h}=f,b=t.router.looseRoutesById[h];try{const g=hU(t,d,b);if(g){const v=await g;t.updateMatch(d,_=>({..._,...v}))}}catch(g){console.error(`Error executing head for route ${h}:`,g)}}if(c)throw c;const l=gp(t);bl(l)&&await l}catch(n){if(qs(n)&&!t.preload){const r=gp(t);throw bl(r)&&await r,n}if(br(n))throw n}return t.matches}async function Y2(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of W2){const i=e.options[r]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function X2(e){for(const t of W2)if(e.options[t]?.preload)return!0;return!1}const W2=["component","errorComponent","pendingComponent","notFoundComponent"];function mU(e){return{input:({url:t})=>{for(const n of e)t=Jb(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=J2(e[n],t);return t}}}function gU(e){const t=F2(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),c=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const f=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return f===i?l.pathname="/":f.startsWith(c)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=mp(["/",t,l.pathname]),l)}}function Jb(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function J2(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Wa(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,i=t?.href!==n.href,c=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:i,hashChanged:c}}function yU(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class bU{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,i=this.basepath??r?.basepath??"/",c=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Q6(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=x6()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let v;this.resolvePathCache=Mp(1e3),v=this.buildRouteTree(),this.setRoutes(v)}!this.__store&&this.latestLocation&&(this.__store=_6(SU(this.latestLocation)),nU(this));let f=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(c||i!==d||l!==h){this.basepath=d;const v=[],_=F2(d);_&&_!=="/"&&v.push(gU({basepath:d})),h&&v.push(h),this.rewrite=v.length===0?void 0:v.length===1?v[0]:mU(v),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&this.__store.setState(v=>({...v,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=V6(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&B6(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:d,search:h,hash:b,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const I=this.options.parseSearch(h),k=this.options.stringifySearch(I);return{href:d+k+b,publicHref:g,pathname:tf(d).path,external:!1,searchStr:k,search:Bs(r?.search,I),hash:tf(b.slice(1)).path,state:Bs(r?.state,v)}}const _=new URL(g,this.origin),w=Jb(this.rewrite,_),E=this.options.parseSearch(w.search),R=this.options.stringifySearch(E);return w.search=R,{href:w.href.replace(w.origin,""),publicHref:g,pathname:tf(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:R,search:Bs(r?.search,E),hash:tf(w.hash.slice(1)).path,state:Bs(r?.state,v)}},c=i(n),{__tempLocation:l,__tempKey:f}=c.state;if(l&&(!f||f===this.tempLocationKey)){const d=i(l);return d.state.key=c.state.key,d.state.__TSR_key=c.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:c}}return c},this.resolvePathWithBase=(n,r)=>K6({base:n,to:Hv(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>_U({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(c=>c.status==="pending"),r=this.state.matches.filter(c=>c.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(c=>{this.cancelMatch(c.id)})},this.buildLocation=n=>{const r=(c={})=>{const l=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(l);c.from;const d=c.unsafeRelative==="path"?l.pathname:c.from??f.fullPath,h=this.resolvePathWithBase(d,"."),b=f.search,g={...f.params},v=c.to?this.resolvePathWithBase(h,`${c.to}`):this.resolvePathWithBase(h,"."),_=c.params===!1||c.params===null?{}:(c.params??!0)===!0?g:Object.assign(g,Fi(c.params,g)),w=this.getMatchedRoutes(v);let E=w.matchedRoutes;if((!w.foundRoute||w.foundRoute.path!=="/"&&w.routeParams["**"])&&this.options.notFoundRoute&&(E=[...E,this.options.notFoundRoute]),Object.keys(_).length>0)for(const te of E){const F=te.options.params?.stringify??te.options.stringifyParams;if(F)try{Object.assign(_,F(_))}catch{}}const C=n.leaveParams?v:tf(NC({path:v,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let I=b;if(n._includeValidateSearch&&this.options.search?.strict){const te={};E.forEach(F=>{if(F.options.validateSearch)try{Object.assign(te,yp(F.options.validateSearch,{...te,...I}))}catch{}}),I=te}I=wU({search:I,dest:c,destRoutes:E,_includeValidateSearch:n._includeValidateSearch}),I=Bs(b,I);const k=this.options.stringifySearch(I),T=c.hash===!0?l.hash:c.hash?Fi(c.hash,l.hash):void 0,$=T?`#${T}`:"";let j=c.state===!0?l.state:c.state?Fi(c.state,l.state):{};j=Bs(l.state,j);const H=`${C}${k}${$}`;let P,Q,ne=!1;if(this.rewrite){const te=new URL(H,this.origin),F=J2(this.rewrite,te);P=te.href.replace(te.origin,""),F.origin!==this.origin?(Q=F.href,ne=!0):Q=F.pathname+F.search+F.hash}else P=N6(H),Q=P;return{publicHref:Q,href:P,pathname:C,search:I,searchStr:k,state:j,hash:T??"",external:ne,unmaskOnReload:c.unmaskOnReload}},i=(c={},l)=>{const f=r(c);let d=l?r(l):void 0;if(!d){const h={};if(this.options.routeMasks){const b=$6(f.pathname,this.processedTree);if(b){Object.assign(h,b.rawParams);const{from:g,params:v,..._}=b.route,w=v===!1||v===null?{}:(v??!0)===!0?h:Object.assign(h,Fi(v,h));l={from:n.from,..._,params:w},d=r(l)}}}return d&&(f.maskedLocation=d),f};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{const c=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(b=>{i.state[b]=this.latestLocation.state[b]});const h=Xa(i.state,this.latestLocation.state);return d.forEach(b=>{delete i.state[b]}),h},l=Xi(this.latestLocation.href)===Xi(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Al(()=>{f?.resolve()}),l&&c())this.load();else{let{maskedLocation:d,hashScrollIntoView:h,...b}=i;d&&(b={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...b,search:b.searchStr,state:{...b.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(b.unmaskOnReload??this.options.unmaskOnReload??!1)&&(b.state.__tempKey=this.tempLocationKey)),b.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](b.publicHref,b.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:l,href:f,...d}={})=>{if(f){const g=this.history.location.state.__TSR_index,v=Tp(f,{__TSR_index:n?g:g+1}),_=new URL(v.pathname,this.origin),w=Jb(this.rewrite,_);d.to=w.pathname,d.search=this.options.parseSearch(v.search),d.hash=v.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const b=this.commitLocation({...h,viewTransition:c,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),b},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:c,...l})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!r&&(r=!0),r){if(n!==void 0||!i){const h=this.buildLocation({to:n,...l});i=i??h.publicHref,c=c??h.publicHref}const d=!f&&c?c:i;if(Op(d,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const b=this.history.getBlockers?.()??[];for(const g of b)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(i=>!n.some(c=>c.id===i.id))}))},this.load=async n=>{let r,i,c;for(c=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Wa({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...Wa({resolvedLocation:h,location:d})}),await BC({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=[],g=[],v=[],_=[];vf(()=>{this.__store.setState(w=>{const E=w.matches,R=w.pendingMatches||w.matches;return b=E.filter(C=>!R.some(I=>I.id===C.id)),g=E.filter(C=>!R.some(I=>I.routeId===C.routeId)),v=R.filter(C=>!E.some(I=>I.routeId===C.routeId)),_=R.filter(C=>E.some(I=>I.routeId===C.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:R,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...b.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[v,"onEnter"],[_,"onStay"]].forEach(([w,E])=>{w.forEach(R=>{this.looseRoutesById[R.routeId].options[E]?.(R)})})})})}})}catch(d){br(d)?(r=d,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):qs(d)&&(i=d),this.__store.setState(h=>({...h,statusCode:r?r.status:i?404:h.matches.some(b=>b.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===c&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=c,await c;this.latestLoadPromise&&c!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(f=>f.status==="error")&&(l=500),l!==void 0&&this.__store.setState(f=>({...f,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,l=this.state.resolvedLocation,f=typeof r.types=="function"?r.types(Wa({resolvedLocation:l,location:c})):r.types;if(f===!1){n();return}i={update:n,types:f}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(c=>c.id===n)?"pendingMatches":this.state.matches.some(c=>c.id===n)?"matches":this.state.cachedMatches.some(c=>c.id===n)?"cachedMatches":"";i&&(i==="cachedMatches"?this.__store.setState(c=>({...c,cachedMatches:yU(c.cachedMatches.map(l=>l.id===n?r(l):l))})):this.__store.setState(c=>({...c,[i]:c[i]?.map(l=>l.id===n?r(l):l)})))})},this.getMatch=n=>{const r=i=>i.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(r),cachedMatches:i.cachedMatches.map(r),pendingMatches:i.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),c=this.getParsedLocationHref(i);n.options.href=c,n.headers.set("Location",c)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;n.options.href=c,n.headers.set("Location",c)}}catch{}if(n.options.href&&!n.options._builtLocation&&Op(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(c=>!r(c))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!0;const c=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=c};this.clearCache({filter:n})},this.loadRouteChunk=Y2,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const c=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),l=new Set([...c,...this.state.cachedMatches.map(f=>f.id)]);vf(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await BC({router:this,matches:i,location:r,preload:!0,updateMatch:(f,d)=>{c.has(f)?i=i.map(h=>h.id===f?d(h):h):this.updateMatch(f,d)}}),i}catch(f){if(br(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:r});qs(f)||console.error(f);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},c=this.buildLocation(i);if(r?.pending&&this.state.status!=="pending")return!1;const f=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=U6(c.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!Xa(d.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Xa(f.search,c.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??aU,parseSearch:t.parseSearch??iU,protocolAllowlist:t.protocolAllowlist??M6}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:c,parsedParams:l}=r;let{matchedRoutes:f}=r,d=!1;(i?i.path!=="/"&&c["**"]:Xi(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const h=d?xU(this.options.notFoundMode,f):void 0,b=new Array(f.length),g=new Map(this.state.matches.map(v=>[v.routeId,v]));for(let v=0;vthis.navigate({...T,_fromLocation:t}),buildLocation:this.buildLocation,cause:_.cause,abortController:_.abortController,preload:!!_.preload,matches:b,routeId:w.id};_.__routeContext=w.options.context(k)??void 0}_.context={...I,..._.__routeContext,..._.__beforeLoadContext}}}return b}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:i}=this.getMatchedRoutes(t.pathname),c=Mf(n),l={...t.search};for(const b of n)try{Object.assign(l,yp(b.options.validateSearch,l))}catch{}const f=Mf(this.state.matches),d=f&&f.routeId===c.id&&t.pathname===this.state.location.pathname;let h;if(d)h=f.params;else{const b={...r};for(const g of n)try{$C(g,r,i??{},b)}catch{}h=b}return{matchedRoutes:n,fullPath:c.fullPath,search:l,params:h}}}class Pp extends Error{}class vU extends Error{}function SU(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function yp(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Pp("Async validation not supported");if(n.issues)throw new Pp(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function _U({pathname:e,routesById:t,processedTree:n}){const r={},i=Xi(e);let c,l;const f=j6(i,n,!0);return f&&(c=f.route,Object.assign(r,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[mr]],routeParams:r,foundRoute:c,parsedParams:l}}function wU({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return EU(n)(e,t,r??!1)}function EU(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const c=({search:l,next:f})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((b,g)=>g(b),l));const h=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((b,g)=>g(b),h):h};t.middlewares.push(c)}if(i.options.validateSearch){const c=({search:l,next:f})=>{const d=f(l);if(!t._includeValidateSearch)return d;try{return{...d,...yp(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(c)}}const n=({search:i})=>{const c=t.dest;return c.search?c.search===!0?i:Fi(c.search,i):{}};t.middlewares.push(n);const r=(i,c,l)=>{if(i>=l.length)return c;const f=l[i];return f({search:c,next:h=>r(i+1,h,l)})};return function(c,l,f){return t.dest=l,t._includeValidateSearch=f,r(0,c,t.middlewares)}}function xU(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return mr}function $C(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const c in t)c in n&&(r[c]=n[c]);else{const c=i(r);Object.assign(r,c)}}const RU="Error preloading route! ā˜ļø";class eO{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,i=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=mr:this.parentRoute||Bo(!1);let c=i?mr:r?.path;c&&c!=="/"&&(c=q2(c));const l=r?.id||c;let f=i?mr:mp([this.parentRoute.id===mr?"":this.parentRoute.id,l]);c===mr&&(c="/"),f!==mr&&(f=mp(["/",f]));const d=f===mr?"/":mp([this.parentRoute.fullPath,c]);this._path=c,this._id=f,this._fullPath=d,this._to=Xi(d)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Vv({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class CU extends eO{constructor(t){super(t)}}const AU="use",UC=Lv[AU],Gh=typeof window<"u"?M.useLayoutEffect:M.useEffect;function z0(e){const t=M.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function TU(e,t,n={},r={}){M.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function IU(e){const t=M.useRef(null);return M.useImperativeHandle(e,()=>t.current,[]),t}function qv(e){const t=e.errorComponent??Fv;return N.jsx(OU,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?M.createElement(t,{error:n,reset:r}):e.children})}class OU extends M.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Fv({error:e}){const[t,n]=M.useState(!1);return N.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[N.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),N.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),N.jsx("div",{style:{height:".25rem"}}),t?N.jsx("div",{children:N.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?N.jsx("code",{children:e.message}):null})}):null]})}function MU({children:e,fallback:t=null}){return Gv()?N.jsx(Cl.Fragment,{children:e}):N.jsx(Cl.Fragment,{children:t})}function Gv(){return Cl.useSyncExternalStore(DU,()=>!0,()=>!1)}function DU(){return()=>{}}var B0={exports:{}},$0={},U0={exports:{}},j0={};var jC;function kU(){if(jC)return j0;jC=1;var e=zl();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue;function f(g,v){var _=v(),w=r({inst:{value:_,getSnapshot:v}}),E=w[0].inst,R=w[1];return c(function(){E.value=_,E.getSnapshot=v,d(E)&&R({inst:E})},[g,_,v]),i(function(){return d(E)&&R({inst:E}),g(function(){d(E)&&R({inst:E})})},[g]),l(_),_}function d(g){var v=g.getSnapshot;g=g.value;try{var _=v();return!n(g,_)}catch{return!0}}function h(g,v){return v()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return j0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,j0}var HC;function tO(){return HC||(HC=1,U0.exports=kU()),U0.exports}var VC;function PU(){if(VC)return $0;VC=1;var e=zl(),t=tO();function n(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,c=e.useRef,l=e.useEffect,f=e.useMemo,d=e.useDebugValue;return $0.useSyncExternalStoreWithSelector=function(h,b,g,v,_){var w=c(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function C(j){if(!I){if(I=!0,k=j,j=v(j),_!==void 0&&E.hasValue){var H=E.value;if(_(H,j))return T=H}return T=j}if(H=T,r(k,j))return H;var P=v(j);return _!==void 0&&_(H,P)?(k=j,H):(k=j,T=P)}var I=!1,k,T,$=g===void 0?null:g;return[function(){return C(b())},$===null?void 0:function(){return C($())}]},[b,g,v,_]);var R=i(h,w[0],w[1]);return l(function(){E.hasValue=!0,E.value=R},[R]),d(R),R},$0}var qC;function NU(){return qC||(qC=1,B0.exports=PU()),B0.exports}var nO=NU();function LU(e,t){return e===t}function zU(e,t,n=LU){const r=M.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=M.useCallback(()=>e?.get(),[e]);return nO.useSyncExternalStoreWithSelector(r,i,i,t,n)}const sO=M.createContext(null);function ns(e){const t=M.useContext(sO);return e?.warn,t}function Mn(e){const t=ns({warn:e?.router===void 0}),n=e?.router||t,r=M.useRef(void 0);return zU(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const c=Bs(r.current,e.select(i));return r.current=c,c}return e.select(i)}return i})}const ym=M.createContext(void 0),BU=M.createContext(void 0);function Wr(e){const t=M.useContext(e.from?BU:ym);return Mn({select:r=>{const i=r.matches.find(c=>e.from?e.from===c.routeId:c.id===t);if(Bo(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Zv(e){return Wr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Kv(e){const{select:t,...n}=e;return Wr({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Qv(e){return Wr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Yv(e){return Wr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function bm(e){const t=ns();return M.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var H0={exports:{}},Qn={};var FC;function $U(){if(FC)return Qn;FC=1;var e=zl();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),H0.exports=$U(),H0.exports}var na=rO();function UU(e,t){const n=ns(),r=IU(t),{activeProps:i,inactiveProps:c,activeOptions:l,to:f,preload:d,preloadDelay:h,hashScrollIntoView:b,replace:g,startTransition:v,resetScroll:_,viewTransition:w,children:E,target:R,disabled:C,style:I,className:k,onClick:T,onBlur:$,onFocus:j,onMouseEnter:H,onMouseLeave:P,onTouchStart:Q,ignoreBlocker:ne,params:te,search:F,hash:oe,state:me,mask:ge,reloadDocument:V,unsafeRelative:re,from:J,_fromLocation:be,...ue}=e,z=Gv(),ee=Mn({select:dt=>{const $t=dt.matches[dt.matches.length-1];return{search:$t?.search,hash:dt.location.hash,path:$t?.pathname}},structuralSharing:!0}),ye=e.from,we=M.useMemo(()=>({...e,from:ye}),[n,ee,ye,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Ee=M.useMemo(()=>n.buildLocation({...we}),[n,we]),Se=Ee.maskedLocation?Ee.maskedLocation.publicHref:Ee.publicHref,Ie=Ee.maskedLocation?Ee.maskedLocation.external:Ee.external,qe=M.useMemo(()=>GU(Se,Ie,n.history,C),[C,Ie,Se,n.history]),ve=M.useMemo(()=>{if(qe?.external)return Op(qe.href,n.protocolAllowlist)?void 0:qe.href;if(!ZU(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Op(f,n.protocolAllowlist)?void 0:f}catch{}},[f,qe,n.protocolAllowlist]),Je=Mn({select:dt=>{if(ve)return!1;if(l?.exact){if(!Z6(dt.location.pathname,Ee.pathname,n.basepath))return!1}else{const $t=Dp(dt.location.pathname,n.basepath),gt=Dp(Ee.pathname,n.basepath);if(!($t.startsWith(gt)&&($t.length===gt.length||$t[gt.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Xa(dt.location.search,Ee.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?z&&dt.location.hash===Ee.hash:!0}}),wt=Je?Fi(i,{})??jU:V0,pe=Je?V0:Fi(c,{})??V0,xe=[k,wt.className,pe.className].filter(Boolean).join(" "),_e=(I||wt.style||pe.style)&&{...I,...wt.style,...pe.style},[Ge,Oe]=M.useState(!1),He=M.useRef(!1),Me=e.reloadDocument||ve?!1:d??n.options.defaultPreload,ft=h??n.options.defaultPreloadDelay??0,mt=M.useCallback(()=>{n.preloadRoute({...we,_builtLocation:Ee}).catch(dt=>{console.warn(dt),console.warn(RU)})},[n,we,Ee]),Xe=M.useCallback(dt=>{dt?.isIntersecting&&mt()},[mt]);TU(r,Xe,FU,{disabled:!!C||Me!=="viewport"}),M.useEffect(()=>{He.current||!C&&Me==="render"&&(mt(),He.current=!0)},[C,mt,Me]);const Pt=dt=>{const $t=dt.currentTarget.getAttribute("target"),gt=R!==void 0?R:$t;if(!C&&!KU(dt)&&!dt.defaultPrevented&&(!gt||gt==="_self")&&dt.button===0){dt.preventDefault(),na.flushSync(()=>{Oe(!0)});const Os=n.subscribe("onResolved",()=>{Os(),Oe(!1)});n.navigate({...we,replace:g,resetScroll:_,hashScrollIntoView:b,startTransition:v,viewTransition:w,ignoreBlocker:ne})}};if(ve)return{...ue,ref:r,href:ve,...E&&{children:E},...R&&{target:R},...C&&{disabled:C},...I&&{style:I},...k&&{className:k},...T&&{onClick:T},...$&&{onBlur:$},...j&&{onFocus:j},...H&&{onMouseEnter:H},...P&&{onMouseLeave:P},...Q&&{onTouchStart:Q}};const wn=dt=>{if(C||Me!=="intent")return;if(!ft){mt();return}const $t=dt.currentTarget;if(rf.has($t))return;const gt=setTimeout(()=>{rf.delete($t),mt()},ft);rf.set($t,gt)},It=dt=>{C||Me!=="intent"||mt()},Xs=dt=>{if(C||!Me||!ft)return;const $t=dt.currentTarget,gt=rf.get($t);gt&&(clearTimeout(gt),rf.delete($t))};return{...ue,...wt,...pe,href:qe?.href,ref:r,onClick:ll([T,Pt]),onBlur:ll([$,Xs]),onFocus:ll([j,wn]),onMouseEnter:ll([H,wn]),onMouseLeave:ll([P,Xs]),onTouchStart:ll([Q,It]),disabled:!!C,target:R,..._e&&{style:_e},...xe&&{className:xe},...C&&HU,...Je&&VU,...z&&Ge&&qU}}const V0={},jU={className:"active"},HU={role:"link","aria-disabled":!0},VU={"data-status":"active","aria-current":"page"},qU={"data-transitioning":"transitioning"},rf=new WeakMap,FU={rootMargin:"100px"},ll=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function GU(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ZU(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const $s=M.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...c}=UU(r,t),l=typeof r.children=="function"?r.children({isActive:c["data-status"]==="active"}):r.children;if(!n){const{disabled:f,...d}=c;return M.createElement("a",d,l)}return M.createElement(n,c,l)});function KU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let QU=class extends eO{constructor(t){super(t),this.useMatch=n=>Wr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Wr({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Yv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Qv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Kv({...n,from:this.id}),this.useLoaderData=n=>Zv({...n,from:this.id}),this.useNavigate=()=>bm({from:this.fullPath}),this.Link=Cl.forwardRef((n,r)=>N.jsx($s,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function YU(e){return new QU(e)}function XU(){return e=>JU(e)}class WU extends CU{constructor(t){super(t),this.useMatch=n=>Wr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Wr({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Yv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Qv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Kv({...n,from:this.id}),this.useLoaderData=n=>Zv({...n,from:this.id}),this.useNavigate=()=>bm({from:this.fullPath}),this.Link=Cl.forwardRef((n,r)=>N.jsx($s,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function JU(e){return new WU(e)}function _t(e){return typeof e=="object"?new ZC(e,{silent:!0}).createRoute(e):new ZC(e,{silent:!0}).createRoute}class ZC{constructor(t,n){this.path=t,this.createRoute=r=>{const i=YU(r);return i.isRoot=!1,i},this.silent=n?.silent}}class KC{constructor(t){this.useMatch=n=>Wr({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Wr({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Yv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Qv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Kv({...n,from:this.options.id}),this.useLoaderData=n=>Zv({...n,from:this.options.id}),this.useNavigate=()=>{const n=ns();return bm({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function QC(e){return typeof e=="object"?new KC(e):t=>new KC({id:e,...t})}function Tt(e,t){let n,r,i,c;const l=()=>(n||(n=e().then(d=>{n=void 0,r=d[t]}).catch(d=>{if(i=d,I6(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const h=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(h)||(sessionStorage.setItem(h,"1"),c=!0)}})),n),f=function(h){if(c)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(UC)UC(l());else throw l();return M.createElement(r,h)};return f.preload=l,f}function e5(){const e=ns(),t=M.useRef({router:e,mounted:!1}),[n,r]=M.useState(!1),{hasPendingMatches:i,isLoading:c}=Mn({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),l=z0(c),f=c||n||i,d=z0(f),h=c||i,b=z0(h);return e.startTransition=g=>{r(!0),M.startTransition(()=>{g(),r(!1)})},M.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Xi(e.latestLocation.publicHref)!==Xi(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),Gh(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),Gh(()=>{l&&!c&&e.emit({type:"onLoad",...Wa(e.state)})},[l,e,c]),Gh(()=>{b&&!h&&e.emit({type:"onBeforeRouteMount",...Wa(e.state)})},[h,b,e]),Gh(()=>{if(d&&!f){const g=Wa(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),g.hrefChanged&&sU(e)}},[f,d,e]),null}function t5(e){const t=Mn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return N.jsx(qv,{getResetKey:()=>t,onCatch:(n,r)=>{if(qs(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(qs(n))return e.fallback?.(n);throw n},children:e.children})}function n5(){return N.jsx("p",{children:"Not Found"})}function ml(e){return N.jsx(N.Fragment,{children:e.children})}function oO(e,t,n){return t.options.notFoundComponent?N.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?N.jsx(e.options.defaultNotFoundComponent,{...n}):N.jsx(n5,{})}function s5(){return ns().isScrollRestoring,null}const iO=M.memo(function({matchId:t}){const n=ns(),r=Mn({select:E=>{const R=E.matches.findIndex(I=>I.id===t),C=E.matches[R];return Bo(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:E.loadedAt,parentRouteId:E.matches[R-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],c=i.options.pendingComponent??n.options.defaultPendingComponent,l=c?N.jsx(c,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,b=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||b)&&(i.options.wrapInSuspense??c??(i.options.errorComponent?.preload||b))?M.Suspense:ml,v=f?qv:ml,_=h?t5:ml,w=i.isRoot?i.options.shellComponent??ml:ml;return N.jsxs(w,{children:[N.jsx(ym.Provider,{value:t,children:N.jsx(g,{fallback:l,children:N.jsx(v,{getResetKey:()=>r.resetKey,errorComponent:f||Fv,onCatch:(E,R)=>{if(qs(E))throw E;d?.(E,R)},children:N.jsx(_,{fallback:E=>{if(!h||E.routeId&&E.routeId!==r.routeId||!E.routeId&&!i.isRoot)throw E;return M.createElement(h,E)},children:b||r._displayPending?N.jsx(MU,{fallback:l,children:N.jsx(YC,{matchId:t})}):N.jsx(YC,{matchId:t})})})})}),r.parentRouteId===mr&&n.options.scrollRestoration?N.jsxs(N.Fragment,{children:[N.jsx(r5,{}),N.jsx(s5,{})]}):null]})});function r5(){const e=ns(),t=M.useRef(void 0);return N.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Wa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const YC=M.memo(function({matchId:t}){const n=ns(),{match:r,key:i,routeId:c}=Mn({select:d=>{const h=d.matches.find(w=>w.id===t),b=h.routeId,v=(n.routesById[b].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:b,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:b,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[c],f=M.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?N.jsx(d,{},i):N.jsx(aO,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise){const b=Al();h._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),h._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Bo(qs(r.error)),oO(n,l,r.error);if(r.status==="redirected")throw Bo(br(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return f}),aO=M.memo(function(){const t=ns(),n=M.useContext(ym),r=Mn({select:h=>h.matches.find(b=>b.id===n)?.routeId}),i=t.routesById[r],c=Mn({select:h=>{const g=h.matches.find(v=>v.id===n);return Bo(g),g.globalNotFound}}),l=Mn({select:h=>{const b=h.matches,g=b.findIndex(v=>v.id===n);return b[g+1]?.id}}),f=t.options.defaultPendingComponent?N.jsx(t.options.defaultPendingComponent,{}):null;if(c)return oO(t,i,void 0);if(!l)return null;const d=N.jsx(iO,{matchId:l});return r===mr?N.jsx(M.Suspense,{fallback:f,children:d}):d});function o5(){const e=ns(),n=e.routesById[mr].options.pendingComponent??e.options.defaultPendingComponent,r=n?N.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?ml:M.Suspense,c=N.jsxs(i,{fallback:r,children:[N.jsx(e5,{}),N.jsx(i5,{})]});return e.options.InnerWrap?N.jsx(e.options.InnerWrap,{children:c}):c}function i5(){const e=ns(),t=Mn({select:i=>i.matches[0]?.id}),n=Mn({select:i=>i.loadedAt}),r=t?N.jsx(iO,{matchId:t}):null;return N.jsx(ym.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:N.jsx(qv,{getResetKey:()=>n,errorComponent:Fv,onCatch:void 0,children:r})})}const a5=e=>new c5(e);class c5 extends bU{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=_t,globalThis.createLazyFileRoute=QC):typeof window<"u"&&(window.createFileRoute=_t,window.createLazyFileRoute=QC);function l5({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=N.jsx(sO.Provider,{value:e,children:t});return e.options.Wrap?N.jsx(e.options.Wrap,{children:r}):r}function u5({router:e,...t}){return N.jsx(l5,{router:e,...t,children:N.jsx(o5,{})})}function f5(e){return Mn({select:t=>e?.select?e.select(t.location):t.location})}function d5({tag:e,attrs:t,children:n,nonce:r}){switch(e){case"title":return N.jsx("title",{...t,suppressHydrationWarning:!0,children:n});case"meta":return N.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return N.jsx("link",{...t,nonce:r,suppressHydrationWarning:!0});case"style":return N.jsx("style",{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case"script":return N.jsx(h5,{attrs:t,children:n});default:return null}}function h5({attrs:e,children:t}){ns();const n=Gv(),r=typeof e?.type=="string"&&e.type!==""&&e.type!=="text/javascript"&&e.type!=="module";if(M.useEffect(()=>{if(!r){if(e?.src){const i=(()=>{try{const f=document.baseURI||window.location.href;return new URL(e.src,f).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(f=>f.src===i))return;const l=document.createElement("script");for(const[f,d]of Object.entries(e))f!=="suppressHydrationWarning"&&d!==void 0&&d!==!1&&l.setAttribute(f,typeof d=="boolean"?"":String(d));return document.head.appendChild(l),()=>{l.parentNode&&l.parentNode.removeChild(l)}}if(typeof t=="string"){const i=typeof e?.type=="string"?e.type:"text/javascript",c=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(d=>{if(!(d instanceof HTMLScriptElement))return!1;const h=d.getAttribute("type")??"text/javascript",b=d.getAttribute("nonce")??void 0;return d.textContent===t&&h===i&&b===c}))return;const f=document.createElement("script");if(f.textContent=t,e)for(const[d,h]of Object.entries(e))d!=="suppressHydrationWarning"&&h!==void 0&&h!==!1&&f.setAttribute(d,typeof h=="boolean"?"":String(h));return document.head.appendChild(f),()=>{f.parentNode&&f.parentNode.removeChild(f)}}}},[e,t,r]),r&&typeof t=="string")return N.jsx("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!n){if(e?.src)return N.jsx("script",{...e,suppressHydrationWarning:!0});if(typeof t=="string")return N.jsx("script",{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}const p5=()=>{const e=ns(),t=e.options.ssr?.nonce,n=Mn({select:d=>d.matches.map(h=>h.meta).filter(Boolean)}),r=M.useMemo(()=>{const d=[],h={};let b;for(let g=n.length-1;g>=0;g--){const v=n[g];for(let _=v.length-1;_>=0;_--){const w=v[_];if(w)if(w.title)b||(b={tag:"title",children:w.title});else if("script:ld+json"in w)try{const E=JSON.stringify(w["script:ld+json"]);d.push({tag:"script",attrs:{type:"application/ld+json"},children:P6(E)})}catch{}else{const E=w.name??w.property;if(E){if(h[E])continue;h[E]=!0}d.push({tag:"meta",attrs:{...w,nonce:t}})}}}return b&&d.push(b),t&&d.push({tag:"meta",attrs:{property:"csp-nonce",content:t}}),d.reverse(),d},[n,t]),i=Mn({select:d=>{const h=d.matches.map(v=>v.links).filter(Boolean).flat(1).map(v=>({tag:"link",attrs:{...v,nonce:t}})),b=e.ssr?.manifest,g=d.matches.map(v=>b?.routes[v.routeId]?.assets??[]).filter(Boolean).flat(1).filter(v=>v.tag==="link").map(v=>({tag:"link",attrs:{...v.attrs,suppressHydrationWarning:!0,nonce:t}}));return[...h,...g]},structuralSharing:!0}),c=Mn({select:d=>{const h=[];return d.matches.map(b=>e.looseRoutesById[b.routeId]).forEach(b=>e.ssr?.manifest?.routes[b.id]?.preloads?.filter(Boolean).forEach(g=>{h.push({tag:"link",attrs:{rel:"modulepreload",href:g,nonce:t}})})),h},structuralSharing:!0}),l=Mn({select:d=>d.matches.map(h=>h.styles).flat(1).filter(Boolean).map(({children:h,...b})=>({tag:"style",attrs:{...b,nonce:t},children:h})),structuralSharing:!0}),f=Mn({select:d=>d.matches.map(h=>h.headScripts).flat(1).filter(Boolean).map(({children:h,...b})=>({tag:"script",attrs:{...b,nonce:t},children:h})),structuralSharing:!0});return m5([...r,...c,...i,...l,...f],d=>JSON.stringify(d))};function m5(e,t){const n=new Set;return e.filter(r=>{const i=t(r);return n.has(i)?!1:(n.add(i),!0)})}function g5(){const e=p5(),n=ns().options.ssr?.nonce;return N.jsx(N.Fragment,{children:e.map(r=>M.createElement(d5,{...r,key:`tsr-meta-${JSON.stringify(r)}`,nonce:n}))})}var q0={exports:{}},of={},F0={exports:{}},G0={};var XC;function y5(){return XC||(XC=1,(function(e){function t(V,re){var J=V.length;V.push(re);e:for(;0>>1,ue=V[be];if(0>>1;bei(ye,J))wei(Ee,ye)?(V[be]=Ee,V[we]=J,be=we):(V[be]=ye,V[ee]=J,be=ee);else if(wei(Ee,J))V[be]=Ee,V[we]=J,be=we;else break e}}return re}function i(V,re){var J=V.sortIndex-re.sortIndex;return J!==0?J:V.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var d=[],h=[],b=1,g=null,v=3,_=!1,w=!1,E=!1,R=!1,C=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function T(V){for(var re=n(h);re!==null;){if(re.callback===null)r(h);else if(re.startTime<=V)r(h),re.sortIndex=re.expirationTime,t(d,re);else break;re=n(h)}}function $(V){if(E=!1,T(V),!w)if(n(d)!==null)w=!0,j||(j=!0,F());else{var re=n(h);re!==null&&ge($,re.startTime-V)}}var j=!1,H=-1,P=5,Q=-1;function ne(){return R?!0:!(e.unstable_now()-QV&&ne());){var be=g.callback;if(typeof be=="function"){g.callback=null,v=g.priorityLevel;var ue=be(g.expirationTime<=V);if(V=e.unstable_now(),typeof ue=="function"){g.callback=ue,T(V),re=!0;break t}g===n(d)&&r(d),T(V)}else r(d);g=n(d)}if(g!==null)re=!0;else{var z=n(h);z!==null&&ge($,z.startTime-V),re=!1}}break e}finally{g=null,v=J,_=!1}re=void 0}}finally{re?F():j=!1}}}var F;if(typeof k=="function")F=function(){k(te)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,me=oe.port2;oe.port1.onmessage=te,F=function(){me.postMessage(null)}}else F=function(){C(te,0)};function ge(V,re){H=C(function(){V(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125be?(V.sortIndex=J,t(h,V),n(d)===null&&V===n(h)&&(E?(I(H),H=-1):E=!0,ge($,J-be))):(V.sortIndex=ue,t(d,V),w||_||(w=!0,j||(j=!0,F()))),V},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(V){var re=v;return function(){var J=v;v=re;try{return V.apply(this,arguments)}finally{v=J}}}})(G0)),G0}var WC;function b5(){return WC||(WC=1,F0.exports=y5()),F0.exports}var JC;function v5(){if(JC)return of;JC=1;var e=b5(),t=zl(),n=rO();function r(s){var o="https://react.dev/errors/"+s;if(1ue||(s.current=be[ue],be[ue]=null,ue--)}function ye(s,o){ue++,be[ue]=s.current,s.current=o}var we=z(null),Ee=z(null),Se=z(null),Ie=z(null);function qe(s,o){switch(ye(Se,o),ye(Ee,s),ye(we,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?LR(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=LR(o),s=zR(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}ee(we),ye(we,s)}function ve(){ee(we),ee(Ee),ee(Se)}function Je(s){s.memoizedState!==null&&ye(Ie,s);var o=we.current,a=zR(o,s.type);o!==a&&(ye(Ee,s),ye(we,a))}function wt(s){Ee.current===s&&(ee(we),ee(Ee)),Ie.current===s&&(ee(Ie),Yu._currentValue=J)}var pe,xe;function _e(s){if(pe===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);pe=o&&o[1]||"",xe=-1)":-1h||z[u]!==K[h]){var ie=` -`+z[u].replace(" at new "," at ");return s.displayName&&ie.includes("")&&(ie=ie.replace("",s.displayName)),ie}while(1<=u&&0<=h);break}}}finally{qe=!1,Error.prepareStackTrace=a}return(a=s?s.displayName||s.name:"")?we(a):""}function je(s,o){switch(s.tag){case 26:case 27:case 5:return we(s.type);case 16:return we("Lazy");case 13:return s.child!==o&&o!==null?we("Suspense Fallback"):we("Suspense");case 19:return we("SuspenseList");case 0:case 15:return Oe(s.type,!1);case 11:return Oe(s.type.render,!1);case 1:return Oe(s.type,!0);case 31:return we("Activity");default:return""}}function De(s){try{var o="",a=null;do o+=je(s,a),a=s,s=s.return;while(s);return o}catch(u){return` +`);for(p=u=0;up||B[u]!==K[p]){var ie=` +`+B[u].replace(" at new "," at ");return s.displayName&&ie.includes("")&&(ie=ie.replace("",s.displayName)),ie}while(1<=u&&0<=p);break}}}finally{Ge=!1,Error.prepareStackTrace=a}return(a=s?s.displayName||s.name:"")?_e(a):""}function He(s,o){switch(s.tag){case 26:case 27:case 5:return _e(s.type);case 16:return _e("Lazy");case 13:return s.child!==o&&o!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Oe(s.type,!1);case 11:return Oe(s.type.render,!1);case 1:return Oe(s.type,!0);case 31:return _e("Activity");default:return""}}function Me(s){try{var o="",a=null;do o+=He(s,a),a=s,s=s.return;while(s);return o}catch(u){return` Error generating stack: `+u.message+` -`+u.stack}}var nt=Object.prototype.hasOwnProperty,Bt=e.unstable_scheduleCallback,We=e.unstable_cancelCallback,Tt=e.unstable_shouldYield,Rn=e.unstable_requestPaint,It=e.unstable_now,Tr=e.unstable_getCurrentPriorityLevel,dt=e.unstable_ImmediatePriority,$t=e.unstable_UserBlockingPriority,mt=e.unstable_NormalPriority,Os=e.unstable_LowPriority,Xs=e.unstable_IdlePriority,ao=e.log,Rd=e.unstable_setDisableYieldValue,fi=null,Gn=null;function Ir(s){if(typeof ao=="function"&&Rd(s),Gn&&typeof Gn.setStrictMode=="function")try{Gn.setStrictMode(fi,s)}catch{}}var Zn=Math.clz32?Math.clz32:Ws,Ft=Math.log,Kn=Math.LN2;function Ws(s){return s>>>=0,s===0?32:31-(Ft(s)/Kn|0)|0}var Nn=256,ds=262144,co=4194304;function Js(s){var o=s&42;if(o!==0)return o;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function di(s,o,a){var u=s.pendingLanes;if(u===0)return 0;var h=0,m=s.suspendedLanes,x=s.pingedLanes;s=s.warmLanes;var A=u&134217727;return A!==0?(u=A&~m,u!==0?h=Js(u):(x&=A,x!==0?h=Js(x):a||(a=A&~s,a!==0&&(h=Js(a))))):(A=u&~m,A!==0?h=Js(A):x!==0?h=Js(x):a||(a=u&~s,a!==0&&(h=Js(a)))),h===0?0:o!==0&&o!==h&&(o&m)===0&&(m=h&-h,a=o&-o,m>=a||m===32&&(a&4194048)!==0)?o:h}function pi(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function Sg(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Cd(){var s=co;return co<<=1,(co&62914560)===0&&(co=4194304),s}function au(s){for(var o=[],a=0;31>a;a++)o.push(s);return o}function Ra(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function cu(s,o,a,u,h,m){var x=s.pendingLanes;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=a,s.entangledLanes&=a,s.errorRecoveryDisabledLanes&=a,s.shellSuspendCounter=0;var A=s.entanglements,z=s.expirationTimes,K=s.hiddenUpdates;for(a=x&~a;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var x4=/[\n"\\]/g;function tr(s){return s.replace(x4,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function xg(s,o,a,u,h,m,x,A){s.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?s.type=x:s.removeAttribute("type"),o!=null?x==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+er(o)):s.value!==""+er(o)&&(s.value=""+er(o)):x!=="submit"&&x!=="reset"||s.removeAttribute("value"),o!=null?Rg(s,x,er(o)):a!=null?Rg(s,x,er(a)):u!=null&&s.removeAttribute("value"),h==null&&m!=null&&(s.defaultChecked=!!m),h!=null&&(s.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?s.name=""+er(A):s.removeAttribute("name")}function DE(s,o,a,u,h,m,x,A){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(s.type=m),o!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||o!=null)){Eg(s);return}a=a!=null?""+er(a):"",o=o!=null?""+er(o):a,A||o===s.value||(s.value=o),s.defaultValue=o}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,s.checked=A?s.checked:!!u,s.defaultChecked=!!u,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(s.name=x),Eg(s)}function Rg(s,o,a){o==="number"&&kd(s.ownerDocument)===s||s.defaultValue===""+a||(s.defaultValue=""+a)}function Oc(s,o,a,u){if(s=s.options,o){o={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Og=!1;if(po)try{var hu={};Object.defineProperty(hu,"passive",{get:function(){Og=!0}}),window.addEventListener("test",hu,hu),window.removeEventListener("test",hu,hu)}catch{Og=!1}var mi=null,Mg=null,Nd=null;function $E(){if(Nd)return Nd;var s,o=Mg,a=o.length,u,h="value"in mi?mi.value:mi.textContent,m=h.length;for(s=0;s=yu),qE=" ",GE=!1;function ZE(s,o){switch(s){case"keyup":return W4.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function KE(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Pc=!1;function eB(s,o){switch(s){case"compositionend":return KE(o);case"keypress":return o.which!==32?null:(GE=!0,qE);case"textInput":return s=o.data,s===qE&&GE?null:s;default:return null}}function tB(s,o){if(Pc)return s==="compositionend"||!Lg&&ZE(s,o)?(s=$E(),Nd=Mg=mi=null,Pc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:a,offset:o-s};s=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=nx(a)}}function rx(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?rx(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function ox(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=kd(s.document);o instanceof s.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)s=o.contentWindow;else break;o=kd(s.document)}return o}function $g(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var lB=po&&"documentMode"in document&&11>=document.documentMode,Nc=null,Ug=null,_u=null,jg=!1;function ix(s,o,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;jg||Nc==null||Nc!==kd(u)||(u=Nc,"selectionStart"in u&&$g(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),_u&&Su(_u,u)||(_u=u,u=Tp(Ug,"onSelect"),0>=x,h-=x,Br=1<<32-Zn(o)+h|a<Je?(ct=Be,Be=null):ct=Be.sibling;var vt=Q(q,Be,Z[Je],le);if(vt===null){Be===null&&(Be=ct);break}s&&Be&&vt.alternate===null&&o(q,Be),F=m(vt,F,Je),bt===null?$e=vt:bt.sibling=vt,bt=vt,Be=ct}if(Je===Z.length)return a(q,Be),ut&&mo(q,Je),$e;if(Be===null){for(;JeJe?(ct=Be,Be=null):ct=Be.sibling;var zi=Q(q,Be,vt.value,le);if(zi===null){Be===null&&(Be=ct);break}s&&Be&&zi.alternate===null&&o(q,Be),F=m(zi,F,Je),bt===null?$e=zi:bt.sibling=zi,bt=zi,Be=ct}if(vt.done)return a(q,Be),ut&&mo(q,Je),$e;if(Be===null){for(;!vt.done;Je++,vt=Z.next())vt=de(q,vt.value,le),vt!==null&&(F=m(vt,F,Je),bt===null?$e=vt:bt.sibling=vt,bt=vt);return ut&&mo(q,Je),$e}for(Be=u(Be);!vt.done;Je++,vt=Z.next())vt=se(Be,q,Je,vt.value,le),vt!==null&&(s&&vt.alternate!==null&&Be.delete(vt.key===null?Je:vt.key),F=m(vt,F,Je),bt===null?$e=vt:bt.sibling=vt,bt=vt);return s&&Be.forEach(function(I$){return o(q,I$)}),ut&&mo(q,Je),$e}function Lt(q,F,Z,le){if(typeof Z=="object"&&Z!==null&&Z.type===E&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:e:{for(var $e=Z.key;F!==null;){if(F.key===$e){if($e=Z.type,$e===E){if(F.tag===7){a(q,F.sibling),le=h(F,Z.props.children),le.return=q,q=le;break e}}else if(F.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===P&&La($e)===F.type){a(q,F.sibling),le=h(F,Z.props),Au(le,Z),le.return=q,q=le;break e}a(q,F);break}else o(q,F);F=F.sibling}Z.type===E?(le=Ma(Z.props.children,q.mode,le,Z.key),le.return=q,q=le):(le=qd(Z.type,Z.key,Z.props,null,q.mode,le),Au(le,Z),le.return=q,q=le)}return x(q);case w:e:{for($e=Z.key;F!==null;){if(F.key===$e)if(F.tag===4&&F.stateNode.containerInfo===Z.containerInfo&&F.stateNode.implementation===Z.implementation){a(q,F.sibling),le=h(F,Z.children||[]),le.return=q,q=le;break e}else{a(q,F);break}else o(q,F);F=F.sibling}le=Kg(Z,q.mode,le),le.return=q,q=le}return x(q);case P:return Z=La(Z),Lt(q,F,Z,le)}if(ye(Z))return Pe(q,F,Z,le);if(G(Z)){if($e=G(Z),typeof $e!="function")throw Error(r(150));return Z=$e.call(Z),He(q,F,Z,le)}if(typeof Z.then=="function")return Lt(q,F,Wd(Z),le);if(Z.$$typeof===k)return Lt(q,F,Kd(q,Z),le);Jd(q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,F!==null&&F.tag===6?(a(q,F.sibling),le=h(F,Z),le.return=q,q=le):(a(q,F),le=Zg(Z,q.mode,le),le.return=q,q=le),x(q)):a(q,F)}return function(q,F,Z,le){try{Cu=0;var $e=Lt(q,F,Z,le);return Gc=null,$e}catch(Be){if(Be===qc||Be===Yd)throw Be;var bt=Ds(29,Be,null,q.mode);return bt.lanes=le,bt.return=q,bt}}}var Ba=Ix(!0),Ox=Ix(!1),Si=!1;function iy(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ay(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function _i(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function wi(s,o,a){var u=s.updateQueue;if(u===null)return null;if(u=u.shared,(wt&2)!==0){var h=u.pending;return h===null?o.next=o:(o.next=h.next,h.next=o),u.pending=o,o=Fd(s),px(s,null,a),o}return Vd(s,u,o,a),Fd(s)}function Tu(s,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194048)!==0)){var u=o.lanes;u&=s.pendingLanes,a|=u,o.lanes=a,Ad(s,a)}}function cy(s,o){var a=s.updateQueue,u=s.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var h=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?h=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?h=m=o:m=m.next=o}else h=m=o;a={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:m,shared:u.shared,callbacks:u.callbacks},s.updateQueue=a;return}s=a.lastBaseUpdate,s===null?a.firstBaseUpdate=o:s.next=o,a.lastBaseUpdate=o}var ly=!1;function Iu(){if(ly){var s=Fc;if(s!==null)throw s}}function Ou(s,o,a,u){ly=!1;var h=s.updateQueue;Si=!1;var m=h.firstBaseUpdate,x=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var z=A,K=z.next;z.next=null,x===null?m=K:x.next=K,x=z;var ie=s.alternate;ie!==null&&(ie=ie.updateQueue,A=ie.lastBaseUpdate,A!==x&&(A===null?ie.firstBaseUpdate=K:A.next=K,ie.lastBaseUpdate=z))}if(m!==null){var de=h.baseState;x=0,ie=K=z=null,A=m;do{var Q=A.lane&-536870913,se=Q!==A.lane;if(se?(at&Q)===Q:(u&Q)===Q){Q!==0&&Q===Vc&&(ly=!0),ie!==null&&(ie=ie.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Pe=s,He=A;Q=o;var Lt=a;switch(He.tag){case 1:if(Pe=He.payload,typeof Pe=="function"){de=Pe.call(Lt,de,Q);break e}de=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=He.payload,Q=typeof Pe=="function"?Pe.call(Lt,de,Q):Pe,Q==null)break e;de=g({},de,Q);break e;case 2:Si=!0}}Q=A.callback,Q!==null&&(s.flags|=64,se&&(s.flags|=8192),se=h.callbacks,se===null?h.callbacks=[Q]:se.push(Q))}else se={lane:Q,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ie===null?(K=ie=se,z=de):ie=ie.next=se,x|=Q;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;se=A,A=se.next,se.next=null,h.lastBaseUpdate=se,h.shared.pending=null}}while(!0);ie===null&&(z=de),h.baseState=z,h.firstBaseUpdate=K,h.lastBaseUpdate=ie,m===null&&(h.shared.lanes=0),Ai|=x,s.lanes=x,s.memoizedState=de}}function Mx(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function Dx(s,o){var a=s.callbacks;if(a!==null)for(s.callbacks=null,s=0;sm?m:8;var x=V.T,A={};V.T=A,Ty(s,!1,o,a);try{var z=h(),K=V.S;if(K!==null&&K(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ie=bB(z,u);ku(s,o,ie,zs(s))}else ku(s,o,u,zs(s))}catch(de){ku(s,o,{then:function(){},status:"rejected",reason:de},zs())}finally{oe.p=m,x!==null&&A.types!==null&&(x.types=A.types),V.T=x}}function xB(){}function Cy(s,o,a,u){if(s.tag!==5)throw Error(r(476));var h=u1(s).queue;l1(s,h,o,J,a===null?xB:function(){return f1(s),a(u)})}function u1(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:J},next:null};var a={};return o.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:a},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function f1(s){var o=u1(s);o.next===null&&(o=s.alternate.memoizedState),ku(s,o.next.queue,{},zs())}function Ay(){return Bn(Yu)}function d1(){return on().memoizedState}function p1(){return on().memoizedState}function RB(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var a=zs();s=_i(a);var u=wi(o,s,a);u!==null&&(vs(u,o,a),Tu(u,o,a)),o={cache:ny()},s.payload=o;return}o=o.return}}function CB(s,o,a){var u=zs();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lp(s)?m1(o,a):(a=qg(s,o,a,u),a!==null&&(vs(a,s,u),g1(a,o,u)))}function h1(s,o,a){var u=zs();ku(s,o,a,u)}function ku(s,o,a,u){var h={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(lp(s))m1(o,h);else{var m=s.alternate;if(s.lanes===0&&(m===null||m.lanes===0)&&(m=o.lastRenderedReducer,m!==null))try{var x=o.lastRenderedState,A=m(x,a);if(h.hasEagerState=!0,h.eagerState=A,Ms(A,x))return Vd(s,o,h,0),Ut===null&&Hd(),!1}catch{}if(a=qg(s,o,h,u),a!==null)return vs(a,s,u),g1(a,o,u),!0}return!1}function Ty(s,o,a,u){if(u={lane:2,revertLane:i0(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},lp(s)){if(o)throw Error(r(479))}else o=qg(s,a,u,2),o!==null&&vs(o,s,2)}function lp(s){var o=s.alternate;return s===Qe||o!==null&&o===Qe}function m1(s,o){Kc=np=!0;var a=s.pending;a===null?o.next=o:(o.next=a.next,a.next=o),s.pending=o}function g1(s,o,a){if((a&4194048)!==0){var u=o.lanes;u&=s.pendingLanes,a|=u,o.lanes=a,Ad(s,a)}}var Pu={readContext:Bn,use:op,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};Pu.useEffectEvent=nn;var y1={readContext:Bn,use:op,useCallback:function(s,o){return rs().memoizedState=[s,o===void 0?null:o],s},useContext:Bn,useEffect:e1,useImperativeHandle:function(s,o,a){a=a!=null?a.concat([s]):null,ap(4194308,4,r1.bind(null,o,s),a)},useLayoutEffect:function(s,o){return ap(4194308,4,s,o)},useInsertionEffect:function(s,o){ap(4,2,s,o)},useMemo:function(s,o){var a=rs();o=o===void 0?null:o;var u=s();if($a){Ir(!0);try{s()}finally{Ir(!1)}}return a.memoizedState=[u,o],u},useReducer:function(s,o,a){var u=rs();if(a!==void 0){var h=a(o);if($a){Ir(!0);try{a(o)}finally{Ir(!1)}}}else h=o;return u.memoizedState=u.baseState=h,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:h},u.queue=s,s=s.dispatch=CB.bind(null,Qe,s),[u.memoizedState,s]},useRef:function(s){var o=rs();return s={current:s},o.memoizedState=s},useState:function(s){s=_y(s);var o=s.queue,a=h1.bind(null,Qe,o);return o.dispatch=a,[s.memoizedState,a]},useDebugValue:xy,useDeferredValue:function(s,o){var a=rs();return Ry(a,s,o)},useTransition:function(){var s=_y(!1);return s=l1.bind(null,Qe,s.queue,!0,!1),rs().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,a){var u=Qe,h=rs();if(ut){if(a===void 0)throw Error(r(407));a=a()}else{if(a=o(),Ut===null)throw Error(r(349));(at&127)!==0||Bx(u,o,a)}h.memoizedState=a;var m={value:a,getSnapshot:o};return h.queue=m,e1(Ux.bind(null,u,m,s),[s]),u.flags|=2048,Yc(9,{destroy:void 0},$x.bind(null,u,m,a,o),null),a},useId:function(){var s=rs(),o=Ut.identifierPrefix;if(ut){var a=$r,u=Br;a=(u&~(1<<32-Zn(u)-1)).toString(32)+a,o="_"+o+"R_"+a,a=sp++,0<\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof u.is=="string"?x.createElement("select",{is:u.is}):x.createElement("select"),u.multiple?m.multiple=!0:u.size&&(m.size=u.size);break;default:m=typeof u.is=="string"?x.createElement(h,{is:u.is}):x.createElement(h)}}m[Ln]=o,m[ps]=u;e:for(x=o.child;x!==null;){if(x.tag===5||x.tag===6)m.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===o)break e;for(;x.sibling===null;){if(x.return===null||x.return===o)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}o.stateNode=m;e:switch(Un(m,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&_o(o)}}return Gt(o),Hy(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,a),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==u&&_o(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(r(166));if(s=_e.current,jc(o)){if(s=o.stateNode,a=o.memoizedProps,u=null,h=zn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}s[Ln]=o,s=!!(s.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||LR(s.nodeValue,a)),s||bi(o,!0)}else s=Ip(s).createTextNode(u),s[Ln]=o,o.stateNode=s}return Gt(o),null;case 31:if(a=o.memoizedState,s===null||s.memoizedState!==null){if(u=jc(o),a!==null){if(s===null){if(!u)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Ln]=o}else Da(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Gt(o),s=!1}else a=Wg(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=a),s=!0;if(!s)return o.flags&256?(Ps(o),o):(Ps(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Gt(o),null;case 13:if(u=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(h=jc(o),u!==null&&u.dehydrated!==null){if(s===null){if(!h)throw Error(r(318));if(h=o.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[Ln]=o}else Da(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Gt(o),h=!1}else h=Wg(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),h=!0;if(!h)return o.flags&256?(Ps(o),o):(Ps(o),null)}return Ps(o),(o.flags&128)!==0?(o.lanes=a,o):(a=u!==null,s=s!==null&&s.memoizedState!==null,a&&(u=o.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==h&&(u.flags|=2048)),a!==s&&a&&(o.child.flags|=8192),hp(o,o.updateQueue),Gt(o),null);case 4:return Se(),s===null&&u0(o.stateNode.containerInfo),Gt(o),null;case 10:return yo(o.type),Gt(o),null;case 19:if(ee(rn),u=o.memoizedState,u===null)return Gt(o),null;if(h=(o.flags&128)!==0,m=u.rendering,m===null)if(h)Lu(u,!1);else{if(sn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(m=tp(s),m!==null){for(o.flags|=128,Lu(u,!1),s=m.updateQueue,o.updateQueue=s,hp(o,s),o.subtreeFlags=0,s=a,a=o.child;a!==null;)hx(a,s),a=a.sibling;return ge(rn,rn.current&1|2),ut&&mo(o,u.treeForkCount),o.child}s=s.sibling}u.tail!==null&&It()>vp&&(o.flags|=128,h=!0,Lu(u,!1),o.lanes=4194304)}else{if(!h)if(s=tp(m),s!==null){if(o.flags|=128,h=!0,s=s.updateQueue,o.updateQueue=s,hp(o,s),Lu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!m.alternate&&!ut)return Gt(o),null}else 2*It()-u.renderingStartTime>vp&&a!==536870912&&(o.flags|=128,h=!0,Lu(u,!1),o.lanes=4194304);u.isBackwards?(m.sibling=o.child,o.child=m):(s=u.last,s!==null?s.sibling=m:o.child=m,u.last=m)}return u.tail!==null?(s=u.tail,u.rendering=s,u.tail=s.sibling,u.renderingStartTime=It(),s.sibling=null,a=rn.current,ge(rn,h?a&1|2:a&1),ut&&mo(o,u.treeForkCount),s):(Gt(o),null);case 22:case 23:return Ps(o),fy(),u=o.memoizedState!==null,s!==null?s.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(a&536870912)!==0&&(o.flags&128)===0&&(Gt(o),o.subtreeFlags&6&&(o.flags|=8192)):Gt(o),a=o.updateQueue,a!==null&&hp(o,a.retryQueue),a=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==a&&(o.flags|=2048),s!==null&&ee(Na),null;case 24:return a=null,s!==null&&(a=s.memoizedState.cache),o.memoizedState.cache!==a&&(o.flags|=2048),yo(dn),Gt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function MB(s,o){switch(Yg(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return yo(dn),Se(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return _t(o),null;case 31:if(o.memoizedState!==null){if(Ps(o),o.alternate===null)throw Error(r(340));Da()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Ps(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Da()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return ee(rn),null;case 4:return Se(),null;case 10:return yo(o.type),null;case 22:case 23:return Ps(o),fy(),s!==null&&ee(Na),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return yo(dn),null;case 25:return null;default:return null}}function j1(s,o){switch(Yg(o),o.tag){case 3:yo(dn),Se();break;case 26:case 27:case 5:_t(o);break;case 4:Se();break;case 31:o.memoizedState!==null&&Ps(o);break;case 13:Ps(o);break;case 19:ee(rn);break;case 10:yo(o.type);break;case 22:case 23:Ps(o),fy(),s!==null&&ee(Na);break;case 24:yo(dn)}}function zu(s,o){try{var a=o.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var h=u.next;a=h;do{if((a.tag&s)===s){u=void 0;var m=a.create,x=a.inst;u=m(),x.destroy=u}a=a.next}while(a!==h)}}catch(A){Mt(o,o.return,A)}}function Ri(s,o,a){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var m=h.next;u=m;do{if((u.tag&s)===s){var x=u.inst,A=x.destroy;if(A!==void 0){x.destroy=void 0,h=o;var z=a,K=A;try{K()}catch(ie){Mt(h,z,ie)}}}u=u.next}while(u!==m)}}catch(ie){Mt(o,o.return,ie)}}function H1(s){var o=s.updateQueue;if(o!==null){var a=s.stateNode;try{Dx(o,a)}catch(u){Mt(s,s.return,u)}}}function V1(s,o,a){a.props=Ua(s.type,s.memoizedProps),a.state=s.memoizedState;try{a.componentWillUnmount()}catch(u){Mt(s,o,u)}}function Bu(s,o){try{var a=s.ref;if(a!==null){switch(s.tag){case 26:case 27:case 5:var u=s.stateNode;break;case 30:u=s.stateNode;break;default:u=s.stateNode}typeof a=="function"?s.refCleanup=a(u):a.current=u}}catch(h){Mt(s,o,h)}}function Ur(s,o){var a=s.ref,u=s.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(h){Mt(s,o,h)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){Mt(s,o,h)}else a.current=null}function F1(s){var o=s.type,a=s.memoizedProps,u=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(h){Mt(s,s.return,h)}}function Vy(s,o,a){try{var u=s.stateNode;JB(u,s.type,a,o),u[ps]=o}catch(h){Mt(s,s.return,h)}}function q1(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Di(s.type)||s.tag===4}function Fy(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||q1(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Di(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function qy(s,o,a){var u=s.tag;if(u===5||u===6)s=s.stateNode,o?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(s,o):(o=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,o.appendChild(s),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=fo));else if(u!==4&&(u===27&&Di(s.type)&&(a=s.stateNode,o=null),s=s.child,s!==null))for(qy(s,o,a),s=s.sibling;s!==null;)qy(s,o,a),s=s.sibling}function mp(s,o,a){var u=s.tag;if(u===5||u===6)s=s.stateNode,o?a.insertBefore(s,o):a.appendChild(s);else if(u!==4&&(u===27&&Di(s.type)&&(a=s.stateNode),s=s.child,s!==null))for(mp(s,o,a),s=s.sibling;s!==null;)mp(s,o,a),s=s.sibling}function G1(s){var o=s.stateNode,a=s.memoizedProps;try{for(var u=s.type,h=o.attributes;h.length;)o.removeAttributeNode(h[0]);Un(o,u,a),o[Ln]=s,o[ps]=a}catch(m){Mt(s,s.return,m)}}var wo=!1,mn=!1,Gy=!1,Z1=typeof WeakSet=="function"?WeakSet:Set,An=null;function DB(s,o){if(s=s.containerInfo,p0=Lp,s=ox(s),$g(s)){if("selectionStart"in s)var a={start:s.selectionStart,end:s.selectionEnd};else e:{a=(a=s.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var h=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,A=-1,z=-1,K=0,ie=0,de=s,Q=null;t:for(;;){for(var se;de!==a||h!==0&&de.nodeType!==3||(A=x+h),de!==m||u!==0&&de.nodeType!==3||(z=x+u),de.nodeType===3&&(x+=de.nodeValue.length),(se=de.firstChild)!==null;)Q=de,de=se;for(;;){if(de===s)break t;if(Q===a&&++K===h&&(A=x),Q===m&&++ie===u&&(z=x),(se=de.nextSibling)!==null)break;de=Q,Q=de.parentNode}de=se}a=A===-1||z===-1?null:{start:A,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(h0={focusedElem:s,selectionRange:a},Lp=!1,An=o;An!==null;)if(o=An,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,An=s;else for(;An!==null;){switch(o=An,m=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(a=0;a title"))),Un(m,u,a),m[Ln]=s,Cn(m),u=m;break e;case"link":var x=JR("link","href",h).get(u+(a.href||""));if(x){for(var A=0;ALt&&(x=Lt,Lt=He,He=x);var q=sx(A,He),F=sx(A,Lt);if(q&&F&&(se.rangeCount!==1||se.anchorNode!==q.node||se.anchorOffset!==q.offset||se.focusNode!==F.node||se.focusOffset!==F.offset)){var Z=de.createRange();Z.setStart(q.node,q.offset),se.removeAllRanges(),He>Lt?(se.addRange(Z),se.extend(F.node,F.offset)):(Z.setEnd(F.node,F.offset),se.addRange(Z))}}}}for(de=[],se=A;se=se.parentNode;)se.nodeType===1&&de.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;Aa?32:a,V.T=null,a=Jy,Jy=null;var m=Ii,x=Ao;if(wn=0,tl=Ii=null,Ao=0,(wt&6)!==0)throw Error(r(331));var A=wt;if(wt|=4,rR(m.current),tR(m,m.current,x,a),wt=A,Fu(0,!1),Gn&&typeof Gn.onPostCommitFiberRoot=="function")try{Gn.onPostCommitFiberRoot(fi,m)}catch{}return!0}finally{oe.p=h,V.T=u,wR(s,o)}}function xR(s,o,a){o=sr(a,o),o=Dy(s.stateNode,o,2),s=wi(s,o,2),s!==null&&(Ra(s,2),jr(s))}function Mt(s,o,a){if(s.tag===3)xR(s,s,a);else for(;o!==null;){if(o.tag===3){xR(o,s,a);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ti===null||!Ti.has(u))){s=sr(a,s),a=R1(2),u=wi(o,a,2),u!==null&&(C1(a,u,o,s),Ra(u,2),jr(u));break}}o=o.return}}function s0(s,o,a){var u=s.pingCache;if(u===null){u=s.pingCache=new NB;var h=new Set;u.set(o,h)}else h=u.get(o),h===void 0&&(h=new Set,u.set(o,h));h.has(a)||(Qy=!0,h.add(a),s=UB.bind(null,s,o,a),o.then(s,s))}function UB(s,o,a){var u=s.pingCache;u!==null&&u.delete(o),s.pingedLanes|=s.suspendedLanes&a,s.warmLanes&=~a,Ut===s&&(at&a)===a&&(sn===4||sn===3&&(at&62914560)===at&&300>It()-bp?(wt&2)===0&&nl(s,0):Yy|=a,el===at&&(el=0)),jr(s)}function RR(s,o){o===0&&(o=Cd()),s=Oa(s,o),s!==null&&(Ra(s,o),jr(s))}function jB(s){var o=s.memoizedState,a=0;o!==null&&(a=o.retryLane),RR(s,a)}function HB(s,o){var a=0;switch(s.tag){case 31:case 13:var u=s.stateNode,h=s.memoizedState;h!==null&&(a=h.retryLane);break;case 19:u=s.stateNode;break;case 22:u=s.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(o),RR(s,a)}function VB(s,o){return Bt(s,o)}var Rp=null,rl=null,r0=!1,Cp=!1,o0=!1,Mi=0;function jr(s){s!==rl&&s.next===null&&(rl===null?Rp=rl=s:rl=rl.next=s),Cp=!0,r0||(r0=!0,qB())}function Fu(s,o){if(!o0&&Cp){o0=!0;do for(var a=!1,u=Rp;u!==null;){if(s!==0){var h=u.pendingLanes;if(h===0)var m=0;else{var x=u.suspendedLanes,A=u.pingedLanes;m=(1<<31-Zn(42|s)+1)-1,m&=h&~(x&~A),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,IR(u,m))}else m=at,m=di(u,u===Ut?m:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(m&3)===0||pi(u,m)||(a=!0,IR(u,m));u=u.next}while(a);o0=!1}}function FB(){CR()}function CR(){Cp=r0=!1;var s=0;Mi!==0&&t$()&&(s=Mi);for(var o=It(),a=null,u=Rp;u!==null;){var h=u.next,m=AR(u,o);m===0?(u.next=null,a===null?Rp=h:a.next=h,h===null&&(rl=a)):(a=u,(s!==0||(m&3)!==0)&&(Cp=!0)),u=h}wn!==0&&wn!==5||Fu(s),Mi!==0&&(Mi=0)}function AR(s,o){for(var a=s.suspendedLanes,u=s.pingedLanes,h=s.expirationTimes,m=s.pendingLanes&-62914561;0A)break;var ie=z.transferSize,de=z.initiatorType;ie&&zR(de)&&(z=z.responseEnd,x+=ie*(z"u"?null:document;function QR(s,o,a){var u=ol;if(u&&typeof o=="string"&&o){var h=tr(o);h='link[rel="'+s+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),KR.has(h)||(KR.add(h),s={rel:s,crossOrigin:a,href:o},u.querySelector(h)===null&&(o=u.createElement("link"),Un(o,"link",s),Cn(o),u.head.appendChild(o)))}}function u$(s){To.D(s),QR("dns-prefetch",s,null)}function f$(s,o){To.C(s,o),QR("preconnect",s,o)}function d$(s,o,a){To.L(s,o,a);var u=ol;if(u&&s&&o){var h='link[rel="preload"][as="'+tr(o)+'"]';o==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+tr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+tr(a.imageSizes)+'"]')):h+='[href="'+tr(s)+'"]';var m=h;switch(o){case"style":m=il(s);break;case"script":m=al(s)}lr.has(m)||(s=g({rel:"preload",href:o==="image"&&a&&a.imageSrcSet?void 0:s,as:o},a),lr.set(m,s),u.querySelector(h)!==null||o==="style"&&u.querySelector(Ku(m))||o==="script"&&u.querySelector(Qu(m))||(o=u.createElement("link"),Un(o,"link",s),Cn(o),u.head.appendChild(o)))}}function p$(s,o){To.m(s,o);var a=ol;if(a&&s){var u=o&&typeof o.as=="string"?o.as:"script",h='link[rel="modulepreload"][as="'+tr(u)+'"][href="'+tr(s)+'"]',m=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=al(s)}if(!lr.has(m)&&(s=g({rel:"modulepreload",href:s},o),lr.set(m,s),a.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Qu(m)))return}u=a.createElement("link"),Un(u,"link",s),Cn(u),a.head.appendChild(u)}}}function h$(s,o,a){To.S(s,o,a);var u=ol;if(u&&s){var h=Tc(u).hoistableStyles,m=il(s);o=o||"default";var x=h.get(m);if(!x){var A={loading:0,preload:null};if(x=u.querySelector(Ku(m)))A.loading=5;else{s=g({rel:"stylesheet",href:s,"data-precedence":o},a),(a=lr.get(m))&&_0(s,a);var z=x=u.createElement("link");Cn(z),Un(z,"link",s),z._p=new Promise(function(K,ie){z.onload=K,z.onerror=ie}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Mp(x,o,u)}x={type:"stylesheet",instance:x,count:1,state:A},h.set(m,x)}}}function m$(s,o){To.X(s,o);var a=ol;if(a&&s){var u=Tc(a).hoistableScripts,h=al(s),m=u.get(h);m||(m=a.querySelector(Qu(h)),m||(s=g({src:s,async:!0},o),(o=lr.get(h))&&w0(s,o),m=a.createElement("script"),Cn(m),Un(m,"link",s),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(h,m))}}function g$(s,o){To.M(s,o);var a=ol;if(a&&s){var u=Tc(a).hoistableScripts,h=al(s),m=u.get(h);m||(m=a.querySelector(Qu(h)),m||(s=g({src:s,async:!0,type:"module"},o),(o=lr.get(h))&&w0(s,o),m=a.createElement("script"),Cn(m),Un(m,"link",s),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(h,m))}}function YR(s,o,a,u){var h=(h=_e.current)?Op(h):null;if(!h)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(o=il(a.href),a=Tc(h).hoistableStyles,u=a.get(o),u||(u={type:"style",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){s=il(a.href);var m=Tc(h).hoistableStyles,x=m.get(s);if(x||(h=h.ownerDocument||h,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(s,x),(m=h.querySelector(Ku(s)))&&!m._p&&(x.instance=m,x.state.loading=5),lr.has(s)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},lr.set(s,a),m||y$(h,s,a,x.state))),o&&u===null)throw Error(r(528,""));return x}if(o&&u!==null)throw Error(r(529,""));return null;case"script":return o=a.async,a=a.src,typeof a=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=al(a),a=Tc(h).hoistableScripts,u=a.get(o),u||(u={type:"script",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function il(s){return'href="'+tr(s)+'"'}function Ku(s){return'link[rel="stylesheet"]['+s+"]"}function XR(s){return g({},s,{"data-precedence":s.precedence,precedence:null})}function y$(s,o,a,u){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=s.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),Un(o,"link",a),Cn(o),s.head.appendChild(o))}function al(s){return'[src="'+tr(s)+'"]'}function Qu(s){return"script[async]"+s}function WR(s,o,a){if(o.count++,o.instance===null)switch(o.type){case"style":var u=s.querySelector('style[data-href~="'+tr(a.href)+'"]');if(u)return o.instance=u,Cn(u),u;var h=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(s.ownerDocument||s).createElement("style"),Cn(u),Un(u,"style",h),Mp(u,a.precedence,s),o.instance=u;case"stylesheet":h=il(a.href);var m=s.querySelector(Ku(h));if(m)return o.state.loading|=4,o.instance=m,Cn(m),m;u=XR(a),(h=lr.get(h))&&_0(u,h),m=(s.ownerDocument||s).createElement("link"),Cn(m);var x=m;return x._p=new Promise(function(A,z){x.onload=A,x.onerror=z}),Un(m,"link",u),o.state.loading|=4,Mp(m,a.precedence,s),o.instance=m;case"script":return m=al(a.src),(h=s.querySelector(Qu(m)))?(o.instance=h,Cn(h),h):(u=a,(h=lr.get(m))&&(u=g({},a),w0(u,h)),s=s.ownerDocument||s,h=s.createElement("script"),Cn(h),Un(h,"link",u),s.head.appendChild(h),o.instance=h);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,Mp(u,a.precedence,s));return o.instance}function Mp(s,o,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,m=h,x=0;x title"):null)}function b$(s,o,a){if(a===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(s=o.disabled,typeof o.precedence=="string"&&s==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function tC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function v$(s,o,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=il(u.href),m=o.querySelector(Ku(h));if(m){o=m._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=kp.bind(s),o.then(s,s)),a.state.loading|=4,a.instance=m,Cn(m);return}m=o.ownerDocument||o,u=XR(u),(h=lr.get(h))&&_0(u,h),m=m.createElement("link"),Cn(m);var x=m;x._p=new Promise(function(A,z){x.onload=A,x.onerror=z}),Un(m,"link",u),a.instance=m}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(a,o),(o=a.state.preload)&&(a.state.loading&3)===0&&(s.count++,a=kp.bind(s),o.addEventListener("load",a),o.addEventListener("error",a))}}var E0=0;function S$(s,o){return s.stylesheets&&s.count===0&&Np(s,s.stylesheets),0E0?50:800)+o);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function kp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Np(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Pp=null;function Np(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Pp=new Map,o.forEach(_$,s),Pp=null,kp.call(s))}function _$(s,o){if(!(o.state.loading&4)){var a=Pp.get(s);if(a)var u=a.get(null);else{a=new Map,Pp.set(s,a);for(var h=s.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),G0.exports=v5(),G0.exports}var _5=S5();const w5=O2(_5);var Q0={exports:{}},Y0={};var nA;function E5(){if(nA)return Y0;nA=1;var e=zl().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Y0.c=function(t){return e.H.useMemoCache(t)},Y0}var sA;function x5(){return sA||(sA=1,Q0.exports=E5()),Q0.exports}var kt=x5();const uO=M.createContext(void 0);function R5(e,t){try{const n=localStorage.getItem(e);if(n==="light"||n==="dark"||n==="system")return n}catch{}return t}function C5(e){const t=kt.c(14),{children:n,defaultTheme:r,storageKey:i}=e,c=r===void 0?"system":r,l=i===void 0?"ui-theme":i;let f;t[0]!==c||t[1]!==l?(f=()=>R5(l,c),t[0]=c,t[1]=l,t[2]=f):f=t[2];const[d,p]=M.useState(f);let b,g;t[3]!==d?(b=()=>{const R=window.document.documentElement;if(R.classList.remove("light","dark"),d==="system"){const C=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";R.classList.add(C);return}R.classList.add(d)},g=[d],t[3]=d,t[4]=b,t[5]=g):(b=t[4],g=t[5]),M.useEffect(b,g);let v;t[6]!==l?(v=R=>{try{localStorage.setItem(l,R)}catch{}p(R)},t[6]=l,t[7]=v):v=t[7];let S;t[8]!==v||t[9]!==d?(S={theme:d,setTheme:v},t[8]=v,t[9]=d,t[10]=S):S=t[10];const w=S;let E;return t[11]!==n||t[12]!==w?(E=N.jsx(uO.Provider,{value:w,children:n}),t[11]=n,t[12]=w,t[13]=E):E=t[13],E}function A5(){const e=M.useContext(uO);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function nv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const _f={};function Sm(e,t,n,r,i){let c={...sv(e,_f)};return t&&(c=gf(c,t)),n&&(c=gf(c,n)),r&&(c=gf(c,r)),i&&(c=gf(c,i)),c}function T5(e){if(e.length===0)return _f;if(e.length===1)return sv(e[0],_f);let t={...sv(e[0],_f)};for(let n=1;n=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function fO(e){return typeof e=="function"}function sv(e,t){return fO(e)?e(t):e??_f}function M5(e,t){return t?e?n=>{if(D5(n)){const i=n;rv(i);const c=t(i);return i.baseUIHandlerPrevented||e?.(i),c}const r=t(n);return e?.(n),r}:t:e}function rv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function dO(e,t){return t?e?t+" "+e:t:e}function D5(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Fo(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const rA={};function vr(e,t){const n=M.useRef(rA);return n.current===rA&&(n.current=e(t)),n}function Nh(e,t,n,r){const i=vr(pO).current;return P5(i,e,t,n,r)&&hO(i,[e,t,n,r]),i.callback}function k5(e){const t=vr(pO).current;return N5(t,e)&&hO(t,e),t.callback}function pO(){return{callback:null,cleanup:null,refs:[]}}function P5(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function N5(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function hO(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i{for(let i=0;i=e}function oA(e){if(!M.isValidElement(e))return null;const t=e,n=t.props;return(Wv(19)?n?.ref:t.ref)??null}function z5(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const c=t[r](i);c!=null&&Object.assign(n,c);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function B5(e,t){return typeof e=="function"?e(t):e}function $5(e,t){return typeof e=="function"?e(t):e}function mO(){}const ORe=Object.freeze([]),Hs=Object.freeze({}),U5={style:{transition:"none"}},j5="data-base-ui-click-trigger",MRe={fallbackAxisSide:"none"},H5={fallbackAxisSide:"end"},V5={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Sr(e,t,n={}){const r=t.render,i=F5(t,n);if(n.enabled===!1)return null;const c=n.state??Hs;return G5(e,r,i,c)}function F5(e,t={}){const{className:n,style:r,render:i}=e,{state:c=Hs,ref:l,props:f,stateAttributesMapping:d,enabled:p=!0}=t,b=p?B5(n,c):void 0,g=p?$5(r,c):void 0,v=p?z5(c,d):Hs,S=p?nv(v,Array.isArray(f)?T5(f):f)??Hs:Hs;return typeof document<"u"&&(p?Array.isArray(l)?S.ref=k5([S.ref,oA(i),...l]):S.ref=Nh(S.ref,oA(i),l):Nh(null,null)),p?(b!==void 0&&(S.className=dO(S.className,b)),g!==void 0&&(S.style=nv(S.style,g)),S):Hs}const q5=Symbol.for("react.lazy");function G5(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=Sm(n,t.props);i.ref=n.ref;let c=t;return c?.$$typeof===q5&&(c=M.Children.toArray(t)[0]),M.cloneElement(c,i)}if(e&&typeof e=="string")return Z5(e,n);throw new Error(Fo(8))}function Z5(e,t){return e==="button"?M.createElement("button",{type:"button",...t,key:t.key}):e==="img"?M.createElement("img",{alt:"",...t,key:t.key}):M.createElement(e,t)}function gO(e){return Sr(e.defaultTagName??"div",e,e)}function yO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,aA=bO,vO=(e,t)=>n=>{var r;if(t?.variants==null)return aA(e,n?.class,n?.className);const{variants:i,defaultVariants:c}=t,l=Object.keys(i).map(p=>{const b=n?.[p],g=c?.[p];if(b===null)return null;const v=iA(b)||iA(g);return i[p][v]}),f=n&&Object.entries(n).reduce((p,b)=>{let[g,v]=b;return v===void 0||(p[g]=v),p},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((p,b)=>{let{class:g,className:v,...S}=b;return Object.entries(S).every(w=>{let[E,R]=w;return Array.isArray(R)?R.includes({...c,...f}[E]):{...c,...f}[E]===R})?[...p,g,v]:p},[]);return aA(e,l,d,n?.class,n?.className)};const SO=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const K5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Q5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const cA=e=>{const t=Q5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Y5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const X5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const W5=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:c,iconNode:l,...f},d)=>M.createElement("svg",{ref:d,...Y5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:SO("lucide",i),...!c&&!X5(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,b])=>M.createElement(p,b)),...Array.isArray(c)?c:[c]]));const xs=(e,t)=>{const n=M.forwardRef(({className:r,...i},c)=>M.createElement(W5,{ref:c,iconNode:t,className:SO(`lucide-${K5(cA(e))}`,`lucide-${e}`,r),...i}));return n.displayName=cA(e),n};const J5=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],e8=xs("camera",J5);const t8=[["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"}]],n8=xs("circle-alert",t8);const s8=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],r8=xs("hard-drive",s8);const o8=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],i8=xs("house",o8);const a8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],c8=xs("image",a8);const l8=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],u8=xs("key",l8);const f8=[["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"}]],d8=xs("layout-grid",f8);const p8=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],h8=xs("log-out",p8);const m8=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],g8=xs("moon",m8);const y8=[["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"}]],b8=xs("network",y8);const v8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],S8=xs("panel-left",v8);const _8=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],lA=xs("server",_8);const w8=[["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"}]],E8=xs("sun",w8);const x8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],R8=xs("x",x8);function _m(){return typeof window<"u"}function sa(e){return Jv(e)?(e.nodeName||"").toLowerCase():"#document"}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function eo(e){var t;return(t=(Jv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jv(e){return _m()?e instanceof Node||e instanceof Sn(e).Node:!1}function Et(e){return _m()?e instanceof Element||e instanceof Sn(e).Element:!1}function yn(e){return _m()?e instanceof HTMLElement||e instanceof Sn(e).HTMLElement:!1}function ov(e){return!_m()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}const C8=new Set(["inline","contents"]);function ra(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Gs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!C8.has(i)}const A8=new Set(["table","td","th"]);function T8(e){return A8.has(sa(e))}const I8=[":popover-open",":modal"];function wm(e){return I8.some(t=>{try{return e.matches(t)}catch{return!1}})}const O8=["transform","translate","scale","rotate","perspective"],M8=["transform","translate","scale","rotate","perspective","filter"],D8=["paint","layout","strict","content"];function eS(e){const t=Em(),n=Et(e)?Gs(e):e;return O8.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||M8.some(r=>(n.willChange||"").includes(r))||D8.some(r=>(n.contain||"").includes(r))}function k8(e){let t=Uo(e);for(;yn(t)&&!Bo(t);){if(eS(t))return t;if(wm(t))return null;t=Uo(t)}return null}function Em(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const P8=new Set(["html","body","#document"]);function Bo(e){return P8.has(sa(e))}function Gs(e){return Sn(e).getComputedStyle(e)}function xm(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uo(e){if(sa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ov(e)&&e.host||eo(e);return ov(t)?t.host:t}function _O(e){const t=Uo(e);return Bo(t)?e.ownerDocument?e.ownerDocument.body:e.body:yn(t)&&ra(t)?t:_O(t)}function Wi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=_O(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),l=Sn(i);if(c){const f=iv(l);return t.concat(l,l.visualViewport||[],ra(i)?i:[],f&&n?Wi(f):[])}return t.concat(i,Wi(i,[],n))}function iv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const X0=Bv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],N8=X0&&X0!==M.useLayoutEffect?X0:e=>e();function Ge(e){const t=vr(L8).current;return t.next=e,N8(t.effect),t.trampoline}function L8(){const e={next:void 0,callback:z8,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function z8(){}const B8={...Bv},$8=()=>{},ht=typeof document<"u"?M.useLayoutEffect:$8,U8=M.createContext(void 0);function j8(e=!1){const t=M.useContext(U8);if(t===void 0&&!e)throw new Error(Fo(16));return t}function H8(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:c}=e,l=r&&t!==!1,f=r&&t===!1;return{props:M.useMemo(()=>{const p={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(p.tabIndex=i,!c&&n&&(p.tabIndex=t?i:-1)),(c&&(t||l)||!c&&n)&&(p["aria-disabled"]=n),c&&(!t||f)&&(p.disabled=n),p},[r,n,t,l,f,c,i])}}function wO(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,c=M.useRef(null),l=j8(!0)!==void 0,f=Ge(()=>{const v=c.current;return!!(v?.tagName==="A"&&v?.href)}),{props:d}=H8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),p=M.useCallback(()=>{const v=c.current;V8(v)&&l&&t&&d.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,d.disabled,l]);ht(p,[p]);const b=M.useCallback((v={})=>{const{onClick:S,onMouseDown:w,onKeyUp:E,onKeyDown:R,onPointerDown:C,...O}=v;return Sm({type:i?"button":void 0,onClick(T){if(t){T.preventDefault();return}S?.(T)},onMouseDown(T){t||w?.(T)},onKeyDown(T){if(t||(rv(T),R?.(T)),T.baseUIHandlerPrevented)return;const $=T.target===T.currentTarget&&!i&&!f()&&!t,j=T.key==="Enter",H=T.key===" ";$&&((H||j)&&T.preventDefault(),j&&S?.(T))},onKeyUp(T){t||(rv(T),E?.(T)),!T.baseUIHandlerPrevented&&T.target===T.currentTarget&&!i&&!t&&T.key===" "&&S?.(T)},onPointerDown(T){if(t){T.preventDefault();return}C?.(T)}},i?void 0:{role:"button"},d,O)},[t,d,i,f]),g=Ge(v=>{c.current=v,p()});return{getButtonProps:b,buttonRef:g}}function V8(e){return yn(e)&&e.tagName==="BUTTON"}const F8=M.forwardRef(function(t,n){const{render:r,className:i,disabled:c=!1,focusableWhenDisabled:l=!1,nativeButton:f=!0,...d}=t,{getButtonProps:p,buttonRef:b}=wO({disabled:c,focusableWhenDisabled:l,native:f});return Sr("button",t,{state:{disabled:c},ref:[n,b],props:[d,p]})}),q8=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),EO=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lh="-",uA=[],Z8="arbitrary..",K8=e=>{const t=Y8(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Q8(l);const f=l.split(Lh),d=f[0]===""&&f.length>1?1:0;return xO(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=r[l],p=n[l];return d?p?q8(p,d):d:p||uA}return n[l]||uA}}},xO=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],c=n.nextPart.get(i);if(c){const p=xO(e,t+1,c);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join(Lh):e.slice(t).join(Lh),d=l.length;for(let p=0;pe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Z8+r:void 0})(),Y8=e=>{const{theme:t,classGroups:n}=e;return X8(n,t)},X8=(e,t)=>{const n=EO();for(const r in e){const i=e[r];tS(i,n,r,t)}return n},tS=(e,t,n,r)=>{const i=e.length;for(let c=0;c{if(typeof e=="string"){J8(e,t,n);return}if(typeof e=="function"){ej(e,t,n,r);return}tj(e,t,n,r)},J8=(e,t,n)=>{const r=e===""?t:RO(t,e);r.classGroupId=n},ej=(e,t,n,r)=>{if(nj(e)){tS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(G8(n,e))},tj=(e,t,n,r)=>{const i=Object.entries(e),c=i.length;for(let l=0;l{let n=e;const r=t.split(Lh),i=r.length;for(let c=0;c"isThemeGetter"in e&&e.isThemeGetter===!0,sj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(c,l)=>{n[c]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(c){let l=n[c];if(l!==void 0)return l;if((l=r[c])!==void 0)return i(c,l),l},set(c,l){c in n?n[c]=l:i(c,l)}}},av="!",fA=":",rj=[],dA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),oj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const c=[];let l=0,f=0,d=0,p;const b=i.length;for(let E=0;Ed?p-d:void 0;return dA(c,S,v,w)};if(t){const i=t+fA,c=r;r=l=>l.startsWith(i)?c(l.slice(i.length)):dA(rj,!1,l,void 0,!0)}if(n){const i=r;r=c=>n({className:c,parseClassName:i})}return r},ij=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let c=0;c0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},aj=e=>({cache:sj(e.cacheSize),parseClassName:oj(e),sortModifiers:ij(e),...K8(e)}),cj=/\s+/,lj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:c}=t,l=[],f=e.trim().split(cj);let d="";for(let p=f.length-1;p>=0;p-=1){const b=f[p],{isExternal:g,modifiers:v,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:E}=n(b);if(g){d=b+(d.length>0?" "+d:d);continue}let R=!!E,C=r(R?w.substring(0,E):w);if(!C){if(!R){d=b+(d.length>0?" "+d:d);continue}if(C=r(w),!C){d=b+(d.length>0?" "+d:d);continue}R=!1}const O=v.length===0?"":v.length===1?v[0]:c(v).join(":"),k=S?O+av:O,T=k+C;if(l.indexOf(T)>-1)continue;l.push(T);const $=i(C,R);for(let j=0;j<$.length;++j){const H=$[j];l.push(k+H)}d=b+(d.length>0?" "+d:d)}return d},uj=(...e)=>{let t=0,n,r,i="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,i,c;const l=d=>{const p=t.reduce((b,g)=>g(b),e());return n=aj(p),r=n.cache.get,i=n.cache.set,c=f,f(d)},f=d=>{const p=r(d);if(p)return p;const b=lj(d,n);return i(d,b),b};return c=l,(...d)=>c(uj(...d))},dj=[],En=e=>{const t=n=>n[e]||dj;return t.isThemeGetter=!0,t},AO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,TO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mj=/\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$/,gj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bi=e=>pj.test(e),tt=e=>!!e&&!Number.isNaN(Number(e)),$i=e=>!!e&&Number.isInteger(Number(e)),W0=e=>e.endsWith("%")&&tt(e.slice(0,-1)),Io=e=>hj.test(e),IO=()=>!0,vj=e=>mj.test(e)&&!gj.test(e),nS=()=>!1,Sj=e=>yj.test(e),_j=e=>bj.test(e),wj=e=>!Ne(e)&&!Le(e),Ej=e=>oa(e,DO,nS),Ne=e=>AO.test(e),Fa=e=>oa(e,kO,vj),pA=e=>oa(e,Mj,tt),xj=e=>oa(e,NO,IO),Rj=e=>oa(e,PO,nS),hA=e=>oa(e,OO,nS),Cj=e=>oa(e,MO,_j),Zp=e=>oa(e,LO,Sj),Le=e=>TO.test(e),cf=e=>uc(e,kO),Aj=e=>uc(e,PO),mA=e=>uc(e,OO),Tj=e=>uc(e,DO),Ij=e=>uc(e,MO),Kp=e=>uc(e,LO,!0),Oj=e=>uc(e,NO,!0),oa=(e,t,n)=>{const r=AO.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uc=(e,t,n=!1)=>{const r=TO.exec(e);return r?r[1]?t(r[1]):n:!1},OO=e=>e==="position"||e==="percentage",MO=e=>e==="image"||e==="url",DO=e=>e==="length"||e==="size"||e==="bg-size",kO=e=>e==="length",Mj=e=>e==="number",PO=e=>e==="family-name",NO=e=>e==="number"||e==="weight",LO=e=>e==="shadow",Dj=()=>{const e=En("color"),t=En("font"),n=En("text"),r=En("font-weight"),i=En("tracking"),c=En("leading"),l=En("breakpoint"),f=En("container"),d=En("spacing"),p=En("radius"),b=En("shadow"),g=En("inset-shadow"),v=En("text-shadow"),S=En("drop-shadow"),w=En("blur"),E=En("perspective"),R=En("aspect"),C=En("ease"),O=En("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...T(),Le,Ne],j=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],P=()=>[Le,Ne,d],Y=()=>[Bi,"full","auto",...P()],ne=()=>[$i,"none","subgrid",Le,Ne],re=()=>["auto",{span:["full",$i,Le,Ne]},$i,Le,Ne],G=()=>[$i,"auto",Le,Ne],te=()=>["auto","min","max","fr",Le,Ne],ue=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ye=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...P()],oe=()=>[Bi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],J=()=>[Bi,"screen","full","dvw","lvw","svw","min","max","fit",...P()],ve=()=>[Bi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],fe=()=>[e,Le,Ne],B=()=>[...T(),mA,hA,{position:[Le,Ne]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ge=()=>["auto","cover","contain",Tj,Ej,{size:[Le,Ne]}],be=()=>[W0,cf,Fa],xe=()=>["","none","full",p,Le,Ne],_e=()=>["",tt,cf,Fa],Te=()=>["solid","dashed","dotted","double"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[tt,W0,mA,hA],Xe=()=>["","none",w,Le,Ne],_t=()=>["none",tt,Le,Ne],me=()=>["none",tt,Le,Ne],Ee=()=>[tt,Le,Ne],we=()=>[Bi,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Io],breakpoint:[Io],color:[IO],container:[Io],"drop-shadow":[Io],ease:["in","out","in-out"],font:[wj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Io],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Io],shadow:[Io],spacing:["px",tt],text:[Io],"text-shadow":[Io],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bi,Ne,Le,R]}],container:["container"],columns:[{columns:[tt,Ne,Le,f]}],"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"],sr:["sr-only","not-sr-only"],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:$()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[$i,"auto",Le,Ne]}],basis:[{basis:[Bi,"full","auto",f,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[tt,Bi,"auto","initial","none",Ne]}],grow:[{grow:["",tt,Le,Ne]}],shrink:[{shrink:["",tt,Le,Ne]}],order:[{order:[$i,"first","last","none",Le,Ne]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...ue(),"normal"]}],"justify-items":[{"justify-items":[...ye(),"normal"]}],"justify-self":[{"justify-self":["auto",...ye()]}],"align-content":[{content:["normal",...ue()]}],"align-items":[{items:[...ye(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ye(),{baseline:["","last"]}]}],"place-content":[{"place-content":ue()}],"place-items":[{"place-items":[...ye(),"baseline"]}],"place-self":[{"place-self":["auto",...ye()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[f,"screen",...oe()]}],"min-w":[{"min-w":[f,"screen","none",...oe()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",n,cf,Fa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Oj,xj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",W0,Ne]}],"font-family":[{font:[Aj,Rj,t]}],"font-features":[{"font-features":[Ne]}],"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:[i,Le,Ne]}],"line-clamp":[{"line-clamp":[tt,"none",Le,pA]}],leading:[{leading:[c,...P()]}],"list-image":[{"list-image":["none",Le,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:fe()}],"text-color":[{text:fe()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Te(),"wavy"]}],"text-decoration-thickness":[{decoration:[tt,"from-font","auto",Le,Fa]}],"text-decoration-color":[{decoration:fe()}],"underline-offset":[{"underline-offset":[tt,"auto",Le,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$i,Le,Ne],radial:["",Le,Ne],conic:[$i,Le,Ne]},Ij,Cj]}],"bg-color":[{bg:fe()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:fe()}],"gradient-via":[{via:fe()}],"gradient-to":[{to:fe()}],rounded:[{rounded:xe()}],"rounded-s":[{"rounded-s":xe()}],"rounded-e":[{"rounded-e":xe()}],"rounded-t":[{"rounded-t":xe()}],"rounded-r":[{"rounded-r":xe()}],"rounded-b":[{"rounded-b":xe()}],"rounded-l":[{"rounded-l":xe()}],"rounded-ss":[{"rounded-ss":xe()}],"rounded-se":[{"rounded-se":xe()}],"rounded-ee":[{"rounded-ee":xe()}],"rounded-es":[{"rounded-es":xe()}],"rounded-tl":[{"rounded-tl":xe()}],"rounded-tr":[{"rounded-tr":xe()}],"rounded-br":[{"rounded-br":xe()}],"rounded-bl":[{"rounded-bl":xe()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Te(),"hidden","none"]}],"divide-style":[{divide:[...Te(),"hidden","none"]}],"border-color":[{border:fe()}],"border-color-x":[{"border-x":fe()}],"border-color-y":[{"border-y":fe()}],"border-color-s":[{"border-s":fe()}],"border-color-e":[{"border-e":fe()}],"border-color-bs":[{"border-bs":fe()}],"border-color-be":[{"border-be":fe()}],"border-color-t":[{"border-t":fe()}],"border-color-r":[{"border-r":fe()}],"border-color-b":[{"border-b":fe()}],"border-color-l":[{"border-l":fe()}],"divide-color":[{divide:fe()}],"outline-style":[{outline:[...Te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[tt,Le,Ne]}],"outline-w":[{outline:["",tt,cf,Fa]}],"outline-color":[{outline:fe()}],shadow:[{shadow:["","none",b,Kp,Zp]}],"shadow-color":[{shadow:fe()}],"inset-shadow":[{"inset-shadow":["none",g,Kp,Zp]}],"inset-shadow-color":[{"inset-shadow":fe()}],"ring-w":[{ring:_e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:fe()}],"ring-offset-w":[{"ring-offset":[tt,Fa]}],"ring-offset-color":[{"ring-offset":fe()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":fe()}],"text-shadow":[{"text-shadow":["none",v,Kp,Zp]}],"text-shadow-color":[{"text-shadow":fe()}],opacity:[{opacity:[tt,Le,Ne]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[tt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":fe()}],"mask-image-linear-to-color":[{"mask-linear-to":fe()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":fe()}],"mask-image-t-to-color":[{"mask-t-to":fe()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":fe()}],"mask-image-r-to-color":[{"mask-r-to":fe()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":fe()}],"mask-image-b-to-color":[{"mask-b-to":fe()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":fe()}],"mask-image-l-to-color":[{"mask-l-to":fe()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":fe()}],"mask-image-x-to-color":[{"mask-x-to":fe()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":fe()}],"mask-image-y-to-color":[{"mask-y-to":fe()}],"mask-image-radial":[{"mask-radial":[Le,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":fe()}],"mask-image-radial-to-color":[{"mask-radial-to":fe()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[tt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":fe()}],"mask-image-conic-to-color":[{"mask-conic-to":fe()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ne]}],filter:[{filter:["","none",Le,Ne]}],blur:[{blur:Xe()}],brightness:[{brightness:[tt,Le,Ne]}],contrast:[{contrast:[tt,Le,Ne]}],"drop-shadow":[{"drop-shadow":["","none",S,Kp,Zp]}],"drop-shadow-color":[{"drop-shadow":fe()}],grayscale:[{grayscale:["",tt,Le,Ne]}],"hue-rotate":[{"hue-rotate":[tt,Le,Ne]}],invert:[{invert:["",tt,Le,Ne]}],saturate:[{saturate:[tt,Le,Ne]}],sepia:[{sepia:["",tt,Le,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ne]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[tt,Le,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[tt,Le,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",tt,Le,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tt,Le,Ne]}],"backdrop-invert":[{"backdrop-invert":["",tt,Le,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[tt,Le,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[tt,Le,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",tt,Le,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[tt,"initial",Le,Ne]}],ease:[{ease:["linear","initial",C,Le,Ne]}],delay:[{delay:[tt,Le,Ne]}],animate:[{animate:["none",O,Le,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Le,Ne]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:_t()}],"rotate-x":[{"rotate-x":_t()}],"rotate-y":[{"rotate-y":_t()}],"rotate-z":[{"rotate-z":_t()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[Le,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"translate-none":["translate-none"],accent:[{accent:fe()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:fe()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Le,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Le,Ne]}],fill:[{fill:["none",...fe()]}],"stroke-w":[{stroke:[tt,cf,Fa,pA]}],stroke:[{stroke:["none",...fe()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kj=fj(Dj);function cn(...e){return kj(bO(e))}function DRe(e){return e?new Date(e).toLocaleString(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Unknown"}function kRe(e){if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(2)} ${t[n]}`}const Pj=/\/$/;function PRe(e){return e.replace(Pj,"")}function Nj(e){return e&&(e.endsWith("/")?e:`${e}/`)}function Lj(e,t){return e.startsWith(t)?e:`${t}${e}`}function NRe(e,t){return e.startsWith(t)?e.slice(t.length):e}const zj=vO("group/button inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-md border border-transparent bg-clip-padding font-medium text-xs/relaxed outline-none transition-all focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Tl(e){const t=kt.c(12);let n,r,i,c;t[0]!==e?({className:n,variant:i,size:c,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c):(n=t[1],r=t[2],i=t[3],c=t[4]);const l=i===void 0?"default":i,f=c===void 0?"default":c;let d;t[5]!==n||t[6]!==f||t[7]!==l?(d=cn(zj({variant:l,size:f,className:n})),t[5]=n,t[6]=f,t[7]=l,t[8]=d):d=t[8];let p;return t[9]!==r||t[10]!==d?(p=N.jsx(F8,{className:d,"data-slot":"button",...r}),t[9]=r,t[10]=d,t[11]=p):p=t[11],p}let gA=0;function Bj(e,t="mui"){const[n,r]=M.useState(e),i=e||n;return M.useEffect(()=>{n==null&&(gA+=1,r(`${t}-${gA}`))},[n,t]),i}const yA=B8.useId;function Zf(e,t){if(yA!==void 0){const n=yA();return e??(t?`${t}-${n}`:n)}return Bj(e,t)}function sS(e){return Zf(e,"base-ui")}const $j=[];function rS(e){M.useEffect(e,$j)}const lf=0;class Jr{static create(){return new Jr}currentId=lf;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=lf,n()},t)}isStarted(){return this.currentId!==lf}clear=()=>{this.currentId!==lf&&(clearTimeout(this.currentId),this.currentId=lf)};disposeEffect=()=>this.clear}function Il(){const e=vr(Jr.create).current;return rS(e.disposeEffect),e}function Kt(e){return e?.ownerDocument||document}const Bl=typeof navigator<"u",J0=jj(),zO=Vj(),BO=Hj(),$O=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),UO=J0.platform==="MacIntel"&&J0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(J0.platform),jO=Bl&&/apple/i.test(navigator.vendor),cv=Bl&&/android/i.test(zO)||/android/i.test(BO),Uj=Bl&&zO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,HO=BO.includes("jsdom/");function jj(){if(!Bl)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Hj(){if(!Bl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Vj(){if(!Bl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const lv="data-base-ui-focusable",VO="active",FO="selected",qO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",LRe="ArrowLeft",zRe="ArrowRight",BRe="ArrowUp",$Re="ArrowDown";function Do(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function gt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ov(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function zh(e,t){if(!Et(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(gt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Ss(e){return"composedPath"in e?e.composedPath()[0]:e.target}function kr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Fj(e){return e.matches("html,body")}function oS(e){return yn(e)&&e.matches(qO)}function bA(e){return e?e.getAttribute("role")==="combobox"&&oS(e):!1}function qj(e){if(!e||HO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function uv(e){return e?e.hasAttribute(lv)?e:e.querySelector(`[${lv}]`)||e:null}function Ja(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...Ja(e,i.id,n)])}function vA(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(c=>c.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function Gj(e){e.preventDefault(),e.stopPropagation()}function Zj(e){return"nativeEvent"in e}function Kj(e){return e.pointerType===""&&e.isTrusted?!0:cv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Qj(e){return HO?!1:!cv&&e.width===0&&e.height===0||cv&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Pf(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Yj(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Xj=["top","right","bottom","left"],Ol=Math.min,js=Math.max,Bh=Math.round,Qp=Math.floor,Yr=e=>({x:e,y:e}),Wj={left:"right",right:"left",bottom:"top",top:"bottom"},Jj={start:"end",end:"start"};function fv(e,t,n){return js(e,Ol(t,n))}function jo(e,t){return typeof e=="function"?e(t):e}function Es(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function iS(e){return e==="x"?"y":"x"}function aS(e){return e==="y"?"height":"width"}const e9=new Set(["top","bottom"]);function br(e){return e9.has(Es(e))?"y":"x"}function cS(e){return iS(br(e))}function t9(e,t,n){n===void 0&&(n=!1);const r=ia(e),i=cS(e),c=aS(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(l=$h(l)),[l,$h(l)]}function n9(e){const t=$h(e);return[dv(e),t,dv(t)]}function dv(e){return e.replace(/start|end/g,t=>Jj[t])}const SA=["left","right"],_A=["right","left"],s9=["top","bottom"],r9=["bottom","top"];function o9(e,t,n){switch(e){case"top":case"bottom":return n?t?_A:SA:t?SA:_A;case"left":case"right":return t?s9:r9;default:return[]}}function i9(e,t,n,r){const i=ia(e);let c=o9(Es(e),n==="start",r);return i&&(c=c.map(l=>l+"-"+i),t&&(c=c.concat(c.map(dv)))),c}function $h(e){return e.replace(/left|right|bottom|top/g,t=>Wj[t])}function a9(e){return{top:0,right:0,bottom:0,left:0,...e}}function GO(e){return typeof e!="number"?a9(e):{top:e,right:e,bottom:e,left:e}}function Uh(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var c9=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],jh=c9.join(","),ZO=typeof Element>"u",Ml=ZO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hh=!ZO&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Vh=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),c=i===""||i==="true",l=c||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Vh(t.parentNode));return l},l9=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},KO=function(t,n,r){if(Vh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(jh));return n&&Ml.call(t,jh)&&i.unshift(t),i=i.filter(r),i},Fh=function(t,n,r){for(var i=[],c=Array.from(t);c.length;){var l=c.shift();if(!Vh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Fh(d,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var b=Ml.call(l,jh);b&&r.filter(l)&&(n||!t.includes(l))&&i.push(l);var g=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),v=!Vh(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(g&&v){var S=Fh(g===!0?l.children:g.children,!0,r);r.flatten?i.push.apply(i,S):i.push({scopeParent:l,candidates:S})}else c.unshift.apply(c,l.children)}}return i},QO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},YO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||l9(t))&&!QO(t)?0:t.tabIndex},u9=function(t,n){var r=YO(t);return r<0&&n&&!QO(t)?0:r},f9=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},XO=function(t){return t.tagName==="INPUT"},d9=function(t){return XO(t)&&t.type==="hidden"},p9=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},h9=function(t,n){for(var r=0;rsummary:first-of-type"),f=l?t.parentElement:t;if(Ml.call(f,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var d=t;t;){var p=t.parentElement,b=Hh(t);if(p&&!p.shadowRoot&&i(p)===!0)return wA(t);t.assignedSlot?t=t.assignedSlot:!p&&b!==t.ownerDocument?t=b.host:t=p}t=d}if(b9(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return wA(t);return!1},S9=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},WO=function(t){var n=[],r=[];return t.forEach(function(i,c){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=u9(f,l),p=l?WO(i.candidates):f;d===0?l?n.push.apply(n,p):n.push(f):r.push({documentOrder:c,tabIndex:d,item:i,isScope:l,content:p})}),r.sort(f9).reduce(function(i,c){return c.isScope?i.push.apply(i,c.content):i.push(c.content),i},[]).concat(n)},Rm=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Fh([t],n.includeContainer,{filter:hv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_9}):r=KO(t,n.includeContainer,hv.bind(null,n)),WO(r)},w9=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Fh([t],n.includeContainer,{filter:pv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=KO(t,n.includeContainer,pv.bind(null,n)),r},JO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ml.call(t,jh)===!1?!1:hv(n,t)};const Kf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eM(e,t){const n=Rm(e,Kf()),r=n.length;if(r===0)return;const i=Do(Kt(e)),c=n.indexOf(i),l=c===-1?t===1?0:r-1:c+t;return n[l]}function tM(e){return eM(Kt(e).body,1)||e}function nM(e){return eM(Kt(e).body,-1)||e}function wf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!gt(n,r)}function E9(e){Rm(e,Kf()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function EA(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Yp=null;class x9{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Xp=new x9;class Kr{static create(){return new Kr}static request(t){return Xp.request(t)}static cancel(t){return Xp.cancel(t)}currentId=Yp;request(t){this.cancel(),this.currentId=Xp.request(()=>{this.currentId=Yp,t()})}cancel=()=>{this.currentId!==Yp&&(Xp.cancel(this.currentId),this.currentId=Yp)};disposeEffect=()=>this.cancel}function sM(){const e=vr(Kr.create).current;return rS(e.disposeEffect),e}function Mo(e){return e==null?e:"current"in e?e.current:e}let Nf=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const R9={[Nf.startingStyle]:""},C9={[Nf.endingStyle]:""},lS={transitionStatus(e){return e==="starting"?R9:e==="ending"?C9:null}};function A9(e,t=!1,n=!0){const r=sM();return Ge((i,c=null)=>{r.cancel();function l(){na.flushSync(i)}const f=Mo(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let p=function(){const g=Nf.startingStyle;if(!d.hasAttribute(g)){r.request(b);return}const v=new MutationObserver(()=>{d.hasAttribute(g)||(v.disconnect(),b())});v.observe(d,{attributes:!0,attributeFilter:[g]}),c?.addEventListener("abort",()=>v.disconnect(),{once:!0})},b=function(){Promise.all(d.getAnimations().map(g=>g.finished)).then(()=>{c?.aborted||l()}).catch(()=>{const g=d.getAnimations();if(n){if(c?.aborted)return;l()}else g.length>0&&g.some(v=>v.pending||v.playState!=="finished")&&b()})};if(t){p();return}r.request(b)}})}function uS(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,c=Ge(i),l=A9(r,n,!1);M.useEffect(()=>{if(!t)return;const f=new AbortController;return l(c,f.signal),()=>{f.abort()}},[t,n,c,l])}function T9(e,t=!1,n=!1){const[r,i]=M.useState(e&&t?"idle":void 0),[c,l]=M.useState(e);return e&&!c&&(l(!0),i("starting")),!e&&c&&r!=="ending"&&!n&&i("ending"),!e&&!c&&r==="ending"&&i(void 0),ht(()=>{if(!e&&c&&r!=="ending"&&n){const f=Kr.request(()=>{i("ending")});return()=>{Kr.cancel(f)}}},[e,c,r,n]),ht(()=>{if(!e||t)return;const f=Kr.request(()=>{i(void 0)});return()=>{Kr.cancel(f)}},[t,e]),ht(()=>{if(!e||!t)return;e&&c&&r!=="idle"&&i("starting");const f=Kr.request(()=>{i("idle")});return()=>{Kr.cancel(f)}},[t,e,c,i,r]),M.useMemo(()=>({mounted:c,setMounted:l,transitionStatus:r}),[c,r])}const fS="none",qh="trigger-press",Lr="trigger-hover",bh="trigger-focus",rM="outside-press",URe="item-press",I9="close-press",oM="focus-out",dS="escape-key",jRe="list-navigation",HRe="cancel-open",O9="disabled",iM="imperative-action",VRe="window-resize";function Jt(e,t,n,r){let i=!1,c=!1;const l=Hs;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){c=!0},get isCanceled(){return i},get isPropagationAllowed(){return c},trigger:n,...l}}const aM=M.createContext(void 0);function fc(e){const t=M.useContext(aM);if(e===!1&&t===void 0)throw new Error(Fo(27));return t}let Qa=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Nf.startingStyle]="startingStyle",e[e.endingStyle=Nf.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Gh=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const M9={[Gh.popupOpen]:""},D9={[Gh.popupOpen]:"",[Gh.pressed]:""},k9={[Qa.open]:""},P9={[Qa.closed]:""},N9={[Qa.anchorHidden]:""},L9={open(e){return e?M9:null}},FRe={open(e){return e?D9:null}},Qf={open(e){return e?k9:P9},anchorHidden(e){return e?N9:null}},z9={...Qf,...lS},B9=M.forwardRef(function(t,n){const{render:r,className:i,forceRender:c=!1,...l}=t,{store:f}=fc(),d=f.useState("open"),p=f.useState("nested"),b=f.useState("mounted"),g=f.useState("transitionStatus");return Sr("div",t,{state:{open:d,transitionStatus:g},ref:[f.context.backdropRef,n],stateAttributesMapping:z9,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:c||!p})}),$9=M.forwardRef(function(t,n){const{render:r,className:i,disabled:c=!1,nativeButton:l=!0,...f}=t,{store:d}=fc(),p=d.useState("open");function b(w){p&&d.setOpen(!1,Jt(I9,w.nativeEvent))}const{getButtonProps:g,buttonRef:v}=wO({disabled:c,native:l});return Sr("button",t,{state:{disabled:c},ref:[n,v],props:[{onClick:b},f,g]})}),U9=M.forwardRef(function(t,n){const{render:r,className:i,id:c,...l}=t,{store:f}=fc(),d=sS(c);return f.useSyncedValueWithCleanup("descriptionElementId",d),Sr("p",t,{ref:n,props:[{id:d},l]})});function Qr(e){const t=vr(j9,e).current;return t.next=e,ht(t.effect),t}function j9(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function H9(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const V9=M.createContext(null),F9=M.createContext(null),Cm=()=>M.useContext(V9)?.id||null,Yf=e=>{const t=M.useContext(F9);return e??t};function Dl(e){return`data-base-ui-${e}`}function vh(e,t,n){if(n&&!Pf(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}const cM=M.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Jr,currentIdRef:{current:null},currentContextRef:{current:null}});function q9(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=M.useRef(n),c=M.useRef(n),l=M.useRef(null),f=M.useRef(null),d=Il();return N.jsx(cM.Provider,{value:M.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:c,currentIdRef:l,timeoutMs:r,currentContextRef:f,timeout:d}),[r,d]),children:t})}function G9(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:i}=t,c=M.useContext(cM),{currentIdRef:l,delayRef:f,timeoutMs:d,initialDelayRef:p,currentContextRef:b,hasProvider:g,timeout:v}=c,[S,w]=M.useState(!1);return ht(()=>{function E(){w(!1),b.current?.setIsInstantPhase(!1),l.current=null,b.current=null,f.current=p.current}if(l.current&&!i&&l.current===r){if(w(!1),d){const R=r;return v.start(d,()=>{n.select("open")||l.current&&l.current!==R||E()}),()=>{v.clear()}}E()}},[i,r,l,f,d,p,b,v,n]),ht(()=>{if(!i)return;const E=b.current,R=l.current;v.clear(),b.current={onOpenChange:n.setOpen,setIsInstantPhase:w},l.current=r,f.current={open:0,close:vh(p.current,"close")},R!==null&&R!==r?(w(!0),E?.setIsInstantPhase(!0),E?.onOpenChange(!1,Jt(fS))):(w(!1),E?.setIsInstantPhase(!1))},[i,r,n,l,f,d,p,b,v]),ht(()=>()=>{b.current=null},[b]),M.useMemo(()=>({hasProvider:g,delayRef:f,isInstantPhase:S}),[g,f,S])}const lM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},uM={...lM,position:"fixed",top:0,left:0},qRe={...lM,position:"absolute"},Zh=M.forwardRef(function(t,n){const[r,i]=M.useState();ht(()=>{jO&&i("button")},[]);const c={tabIndex:0,role:r};return N.jsx("span",{...t,ref:n,style:uM,"aria-hidden":r?void 0:!0,...c,"data-base-ui-focus-guard":""})});let xA=0;function eb(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(xA);const c=()=>e?.focus({preventScroll:n});i?c():xA=requestAnimationFrame(c)}const vl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function RA(e){return e==="inert"?vl.inert:e==="aria-hidden"?vl["aria-hidden"]:vl.none}let Wp=new WeakSet,Jp={},tb=0;const fM=e=>e&&(e.host||fM(e.parentNode)),Z9=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=fM(n);return e.contains(r)?r:null}).filter(n=>n!=null);function K9(e,t,n,r){const i="data-base-ui-inert",c=r?"inert":n?"aria-hidden":null,l=Z9(t,e),f=new Set,d=new Set(l),p=[];Jp[i]||(Jp[i]=new WeakMap);const b=Jp[i];l.forEach(g),v(t),f.clear();function g(S){!S||f.has(S)||(f.add(S),S.parentNode&&g(S.parentNode))}function v(S){!S||d.has(S)||[].forEach.call(S.children,w=>{if(sa(w)!=="script")if(f.has(w))v(w);else{const E=c?w.getAttribute(c):null,R=E!==null&&E!=="false",C=RA(c),O=(C.get(w)||0)+1,k=(b.get(w)||0)+1;C.set(w,O),b.set(w,k),p.push(w),O===1&&R&&Wp.add(w),k===1&&w.setAttribute(i,""),!R&&c&&w.setAttribute(c,c==="inert"?"":"true")}})}return tb+=1,()=>{p.forEach(S=>{const w=RA(c),R=(w.get(S)||0)-1,C=(b.get(S)||0)-1;w.set(S,R),b.set(S,C),R||(!Wp.has(S)&&c&&S.removeAttribute(c),Wp.delete(S)),C||S.removeAttribute(i)}),tb-=1,tb||(vl.inert=new WeakMap,vl["aria-hidden"]=new WeakMap,vl.none=new WeakMap,Wp=new WeakSet,Jp={})}}function Q9(e,t=!1,n=!1){const r=Kt(e[0]).body;return K9(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const dM=M.createContext(null),pM=()=>M.useContext(dM),Y9=Dl("portal");function hM(e={}){const{ref:t,container:n,componentProps:r=Hs,elementProps:i}=e,c=Zf(),f=pM()?.portalNode,[d,p]=M.useState(null),[b,g]=M.useState(null),v=Ge(R=>{R!==null&&g(R)}),S=M.useRef(null);ht(()=>{if(n===null){S.current&&(S.current=null,g(null),p(null));return}if(c==null)return;const R=(n&&(Jv(n)?n:n.current))??f??document.body;if(R==null){S.current&&(S.current=null,g(null),p(null));return}S.current!==R&&(S.current=R,g(null),p(R))},[n,f,c]);const w=Sr("div",r,{ref:[t,v],props:[{id:c,[Y9]:""},i]});return{portalNode:b,portalSubtree:d&&w?na.createPortal(w,d):null}}const X9=M.forwardRef(function(t,n){const{children:r,container:i,className:c,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:b}=hM({container:i,ref:n,componentProps:t,elementProps:d}),g=M.useRef(null),v=M.useRef(null),S=M.useRef(null),w=M.useRef(null),[E,R]=M.useState(null),C=E?.modal,O=E?.open,k=typeof f=="boolean"?f:!!E&&!E.modal&&E.open&&!!p;M.useEffect(()=>{if(!p||C)return;function $(j){p&&j.relatedTarget&&wf(j)&&(j.type==="focusin"?EA:E9)(p)}return p.addEventListener("focusin",$,!0),p.addEventListener("focusout",$,!0),()=>{p.removeEventListener("focusin",$,!0),p.removeEventListener("focusout",$,!0)}},[p,C]),M.useEffect(()=>{!p||O||EA(p)},[O,p]);const T=M.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:v,beforeInsideRef:S,afterInsideRef:w,portalNode:p,setFocusManagerState:R}),[p]);return N.jsxs(M.Fragment,{children:[b,N.jsxs(dM.Provider,{value:T,children:[k&&p&&N.jsx(Zh,{"data-type":"outside",ref:g,onFocus:$=>{if(wf($,p))S.current?.focus();else{const j=E?E.domReference:null;nM(j)?.focus()}}}),k&&p&&N.jsx("span",{"aria-owns":p.id,style:V5}),p&&na.createPortal(r,p),k&&p&&N.jsx(Zh,{"data-type":"outside",ref:v,onFocus:$=>{if(wf($,p))w.current?.focus();else{const j=E?E.domReference:null;tM(j)?.focus(),E?.closeOnFocusOut&&E?.onOpenChange(!1,Jt(oM,$.nativeEvent))}}})]})]})});function W9(e,t){const n=Sn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const CA=20;let Ki=[];function pS(){Ki=Ki.filter(e=>e.deref()?.isConnected)}function J9(e){pS(),e&&sa(e)!=="body"&&(Ki.push(new WeakRef(e)),Ki.length>CA&&(Ki=Ki.slice(-CA)))}function nb(){return pS(),Ki[Ki.length-1]?.deref()}function eH(e){if(!e)return null;const t=Kf();return JO(e,t)?e:Rm(e,t)[0]||e}function tH(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Gs(e).display!=="none"}function AA(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Kf(),i=w9(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return JO(l,n)||l.hasAttribute("data-tabindex")&&!f.startsWith("-")}),c=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?c!=="0"&&e.setAttribute("tabindex","0"):(c!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function nH(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:c=!0,restoreFocus:l=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:p="",nextFocusableElement:b,previousFocusableElement:g,beforeContentFocusGuardRef:v,externalTree:S}=e,w="rootStore"in t?t.rootStore:t,E=w.useState("open"),R=w.useState("domReferenceElement"),C=w.useState("floatingElement"),{events:O,dataRef:k}=w.context,T=Ge(()=>k.current.floatingContext?.nodeId),$=i===!1,j=bA(R)&&$,H=M.useRef(["content"]),P=Qr(i),Y=Qr(c),ne=Qr(p),re=Yf(S),G=pM(),te=M.useRef(null),ue=M.useRef(null),ye=M.useRef(!1),V=M.useRef(!1),oe=M.useRef(!1),J=M.useRef(-1),ve=M.useRef(""),fe=M.useRef(""),B=M.useRef(null),ee=M.useRef(null),ge=Nh(B,v,G?.beforeInsideRef),be=Nh(ee,G?.afterInsideRef),xe=Il(),_e=Il(),Te=sM(),Fe=G!=null,Se=uv(C),Xe=Ge((Ee=Se)=>Ee?Rm(Ee,Kf()):[]),_t=Ge(Ee=>{const we=Xe(Ee);return H.current.map(()=>we).filter(Boolean).flat()});M.useEffect(()=>{if(r||!f)return;function Ee(qe){qe.key==="Tab"&>(Se,Do(Kt(Se)))&&Xe().length===0&&!j&&Gj(qe)}const we=Kt(Se);return we.addEventListener("keydown",Ee),()=>{we.removeEventListener("keydown",Ee)}},[r,R,Se,f,H,j,Xe,_t]),M.useEffect(()=>{if(r||!E)return;const Ee=Kt(Se);function we(){oe.current=!1}function qe(je){const De=Ss(je),nt=gt(C,De)||gt(R,De)||gt(G?.portalNode,De);oe.current=!nt,fe.current=je.pointerType||"keyboard",De?.closest(`[${j5}]`)&&(V.current=!0)}function Oe(){fe.current="keyboard"}return Ee.addEventListener("pointerdown",qe,!0),Ee.addEventListener("pointerup",we,!0),Ee.addEventListener("pointercancel",we,!0),Ee.addEventListener("keydown",Oe,!0),()=>{Ee.removeEventListener("pointerdown",qe,!0),Ee.removeEventListener("pointerup",we,!0),Ee.removeEventListener("pointercancel",we,!0),Ee.removeEventListener("keydown",Oe,!0)}},[r,C,R,Se,E,G]),M.useEffect(()=>{if(r||!d)return;const Ee=Kt(Se);function we(){V.current=!0,_e.start(0,()=>{V.current=!1})}function qe(Bt){const We=Ss(Bt),Rn=Xe().indexOf(We);Rn!==-1&&(J.current=Rn)}function Oe(Bt){const We=Bt.relatedTarget,Tt=Bt.currentTarget,Rn=Ss(Bt);queueMicrotask(()=>{const It=T(),Tr=w.context.triggerElements,dt=We?.hasAttribute(Dl("focus-guard"))&&[B.current,ee.current,G?.beforeInsideRef.current,G?.afterInsideRef.current,G?.beforeOutsideRef.current,G?.afterOutsideRef.current,Mo(g),Mo(b)].includes(We),$t=!(gt(R,We)||gt(C,We)||gt(We,C)||gt(G?.portalNode,We)||We!=null&&Tr.hasElement(We)||Tr.hasMatchingElement(mt=>gt(mt,We))||dt||re&&(Ja(re.nodesRef.current,It).find(mt=>gt(mt.context?.elements.floating,We)||gt(mt.context?.elements.domReference,We))||vA(re.nodesRef.current,It).find(mt=>[mt.context?.elements.floating,uv(mt.context?.elements.floating)].includes(We)||mt.context?.elements.domReference===We)));if(Tt===R&&Se&&AA(Se,H),l&&Tt!==R&&!tH(Rn)&&Do(Ee)===Ee.body){if(yn(Se)&&(Se.focus(),l==="popup")){Te.request(()=>{Se.focus()});return}const mt=J.current,Os=Xe(),Xs=Os[mt]||Os[Os.length-1]||Se;yn(Xs)&&Xs.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(j||!f)&&We&&$t&&!V.current&&(j||We!==nb())&&(ye.current=!0,w.setOpen(!1,Jt(oM,Bt)))})}function je(){oe.current||(k.current.insideReactTree=!0,xe.start(0,()=>{k.current.insideReactTree=!1}))}const De=yn(R)?R:null,nt=[];if(!(!C&&!De))return De&&(De.addEventListener("focusout",Oe),De.addEventListener("pointerdown",we),nt.push(()=>{De.removeEventListener("focusout",Oe),De.removeEventListener("pointerdown",we)})),C&&(C.addEventListener("focusin",qe),C.addEventListener("focusout",Oe),G&&(C.addEventListener("focusout",je,!0),nt.push(()=>{C.removeEventListener("focusout",je,!0)})),nt.push(()=>{C.removeEventListener("focusin",qe),C.removeEventListener("focusout",Oe)})),()=>{nt.forEach(Bt=>{Bt()})}},[r,R,C,Se,f,re,G,w,d,l,Xe,j,T,H,k,xe,_e,Te,b,g]),M.useEffect(()=>{if(r||!C||!E)return;const Ee=Array.from(G?.portalNode?.querySelectorAll(`[${Dl("portal")}]`)||[]),qe=(re?vA(re.nodesRef.current,T()):[]).find(je=>bA(je.context?.elements.domReference||null))?.context?.elements.domReference,Oe=[C,qe,...Ee,te.current,ue.current,B.current,ee.current,G?.beforeOutsideRef.current,G?.afterOutsideRef.current,Mo(g),Mo(b),j?R:null].filter(je=>je!=null);return Q9(Oe,f||j)},[E,r,R,C,f,H,G,j,re,T,b,g]),ht(()=>{if(!E||r||!yn(Se))return;const Ee=Kt(Se),we=Do(Ee);queueMicrotask(()=>{const qe=_t(Se),Oe=P.current,je=typeof Oe=="function"?Oe(ne.current||""):Oe;if(je===void 0||je===!1)return;let De;je===!0||je===null?De=qe[0]||Se:De=Mo(je),De=De||qe[0]||Se,!gt(Se,we)&&eb(De,{preventScroll:De===Se})})},[r,E,Se,$,_t,P,ne]),ht(()=>{if(r||!Se)return;const Ee=Kt(Se),we=Do(Ee);J9(we);function qe(De){if(De.open||(ve.current=W9(De.nativeEvent,fe.current)),De.reason===Lr&&De.nativeEvent.type==="mouseleave"&&(ye.current=!0),De.reason===rM)if(De.nested)ye.current=!1;else if(Kj(De.nativeEvent)||Qj(De.nativeEvent))ye.current=!1;else{let nt=!1;document.createElement("div").focus({get preventScroll(){return nt=!0,!1}}),nt?ye.current=!1:ye.current=!0}}O.on("openchange",qe);const Oe=Ee.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,uM),Fe&&R&&R.insertAdjacentElement("afterend",Oe);function je(){const De=Y.current;let nt=typeof De=="function"?De(ve.current):De;if(nt===void 0||nt===!1)return null;if(nt===null&&(nt=!0),typeof nt=="boolean"){const We=R||nb();return We&&We.isConnected?We:Oe}const Bt=R||nb()||Oe;return Mo(nt)||Bt}return()=>{O.off("openchange",qe);const De=Do(Ee),nt=gt(C,De)||re&&Ja(re.nodesRef.current,T(),!1).some(We=>gt(We.context?.elements.floating,De)),Bt=je();queueMicrotask(()=>{const We=eH(Bt),Tt=typeof Y.current!="boolean";Y.current&&!ye.current&&yn(We)&&(!(!Tt&&We!==De&&De!==Ee.body)||nt)&&We.focus({preventScroll:!0}),Oe.remove(),ye.current=!1})}},[r,C,Se,Y,k,O,re,Fe,R,T]),ht(()=>{if(!$O||E||!C)return;const Ee=Do(Kt(C));!yn(Ee)||!oS(Ee)||gt(C,Ee)&&Ee.blur()},[E,C]),ht(()=>{if(!(r||!G))return G.setFocusManagerState({modal:f,closeOnFocusOut:d,open:E,onOpenChange:w.setOpen,domReference:R}),()=>{G.setFocusManagerState(null)}},[r,G,f,E,w,d,R]),ht(()=>{if(!(r||!Se))return AA(Se,H),()=>{queueMicrotask(pS)}},[r,Se,H]);const me=!r&&(f?!j:!0)&&(Fe||f);return N.jsxs(M.Fragment,{children:[me&&N.jsx(Zh,{"data-type":"inside",ref:ge,onFocus:Ee=>{if(f){const we=_t();eb(we[we.length-1])}else G?.portalNode&&(ye.current=!1,wf(Ee,G.portalNode)?tM(R)?.focus():Mo(g??G.beforeOutsideRef)?.focus())}}),n,me&&N.jsx(Zh,{"data-type":"inside",ref:be,onFocus:Ee=>{f?eb(_t()[0]):G?.portalNode&&(d&&(ye.current=!0),wf(Ee,G.portalNode)?nM(R)?.focus():Mo(b??G.afterOutsideRef)?.focus())}})]})}function sH(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){const c=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",f=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let p=c.width,b=c.height,g=c.x,v=c.y;return n==null&&t.x&&l&&(n=c.x-t.x),r==null&&t.y&&f&&(r=c.y-t.y),g-=n||0,v-=r||0,p=0,b=0,!i||d?(p=t.axis==="y"?c.width:0,b=t.axis==="x"?c.height:0,g=l&&t.x!=null?t.x:g,v=f&&t.y!=null?t.y:v):i&&!d&&(b=t.axis==="x"?c.height:b,p=t.axis==="y"?c.width:p),i=!0,{width:p,height:b,x:g,y:v,top:v,right:g+p,bottom:v+b,left:g}}}}function TA(e){return e!=null&&e.clientX!=null}function rH(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),c=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:f=!0,axis:d="both"}=t,p=M.useRef(!1),b=M.useRef(null),[g,v]=M.useState(),[S,w]=M.useState([]),E=Ge((T,$,j)=>{p.current||l.current.openEvent&&!TA(l.current.openEvent)||n.set("positionReference",sH(j??c,{x:T,y:$,axis:d,dataRef:l,pointerType:g}))}),R=Ge(T=>{r?b.current||w([]):E(T.clientX,T.clientY,T.currentTarget)}),C=Pf(g)?i:r,O=M.useCallback(()=>{if(!C||!f)return;const T=Sn(i);function $(j){const H=Ss(j);gt(i,H)?(T.removeEventListener("mousemove",$),b.current=null):E(j.clientX,j.clientY)}if(!l.current.openEvent||TA(l.current.openEvent)){T.addEventListener("mousemove",$);const j=()=>{T.removeEventListener("mousemove",$),b.current=null};return b.current=j,j}n.set("positionReference",c)},[C,f,i,l,c,n,E]);M.useEffect(()=>O(),[O,S]),M.useEffect(()=>{f&&!i&&(p.current=!1)},[f,i]),M.useEffect(()=>{!f&&r&&(p.current=!0)},[f,r]);const k=M.useMemo(()=>{function T($){v($.pointerType)}return{onPointerDown:T,onPointerEnter:T,onMouseMove:R,onMouseEnter:R}},[R]);return M.useMemo(()=>f?{reference:k,trigger:k}:{},[f,k])}function IA(e,t,n){let{reference:r,floating:i}=e;const c=br(t),l=cS(t),f=aS(l),d=Es(t),p=c==="y",b=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,v=r[f]/2-i[f]/2;let S;switch(d){case"top":S={x:b,y:r.y-i.height};break;case"bottom":S={x:b,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y:g};break;case"left":S={x:r.x-i.width,y:g};break;default:S={x:r.x,y:r.y}}switch(ia(t)){case"start":S[l]-=v*(n&&p?-1:1);break;case"end":S[l]+=v*(n&&p?-1:1);break}return S}async function oH(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:c,rects:l,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:b="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=jo(t,e),w=GO(S),R=f[v?g==="floating"?"reference":"floating":g],C=Uh(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(R)))==null||n?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:p,rootBoundary:b,strategy:d})),O=g==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),T=await(c.isElement==null?void 0:c.isElement(k))?await(c.getScale==null?void 0:c.getScale(k))||{x:1,y:1}:{x:1,y:1},$=Uh(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:O,offsetParent:k,strategy:d}):O);return{top:(C.top-$.top+w.top)/T.y,bottom:($.bottom-C.bottom+w.bottom)/T.y,left:(C.left-$.left+w.left)/T.x,right:($.right-C.right+w.right)/T.x}}const iH=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:l}=n,f=c.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:b,y:g}=IA(p,r,d),v=r,S={},w=0;for(let R=0;Rue<=0)){var re,G;const ue=(((re=c.flip)==null?void 0:re.index)||0)+1,ye=H[ue];if(ye&&(!(g==="alignment"?O!==br(ye):!1)||ne.every(J=>br(J.placement)===O?J.overflows[0]>0:!0)))return{data:{index:ue,overflows:ne},reset:{placement:ye}};let V=(G=ne.filter(oe=>oe.overflows[0]<=0).sort((oe,J)=>oe.overflows[1]-J.overflows[1])[0])==null?void 0:G.placement;if(!V)switch(S){case"bestFit":{var te;const oe=(te=ne.filter(J=>{if(j){const ve=br(J.placement);return ve===O||ve==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(ve=>ve>0).reduce((ve,fe)=>ve+fe,0)]).sort((J,ve)=>J[1]-ve[1])[0])==null?void 0:te[0];oe&&(V=oe);break}case"initialPlacement":V=f;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function OA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MA(e){return Xj.some(t=>e[t]>=0)}const cH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...c}=jo(e,t);switch(i){case"referenceHidden":{const l=await r.detectOverflow(t,{...c,elementContext:"reference"}),f=OA(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:MA(f)}}}case"escaped":{const l=await r.detectOverflow(t,{...c,altBoundary:!0}),f=OA(l,n.floating);return{data:{escapedOffsets:f,escaped:MA(f)}}}default:return{}}}}},mM=new Set(["left","top"]);async function lH(e,t){const{placement:n,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Es(n),f=ia(n),d=br(n)==="y",p=mM.has(l)?-1:1,b=c&&d?-1:1,g=jo(t,e);let{mainAxis:v,crossAxis:S,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof w=="number"&&(S=f==="end"?w*-1:w),d?{x:S*b,y:v*p}:{x:v*p,y:S*b}}const uH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:c,placement:l,middlewareData:f}=t,d=await lH(t,e);return l===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:c+d.y,data:{...d,placement:l}}}}},fH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:c}=t,{mainAxis:l=!0,crossAxis:f=!1,limiter:d={fn:C=>{let{x:O,y:k}=C;return{x:O,y:k}}},...p}=jo(e,t),b={x:n,y:r},g=await c.detectOverflow(t,p),v=br(Es(i)),S=iS(v);let w=b[S],E=b[v];if(l){const C=S==="y"?"top":"left",O=S==="y"?"bottom":"right",k=w+g[C],T=w-g[O];w=fv(k,w,T)}if(f){const C=v==="y"?"top":"left",O=v==="y"?"bottom":"right",k=E+g[C],T=E-g[O];E=fv(k,E,T)}const R=d.fn({...t,[S]:w,[v]:E});return{...R,data:{x:R.x-n,y:R.y-r,enabled:{[S]:l,[v]:f}}}}}},dH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=jo(e,t),b={x:n,y:r},g=br(i),v=iS(g);let S=b[v],w=b[g];const E=jo(f,t),R=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(d){const k=v==="y"?"height":"width",T=c.reference[v]-c.floating[k]+R.mainAxis,$=c.reference[v]+c.reference[k]-R.mainAxis;S$&&(S=$)}if(p){var C,O;const k=v==="y"?"width":"height",T=mM.has(Es(i)),$=c.reference[g]-c.floating[k]+(T&&((C=l.offset)==null?void 0:C[g])||0)+(T?0:R.crossAxis),j=c.reference[g]+c.reference[k]+(T?0:((O=l.offset)==null?void 0:O[g])||0)-(T?R.crossAxis:0);w<$?w=$:w>j&&(w=j)}return{[v]:S,[g]:w}}}},pH=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:c,platform:l,elements:f}=t,{apply:d=()=>{},...p}=jo(e,t),b=await l.detectOverflow(t,p),g=Es(i),v=ia(i),S=br(i)==="y",{width:w,height:E}=c.floating;let R,C;g==="top"||g==="bottom"?(R=g,C=v===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=g,R=v==="end"?"top":"bottom");const O=E-b.top-b.bottom,k=w-b.left-b.right,T=Ol(E-b[R],O),$=Ol(w-b[C],k),j=!t.middlewareData.shift;let H=T,P=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(H=O),j&&!v){const ne=js(b.left,0),re=js(b.right,0),G=js(b.top,0),te=js(b.bottom,0);S?P=w-2*(ne!==0||re!==0?ne+re:js(b.left,b.right)):H=E-2*(G!==0||te!==0?G+te:js(b.top,b.bottom))}await d({...t,availableWidth:P,availableHeight:H});const Y=await l.getDimensions(f.floating);return w!==Y.width||E!==Y.height?{reset:{rects:!0}}:{}}}};function gM(e){const t=Gs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=yn(e),c=i?e.offsetWidth:n,l=i?e.offsetHeight:r,f=Bh(n)!==c||Bh(r)!==l;return f&&(n=c,r=l),{width:n,height:r,$:f}}function hS(e){return Et(e)?e:e.contextElement}function Sl(e){const t=hS(e);if(!yn(t))return Yr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:c}=gM(t);let l=(c?Bh(n.width):n.width)/r,f=(c?Bh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const hH=Yr(0);function yM(e){const t=Sn(e);return!Em()||!t.visualViewport?hH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mH(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sn(e)?!1:t}function rc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),c=hS(e);let l=Yr(1);t&&(r?Et(r)&&(l=Sl(r)):l=Sl(e));const f=mH(c,n,r)?yM(c):Yr(0);let d=(i.left+f.x)/l.x,p=(i.top+f.y)/l.y,b=i.width/l.x,g=i.height/l.y;if(c){const v=Sn(c),S=r&&Et(r)?Sn(r):r;let w=v,E=iv(w);for(;E&&r&&S!==w;){const R=Sl(E),C=E.getBoundingClientRect(),O=Gs(E),k=C.left+(E.clientLeft+parseFloat(O.paddingLeft))*R.x,T=C.top+(E.clientTop+parseFloat(O.paddingTop))*R.y;d*=R.x,p*=R.y,b*=R.x,g*=R.y,d+=k,p+=T,w=Sn(E),E=iv(w)}}return Uh({width:b,height:g,x:d,y:p})}function Am(e,t){const n=xm(e).scrollLeft;return t?t.left+n:rc(eo(e)).left+n}function bM(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Am(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function gH(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const c=i==="fixed",l=eo(r),f=t?wm(t.floating):!1;if(r===l||f&&c)return n;let d={scrollLeft:0,scrollTop:0},p=Yr(1);const b=Yr(0),g=yn(r);if((g||!g&&!c)&&((sa(r)!=="body"||ra(l))&&(d=xm(r)),yn(r))){const S=rc(r);p=Sl(r),b.x=S.x+r.clientLeft,b.y=S.y+r.clientTop}const v=l&&!g&&!c?bM(l,d):Yr(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+b.x+v.x,y:n.y*p.y-d.scrollTop*p.y+b.y+v.y}}function yH(e){return Array.from(e.getClientRects())}function bH(e){const t=eo(e),n=xm(e),r=e.ownerDocument.body,i=js(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),c=js(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Am(e);const f=-n.scrollTop;return Gs(r).direction==="rtl"&&(l+=js(t.clientWidth,r.clientWidth)-i),{width:i,height:c,x:l,y:f}}const DA=25;function vH(e,t){const n=Sn(e),r=eo(e),i=n.visualViewport;let c=r.clientWidth,l=r.clientHeight,f=0,d=0;if(i){c=i.width,l=i.height;const b=Em();(!b||b&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=Am(r);if(p<=0){const b=r.ownerDocument,g=b.body,v=getComputedStyle(g),S=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-S);w<=DA&&(c-=w)}else p<=DA&&(c+=p);return{width:c,height:l,x:f,y:d}}const SH=new Set(["absolute","fixed"]);function _H(e,t){const n=rc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,c=yn(e)?Sl(e):Yr(1),l=e.clientWidth*c.x,f=e.clientHeight*c.y,d=i*c.x,p=r*c.y;return{width:l,height:f,x:d,y:p}}function kA(e,t,n){let r;if(t==="viewport")r=vH(e,n);else if(t==="document")r=bH(eo(e));else if(Et(t))r=_H(t,n);else{const i=yM(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Uh(r)}function vM(e,t){const n=Uo(e);return n===t||!Et(n)||Bo(n)?!1:Gs(n).position==="fixed"||vM(n,t)}function wH(e,t){const n=t.get(e);if(n)return n;let r=Wi(e,[],!1).filter(f=>Et(f)&&sa(f)!=="body"),i=null;const c=Gs(e).position==="fixed";let l=c?Uo(e):e;for(;Et(l)&&!Bo(l);){const f=Gs(l),d=eS(l);!d&&f.position==="fixed"&&(i=null),(c?!d&&!i:!d&&f.position==="static"&&!!i&&SH.has(i.position)||ra(l)&&!d&&vM(e,l))?r=r.filter(b=>b!==l):i=f,l=Uo(l)}return t.set(e,r),r}function EH(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?wm(t)?[]:wH(t,this._c):[].concat(n),r],f=l[0],d=l.reduce((p,b)=>{const g=kA(t,b,i);return p.top=js(g.top,p.top),p.right=Ol(g.right,p.right),p.bottom=Ol(g.bottom,p.bottom),p.left=js(g.left,p.left),p},kA(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function xH(e){const{width:t,height:n}=gM(e);return{width:t,height:n}}function RH(e,t,n){const r=yn(t),i=eo(t),c=n==="fixed",l=rc(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const d=Yr(0);function p(){d.x=Am(i)}if(r||!r&&!c)if((sa(t)!=="body"||ra(i))&&(f=xm(t)),r){const S=rc(t,!0,c,t);d.x=S.x+t.clientLeft,d.y=S.y+t.clientTop}else i&&p();c&&!r&&i&&p();const b=i&&!r&&!c?bM(i,f):Yr(0),g=l.left+f.scrollLeft-d.x-b.x,v=l.top+f.scrollTop-d.y-b.y;return{x:g,y:v,width:l.width,height:l.height}}function sb(e){return Gs(e).position==="static"}function PA(e,t){if(!yn(e)||Gs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return eo(e)===n&&(n=n.ownerDocument.body),n}function SM(e,t){const n=Sn(e);if(wm(e))return n;if(!yn(e)){let i=Uo(e);for(;i&&!Bo(i);){if(Et(i)&&!sb(i))return i;i=Uo(i)}return n}let r=PA(e,t);for(;r&&T8(r)&&sb(r);)r=PA(r,t);return r&&Bo(r)&&sb(r)&&!eS(r)?n:r||k8(e)||n}const CH=async function(e){const t=this.getOffsetParent||SM,n=this.getDimensions,r=await n(e.floating);return{reference:RH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function AH(e){return Gs(e).direction==="rtl"}const TH={convertOffsetParentRelativeRectToViewportRelativeRect:gH,getDocumentElement:eo,getClippingRect:EH,getOffsetParent:SM,getElementRects:CH,getClientRects:yH,getDimensions:xH,getScale:Sl,isElement:Et,isRTL:AH};function _M(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IH(e,t){let n=null,r;const i=eo(e);function c(){var f;clearTimeout(r),(f=n)==null||f.disconnect(),n=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),c();const p=e.getBoundingClientRect(),{left:b,top:g,width:v,height:S}=p;if(f||t(),!v||!S)return;const w=Qp(g),E=Qp(i.clientWidth-(b+v)),R=Qp(i.clientHeight-(g+S)),C=Qp(b),k={rootMargin:-w+"px "+-E+"px "+-R+"px "+-C+"px",threshold:js(0,Ol(1,d))||1};let T=!0;function $(j){const H=j[0].intersectionRatio;if(H!==d){if(!T)return l();H?l(!1,H):r=setTimeout(()=>{l(!1,1e-7)},1e3)}H===1&&!_M(p,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver($,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver($,k)}n.observe(e)}return l(!0),c}function NA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,p=hS(e),b=i||c?[...p?Wi(p):[],...Wi(t)]:[];b.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),c&&C.addEventListener("resize",n)});const g=p&&f?IH(p,n):null;let v=-1,S=null;l&&(S=new ResizeObserver(C=>{let[O]=C;O&&O.target===p&&S&&(S.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var k;(k=S)==null||k.observe(t)})),n()}),p&&!d&&S.observe(p),S.observe(t));let w,E=d?rc(e):null;d&&R();function R(){const C=rc(e);E&&!_M(E,C)&&n(),E=C,w=requestAnimationFrame(R)}return n(),()=>{var C;b.forEach(O=>{i&&O.removeEventListener("scroll",n),c&&O.removeEventListener("resize",n)}),g?.(),(C=S)==null||C.disconnect(),S=null,d&&cancelAnimationFrame(w)}}const OH=uH,MH=fH,DH=aH,kH=pH,PH=cH,NH=dH,LH=(e,t,n)=>{const r=new Map,i={platform:TH,...n},c={...i.platform,_c:r};return iH(e,t,{...i,platform:c})};var zH=typeof document<"u",BH=function(){},Sh=zH?M.useLayoutEffect:BH;function Kh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const c=i[r];if(!(c==="_owner"&&e.$$typeof)&&!Kh(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function wM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function LA(e,t){const n=wM(e);return Math.round(t*n)/n}function rb(e){const t=M.useRef(e);return Sh(()=>{t.current=e}),t}function $H(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:c,floating:l}={},transform:f=!0,whileElementsMounted:d,open:p}=e,[b,g]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,S]=M.useState(r);Kh(v,r)||S(r);const[w,E]=M.useState(null),[R,C]=M.useState(null),O=M.useCallback(J=>{J!==j.current&&(j.current=J,E(J))},[]),k=M.useCallback(J=>{J!==H.current&&(H.current=J,C(J))},[]),T=c||w,$=l||R,j=M.useRef(null),H=M.useRef(null),P=M.useRef(b),Y=d!=null,ne=rb(d),re=rb(i),G=rb(p),te=M.useCallback(()=>{if(!j.current||!H.current)return;const J={placement:t,strategy:n,middleware:v};re.current&&(J.platform=re.current),LH(j.current,H.current,J).then(ve=>{const fe={...ve,isPositioned:G.current!==!1};ue.current&&!Kh(P.current,fe)&&(P.current=fe,na.flushSync(()=>{g(fe)}))})},[v,t,n,re,G]);Sh(()=>{p===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(J=>({...J,isPositioned:!1})))},[p]);const ue=M.useRef(!1);Sh(()=>(ue.current=!0,()=>{ue.current=!1}),[]),Sh(()=>{if(T&&(j.current=T),$&&(H.current=$),T&&$){if(ne.current)return ne.current(T,$,te);te()}},[T,$,te,ne,Y]);const ye=M.useMemo(()=>({reference:j,floating:H,setReference:O,setFloating:k}),[O,k]),V=M.useMemo(()=>({reference:T,floating:$}),[T,$]),oe=M.useMemo(()=>{const J={position:n,left:0,top:0};if(!V.floating)return J;const ve=LA(V.floating,b.x),fe=LA(V.floating,b.y);return f?{...J,transform:"translate("+ve+"px, "+fe+"px)",...wM(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ve,top:fe}},[n,f,V.floating,b.x,b.y]);return M.useMemo(()=>({...b,update:te,refs:ye,elements:V,floatingStyles:oe}),[b,te,ye,V,oe])}const UH=(e,t)=>({...OH(e),options:[e,t]}),jH=(e,t)=>({...MH(e),options:[e,t]}),HH=(e,t)=>({...NH(e),options:[e,t]}),VH=(e,t)=>({...DH(e),options:[e,t]}),FH=(e,t)=>({...kH(e),options:[e,t]}),qH=(e,t)=>({...PH(e),options:[e,t]}),GH={intentional:"onClick",sloppy:"onPointerDown"};function ZH(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function EM(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),c=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:f,dataRef:d}=n.context,{enabled:p=!0,escapeKey:b=!0,outsidePress:g=!0,outsidePressEvent:v="sloppy",referencePress:S=!1,referencePressEvent:w="sloppy",ancestorScroll:E=!1,bubbles:R,externalTree:C}=t,O=Yf(C),k=Ge(typeof g=="function"?g:()=>!1),T=typeof g=="function"?k:g,$=M.useRef(!1),{escapeKey:j,outsidePress:H}=ZH(R),P=M.useRef(null),Y=Il(),ne=Il(),re=Ge(()=>{ne.clear(),d.current.insideReactTree=!1}),G=M.useRef(!1),te=M.useRef(""),ue=Ge(me=>{te.current=me.pointerType}),ye=Ge(()=>{const me=te.current,Ee=me==="pen"||!me?"mouse":me,we=typeof v=="function"?v():v;return typeof we=="string"?we:we[Ee]}),V=Ge(me=>{if(!r||!p||!b||me.key!=="Escape"||G.current)return;const Ee=d.current.floatingContext?.nodeId,we=O?Ja(O.nodesRef.current,Ee):[];if(!j&&we.length>0){let je=!0;if(we.forEach(De=>{De.context?.open&&!De.context.dataRef.current.__escapeKeyBubbles&&(je=!1)}),!je)return}const qe=Zj(me)?me.nativeEvent:me,Oe=Jt(dS,qe);n.setOpen(!1,Oe),!j&&!Oe.isPropagationAllowed&&me.stopPropagation()}),oe=Ge(me=>{const Ee=ye();return Ee==="intentional"&&me.type!=="click"||Ee==="sloppy"&&me.type==="click"}),J=Ge(()=>{d.current.insideReactTree=!0,ne.start(0,re)}),ve=Ge((me,Ee=!1)=>{if(oe(me)){re();return}if(d.current.insideReactTree){re();return}if(ye()==="intentional"&&Ee||typeof T=="function"&&!T(me))return;const we=Ss(me),qe=`[${Dl("inert")}]`,Oe=Kt(n.select("floatingElement")).querySelectorAll(qe),je=n.context.triggerElements;if(we&&(je.hasElement(we)||je.hasMatchingElement(Tt=>gt(Tt,we))))return;let De=Et(we)?we:null;for(;De&&!Bo(De);){const Tt=Uo(De);if(Bo(Tt)||!Et(Tt))break;De=Tt}if(Oe.length&&Et(we)&&!Fj(we)&&!gt(we,n.select("floatingElement"))&&Array.from(Oe).every(Tt=>!gt(De,Tt)))return;if(yn(we)&&!("touches"in me)){const Tt=Bo(we),Rn=Gs(we),It=/auto|scroll/,Tr=Tt||It.test(Rn.overflowX),dt=Tt||It.test(Rn.overflowY),$t=Tr&&we.clientWidth>0&&we.scrollWidth>we.clientWidth,mt=dt&&we.clientHeight>0&&we.scrollHeight>we.clientHeight,Os=Rn.direction==="rtl",Xs=mt&&(Os?me.offsetX<=we.offsetWidth-we.clientWidth:me.offsetX>we.clientWidth),ao=$t&&me.offsetY>we.clientHeight;if(Xs||ao)return}const nt=d.current.floatingContext?.nodeId,Bt=O&&Ja(O.nodesRef.current,nt).some(Tt=>kr(me,Tt.context?.elements.floating));if(kr(me,n.select("floatingElement"))||kr(me,n.select("domReferenceElement"))||Bt)return;const We=O?Ja(O.nodesRef.current,nt):[];if(We.length>0){let Tt=!0;if(We.forEach(Rn=>{Rn.context?.open&&!Rn.context.dataRef.current.__outsidePressBubbles&&(Tt=!1)}),!Tt)return}n.setOpen(!1,Jt(rM,me)),re()}),fe=Ge(me=>{ye()!=="sloppy"||me.pointerType==="touch"||!n.select("open")||!p||kr(me,n.select("floatingElement"))||kr(me,n.select("domReferenceElement"))||ve(me)}),B=Ge(me=>{if(ye()!=="sloppy"||!n.select("open")||!p||kr(me,n.select("floatingElement"))||kr(me,n.select("domReferenceElement")))return;const Ee=me.touches[0];Ee&&(P.current={startTime:Date.now(),startX:Ee.clientX,startY:Ee.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},Y.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}),ee=Ge(me=>{const Ee=Ss(me);function we(){B(me),Ee?.removeEventListener(me.type,we)}Ee?.addEventListener(me.type,we)}),ge=Ge(me=>{const Ee=$.current;if($.current=!1,Y.clear(),me.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)return;const we=Ss(me);function qe(){me.type==="pointerdown"?fe(me):ve(me,Ee),we?.removeEventListener(me.type,qe)}we?.addEventListener(me.type,qe)}),be=Ge(me=>{if(ye()!=="sloppy"||!P.current||kr(me,n.select("floatingElement"))||kr(me,n.select("domReferenceElement")))return;const Ee=me.touches[0];if(!Ee)return;const we=Math.abs(Ee.clientX-P.current.startX),qe=Math.abs(Ee.clientY-P.current.startY),Oe=Math.sqrt(we*we+qe*qe);Oe>5&&(P.current.dismissOnTouchEnd=!0),Oe>10&&(ve(me),Y.clear(),P.current=null)}),xe=Ge(me=>{const Ee=Ss(me);function we(){be(me),Ee?.removeEventListener(me.type,we)}Ee?.addEventListener(me.type,we)}),_e=Ge(me=>{ye()!=="sloppy"||!P.current||kr(me,n.select("floatingElement"))||kr(me,n.select("domReferenceElement"))||(P.current.dismissOnTouchEnd&&ve(me),Y.clear(),P.current=null)}),Te=Ge(me=>{const Ee=Ss(me);function we(){_e(me),Ee?.removeEventListener(me.type,we)}Ee?.addEventListener(me.type,we)});M.useEffect(()=>{if(!r||!p)return;d.current.__escapeKeyBubbles=j,d.current.__outsidePressBubbles=H;const me=new Jr;function Ee(De){n.setOpen(!1,Jt(fS,De))}function we(){me.clear(),G.current=!0}function qe(){me.start(Em()?5:0,()=>{G.current=!1})}const Oe=Kt(i);Oe.addEventListener("pointerdown",ue,!0),b&&(Oe.addEventListener("keydown",V),Oe.addEventListener("compositionstart",we),Oe.addEventListener("compositionend",qe)),T&&(Oe.addEventListener("click",ge,!0),Oe.addEventListener("pointerdown",ge,!0),Oe.addEventListener("touchstart",ee,!0),Oe.addEventListener("touchmove",xe,!0),Oe.addEventListener("touchend",Te,!0),Oe.addEventListener("mousedown",ge,!0));let je=[];return E&&(Et(l)&&(je=Wi(l)),Et(i)&&(je=je.concat(Wi(i))),!Et(c)&&c&&c.contextElement&&(je=je.concat(Wi(c.contextElement)))),je=je.filter(De=>De!==Oe.defaultView?.visualViewport),je.forEach(De=>{De.addEventListener("scroll",Ee,{passive:!0})}),()=>{Oe.removeEventListener("pointerdown",ue,!0),b&&(Oe.removeEventListener("keydown",V),Oe.removeEventListener("compositionstart",we),Oe.removeEventListener("compositionend",qe)),T&&(Oe.removeEventListener("click",ge,!0),Oe.removeEventListener("pointerdown",ge,!0),Oe.removeEventListener("touchstart",ee,!0),Oe.removeEventListener("touchmove",xe,!0),Oe.removeEventListener("touchend",Te,!0),Oe.removeEventListener("mousedown",ge,!0)),je.forEach(De=>{De.removeEventListener("scroll",Ee)}),me.clear(),$.current=!1}},[d,i,c,l,b,T,r,f,E,p,j,H,V,ve,ge,fe,ee,xe,Te,ue,n]),M.useEffect(re,[T,re]);const Fe=M.useMemo(()=>({onKeyDown:V,...S&&{[GH[w]]:me=>{n.setOpen(!1,Jt(qh,me.nativeEvent))},...w!=="intentional"&&{onClick(me){n.setOpen(!1,Jt(qh,me.nativeEvent))}}}}),[V,n,S,w]),Se=Ge(me=>{const Ee=Ss(me.nativeEvent);!gt(n.select("floatingElement"),Ee)||me.button!==0||($.current=!0)}),Xe=Ge(me=>{!r||!p||me.button!==0||($.current=!0)}),_t=M.useMemo(()=>({onKeyDown:V,onPointerDown:Se,onMouseDown:Se,onMouseUp:Se,onClickCapture:J,onMouseDownCapture(me){J(),Xe(me)},onPointerDownCapture(me){J(),Xe(me)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[V,Se,J,Xe]);return M.useMemo(()=>p?{reference:Fe,floating:_t,trigger:Fe}:{},[p,Fe,_t])}var Qh=Symbol("NOT_FOUND");function KH(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function QH(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function YH(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var zA=e=>Array.isArray(e)?e:[e];function XH(e){const t=Array.isArray(e[0])?e[0]:e;return YH(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WH(e,t){const n=[],{length:r}=e;for(let i=0;it(f,p.key));if(d>-1){const p=n[d];return d>0&&(n.splice(d,1),n.unshift(p)),p.value}return Qh}function i(f,d){r(f)===Qh&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function c(){return n}function l(){n=[]}return{get:r,put:i,getEntries:c,clear:l}}var tV=(e,t)=>e===t;function nV(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let c=0;cc(S.value,b));v&&(b=v.value,f!==0&&f--)}d.put(arguments,b)}return b}return p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>f,p.resetResultsCount=()=>{f=0},p}var rV=class{constructor(e){this.value=e}deref(){return this.value}},oV=typeof WeakRef<"u"?WeakRef:rV,iV=0,BA=1;function eh(){return{s:iV,v:void 0,o:null,p:null}}function xM(e,t={}){let n=eh();const{resultEqualityCheck:r}=t;let i,c=0;function l(){let f=n;const{length:d}=arguments;for(let g=0,v=d;g{n=eh(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}function RM(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let c=0,l=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),KH(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const b={...n,...d},{memoize:g,memoizeOptions:v=[],argsMemoize:S=xM,argsMemoizeOptions:w=[]}=b,E=zA(v),R=zA(w),C=XH(i),O=g(function(){return c++,p.apply(null,arguments)},...E),k=S(function(){l++;const $=WH(C,arguments);return f=O.apply(null,$),f},...R);return Object.assign(k,{resultFunc:p,memoizedResultFunc:O,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>c,resetRecomputations:()=>{c=0},memoize:g,argsMemoize:S})};return Object.assign(r,{withTypes:()=>r}),r}var aV=RM(xM),cV=Object.assign((e,t=aV)=>{QH(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(c=>e[c]);return t(r,(...c)=>c.reduce((l,f,d)=>(l[n[d]]=f,l),{}))},{withTypes:()=>cV});RM({memoize:sV,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const it=(e,t,n,r,i,c,...l)=>{if(l.length>0)throw new Error(Fo(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var CM=sO();const mv=[];let gv;function lV(){return gv}function uV(e){mv.push(e)}function AM(e){const t=(n,r)=>{const i=vr(dV).current;let c;try{gv=i;for(const l of mv)l.before(i);c=e(n,r);for(const l of mv)l.after(i);i.didInitialize=!0}finally{gv=void 0}return c};return t.displayName=e.displayName||e.name,t}function fV(e){return M.forwardRef(AM(e))}function dV(){return{didInitialize:!1}}const pV=Wv(19),hV=pV?gV:yV;function TM(e,t,n,r,i){return hV(e,t,n,r,i)}function mV(e,t,n,r,i){const c=M.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return CM.useSyncExternalStore(e.subscribe,c,c)}uV({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),CM.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function gV(e,t,n,r,i){const c=lV();if(!c)return mV(e,t,n,r,i);const l=c.syncIndex;c.syncIndex+=1;let f;return c.didInitialize?(f=c.syncHooks[l],(f.store!==e||f.selector!==t||!Object.is(f.a1,n)||!Object.is(f.a2,r)||!Object.is(f.a3,i))&&(f.store!==e&&(c.didChangeStore=!0),f.store=e,f.selector=t,f.a1=n,f.a2=r,f.a3=i,f.didChange=!0)):(f={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},c.syncHooks.push(f)),f.value}function yV(e,t,n,r,i){return rO.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>t(c,n,r,i))}class bV{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return TM(this,t,n,r,i)}}class mS extends bV{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){M.useDebugValue(t),ht(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;ht(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ht(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){M.useDebugValue(t);const r=n!==void 0;ht(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,i){const c=this.selectors[t];return c(this.state,n,r,i)}useState(t,n,r,i){return M.useDebugValue(t),TM(this,this.selectors[t],n,r,i)}useContextCallback(t,n){M.useDebugValue(t);const r=Ge(n??mO);this.context[t]=r}useStateSetter(t){const n=M.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(c=>{const l=r(c);if(!Object.is(i,l)){const f=i;i=l,n(l,f,this)}})}}const vV={open:it(e=>e.open),domReferenceElement:it(e=>e.domReferenceElement),referenceElement:it(e=>e.positionReference??e.referenceElement),floatingElement:it(e=>e.floatingElement),floatingId:it(e=>e.floatingId)};class gS extends mS{constructor(t){const{nested:n,noEmit:r,onOpenChange:i,triggerElements:c,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:H9(),nested:n,noEmit:r,triggerElements:c},vV)}setOpen=(t,n)=>{if((!t||!this.state.open||Yj(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function SV(e,t){const n=M.useRef(null),r=M.useRef(null);return M.useCallback(i=>{if(e!==void 0){if(n.current!==null){const c=n.current,l=r.current,f=t.context.triggerElements.getById(c);l&&f===l&&t.context.triggerElements.delete(c),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function _V(e,t,n,r){const i=n.useState("isMountedByTrigger",e),c=SV(e,n),l=Ge(f=>{if(c(f),!f||!n.select("open"))return;const d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:f,...r});return}d==null&&n.update({activeTriggerId:e,activeTriggerElement:f,...r})});return ht(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:i}}function IM(e){const t=e.useState("open");ht(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,i]=n.value;e.update({activeTriggerId:r,activeTriggerElement:i})}}},[t,e])}function OM(e,t,n){const{mounted:r,setMounted:i,transitionStatus:c}=T9(e);t.useSyncedValues({mounted:r,transitionStatus:c});const l=Ge(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return uS({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:c}}class Tm{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function wV(){return new gS({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Tm,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function MM(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:wV(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Hs,inactiveTriggerProps:Hs,popupProps:Hs}}const th=it(e=>e.triggerIdProp??e.activeTriggerId),DM={open:it(e=>e.openProp??e.open),mounted:it(e=>e.mounted),transitionStatus:it(e=>e.transitionStatus),floatingRootContext:it(e=>e.floatingRootContext),preventUnmountingOnClose:it(e=>e.preventUnmountingOnClose),payload:it(e=>e.payload),activeTriggerId:th,activeTriggerElement:it(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:it((e,t)=>t!==void 0&&th(e)===t),isOpenedByTrigger:it((e,t)=>t!==void 0&&th(e)===t&&e.open),isMountedByTrigger:it((e,t)=>t!==void 0&&th(e)===t&&e.mounted),triggerProps:it((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:it(e=>e.popupProps),popupElement:it(e=>e.popupElement),positionerElement:it(e=>e.positionerElement)};function EV(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Zf(),c=Cm()!=null,l=vr(()=>new gS({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Tm,floatingId:i,nested:c,noEmit:!1})).current;return ht(()=>{const f={open:t,floatingId:i};r.reference!==void 0&&(f.referenceElement=r.reference,f.domReferenceElement=Et(r.reference)?r.reference:null),r.floating!==void 0&&(f.floatingElement=r.floating),l.update(f)},[t,i,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=c,l.context.noEmit=!1,l}function xV(e={}){const{nodeId:t,externalTree:n}=e,r=EV(e),i=e.rootContext||r,c={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[l,f]=M.useState(null),d=M.useRef(null),p=Yf(n);ht(()=>{c.domReference&&(d.current=c.domReference)},[c.domReference]);const b=$H({...e,elements:{...c,...l&&{reference:l}}}),g=M.useCallback(H=>{const P=Et(H)?{getBoundingClientRect:()=>H.getBoundingClientRect(),getClientRects:()=>H.getClientRects(),contextElement:H}:H;f(P),b.refs.setReference(P)},[b.refs]),[v,S]=M.useState(null),[w,E]=M.useState(null);i.useSyncedValue("referenceElement",v),i.useSyncedValue("domReferenceElement",Et(v)?v:null),i.useSyncedValue("floatingElement",w);const R=M.useCallback(H=>{(Et(H)||H===null)&&(d.current=H,S(H)),(Et(b.refs.reference.current)||b.refs.reference.current===null||H!==null&&!Et(H))&&b.refs.setReference(H)},[b.refs,S]),C=M.useCallback(H=>{E(H),b.refs.setFloating(H)},[b.refs]),O=M.useMemo(()=>({...b.refs,setReference:R,setFloating:C,setPositionReference:g,domReference:d}),[b.refs,R,C,g]),k=M.useMemo(()=>({...b.elements,domReference:c.domReference}),[b.elements,c.domReference]),T=i.useState("open"),$=i.useState("floatingId"),j=M.useMemo(()=>({...b,dataRef:i.context.dataRef,open:T,onOpenChange:i.setOpen,events:i.context.events,floatingId:$,refs:O,elements:k,nodeId:t,rootStore:i}),[b,O,k,t,i,T,$]);return ht(()=>{i.context.dataRef.current.floatingContext=j;const H=p?.nodesRef.current.find(P=>P.id===t);H&&(H.context=j)}),M.useMemo(()=>({...b,context:j,refs:O,elements:k,rootStore:i}),[b,O,k,j,i])}function kM(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,c=Zf(),l=Cm()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(r?"popupElement":"positionerElement"),b=t.context.triggerElements,g=vr(()=>new gS({open:f,referenceElement:d,floatingElement:p,triggerElements:b,onOpenChange:i,floatingId:c,nested:l,noEmit:n})).current;return ht(()=>{const v={open:f,floatingId:c,referenceElement:d,floatingElement:p};Et(d)&&(v.domReferenceElement=d),g.state.positionReference===g.state.referenceElement&&(v.positionReference=d),g.update(v)},[f,c,d,p,g]),g.context.onOpenChange=i,g.context.nested=l,g.context.noEmit=n,g}const ob=Uj&&jO;function RV(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:c=!0,delay:l}=t,f=M.useRef(!1),d=M.useRef(null),p=Il(),b=M.useRef(!0);M.useEffect(()=>{const v=n.select("domReferenceElement");if(!c)return;const S=Sn(v);function w(){const C=n.select("domReferenceElement");!n.select("open")&&yn(C)&&C===Do(Kt(C))&&(f.current=!0)}function E(){b.current=!0}function R(){b.current=!1}return S.addEventListener("blur",w),ob&&(S.addEventListener("keydown",E,!0),S.addEventListener("pointerdown",R,!0)),()=>{S.removeEventListener("blur",w),ob&&(S.removeEventListener("keydown",E,!0),S.removeEventListener("pointerdown",R,!0))}},[n,c]),M.useEffect(()=>{if(!c)return;function v(S){if(S.reason===qh||S.reason===dS){const w=n.select("domReferenceElement");Et(w)&&(d.current=w,f.current=!0)}}return r.on("openchange",v),()=>{r.off("openchange",v)}},[r,c,n]);const g=M.useMemo(()=>({onMouseLeave(){f.current=!1,d.current=null},onFocus(v){const S=v.currentTarget;if(f.current){if(d.current===S)return;f.current=!1,d.current=null}const w=Ss(v.nativeEvent);if(Et(w)){if(ob&&!v.relatedTarget){if(!b.current&&!oS(w))return}else if(!qj(w))return}const E=zh(v.relatedTarget,n.context.triggerElements),{nativeEvent:R,currentTarget:C}=v,O=typeof l=="function"?l():l;if(n.select("open")&&E||O===0||O===void 0){n.setOpen(!0,Jt(bh,R,C));return}p.start(O,()=>{f.current||n.setOpen(!0,Jt(bh,R,C))})},onBlur(v){f.current=!1,d.current=null;const S=v.relatedTarget,w=v.nativeEvent,E=Et(S)&&S.hasAttribute(Dl("focus-guard"))&&S.getAttribute("data-type")==="outside";p.start(0,()=>{const R=n.select("domReferenceElement"),C=Do(R?R.ownerDocument:document);!S&&C===R||gt(i.current.floatingContext?.refs.floating.current,C)||gt(R,C)||E||zh(S??C,n.context.triggerElements)||n.setOpen(!1,Jt(bh,w))})}}),[i,n,p,l]);return M.useMemo(()=>c?{reference:g,trigger:g}:{},[c,g])}const yv=Dl("safe-polygon"),CV=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${qO}`;function AV(e){return e?!!e.closest(CV):!1}class yS{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new Jr,this.restTimeout=new Jr,this.handleCloseOptions=void 0}static create(){return new yS}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function PM(e){const t=vr(yS.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),rS(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const TV=new Set(["click","mousedown"]);function IV(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),c=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:f=!0,closeDelay:d=0}=t,p=PM(n),b=Yf(),g=Cm(),v=Ge(()=>p.interactedInside?!0:l.current.openEvent?TV.has(l.current.openEvent.type):!1),S=Ge(()=>{const k=l.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),w=Ge(k=>zh(k,n.context.triggerElements)),E=M.useCallback((k,T=!0)=>{const $=OV(d,p.pointerType);$&&!p.handler?p.openChangeTimeout.start($,()=>n.setOpen(!1,Jt(Lr,k))):T&&(p.openChangeTimeout.clear(),n.setOpen(!1,Jt(Lr,k)))},[d,n,p]),R=Ge(()=>{p.unbindMouseMove(),p.handler=void 0}),C=Ge(()=>{if(p.performedPointerEventsMutation){const k=Kt(i).body;k.style.pointerEvents="",k.removeAttribute(yv),p.performedPointerEventsMutation=!1}}),O=Ge(k=>{const T=Ss(k);if(!AV(T)){p.interactedInside=!1;return}p.interactedInside=!0});ht(()=>{r||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,R(),C())},[r,p,R,C]),M.useEffect(()=>()=>{R()},[R]),M.useEffect(()=>C,[C]),ht(()=>{if(f&&r&&p.handleCloseOptions?.blockPointerEvents&&S()&&Et(c)&&i){p.performedPointerEventsMutation=!0;const k=Kt(i).body;k.setAttribute(yv,"");const T=c,$=i,j=b?.nodesRef.current.find(H=>H.id===g)?.context?.elements.floating;return j&&(j.style.pointerEvents=""),k.style.pointerEvents="none",T.style.pointerEvents="auto",$.style.pointerEvents="auto",()=>{k.style.pointerEvents="",T.style.pointerEvents="",$.style.pointerEvents=""}}},[f,r,c,i,p,S,b,g]),M.useEffect(()=>{if(!f)return;function k(H){v()||!l.current.floatingContext||!n.select("open")||w(H.relatedTarget)||(C(),R(),v()||E(H))}function T(H){p.openChangeTimeout.clear(),C(),p.handler?.(H),R()}function $(H){v()||E(H,!1)}const j=i;return j&&(j.addEventListener("mouseleave",k),j.addEventListener("mouseenter",T),j.addEventListener("mouseleave",$),j.addEventListener("pointerdown",O,!0)),()=>{j&&(j.removeEventListener("mouseleave",k),j.removeEventListener("mouseenter",T),j.removeEventListener("mouseleave",$),j.removeEventListener("pointerdown",O,!0))}},[f,i,n,l,v,w,E,C,R,O,p])}function OV(e,t){return t&&!Pf(t)?0:typeof e=="function"?e():e}function ib(e){return typeof e=="function"?e():e}const MV={current:null};function DV(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:c=!0,delay:l=0,handleClose:f=null,mouseOnly:d=!1,restMs:p=0,move:b=!0,triggerElementRef:g=MV,externalTree:v,isActiveTrigger:S=!0}=t,w=Yf(v),E=PM(n),R=Qr(f),C=Qr(l),O=Qr(p),k=Qr(c);S&&(E.handleCloseOptions=R.current?.__options);const T=Ge(()=>E.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),$=Ge(ne=>zh(ne,n.context.triggerElements)),j=M.useCallback((ne,re=!0)=>{const G=vh(C.current,"close",E.pointerType);G&&!E.handler?E.openChangeTimeout.start(G,()=>n.setOpen(!1,Jt(Lr,ne))):re&&(E.openChangeTimeout.clear(),n.setOpen(!1,Jt(Lr,ne)))},[C,n,E]),H=Ge(()=>{E.unbindMouseMove(),E.handler=void 0}),P=Ge(()=>{if(E.performedPointerEventsMutation){const ne=Kt(n.select("domReferenceElement")).body;ne.style.pointerEvents="",ne.removeAttribute(yv),E.performedPointerEventsMutation=!1}});M.useEffect(()=>{if(!c)return;function ne(re){re.open||(E.openChangeTimeout.clear(),E.restTimeout.clear(),E.blockMouseMove=!0,E.restTimeoutPending=!1)}return i.on("openchange",ne),()=>{i.off("openchange",ne)}},[c,i,E]);const Y=Ge(ne=>{if(T()||!r.current.floatingContext||$(ne.relatedTarget))return;const re=g.current;R.current?.({...r.current.floatingContext,tree:w,x:ne.clientX,y:ne.clientY,onClose(){P(),H(),!T()&&re===n.select("domReferenceElement")&&j(ne)}})(ne)});return M.useEffect(()=>{if(!c)return;const ne=g.current??(S?n.select("domReferenceElement"):null);if(!Et(ne))return;function re(ue){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,d&&!Pf(E.pointerType)||ib(O.current)>0&&!vh(C.current,"open"))return;const ye=vh(C.current,"open",E.pointerType),V=n.select("domReferenceElement"),oe=n.context.triggerElements,J=(oe.hasElement(ue.target)||oe.hasMatchingElement(ee=>gt(ee,ue.target)))&&(!V||!gt(V,ue.target)),ve=ue.currentTarget??null,fe=n.select("open"),B=!fe||J;J&&fe?n.setOpen(!0,Jt(Lr,ue,ve)):ye?E.openChangeTimeout.start(ye,()=>{B&&n.setOpen(!0,Jt(Lr,ue,ve))}):B&&n.setOpen(!0,Jt(Lr,ue,ve))}function G(ue){if(T()){P();return}E.unbindMouseMove();const ye=n.select("domReferenceElement"),V=Kt(ye);if(E.restTimeout.clear(),E.restTimeoutPending=!1,$(ue.relatedTarget))return;if(R.current&&r.current.floatingContext){n.select("open")||E.openChangeTimeout.clear();const J=g.current;E.handler=R.current({...r.current.floatingContext,tree:w,x:ue.clientX,y:ue.clientY,onClose(){P(),H(),k.current&&!T()&&J===n.select("domReferenceElement")&&j(ue,!0)}});const ve=E.handler;ve(ue),V.addEventListener("mousemove",ve),E.unbindMouseMove=()=>{V.removeEventListener("mousemove",ve)};return}(E.pointerType!=="touch"||!gt(n.select("floatingElement"),ue.relatedTarget))&&j(ue)}function te(ue){Y(ue)}return n.select("open")&&ne.addEventListener("mouseleave",te),b&&ne.addEventListener("mousemove",re,{once:!0}),ne.addEventListener("mouseenter",re),ne.addEventListener("mouseleave",G),()=>{ne.removeEventListener("mouseleave",te),b&&ne.removeEventListener("mousemove",re),ne.removeEventListener("mouseenter",re),ne.removeEventListener("mouseleave",G)}},[H,P,r,C,j,n,c,R,Y,E,S,T,$,d,b,O,g,w,k]),M.useMemo(()=>{if(!c)return;function ne(re){E.pointerType=re.pointerType}return{onPointerDown:ne,onPointerEnter:ne,onMouseMove(re){const{nativeEvent:G}=re,te=re.currentTarget,ue=n.select("domReferenceElement"),ye=n.context.triggerElements,V=n.select("open"),oe=(ye.hasElement(re.target)||ye.hasMatchingElement(ve=>gt(ve,re.target)))&&(!ue||!gt(ue,re.target));if(d&&!Pf(E.pointerType)||V&&!oe||ib(O.current)===0||!oe&&E.restTimeoutPending&&re.movementX**2+re.movementY**2<2)return;E.restTimeout.clear();function J(){if(E.restTimeoutPending=!1,T())return;const ve=n.select("open");!E.blockMouseMove&&(!ve||oe)&&n.setOpen(!0,Jt(Lr,G,te))}E.pointerType==="touch"?na.flushSync(()=>{J()}):oe&&V?J():(E.restTimeoutPending=!0,E.restTimeout.start(ib(O.current),J))}}},[c,E,T,d,n,O])}function NM(e=[]){const t=e.map(p=>p?.reference),n=e.map(p=>p?.floating),r=e.map(p=>p?.item),i=e.map(p=>p?.trigger),c=M.useCallback(p=>nh(p,e,"reference"),t),l=M.useCallback(p=>nh(p,e,"floating"),n),f=M.useCallback(p=>nh(p,e,"item"),r),d=M.useCallback(p=>nh(p,e,"trigger"),i);return M.useMemo(()=>({getReferenceProps:c,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[c,l,f,d])}function nh(e,t,n){const r=new Map,i=n==="item",c={};n==="floating"&&(c.tabIndex=-1,c[lv]="");for(const l in e)i&&e&&(l===VO||l===FO)||(c[l]=e[l]);for(let l=0;lr.get(i)?.map(f=>f(...l)).find(f=>f!==void 0))):e[i]=c)}}const kV=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PV(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingId"),c=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:f="dialog"}=t,d=Zf(),p=c?.id||d,b=M.useMemo(()=>uv(l)?.id||i,[l,i]),g=kV.get(f)??f,S=Cm()!=null,w=M.useMemo(()=>g==="tooltip"||f==="label"?Hs:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&S&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[g,S,f]),E=M.useMemo(()=>g==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:r?b:void 0}:{...w,"aria-expanded":r?"true":"false","aria-controls":r?b:void 0,...g==="menu"&&{id:p}},[g,b,r,p,f,w]),R=M.useMemo(()=>{const O={id:b,...g&&{role:g}};return g==="tooltip"||f==="label"?O:{...O,...g==="menu"&&{"aria-labelledby":p}}},[g,b,p,f]),C=M.useCallback(({active:O,selected:k})=>{const T={role:"option",...O&&{id:`${b}-fui-option`}};switch(f){case"select":case"combobox":return{...T,"aria-selected":k}}return{}},[b,f]);return M.useMemo(()=>({reference:E,floating:R,item:C,trigger:w}),[E,R,w,C])}function UA(e,t){const[n,r]=e;let i=!1;const c=t.length;for(let l=0,f=c-1;l=r!=g>=r&&n<=(b-d)*(r-p)/(g-p)+d&&(i=!i)}return i}function NV(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function LV(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Jr;let c=!1,l=null,f=null,d=typeof performance<"u"?performance.now():0;function p(g,v){const S=performance.now(),w=S-d;if(l===null||f===null||w===0)return l=g,f=v,d=S,null;const E=g-l,R=v-f,O=Math.sqrt(E*E+R*R)/w;return l=g,f=v,d=S,O}const b=({x:g,y:v,placement:S,elements:w,onClose:E,nodeId:R,tree:C})=>function(k){function T(){i.clear(),E()}if(i.clear(),!w.domReference||!w.floating||S==null||g==null||v==null)return;const{clientX:$,clientY:j}=k,H=[$,j],P=Ss(k),Y=k.type==="mouseleave",ne=gt(w.floating,P),re=gt(w.domReference,P),G=w.domReference.getBoundingClientRect(),te=w.floating.getBoundingClientRect(),ue=S.split("-")[0],ye=g>te.right-te.width/2,V=v>te.bottom-te.height/2,oe=NV(H,G),J=te.width>G.width,ve=te.height>G.height,fe=(J?G:te).left,B=(J?G:te).right,ee=(ve?G:te).top,ge=(ve?G:te).bottom;if(ne&&(c=!0,!Y))return;if(re&&(c=!1),re&&!Y){c=!0;return}if(Y&&Et(k.relatedTarget)&>(w.floating,k.relatedTarget)||C&&Ja(C.nodesRef.current,R).some(({context:_e})=>_e?.open))return;if(ue==="top"&&v>=G.bottom-1||ue==="bottom"&&v<=G.top+1||ue==="left"&&g>=G.right-1||ue==="right"&&g<=G.left+1)return T();let be=[];switch(ue){case"top":be=[[fe,G.top+1],[fe,te.bottom-1],[B,te.bottom-1],[B,G.top+1]];break;case"bottom":be=[[fe,te.top+1],[fe,G.bottom-1],[B,G.bottom-1],[B,te.top+1]];break;case"left":be=[[te.right-1,ge],[te.right-1,ee],[G.left+1,ee],[G.left+1,ge]];break;case"right":be=[[G.right-1,ge],[G.right-1,ee],[te.left+1,ee],[te.left+1,ge]];break}function xe([_e,Te]){switch(ue){case"top":{const Fe=[J?_e+t/2:ye?_e+t*4:_e-t*4,Te+t+1],Se=[J?_e-t/2:ye?_e+t*4:_e-t*4,Te+t+1],Xe=[[te.left,ye||J?te.bottom-t:te.top],[te.right,ye?J?te.bottom-t:te.top:te.bottom-t]];return[Fe,Se,...Xe]}case"bottom":{const Fe=[J?_e+t/2:ye?_e+t*4:_e-t*4,Te-t],Se=[J?_e-t/2:ye?_e+t*4:_e-t*4,Te-t],Xe=[[te.left,ye||J?te.top+t:te.bottom],[te.right,ye?J?te.top+t:te.bottom:te.top+t]];return[Fe,Se,...Xe]}case"left":{const Fe=[_e+t+1,ve?Te+t/2:V?Te+t*4:Te-t*4],Se=[_e+t+1,ve?Te-t/2:V?Te+t*4:Te-t*4];return[...[[V||ve?te.right-t:te.left,te.top],[V?ve?te.right-t:te.left:te.right-t,te.bottom]],Fe,Se]}case"right":{const Fe=[_e-t,ve?Te+t/2:V?Te+t*4:Te-t*4],Se=[_e-t,ve?Te-t/2:V?Te+t*4:Te-t*4],Xe=[[V||ve?te.left+t:te.right,te.top],[V?ve?te.left+t:te.right:te.left+t,te.bottom]];return[Fe,Se,...Xe]}default:return[]}}if(!UA([$,j],be)){if(c&&!oe)return T();if(!Y&&r){const _e=p(k.clientX,k.clientY);if(_e!==null&&_e<.1)return T()}UA([$,j],xe([g,v]))?!c&&r&&i.start(40,T):T()}};return b.__options={blockPointerEvents:n},b}let zV=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),BV=(function(e){return e[e.open=Qa.open]="open",e[e.closed=Qa.closed]="closed",e[e.startingStyle=Qa.startingStyle]="startingStyle",e[e.endingStyle=Qa.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const LM=M.createContext(void 0);function $V(){const e=M.useContext(LM);if(e===void 0)throw new Error(Fo(26));return e}const zM="ArrowUp",BM="ArrowDown",$M="ArrowLeft",UM="ArrowRight",jM="Home",HM="End",UV=new Set([$M,UM]),jV=new Set([zM,BM]),HV=new Set([...UV,...jV]);[...HV];const VV=new Set([zM,BM,$M,UM,jM,HM]),FV={...Qf,...lS,nestedDialogOpen(e){return e?{[BV.nestedDialogOpen]:""}:null}},qV=M.forwardRef(function(t,n){const{className:r,finalFocus:i,initialFocus:c,render:l,...f}=t,{store:d}=fc(),p=d.useState("descriptionElementId"),b=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),v=d.useState("popupProps"),S=d.useState("modal"),w=d.useState("mounted"),E=d.useState("nested"),R=d.useState("nestedOpenDialogCount"),C=d.useState("open"),O=d.useState("openMethod"),k=d.useState("titleElementId"),T=d.useState("transitionStatus"),$=d.useState("role");$V(),uS({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function j(re){return re==="touch"?d.context.popupRef.current:!0}const H=c===void 0?j:c,P=R>0,ne=Sr("div",t,{state:{open:C,nested:E,transitionStatus:T,nestedDialogOpen:P},props:[v,{"aria-labelledby":k??void 0,"aria-describedby":p??void 0,role:$,tabIndex:-1,hidden:!w,onKeyDown(re){VV.has(re.key)&&re.stopPropagation()},style:{[zV.nestedDialogs]:R}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:FV});return N.jsx(nH,{context:g,openInteractionType:O,disabled:!w,closeOnFocusOut:!b,initialFocus:H,returnFocus:i,modal:S!==!1,restoreFocus:"popup",children:ne})});function GV(e){return Wv(19)?e:e?"true":void 0}const ZV=M.forwardRef(function(t,n){const{cutout:r,...i}=t;let c;if(r){const l=r?.getBoundingClientRect();c=`polygon( +`+u.stack}}var ft=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,Xe=e.unstable_cancelCallback,Pt=e.unstable_shouldYield,wn=e.unstable_requestPaint,It=e.unstable_now,Xs=e.unstable_getCurrentPriorityLevel,dt=e.unstable_ImmediatePriority,$t=e.unstable_UserBlockingPriority,gt=e.unstable_NormalPriority,Os=e.unstable_LowPriority,Ws=e.unstable_IdlePriority,ao=e.log,Rd=e.unstable_setDisableYieldValue,ui=null,Gn=null;function Ir(s){if(typeof ao=="function"&&Rd(s),Gn&&typeof Gn.setStrictMode=="function")try{Gn.setStrictMode(ui,s)}catch{}}var Zn=Math.clz32?Math.clz32:Js,qt=Math.log,Kn=Math.LN2;function Js(s){return s>>>=0,s===0?32:31-(qt(s)/Kn|0)|0}var Nn=256,ds=262144,co=4194304;function er(s){var o=s&42;if(o!==0)return o;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function fi(s,o,a){var u=s.pendingLanes;if(u===0)return 0;var p=0,m=s.suspendedLanes,x=s.pingedLanes;s=s.warmLanes;var A=u&134217727;return A!==0?(u=A&~m,u!==0?p=er(u):(x&=A,x!==0?p=er(x):a||(a=A&~s,a!==0&&(p=er(a))))):(A=u&~m,A!==0?p=er(A):x!==0?p=er(x):a||(a=u&~s,a!==0&&(p=er(a)))),p===0?0:o!==0&&o!==p&&(o&m)===0&&(m=p&-p,a=o&-o,m>=a||m===32&&(a&4194048)!==0)?o:p}function di(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function Sg(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Cd(){var s=co;return co<<=1,(co&62914560)===0&&(co=4194304),s}function au(s){for(var o=[],a=0;31>a;a++)o.push(s);return o}function Ra(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function cu(s,o,a,u,p,m){var x=s.pendingLanes;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=a,s.entangledLanes&=a,s.errorRecoveryDisabledLanes&=a,s.shellSuspendCounter=0;var A=s.entanglements,B=s.expirationTimes,K=s.hiddenUpdates;for(a=x&~a;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var E4=/[\n"\\]/g;function nr(s){return s.replace(E4,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function xg(s,o,a,u,p,m,x,A){s.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?s.type=x:s.removeAttribute("type"),o!=null?x==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+tr(o)):s.value!==""+tr(o)&&(s.value=""+tr(o)):x!=="submit"&&x!=="reset"||s.removeAttribute("value"),o!=null?Rg(s,x,tr(o)):a!=null?Rg(s,x,tr(a)):u!=null&&s.removeAttribute("value"),p==null&&m!=null&&(s.defaultChecked=!!m),p!=null&&(s.checked=p&&typeof p!="function"&&typeof p!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?s.name=""+tr(A):s.removeAttribute("name")}function OE(s,o,a,u,p,m,x,A){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(s.type=m),o!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||o!=null)){Eg(s);return}a=a!=null?""+tr(a):"",o=o!=null?""+tr(o):a,A||o===s.value||(s.value=o),s.defaultValue=o}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,s.checked=A?s.checked:!!u,s.defaultChecked=!!u,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(s.name=x),Eg(s)}function Rg(s,o,a){o==="number"&&kd(s.ownerDocument)===s||s.defaultValue===""+a||(s.defaultValue=""+a)}function Oc(s,o,a,u){if(s=s.options,o){o={};for(var p=0;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Og=!1;if(ho)try{var pu={};Object.defineProperty(pu,"passive",{get:function(){Og=!0}}),window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{Og=!1}var pi=null,Mg=null,Nd=null;function zE(){if(Nd)return Nd;var s,o=Mg,a=o.length,u,p="value"in pi?pi.value:pi.textContent,m=p.length;for(s=0;s=yu),VE=" ",qE=!1;function FE(s,o){switch(s){case"keyup":return X4.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GE(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Pc=!1;function J4(s,o){switch(s){case"compositionend":return GE(o);case"keypress":return o.which!==32?null:(qE=!0,VE);case"textInput":return s=o.data,s===VE&&qE?null:s;default:return null}}function eB(s,o){if(Pc)return s==="compositionend"||!Lg&&FE(s,o)?(s=zE(),Nd=Mg=pi=null,Pc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:a,offset:o-s};s=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ex(a)}}function nx(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?nx(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function sx(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=kd(s.document);o instanceof s.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)s=o.contentWindow;else break;o=kd(s.document)}return o}function $g(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var cB=ho&&"documentMode"in document&&11>=document.documentMode,Nc=null,Ug=null,_u=null,jg=!1;function rx(s,o,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;jg||Nc==null||Nc!==kd(u)||(u=Nc,"selectionStart"in u&&$g(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),_u&&Su(_u,u)||(_u=u,u=Th(Ug,"onSelect"),0>=x,p-=x,Br=1<<32-Zn(o)+p|a<We?(at=Be,Be=null):at=Be.sibling;var St=Y(G,Be,Z[We],le);if(St===null){Be===null&&(Be=at);break}s&&Be&&St.alternate===null&&o(G,Be),q=m(St,q,We),vt===null?$e=St:vt.sibling=St,vt=St,Be=at}if(We===Z.length)return a(G,Be),lt&&mo(G,We),$e;if(Be===null){for(;WeWe?(at=Be,Be=null):at=Be.sibling;var Li=Y(G,Be,St.value,le);if(Li===null){Be===null&&(Be=at);break}s&&Be&&Li.alternate===null&&o(G,Be),q=m(Li,q,We),vt===null?$e=Li:vt.sibling=Li,vt=Li,Be=at}if(St.done)return a(G,Be),lt&&mo(G,We),$e;if(Be===null){for(;!St.done;We++,St=Z.next())St=fe(G,St.value,le),St!==null&&(q=m(St,q,We),vt===null?$e=St:vt.sibling=St,vt=St);return lt&&mo(G,We),$e}for(Be=u(Be);!St.done;We++,St=Z.next())St=se(Be,G,We,St.value,le),St!==null&&(s&&St.alternate!==null&&Be.delete(St.key===null?We:St.key),q=m(St,q,We),vt===null?$e=St:vt.sibling=St,vt=St);return s&&Be.forEach(function(T$){return o(G,T$)}),lt&&mo(G,We),$e}function zt(G,q,Z,le){if(typeof Z=="object"&&Z!==null&&Z.type===E&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:e:{for(var $e=Z.key;q!==null;){if(q.key===$e){if($e=Z.type,$e===E){if(q.tag===7){a(G,q.sibling),le=p(q,Z.props.children),le.return=G,G=le;break e}}else if(q.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===P&&La($e)===q.type){a(G,q.sibling),le=p(q,Z.props),Au(le,Z),le.return=G,G=le;break e}a(G,q);break}else o(G,q);q=q.sibling}Z.type===E?(le=Ma(Z.props.children,G.mode,le,Z.key),le.return=G,G=le):(le=Fd(Z.type,Z.key,Z.props,null,G.mode,le),Au(le,Z),le.return=G,G=le)}return x(G);case w:e:{for($e=Z.key;q!==null;){if(q.key===$e)if(q.tag===4&&q.stateNode.containerInfo===Z.containerInfo&&q.stateNode.implementation===Z.implementation){a(G,q.sibling),le=p(q,Z.children||[]),le.return=G,G=le;break e}else{a(G,q);break}else o(G,q);q=q.sibling}le=Kg(Z,G.mode,le),le.return=G,G=le}return x(G);case P:return Z=La(Z),zt(G,q,Z,le)}if(ge(Z))return Pe(G,q,Z,le);if(F(Z)){if($e=F(Z),typeof $e!="function")throw Error(r(150));return Z=$e.call(Z),je(G,q,Z,le)}if(typeof Z.then=="function")return zt(G,q,Wd(Z),le);if(Z.$$typeof===k)return zt(G,q,Kd(G,Z),le);Jd(G,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,q!==null&&q.tag===6?(a(G,q.sibling),le=p(q,Z),le.return=G,G=le):(a(G,q),le=Zg(Z,G.mode,le),le.return=G,G=le),x(G)):a(G,q)}return function(G,q,Z,le){try{Cu=0;var $e=zt(G,q,Z,le);return Gc=null,$e}catch(Be){if(Be===Fc||Be===Yd)throw Be;var vt=Ds(29,Be,null,G.mode);return vt.lanes=le,vt.return=G,vt}}}var Ba=Ax(!0),Tx=Ax(!1),vi=!1;function iy(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ay(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Si(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function _i(s,o,a){var u=s.updateQueue;if(u===null)return null;if(u=u.shared,(Et&2)!==0){var p=u.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),u.pending=o,o=qd(s),fx(s,null,a),o}return Vd(s,u,o,a),qd(s)}function Tu(s,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194048)!==0)){var u=o.lanes;u&=s.pendingLanes,a|=u,o.lanes=a,Ad(s,a)}}function cy(s,o){var a=s.updateQueue,u=s.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var p=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?p=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?p=m=o:m=m.next=o}else p=m=o;a={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:m,shared:u.shared,callbacks:u.callbacks},s.updateQueue=a;return}s=a.lastBaseUpdate,s===null?a.firstBaseUpdate=o:s.next=o,a.lastBaseUpdate=o}var ly=!1;function Iu(){if(ly){var s=qc;if(s!==null)throw s}}function Ou(s,o,a,u){ly=!1;var p=s.updateQueue;vi=!1;var m=p.firstBaseUpdate,x=p.lastBaseUpdate,A=p.shared.pending;if(A!==null){p.shared.pending=null;var B=A,K=B.next;B.next=null,x===null?m=K:x.next=K,x=B;var ie=s.alternate;ie!==null&&(ie=ie.updateQueue,A=ie.lastBaseUpdate,A!==x&&(A===null?ie.firstBaseUpdate=K:A.next=K,ie.lastBaseUpdate=B))}if(m!==null){var fe=p.baseState;x=0,ie=K=B=null,A=m;do{var Y=A.lane&-536870913,se=Y!==A.lane;if(se?(it&Y)===Y:(u&Y)===Y){Y!==0&&Y===Vc&&(ly=!0),ie!==null&&(ie=ie.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Pe=s,je=A;Y=o;var zt=a;switch(je.tag){case 1:if(Pe=je.payload,typeof Pe=="function"){fe=Pe.call(zt,fe,Y);break e}fe=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=je.payload,Y=typeof Pe=="function"?Pe.call(zt,fe,Y):Pe,Y==null)break e;fe=g({},fe,Y);break e;case 2:vi=!0}}Y=A.callback,Y!==null&&(s.flags|=64,se&&(s.flags|=8192),se=p.callbacks,se===null?p.callbacks=[Y]:se.push(Y))}else se={lane:Y,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ie===null?(K=ie=se,B=fe):ie=ie.next=se,x|=Y;if(A=A.next,A===null){if(A=p.shared.pending,A===null)break;se=A,A=se.next,se.next=null,p.lastBaseUpdate=se,p.shared.pending=null}}while(!0);ie===null&&(B=fe),p.baseState=B,p.firstBaseUpdate=K,p.lastBaseUpdate=ie,m===null&&(p.shared.lanes=0),Ci|=x,s.lanes=x,s.memoizedState=fe}}function Ix(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function Ox(s,o){var a=s.callbacks;if(a!==null)for(s.callbacks=null,s=0;sm?m:8;var x=V.T,A={};V.T=A,Ty(s,!1,o,a);try{var B=p(),K=V.S;if(K!==null&&K(A,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ie=yB(B,u);ku(s,o,ie,zs(s))}else ku(s,o,u,zs(s))}catch(fe){ku(s,o,{then:function(){},status:"rejected",reason:fe},zs())}finally{re.p=m,x!==null&&A.types!==null&&(x.types=A.types),V.T=x}}function EB(){}function Cy(s,o,a,u){if(s.tag!==5)throw Error(r(476));var p=c1(s).queue;a1(s,p,o,J,a===null?EB:function(){return l1(s),a(u)})}function c1(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:J},next:null};var a={};return o.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:a},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function l1(s){var o=c1(s);o.next===null&&(o=s.alternate.memoizedState),ku(s,o.next.queue,{},zs())}function Ay(){return Bn(Yu)}function u1(){return on().memoizedState}function f1(){return on().memoizedState}function xB(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var a=zs();s=Si(a);var u=_i(o,s,a);u!==null&&(vs(u,o,a),Tu(u,o,a)),o={cache:ny()},s.payload=o;return}o=o.return}}function RB(s,o,a){var u=zs();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lh(s)?h1(o,a):(a=Fg(s,o,a,u),a!==null&&(vs(a,s,u),p1(a,o,u)))}function d1(s,o,a){var u=zs();ku(s,o,a,u)}function ku(s,o,a,u){var p={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(lh(s))h1(o,p);else{var m=s.alternate;if(s.lanes===0&&(m===null||m.lanes===0)&&(m=o.lastRenderedReducer,m!==null))try{var x=o.lastRenderedState,A=m(x,a);if(p.hasEagerState=!0,p.eagerState=A,Ms(A,x))return Vd(s,o,p,0),Ut===null&&Hd(),!1}catch{}if(a=Fg(s,o,p,u),a!==null)return vs(a,s,u),p1(a,o,u),!0}return!1}function Ty(s,o,a,u){if(u={lane:2,revertLane:i0(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},lh(s)){if(o)throw Error(r(479))}else o=Fg(s,a,u,2),o!==null&&vs(o,s,2)}function lh(s){var o=s.alternate;return s===Qe||o!==null&&o===Qe}function h1(s,o){Kc=nh=!0;var a=s.pending;a===null?o.next=o:(o.next=a.next,a.next=o),s.pending=o}function p1(s,o,a){if((a&4194048)!==0){var u=o.lanes;u&=s.pendingLanes,a|=u,o.lanes=a,Ad(s,a)}}var Pu={readContext:Bn,use:oh,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};Pu.useEffectEvent=nn;var m1={readContext:Bn,use:oh,useCallback:function(s,o){return rs().memoizedState=[s,o===void 0?null:o],s},useContext:Bn,useEffect:Wx,useImperativeHandle:function(s,o,a){a=a!=null?a.concat([s]):null,ah(4194308,4,n1.bind(null,o,s),a)},useLayoutEffect:function(s,o){return ah(4194308,4,s,o)},useInsertionEffect:function(s,o){ah(4,2,s,o)},useMemo:function(s,o){var a=rs();o=o===void 0?null:o;var u=s();if($a){Ir(!0);try{s()}finally{Ir(!1)}}return a.memoizedState=[u,o],u},useReducer:function(s,o,a){var u=rs();if(a!==void 0){var p=a(o);if($a){Ir(!0);try{a(o)}finally{Ir(!1)}}}else p=o;return u.memoizedState=u.baseState=p,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:p},u.queue=s,s=s.dispatch=RB.bind(null,Qe,s),[u.memoizedState,s]},useRef:function(s){var o=rs();return s={current:s},o.memoizedState=s},useState:function(s){s=_y(s);var o=s.queue,a=d1.bind(null,Qe,o);return o.dispatch=a,[s.memoizedState,a]},useDebugValue:xy,useDeferredValue:function(s,o){var a=rs();return Ry(a,s,o)},useTransition:function(){var s=_y(!1);return s=a1.bind(null,Qe,s.queue,!0,!1),rs().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,a){var u=Qe,p=rs();if(lt){if(a===void 0)throw Error(r(407));a=a()}else{if(a=o(),Ut===null)throw Error(r(349));(it&127)!==0||Lx(u,o,a)}p.memoizedState=a;var m={value:a,getSnapshot:o};return p.queue=m,Wx(Bx.bind(null,u,m,s),[s]),u.flags|=2048,Yc(9,{destroy:void 0},zx.bind(null,u,m,a,o),null),a},useId:function(){var s=rs(),o=Ut.identifierPrefix;if(lt){var a=$r,u=Br;a=(u&~(1<<32-Zn(u)-1)).toString(32)+a,o="_"+o+"R_"+a,a=sh++,0<\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof u.is=="string"?x.createElement("select",{is:u.is}):x.createElement("select"),u.multiple?m.multiple=!0:u.size&&(m.size=u.size);break;default:m=typeof u.is=="string"?x.createElement(p,{is:u.is}):x.createElement(p)}}m[Ln]=o,m[hs]=u;e:for(x=o.child;x!==null;){if(x.tag===5||x.tag===6)m.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===o)break e;for(;x.sibling===null;){if(x.return===null||x.return===o)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}o.stateNode=m;e:switch(Un(m,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&_o(o)}}return Gt(o),Hy(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,a),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==u&&_o(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(r(166));if(s=Se.current,jc(o)){if(s=o.stateNode,a=o.memoizedProps,u=null,p=zn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}s[Ln]=o,s=!!(s.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||PR(s.nodeValue,a)),s||yi(o,!0)}else s=Ih(s).createTextNode(u),s[Ln]=o,o.stateNode=s}return Gt(o),null;case 31:if(a=o.memoizedState,s===null||s.memoizedState!==null){if(u=jc(o),a!==null){if(s===null){if(!u)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Ln]=o}else Da(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Gt(o),s=!1}else a=Wg(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=a),s=!0;if(!s)return o.flags&256?(Ps(o),o):(Ps(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Gt(o),null;case 13:if(u=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(p=jc(o),u!==null&&u.dehydrated!==null){if(s===null){if(!p)throw Error(r(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Ln]=o}else Da(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Gt(o),p=!1}else p=Wg(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),p=!0;if(!p)return o.flags&256?(Ps(o),o):(Ps(o),null)}return Ps(o),(o.flags&128)!==0?(o.lanes=a,o):(a=u!==null,s=s!==null&&s.memoizedState!==null,a&&(u=o.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==p&&(u.flags|=2048)),a!==s&&a&&(o.child.flags|=8192),ph(o,o.updateQueue),Gt(o),null);case 4:return ve(),s===null&&u0(o.stateNode.containerInfo),Gt(o),null;case 10:return yo(o.type),Gt(o),null;case 19:if(ee(rn),u=o.memoizedState,u===null)return Gt(o),null;if(p=(o.flags&128)!==0,m=u.rendering,m===null)if(p)Lu(u,!1);else{if(sn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(m=th(s),m!==null){for(o.flags|=128,Lu(u,!1),s=m.updateQueue,o.updateQueue=s,ph(o,s),o.subtreeFlags=0,s=a,a=o.child;a!==null;)dx(a,s),a=a.sibling;return ye(rn,rn.current&1|2),lt&&mo(o,u.treeForkCount),o.child}s=s.sibling}u.tail!==null&&It()>vh&&(o.flags|=128,p=!0,Lu(u,!1),o.lanes=4194304)}else{if(!p)if(s=th(m),s!==null){if(o.flags|=128,p=!0,s=s.updateQueue,o.updateQueue=s,ph(o,s),Lu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!m.alternate&&!lt)return Gt(o),null}else 2*It()-u.renderingStartTime>vh&&a!==536870912&&(o.flags|=128,p=!0,Lu(u,!1),o.lanes=4194304);u.isBackwards?(m.sibling=o.child,o.child=m):(s=u.last,s!==null?s.sibling=m:o.child=m,u.last=m)}return u.tail!==null?(s=u.tail,u.rendering=s,u.tail=s.sibling,u.renderingStartTime=It(),s.sibling=null,a=rn.current,ye(rn,p?a&1|2:a&1),lt&&mo(o,u.treeForkCount),s):(Gt(o),null);case 22:case 23:return Ps(o),fy(),u=o.memoizedState!==null,s!==null?s.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(a&536870912)!==0&&(o.flags&128)===0&&(Gt(o),o.subtreeFlags&6&&(o.flags|=8192)):Gt(o),a=o.updateQueue,a!==null&&ph(o,a.retryQueue),a=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==a&&(o.flags|=2048),s!==null&&ee(Na),null;case 24:return a=null,s!==null&&(a=s.memoizedState.cache),o.memoizedState.cache!==a&&(o.flags|=2048),yo(dn),Gt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function OB(s,o){switch(Yg(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return yo(dn),ve(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return wt(o),null;case 31:if(o.memoizedState!==null){if(Ps(o),o.alternate===null)throw Error(r(340));Da()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Ps(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Da()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return ee(rn),null;case 4:return ve(),null;case 10:return yo(o.type),null;case 22:case 23:return Ps(o),fy(),s!==null&&ee(Na),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return yo(dn),null;case 25:return null;default:return null}}function $1(s,o){switch(Yg(o),o.tag){case 3:yo(dn),ve();break;case 26:case 27:case 5:wt(o);break;case 4:ve();break;case 31:o.memoizedState!==null&&Ps(o);break;case 13:Ps(o);break;case 19:ee(rn);break;case 10:yo(o.type);break;case 22:case 23:Ps(o),fy(),s!==null&&ee(Na);break;case 24:yo(dn)}}function zu(s,o){try{var a=o.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var p=u.next;a=p;do{if((a.tag&s)===s){u=void 0;var m=a.create,x=a.inst;u=m(),x.destroy=u}a=a.next}while(a!==p)}}catch(A){Mt(o,o.return,A)}}function xi(s,o,a){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var m=p.next;u=m;do{if((u.tag&s)===s){var x=u.inst,A=x.destroy;if(A!==void 0){x.destroy=void 0,p=o;var B=a,K=A;try{K()}catch(ie){Mt(p,B,ie)}}}u=u.next}while(u!==m)}}catch(ie){Mt(o,o.return,ie)}}function U1(s){var o=s.updateQueue;if(o!==null){var a=s.stateNode;try{Ox(o,a)}catch(u){Mt(s,s.return,u)}}}function j1(s,o,a){a.props=Ua(s.type,s.memoizedProps),a.state=s.memoizedState;try{a.componentWillUnmount()}catch(u){Mt(s,o,u)}}function Bu(s,o){try{var a=s.ref;if(a!==null){switch(s.tag){case 26:case 27:case 5:var u=s.stateNode;break;case 30:u=s.stateNode;break;default:u=s.stateNode}typeof a=="function"?s.refCleanup=a(u):a.current=u}}catch(p){Mt(s,o,p)}}function Ur(s,o){var a=s.ref,u=s.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(p){Mt(s,o,p)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){Mt(s,o,p)}else a.current=null}function H1(s){var o=s.type,a=s.memoizedProps,u=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(p){Mt(s,s.return,p)}}function Vy(s,o,a){try{var u=s.stateNode;WB(u,s.type,a,o),u[hs]=o}catch(p){Mt(s,s.return,p)}}function V1(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Mi(s.type)||s.tag===4}function qy(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||V1(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Mi(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Fy(s,o,a){var u=s.tag;if(u===5||u===6)s=s.stateNode,o?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(s,o):(o=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,o.appendChild(s),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=fo));else if(u!==4&&(u===27&&Mi(s.type)&&(a=s.stateNode,o=null),s=s.child,s!==null))for(Fy(s,o,a),s=s.sibling;s!==null;)Fy(s,o,a),s=s.sibling}function mh(s,o,a){var u=s.tag;if(u===5||u===6)s=s.stateNode,o?a.insertBefore(s,o):a.appendChild(s);else if(u!==4&&(u===27&&Mi(s.type)&&(a=s.stateNode),s=s.child,s!==null))for(mh(s,o,a),s=s.sibling;s!==null;)mh(s,o,a),s=s.sibling}function q1(s){var o=s.stateNode,a=s.memoizedProps;try{for(var u=s.type,p=o.attributes;p.length;)o.removeAttributeNode(p[0]);Un(o,u,a),o[Ln]=s,o[hs]=a}catch(m){Mt(s,s.return,m)}}var wo=!1,mn=!1,Gy=!1,F1=typeof WeakSet=="function"?WeakSet:Set,An=null;function MB(s,o){if(s=s.containerInfo,h0=Lh,s=sx(s),$g(s)){if("selectionStart"in s)var a={start:s.selectionStart,end:s.selectionEnd};else e:{a=(a=s.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var p=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,A=-1,B=-1,K=0,ie=0,fe=s,Y=null;t:for(;;){for(var se;fe!==a||p!==0&&fe.nodeType!==3||(A=x+p),fe!==m||u!==0&&fe.nodeType!==3||(B=x+u),fe.nodeType===3&&(x+=fe.nodeValue.length),(se=fe.firstChild)!==null;)Y=fe,fe=se;for(;;){if(fe===s)break t;if(Y===a&&++K===p&&(A=x),Y===m&&++ie===u&&(B=x),(se=fe.nextSibling)!==null)break;fe=Y,Y=fe.parentNode}fe=se}a=A===-1||B===-1?null:{start:A,end:B}}else a=null}a=a||{start:0,end:0}}else a=null;for(p0={focusedElem:s,selectionRange:a},Lh=!1,An=o;An!==null;)if(o=An,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,An=s;else for(;An!==null;){switch(o=An,m=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(a=0;a title"))),Un(m,u,a),m[Ln]=s,Cn(m),u=m;break e;case"link":var x=XR("link","href",p).get(u+(a.href||""));if(x){for(var A=0;Azt&&(x=zt,zt=je,je=x);var G=tx(A,je),q=tx(A,zt);if(G&&q&&(se.rangeCount!==1||se.anchorNode!==G.node||se.anchorOffset!==G.offset||se.focusNode!==q.node||se.focusOffset!==q.offset)){var Z=fe.createRange();Z.setStart(G.node,G.offset),se.removeAllRanges(),je>zt?(se.addRange(Z),se.extend(q.node,q.offset)):(Z.setEnd(q.node,q.offset),se.addRange(Z))}}}}for(fe=[],se=A;se=se.parentNode;)se.nodeType===1&&fe.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;Aa?32:a,V.T=null,a=Jy,Jy=null;var m=Ti,x=Ao;if(En=0,tl=Ti=null,Ao=0,(Et&6)!==0)throw Error(r(331));var A=Et;if(Et|=4,nR(m.current),J1(m,m.current,x,a),Et=A,qu(0,!1),Gn&&typeof Gn.onPostCommitFiberRoot=="function")try{Gn.onPostCommitFiberRoot(ui,m)}catch{}return!0}finally{re.p=p,V.T=u,SR(s,o)}}function wR(s,o,a){o=rr(a,o),o=Dy(s.stateNode,o,2),s=_i(s,o,2),s!==null&&(Ra(s,2),jr(s))}function Mt(s,o,a){if(s.tag===3)wR(s,s,a);else for(;o!==null;){if(o.tag===3){wR(o,s,a);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ai===null||!Ai.has(u))){s=rr(a,s),a=E1(2),u=_i(o,a,2),u!==null&&(x1(a,u,o,s),Ra(u,2),jr(u));break}}o=o.return}}function s0(s,o,a){var u=s.pingCache;if(u===null){u=s.pingCache=new PB;var p=new Set;u.set(o,p)}else p=u.get(o),p===void 0&&(p=new Set,u.set(o,p));p.has(a)||(Qy=!0,p.add(a),s=$B.bind(null,s,o,a),o.then(s,s))}function $B(s,o,a){var u=s.pingCache;u!==null&&u.delete(o),s.pingedLanes|=s.suspendedLanes&a,s.warmLanes&=~a,Ut===s&&(it&a)===a&&(sn===4||sn===3&&(it&62914560)===it&&300>It()-bh?(Et&2)===0&&nl(s,0):Yy|=a,el===it&&(el=0)),jr(s)}function ER(s,o){o===0&&(o=Cd()),s=Oa(s,o),s!==null&&(Ra(s,o),jr(s))}function UB(s){var o=s.memoizedState,a=0;o!==null&&(a=o.retryLane),ER(s,a)}function jB(s,o){var a=0;switch(s.tag){case 31:case 13:var u=s.stateNode,p=s.memoizedState;p!==null&&(a=p.retryLane);break;case 19:u=s.stateNode;break;case 22:u=s.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(o),ER(s,a)}function HB(s,o){return mt(s,o)}var Rh=null,rl=null,r0=!1,Ch=!1,o0=!1,Oi=0;function jr(s){s!==rl&&s.next===null&&(rl===null?Rh=rl=s:rl=rl.next=s),Ch=!0,r0||(r0=!0,qB())}function qu(s,o){if(!o0&&Ch){o0=!0;do for(var a=!1,u=Rh;u!==null;){if(s!==0){var p=u.pendingLanes;if(p===0)var m=0;else{var x=u.suspendedLanes,A=u.pingedLanes;m=(1<<31-Zn(42|s)+1)-1,m&=p&~(x&~A),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,AR(u,m))}else m=it,m=fi(u,u===Ut?m:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(m&3)===0||di(u,m)||(a=!0,AR(u,m));u=u.next}while(a);o0=!1}}function VB(){xR()}function xR(){Ch=r0=!1;var s=0;Oi!==0&&e$()&&(s=Oi);for(var o=It(),a=null,u=Rh;u!==null;){var p=u.next,m=RR(u,o);m===0?(u.next=null,a===null?Rh=p:a.next=p,p===null&&(rl=a)):(a=u,(s!==0||(m&3)!==0)&&(Ch=!0)),u=p}En!==0&&En!==5||qu(s),Oi!==0&&(Oi=0)}function RR(s,o){for(var a=s.suspendedLanes,u=s.pingedLanes,p=s.expirationTimes,m=s.pendingLanes&-62914561;0A)break;var ie=B.transferSize,fe=B.initiatorType;ie&&NR(fe)&&(B=B.responseEnd,x+=ie*(B"u"?null:document;function ZR(s,o,a){var u=ol;if(u&&typeof o=="string"&&o){var p=nr(o);p='link[rel="'+s+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),GR.has(p)||(GR.add(p),s={rel:s,crossOrigin:a,href:o},u.querySelector(p)===null&&(o=u.createElement("link"),Un(o,"link",s),Cn(o),u.head.appendChild(o)))}}function l$(s){To.D(s),ZR("dns-prefetch",s,null)}function u$(s,o){To.C(s,o),ZR("preconnect",s,o)}function f$(s,o,a){To.L(s,o,a);var u=ol;if(u&&s&&o){var p='link[rel="preload"][as="'+nr(o)+'"]';o==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+nr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+nr(a.imageSizes)+'"]')):p+='[href="'+nr(s)+'"]';var m=p;switch(o){case"style":m=il(s);break;case"script":m=al(s)}ur.has(m)||(s=g({rel:"preload",href:o==="image"&&a&&a.imageSrcSet?void 0:s,as:o},a),ur.set(m,s),u.querySelector(p)!==null||o==="style"&&u.querySelector(Ku(m))||o==="script"&&u.querySelector(Qu(m))||(o=u.createElement("link"),Un(o,"link",s),Cn(o),u.head.appendChild(o)))}}function d$(s,o){To.m(s,o);var a=ol;if(a&&s){var u=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+nr(u)+'"][href="'+nr(s)+'"]',m=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=al(s)}if(!ur.has(m)&&(s=g({rel:"modulepreload",href:s},o),ur.set(m,s),a.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Qu(m)))return}u=a.createElement("link"),Un(u,"link",s),Cn(u),a.head.appendChild(u)}}}function h$(s,o,a){To.S(s,o,a);var u=ol;if(u&&s){var p=Tc(u).hoistableStyles,m=il(s);o=o||"default";var x=p.get(m);if(!x){var A={loading:0,preload:null};if(x=u.querySelector(Ku(m)))A.loading=5;else{s=g({rel:"stylesheet",href:s,"data-precedence":o},a),(a=ur.get(m))&&_0(s,a);var B=x=u.createElement("link");Cn(B),Un(B,"link",s),B._p=new Promise(function(K,ie){B.onload=K,B.onerror=ie}),B.addEventListener("load",function(){A.loading|=1}),B.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Mh(x,o,u)}x={type:"stylesheet",instance:x,count:1,state:A},p.set(m,x)}}}function p$(s,o){To.X(s,o);var a=ol;if(a&&s){var u=Tc(a).hoistableScripts,p=al(s),m=u.get(p);m||(m=a.querySelector(Qu(p)),m||(s=g({src:s,async:!0},o),(o=ur.get(p))&&w0(s,o),m=a.createElement("script"),Cn(m),Un(m,"link",s),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(p,m))}}function m$(s,o){To.M(s,o);var a=ol;if(a&&s){var u=Tc(a).hoistableScripts,p=al(s),m=u.get(p);m||(m=a.querySelector(Qu(p)),m||(s=g({src:s,async:!0,type:"module"},o),(o=ur.get(p))&&w0(s,o),m=a.createElement("script"),Cn(m),Un(m,"link",s),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(p,m))}}function KR(s,o,a,u){var p=(p=Se.current)?Oh(p):null;if(!p)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(o=il(a.href),a=Tc(p).hoistableStyles,u=a.get(o),u||(u={type:"style",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){s=il(a.href);var m=Tc(p).hoistableStyles,x=m.get(s);if(x||(p=p.ownerDocument||p,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(s,x),(m=p.querySelector(Ku(s)))&&!m._p&&(x.instance=m,x.state.loading=5),ur.has(s)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ur.set(s,a),m||g$(p,s,a,x.state))),o&&u===null)throw Error(r(528,""));return x}if(o&&u!==null)throw Error(r(529,""));return null;case"script":return o=a.async,a=a.src,typeof a=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=al(a),a=Tc(p).hoistableScripts,u=a.get(o),u||(u={type:"script",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function il(s){return'href="'+nr(s)+'"'}function Ku(s){return'link[rel="stylesheet"]['+s+"]"}function QR(s){return g({},s,{"data-precedence":s.precedence,precedence:null})}function g$(s,o,a,u){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=s.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),Un(o,"link",a),Cn(o),s.head.appendChild(o))}function al(s){return'[src="'+nr(s)+'"]'}function Qu(s){return"script[async]"+s}function YR(s,o,a){if(o.count++,o.instance===null)switch(o.type){case"style":var u=s.querySelector('style[data-href~="'+nr(a.href)+'"]');if(u)return o.instance=u,Cn(u),u;var p=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(s.ownerDocument||s).createElement("style"),Cn(u),Un(u,"style",p),Mh(u,a.precedence,s),o.instance=u;case"stylesheet":p=il(a.href);var m=s.querySelector(Ku(p));if(m)return o.state.loading|=4,o.instance=m,Cn(m),m;u=QR(a),(p=ur.get(p))&&_0(u,p),m=(s.ownerDocument||s).createElement("link"),Cn(m);var x=m;return x._p=new Promise(function(A,B){x.onload=A,x.onerror=B}),Un(m,"link",u),o.state.loading|=4,Mh(m,a.precedence,s),o.instance=m;case"script":return m=al(a.src),(p=s.querySelector(Qu(m)))?(o.instance=p,Cn(p),p):(u=a,(p=ur.get(m))&&(u=g({},a),w0(u,p)),s=s.ownerDocument||s,p=s.createElement("script"),Cn(p),Un(p,"link",u),s.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,Mh(u,a.precedence,s));return o.instance}function Mh(s,o,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,m=p,x=0;x title"):null)}function y$(s,o,a){if(a===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(s=o.disabled,typeof o.precedence=="string"&&s==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function JR(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function b$(s,o,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=il(u.href),m=o.querySelector(Ku(p));if(m){o=m._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=kh.bind(s),o.then(s,s)),a.state.loading|=4,a.instance=m,Cn(m);return}m=o.ownerDocument||o,u=QR(u),(p=ur.get(p))&&_0(u,p),m=m.createElement("link"),Cn(m);var x=m;x._p=new Promise(function(A,B){x.onload=A,x.onerror=B}),Un(m,"link",u),a.instance=m}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(a,o),(o=a.state.preload)&&(a.state.loading&3)===0&&(s.count++,a=kh.bind(s),o.addEventListener("load",a),o.addEventListener("error",a))}}var E0=0;function v$(s,o){return s.stylesheets&&s.count===0&&Nh(s,s.stylesheets),0E0?50:800)+o);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function kh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Ph=null;function Nh(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Ph=new Map,o.forEach(S$,s),Ph=null,kh.call(s))}function S$(s,o){if(!(o.state.loading&4)){var a=Ph.get(s);if(a)var u=a.get(null);else{a=new Map,Ph.set(s,a);for(var p=s.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),q0.exports=v5(),q0.exports}var _5=S5();const w5=T2(_5);var Z0={exports:{}},K0={};var tA;function E5(){if(tA)return K0;tA=1;var e=zl().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return K0.c=function(t){return e.H.useMemoCache(t)},K0}var nA;function x5(){return nA||(nA=1,Z0.exports=E5()),Z0.exports}var kt=x5();const cO=M.createContext(void 0);function R5(e,t){try{const n=localStorage.getItem(e);if(n==="light"||n==="dark"||n==="system")return n}catch{}return t}function C5(e){const t=kt.c(14),{children:n,defaultTheme:r,storageKey:i}=e,c=r===void 0?"system":r,l=i===void 0?"ui-theme":i;let f;t[0]!==c||t[1]!==l?(f=()=>R5(l,c),t[0]=c,t[1]=l,t[2]=f):f=t[2];const[d,h]=M.useState(f);let b,g;t[3]!==d?(b=()=>{const R=window.document.documentElement;if(R.classList.remove("light","dark"),d==="system"){const C=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";R.classList.add(C);return}R.classList.add(d)},g=[d],t[3]=d,t[4]=b,t[5]=g):(b=t[4],g=t[5]),M.useEffect(b,g);let v;t[6]!==l?(v=R=>{try{localStorage.setItem(l,R)}catch{}h(R)},t[6]=l,t[7]=v):v=t[7];let _;t[8]!==v||t[9]!==d?(_={theme:d,setTheme:v},t[8]=v,t[9]=d,t[10]=_):_=t[10];const w=_;let E;return t[11]!==n||t[12]!==w?(E=N.jsx(cO.Provider,{value:w,children:n}),t[11]=n,t[12]=w,t[13]=E):E=t[13],E}function A5(){const e=M.useContext(cO);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function ev(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Sf={};function vm(e,t,n,r,i){let c={...tv(e,Sf)};return t&&(c=mf(c,t)),n&&(c=mf(c,n)),r&&(c=mf(c,r)),i&&(c=mf(c,i)),c}function T5(e){if(e.length===0)return Sf;if(e.length===1)return tv(e[0],Sf);let t={...tv(e[0],Sf)};for(let n=1;n=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function lO(e){return typeof e=="function"}function tv(e,t){return lO(e)?e(t):e??Sf}function M5(e,t){return t?e?n=>{if(D5(n)){const i=n;nv(i);const c=t(i);return i.baseUIHandlerPrevented||e?.(i),c}const r=t(n);return e?.(n),r}:t:e}function nv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function uO(e,t){return t?e?t+" "+e:t:e}function D5(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Vo(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const sA={};function Sr(e,t){const n=M.useRef(sA);return n.current===sA&&(n.current=e(t)),n}function Np(e,t,n,r){const i=Sr(fO).current;return P5(i,e,t,n,r)&&dO(i,[e,t,n,r]),i.callback}function k5(e){const t=Sr(fO).current;return N5(t,e)&&dO(t,e),t.callback}function fO(){return{callback:null,cleanup:null,refs:[]}}function P5(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function N5(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function dO(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i{for(let i=0;i=e}function rA(e){if(!M.isValidElement(e))return null;const t=e,n=t.props;return(Xv(19)?n?.ref:t.ref)??null}function z5(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const c=t[r](i);c!=null&&Object.assign(n,c);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function B5(e,t){return typeof e=="function"?e(t):e}function $5(e,t){return typeof e=="function"?e(t):e}function hO(){}const RRe=Object.freeze([]),Hs=Object.freeze({}),U5={style:{transition:"none"}},j5="data-base-ui-click-trigger",CRe={fallbackAxisSide:"none"},H5={fallbackAxisSide:"end"},V5={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function _r(e,t,n={}){const r=t.render,i=q5(t,n);if(n.enabled===!1)return null;const c=n.state??Hs;return G5(e,r,i,c)}function q5(e,t={}){const{className:n,style:r,render:i}=e,{state:c=Hs,ref:l,props:f,stateAttributesMapping:d,enabled:h=!0}=t,b=h?B5(n,c):void 0,g=h?$5(r,c):void 0,v=h?z5(c,d):Hs,_=h?ev(v,Array.isArray(f)?T5(f):f)??Hs:Hs;return typeof document<"u"&&(h?Array.isArray(l)?_.ref=k5([_.ref,rA(i),...l]):_.ref=Np(_.ref,rA(i),l):Np(null,null)),h?(b!==void 0&&(_.className=uO(_.className,b)),g!==void 0&&(_.style=ev(_.style,g)),_):Hs}const F5=Symbol.for("react.lazy");function G5(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=vm(n,t.props);i.ref=n.ref;let c=t;return c?.$$typeof===F5&&(c=M.Children.toArray(t)[0]),M.cloneElement(c,i)}if(e&&typeof e=="string")return Z5(e,n);throw new Error(Vo(8))}function Z5(e,t){return e==="button"?M.createElement("button",{type:"button",...t,key:t.key}):e==="img"?M.createElement("img",{alt:"",...t,key:t.key}):M.createElement(e,t)}function pO(e){return _r(e.defaultTagName??"div",e,e)}function mO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,iA=gO,yO=(e,t)=>n=>{var r;if(t?.variants==null)return iA(e,n?.class,n?.className);const{variants:i,defaultVariants:c}=t,l=Object.keys(i).map(h=>{const b=n?.[h],g=c?.[h];if(b===null)return null;const v=oA(b)||oA(g);return i[h][v]}),f=n&&Object.entries(n).reduce((h,b)=>{let[g,v]=b;return v===void 0||(h[g]=v),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,b)=>{let{class:g,className:v,..._}=b;return Object.entries(_).every(w=>{let[E,R]=w;return Array.isArray(R)?R.includes({...c,...f}[E]):{...c,...f}[E]===R})?[...h,g,v]:h},[]);return iA(e,l,d,n?.class,n?.className)};const bO=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const K5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Q5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const aA=e=>{const t=Q5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Y5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const X5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const W5=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:c,iconNode:l,...f},d)=>M.createElement("svg",{ref:d,...Y5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:bO("lucide",i),...!c&&!X5(f)&&{"aria-hidden":"true"},...f},[...l.map(([h,b])=>M.createElement(h,b)),...Array.isArray(c)?c:[c]]));const xs=(e,t)=>{const n=M.forwardRef(({className:r,...i},c)=>M.createElement(W5,{ref:c,iconNode:t,className:bO(`lucide-${K5(aA(e))}`,`lucide-${e}`,r),...i}));return n.displayName=aA(e),n};const J5=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],e8=xs("camera",J5);const t8=[["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"}]],n8=xs("circle-alert",t8);const s8=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],r8=xs("hard-drive",s8);const o8=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],i8=xs("house",o8);const a8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],c8=xs("image",a8);const l8=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],u8=xs("key",l8);const f8=[["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"}]],d8=xs("layout-grid",f8);const h8=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],p8=xs("log-out",h8);const m8=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],g8=xs("moon",m8);const y8=[["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"}]],b8=xs("network",y8);const v8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],S8=xs("panel-left",v8);const _8=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],cA=xs("server",_8);const w8=[["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"}]],E8=xs("sun",w8);const x8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],R8=xs("x",x8);function Sm(){return typeof window<"u"}function sa(e){return Wv(e)?(e.nodeName||"").toLowerCase():"#document"}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function eo(e){var t;return(t=(Wv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wv(e){return Sm()?e instanceof Node||e instanceof Sn(e).Node:!1}function xt(e){return Sm()?e instanceof Element||e instanceof Sn(e).Element:!1}function yn(e){return Sm()?e instanceof HTMLElement||e instanceof Sn(e).HTMLElement:!1}function sv(e){return!Sm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}const C8=new Set(["inline","contents"]);function ra(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Gs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!C8.has(i)}const A8=new Set(["table","td","th"]);function T8(e){return A8.has(sa(e))}const I8=[":popover-open",":modal"];function _m(e){return I8.some(t=>{try{return e.matches(t)}catch{return!1}})}const O8=["transform","translate","scale","rotate","perspective"],M8=["transform","translate","scale","rotate","perspective","filter"],D8=["paint","layout","strict","content"];function Jv(e){const t=wm(),n=xt(e)?Gs(e):e;return O8.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||M8.some(r=>(n.willChange||"").includes(r))||D8.some(r=>(n.contain||"").includes(r))}function k8(e){let t=$o(e);for(;yn(t)&&!zo(t);){if(Jv(t))return t;if(_m(t))return null;t=$o(t)}return null}function wm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const P8=new Set(["html","body","#document"]);function zo(e){return P8.has(sa(e))}function Gs(e){return Sn(e).getComputedStyle(e)}function Em(e){return xt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $o(e){if(sa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sv(e)&&e.host||eo(e);return sv(t)?t.host:t}function vO(e){const t=$o(e);return zo(t)?e.ownerDocument?e.ownerDocument.body:e.body:yn(t)&&ra(t)?t:vO(t)}function Wi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=vO(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),l=Sn(i);if(c){const f=rv(l);return t.concat(l,l.visualViewport||[],ra(i)?i:[],f&&n?Wi(f):[])}return t.concat(i,Wi(i,[],n))}function rv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Q0=Lv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],N8=Q0&&Q0!==M.useLayoutEffect?Q0:e=>e();function Fe(e){const t=Sr(L8).current;return t.next=e,N8(t.effect),t.trampoline}function L8(){const e={next:void 0,callback:z8,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function z8(){}const B8={...Lv},$8=()=>{},pt=typeof document<"u"?M.useLayoutEffect:$8,U8=M.createContext(void 0);function j8(e=!1){const t=M.useContext(U8);if(t===void 0&&!e)throw new Error(Vo(16));return t}function H8(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:c}=e,l=r&&t!==!1,f=r&&t===!1;return{props:M.useMemo(()=>{const h={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(h.tabIndex=i,!c&&n&&(h.tabIndex=t?i:-1)),(c&&(t||l)||!c&&n)&&(h["aria-disabled"]=n),c&&(!t||f)&&(h.disabled=n),h},[r,n,t,l,f,c,i])}}function SO(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,c=M.useRef(null),l=j8(!0)!==void 0,f=Fe(()=>{const v=c.current;return!!(v?.tagName==="A"&&v?.href)}),{props:d}=H8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),h=M.useCallback(()=>{const v=c.current;V8(v)&&l&&t&&d.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,d.disabled,l]);pt(h,[h]);const b=M.useCallback((v={})=>{const{onClick:_,onMouseDown:w,onKeyUp:E,onKeyDown:R,onPointerDown:C,...I}=v;return vm({type:i?"button":void 0,onClick(T){if(t){T.preventDefault();return}_?.(T)},onMouseDown(T){t||w?.(T)},onKeyDown(T){if(t||(nv(T),R?.(T)),T.baseUIHandlerPrevented)return;const $=T.target===T.currentTarget&&!i&&!f()&&!t,j=T.key==="Enter",H=T.key===" ";$&&((H||j)&&T.preventDefault(),j&&_?.(T))},onKeyUp(T){t||(nv(T),E?.(T)),!T.baseUIHandlerPrevented&&T.target===T.currentTarget&&!i&&!t&&T.key===" "&&_?.(T)},onPointerDown(T){if(t){T.preventDefault();return}C?.(T)}},i?void 0:{role:"button"},d,I)},[t,d,i,f]),g=Fe(v=>{c.current=v,h()});return{getButtonProps:b,buttonRef:g}}function V8(e){return yn(e)&&e.tagName==="BUTTON"}const q8=M.forwardRef(function(t,n){const{render:r,className:i,disabled:c=!1,focusableWhenDisabled:l=!1,nativeButton:f=!0,...d}=t,{getButtonProps:h,buttonRef:b}=SO({disabled:c,focusableWhenDisabled:l,native:f});return _r("button",t,{state:{disabled:c},ref:[n,b],props:[d,h]})}),F8=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),_O=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lp="-",lA=[],Z8="arbitrary..",K8=e=>{const t=Y8(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Q8(l);const f=l.split(Lp),d=f[0]===""&&f.length>1?1:0;return wO(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=r[l],h=n[l];return d?h?F8(h,d):d:h||lA}return n[l]||lA}}},wO=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],c=n.nextPart.get(i);if(c){const h=wO(e,t+1,c);if(h)return h}const l=n.validators;if(l===null)return;const f=t===0?e.join(Lp):e.slice(t).join(Lp),d=l.length;for(let h=0;he.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Z8+r:void 0})(),Y8=e=>{const{theme:t,classGroups:n}=e;return X8(n,t)},X8=(e,t)=>{const n=_O();for(const r in e){const i=e[r];eS(i,n,r,t)}return n},eS=(e,t,n,r)=>{const i=e.length;for(let c=0;c{if(typeof e=="string"){J8(e,t,n);return}if(typeof e=="function"){ej(e,t,n,r);return}tj(e,t,n,r)},J8=(e,t,n)=>{const r=e===""?t:EO(t,e);r.classGroupId=n},ej=(e,t,n,r)=>{if(nj(e)){eS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(G8(n,e))},tj=(e,t,n,r)=>{const i=Object.entries(e),c=i.length;for(let l=0;l{let n=e;const r=t.split(Lp),i=r.length;for(let c=0;c"isThemeGetter"in e&&e.isThemeGetter===!0,sj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(c,l)=>{n[c]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(c){let l=n[c];if(l!==void 0)return l;if((l=r[c])!==void 0)return i(c,l),l},set(c,l){c in n?n[c]=l:i(c,l)}}},ov="!",uA=":",rj=[],fA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),oj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const c=[];let l=0,f=0,d=0,h;const b=i.length;for(let E=0;Ed?h-d:void 0;return fA(c,_,v,w)};if(t){const i=t+uA,c=r;r=l=>l.startsWith(i)?c(l.slice(i.length)):fA(rj,!1,l,void 0,!0)}if(n){const i=r;r=c=>n({className:c,parseClassName:i})}return r},ij=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let c=0;c0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},aj=e=>({cache:sj(e.cacheSize),parseClassName:oj(e),sortModifiers:ij(e),...K8(e)}),cj=/\s+/,lj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:c}=t,l=[],f=e.trim().split(cj);let d="";for(let h=f.length-1;h>=0;h-=1){const b=f[h],{isExternal:g,modifiers:v,hasImportantModifier:_,baseClassName:w,maybePostfixModifierPosition:E}=n(b);if(g){d=b+(d.length>0?" "+d:d);continue}let R=!!E,C=r(R?w.substring(0,E):w);if(!C){if(!R){d=b+(d.length>0?" "+d:d);continue}if(C=r(w),!C){d=b+(d.length>0?" "+d:d);continue}R=!1}const I=v.length===0?"":v.length===1?v[0]:c(v).join(":"),k=_?I+ov:I,T=k+C;if(l.indexOf(T)>-1)continue;l.push(T);const $=i(C,R);for(let j=0;j<$.length;++j){const H=$[j];l.push(k+H)}d=b+(d.length>0?" "+d:d)}return d},uj=(...e)=>{let t=0,n,r,i="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,i,c;const l=d=>{const h=t.reduce((b,g)=>g(b),e());return n=aj(h),r=n.cache.get,i=n.cache.set,c=f,f(d)},f=d=>{const h=r(d);if(h)return h;const b=lj(d,n);return i(d,b),b};return c=l,(...d)=>c(uj(...d))},dj=[],xn=e=>{const t=n=>n[e]||dj;return t.isThemeGetter=!0,t},RO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,CO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mj=/\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$/,gj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=e=>hj.test(e),tt=e=>!!e&&!Number.isNaN(Number(e)),Bi=e=>!!e&&Number.isInteger(Number(e)),Y0=e=>e.endsWith("%")&&tt(e.slice(0,-1)),Io=e=>pj.test(e),AO=()=>!0,vj=e=>mj.test(e)&&!gj.test(e),tS=()=>!1,Sj=e=>yj.test(e),_j=e=>bj.test(e),wj=e=>!Ne(e)&&!Le(e),Ej=e=>oa(e,OO,tS),Ne=e=>RO.test(e),qa=e=>oa(e,MO,vj),dA=e=>oa(e,Mj,tt),xj=e=>oa(e,kO,AO),Rj=e=>oa(e,DO,tS),hA=e=>oa(e,TO,tS),Cj=e=>oa(e,IO,_j),Zh=e=>oa(e,PO,Sj),Le=e=>CO.test(e),af=e=>uc(e,MO),Aj=e=>uc(e,DO),pA=e=>uc(e,TO),Tj=e=>uc(e,OO),Ij=e=>uc(e,IO),Kh=e=>uc(e,PO,!0),Oj=e=>uc(e,kO,!0),oa=(e,t,n)=>{const r=RO.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uc=(e,t,n=!1)=>{const r=CO.exec(e);return r?r[1]?t(r[1]):n:!1},TO=e=>e==="position"||e==="percentage",IO=e=>e==="image"||e==="url",OO=e=>e==="length"||e==="size"||e==="bg-size",MO=e=>e==="length",Mj=e=>e==="number",DO=e=>e==="family-name",kO=e=>e==="number"||e==="weight",PO=e=>e==="shadow",Dj=()=>{const e=xn("color"),t=xn("font"),n=xn("text"),r=xn("font-weight"),i=xn("tracking"),c=xn("leading"),l=xn("breakpoint"),f=xn("container"),d=xn("spacing"),h=xn("radius"),b=xn("shadow"),g=xn("inset-shadow"),v=xn("text-shadow"),_=xn("drop-shadow"),w=xn("blur"),E=xn("perspective"),R=xn("aspect"),C=xn("ease"),I=xn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...T(),Le,Ne],j=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],P=()=>[Le,Ne,d],Q=()=>[zi,"full","auto",...P()],ne=()=>[Bi,"none","subgrid",Le,Ne],te=()=>["auto",{span:["full",Bi,Le,Ne]},Bi,Le,Ne],F=()=>[Bi,"auto",Le,Ne],oe=()=>["auto","min","max","fr",Le,Ne],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...P()],re=()=>[zi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],J=()=>[zi,"screen","full","dvw","lvw","svw","min","max","fit",...P()],be=()=>[zi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],ue=()=>[e,Le,Ne],z=()=>[...T(),pA,hA,{position:[Le,Ne]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",Tj,Ej,{size:[Le,Ne]}],we=()=>[Y0,af,qa],Ee=()=>["","none","full",h,Le,Ne],Se=()=>["",tt,af,qa],Ie=()=>["solid","dashed","dotted","double"],qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[tt,Y0,pA,hA],Je=()=>["","none",w,Le,Ne],wt=()=>["none",tt,Le,Ne],pe=()=>["none",tt,Le,Ne],xe=()=>[tt,Le,Ne],_e=()=>[zi,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Io],breakpoint:[Io],color:[AO],container:[Io],"drop-shadow":[Io],ease:["in","out","in-out"],font:[wj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Io],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Io],shadow:[Io],spacing:["px",tt],text:[Io],"text-shadow":[Io],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zi,Ne,Le,R]}],container:["container"],columns:[{columns:[tt,Ne,Le,f]}],"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"],sr:["sr-only","not-sr-only"],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:$()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[Bi,"auto",Le,Ne]}],basis:[{basis:[zi,"full","auto",f,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[tt,zi,"auto","initial","none",Ne]}],grow:[{grow:["",tt,Le,Ne]}],shrink:[{shrink:["",tt,Le,Ne]}],order:[{order:[Bi,"first","last","none",Le,Ne]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...be()]}],"min-block-size":[{"min-block":["auto",...be()]}],"max-block-size":[{"max-block":["none",...be()]}],w:[{w:[f,"screen",...re()]}],"min-w":[{"min-w":[f,"screen","none",...re()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,af,qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Oj,xj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Y0,Ne]}],"font-family":[{font:[Aj,Rj,t]}],"font-features":[{"font-features":[Ne]}],"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:[i,Le,Ne]}],"line-clamp":[{"line-clamp":[tt,"none",Le,dA]}],leading:[{leading:[c,...P()]}],"list-image":[{"list-image":["none",Le,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ue()}],"text-color":[{text:ue()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[tt,"from-font","auto",Le,qa]}],"text-decoration-color":[{decoration:ue()}],"underline-offset":[{"underline-offset":[tt,"auto",Le,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bi,Le,Ne],radial:["",Le,Ne],conic:[Bi,Le,Ne]},Ij,Cj]}],"bg-color":[{bg:ue()}],"gradient-from-pos":[{from:we()}],"gradient-via-pos":[{via:we()}],"gradient-to-pos":[{to:we()}],"gradient-from":[{from:ue()}],"gradient-via":[{via:ue()}],"gradient-to":[{to:ue()}],rounded:[{rounded:Ee()}],"rounded-s":[{"rounded-s":Ee()}],"rounded-e":[{"rounded-e":Ee()}],"rounded-t":[{"rounded-t":Ee()}],"rounded-r":[{"rounded-r":Ee()}],"rounded-b":[{"rounded-b":Ee()}],"rounded-l":[{"rounded-l":Ee()}],"rounded-ss":[{"rounded-ss":Ee()}],"rounded-se":[{"rounded-se":Ee()}],"rounded-ee":[{"rounded-ee":Ee()}],"rounded-es":[{"rounded-es":Ee()}],"rounded-tl":[{"rounded-tl":Ee()}],"rounded-tr":[{"rounded-tr":Ee()}],"rounded-br":[{"rounded-br":Ee()}],"rounded-bl":[{"rounded-bl":Ee()}],"border-w":[{border:Se()}],"border-w-x":[{"border-x":Se()}],"border-w-y":[{"border-y":Se()}],"border-w-s":[{"border-s":Se()}],"border-w-e":[{"border-e":Se()}],"border-w-bs":[{"border-bs":Se()}],"border-w-be":[{"border-be":Se()}],"border-w-t":[{"border-t":Se()}],"border-w-r":[{"border-r":Se()}],"border-w-b":[{"border-b":Se()}],"border-w-l":[{"border-l":Se()}],"divide-x":[{"divide-x":Se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ie(),"hidden","none"]}],"divide-style":[{divide:[...Ie(),"hidden","none"]}],"border-color":[{border:ue()}],"border-color-x":[{"border-x":ue()}],"border-color-y":[{"border-y":ue()}],"border-color-s":[{"border-s":ue()}],"border-color-e":[{"border-e":ue()}],"border-color-bs":[{"border-bs":ue()}],"border-color-be":[{"border-be":ue()}],"border-color-t":[{"border-t":ue()}],"border-color-r":[{"border-r":ue()}],"border-color-b":[{"border-b":ue()}],"border-color-l":[{"border-l":ue()}],"divide-color":[{divide:ue()}],"outline-style":[{outline:[...Ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[tt,Le,Ne]}],"outline-w":[{outline:["",tt,af,qa]}],"outline-color":[{outline:ue()}],shadow:[{shadow:["","none",b,Kh,Zh]}],"shadow-color":[{shadow:ue()}],"inset-shadow":[{"inset-shadow":["none",g,Kh,Zh]}],"inset-shadow-color":[{"inset-shadow":ue()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ue()}],"ring-offset-w":[{"ring-offset":[tt,qa]}],"ring-offset-color":[{"ring-offset":ue()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":ue()}],"text-shadow":[{"text-shadow":["none",v,Kh,Zh]}],"text-shadow-color":[{"text-shadow":ue()}],opacity:[{opacity:[tt,Le,Ne]}],"mix-blend":[{"mix-blend":[...qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[tt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":ue()}],"mask-image-linear-to-color":[{"mask-linear-to":ue()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":ue()}],"mask-image-t-to-color":[{"mask-t-to":ue()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":ue()}],"mask-image-r-to-color":[{"mask-r-to":ue()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":ue()}],"mask-image-b-to-color":[{"mask-b-to":ue()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":ue()}],"mask-image-l-to-color":[{"mask-l-to":ue()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":ue()}],"mask-image-x-to-color":[{"mask-x-to":ue()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":ue()}],"mask-image-y-to-color":[{"mask-y-to":ue()}],"mask-image-radial":[{"mask-radial":[Le,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":ue()}],"mask-image-radial-to-color":[{"mask-radial-to":ue()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[tt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":ue()}],"mask-image-conic-to-color":[{"mask-conic-to":ue()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ne]}],filter:[{filter:["","none",Le,Ne]}],blur:[{blur:Je()}],brightness:[{brightness:[tt,Le,Ne]}],contrast:[{contrast:[tt,Le,Ne]}],"drop-shadow":[{"drop-shadow":["","none",_,Kh,Zh]}],"drop-shadow-color":[{"drop-shadow":ue()}],grayscale:[{grayscale:["",tt,Le,Ne]}],"hue-rotate":[{"hue-rotate":[tt,Le,Ne]}],invert:[{invert:["",tt,Le,Ne]}],saturate:[{saturate:[tt,Le,Ne]}],sepia:[{sepia:["",tt,Le,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ne]}],"backdrop-blur":[{"backdrop-blur":Je()}],"backdrop-brightness":[{"backdrop-brightness":[tt,Le,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[tt,Le,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",tt,Le,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tt,Le,Ne]}],"backdrop-invert":[{"backdrop-invert":["",tt,Le,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[tt,Le,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[tt,Le,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",tt,Le,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[tt,"initial",Le,Ne]}],ease:[{ease:["linear","initial",C,Le,Ne]}],delay:[{delay:[tt,Le,Ne]}],animate:[{animate:["none",I,Le,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Le,Ne]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:wt()}],"rotate-x":[{"rotate-x":wt()}],"rotate-y":[{"rotate-y":wt()}],"rotate-z":[{"rotate-z":wt()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Le,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:ue()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ue()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Le,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Le,Ne]}],fill:[{fill:["none",...ue()]}],"stroke-w":[{stroke:[tt,af,qa,dA]}],stroke:[{stroke:["none",...ue()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kj=fj(Dj);function cn(...e){return kj(gO(e))}function ARe(e){return e?new Date(e).toLocaleString(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Unknown"}function TRe(e){if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(2)} ${t[n]}`}const Pj=/\/$/;function IRe(e){return e.replace(Pj,"")}function Nj(e){return e&&(e.endsWith("/")?e:`${e}/`)}function Lj(e,t){return e.startsWith(t)?e:`${t}${e}`}function ORe(e,t){return e.startsWith(t)?e.slice(t.length):e}const zj=yO("group/button inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-md border border-transparent bg-clip-padding font-medium text-xs/relaxed outline-none transition-all focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Il(e){const t=kt.c(12);let n,r,i,c;t[0]!==e?({className:n,variant:i,size:c,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c):(n=t[1],r=t[2],i=t[3],c=t[4]);const l=i===void 0?"default":i,f=c===void 0?"default":c;let d;t[5]!==n||t[6]!==f||t[7]!==l?(d=cn(zj({variant:l,size:f,className:n})),t[5]=n,t[6]=f,t[7]=l,t[8]=d):d=t[8];let h;return t[9]!==r||t[10]!==d?(h=N.jsx(q8,{className:d,"data-slot":"button",...r}),t[9]=r,t[10]=d,t[11]=h):h=t[11],h}let mA=0;function Bj(e,t="mui"){const[n,r]=M.useState(e),i=e||n;return M.useEffect(()=>{n==null&&(mA+=1,r(`${t}-${mA}`))},[n,t]),i}const gA=B8.useId;function Kf(e,t){if(gA!==void 0){const n=gA();return e??(t?`${t}-${n}`:n)}return Bj(e,t)}function nS(e){return Kf(e,"base-ui")}const $j=[];function sS(e){M.useEffect(e,$j)}const cf=0;class Jr{static create(){return new Jr}currentId=cf;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=cf,n()},t)}isStarted(){return this.currentId!==cf}clear=()=>{this.currentId!==cf&&(clearTimeout(this.currentId),this.currentId=cf)};disposeEffect=()=>this.clear}function Ol(){const e=Sr(Jr.create).current;return sS(e.disposeEffect),e}function Kt(e){return e?.ownerDocument||document}const Bl=typeof navigator<"u",X0=jj(),NO=Vj(),LO=Hj(),zO=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),BO=X0.platform==="MacIntel"&&X0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(X0.platform),$O=Bl&&/apple/i.test(navigator.vendor),iv=Bl&&/android/i.test(NO)||/android/i.test(LO),Uj=Bl&&NO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,UO=LO.includes("jsdom/");function jj(){if(!Bl)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Hj(){if(!Bl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Vj(){if(!Bl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const av="data-base-ui-focusable",jO="active",HO="selected",VO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",MRe="ArrowLeft",DRe="ArrowRight",kRe="ArrowUp",PRe="ArrowDown";function Do(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function yt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&sv(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function zp(e,t){if(!xt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(yt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Ss(e){return"composedPath"in e?e.composedPath()[0]:e.target}function kr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function qj(e){return e.matches("html,body")}function rS(e){return yn(e)&&e.matches(VO)}function yA(e){return e?e.getAttribute("role")==="combobox"&&rS(e):!1}function Fj(e){if(!e||UO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function cv(e){return e?e.hasAttribute(av)?e:e.querySelector(`[${av}]`)||e:null}function Ja(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...Ja(e,i.id,n)])}function bA(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(c=>c.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function Gj(e){e.preventDefault(),e.stopPropagation()}function Zj(e){return"nativeEvent"in e}function Kj(e){return e.pointerType===""&&e.isTrusted?!0:iv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Qj(e){return UO?!1:!iv&&e.width===0&&e.height===0||iv&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function kf(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Yj(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Xj=["top","right","bottom","left"],Ml=Math.min,js=Math.max,Bp=Math.round,Qh=Math.floor,Yr=e=>({x:e,y:e}),Wj={left:"right",right:"left",bottom:"top",top:"bottom"},Jj={start:"end",end:"start"};function lv(e,t,n){return js(e,Ml(t,n))}function Uo(e,t){return typeof e=="function"?e(t):e}function Es(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function oS(e){return e==="x"?"y":"x"}function iS(e){return e==="y"?"height":"width"}const e9=new Set(["top","bottom"]);function vr(e){return e9.has(Es(e))?"y":"x"}function aS(e){return oS(vr(e))}function t9(e,t,n){n===void 0&&(n=!1);const r=ia(e),i=aS(e),c=iS(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(l=$p(l)),[l,$p(l)]}function n9(e){const t=$p(e);return[uv(e),t,uv(t)]}function uv(e){return e.replace(/start|end/g,t=>Jj[t])}const vA=["left","right"],SA=["right","left"],s9=["top","bottom"],r9=["bottom","top"];function o9(e,t,n){switch(e){case"top":case"bottom":return n?t?SA:vA:t?vA:SA;case"left":case"right":return t?s9:r9;default:return[]}}function i9(e,t,n,r){const i=ia(e);let c=o9(Es(e),n==="start",r);return i&&(c=c.map(l=>l+"-"+i),t&&(c=c.concat(c.map(uv)))),c}function $p(e){return e.replace(/left|right|bottom|top/g,t=>Wj[t])}function a9(e){return{top:0,right:0,bottom:0,left:0,...e}}function qO(e){return typeof e!="number"?a9(e):{top:e,right:e,bottom:e,left:e}}function Up(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var c9=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],jp=c9.join(","),FO=typeof Element>"u",Dl=FO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hp=!FO&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Vp=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),c=i===""||i==="true",l=c||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Vp(t.parentNode));return l},l9=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},GO=function(t,n,r){if(Vp(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(jp));return n&&Dl.call(t,jp)&&i.unshift(t),i=i.filter(r),i},qp=function(t,n,r){for(var i=[],c=Array.from(t);c.length;){var l=c.shift();if(!Vp(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,h=qp(d,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:l,candidates:h})}else{var b=Dl.call(l,jp);b&&r.filter(l)&&(n||!t.includes(l))&&i.push(l);var g=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),v=!Vp(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(g&&v){var _=qp(g===!0?l.children:g.children,!0,r);r.flatten?i.push.apply(i,_):i.push({scopeParent:l,candidates:_})}else c.unshift.apply(c,l.children)}}return i},ZO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},KO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||l9(t))&&!ZO(t)?0:t.tabIndex},u9=function(t,n){var r=KO(t);return r<0&&n&&!ZO(t)?0:r},f9=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},QO=function(t){return t.tagName==="INPUT"},d9=function(t){return QO(t)&&t.type==="hidden"},h9=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},p9=function(t,n){for(var r=0;rsummary:first-of-type"),f=l?t.parentElement:t;if(Dl.call(f,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var d=t;t;){var h=t.parentElement,b=Hp(t);if(h&&!h.shadowRoot&&i(h)===!0)return _A(t);t.assignedSlot?t=t.assignedSlot:!h&&b!==t.ownerDocument?t=b.host:t=h}t=d}if(b9(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _A(t);return!1},S9=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},YO=function(t){var n=[],r=[];return t.forEach(function(i,c){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=u9(f,l),h=l?YO(i.candidates):f;d===0?l?n.push.apply(n,h):n.push(f):r.push({documentOrder:c,tabIndex:d,item:i,isScope:l,content:h})}),r.sort(f9).reduce(function(i,c){return c.isScope?i.push.apply(i,c.content):i.push(c.content),i},[]).concat(n)},xm=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qp([t],n.includeContainer,{filter:dv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_9}):r=GO(t,n.includeContainer,dv.bind(null,n)),YO(r)},w9=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qp([t],n.includeContainer,{filter:fv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=GO(t,n.includeContainer,fv.bind(null,n)),r},XO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Dl.call(t,jp)===!1?!1:dv(n,t)};const Qf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function WO(e,t){const n=xm(e,Qf()),r=n.length;if(r===0)return;const i=Do(Kt(e)),c=n.indexOf(i),l=c===-1?t===1?0:r-1:c+t;return n[l]}function JO(e){return WO(Kt(e).body,1)||e}function eM(e){return WO(Kt(e).body,-1)||e}function _f(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!yt(n,r)}function E9(e){xm(e,Qf()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wA(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Yh=null;class x9{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Xh=new x9;class Kr{static create(){return new Kr}static request(t){return Xh.request(t)}static cancel(t){return Xh.cancel(t)}currentId=Yh;request(t){this.cancel(),this.currentId=Xh.request(()=>{this.currentId=Yh,t()})}cancel=()=>{this.currentId!==Yh&&(Xh.cancel(this.currentId),this.currentId=Yh)};disposeEffect=()=>this.cancel}function tM(){const e=Sr(Kr.create).current;return sS(e.disposeEffect),e}function Mo(e){return e==null?e:"current"in e?e.current:e}let Pf=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const R9={[Pf.startingStyle]:""},C9={[Pf.endingStyle]:""},cS={transitionStatus(e){return e==="starting"?R9:e==="ending"?C9:null}};function A9(e,t=!1,n=!0){const r=tM();return Fe((i,c=null)=>{r.cancel();function l(){na.flushSync(i)}const f=Mo(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let h=function(){const g=Pf.startingStyle;if(!d.hasAttribute(g)){r.request(b);return}const v=new MutationObserver(()=>{d.hasAttribute(g)||(v.disconnect(),b())});v.observe(d,{attributes:!0,attributeFilter:[g]}),c?.addEventListener("abort",()=>v.disconnect(),{once:!0})},b=function(){Promise.all(d.getAnimations().map(g=>g.finished)).then(()=>{c?.aborted||l()}).catch(()=>{const g=d.getAnimations();if(n){if(c?.aborted)return;l()}else g.length>0&&g.some(v=>v.pending||v.playState!=="finished")&&b()})};if(t){h();return}r.request(b)}})}function lS(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,c=Fe(i),l=A9(r,n,!1);M.useEffect(()=>{if(!t)return;const f=new AbortController;return l(c,f.signal),()=>{f.abort()}},[t,n,c,l])}function T9(e,t=!1,n=!1){const[r,i]=M.useState(e&&t?"idle":void 0),[c,l]=M.useState(e);return e&&!c&&(l(!0),i("starting")),!e&&c&&r!=="ending"&&!n&&i("ending"),!e&&!c&&r==="ending"&&i(void 0),pt(()=>{if(!e&&c&&r!=="ending"&&n){const f=Kr.request(()=>{i("ending")});return()=>{Kr.cancel(f)}}},[e,c,r,n]),pt(()=>{if(!e||t)return;const f=Kr.request(()=>{i(void 0)});return()=>{Kr.cancel(f)}},[t,e]),pt(()=>{if(!e||!t)return;e&&c&&r!=="idle"&&i("starting");const f=Kr.request(()=>{i("idle")});return()=>{Kr.cancel(f)}},[t,e,c,i,r]),M.useMemo(()=>({mounted:c,setMounted:l,transitionStatus:r}),[c,r])}const uS="none",Fp="trigger-press",Lr="trigger-hover",bp="trigger-focus",nM="outside-press",NRe="item-press",I9="close-press",sM="focus-out",fS="escape-key",LRe="list-navigation",zRe="cancel-open",O9="disabled",rM="imperative-action",BRe="window-resize";function Jt(e,t,n,r){let i=!1,c=!1;const l=Hs;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){c=!0},get isCanceled(){return i},get isPropagationAllowed(){return c},trigger:n,...l}}const oM=M.createContext(void 0);function fc(e){const t=M.useContext(oM);if(e===!1&&t===void 0)throw new Error(Vo(27));return t}let Qa=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Pf.startingStyle]="startingStyle",e[e.endingStyle=Pf.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Gp=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const M9={[Gp.popupOpen]:""},D9={[Gp.popupOpen]:"",[Gp.pressed]:""},k9={[Qa.open]:""},P9={[Qa.closed]:""},N9={[Qa.anchorHidden]:""},L9={open(e){return e?M9:null}},$Re={open(e){return e?D9:null}},Yf={open(e){return e?k9:P9},anchorHidden(e){return e?N9:null}},z9={...Yf,...cS},B9=M.forwardRef(function(t,n){const{render:r,className:i,forceRender:c=!1,...l}=t,{store:f}=fc(),d=f.useState("open"),h=f.useState("nested"),b=f.useState("mounted"),g=f.useState("transitionStatus");return _r("div",t,{state:{open:d,transitionStatus:g},ref:[f.context.backdropRef,n],stateAttributesMapping:z9,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:c||!h})}),$9=M.forwardRef(function(t,n){const{render:r,className:i,disabled:c=!1,nativeButton:l=!0,...f}=t,{store:d}=fc(),h=d.useState("open");function b(w){h&&d.setOpen(!1,Jt(I9,w.nativeEvent))}const{getButtonProps:g,buttonRef:v}=SO({disabled:c,native:l});return _r("button",t,{state:{disabled:c},ref:[n,v],props:[{onClick:b},f,g]})}),U9=M.forwardRef(function(t,n){const{render:r,className:i,id:c,...l}=t,{store:f}=fc(),d=nS(c);return f.useSyncedValueWithCleanup("descriptionElementId",d),_r("p",t,{ref:n,props:[{id:d},l]})});function Qr(e){const t=Sr(j9,e).current;return t.next=e,pt(t.effect),t}function j9(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function H9(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const V9=M.createContext(null),q9=M.createContext(null),Rm=()=>M.useContext(V9)?.id||null,Xf=e=>{const t=M.useContext(q9);return e??t};function kl(e){return`data-base-ui-${e}`}function vp(e,t,n){if(n&&!kf(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}const iM=M.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Jr,currentIdRef:{current:null},currentContextRef:{current:null}});function F9(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=M.useRef(n),c=M.useRef(n),l=M.useRef(null),f=M.useRef(null),d=Ol();return N.jsx(iM.Provider,{value:M.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:c,currentIdRef:l,timeoutMs:r,currentContextRef:f,timeout:d}),[r,d]),children:t})}function G9(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:i}=t,c=M.useContext(iM),{currentIdRef:l,delayRef:f,timeoutMs:d,initialDelayRef:h,currentContextRef:b,hasProvider:g,timeout:v}=c,[_,w]=M.useState(!1);return pt(()=>{function E(){w(!1),b.current?.setIsInstantPhase(!1),l.current=null,b.current=null,f.current=h.current}if(l.current&&!i&&l.current===r){if(w(!1),d){const R=r;return v.start(d,()=>{n.select("open")||l.current&&l.current!==R||E()}),()=>{v.clear()}}E()}},[i,r,l,f,d,h,b,v,n]),pt(()=>{if(!i)return;const E=b.current,R=l.current;v.clear(),b.current={onOpenChange:n.setOpen,setIsInstantPhase:w},l.current=r,f.current={open:0,close:vp(h.current,"close")},R!==null&&R!==r?(w(!0),E?.setIsInstantPhase(!0),E?.onOpenChange(!1,Jt(uS))):(w(!1),E?.setIsInstantPhase(!1))},[i,r,n,l,f,d,h,b,v]),pt(()=>()=>{b.current=null},[b]),M.useMemo(()=>({hasProvider:g,delayRef:f,isInstantPhase:_}),[g,f,_])}const aM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},cM={...aM,position:"fixed",top:0,left:0},URe={...aM,position:"absolute"},Zp=M.forwardRef(function(t,n){const[r,i]=M.useState();pt(()=>{$O&&i("button")},[]);const c={tabIndex:0,role:r};return N.jsx("span",{...t,ref:n,style:cM,"aria-hidden":r?void 0:!0,...c,"data-base-ui-focus-guard":""})});let EA=0;function W0(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(EA);const c=()=>e?.focus({preventScroll:n});i?c():EA=requestAnimationFrame(c)}const Sl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function xA(e){return e==="inert"?Sl.inert:e==="aria-hidden"?Sl["aria-hidden"]:Sl.none}let Wh=new WeakSet,Jh={},J0=0;const lM=e=>e&&(e.host||lM(e.parentNode)),Z9=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=lM(n);return e.contains(r)?r:null}).filter(n=>n!=null);function K9(e,t,n,r){const i="data-base-ui-inert",c=r?"inert":n?"aria-hidden":null,l=Z9(t,e),f=new Set,d=new Set(l),h=[];Jh[i]||(Jh[i]=new WeakMap);const b=Jh[i];l.forEach(g),v(t),f.clear();function g(_){!_||f.has(_)||(f.add(_),_.parentNode&&g(_.parentNode))}function v(_){!_||d.has(_)||[].forEach.call(_.children,w=>{if(sa(w)!=="script")if(f.has(w))v(w);else{const E=c?w.getAttribute(c):null,R=E!==null&&E!=="false",C=xA(c),I=(C.get(w)||0)+1,k=(b.get(w)||0)+1;C.set(w,I),b.set(w,k),h.push(w),I===1&&R&&Wh.add(w),k===1&&w.setAttribute(i,""),!R&&c&&w.setAttribute(c,c==="inert"?"":"true")}})}return J0+=1,()=>{h.forEach(_=>{const w=xA(c),R=(w.get(_)||0)-1,C=(b.get(_)||0)-1;w.set(_,R),b.set(_,C),R||(!Wh.has(_)&&c&&_.removeAttribute(c),Wh.delete(_)),C||_.removeAttribute(i)}),J0-=1,J0||(Sl.inert=new WeakMap,Sl["aria-hidden"]=new WeakMap,Sl.none=new WeakMap,Wh=new WeakSet,Jh={})}}function Q9(e,t=!1,n=!1){const r=Kt(e[0]).body;return K9(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const uM=M.createContext(null),fM=()=>M.useContext(uM),Y9=kl("portal");function dM(e={}){const{ref:t,container:n,componentProps:r=Hs,elementProps:i}=e,c=Kf(),f=fM()?.portalNode,[d,h]=M.useState(null),[b,g]=M.useState(null),v=Fe(R=>{R!==null&&g(R)}),_=M.useRef(null);pt(()=>{if(n===null){_.current&&(_.current=null,g(null),h(null));return}if(c==null)return;const R=(n&&(Wv(n)?n:n.current))??f??document.body;if(R==null){_.current&&(_.current=null,g(null),h(null));return}_.current!==R&&(_.current=R,g(null),h(R))},[n,f,c]);const w=_r("div",r,{ref:[t,v],props:[{id:c,[Y9]:""},i]});return{portalNode:b,portalSubtree:d&&w?na.createPortal(w,d):null}}const X9=M.forwardRef(function(t,n){const{children:r,container:i,className:c,render:l,renderGuards:f,...d}=t,{portalNode:h,portalSubtree:b}=dM({container:i,ref:n,componentProps:t,elementProps:d}),g=M.useRef(null),v=M.useRef(null),_=M.useRef(null),w=M.useRef(null),[E,R]=M.useState(null),C=E?.modal,I=E?.open,k=typeof f=="boolean"?f:!!E&&!E.modal&&E.open&&!!h;M.useEffect(()=>{if(!h||C)return;function $(j){h&&j.relatedTarget&&_f(j)&&(j.type==="focusin"?wA:E9)(h)}return h.addEventListener("focusin",$,!0),h.addEventListener("focusout",$,!0),()=>{h.removeEventListener("focusin",$,!0),h.removeEventListener("focusout",$,!0)}},[h,C]),M.useEffect(()=>{!h||I||wA(h)},[I,h]);const T=M.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:v,beforeInsideRef:_,afterInsideRef:w,portalNode:h,setFocusManagerState:R}),[h]);return N.jsxs(M.Fragment,{children:[b,N.jsxs(uM.Provider,{value:T,children:[k&&h&&N.jsx(Zp,{"data-type":"outside",ref:g,onFocus:$=>{if(_f($,h))_.current?.focus();else{const j=E?E.domReference:null;eM(j)?.focus()}}}),k&&h&&N.jsx("span",{"aria-owns":h.id,style:V5}),h&&na.createPortal(r,h),k&&h&&N.jsx(Zp,{"data-type":"outside",ref:v,onFocus:$=>{if(_f($,h))w.current?.focus();else{const j=E?E.domReference:null;JO(j)?.focus(),E?.closeOnFocusOut&&E?.onOpenChange(!1,Jt(sM,$.nativeEvent))}}})]})]})});function W9(e,t){const n=Sn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const RA=20;let Zi=[];function dS(){Zi=Zi.filter(e=>e.deref()?.isConnected)}function J9(e){dS(),e&&sa(e)!=="body"&&(Zi.push(new WeakRef(e)),Zi.length>RA&&(Zi=Zi.slice(-RA)))}function eb(){return dS(),Zi[Zi.length-1]?.deref()}function eH(e){if(!e)return null;const t=Qf();return XO(e,t)?e:xm(e,t)[0]||e}function tH(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Gs(e).display!=="none"}function CA(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Qf(),i=w9(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return XO(l,n)||l.hasAttribute("data-tabindex")&&!f.startsWith("-")}),c=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?c!=="0"&&e.setAttribute("tabindex","0"):(c!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function nH(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:c=!0,restoreFocus:l=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:h="",nextFocusableElement:b,previousFocusableElement:g,beforeContentFocusGuardRef:v,externalTree:_}=e,w="rootStore"in t?t.rootStore:t,E=w.useState("open"),R=w.useState("domReferenceElement"),C=w.useState("floatingElement"),{events:I,dataRef:k}=w.context,T=Fe(()=>k.current.floatingContext?.nodeId),$=i===!1,j=yA(R)&&$,H=M.useRef(["content"]),P=Qr(i),Q=Qr(c),ne=Qr(h),te=Xf(_),F=fM(),oe=M.useRef(null),me=M.useRef(null),ge=M.useRef(!1),V=M.useRef(!1),re=M.useRef(!1),J=M.useRef(-1),be=M.useRef(""),ue=M.useRef(""),z=M.useRef(null),ee=M.useRef(null),ye=Np(z,v,F?.beforeInsideRef),we=Np(ee,F?.afterInsideRef),Ee=Ol(),Se=Ol(),Ie=tM(),qe=F!=null,ve=cv(C),Je=Fe((xe=ve)=>xe?xm(xe,Qf()):[]),wt=Fe(xe=>{const _e=Je(xe);return H.current.map(()=>_e).filter(Boolean).flat()});M.useEffect(()=>{if(r||!f)return;function xe(Ge){Ge.key==="Tab"&&yt(ve,Do(Kt(ve)))&&Je().length===0&&!j&&Gj(Ge)}const _e=Kt(ve);return _e.addEventListener("keydown",xe),()=>{_e.removeEventListener("keydown",xe)}},[r,R,ve,f,H,j,Je,wt]),M.useEffect(()=>{if(r||!E)return;const xe=Kt(ve);function _e(){re.current=!1}function Ge(He){const Me=Ss(He),ft=yt(C,Me)||yt(R,Me)||yt(F?.portalNode,Me);re.current=!ft,ue.current=He.pointerType||"keyboard",Me?.closest(`[${j5}]`)&&(V.current=!0)}function Oe(){ue.current="keyboard"}return xe.addEventListener("pointerdown",Ge,!0),xe.addEventListener("pointerup",_e,!0),xe.addEventListener("pointercancel",_e,!0),xe.addEventListener("keydown",Oe,!0),()=>{xe.removeEventListener("pointerdown",Ge,!0),xe.removeEventListener("pointerup",_e,!0),xe.removeEventListener("pointercancel",_e,!0),xe.removeEventListener("keydown",Oe,!0)}},[r,C,R,ve,E,F]),M.useEffect(()=>{if(r||!d)return;const xe=Kt(ve);function _e(){V.current=!0,Se.start(0,()=>{V.current=!1})}function Ge(mt){const Xe=Ss(mt),wn=Je().indexOf(Xe);wn!==-1&&(J.current=wn)}function Oe(mt){const Xe=mt.relatedTarget,Pt=mt.currentTarget,wn=Ss(mt);queueMicrotask(()=>{const It=T(),Xs=w.context.triggerElements,dt=Xe?.hasAttribute(kl("focus-guard"))&&[z.current,ee.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,Mo(g),Mo(b)].includes(Xe),$t=!(yt(R,Xe)||yt(C,Xe)||yt(Xe,C)||yt(F?.portalNode,Xe)||Xe!=null&&Xs.hasElement(Xe)||Xs.hasMatchingElement(gt=>yt(gt,Xe))||dt||te&&(Ja(te.nodesRef.current,It).find(gt=>yt(gt.context?.elements.floating,Xe)||yt(gt.context?.elements.domReference,Xe))||bA(te.nodesRef.current,It).find(gt=>[gt.context?.elements.floating,cv(gt.context?.elements.floating)].includes(Xe)||gt.context?.elements.domReference===Xe)));if(Pt===R&&ve&&CA(ve,H),l&&Pt!==R&&!tH(wn)&&Do(xe)===xe.body){if(yn(ve)&&(ve.focus(),l==="popup")){Ie.request(()=>{ve.focus()});return}const gt=J.current,Os=Je(),Ws=Os[gt]||Os[Os.length-1]||ve;yn(Ws)&&Ws.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(j||!f)&&Xe&&$t&&!V.current&&(j||Xe!==eb())&&(ge.current=!0,w.setOpen(!1,Jt(sM,mt)))})}function He(){re.current||(k.current.insideReactTree=!0,Ee.start(0,()=>{k.current.insideReactTree=!1}))}const Me=yn(R)?R:null,ft=[];if(!(!C&&!Me))return Me&&(Me.addEventListener("focusout",Oe),Me.addEventListener("pointerdown",_e),ft.push(()=>{Me.removeEventListener("focusout",Oe),Me.removeEventListener("pointerdown",_e)})),C&&(C.addEventListener("focusin",Ge),C.addEventListener("focusout",Oe),F&&(C.addEventListener("focusout",He,!0),ft.push(()=>{C.removeEventListener("focusout",He,!0)})),ft.push(()=>{C.removeEventListener("focusin",Ge),C.removeEventListener("focusout",Oe)})),()=>{ft.forEach(mt=>{mt()})}},[r,R,C,ve,f,te,F,w,d,l,Je,j,T,H,k,Ee,Se,Ie,b,g]),M.useEffect(()=>{if(r||!C||!E)return;const xe=Array.from(F?.portalNode?.querySelectorAll(`[${kl("portal")}]`)||[]),Ge=(te?bA(te.nodesRef.current,T()):[]).find(He=>yA(He.context?.elements.domReference||null))?.context?.elements.domReference,Oe=[C,Ge,...xe,oe.current,me.current,z.current,ee.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,Mo(g),Mo(b),j?R:null].filter(He=>He!=null);return Q9(Oe,f||j)},[E,r,R,C,f,H,F,j,te,T,b,g]),pt(()=>{if(!E||r||!yn(ve))return;const xe=Kt(ve),_e=Do(xe);queueMicrotask(()=>{const Ge=wt(ve),Oe=P.current,He=typeof Oe=="function"?Oe(ne.current||""):Oe;if(He===void 0||He===!1)return;let Me;He===!0||He===null?Me=Ge[0]||ve:Me=Mo(He),Me=Me||Ge[0]||ve,!yt(ve,_e)&&W0(Me,{preventScroll:Me===ve})})},[r,E,ve,$,wt,P,ne]),pt(()=>{if(r||!ve)return;const xe=Kt(ve),_e=Do(xe);J9(_e);function Ge(Me){if(Me.open||(be.current=W9(Me.nativeEvent,ue.current)),Me.reason===Lr&&Me.nativeEvent.type==="mouseleave"&&(ge.current=!0),Me.reason===nM)if(Me.nested)ge.current=!1;else if(Kj(Me.nativeEvent)||Qj(Me.nativeEvent))ge.current=!1;else{let ft=!1;document.createElement("div").focus({get preventScroll(){return ft=!0,!1}}),ft?ge.current=!1:ge.current=!0}}I.on("openchange",Ge);const Oe=xe.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,cM),qe&&R&&R.insertAdjacentElement("afterend",Oe);function He(){const Me=Q.current;let ft=typeof Me=="function"?Me(be.current):Me;if(ft===void 0||ft===!1)return null;if(ft===null&&(ft=!0),typeof ft=="boolean"){const Xe=R||eb();return Xe&&Xe.isConnected?Xe:Oe}const mt=R||eb()||Oe;return Mo(ft)||mt}return()=>{I.off("openchange",Ge);const Me=Do(xe),ft=yt(C,Me)||te&&Ja(te.nodesRef.current,T(),!1).some(Xe=>yt(Xe.context?.elements.floating,Me)),mt=He();queueMicrotask(()=>{const Xe=eH(mt),Pt=typeof Q.current!="boolean";Q.current&&!ge.current&&yn(Xe)&&(!(!Pt&&Xe!==Me&&Me!==xe.body)||ft)&&Xe.focus({preventScroll:!0}),Oe.remove(),ge.current=!1})}},[r,C,ve,Q,k,I,te,qe,R,T]),pt(()=>{if(!zO||E||!C)return;const xe=Do(Kt(C));!yn(xe)||!rS(xe)||yt(C,xe)&&xe.blur()},[E,C]),pt(()=>{if(!(r||!F))return F.setFocusManagerState({modal:f,closeOnFocusOut:d,open:E,onOpenChange:w.setOpen,domReference:R}),()=>{F.setFocusManagerState(null)}},[r,F,f,E,w,d,R]),pt(()=>{if(!(r||!ve))return CA(ve,H),()=>{queueMicrotask(dS)}},[r,ve,H]);const pe=!r&&(f?!j:!0)&&(qe||f);return N.jsxs(M.Fragment,{children:[pe&&N.jsx(Zp,{"data-type":"inside",ref:ye,onFocus:xe=>{if(f){const _e=wt();W0(_e[_e.length-1])}else F?.portalNode&&(ge.current=!1,_f(xe,F.portalNode)?JO(R)?.focus():Mo(g??F.beforeOutsideRef)?.focus())}}),n,pe&&N.jsx(Zp,{"data-type":"inside",ref:we,onFocus:xe=>{f?W0(wt()[0]):F?.portalNode&&(d&&(ge.current=!0),_f(xe,F.portalNode)?eM(R)?.focus():Mo(b??F.afterOutsideRef)?.focus())}})]})}function sH(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){const c=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",f=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let h=c.width,b=c.height,g=c.x,v=c.y;return n==null&&t.x&&l&&(n=c.x-t.x),r==null&&t.y&&f&&(r=c.y-t.y),g-=n||0,v-=r||0,h=0,b=0,!i||d?(h=t.axis==="y"?c.width:0,b=t.axis==="x"?c.height:0,g=l&&t.x!=null?t.x:g,v=f&&t.y!=null?t.y:v):i&&!d&&(b=t.axis==="x"?c.height:b,h=t.axis==="y"?c.width:h),i=!0,{width:h,height:b,x:g,y:v,top:v,right:g+h,bottom:v+b,left:g}}}}function AA(e){return e!=null&&e.clientX!=null}function rH(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),c=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:f=!0,axis:d="both"}=t,h=M.useRef(!1),b=M.useRef(null),[g,v]=M.useState(),[_,w]=M.useState([]),E=Fe((T,$,j)=>{h.current||l.current.openEvent&&!AA(l.current.openEvent)||n.set("positionReference",sH(j??c,{x:T,y:$,axis:d,dataRef:l,pointerType:g}))}),R=Fe(T=>{r?b.current||w([]):E(T.clientX,T.clientY,T.currentTarget)}),C=kf(g)?i:r,I=M.useCallback(()=>{if(!C||!f)return;const T=Sn(i);function $(j){const H=Ss(j);yt(i,H)?(T.removeEventListener("mousemove",$),b.current=null):E(j.clientX,j.clientY)}if(!l.current.openEvent||AA(l.current.openEvent)){T.addEventListener("mousemove",$);const j=()=>{T.removeEventListener("mousemove",$),b.current=null};return b.current=j,j}n.set("positionReference",c)},[C,f,i,l,c,n,E]);M.useEffect(()=>I(),[I,_]),M.useEffect(()=>{f&&!i&&(h.current=!1)},[f,i]),M.useEffect(()=>{!f&&r&&(h.current=!0)},[f,r]);const k=M.useMemo(()=>{function T($){v($.pointerType)}return{onPointerDown:T,onPointerEnter:T,onMouseMove:R,onMouseEnter:R}},[R]);return M.useMemo(()=>f?{reference:k,trigger:k}:{},[f,k])}function TA(e,t,n){let{reference:r,floating:i}=e;const c=vr(t),l=aS(t),f=iS(l),d=Es(t),h=c==="y",b=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,v=r[f]/2-i[f]/2;let _;switch(d){case"top":_={x:b,y:r.y-i.height};break;case"bottom":_={x:b,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:g};break;case"left":_={x:r.x-i.width,y:g};break;default:_={x:r.x,y:r.y}}switch(ia(t)){case"start":_[l]-=v*(n&&h?-1:1);break;case"end":_[l]+=v*(n&&h?-1:1);break}return _}async function oH(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:c,rects:l,elements:f,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:b="viewport",elementContext:g="floating",altBoundary:v=!1,padding:_=0}=Uo(t,e),w=qO(_),R=f[v?g==="floating"?"reference":"floating":g],C=Up(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(R)))==null||n?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:h,rootBoundary:b,strategy:d})),I=g==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),T=await(c.isElement==null?void 0:c.isElement(k))?await(c.getScale==null?void 0:c.getScale(k))||{x:1,y:1}:{x:1,y:1},$=Up(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:I,offsetParent:k,strategy:d}):I);return{top:(C.top-$.top+w.top)/T.y,bottom:($.bottom-C.bottom+w.bottom)/T.y,left:(C.left-$.left+w.left)/T.x,right:($.right-C.right+w.right)/T.x}}const iH=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:l}=n,f=c.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:b,y:g}=TA(h,r,d),v=r,_={},w=0;for(let R=0;Rme<=0)){var te,F;const me=(((te=c.flip)==null?void 0:te.index)||0)+1,ge=H[me];if(ge&&(!(g==="alignment"?I!==vr(ge):!1)||ne.every(J=>vr(J.placement)===I?J.overflows[0]>0:!0)))return{data:{index:me,overflows:ne},reset:{placement:ge}};let V=(F=ne.filter(re=>re.overflows[0]<=0).sort((re,J)=>re.overflows[1]-J.overflows[1])[0])==null?void 0:F.placement;if(!V)switch(_){case"bestFit":{var oe;const re=(oe=ne.filter(J=>{if(j){const be=vr(J.placement);return be===I||be==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(be=>be>0).reduce((be,ue)=>be+ue,0)]).sort((J,be)=>J[1]-be[1])[0])==null?void 0:oe[0];re&&(V=re);break}case"initialPlacement":V=f;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function IA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function OA(e){return Xj.some(t=>e[t]>=0)}const cH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...c}=Uo(e,t);switch(i){case"referenceHidden":{const l=await r.detectOverflow(t,{...c,elementContext:"reference"}),f=IA(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:OA(f)}}}case"escaped":{const l=await r.detectOverflow(t,{...c,altBoundary:!0}),f=IA(l,n.floating);return{data:{escapedOffsets:f,escaped:OA(f)}}}default:return{}}}}},hM=new Set(["left","top"]);async function lH(e,t){const{placement:n,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Es(n),f=ia(n),d=vr(n)==="y",h=hM.has(l)?-1:1,b=c&&d?-1:1,g=Uo(t,e);let{mainAxis:v,crossAxis:_,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof w=="number"&&(_=f==="end"?w*-1:w),d?{x:_*b,y:v*h}:{x:v*h,y:_*b}}const uH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:c,placement:l,middlewareData:f}=t,d=await lH(t,e);return l===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:c+d.y,data:{...d,placement:l}}}}},fH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:c}=t,{mainAxis:l=!0,crossAxis:f=!1,limiter:d={fn:C=>{let{x:I,y:k}=C;return{x:I,y:k}}},...h}=Uo(e,t),b={x:n,y:r},g=await c.detectOverflow(t,h),v=vr(Es(i)),_=oS(v);let w=b[_],E=b[v];if(l){const C=_==="y"?"top":"left",I=_==="y"?"bottom":"right",k=w+g[C],T=w-g[I];w=lv(k,w,T)}if(f){const C=v==="y"?"top":"left",I=v==="y"?"bottom":"right",k=E+g[C],T=E-g[I];E=lv(k,E,T)}const R=d.fn({...t,[_]:w,[v]:E});return{...R,data:{x:R.x-n,y:R.y-r,enabled:{[_]:l,[v]:f}}}}}},dH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:h=!0}=Uo(e,t),b={x:n,y:r},g=vr(i),v=oS(g);let _=b[v],w=b[g];const E=Uo(f,t),R=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(d){const k=v==="y"?"height":"width",T=c.reference[v]-c.floating[k]+R.mainAxis,$=c.reference[v]+c.reference[k]-R.mainAxis;_$&&(_=$)}if(h){var C,I;const k=v==="y"?"width":"height",T=hM.has(Es(i)),$=c.reference[g]-c.floating[k]+(T&&((C=l.offset)==null?void 0:C[g])||0)+(T?0:R.crossAxis),j=c.reference[g]+c.reference[k]+(T?0:((I=l.offset)==null?void 0:I[g])||0)-(T?R.crossAxis:0);w<$?w=$:w>j&&(w=j)}return{[v]:_,[g]:w}}}},hH=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:c,platform:l,elements:f}=t,{apply:d=()=>{},...h}=Uo(e,t),b=await l.detectOverflow(t,h),g=Es(i),v=ia(i),_=vr(i)==="y",{width:w,height:E}=c.floating;let R,C;g==="top"||g==="bottom"?(R=g,C=v===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=g,R=v==="end"?"top":"bottom");const I=E-b.top-b.bottom,k=w-b.left-b.right,T=Ml(E-b[R],I),$=Ml(w-b[C],k),j=!t.middlewareData.shift;let H=T,P=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(H=I),j&&!v){const ne=js(b.left,0),te=js(b.right,0),F=js(b.top,0),oe=js(b.bottom,0);_?P=w-2*(ne!==0||te!==0?ne+te:js(b.left,b.right)):H=E-2*(F!==0||oe!==0?F+oe:js(b.top,b.bottom))}await d({...t,availableWidth:P,availableHeight:H});const Q=await l.getDimensions(f.floating);return w!==Q.width||E!==Q.height?{reset:{rects:!0}}:{}}}};function pM(e){const t=Gs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=yn(e),c=i?e.offsetWidth:n,l=i?e.offsetHeight:r,f=Bp(n)!==c||Bp(r)!==l;return f&&(n=c,r=l),{width:n,height:r,$:f}}function hS(e){return xt(e)?e:e.contextElement}function _l(e){const t=hS(e);if(!yn(t))return Yr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:c}=pM(t);let l=(c?Bp(n.width):n.width)/r,f=(c?Bp(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const pH=Yr(0);function mM(e){const t=Sn(e);return!wm()||!t.visualViewport?pH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mH(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sn(e)?!1:t}function rc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),c=hS(e);let l=Yr(1);t&&(r?xt(r)&&(l=_l(r)):l=_l(e));const f=mH(c,n,r)?mM(c):Yr(0);let d=(i.left+f.x)/l.x,h=(i.top+f.y)/l.y,b=i.width/l.x,g=i.height/l.y;if(c){const v=Sn(c),_=r&&xt(r)?Sn(r):r;let w=v,E=rv(w);for(;E&&r&&_!==w;){const R=_l(E),C=E.getBoundingClientRect(),I=Gs(E),k=C.left+(E.clientLeft+parseFloat(I.paddingLeft))*R.x,T=C.top+(E.clientTop+parseFloat(I.paddingTop))*R.y;d*=R.x,h*=R.y,b*=R.x,g*=R.y,d+=k,h+=T,w=Sn(E),E=rv(w)}}return Up({width:b,height:g,x:d,y:h})}function Cm(e,t){const n=Em(e).scrollLeft;return t?t.left+n:rc(eo(e)).left+n}function gM(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Cm(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function gH(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const c=i==="fixed",l=eo(r),f=t?_m(t.floating):!1;if(r===l||f&&c)return n;let d={scrollLeft:0,scrollTop:0},h=Yr(1);const b=Yr(0),g=yn(r);if((g||!g&&!c)&&((sa(r)!=="body"||ra(l))&&(d=Em(r)),yn(r))){const _=rc(r);h=_l(r),b.x=_.x+r.clientLeft,b.y=_.y+r.clientTop}const v=l&&!g&&!c?gM(l,d):Yr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+b.x+v.x,y:n.y*h.y-d.scrollTop*h.y+b.y+v.y}}function yH(e){return Array.from(e.getClientRects())}function bH(e){const t=eo(e),n=Em(e),r=e.ownerDocument.body,i=js(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),c=js(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Cm(e);const f=-n.scrollTop;return Gs(r).direction==="rtl"&&(l+=js(t.clientWidth,r.clientWidth)-i),{width:i,height:c,x:l,y:f}}const MA=25;function vH(e,t){const n=Sn(e),r=eo(e),i=n.visualViewport;let c=r.clientWidth,l=r.clientHeight,f=0,d=0;if(i){c=i.width,l=i.height;const b=wm();(!b||b&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const h=Cm(r);if(h<=0){const b=r.ownerDocument,g=b.body,v=getComputedStyle(g),_=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-_);w<=MA&&(c-=w)}else h<=MA&&(c+=h);return{width:c,height:l,x:f,y:d}}const SH=new Set(["absolute","fixed"]);function _H(e,t){const n=rc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,c=yn(e)?_l(e):Yr(1),l=e.clientWidth*c.x,f=e.clientHeight*c.y,d=i*c.x,h=r*c.y;return{width:l,height:f,x:d,y:h}}function DA(e,t,n){let r;if(t==="viewport")r=vH(e,n);else if(t==="document")r=bH(eo(e));else if(xt(t))r=_H(t,n);else{const i=mM(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Up(r)}function yM(e,t){const n=$o(e);return n===t||!xt(n)||zo(n)?!1:Gs(n).position==="fixed"||yM(n,t)}function wH(e,t){const n=t.get(e);if(n)return n;let r=Wi(e,[],!1).filter(f=>xt(f)&&sa(f)!=="body"),i=null;const c=Gs(e).position==="fixed";let l=c?$o(e):e;for(;xt(l)&&!zo(l);){const f=Gs(l),d=Jv(l);!d&&f.position==="fixed"&&(i=null),(c?!d&&!i:!d&&f.position==="static"&&!!i&&SH.has(i.position)||ra(l)&&!d&&yM(e,l))?r=r.filter(b=>b!==l):i=f,l=$o(l)}return t.set(e,r),r}function EH(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?_m(t)?[]:wH(t,this._c):[].concat(n),r],f=l[0],d=l.reduce((h,b)=>{const g=DA(t,b,i);return h.top=js(g.top,h.top),h.right=Ml(g.right,h.right),h.bottom=Ml(g.bottom,h.bottom),h.left=js(g.left,h.left),h},DA(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function xH(e){const{width:t,height:n}=pM(e);return{width:t,height:n}}function RH(e,t,n){const r=yn(t),i=eo(t),c=n==="fixed",l=rc(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const d=Yr(0);function h(){d.x=Cm(i)}if(r||!r&&!c)if((sa(t)!=="body"||ra(i))&&(f=Em(t)),r){const _=rc(t,!0,c,t);d.x=_.x+t.clientLeft,d.y=_.y+t.clientTop}else i&&h();c&&!r&&i&&h();const b=i&&!r&&!c?gM(i,f):Yr(0),g=l.left+f.scrollLeft-d.x-b.x,v=l.top+f.scrollTop-d.y-b.y;return{x:g,y:v,width:l.width,height:l.height}}function tb(e){return Gs(e).position==="static"}function kA(e,t){if(!yn(e)||Gs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return eo(e)===n&&(n=n.ownerDocument.body),n}function bM(e,t){const n=Sn(e);if(_m(e))return n;if(!yn(e)){let i=$o(e);for(;i&&!zo(i);){if(xt(i)&&!tb(i))return i;i=$o(i)}return n}let r=kA(e,t);for(;r&&T8(r)&&tb(r);)r=kA(r,t);return r&&zo(r)&&tb(r)&&!Jv(r)?n:r||k8(e)||n}const CH=async function(e){const t=this.getOffsetParent||bM,n=this.getDimensions,r=await n(e.floating);return{reference:RH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function AH(e){return Gs(e).direction==="rtl"}const TH={convertOffsetParentRelativeRectToViewportRelativeRect:gH,getDocumentElement:eo,getClippingRect:EH,getOffsetParent:bM,getElementRects:CH,getClientRects:yH,getDimensions:xH,getScale:_l,isElement:xt,isRTL:AH};function vM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IH(e,t){let n=null,r;const i=eo(e);function c(){var f;clearTimeout(r),(f=n)==null||f.disconnect(),n=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),c();const h=e.getBoundingClientRect(),{left:b,top:g,width:v,height:_}=h;if(f||t(),!v||!_)return;const w=Qh(g),E=Qh(i.clientWidth-(b+v)),R=Qh(i.clientHeight-(g+_)),C=Qh(b),k={rootMargin:-w+"px "+-E+"px "+-R+"px "+-C+"px",threshold:js(0,Ml(1,d))||1};let T=!0;function $(j){const H=j[0].intersectionRatio;if(H!==d){if(!T)return l();H?l(!1,H):r=setTimeout(()=>{l(!1,1e-7)},1e3)}H===1&&!vM(h,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver($,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver($,k)}n.observe(e)}return l(!0),c}function PA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=hS(e),b=i||c?[...h?Wi(h):[],...Wi(t)]:[];b.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),c&&C.addEventListener("resize",n)});const g=h&&f?IH(h,n):null;let v=-1,_=null;l&&(_=new ResizeObserver(C=>{let[I]=C;I&&I.target===h&&_&&(_.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var k;(k=_)==null||k.observe(t)})),n()}),h&&!d&&_.observe(h),_.observe(t));let w,E=d?rc(e):null;d&&R();function R(){const C=rc(e);E&&!vM(E,C)&&n(),E=C,w=requestAnimationFrame(R)}return n(),()=>{var C;b.forEach(I=>{i&&I.removeEventListener("scroll",n),c&&I.removeEventListener("resize",n)}),g?.(),(C=_)==null||C.disconnect(),_=null,d&&cancelAnimationFrame(w)}}const OH=uH,MH=fH,DH=aH,kH=hH,PH=cH,NH=dH,LH=(e,t,n)=>{const r=new Map,i={platform:TH,...n},c={...i.platform,_c:r};return iH(e,t,{...i,platform:c})};var zH=typeof document<"u",BH=function(){},Sp=zH?M.useLayoutEffect:BH;function Kp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const c=i[r];if(!(c==="_owner"&&e.$$typeof)&&!Kp(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function SM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function NA(e,t){const n=SM(e);return Math.round(t*n)/n}function nb(e){const t=M.useRef(e);return Sp(()=>{t.current=e}),t}function $H(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:c,floating:l}={},transform:f=!0,whileElementsMounted:d,open:h}=e,[b,g]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,_]=M.useState(r);Kp(v,r)||_(r);const[w,E]=M.useState(null),[R,C]=M.useState(null),I=M.useCallback(J=>{J!==j.current&&(j.current=J,E(J))},[]),k=M.useCallback(J=>{J!==H.current&&(H.current=J,C(J))},[]),T=c||w,$=l||R,j=M.useRef(null),H=M.useRef(null),P=M.useRef(b),Q=d!=null,ne=nb(d),te=nb(i),F=nb(h),oe=M.useCallback(()=>{if(!j.current||!H.current)return;const J={placement:t,strategy:n,middleware:v};te.current&&(J.platform=te.current),LH(j.current,H.current,J).then(be=>{const ue={...be,isPositioned:F.current!==!1};me.current&&!Kp(P.current,ue)&&(P.current=ue,na.flushSync(()=>{g(ue)}))})},[v,t,n,te,F]);Sp(()=>{h===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(J=>({...J,isPositioned:!1})))},[h]);const me=M.useRef(!1);Sp(()=>(me.current=!0,()=>{me.current=!1}),[]),Sp(()=>{if(T&&(j.current=T),$&&(H.current=$),T&&$){if(ne.current)return ne.current(T,$,oe);oe()}},[T,$,oe,ne,Q]);const ge=M.useMemo(()=>({reference:j,floating:H,setReference:I,setFloating:k}),[I,k]),V=M.useMemo(()=>({reference:T,floating:$}),[T,$]),re=M.useMemo(()=>{const J={position:n,left:0,top:0};if(!V.floating)return J;const be=NA(V.floating,b.x),ue=NA(V.floating,b.y);return f?{...J,transform:"translate("+be+"px, "+ue+"px)",...SM(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:be,top:ue}},[n,f,V.floating,b.x,b.y]);return M.useMemo(()=>({...b,update:oe,refs:ge,elements:V,floatingStyles:re}),[b,oe,ge,V,re])}const UH=(e,t)=>({...OH(e),options:[e,t]}),jH=(e,t)=>({...MH(e),options:[e,t]}),HH=(e,t)=>({...NH(e),options:[e,t]}),VH=(e,t)=>({...DH(e),options:[e,t]}),qH=(e,t)=>({...kH(e),options:[e,t]}),FH=(e,t)=>({...PH(e),options:[e,t]}),GH={intentional:"onClick",sloppy:"onPointerDown"};function ZH(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function _M(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),c=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:f,dataRef:d}=n.context,{enabled:h=!0,escapeKey:b=!0,outsidePress:g=!0,outsidePressEvent:v="sloppy",referencePress:_=!1,referencePressEvent:w="sloppy",ancestorScroll:E=!1,bubbles:R,externalTree:C}=t,I=Xf(C),k=Fe(typeof g=="function"?g:()=>!1),T=typeof g=="function"?k:g,$=M.useRef(!1),{escapeKey:j,outsidePress:H}=ZH(R),P=M.useRef(null),Q=Ol(),ne=Ol(),te=Fe(()=>{ne.clear(),d.current.insideReactTree=!1}),F=M.useRef(!1),oe=M.useRef(""),me=Fe(pe=>{oe.current=pe.pointerType}),ge=Fe(()=>{const pe=oe.current,xe=pe==="pen"||!pe?"mouse":pe,_e=typeof v=="function"?v():v;return typeof _e=="string"?_e:_e[xe]}),V=Fe(pe=>{if(!r||!h||!b||pe.key!=="Escape"||F.current)return;const xe=d.current.floatingContext?.nodeId,_e=I?Ja(I.nodesRef.current,xe):[];if(!j&&_e.length>0){let He=!0;if(_e.forEach(Me=>{Me.context?.open&&!Me.context.dataRef.current.__escapeKeyBubbles&&(He=!1)}),!He)return}const Ge=Zj(pe)?pe.nativeEvent:pe,Oe=Jt(fS,Ge);n.setOpen(!1,Oe),!j&&!Oe.isPropagationAllowed&&pe.stopPropagation()}),re=Fe(pe=>{const xe=ge();return xe==="intentional"&&pe.type!=="click"||xe==="sloppy"&&pe.type==="click"}),J=Fe(()=>{d.current.insideReactTree=!0,ne.start(0,te)}),be=Fe((pe,xe=!1)=>{if(re(pe)){te();return}if(d.current.insideReactTree){te();return}if(ge()==="intentional"&&xe||typeof T=="function"&&!T(pe))return;const _e=Ss(pe),Ge=`[${kl("inert")}]`,Oe=Kt(n.select("floatingElement")).querySelectorAll(Ge),He=n.context.triggerElements;if(_e&&(He.hasElement(_e)||He.hasMatchingElement(Pt=>yt(Pt,_e))))return;let Me=xt(_e)?_e:null;for(;Me&&!zo(Me);){const Pt=$o(Me);if(zo(Pt)||!xt(Pt))break;Me=Pt}if(Oe.length&&xt(_e)&&!qj(_e)&&!yt(_e,n.select("floatingElement"))&&Array.from(Oe).every(Pt=>!yt(Me,Pt)))return;if(yn(_e)&&!("touches"in pe)){const Pt=zo(_e),wn=Gs(_e),It=/auto|scroll/,Xs=Pt||It.test(wn.overflowX),dt=Pt||It.test(wn.overflowY),$t=Xs&&_e.clientWidth>0&&_e.scrollWidth>_e.clientWidth,gt=dt&&_e.clientHeight>0&&_e.scrollHeight>_e.clientHeight,Os=wn.direction==="rtl",Ws=gt&&(Os?pe.offsetX<=_e.offsetWidth-_e.clientWidth:pe.offsetX>_e.clientWidth),ao=$t&&pe.offsetY>_e.clientHeight;if(Ws||ao)return}const ft=d.current.floatingContext?.nodeId,mt=I&&Ja(I.nodesRef.current,ft).some(Pt=>kr(pe,Pt.context?.elements.floating));if(kr(pe,n.select("floatingElement"))||kr(pe,n.select("domReferenceElement"))||mt)return;const Xe=I?Ja(I.nodesRef.current,ft):[];if(Xe.length>0){let Pt=!0;if(Xe.forEach(wn=>{wn.context?.open&&!wn.context.dataRef.current.__outsidePressBubbles&&(Pt=!1)}),!Pt)return}n.setOpen(!1,Jt(nM,pe)),te()}),ue=Fe(pe=>{ge()!=="sloppy"||pe.pointerType==="touch"||!n.select("open")||!h||kr(pe,n.select("floatingElement"))||kr(pe,n.select("domReferenceElement"))||be(pe)}),z=Fe(pe=>{if(ge()!=="sloppy"||!n.select("open")||!h||kr(pe,n.select("floatingElement"))||kr(pe,n.select("domReferenceElement")))return;const xe=pe.touches[0];xe&&(P.current={startTime:Date.now(),startX:xe.clientX,startY:xe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},Q.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}),ee=Fe(pe=>{const xe=Ss(pe);function _e(){z(pe),xe?.removeEventListener(pe.type,_e)}xe?.addEventListener(pe.type,_e)}),ye=Fe(pe=>{const xe=$.current;if($.current=!1,Q.clear(),pe.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)return;const _e=Ss(pe);function Ge(){pe.type==="pointerdown"?ue(pe):be(pe,xe),_e?.removeEventListener(pe.type,Ge)}_e?.addEventListener(pe.type,Ge)}),we=Fe(pe=>{if(ge()!=="sloppy"||!P.current||kr(pe,n.select("floatingElement"))||kr(pe,n.select("domReferenceElement")))return;const xe=pe.touches[0];if(!xe)return;const _e=Math.abs(xe.clientX-P.current.startX),Ge=Math.abs(xe.clientY-P.current.startY),Oe=Math.sqrt(_e*_e+Ge*Ge);Oe>5&&(P.current.dismissOnTouchEnd=!0),Oe>10&&(be(pe),Q.clear(),P.current=null)}),Ee=Fe(pe=>{const xe=Ss(pe);function _e(){we(pe),xe?.removeEventListener(pe.type,_e)}xe?.addEventListener(pe.type,_e)}),Se=Fe(pe=>{ge()!=="sloppy"||!P.current||kr(pe,n.select("floatingElement"))||kr(pe,n.select("domReferenceElement"))||(P.current.dismissOnTouchEnd&&be(pe),Q.clear(),P.current=null)}),Ie=Fe(pe=>{const xe=Ss(pe);function _e(){Se(pe),xe?.removeEventListener(pe.type,_e)}xe?.addEventListener(pe.type,_e)});M.useEffect(()=>{if(!r||!h)return;d.current.__escapeKeyBubbles=j,d.current.__outsidePressBubbles=H;const pe=new Jr;function xe(Me){n.setOpen(!1,Jt(uS,Me))}function _e(){pe.clear(),F.current=!0}function Ge(){pe.start(wm()?5:0,()=>{F.current=!1})}const Oe=Kt(i);Oe.addEventListener("pointerdown",me,!0),b&&(Oe.addEventListener("keydown",V),Oe.addEventListener("compositionstart",_e),Oe.addEventListener("compositionend",Ge)),T&&(Oe.addEventListener("click",ye,!0),Oe.addEventListener("pointerdown",ye,!0),Oe.addEventListener("touchstart",ee,!0),Oe.addEventListener("touchmove",Ee,!0),Oe.addEventListener("touchend",Ie,!0),Oe.addEventListener("mousedown",ye,!0));let He=[];return E&&(xt(l)&&(He=Wi(l)),xt(i)&&(He=He.concat(Wi(i))),!xt(c)&&c&&c.contextElement&&(He=He.concat(Wi(c.contextElement)))),He=He.filter(Me=>Me!==Oe.defaultView?.visualViewport),He.forEach(Me=>{Me.addEventListener("scroll",xe,{passive:!0})}),()=>{Oe.removeEventListener("pointerdown",me,!0),b&&(Oe.removeEventListener("keydown",V),Oe.removeEventListener("compositionstart",_e),Oe.removeEventListener("compositionend",Ge)),T&&(Oe.removeEventListener("click",ye,!0),Oe.removeEventListener("pointerdown",ye,!0),Oe.removeEventListener("touchstart",ee,!0),Oe.removeEventListener("touchmove",Ee,!0),Oe.removeEventListener("touchend",Ie,!0),Oe.removeEventListener("mousedown",ye,!0)),He.forEach(Me=>{Me.removeEventListener("scroll",xe)}),pe.clear(),$.current=!1}},[d,i,c,l,b,T,r,f,E,h,j,H,V,be,ye,ue,ee,Ee,Ie,me,n]),M.useEffect(te,[T,te]);const qe=M.useMemo(()=>({onKeyDown:V,..._&&{[GH[w]]:pe=>{n.setOpen(!1,Jt(Fp,pe.nativeEvent))},...w!=="intentional"&&{onClick(pe){n.setOpen(!1,Jt(Fp,pe.nativeEvent))}}}}),[V,n,_,w]),ve=Fe(pe=>{const xe=Ss(pe.nativeEvent);!yt(n.select("floatingElement"),xe)||pe.button!==0||($.current=!0)}),Je=Fe(pe=>{!r||!h||pe.button!==0||($.current=!0)}),wt=M.useMemo(()=>({onKeyDown:V,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:J,onMouseDownCapture(pe){J(),Je(pe)},onPointerDownCapture(pe){J(),Je(pe)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[V,ve,J,Je]);return M.useMemo(()=>h?{reference:qe,floating:wt,trigger:qe}:{},[h,qe,wt])}var Qp=Symbol("NOT_FOUND");function KH(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function QH(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function YH(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var LA=e=>Array.isArray(e)?e:[e];function XH(e){const t=Array.isArray(e[0])?e[0]:e;return YH(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WH(e,t){const n=[],{length:r}=e;for(let i=0;it(f,h.key));if(d>-1){const h=n[d];return d>0&&(n.splice(d,1),n.unshift(h)),h.value}return Qp}function i(f,d){r(f)===Qp&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function c(){return n}function l(){n=[]}return{get:r,put:i,getEntries:c,clear:l}}var tV=(e,t)=>e===t;function nV(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let c=0;cc(_.value,b));v&&(b=v.value,f!==0&&f--)}d.put(arguments,b)}return b}return h.clearCache=()=>{d.clear(),h.resetResultsCount()},h.resultsCount=()=>f,h.resetResultsCount=()=>{f=0},h}var rV=class{constructor(e){this.value=e}deref(){return this.value}},oV=typeof WeakRef<"u"?WeakRef:rV,iV=0,zA=1;function ep(){return{s:iV,v:void 0,o:null,p:null}}function wM(e,t={}){let n=ep();const{resultEqualityCheck:r}=t;let i,c=0;function l(){let f=n;const{length:d}=arguments;for(let g=0,v=d;g{n=ep(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}function EM(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let c=0,l=0,f,d={},h=i.pop();typeof h=="object"&&(d=h,h=i.pop()),KH(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const b={...n,...d},{memoize:g,memoizeOptions:v=[],argsMemoize:_=wM,argsMemoizeOptions:w=[]}=b,E=LA(v),R=LA(w),C=XH(i),I=g(function(){return c++,h.apply(null,arguments)},...E),k=_(function(){l++;const $=WH(C,arguments);return f=I.apply(null,$),f},...R);return Object.assign(k,{resultFunc:h,memoizedResultFunc:I,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>c,resetRecomputations:()=>{c=0},memoize:g,argsMemoize:_})};return Object.assign(r,{withTypes:()=>r}),r}var aV=EM(wM),cV=Object.assign((e,t=aV)=>{QH(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(c=>e[c]);return t(r,(...c)=>c.reduce((l,f,d)=>(l[n[d]]=f,l),{}))},{withTypes:()=>cV});EM({memoize:sV,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ot=(e,t,n,r,i,c,...l)=>{if(l.length>0)throw new Error(Vo(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var xM=tO();const hv=[];let pv;function lV(){return pv}function uV(e){hv.push(e)}function RM(e){const t=(n,r)=>{const i=Sr(dV).current;let c;try{pv=i;for(const l of hv)l.before(i);c=e(n,r);for(const l of hv)l.after(i);i.didInitialize=!0}finally{pv=void 0}return c};return t.displayName=e.displayName||e.name,t}function fV(e){return M.forwardRef(RM(e))}function dV(){return{didInitialize:!1}}const hV=Xv(19),pV=hV?gV:yV;function CM(e,t,n,r,i){return pV(e,t,n,r,i)}function mV(e,t,n,r,i){const c=M.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return xM.useSyncExternalStore(e.subscribe,c,c)}uV({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),xM.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function gV(e,t,n,r,i){const c=lV();if(!c)return mV(e,t,n,r,i);const l=c.syncIndex;c.syncIndex+=1;let f;return c.didInitialize?(f=c.syncHooks[l],(f.store!==e||f.selector!==t||!Object.is(f.a1,n)||!Object.is(f.a2,r)||!Object.is(f.a3,i))&&(f.store!==e&&(c.didChangeStore=!0),f.store=e,f.selector=t,f.a1=n,f.a2=r,f.a3=i,f.didChange=!0)):(f={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},c.syncHooks.push(f)),f.value}function yV(e,t,n,r,i){return nO.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>t(c,n,r,i))}class bV{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return CM(this,t,n,r,i)}}class pS extends bV{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){M.useDebugValue(t),pt(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;pt(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);pt(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){M.useDebugValue(t);const r=n!==void 0;pt(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,i){const c=this.selectors[t];return c(this.state,n,r,i)}useState(t,n,r,i){return M.useDebugValue(t),CM(this,this.selectors[t],n,r,i)}useContextCallback(t,n){M.useDebugValue(t);const r=Fe(n??hO);this.context[t]=r}useStateSetter(t){const n=M.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(c=>{const l=r(c);if(!Object.is(i,l)){const f=i;i=l,n(l,f,this)}})}}const vV={open:ot(e=>e.open),domReferenceElement:ot(e=>e.domReferenceElement),referenceElement:ot(e=>e.positionReference??e.referenceElement),floatingElement:ot(e=>e.floatingElement),floatingId:ot(e=>e.floatingId)};class mS extends pS{constructor(t){const{nested:n,noEmit:r,onOpenChange:i,triggerElements:c,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:H9(),nested:n,noEmit:r,triggerElements:c},vV)}setOpen=(t,n)=>{if((!t||!this.state.open||Yj(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function SV(e,t){const n=M.useRef(null),r=M.useRef(null);return M.useCallback(i=>{if(e!==void 0){if(n.current!==null){const c=n.current,l=r.current,f=t.context.triggerElements.getById(c);l&&f===l&&t.context.triggerElements.delete(c),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function _V(e,t,n,r){const i=n.useState("isMountedByTrigger",e),c=SV(e,n),l=Fe(f=>{if(c(f),!f||!n.select("open"))return;const d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:f,...r});return}d==null&&n.update({activeTriggerId:e,activeTriggerElement:f,...r})});return pt(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:i}}function AM(e){const t=e.useState("open");pt(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,i]=n.value;e.update({activeTriggerId:r,activeTriggerElement:i})}}},[t,e])}function TM(e,t,n){const{mounted:r,setMounted:i,transitionStatus:c}=T9(e);t.useSyncedValues({mounted:r,transitionStatus:c});const l=Fe(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return lS({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:c}}class Am{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function wV(){return new mS({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Am,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function IM(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:wV(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Hs,inactiveTriggerProps:Hs,popupProps:Hs}}const tp=ot(e=>e.triggerIdProp??e.activeTriggerId),OM={open:ot(e=>e.openProp??e.open),mounted:ot(e=>e.mounted),transitionStatus:ot(e=>e.transitionStatus),floatingRootContext:ot(e=>e.floatingRootContext),preventUnmountingOnClose:ot(e=>e.preventUnmountingOnClose),payload:ot(e=>e.payload),activeTriggerId:tp,activeTriggerElement:ot(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ot((e,t)=>t!==void 0&&tp(e)===t),isOpenedByTrigger:ot((e,t)=>t!==void 0&&tp(e)===t&&e.open),isMountedByTrigger:ot((e,t)=>t!==void 0&&tp(e)===t&&e.mounted),triggerProps:ot((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ot(e=>e.popupProps),popupElement:ot(e=>e.popupElement),positionerElement:ot(e=>e.positionerElement)};function EV(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Kf(),c=Rm()!=null,l=Sr(()=>new mS({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Am,floatingId:i,nested:c,noEmit:!1})).current;return pt(()=>{const f={open:t,floatingId:i};r.reference!==void 0&&(f.referenceElement=r.reference,f.domReferenceElement=xt(r.reference)?r.reference:null),r.floating!==void 0&&(f.floatingElement=r.floating),l.update(f)},[t,i,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=c,l.context.noEmit=!1,l}function xV(e={}){const{nodeId:t,externalTree:n}=e,r=EV(e),i=e.rootContext||r,c={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[l,f]=M.useState(null),d=M.useRef(null),h=Xf(n);pt(()=>{c.domReference&&(d.current=c.domReference)},[c.domReference]);const b=$H({...e,elements:{...c,...l&&{reference:l}}}),g=M.useCallback(H=>{const P=xt(H)?{getBoundingClientRect:()=>H.getBoundingClientRect(),getClientRects:()=>H.getClientRects(),contextElement:H}:H;f(P),b.refs.setReference(P)},[b.refs]),[v,_]=M.useState(null),[w,E]=M.useState(null);i.useSyncedValue("referenceElement",v),i.useSyncedValue("domReferenceElement",xt(v)?v:null),i.useSyncedValue("floatingElement",w);const R=M.useCallback(H=>{(xt(H)||H===null)&&(d.current=H,_(H)),(xt(b.refs.reference.current)||b.refs.reference.current===null||H!==null&&!xt(H))&&b.refs.setReference(H)},[b.refs,_]),C=M.useCallback(H=>{E(H),b.refs.setFloating(H)},[b.refs]),I=M.useMemo(()=>({...b.refs,setReference:R,setFloating:C,setPositionReference:g,domReference:d}),[b.refs,R,C,g]),k=M.useMemo(()=>({...b.elements,domReference:c.domReference}),[b.elements,c.domReference]),T=i.useState("open"),$=i.useState("floatingId"),j=M.useMemo(()=>({...b,dataRef:i.context.dataRef,open:T,onOpenChange:i.setOpen,events:i.context.events,floatingId:$,refs:I,elements:k,nodeId:t,rootStore:i}),[b,I,k,t,i,T,$]);return pt(()=>{i.context.dataRef.current.floatingContext=j;const H=h?.nodesRef.current.find(P=>P.id===t);H&&(H.context=j)}),M.useMemo(()=>({...b,context:j,refs:I,elements:k,rootStore:i}),[b,I,k,j,i])}function MM(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,c=Kf(),l=Rm()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),h=t.useState(r?"popupElement":"positionerElement"),b=t.context.triggerElements,g=Sr(()=>new mS({open:f,referenceElement:d,floatingElement:h,triggerElements:b,onOpenChange:i,floatingId:c,nested:l,noEmit:n})).current;return pt(()=>{const v={open:f,floatingId:c,referenceElement:d,floatingElement:h};xt(d)&&(v.domReferenceElement=d),g.state.positionReference===g.state.referenceElement&&(v.positionReference=d),g.update(v)},[f,c,d,h,g]),g.context.onOpenChange=i,g.context.nested=l,g.context.noEmit=n,g}const sb=Uj&&$O;function RV(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:c=!0,delay:l}=t,f=M.useRef(!1),d=M.useRef(null),h=Ol(),b=M.useRef(!0);M.useEffect(()=>{const v=n.select("domReferenceElement");if(!c)return;const _=Sn(v);function w(){const C=n.select("domReferenceElement");!n.select("open")&&yn(C)&&C===Do(Kt(C))&&(f.current=!0)}function E(){b.current=!0}function R(){b.current=!1}return _.addEventListener("blur",w),sb&&(_.addEventListener("keydown",E,!0),_.addEventListener("pointerdown",R,!0)),()=>{_.removeEventListener("blur",w),sb&&(_.removeEventListener("keydown",E,!0),_.removeEventListener("pointerdown",R,!0))}},[n,c]),M.useEffect(()=>{if(!c)return;function v(_){if(_.reason===Fp||_.reason===fS){const w=n.select("domReferenceElement");xt(w)&&(d.current=w,f.current=!0)}}return r.on("openchange",v),()=>{r.off("openchange",v)}},[r,c,n]);const g=M.useMemo(()=>({onMouseLeave(){f.current=!1,d.current=null},onFocus(v){const _=v.currentTarget;if(f.current){if(d.current===_)return;f.current=!1,d.current=null}const w=Ss(v.nativeEvent);if(xt(w)){if(sb&&!v.relatedTarget){if(!b.current&&!rS(w))return}else if(!Fj(w))return}const E=zp(v.relatedTarget,n.context.triggerElements),{nativeEvent:R,currentTarget:C}=v,I=typeof l=="function"?l():l;if(n.select("open")&&E||I===0||I===void 0){n.setOpen(!0,Jt(bp,R,C));return}h.start(I,()=>{f.current||n.setOpen(!0,Jt(bp,R,C))})},onBlur(v){f.current=!1,d.current=null;const _=v.relatedTarget,w=v.nativeEvent,E=xt(_)&&_.hasAttribute(kl("focus-guard"))&&_.getAttribute("data-type")==="outside";h.start(0,()=>{const R=n.select("domReferenceElement"),C=Do(R?R.ownerDocument:document);!_&&C===R||yt(i.current.floatingContext?.refs.floating.current,C)||yt(R,C)||E||zp(_??C,n.context.triggerElements)||n.setOpen(!1,Jt(bp,w))})}}),[i,n,h,l]);return M.useMemo(()=>c?{reference:g,trigger:g}:{},[c,g])}const mv=kl("safe-polygon"),CV=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${VO}`;function AV(e){return e?!!e.closest(CV):!1}class gS{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new Jr,this.restTimeout=new Jr,this.handleCloseOptions=void 0}static create(){return new gS}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function DM(e){const t=Sr(gS.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),sS(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const TV=new Set(["click","mousedown"]);function IV(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),c=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:f=!0,closeDelay:d=0}=t,h=DM(n),b=Xf(),g=Rm(),v=Fe(()=>h.interactedInside?!0:l.current.openEvent?TV.has(l.current.openEvent.type):!1),_=Fe(()=>{const k=l.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),w=Fe(k=>zp(k,n.context.triggerElements)),E=M.useCallback((k,T=!0)=>{const $=OV(d,h.pointerType);$&&!h.handler?h.openChangeTimeout.start($,()=>n.setOpen(!1,Jt(Lr,k))):T&&(h.openChangeTimeout.clear(),n.setOpen(!1,Jt(Lr,k)))},[d,n,h]),R=Fe(()=>{h.unbindMouseMove(),h.handler=void 0}),C=Fe(()=>{if(h.performedPointerEventsMutation){const k=Kt(i).body;k.style.pointerEvents="",k.removeAttribute(mv),h.performedPointerEventsMutation=!1}}),I=Fe(k=>{const T=Ss(k);if(!AV(T)){h.interactedInside=!1;return}h.interactedInside=!0});pt(()=>{r||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,R(),C())},[r,h,R,C]),M.useEffect(()=>()=>{R()},[R]),M.useEffect(()=>C,[C]),pt(()=>{if(f&&r&&h.handleCloseOptions?.blockPointerEvents&&_()&&xt(c)&&i){h.performedPointerEventsMutation=!0;const k=Kt(i).body;k.setAttribute(mv,"");const T=c,$=i,j=b?.nodesRef.current.find(H=>H.id===g)?.context?.elements.floating;return j&&(j.style.pointerEvents=""),k.style.pointerEvents="none",T.style.pointerEvents="auto",$.style.pointerEvents="auto",()=>{k.style.pointerEvents="",T.style.pointerEvents="",$.style.pointerEvents=""}}},[f,r,c,i,h,_,b,g]),M.useEffect(()=>{if(!f)return;function k(H){v()||!l.current.floatingContext||!n.select("open")||w(H.relatedTarget)||(C(),R(),v()||E(H))}function T(H){h.openChangeTimeout.clear(),C(),h.handler?.(H),R()}function $(H){v()||E(H,!1)}const j=i;return j&&(j.addEventListener("mouseleave",k),j.addEventListener("mouseenter",T),j.addEventListener("mouseleave",$),j.addEventListener("pointerdown",I,!0)),()=>{j&&(j.removeEventListener("mouseleave",k),j.removeEventListener("mouseenter",T),j.removeEventListener("mouseleave",$),j.removeEventListener("pointerdown",I,!0))}},[f,i,n,l,v,w,E,C,R,I,h])}function OV(e,t){return t&&!kf(t)?0:typeof e=="function"?e():e}function rb(e){return typeof e=="function"?e():e}const MV={current:null};function DV(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:c=!0,delay:l=0,handleClose:f=null,mouseOnly:d=!1,restMs:h=0,move:b=!0,triggerElementRef:g=MV,externalTree:v,isActiveTrigger:_=!0}=t,w=Xf(v),E=DM(n),R=Qr(f),C=Qr(l),I=Qr(h),k=Qr(c);_&&(E.handleCloseOptions=R.current?.__options);const T=Fe(()=>E.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),$=Fe(ne=>zp(ne,n.context.triggerElements)),j=M.useCallback((ne,te=!0)=>{const F=vp(C.current,"close",E.pointerType);F&&!E.handler?E.openChangeTimeout.start(F,()=>n.setOpen(!1,Jt(Lr,ne))):te&&(E.openChangeTimeout.clear(),n.setOpen(!1,Jt(Lr,ne)))},[C,n,E]),H=Fe(()=>{E.unbindMouseMove(),E.handler=void 0}),P=Fe(()=>{if(E.performedPointerEventsMutation){const ne=Kt(n.select("domReferenceElement")).body;ne.style.pointerEvents="",ne.removeAttribute(mv),E.performedPointerEventsMutation=!1}});M.useEffect(()=>{if(!c)return;function ne(te){te.open||(E.openChangeTimeout.clear(),E.restTimeout.clear(),E.blockMouseMove=!0,E.restTimeoutPending=!1)}return i.on("openchange",ne),()=>{i.off("openchange",ne)}},[c,i,E]);const Q=Fe(ne=>{if(T()||!r.current.floatingContext||$(ne.relatedTarget))return;const te=g.current;R.current?.({...r.current.floatingContext,tree:w,x:ne.clientX,y:ne.clientY,onClose(){P(),H(),!T()&&te===n.select("domReferenceElement")&&j(ne)}})(ne)});return M.useEffect(()=>{if(!c)return;const ne=g.current??(_?n.select("domReferenceElement"):null);if(!xt(ne))return;function te(me){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,d&&!kf(E.pointerType)||rb(I.current)>0&&!vp(C.current,"open"))return;const ge=vp(C.current,"open",E.pointerType),V=n.select("domReferenceElement"),re=n.context.triggerElements,J=(re.hasElement(me.target)||re.hasMatchingElement(ee=>yt(ee,me.target)))&&(!V||!yt(V,me.target)),be=me.currentTarget??null,ue=n.select("open"),z=!ue||J;J&&ue?n.setOpen(!0,Jt(Lr,me,be)):ge?E.openChangeTimeout.start(ge,()=>{z&&n.setOpen(!0,Jt(Lr,me,be))}):z&&n.setOpen(!0,Jt(Lr,me,be))}function F(me){if(T()){P();return}E.unbindMouseMove();const ge=n.select("domReferenceElement"),V=Kt(ge);if(E.restTimeout.clear(),E.restTimeoutPending=!1,$(me.relatedTarget))return;if(R.current&&r.current.floatingContext){n.select("open")||E.openChangeTimeout.clear();const J=g.current;E.handler=R.current({...r.current.floatingContext,tree:w,x:me.clientX,y:me.clientY,onClose(){P(),H(),k.current&&!T()&&J===n.select("domReferenceElement")&&j(me,!0)}});const be=E.handler;be(me),V.addEventListener("mousemove",be),E.unbindMouseMove=()=>{V.removeEventListener("mousemove",be)};return}(E.pointerType!=="touch"||!yt(n.select("floatingElement"),me.relatedTarget))&&j(me)}function oe(me){Q(me)}return n.select("open")&&ne.addEventListener("mouseleave",oe),b&&ne.addEventListener("mousemove",te,{once:!0}),ne.addEventListener("mouseenter",te),ne.addEventListener("mouseleave",F),()=>{ne.removeEventListener("mouseleave",oe),b&&ne.removeEventListener("mousemove",te),ne.removeEventListener("mouseenter",te),ne.removeEventListener("mouseleave",F)}},[H,P,r,C,j,n,c,R,Q,E,_,T,$,d,b,I,g,w,k]),M.useMemo(()=>{if(!c)return;function ne(te){E.pointerType=te.pointerType}return{onPointerDown:ne,onPointerEnter:ne,onMouseMove(te){const{nativeEvent:F}=te,oe=te.currentTarget,me=n.select("domReferenceElement"),ge=n.context.triggerElements,V=n.select("open"),re=(ge.hasElement(te.target)||ge.hasMatchingElement(be=>yt(be,te.target)))&&(!me||!yt(me,te.target));if(d&&!kf(E.pointerType)||V&&!re||rb(I.current)===0||!re&&E.restTimeoutPending&&te.movementX**2+te.movementY**2<2)return;E.restTimeout.clear();function J(){if(E.restTimeoutPending=!1,T())return;const be=n.select("open");!E.blockMouseMove&&(!be||re)&&n.setOpen(!0,Jt(Lr,F,oe))}E.pointerType==="touch"?na.flushSync(()=>{J()}):re&&V?J():(E.restTimeoutPending=!0,E.restTimeout.start(rb(I.current),J))}}},[c,E,T,d,n,I])}function kM(e=[]){const t=e.map(h=>h?.reference),n=e.map(h=>h?.floating),r=e.map(h=>h?.item),i=e.map(h=>h?.trigger),c=M.useCallback(h=>np(h,e,"reference"),t),l=M.useCallback(h=>np(h,e,"floating"),n),f=M.useCallback(h=>np(h,e,"item"),r),d=M.useCallback(h=>np(h,e,"trigger"),i);return M.useMemo(()=>({getReferenceProps:c,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[c,l,f,d])}function np(e,t,n){const r=new Map,i=n==="item",c={};n==="floating"&&(c.tabIndex=-1,c[av]="");for(const l in e)i&&e&&(l===jO||l===HO)||(c[l]=e[l]);for(let l=0;lr.get(i)?.map(f=>f(...l)).find(f=>f!==void 0))):e[i]=c)}}const kV=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PV(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingId"),c=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:f="dialog"}=t,d=Kf(),h=c?.id||d,b=M.useMemo(()=>cv(l)?.id||i,[l,i]),g=kV.get(f)??f,_=Rm()!=null,w=M.useMemo(()=>g==="tooltip"||f==="label"?Hs:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&_&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[g,_,f]),E=M.useMemo(()=>g==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:r?b:void 0}:{...w,"aria-expanded":r?"true":"false","aria-controls":r?b:void 0,...g==="menu"&&{id:h}},[g,b,r,h,f,w]),R=M.useMemo(()=>{const I={id:b,...g&&{role:g}};return g==="tooltip"||f==="label"?I:{...I,...g==="menu"&&{"aria-labelledby":h}}},[g,b,h,f]),C=M.useCallback(({active:I,selected:k})=>{const T={role:"option",...I&&{id:`${b}-fui-option`}};switch(f){case"select":case"combobox":return{...T,"aria-selected":k}}return{}},[b,f]);return M.useMemo(()=>({reference:E,floating:R,item:C,trigger:w}),[E,R,w,C])}function $A(e,t){const[n,r]=e;let i=!1;const c=t.length;for(let l=0,f=c-1;l=r!=g>=r&&n<=(b-d)*(r-h)/(g-h)+d&&(i=!i)}return i}function NV(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function LV(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Jr;let c=!1,l=null,f=null,d=typeof performance<"u"?performance.now():0;function h(g,v){const _=performance.now(),w=_-d;if(l===null||f===null||w===0)return l=g,f=v,d=_,null;const E=g-l,R=v-f,I=Math.sqrt(E*E+R*R)/w;return l=g,f=v,d=_,I}const b=({x:g,y:v,placement:_,elements:w,onClose:E,nodeId:R,tree:C})=>function(k){function T(){i.clear(),E()}if(i.clear(),!w.domReference||!w.floating||_==null||g==null||v==null)return;const{clientX:$,clientY:j}=k,H=[$,j],P=Ss(k),Q=k.type==="mouseleave",ne=yt(w.floating,P),te=yt(w.domReference,P),F=w.domReference.getBoundingClientRect(),oe=w.floating.getBoundingClientRect(),me=_.split("-")[0],ge=g>oe.right-oe.width/2,V=v>oe.bottom-oe.height/2,re=NV(H,F),J=oe.width>F.width,be=oe.height>F.height,ue=(J?F:oe).left,z=(J?F:oe).right,ee=(be?F:oe).top,ye=(be?F:oe).bottom;if(ne&&(c=!0,!Q))return;if(te&&(c=!1),te&&!Q){c=!0;return}if(Q&&xt(k.relatedTarget)&&yt(w.floating,k.relatedTarget)||C&&Ja(C.nodesRef.current,R).some(({context:Se})=>Se?.open))return;if(me==="top"&&v>=F.bottom-1||me==="bottom"&&v<=F.top+1||me==="left"&&g>=F.right-1||me==="right"&&g<=F.left+1)return T();let we=[];switch(me){case"top":we=[[ue,F.top+1],[ue,oe.bottom-1],[z,oe.bottom-1],[z,F.top+1]];break;case"bottom":we=[[ue,oe.top+1],[ue,F.bottom-1],[z,F.bottom-1],[z,oe.top+1]];break;case"left":we=[[oe.right-1,ye],[oe.right-1,ee],[F.left+1,ee],[F.left+1,ye]];break;case"right":we=[[F.right-1,ye],[F.right-1,ee],[oe.left+1,ee],[oe.left+1,ye]];break}function Ee([Se,Ie]){switch(me){case"top":{const qe=[J?Se+t/2:ge?Se+t*4:Se-t*4,Ie+t+1],ve=[J?Se-t/2:ge?Se+t*4:Se-t*4,Ie+t+1],Je=[[oe.left,ge||J?oe.bottom-t:oe.top],[oe.right,ge?J?oe.bottom-t:oe.top:oe.bottom-t]];return[qe,ve,...Je]}case"bottom":{const qe=[J?Se+t/2:ge?Se+t*4:Se-t*4,Ie-t],ve=[J?Se-t/2:ge?Se+t*4:Se-t*4,Ie-t],Je=[[oe.left,ge||J?oe.top+t:oe.bottom],[oe.right,ge?J?oe.top+t:oe.bottom:oe.top+t]];return[qe,ve,...Je]}case"left":{const qe=[Se+t+1,be?Ie+t/2:V?Ie+t*4:Ie-t*4],ve=[Se+t+1,be?Ie-t/2:V?Ie+t*4:Ie-t*4];return[...[[V||be?oe.right-t:oe.left,oe.top],[V?be?oe.right-t:oe.left:oe.right-t,oe.bottom]],qe,ve]}case"right":{const qe=[Se-t,be?Ie+t/2:V?Ie+t*4:Ie-t*4],ve=[Se-t,be?Ie-t/2:V?Ie+t*4:Ie-t*4],Je=[[V||be?oe.left+t:oe.right,oe.top],[V?be?oe.left+t:oe.right:oe.left+t,oe.bottom]];return[qe,ve,...Je]}default:return[]}}if(!$A([$,j],we)){if(c&&!re)return T();if(!Q&&r){const Se=h(k.clientX,k.clientY);if(Se!==null&&Se<.1)return T()}$A([$,j],Ee([g,v]))?!c&&r&&i.start(40,T):T()}};return b.__options={blockPointerEvents:n},b}let zV=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),BV=(function(e){return e[e.open=Qa.open]="open",e[e.closed=Qa.closed]="closed",e[e.startingStyle=Qa.startingStyle]="startingStyle",e[e.endingStyle=Qa.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const PM=M.createContext(void 0);function $V(){const e=M.useContext(PM);if(e===void 0)throw new Error(Vo(26));return e}const NM="ArrowUp",LM="ArrowDown",zM="ArrowLeft",BM="ArrowRight",$M="Home",UM="End",UV=new Set([zM,BM]),jV=new Set([NM,LM]),HV=new Set([...UV,...jV]);[...HV];const VV=new Set([NM,LM,zM,BM,$M,UM]),qV={...Yf,...cS,nestedDialogOpen(e){return e?{[BV.nestedDialogOpen]:""}:null}},FV=M.forwardRef(function(t,n){const{className:r,finalFocus:i,initialFocus:c,render:l,...f}=t,{store:d}=fc(),h=d.useState("descriptionElementId"),b=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),v=d.useState("popupProps"),_=d.useState("modal"),w=d.useState("mounted"),E=d.useState("nested"),R=d.useState("nestedOpenDialogCount"),C=d.useState("open"),I=d.useState("openMethod"),k=d.useState("titleElementId"),T=d.useState("transitionStatus"),$=d.useState("role");$V(),lS({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function j(te){return te==="touch"?d.context.popupRef.current:!0}const H=c===void 0?j:c,P=R>0,ne=_r("div",t,{state:{open:C,nested:E,transitionStatus:T,nestedDialogOpen:P},props:[v,{"aria-labelledby":k??void 0,"aria-describedby":h??void 0,role:$,tabIndex:-1,hidden:!w,onKeyDown(te){VV.has(te.key)&&te.stopPropagation()},style:{[zV.nestedDialogs]:R}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:qV});return N.jsx(nH,{context:g,openInteractionType:I,disabled:!w,closeOnFocusOut:!b,initialFocus:H,returnFocus:i,modal:_!==!1,restoreFocus:"popup",children:ne})});function GV(e){return Xv(19)?e:e?"true":void 0}const ZV=M.forwardRef(function(t,n){const{cutout:r,...i}=t;let c;if(r){const l=r?.getBoundingClientRect();c=`polygon( 0% 0%, 100% 0%, 100% 100%, @@ -18,9 +18,9 @@ Error generating stack: `+u.message+` ${l.right}px ${l.bottom}px, ${l.right}px ${l.top}px, ${l.left}px ${l.top}px - )`}return N.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})}),KV=M.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:c}=fc(),l=c.useState("mounted"),f=c.useState("modal"),d=c.useState("open");return l||r?N.jsx(LM.Provider,{value:r,children:N.jsxs(X9,{ref:n,...i,children:[l&&f===!0&&N.jsx(ZV,{ref:c.context.internalBackdropRef,inert:GV(!d)}),t.children]})}):null});function VM(e){const t=M.useRef(!0);t.current&&(t.current=!1,e())}let jA={},HA={},VA="";function QV(e){if(typeof document>"u")return!1;const t=Kt(e);return Sn(t).innerWidth-t.documentElement.clientWidth>0}function YV(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Kt(e),r=n.documentElement,i=n.body,c=ra(r)?r:i,l=c.style.overflowY,f=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",c.style.overflowY="scroll";const d=c.offsetWidth;c.style.overflowY="hidden";const p=c.offsetWidth;return c.style.overflowY=l,r.style.scrollbarGutter=f,d===p}function XV(e){const t=Kt(e),n=t.documentElement,r=t.body,i=ra(n)?n:r,c={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,c)}}function WV(e){const t=Kt(e),n=t.documentElement,r=t.body,i=Sn(n);let c=0,l=0,f=!1;const d=Kr.create();if($O&&(i.visualViewport?.scale??1)!==1)return()=>{};function p(){const v=i.getComputedStyle(n),S=i.getComputedStyle(r),R=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=n.scrollTop,l=n.scrollLeft,jA={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},VA=n.style.scrollBehavior,HA={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=v.overflowY==="scroll"||S.overflowY==="scroll",T=v.overflowX==="scroll"||S.overflowX==="scroll",$=Math.max(0,i.innerWidth-r.clientWidth),j=Math.max(0,i.innerHeight-r.clientHeight),H=parseFloat(S.marginTop)+parseFloat(S.marginBottom),P=parseFloat(S.marginLeft)+parseFloat(S.marginRight),Y=ra(n)?n:r;if(f=YV(e),f){n.style.scrollbarGutter=R,Y.style.overflowY="hidden",Y.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(C||k)&&(n.style.overflowY="scroll"),(O||T)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:H||j?`calc(100dvh - ${H+j}px)`:"100dvh",width:P||$?`calc(100vw - ${P+$}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=c,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function b(){Object.assign(n.style,jA),Object.assign(r.style,HA),f||(n.scrollTop=c,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=VA)}function g(){b(),d.request(p)}return p(),i.addEventListener("resize",g),()=>{d.cancel(),b(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",g)}}class JV{lockCount=0;restore=null;timeoutLock=Jr.create();timeoutUnlock=Jr.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Kt(t).documentElement,i=Sn(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=mO;return}const c=UO||!QV(t);this.restore=c?XV(t):WV(t)}}const e7=new JV;function t7(e=!0,t=null){ht(()=>{if(e)return e7.acquire(t)},[e,t])}function n7(e){const t=M.useRef(""),n=M.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:M.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function s7(e){const[t,n]=M.useState(null),r=Ge((f,d)=>{e||n(d||(UO?"touch":""))}),i=M.useCallback(()=>{n(null)},[]),{onClick:c,onPointerDown:l}=n7(r);return M.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:c,onPointerDown:l}}),[t,i,c,l])}function r7(e){const{store:t,parentContext:n,actionsRef:r}=e,i=t.useState("open"),c=t.useState("disablePointerDismissal"),l=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:p,reset:b}=s7(i);IM(t);const{forceUnmount:g}=OM(i,t,()=>{b()}),v=Ge(ne=>{const re=Jt(ne);return re.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},re}),S=M.useCallback(()=>{t.setOpen(!1,v(iM))},[t,v]);M.useImperativeHandle(r,()=>({unmount:g,close:S}),[g,S]);const w=kM({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[E,R]=M.useState(0),C=E===0,O=PV(w),k=EM(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(ne){if(!t.context.outsidePressEnabledRef.current||"button"in ne&&ne.button!==0||"touches"in ne&&ne.touches.length!==1)return!1;const re=Ss(ne);if(C&&!c){const G=re;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===G||t.context.backdropRef.current===G||gt(G,f)&&!G?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});t7(i&&l===!0,f);const{getReferenceProps:T,getFloatingProps:$,getTriggerProps:j}=NM([O,k]);t.useContextCallback("onNestedDialogOpen",ne=>{R(ne+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),M.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(E),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,E]);const H=M.useMemo(()=>T(p),[T,p]),P=M.useMemo(()=>j(p),[j,p]),Y=M.useMemo(()=>$(),[$]);t.useSyncedValues({openMethod:d,activeTriggerProps:H,inactiveTriggerProps:P,popupProps:Y,floatingRootContext:w,nestedOpenDialogCount:E})}const o7={...DM,modal:it(e=>e.modal),nested:it(e=>e.nested),nestedOpenDialogCount:it(e=>e.nestedOpenDialogCount),disablePointerDismissal:it(e=>e.disablePointerDismissal),openMethod:it(e=>e.openMethod),descriptionElementId:it(e=>e.descriptionElementId),titleElementId:it(e=>e.titleElementId),viewportElement:it(e=>e.viewportElement),role:it(e=>e.role)};class i7 extends mS{constructor(t){super(a7(t),{popupRef:M.createRef(),backdropRef:M.createRef(),internalBackdropRef:M.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Tm,onOpenChange:void 0,onOpenChangeComplete:void 0},o7)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const i={open:t},c=n.trigger?.id??null;(c||t)&&(i.activeTriggerId=c,i.activeTriggerElement=n.trigger??null),this.update(i)}}function a7(e={}){return{...MM(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function c7(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:c,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:b,defaultTriggerId:g=null}=e,v=fc(!0),S=!!v,w=vr(()=>p?.store??new i7({open:r,openProp:n,activeTriggerId:g,triggerIdProp:b,modal:f,disablePointerDismissal:l,nested:S})).current;VM(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:g})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",b),w.useSyncedValues({disablePointerDismissal:l,nested:S,modal:f}),w.useContextCallback("onOpenChange",i),w.useContextCallback("onOpenChangeComplete",c);const E=w.useState("payload");r7({store:w,actionsRef:d,parentContext:v?.store.context});const R=M.useMemo(()=>({store:w}),[w]);return N.jsx(aM.Provider,{value:R,children:typeof t=="function"?t({payload:E}):t})}const l7=M.forwardRef(function(t,n){const{render:r,className:i,id:c,...l}=t,{store:f}=fc(),d=sS(c);return f.useSyncedValueWithCleanup("titleElementId",d),Sr("h2",t,{ref:n,props:[{id:d},l]})});function u7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(c7,{"data-slot":"sheet",...n}),t[2]=n,t[3]=r):r=t[3],r}function f7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(KV,{"data-slot":"sheet-portal",...n}),t[2]=n,t[3]=r):r=t[3],r}function d7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-50 bg-black/80 duration-100 data-closed:animate-out data-open:animate-in data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx(B9,{className:i,"data-slot":"sheet-overlay",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function p7(e){const t=kt.c(17);let n,r,i,c,l;t[0]!==e?({className:r,children:n,side:c,showCloseButton:l,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5]);const f=c===void 0?"right":c,d=l===void 0?!0:l;let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=N.jsx(d7,{}),t[6]=p):p=t[6];let b;t[7]!==r?(b=cn("data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col bg-background bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=top]:inset-x-0 data-[side=left]:inset-y-0 data-[side=right]:inset-y-0 data-[side=top]:top-0 data-[side=right]:right-0 data-[side=bottom]:bottom-0 data-[side=left]:left-0 data-[side=bottom]:h-auto data-[side=left]:h-full data-[side=right]:h-full data-[side=top]:h-auto data-[side=left]:w-3/4 data-[side=right]:w-3/4 data-closed:animate-out data-open:animate-in data-[side=bottom]:border-t data-[side=left]:border-r data-[side=top]:border-b data-[side=right]:border-l data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",r),t[7]=r,t[8]=b):b=t[8];let g;t[9]!==d?(g=d&&N.jsxs($9,{"data-slot":"sheet-close",render:N.jsx(Tl,{className:"absolute top-4 right-4",size:"icon-sm",variant:"ghost"}),children:[N.jsx(R8,{}),N.jsx("span",{className:"sr-only",children:"Close"})]}),t[9]=d,t[10]=g):g=t[10];let v;return t[11]!==n||t[12]!==i||t[13]!==f||t[14]!==b||t[15]!==g?(v=N.jsxs(f7,{children:[p,N.jsxs(qV,{className:b,"data-side":f,"data-slot":"sheet-content",...i,children:[n,g]})]}),t[11]=n,t[12]=i,t[13]=f,t[14]=b,t[15]=g,t[16]=v):v=t[16],v}function h7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("flex flex-col gap-1.5 p-6",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-slot":"sheet-header",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function m7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("font-medium text-foreground text-sm",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx(l7,{className:i,"data-slot":"sheet-title",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function g7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("text-muted-foreground text-xs/relaxed",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx(U9,{className:i,"data-slot":"sheet-description",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}const FM=M.createContext(void 0);function Xf(e){const t=M.useContext(FM);if(t===void 0&&!e)throw new Error(Fo(72));return t}const y7={...DM,disabled:it(e=>e.disabled),instantType:it(e=>e.instantType),isInstantPhase:it(e=>e.isInstantPhase),trackCursorAxis:it(e=>e.trackCursorAxis),disableHoverablePopup:it(e=>e.disableHoverablePopup),lastOpenChangeReason:it(e=>e.openChangeReason),closeDelay:it(e=>e.closeDelay),hasViewport:it(e=>e.hasViewport)};class bS extends mS{constructor(t){super({...b7(),...t},{popupRef:M.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Tm},y7)}setOpen=(t,n)=>{const r=n.reason,i=r===Lr,c=t&&r===bh,l=!t&&(r===qh||r===dS);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const f=()=>{const d={open:t,openChangeReason:r};c?d.instantType="focus":l?d.instantType="dismiss":r===Lr&&(d.instantType=void 0);const p=n.trigger?.id??null;(p||t)&&(d.activeTriggerId=p,d.activeTriggerElement=n.trigger??null),this.update(d)};i?na.flushSync(f):f()};static useStore(t,n){const r=vr(()=>new bS(n)).current,i=t??r,c=kM({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=c,i}}function b7(){return{...MM(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const v7=AM(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:c=!1,trackCursorAxis:l="none",actionsRef:f,onOpenChange:d,onOpenChangeComplete:p,handle:b,triggerId:g,defaultTriggerId:v=null,children:S}=t,w=bS.useStore(b?.store,{open:r,openProp:i,activeTriggerId:v,triggerIdProp:g});VM(()=>{i===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:v})}),w.useControlledProp("openProp",i),w.useControlledProp("triggerIdProp",g),w.useContextCallback("onOpenChange",d),w.useContextCallback("onOpenChangeComplete",p);const E=w.useState("open"),R=!n&&E,C=w.useState("activeTriggerId"),O=w.useState("payload");w.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:c}),ht(()=>{E&&n&&w.setOpen(!1,Jt(O9))},[E,n,w]),w.useSyncedValue("disabled",n),IM(w);const{forceUnmount:k,transitionStatus:T}=OM(R,w),$=w.useState("isInstantPhase"),j=w.useState("instantType"),H=w.useState("lastOpenChangeReason"),P=M.useRef(null);ht(()=>{T==="ending"&&H===fS||T!=="ending"&&$?(j!=="delay"&&(P.current=j),w.set("instantType","delay")):P.current!==null&&(w.set("instantType",P.current),P.current=null)},[T,$,H,j,w]),ht(()=>{R&&C==null&&w.set("payload",void 0)},[w,C,R]);const Y=M.useCallback(()=>{w.setOpen(!1,S7(w,iM))},[w]);M.useImperativeHandle(f,()=>({unmount:k,close:Y}),[k,Y]);const ne=w.useState("floatingRootContext"),re=EM(ne,{enabled:!n,referencePress:!0}),G=rH(ne,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:te,getFloatingProps:ue,getTriggerProps:ye}=NM([re,G]),V=M.useMemo(()=>te(),[te]),oe=M.useMemo(()=>ye(),[ye]),J=M.useMemo(()=>ue(),[ue]);return w.useSyncedValues({activeTriggerProps:V,inactiveTriggerProps:oe,popupProps:J}),N.jsx(FM.Provider,{value:w,children:typeof S=="function"?S({payload:O}):S})});function S7(e,t){const n=Jt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const qM=M.createContext(void 0);function _7(){return M.useContext(qM)}let w7=(function(e){return e[e.popupOpen=Gh.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const E7=600,x7=fV(function(t,n){const{className:r,render:i,handle:c,payload:l,disabled:f,delay:d,closeDelay:p,id:b,...g}=t,v=Xf(!0),S=c?.store??v;if(!S)throw new Error(Fo(82));const w=sS(b),E=S.useState("isTriggerActive",w),R=S.useState("isOpenedByTrigger",w),C=S.useState("floatingRootContext"),O=M.useRef(null),k=d??E7,T=p??0,{registerTrigger:$,isMountedByThisTrigger:j}=_V(w,O,S,{payload:l,closeDelay:T}),H=_7(),{delayRef:P,isInstantPhase:Y,hasProvider:ne}=G9(C,{open:R});S.useSyncedValue("isInstantPhase",Y);const re=S.useState("disabled"),G=f??re,te=S.useState("trackCursorAxis"),ue=S.useState("disableHoverablePopup"),ye=DV(C,{enabled:!G,mouseOnly:!0,move:!1,handleClose:!ue&&te!=="both"?LV():null,restMs(){const fe=H?.delay,B=typeof P.current=="object"?P.current.open:void 0;let ee=k;return ne&&(B!==0?ee=d??fe??k:ee=0),ee},delay(){const fe=typeof P.current=="object"?P.current.close:void 0;let B=T;return p==null&&ne&&(B=fe),{close:B}},triggerElementRef:O,isActiveTrigger:E}),V=RV(C,{enabled:!G}).reference,oe={open:R},J=S.useState("triggerProps",j);return Sr("button",t,{state:oe,ref:[n,$,O],props:[ye,V,J,{id:w,[w7.triggerDisabled]:G?"":void 0},g],stateAttributesMapping:L9})}),GM=M.createContext(void 0);function R7(){const e=M.useContext(GM);if(e===void 0)throw new Error(Fo(70));return e}const C7=M.forwardRef(function(t,n){const{children:r,container:i,className:c,render:l,...f}=t,{portalNode:d,portalSubtree:p}=hM({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:N.jsxs(M.Fragment,{children:[p,d&&na.createPortal(r,d)]})}),A7=M.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Xf().useState("mounted")||r?N.jsx(GM.Provider,{value:r,children:N.jsx(C7,{ref:n,...i})}):null}),ZM=M.createContext(void 0);function KM(){const e=M.useContext(ZM);if(e===void 0)throw new Error(Fo(71));return e}const T7=M.createContext(void 0);function I7(){return M.useContext(T7)?.direction??"ltr"}const O7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:c,platform:l,elements:f,middlewareData:d}=t,{element:p,padding:b=0,offsetParent:g="real"}=jo(e,t)||{};if(p==null)return{};const v=GO(b),S={x:n,y:r},w=cS(i),E=aS(w),R=await l.getDimensions(p),C=w==="y",O=C?"top":"left",k=C?"bottom":"right",T=C?"clientHeight":"clientWidth",$=c.reference[E]+c.reference[w]-S[w]-c.floating[E],j=S[w]-c.reference[w],H=g==="real"?await l.getOffsetParent?.(p):f.floating;let P=f.floating[T]||c.floating[E];(!P||!await l.isElement?.(H))&&(P=f.floating[T]||c.floating[E]);const Y=$/2-j/2,ne=P/2-R[E]/2-1,re=Math.min(v[O],ne),G=Math.min(v[k],ne),te=re,ue=P-R[E]-G,ye=P/2-R[E]/2+Y,V=fv(te,ye,ue),oe=!d.arrow&&ia(i)!=null&&ye!==V&&c.reference[E]/2-(ye({...O7(e),options:[e,t]}),D7={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,c=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await qH().fn(e)).data?.referenceHidden||c}}}},_h={sideX:"left",sideY:"top"},k7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:c,strategy:l,placement:f}=e,d=Sn(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:_h};const g=await c.getOffsetParent?.(i);let v={width:0,height:0};if(l==="fixed"&&d?.visualViewport)v={width:d.visualViewport.width,height:d.visualViewport.height};else if(g===d){const O=Kt(i);v={width:O.documentElement.clientWidth,height:O.documentElement.clientHeight}}else await c.isElement?.(g)&&(v=await c.getDimensions(g));const S=Es(f);let w=t,E=n;S==="left"&&(w=v.width-(t+r.width)),S==="top"&&(E=v.height-(n+r.height));const R=S==="left"?"right":_h.sideX,C=S==="top"?"bottom":_h.sideY;return{x:w,y:E,data:{sideX:R,sideY:C}}}};function QM(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function FA(e,t,n){const{rects:r,placement:i}=e;return{side:QM(t,Es(i),n),align:ia(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function P7(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:c="center",alignOffset:l=0,collisionBoundary:f,collisionPadding:d=5,sticky:p=!1,arrowPadding:b=5,disableAnchorTracking:g=!1,keepMounted:v=!1,floatingRootContext:S,mounted:w,collisionAvoidance:E,shiftCrossAxis:R=!1,nodeId:C,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:T}=e,[$,j]=M.useState(null);!w&&$!==null&&j(null);const H=E.side||"flip",P=E.align||"flip",Y=E.fallbackAxisSide||"end",ne=typeof t=="function"?t:void 0,re=Ge(ne),G=ne?re:t,te=Qr(t),ye=I7()==="rtl",V=$||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ye?"left":"right","inline-start":ye?"right":"left"}[r],oe=c==="center"?V:`${V}-${c}`;let J=d;const ve=1,fe=r==="bottom"?ve:0,B=r==="top"?ve:0,ee=r==="right"?ve:0,ge=r==="left"?ve:0;typeof J=="number"?J={top:J+fe,right:J+ge,bottom:J+B,left:J+ee}:J&&(J={top:(J.top||0)+fe,right:(J.right||0)+ge,bottom:(J.bottom||0)+B,left:(J.left||0)+ee});const be={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:J},xe=M.useRef(null),_e=Qr(i),Te=Qr(l),Xe=[UH(Ft=>{const Kn=FA(Ft,r,ye),Ws=typeof _e.current=="function"?_e.current(Kn):_e.current,Nn=typeof Te.current=="function"?Te.current(Kn):Te.current;return{mainAxis:Ws,crossAxis:Nn,alignmentAxis:Nn}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ye,r])],_t=P==="none"&&H!=="shift",me=!_t&&(p||R||H==="shift"),Ee=H==="none"?null:VH({...be,padding:{top:J.top+ve,right:J.right+ve,bottom:J.bottom+ve,left:J.left+ve},mainAxis:!R&&H==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:Y}),we=_t?null:jH(Ft=>{const Kn=Kt(Ft.elements.floating).documentElement;return{...be,rootBoundary:R?{x:0,y:0,width:Kn.clientWidth,height:Kn.clientHeight}:void 0,mainAxis:P!=="none",crossAxis:me,limiter:p||R?void 0:HH(Ws=>{if(!xe.current)return{};const{width:Nn,height:ds}=xe.current.getBoundingClientRect(),co=br(Es(Ws.placement)),Js=co==="y"?Nn:ds,di=co==="y"?J.left+J.right:J.top+J.bottom;return{offset:Js/2+di/2}})}},[be,p,R,J,P]);H==="shift"||P==="shift"||c==="center"?Xe.push(we,Ee):Xe.push(Ee,we),Xe.push(FH({...be,apply({elements:{floating:Ft},rects:{reference:Kn},availableWidth:Ws,availableHeight:Nn}){const ds=Ft.style;ds.setProperty("--available-width",`${Ws}px`),ds.setProperty("--available-height",`${Nn}px`),ds.setProperty("--anchor-width",`${Kn.width}px`),ds.setProperty("--anchor-height",`${Kn.height}px`)}}),M7(()=>({element:xe.current||document.createElement("div"),padding:b,offsetParent:"floating"}),[b]),{name:"transformOrigin",fn(Ft){const{elements:Kn,middlewareData:Ws,placement:Nn,rects:ds,y:co}=Ft,Js=Es(Nn),di=br(Js),pi=xe.current,Sg=Ws.arrow?.x||0,Cd=Ws.arrow?.y||0,au=pi?.clientWidth||0,Ra=pi?.clientHeight||0,cu=Sg+au/2,lu=Cd+Ra/2,Ad=Math.abs(Ws.shift?.y||0),Td=ds.reference.height/2,lo=typeof i=="function"?i(FA(Ft,r,ye)):i,uu=Ad>lo,Id={top:`${cu}px calc(100% + ${lo}px)`,bottom:`${cu}px ${-lo}px`,left:`calc(100% + ${lo}px) ${lu}px`,right:`${-lo}px ${lu}px`}[Js],Od=`${cu}px ${ds.reference.y+Td-co}px`;return Kn.floating.style.setProperty("--transform-origin",me&&di==="y"&&uu?Od:Id),{}}},D7,O),ht(()=>{!w&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,S]);const qe=M.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:Oe,elements:je,x:De,y:nt,middlewareData:Bt,update:We,placement:Tt,context:Rn,isPositioned:It,floatingStyles:Tr}=xV({rootContext:S,placement:oe,middleware:Xe,strategy:n,whileElementsMounted:v?void 0:(...Ft)=>NA(...Ft,qe),nodeId:C,externalTree:T}),{sideX:dt,sideY:$t}=Bt.adaptiveOrigin||_h,mt=It?n:"fixed",Os=M.useMemo(()=>{const Ft=O?{position:mt,[dt]:De,[$t]:nt}:{position:mt,...Tr};return It||(Ft.opacity=0),Ft},[O,mt,dt,De,$t,nt,Tr,It]),Xs=M.useRef(null);ht(()=>{if(!w)return;const Ft=te.current,Kn=typeof Ft=="function"?Ft():Ft,Nn=(qA(Kn)?Kn.current:Kn)||null||null;Nn!==Xs.current&&(Oe.setPositionReference(Nn),Xs.current=Nn)},[w,Oe,G,te]),M.useEffect(()=>{if(!w)return;const Ft=te.current;typeof Ft!="function"&&qA(Ft)&&Ft.current!==Xs.current&&(Oe.setPositionReference(Ft.current),Xs.current=Ft.current)},[w,Oe,G,te]),M.useEffect(()=>{if(v&&w&&je.domReference&&je.floating)return NA(je.domReference,je.floating,We,qe)},[v,w,je,We,qe]);const ao=Es(Tt),Rd=QM(r,ao,ye),fi=ia(Tt)||"center",Gn=!!Bt.hide?.referenceHidden;ht(()=>{k&&w&&It&&j(ao)},[k,w,It,ao]);const Ir=M.useMemo(()=>({position:"absolute",top:Bt.arrow?.y,left:Bt.arrow?.x}),[Bt.arrow]),Zn=Bt.arrow?.centerOffset!==0;return M.useMemo(()=>({positionerStyles:Os,arrowStyles:Ir,arrowRef:xe,arrowUncentered:Zn,side:Rd,align:fi,physicalSide:ao,anchorHidden:Gn,refs:Oe,context:Rn,isPositioned:It,update:We}),[Os,Ir,xe,Zn,Rd,fi,ao,Gn,Oe,Rn,It,We])}function qA(e){return e!=null&&"current"in e}function YM(e){return e==="starting"?U5:Hs}const N7=M.forwardRef(function(t,n){const{render:r,className:i,anchor:c,positionMethod:l="absolute",side:f="top",align:d="center",sideOffset:p=0,alignOffset:b=0,collisionBoundary:g="clipping-ancestors",collisionPadding:v=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:E=!1,collisionAvoidance:R=H5,...C}=t,O=Xf(),k=R7(),T=O.useState("open"),$=O.useState("mounted"),j=O.useState("trackCursorAxis"),H=O.useState("disableHoverablePopup"),P=O.useState("floatingRootContext"),Y=O.useState("instantType"),ne=O.useState("transitionStatus"),re=O.useState("hasViewport"),G=P7({anchor:c,positionMethod:l,floatingRootContext:P,mounted:$,side:f,sideOffset:p,align:d,alignOffset:b,collisionBoundary:g,collisionPadding:v,sticky:w,arrowPadding:S,disableAnchorTracking:E,keepMounted:k,collisionAvoidance:R,adaptiveOrigin:re?k7:void 0}),te=M.useMemo(()=>{const oe={};return(!T||j==="both"||H)&&(oe.pointerEvents="none"),{role:"presentation",hidden:!$,style:{...G.positionerStyles,...oe}}},[T,j,H,$,G.positionerStyles]),ue=M.useMemo(()=>({open:T,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:j!=="none"?"tracking-cursor":Y}),[T,G.side,G.align,G.anchorHidden,j,Y]),ye=M.useMemo(()=>({...ue,arrowRef:G.arrowRef,arrowStyles:G.arrowStyles,arrowUncentered:G.arrowUncentered}),[ue,G.arrowRef,G.arrowStyles,G.arrowUncentered]),V=Sr("div",t,{state:ue,props:[te,YM(ne),C],ref:[n,O.useStateSetter("positionerElement")],stateAttributesMapping:Qf});return N.jsx(ZM.Provider,{value:ye,children:V})}),L7={...Qf,...lS},z7=M.forwardRef(function(t,n){const{className:r,render:i,...c}=t,l=Xf(),{side:f,align:d}=KM(),p=l.useState("open"),b=l.useState("instantType"),g=l.useState("transitionStatus"),v=l.useState("popupProps"),S=l.useState("floatingRootContext");uS({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const w=l.useState("disabled"),E=l.useState("closeDelay");return IV(S,{enabled:!w,closeDelay:E}),Sr("div",t,{state:{open:p,side:f,align:d,instant:b,transitionStatus:g},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[v,YM(g),c],stateAttributesMapping:L7})}),B7=M.forwardRef(function(t,n){const{className:r,render:i,...c}=t,f=Xf().useState("instantType"),{open:d,arrowRef:p,side:b,align:g,arrowUncentered:v,arrowStyles:S}=KM();return Sr("div",t,{state:{open:d,side:b,align:g,uncentered:v,instant:f},ref:[n,p],props:[{style:S,"aria-hidden":!0},c],stateAttributesMapping:Qf})}),$7=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,c=M.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=M.useMemo(()=>({open:n,close:r}),[n,r]);return N.jsx(qM.Provider,{value:c,children:N.jsx(q9,{delay:l,timeoutMs:i,children:t.children})})};function U7(e){const t=kt.c(6);let n,r;t[0]!==e?({delay:r,...n}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);const i=r===void 0?0:r;let c;return t[3]!==i||t[4]!==n?(c=N.jsx($7,{"data-slot":"tooltip-provider",delay:i,...n}),t[3]=i,t[4]=n,t[5]=c):c=t[5],c}function j7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(U7,{children:N.jsx(v7,{"data-slot":"tooltip",...n})}),t[2]=n,t[3]=r):r=t[3],r}function H7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(x7,{"data-slot":"tooltip-trigger",...n}),t[2]=n,t[3]=r):r=t[3],r}function V7(e){const t=kt.c(21);let n,r,i,c,l,f,d;t[0]!==e?({className:r,side:c,sideOffset:l,align:f,alignOffset:d,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l,t[6]=f,t[7]=d):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5],f=t[6],d=t[7]);const p=c===void 0?"top":c,b=l===void 0?4:l,g=f===void 0?"center":f,v=d===void 0?0:d;let S;t[8]!==r?(S=cn("data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:fade-out-0 data-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 max-w-xs origin-(--transform-origin) rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=delayed-open]:animate-in data-closed:animate-out data-open:animate-in **:data-[slot=kbd]:rounded-md",r),t[8]=r,t[9]=S):S=t[9];let w;t[10]===Symbol.for("react.memo_cache_sentinel")?(w=N.jsx(B7,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=right]:top-1/2! data-[side=left]:-right-1 data-[side=top]:-bottom-2.5 data-[side=right]:-left-1 data-[side=left]:-translate-y-1/2 data-[side=right]:-translate-y-1/2"}),t[10]=w):w=t[10];let E;t[11]!==n||t[12]!==i||t[13]!==S?(E=N.jsxs(z7,{className:S,"data-slot":"tooltip-content",...i,children:[n,w]}),t[11]=n,t[12]=i,t[13]=S,t[14]=E):E=t[14];let R;return t[15]!==g||t[16]!==v||t[17]!==p||t[18]!==b||t[19]!==E?(R=N.jsx(A7,{children:N.jsx(N7,{align:g,alignOffset:v,className:"isolate z-50",side:p,sideOffset:b,children:E})}),t[15]=g,t[16]=v,t[17]=p,t[18]=b,t[19]=E,t[20]=R):R=t[20],R}const F7=768,XM=`(max-width: ${F7-1}px)`;function q7(e){const t=window.matchMedia(XM);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function G7(){return window.matchMedia(XM).matches}function Z7(){return M.useSyncExternalStore(q7,G7)}const K7="sidebar_state",Q7=3600*24*7,Y7="12rem",X7="16rem",W7="3rem",J7="b",WM=M.createContext(null);function Im(){const e=M.useContext(WM);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function eF(e){const t=kt.c(36);let n,r,i,c,l,f,d;t[0]!==e?({defaultOpen:d,open:i,onOpenChange:l,className:r,style:f,children:n,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l,t[6]=f,t[7]=d):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5],f=t[6],d=t[7]);const p=d===void 0?!0:d,b=Z7(),[g,v]=M.useState(!1),[S,w]=M.useState(p),E=i??S;let R;t[8]!==E||t[9]!==l?(R=ue=>{const ye=typeof ue=="function"?ue(E):ue;l?l(ye):w(ye),document.cookie=`${K7}=${ye}; path=/; max-age=${Q7}`},t[8]=E,t[9]=l,t[10]=R):R=t[10];const C=R;let O;t[11]!==b||t[12]!==C?(O=()=>b?v(nF):C(tF),t[11]=b,t[12]=C,t[13]=O):O=t[13];const k=O;let T,$;t[14]!==k?(T=()=>{const ue=ye=>{ye.key===J7&&(ye.metaKey||ye.ctrlKey)&&(ye.preventDefault(),k())};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},$=[k],t[14]=k,t[15]=T,t[16]=$):(T=t[15],$=t[16]),M.useEffect(T,$);const j=E?"expanded":"collapsed";let H;t[17]!==b||t[18]!==E||t[19]!==g||t[20]!==C||t[21]!==j||t[22]!==k?(H={state:j,open:E,setOpen:C,isMobile:b,openMobile:g,setOpenMobile:v,toggleSidebar:k},t[17]=b,t[18]=E,t[19]=g,t[20]=C,t[21]=j,t[22]=k,t[23]=H):H=t[23];const P=H;let Y;t[24]!==r?(Y=cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),t[24]=r,t[25]=Y):Y=t[25];let ne;t[26]!==f?(ne={"--sidebar-width":Y7,"--sidebar-width-icon":W7,...f},t[26]=f,t[27]=ne):ne=t[27];const re=ne;let G;t[28]!==n||t[29]!==c||t[30]!==Y||t[31]!==re?(G=N.jsx("div",{className:Y,"data-slot":"sidebar-wrapper",style:re,...c,children:n}),t[28]=n,t[29]=c,t[30]=Y,t[31]=re,t[32]=G):G=t[32];let te;return t[33]!==P||t[34]!==G?(te=N.jsx(WM.Provider,{value:P,children:G}),t[33]=P,t[34]=G,t[35]=te):te=t[35],te}function tF(e){return!e}function nF(e){return!e}function sF(e){const t=kt.c(46);let n,r,i,c,l,f;t[0]!==e?({side:c,variant:l,collapsible:f,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l,t[6]=f):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5],f=t[6]);const d=c===void 0?"left":c,p=l===void 0?"sidebar":l,b=f===void 0?"offExamples":f,{isMobile:g,state:v,openMobile:S,setOpenMobile:w}=Im();if(b==="none"){let Y;t[7]!==r?(Y=cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),t[7]=r,t[8]=Y):Y=t[8];let ne;return t[9]!==n||t[10]!==i||t[11]!==Y?(ne=N.jsx("div",{className:Y,"data-slot":"sidebar",...i,children:n}),t[9]=n,t[10]=i,t[11]=Y,t[12]=ne):ne=t[12],ne}if(g){let Y;t[13]===Symbol.for("react.memo_cache_sentinel")?(Y={"--sidebar-width":X7},t[13]=Y):Y=t[13];let ne;t[14]===Symbol.for("react.memo_cache_sentinel")?(ne=N.jsxs(h7,{className:"sr-only",children:[N.jsx(m7,{children:"Sidebar"}),N.jsx(g7,{children:"Displays the mobile sidebar."})]}),t[14]=ne):ne=t[14];let re;t[15]!==n?(re=N.jsx("div",{className:"flex h-full w-full flex-col",children:n}),t[15]=n,t[16]=re):re=t[16];let G;t[17]!==d||t[18]!==re?(G=N.jsxs(p7,{className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar","data-slot":"sidebar",side:d,style:Y,children:[ne,re]}),t[17]=d,t[18]=re,t[19]=G):G=t[19];let te;return t[20]!==S||t[21]!==i||t[22]!==w||t[23]!==G?(te=N.jsx(u7,{onOpenChange:w,open:S,...i,children:G}),t[20]=S,t[21]=i,t[22]=w,t[23]=G,t[24]=te):te=t[24],te}const E=v==="collapsed"?b:"",R=p==="floating"||p==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let C;t[25]!==R?(C=cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offExamples]:w-0","group-data-[side=right]:rotate-180",R),t[25]=R,t[26]=C):C=t[26];let O;t[27]!==C?(O=N.jsx("div",{className:C,"data-slot":"sidebar-gap"}),t[27]=C,t[28]=O):O=t[28];const k=d==="left"?"left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]",T=p==="floating"||p==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let $;t[29]!==r||t[30]!==k||t[31]!==T?($=cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",k,T,r),t[29]=r,t[30]=k,t[31]=T,t[32]=$):$=t[32];let j;t[33]!==n?(j=N.jsx("div",{className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border","data-sidebar":"sidebar","data-slot":"sidebar-inner",children:n}),t[33]=n,t[34]=j):j=t[34];let H;t[35]!==i||t[36]!==$||t[37]!==j?(H=N.jsx("div",{className:$,"data-slot":"sidebar-container",...i,children:j}),t[35]=i,t[36]=$,t[37]=j,t[38]=H):H=t[38];let P;return t[39]!==d||t[40]!==v||t[41]!==H||t[42]!==E||t[43]!==O||t[44]!==p?(P=N.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":E,"data-side":d,"data-slot":"sidebar","data-state":v,"data-variant":p,children:[O,H]}),t[39]=d,t[40]=v,t[41]=H,t[42]=E,t[43]=O,t[44]=p,t[45]=P):P=t[45],P}function rF(e){const t=kt.c(15);let n,r,i;t[0]!==e?({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]);const{toggleSidebar:c}=Im();let l;t[4]!==n?(l=cn(n),t[4]=n,t[5]=l):l=t[5];let f;t[6]!==r||t[7]!==c?(f=g=>{r?.(g),c()},t[6]=r,t[7]=c,t[8]=f):f=t[8];let d,p;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=N.jsx(S8,{}),p=N.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),t[9]=d,t[10]=p):(d=t[9],p=t[10]);let b;return t[11]!==i||t[12]!==l||t[13]!==f?(b=N.jsxs(Tl,{className:l,"data-sidebar":"trigger","data-slot":"sidebar-trigger",onClick:f,size:"icon-lg",variant:"ghost",...i,children:[d,p]}),t[11]=i,t[12]=l,t[13]=f,t[14]=b):b=t[14],b}function oF(e){const t=kt.c(9);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);const{toggleSidebar:i}=Im();let c;t[3]!==n?(c=cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offExamples]:translate-x-0 hover:group-data-[collapsible=offExamples]:bg-sidebar group-data-[collapsible=offExamples]:after:left-full","[[data-side=left][data-collapsible=offExamples]_&]:-right-2","[[data-side=right][data-collapsible=offExamples]_&]:-left-2",n),t[3]=n,t[4]=c):c=t[4];let l;return t[5]!==r||t[6]!==c||t[7]!==i?(l=N.jsx("button",{"aria-label":"Toggle Sidebar",className:c,"data-sidebar":"rail","data-slot":"sidebar-rail",onClick:i,tabIndex:-1,title:"Toggle Sidebar",...r}),t[5]=r,t[6]=c,t[7]=i,t[8]=l):l=t[8],l}function iF(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("flex flex-col gap-2 p-2",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-sidebar":"footer","data-slot":"sidebar-footer",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function aF(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-sidebar":"content","data-slot":"sidebar-content",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function sh(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("relative flex w-full min-w-0 flex-col px-2 py-1",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-sidebar":"group","data-slot":"sidebar-group",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function rh(e){const t=kt.c(10);let n,r,i,c;if(t[0]!==e){const{className:d,render:p,...b}=e;n=p,c=gO,r="div",i=Sm({className:cn("flex h-8 shrink-0 items-center rounded-md px-2 text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 [&>svg]:size-4 [&>svg]:shrink-0",d)},b),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c}else n=t[1],r=t[2],i=t[3],c=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},t[5]=l):l=t[5];let f;return t[6]!==n||t[7]!==r||t[8]!==i?(f={defaultTagName:r,props:i,render:n,state:l},t[6]=n,t[7]=r,t[8]=i,t[9]=f):f=t[9],c(f)}function uf(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("flex w-full min-w-0 flex-col gap-px",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("ul",{className:i,"data-sidebar":"menu","data-slot":"sidebar-menu",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function Hr(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("group/menu-item relative",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("li",{className:i,"data-sidebar":"menu-item","data-slot":"sidebar-menu-item",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}const cF=vO("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Vr(e){const t=kt.c(15);let{render:n,isActive:r,variant:i,size:c,tooltip:l,className:f,...d}=e;const p=r===void 0?!1:r,b=i===void 0?"default":i,g=c===void 0?"default":c,{isMobile:v,state:S}=Im(),w="button",E=Sm({className:cn(cF({variant:b,size:g}),f)},d),R=l?H7:n;let C;t[0]!==p||t[1]!==g?(C={slot:"sidebar-menu-button",sidebar:"menu-button",size:g,active:p},t[0]=p,t[1]=g,t[2]=C):C=t[2];let O;t[3]!==E||t[4]!==R||t[5]!==C?(O={defaultTagName:w,props:E,render:R,state:C},t[3]=E,t[4]=R,t[5]=C,t[6]=O):O=t[6];const k=gO(O);if(!l)return k;if(typeof l=="string"){let H;t[7]!==l?(H={children:l},t[7]=l,t[8]=H):H=t[8],l=H}const T=S!=="collapsed"||v;let $;t[9]!==T||t[10]!==l?($=N.jsx(V7,{align:"center",hidden:T,side:"right",...l}),t[9]=T,t[10]=l,t[11]=$):$=t[11];let j;return t[12]!==k||t[13]!==$?(j=N.jsxs(j7,{children:[k,$]}),t[12]=k,t[13]=$,t[14]=j):j=t[14],j}function lF(){const e=kt.c(8),{theme:t,setTheme:n}=A5();let r;e[0]!==n||e[1]!==t?(r=()=>{n(t==="light"?"dark":t==="dark"?"light":"dark")},e[0]=n,e[1]=t,e[2]=r):r=e[2];const i=r;let c,l,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=N.jsx(E8,{className:"size-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l=N.jsx(g8,{className:"absolute size-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),f=N.jsx("span",{className:"sr-only",children:"Toggle theme"}),e[3]=c,e[4]=l,e[5]=f):(c=e[3],l=e[4],f=e[5]);let d;return e[6]!==i?(d=N.jsxs(Tl,{className:"rounded-full",onClick:i,size:"icon-sm",variant:"ghost",children:[c,l,f]}),e[6]=i,e[7]=d):d=e[7],d}function JM(){const e=kt.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=cn("z-50 flex h-10 shrink-0 items-center gap-2 border-sidebar-border border-b bg-sidebar px-4 text-sidebar-foreground","sticky top-0"),n=N.jsx(rF,{className:"-ml-1"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=N.jsxs("header",{className:t,children:[n,N.jsx("div",{className:"flex w-full justify-end",children:N.jsx(lF,{})})]}),e[2]=r):r=e[2],r}function uF(){const e=kt.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=N.jsx("h1",{className:"font-bold text-4xl",children:"404"}),n=N.jsx("p",{className:"text-muted-foreground",children:"Page not found"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=N.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4",children:[t,n,N.jsx($s,{to:"/",children:N.jsx(Tl,{variant:"outline",children:"Go back home"})})]}),e[2]=r):r=e[2],r}function pe(e,t,n){function r(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const p=l.prototype,b=Object.keys(p);for(let g=0;gn?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class _l extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eD extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const tD={};function oc(e){return tD}function nD(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function bv(e,t){return typeof t=="bigint"?t.toString():t}function vS(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function SS(e){return e==null}function _S(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function fF(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const c=n>i?n:i,l=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return l%f/10**c}const GA=Symbol("evaluating");function Dt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==GA)return r===void 0&&(r=GA,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function dc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function aa(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ZA(e){return JSON.stringify(e)}function dF(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sD="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const pF=vS(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Lf(e){if(Yh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Yh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function rD(e){return Lf(e)?{...e}:Array.isArray(e)?[...e]:e}const hF=new Set(["string","number","symbol"]);function Om(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ca(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ue(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function mF(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const gF={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function yF(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=aa(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return dc(this,"shape",l),l},checks:[]});return ca(e,c)}function bF(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=aa(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return dc(this,"shape",l),l},checks:[]});return ca(e,c)}function vF(e,t){if(!Lf(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const c=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(c,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=aa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return dc(this,"shape",c),c}});return ca(e,i)}function SF(e,t){if(!Lf(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=aa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return dc(this,"shape",r),r}});return ca(e,n)}function _F(e,t){const n=aa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return dc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ca(e,n)}function wF(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=aa(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(d[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)d[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return dc(this,"shape",d),d},checks:[]});return ca(t,l)}function EF(e,t,n){const r=aa(t._zod.def,{get shape(){const i=t._zod.def.shape,c={...i};if(n)for(const l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)c[l]=new e({type:"nonoptional",innerType:i[l]});return dc(this,"shape",c),c}});return ca(t,r)}function ml(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function oh(e){return typeof e=="string"?e:e?.message}function ic(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=oh(e.inst?._zod.def?.error?.(e))??oh(t?.error?.(e))??oh(n.customError?.(e))??oh(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function wS(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function zf(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const iD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,bv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aD=pe("$ZodError",iD),Mm=pe("$ZodError",iD,{Parent:Error});function xF(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function RF(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>r({issues:l}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)n._errors.push(t(c));else{let l=n,f=0;for(;f(t,n,r,i)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise)throw new _l;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ic(d,c,oc())));throw sD(f,i?.callee),f}return l.value},GRe=Dm(Mm),km=e=>async(t,n,r,i)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ic(d,c,oc())));throw sD(f,i?.callee),f}return l.value},ZRe=km(Mm),Pm=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise)throw new _l;return c.issues.length?{success:!1,error:new(e??aD)(c.issues.map(l=>ic(l,i,oc())))}:{success:!0,data:c.value}},CF=Pm(Mm),Nm=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},i);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(l=>ic(l,i,oc())))}:{success:!0,data:c.value}},AF=Nm(Mm),TF=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dm(e)(t,n,i)},IF=e=>(t,n,r)=>Dm(e)(t,n,r),OF=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return km(e)(t,n,i)},MF=e=>async(t,n,r)=>km(e)(t,n,r),DF=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Pm(e)(t,n,i)},kF=e=>(t,n,r)=>Pm(e)(t,n,r),PF=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Nm(e)(t,n,i)},NF=e=>async(t,n,r)=>Nm(e)(t,n,r),LF=/^[cC][^\s-]{8,}$/,zF=/^[0-9a-z]+$/,BF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$F=/^[0-9a-vA-V]{20}$/,UF=/^[A-Za-z0-9]{27}$/,jF=/^[a-zA-Z0-9_-]{21}$/,HF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VF=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,KA=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,FF=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function GF(){return new RegExp(qF,"u")}const ZF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,KF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,QF=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,XF=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cD=/^[A-Za-z0-9_-]*$/,WF=/^\+[1-9]\d{6,14}$/,lD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",JF=new RegExp(`^${lD}$`);function uD(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eq(e){return new RegExp(`^${uD(e)}$`)}function tq(e){const t=uD({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${lD}T(?:${r})$`)}const nq=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sq=/^-?\d+$/,rq=/^-?\d+(?:\.\d+)?$/,oq=/^(?:true|false)$/i,iq=/^[^A-Z]*$/,aq=/^[^a-z]*$/,Rs=pe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fD={number:"number",bigint:"bigint",object:"date"},dD=pe("$ZodCheckLessThan",(e,t)=>{Rs.init(e,t);const n=fD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,c=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?r.value<=t.value:r.value{Rs.init(e,t);const n=fD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,c=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cq=pe("$ZodCheckMultipleOf",(e,t)=>{Rs.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):fF(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),lq=pe("$ZodCheckNumberFormat",(e,t)=>{Rs.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,c]=gF[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=i,f.maximum=c,n&&(f.pattern=sq)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}fc&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),uq=pe("$ZodCheckMaxLength",(e,t)=>{var n;Rs.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!SS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const i=r.value;if(i.length<=t.maximum)return;const l=wS(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),fq=pe("$ZodCheckMinLength",(e,t)=>{var n;Rs.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!SS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=wS(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),dq=pe("$ZodCheckLengthEquals",(e,t)=>{var n;Rs.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!SS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,c=i.length;if(c===t.length)return;const l=wS(i),f=c>t.length;r.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Lm=pe("$ZodCheckStringFormat",(e,t)=>{var n,r;Rs.init(e,t),e._zod.onattach.push(i=>{const c=i._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),pq=pe("$ZodCheckRegex",(e,t)=>{Lm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hq=pe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iq),Lm.init(e,t)}),mq=pe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=aq),Lm.init(e,t)}),gq=pe("$ZodCheckIncludes",(e,t)=>{Rs.init(e,t);const n=Om(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const c=i._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),yq=pe("$ZodCheckStartsWith",(e,t)=>{Rs.init(e,t);const n=new RegExp(`^${Om(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),bq=pe("$ZodCheckEndsWith",(e,t)=>{Rs.init(e,t);const n=new RegExp(`.*${Om(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),vq=pe("$ZodCheckOverwrite",(e,t)=>{Rs.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Sq{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(` + )`}return N.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})}),KV=M.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:c}=fc(),l=c.useState("mounted"),f=c.useState("modal"),d=c.useState("open");return l||r?N.jsx(PM.Provider,{value:r,children:N.jsxs(X9,{ref:n,...i,children:[l&&f===!0&&N.jsx(ZV,{ref:c.context.internalBackdropRef,inert:GV(!d)}),t.children]})}):null});function jM(e){const t=M.useRef(!0);t.current&&(t.current=!1,e())}let UA={},jA={},HA="";function QV(e){if(typeof document>"u")return!1;const t=Kt(e);return Sn(t).innerWidth-t.documentElement.clientWidth>0}function YV(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Kt(e),r=n.documentElement,i=n.body,c=ra(r)?r:i,l=c.style.overflowY,f=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",c.style.overflowY="scroll";const d=c.offsetWidth;c.style.overflowY="hidden";const h=c.offsetWidth;return c.style.overflowY=l,r.style.scrollbarGutter=f,d===h}function XV(e){const t=Kt(e),n=t.documentElement,r=t.body,i=ra(n)?n:r,c={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,c)}}function WV(e){const t=Kt(e),n=t.documentElement,r=t.body,i=Sn(n);let c=0,l=0,f=!1;const d=Kr.create();if(zO&&(i.visualViewport?.scale??1)!==1)return()=>{};function h(){const v=i.getComputedStyle(n),_=i.getComputedStyle(r),R=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=n.scrollTop,l=n.scrollLeft,UA={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},HA=n.style.scrollBehavior,jA={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,I=n.scrollWidth>n.clientWidth,k=v.overflowY==="scroll"||_.overflowY==="scroll",T=v.overflowX==="scroll"||_.overflowX==="scroll",$=Math.max(0,i.innerWidth-r.clientWidth),j=Math.max(0,i.innerHeight-r.clientHeight),H=parseFloat(_.marginTop)+parseFloat(_.marginBottom),P=parseFloat(_.marginLeft)+parseFloat(_.marginRight),Q=ra(n)?n:r;if(f=YV(e),f){n.style.scrollbarGutter=R,Q.style.overflowY="hidden",Q.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(C||k)&&(n.style.overflowY="scroll"),(I||T)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:H||j?`calc(100dvh - ${H+j}px)`:"100dvh",width:P||$?`calc(100vw - ${P+$}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=c,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function b(){Object.assign(n.style,UA),Object.assign(r.style,jA),f||(n.scrollTop=c,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=HA)}function g(){b(),d.request(h)}return h(),i.addEventListener("resize",g),()=>{d.cancel(),b(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",g)}}class JV{lockCount=0;restore=null;timeoutLock=Jr.create();timeoutUnlock=Jr.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Kt(t).documentElement,i=Sn(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=hO;return}const c=BO||!QV(t);this.restore=c?XV(t):WV(t)}}const e7=new JV;function t7(e=!0,t=null){pt(()=>{if(e)return e7.acquire(t)},[e,t])}function n7(e){const t=M.useRef(""),n=M.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:M.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function s7(e){const[t,n]=M.useState(null),r=Fe((f,d)=>{e||n(d||(BO?"touch":""))}),i=M.useCallback(()=>{n(null)},[]),{onClick:c,onPointerDown:l}=n7(r);return M.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:c,onPointerDown:l}}),[t,i,c,l])}function r7(e){const{store:t,parentContext:n,actionsRef:r}=e,i=t.useState("open"),c=t.useState("disablePointerDismissal"),l=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:h,reset:b}=s7(i);AM(t);const{forceUnmount:g}=TM(i,t,()=>{b()}),v=Fe(ne=>{const te=Jt(ne);return te.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},te}),_=M.useCallback(()=>{t.setOpen(!1,v(rM))},[t,v]);M.useImperativeHandle(r,()=>({unmount:g,close:_}),[g,_]);const w=MM({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[E,R]=M.useState(0),C=E===0,I=PV(w),k=_M(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(ne){if(!t.context.outsidePressEnabledRef.current||"button"in ne&&ne.button!==0||"touches"in ne&&ne.touches.length!==1)return!1;const te=Ss(ne);if(C&&!c){const F=te;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===F||t.context.backdropRef.current===F||yt(F,f)&&!F?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});t7(i&&l===!0,f);const{getReferenceProps:T,getFloatingProps:$,getTriggerProps:j}=kM([I,k]);t.useContextCallback("onNestedDialogOpen",ne=>{R(ne+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),M.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(E),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,E]);const H=M.useMemo(()=>T(h),[T,h]),P=M.useMemo(()=>j(h),[j,h]),Q=M.useMemo(()=>$(),[$]);t.useSyncedValues({openMethod:d,activeTriggerProps:H,inactiveTriggerProps:P,popupProps:Q,floatingRootContext:w,nestedOpenDialogCount:E})}const o7={...OM,modal:ot(e=>e.modal),nested:ot(e=>e.nested),nestedOpenDialogCount:ot(e=>e.nestedOpenDialogCount),disablePointerDismissal:ot(e=>e.disablePointerDismissal),openMethod:ot(e=>e.openMethod),descriptionElementId:ot(e=>e.descriptionElementId),titleElementId:ot(e=>e.titleElementId),viewportElement:ot(e=>e.viewportElement),role:ot(e=>e.role)};class i7 extends pS{constructor(t){super(a7(t),{popupRef:M.createRef(),backdropRef:M.createRef(),internalBackdropRef:M.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Am,onOpenChange:void 0,onOpenChangeComplete:void 0},o7)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const i={open:t},c=n.trigger?.id??null;(c||t)&&(i.activeTriggerId=c,i.activeTriggerElement=n.trigger??null),this.update(i)}}function a7(e={}){return{...IM(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function c7(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:c,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:h,triggerId:b,defaultTriggerId:g=null}=e,v=fc(!0),_=!!v,w=Sr(()=>h?.store??new i7({open:r,openProp:n,activeTriggerId:g,triggerIdProp:b,modal:f,disablePointerDismissal:l,nested:_})).current;jM(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:g})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",b),w.useSyncedValues({disablePointerDismissal:l,nested:_,modal:f}),w.useContextCallback("onOpenChange",i),w.useContextCallback("onOpenChangeComplete",c);const E=w.useState("payload");r7({store:w,actionsRef:d,parentContext:v?.store.context});const R=M.useMemo(()=>({store:w}),[w]);return N.jsx(oM.Provider,{value:R,children:typeof t=="function"?t({payload:E}):t})}const l7=M.forwardRef(function(t,n){const{render:r,className:i,id:c,...l}=t,{store:f}=fc(),d=nS(c);return f.useSyncedValueWithCleanup("titleElementId",d),_r("h2",t,{ref:n,props:[{id:d},l]})});function u7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(c7,{"data-slot":"sheet",...n}),t[2]=n,t[3]=r):r=t[3],r}function f7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(KV,{"data-slot":"sheet-portal",...n}),t[2]=n,t[3]=r):r=t[3],r}function d7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-50 bg-black/80 duration-100 data-closed:animate-out data-open:animate-in data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx(B9,{className:i,"data-slot":"sheet-overlay",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function h7(e){const t=kt.c(17);let n,r,i,c,l;t[0]!==e?({className:r,children:n,side:c,showCloseButton:l,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5]);const f=c===void 0?"right":c,d=l===void 0?!0:l;let h;t[6]===Symbol.for("react.memo_cache_sentinel")?(h=N.jsx(d7,{}),t[6]=h):h=t[6];let b;t[7]!==r?(b=cn("data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col bg-background bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=top]:inset-x-0 data-[side=left]:inset-y-0 data-[side=right]:inset-y-0 data-[side=top]:top-0 data-[side=right]:right-0 data-[side=bottom]:bottom-0 data-[side=left]:left-0 data-[side=bottom]:h-auto data-[side=left]:h-full data-[side=right]:h-full data-[side=top]:h-auto data-[side=left]:w-3/4 data-[side=right]:w-3/4 data-closed:animate-out data-open:animate-in data-[side=bottom]:border-t data-[side=left]:border-r data-[side=top]:border-b data-[side=right]:border-l data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",r),t[7]=r,t[8]=b):b=t[8];let g;t[9]!==d?(g=d&&N.jsxs($9,{"data-slot":"sheet-close",render:N.jsx(Il,{className:"absolute top-4 right-4",size:"icon-sm",variant:"ghost"}),children:[N.jsx(R8,{}),N.jsx("span",{className:"sr-only",children:"Close"})]}),t[9]=d,t[10]=g):g=t[10];let v;return t[11]!==n||t[12]!==i||t[13]!==f||t[14]!==b||t[15]!==g?(v=N.jsxs(f7,{children:[h,N.jsxs(FV,{className:b,"data-side":f,"data-slot":"sheet-content",...i,children:[n,g]})]}),t[11]=n,t[12]=i,t[13]=f,t[14]=b,t[15]=g,t[16]=v):v=t[16],v}function p7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("flex flex-col gap-1.5 p-6",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-slot":"sheet-header",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function m7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("font-medium text-foreground text-sm",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx(l7,{className:i,"data-slot":"sheet-title",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function g7(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("text-muted-foreground text-xs/relaxed",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx(U9,{className:i,"data-slot":"sheet-description",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}const HM=M.createContext(void 0);function Wf(e){const t=M.useContext(HM);if(t===void 0&&!e)throw new Error(Vo(72));return t}const y7={...OM,disabled:ot(e=>e.disabled),instantType:ot(e=>e.instantType),isInstantPhase:ot(e=>e.isInstantPhase),trackCursorAxis:ot(e=>e.trackCursorAxis),disableHoverablePopup:ot(e=>e.disableHoverablePopup),lastOpenChangeReason:ot(e=>e.openChangeReason),closeDelay:ot(e=>e.closeDelay),hasViewport:ot(e=>e.hasViewport)};class yS extends pS{constructor(t){super({...b7(),...t},{popupRef:M.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Am},y7)}setOpen=(t,n)=>{const r=n.reason,i=r===Lr,c=t&&r===bp,l=!t&&(r===Fp||r===fS);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const f=()=>{const d={open:t,openChangeReason:r};c?d.instantType="focus":l?d.instantType="dismiss":r===Lr&&(d.instantType=void 0);const h=n.trigger?.id??null;(h||t)&&(d.activeTriggerId=h,d.activeTriggerElement=n.trigger??null),this.update(d)};i?na.flushSync(f):f()};static useStore(t,n){const r=Sr(()=>new yS(n)).current,i=t??r,c=MM({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=c,i}}function b7(){return{...IM(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const v7=RM(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:c=!1,trackCursorAxis:l="none",actionsRef:f,onOpenChange:d,onOpenChangeComplete:h,handle:b,triggerId:g,defaultTriggerId:v=null,children:_}=t,w=yS.useStore(b?.store,{open:r,openProp:i,activeTriggerId:v,triggerIdProp:g});jM(()=>{i===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:v})}),w.useControlledProp("openProp",i),w.useControlledProp("triggerIdProp",g),w.useContextCallback("onOpenChange",d),w.useContextCallback("onOpenChangeComplete",h);const E=w.useState("open"),R=!n&&E,C=w.useState("activeTriggerId"),I=w.useState("payload");w.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:c}),pt(()=>{E&&n&&w.setOpen(!1,Jt(O9))},[E,n,w]),w.useSyncedValue("disabled",n),AM(w);const{forceUnmount:k,transitionStatus:T}=TM(R,w),$=w.useState("isInstantPhase"),j=w.useState("instantType"),H=w.useState("lastOpenChangeReason"),P=M.useRef(null);pt(()=>{T==="ending"&&H===uS||T!=="ending"&&$?(j!=="delay"&&(P.current=j),w.set("instantType","delay")):P.current!==null&&(w.set("instantType",P.current),P.current=null)},[T,$,H,j,w]),pt(()=>{R&&C==null&&w.set("payload",void 0)},[w,C,R]);const Q=M.useCallback(()=>{w.setOpen(!1,S7(w,rM))},[w]);M.useImperativeHandle(f,()=>({unmount:k,close:Q}),[k,Q]);const ne=w.useState("floatingRootContext"),te=_M(ne,{enabled:!n,referencePress:!0}),F=rH(ne,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:oe,getFloatingProps:me,getTriggerProps:ge}=kM([te,F]),V=M.useMemo(()=>oe(),[oe]),re=M.useMemo(()=>ge(),[ge]),J=M.useMemo(()=>me(),[me]);return w.useSyncedValues({activeTriggerProps:V,inactiveTriggerProps:re,popupProps:J}),N.jsx(HM.Provider,{value:w,children:typeof _=="function"?_({payload:I}):_})});function S7(e,t){const n=Jt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const VM=M.createContext(void 0);function _7(){return M.useContext(VM)}let w7=(function(e){return e[e.popupOpen=Gp.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const E7=600,x7=fV(function(t,n){const{className:r,render:i,handle:c,payload:l,disabled:f,delay:d,closeDelay:h,id:b,...g}=t,v=Wf(!0),_=c?.store??v;if(!_)throw new Error(Vo(82));const w=nS(b),E=_.useState("isTriggerActive",w),R=_.useState("isOpenedByTrigger",w),C=_.useState("floatingRootContext"),I=M.useRef(null),k=d??E7,T=h??0,{registerTrigger:$,isMountedByThisTrigger:j}=_V(w,I,_,{payload:l,closeDelay:T}),H=_7(),{delayRef:P,isInstantPhase:Q,hasProvider:ne}=G9(C,{open:R});_.useSyncedValue("isInstantPhase",Q);const te=_.useState("disabled"),F=f??te,oe=_.useState("trackCursorAxis"),me=_.useState("disableHoverablePopup"),ge=DV(C,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!me&&oe!=="both"?LV():null,restMs(){const ue=H?.delay,z=typeof P.current=="object"?P.current.open:void 0;let ee=k;return ne&&(z!==0?ee=d??ue??k:ee=0),ee},delay(){const ue=typeof P.current=="object"?P.current.close:void 0;let z=T;return h==null&&ne&&(z=ue),{close:z}},triggerElementRef:I,isActiveTrigger:E}),V=RV(C,{enabled:!F}).reference,re={open:R},J=_.useState("triggerProps",j);return _r("button",t,{state:re,ref:[n,$,I],props:[ge,V,J,{id:w,[w7.triggerDisabled]:F?"":void 0},g],stateAttributesMapping:L9})}),qM=M.createContext(void 0);function R7(){const e=M.useContext(qM);if(e===void 0)throw new Error(Vo(70));return e}const C7=M.forwardRef(function(t,n){const{children:r,container:i,className:c,render:l,...f}=t,{portalNode:d,portalSubtree:h}=dM({container:i,ref:n,componentProps:t,elementProps:f});return!h&&!d?null:N.jsxs(M.Fragment,{children:[h,d&&na.createPortal(r,d)]})}),A7=M.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Wf().useState("mounted")||r?N.jsx(qM.Provider,{value:r,children:N.jsx(C7,{ref:n,...i})}):null}),FM=M.createContext(void 0);function GM(){const e=M.useContext(FM);if(e===void 0)throw new Error(Vo(71));return e}const T7=M.createContext(void 0);function I7(){return M.useContext(T7)?.direction??"ltr"}const O7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:c,platform:l,elements:f,middlewareData:d}=t,{element:h,padding:b=0,offsetParent:g="real"}=Uo(e,t)||{};if(h==null)return{};const v=qO(b),_={x:n,y:r},w=aS(i),E=iS(w),R=await l.getDimensions(h),C=w==="y",I=C?"top":"left",k=C?"bottom":"right",T=C?"clientHeight":"clientWidth",$=c.reference[E]+c.reference[w]-_[w]-c.floating[E],j=_[w]-c.reference[w],H=g==="real"?await l.getOffsetParent?.(h):f.floating;let P=f.floating[T]||c.floating[E];(!P||!await l.isElement?.(H))&&(P=f.floating[T]||c.floating[E]);const Q=$/2-j/2,ne=P/2-R[E]/2-1,te=Math.min(v[I],ne),F=Math.min(v[k],ne),oe=te,me=P-R[E]-F,ge=P/2-R[E]/2+Q,V=lv(oe,ge,me),re=!d.arrow&&ia(i)!=null&&ge!==V&&c.reference[E]/2-(ge({...O7(e),options:[e,t]}),D7={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,c=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await FH().fn(e)).data?.referenceHidden||c}}}},_p={sideX:"left",sideY:"top"},k7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:c,strategy:l,placement:f}=e,d=Sn(i),h=d.getComputedStyle(i);if(!(h.transitionDuration!=="0s"&&h.transitionDuration!==""))return{x:t,y:n,data:_p};const g=await c.getOffsetParent?.(i);let v={width:0,height:0};if(l==="fixed"&&d?.visualViewport)v={width:d.visualViewport.width,height:d.visualViewport.height};else if(g===d){const I=Kt(i);v={width:I.documentElement.clientWidth,height:I.documentElement.clientHeight}}else await c.isElement?.(g)&&(v=await c.getDimensions(g));const _=Es(f);let w=t,E=n;_==="left"&&(w=v.width-(t+r.width)),_==="top"&&(E=v.height-(n+r.height));const R=_==="left"?"right":_p.sideX,C=_==="top"?"bottom":_p.sideY;return{x:w,y:E,data:{sideX:R,sideY:C}}}};function ZM(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function VA(e,t,n){const{rects:r,placement:i}=e;return{side:ZM(t,Es(i),n),align:ia(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function P7(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:c="center",alignOffset:l=0,collisionBoundary:f,collisionPadding:d=5,sticky:h=!1,arrowPadding:b=5,disableAnchorTracking:g=!1,keepMounted:v=!1,floatingRootContext:_,mounted:w,collisionAvoidance:E,shiftCrossAxis:R=!1,nodeId:C,adaptiveOrigin:I,lazyFlip:k=!1,externalTree:T}=e,[$,j]=M.useState(null);!w&&$!==null&&j(null);const H=E.side||"flip",P=E.align||"flip",Q=E.fallbackAxisSide||"end",ne=typeof t=="function"?t:void 0,te=Fe(ne),F=ne?te:t,oe=Qr(t),ge=I7()==="rtl",V=$||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ge?"left":"right","inline-start":ge?"right":"left"}[r],re=c==="center"?V:`${V}-${c}`;let J=d;const be=1,ue=r==="bottom"?be:0,z=r==="top"?be:0,ee=r==="right"?be:0,ye=r==="left"?be:0;typeof J=="number"?J={top:J+ue,right:J+ye,bottom:J+z,left:J+ee}:J&&(J={top:(J.top||0)+ue,right:(J.right||0)+ye,bottom:(J.bottom||0)+z,left:(J.left||0)+ee});const we={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:J},Ee=M.useRef(null),Se=Qr(i),Ie=Qr(l),Je=[UH(qt=>{const Kn=VA(qt,r,ge),Js=typeof Se.current=="function"?Se.current(Kn):Se.current,Nn=typeof Ie.current=="function"?Ie.current(Kn):Ie.current;return{mainAxis:Js,crossAxis:Nn,alignmentAxis:Nn}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ge,r])],wt=P==="none"&&H!=="shift",pe=!wt&&(h||R||H==="shift"),xe=H==="none"?null:VH({...we,padding:{top:J.top+be,right:J.right+be,bottom:J.bottom+be,left:J.left+be},mainAxis:!R&&H==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:Q}),_e=wt?null:jH(qt=>{const Kn=Kt(qt.elements.floating).documentElement;return{...we,rootBoundary:R?{x:0,y:0,width:Kn.clientWidth,height:Kn.clientHeight}:void 0,mainAxis:P!=="none",crossAxis:pe,limiter:h||R?void 0:HH(Js=>{if(!Ee.current)return{};const{width:Nn,height:ds}=Ee.current.getBoundingClientRect(),co=vr(Es(Js.placement)),er=co==="y"?Nn:ds,fi=co==="y"?J.left+J.right:J.top+J.bottom;return{offset:er/2+fi/2}})}},[we,h,R,J,P]);H==="shift"||P==="shift"||c==="center"?Je.push(_e,xe):Je.push(xe,_e),Je.push(qH({...we,apply({elements:{floating:qt},rects:{reference:Kn},availableWidth:Js,availableHeight:Nn}){const ds=qt.style;ds.setProperty("--available-width",`${Js}px`),ds.setProperty("--available-height",`${Nn}px`),ds.setProperty("--anchor-width",`${Kn.width}px`),ds.setProperty("--anchor-height",`${Kn.height}px`)}}),M7(()=>({element:Ee.current||document.createElement("div"),padding:b,offsetParent:"floating"}),[b]),{name:"transformOrigin",fn(qt){const{elements:Kn,middlewareData:Js,placement:Nn,rects:ds,y:co}=qt,er=Es(Nn),fi=vr(er),di=Ee.current,Sg=Js.arrow?.x||0,Cd=Js.arrow?.y||0,au=di?.clientWidth||0,Ra=di?.clientHeight||0,cu=Sg+au/2,lu=Cd+Ra/2,Ad=Math.abs(Js.shift?.y||0),Td=ds.reference.height/2,lo=typeof i=="function"?i(VA(qt,r,ge)):i,uu=Ad>lo,Id={top:`${cu}px calc(100% + ${lo}px)`,bottom:`${cu}px ${-lo}px`,left:`calc(100% + ${lo}px) ${lu}px`,right:`${-lo}px ${lu}px`}[er],Od=`${cu}px ${ds.reference.y+Td-co}px`;return Kn.floating.style.setProperty("--transform-origin",pe&&fi==="y"&&uu?Od:Id),{}}},D7,I),pt(()=>{!w&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,_]);const Ge=M.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:Oe,elements:He,x:Me,y:ft,middlewareData:mt,update:Xe,placement:Pt,context:wn,isPositioned:It,floatingStyles:Xs}=xV({rootContext:_,placement:re,middleware:Je,strategy:n,whileElementsMounted:v?void 0:(...qt)=>PA(...qt,Ge),nodeId:C,externalTree:T}),{sideX:dt,sideY:$t}=mt.adaptiveOrigin||_p,gt=It?n:"fixed",Os=M.useMemo(()=>{const qt=I?{position:gt,[dt]:Me,[$t]:ft}:{position:gt,...Xs};return It||(qt.opacity=0),qt},[I,gt,dt,Me,$t,ft,Xs,It]),Ws=M.useRef(null);pt(()=>{if(!w)return;const qt=oe.current,Kn=typeof qt=="function"?qt():qt,Nn=(qA(Kn)?Kn.current:Kn)||null||null;Nn!==Ws.current&&(Oe.setPositionReference(Nn),Ws.current=Nn)},[w,Oe,F,oe]),M.useEffect(()=>{if(!w)return;const qt=oe.current;typeof qt!="function"&&qA(qt)&&qt.current!==Ws.current&&(Oe.setPositionReference(qt.current),Ws.current=qt.current)},[w,Oe,F,oe]),M.useEffect(()=>{if(v&&w&&He.domReference&&He.floating)return PA(He.domReference,He.floating,Xe,Ge)},[v,w,He,Xe,Ge]);const ao=Es(Pt),Rd=ZM(r,ao,ge),ui=ia(Pt)||"center",Gn=!!mt.hide?.referenceHidden;pt(()=>{k&&w&&It&&j(ao)},[k,w,It,ao]);const Ir=M.useMemo(()=>({position:"absolute",top:mt.arrow?.y,left:mt.arrow?.x}),[mt.arrow]),Zn=mt.arrow?.centerOffset!==0;return M.useMemo(()=>({positionerStyles:Os,arrowStyles:Ir,arrowRef:Ee,arrowUncentered:Zn,side:Rd,align:ui,physicalSide:ao,anchorHidden:Gn,refs:Oe,context:wn,isPositioned:It,update:Xe}),[Os,Ir,Ee,Zn,Rd,ui,ao,Gn,Oe,wn,It,Xe])}function qA(e){return e!=null&&"current"in e}function KM(e){return e==="starting"?U5:Hs}const N7=M.forwardRef(function(t,n){const{render:r,className:i,anchor:c,positionMethod:l="absolute",side:f="top",align:d="center",sideOffset:h=0,alignOffset:b=0,collisionBoundary:g="clipping-ancestors",collisionPadding:v=5,arrowPadding:_=5,sticky:w=!1,disableAnchorTracking:E=!1,collisionAvoidance:R=H5,...C}=t,I=Wf(),k=R7(),T=I.useState("open"),$=I.useState("mounted"),j=I.useState("trackCursorAxis"),H=I.useState("disableHoverablePopup"),P=I.useState("floatingRootContext"),Q=I.useState("instantType"),ne=I.useState("transitionStatus"),te=I.useState("hasViewport"),F=P7({anchor:c,positionMethod:l,floatingRootContext:P,mounted:$,side:f,sideOffset:h,align:d,alignOffset:b,collisionBoundary:g,collisionPadding:v,sticky:w,arrowPadding:_,disableAnchorTracking:E,keepMounted:k,collisionAvoidance:R,adaptiveOrigin:te?k7:void 0}),oe=M.useMemo(()=>{const re={};return(!T||j==="both"||H)&&(re.pointerEvents="none"),{role:"presentation",hidden:!$,style:{...F.positionerStyles,...re}}},[T,j,H,$,F.positionerStyles]),me=M.useMemo(()=>({open:T,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:j!=="none"?"tracking-cursor":Q}),[T,F.side,F.align,F.anchorHidden,j,Q]),ge=M.useMemo(()=>({...me,arrowRef:F.arrowRef,arrowStyles:F.arrowStyles,arrowUncentered:F.arrowUncentered}),[me,F.arrowRef,F.arrowStyles,F.arrowUncentered]),V=_r("div",t,{state:me,props:[oe,KM(ne),C],ref:[n,I.useStateSetter("positionerElement")],stateAttributesMapping:Yf});return N.jsx(FM.Provider,{value:ge,children:V})}),L7={...Yf,...cS},z7=M.forwardRef(function(t,n){const{className:r,render:i,...c}=t,l=Wf(),{side:f,align:d}=GM(),h=l.useState("open"),b=l.useState("instantType"),g=l.useState("transitionStatus"),v=l.useState("popupProps"),_=l.useState("floatingRootContext");lS({open:h,ref:l.context.popupRef,onComplete(){h&&l.context.onOpenChangeComplete?.(!0)}});const w=l.useState("disabled"),E=l.useState("closeDelay");return IV(_,{enabled:!w,closeDelay:E}),_r("div",t,{state:{open:h,side:f,align:d,instant:b,transitionStatus:g},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[v,KM(g),c],stateAttributesMapping:L7})}),B7=M.forwardRef(function(t,n){const{className:r,render:i,...c}=t,f=Wf().useState("instantType"),{open:d,arrowRef:h,side:b,align:g,arrowUncentered:v,arrowStyles:_}=GM();return _r("div",t,{state:{open:d,side:b,align:g,uncentered:v,instant:f},ref:[n,h],props:[{style:_,"aria-hidden":!0},c],stateAttributesMapping:Yf})}),$7=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,c=M.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=M.useMemo(()=>({open:n,close:r}),[n,r]);return N.jsx(VM.Provider,{value:c,children:N.jsx(F9,{delay:l,timeoutMs:i,children:t.children})})};function U7(e){const t=kt.c(6);let n,r;t[0]!==e?({delay:r,...n}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);const i=r===void 0?0:r;let c;return t[3]!==i||t[4]!==n?(c=N.jsx($7,{"data-slot":"tooltip-provider",delay:i,...n}),t[3]=i,t[4]=n,t[5]=c):c=t[5],c}function j7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(U7,{children:N.jsx(v7,{"data-slot":"tooltip",...n})}),t[2]=n,t[3]=r):r=t[3],r}function H7(e){const t=kt.c(4);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=N.jsx(x7,{"data-slot":"tooltip-trigger",...n}),t[2]=n,t[3]=r):r=t[3],r}function V7(e){const t=kt.c(21);let n,r,i,c,l,f,d;t[0]!==e?({className:r,side:c,sideOffset:l,align:f,alignOffset:d,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l,t[6]=f,t[7]=d):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5],f=t[6],d=t[7]);const h=c===void 0?"top":c,b=l===void 0?4:l,g=f===void 0?"center":f,v=d===void 0?0:d;let _;t[8]!==r?(_=cn("data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:fade-out-0 data-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 max-w-xs origin-(--transform-origin) rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=delayed-open]:animate-in data-closed:animate-out data-open:animate-in **:data-[slot=kbd]:rounded-md",r),t[8]=r,t[9]=_):_=t[9];let w;t[10]===Symbol.for("react.memo_cache_sentinel")?(w=N.jsx(B7,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=right]:top-1/2! data-[side=left]:-right-1 data-[side=top]:-bottom-2.5 data-[side=right]:-left-1 data-[side=left]:-translate-y-1/2 data-[side=right]:-translate-y-1/2"}),t[10]=w):w=t[10];let E;t[11]!==n||t[12]!==i||t[13]!==_?(E=N.jsxs(z7,{className:_,"data-slot":"tooltip-content",...i,children:[n,w]}),t[11]=n,t[12]=i,t[13]=_,t[14]=E):E=t[14];let R;return t[15]!==g||t[16]!==v||t[17]!==h||t[18]!==b||t[19]!==E?(R=N.jsx(A7,{children:N.jsx(N7,{align:g,alignOffset:v,className:"isolate z-50",side:h,sideOffset:b,children:E})}),t[15]=g,t[16]=v,t[17]=h,t[18]=b,t[19]=E,t[20]=R):R=t[20],R}const q7=768,QM=`(max-width: ${q7-1}px)`;function F7(e){const t=window.matchMedia(QM);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function G7(){return window.matchMedia(QM).matches}function Z7(){return M.useSyncExternalStore(F7,G7)}const K7="sidebar_state",Q7=3600*24*7,Y7="12rem",X7="16rem",W7="3rem",J7="b",YM=M.createContext(null);function Tm(){const e=M.useContext(YM);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function eq(e){const t=kt.c(36);let n,r,i,c,l,f,d;t[0]!==e?({defaultOpen:d,open:i,onOpenChange:l,className:r,style:f,children:n,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l,t[6]=f,t[7]=d):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5],f=t[6],d=t[7]);const h=d===void 0?!0:d,b=Z7(),[g,v]=M.useState(!1),[_,w]=M.useState(h),E=i??_;let R;t[8]!==E||t[9]!==l?(R=me=>{const ge=typeof me=="function"?me(E):me;l?l(ge):w(ge),document.cookie=`${K7}=${ge}; path=/; max-age=${Q7}`},t[8]=E,t[9]=l,t[10]=R):R=t[10];const C=R;let I;t[11]!==b||t[12]!==C?(I=()=>b?v(nq):C(tq),t[11]=b,t[12]=C,t[13]=I):I=t[13];const k=I;let T,$;t[14]!==k?(T=()=>{const me=ge=>{ge.key===J7&&(ge.metaKey||ge.ctrlKey)&&(ge.preventDefault(),k())};return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},$=[k],t[14]=k,t[15]=T,t[16]=$):(T=t[15],$=t[16]),M.useEffect(T,$);const j=E?"expanded":"collapsed";let H;t[17]!==b||t[18]!==E||t[19]!==g||t[20]!==C||t[21]!==j||t[22]!==k?(H={state:j,open:E,setOpen:C,isMobile:b,openMobile:g,setOpenMobile:v,toggleSidebar:k},t[17]=b,t[18]=E,t[19]=g,t[20]=C,t[21]=j,t[22]=k,t[23]=H):H=t[23];const P=H;let Q;t[24]!==r?(Q=cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),t[24]=r,t[25]=Q):Q=t[25];let ne;t[26]!==f?(ne={"--sidebar-width":Y7,"--sidebar-width-icon":W7,...f},t[26]=f,t[27]=ne):ne=t[27];const te=ne;let F;t[28]!==n||t[29]!==c||t[30]!==Q||t[31]!==te?(F=N.jsx("div",{className:Q,"data-slot":"sidebar-wrapper",style:te,...c,children:n}),t[28]=n,t[29]=c,t[30]=Q,t[31]=te,t[32]=F):F=t[32];let oe;return t[33]!==P||t[34]!==F?(oe=N.jsx(YM.Provider,{value:P,children:F}),t[33]=P,t[34]=F,t[35]=oe):oe=t[35],oe}function tq(e){return!e}function nq(e){return!e}function sq(e){const t=kt.c(46);let n,r,i,c,l,f;t[0]!==e?({side:c,variant:l,collapsible:f,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c,t[5]=l,t[6]=f):(n=t[1],r=t[2],i=t[3],c=t[4],l=t[5],f=t[6]);const d=c===void 0?"left":c,h=l===void 0?"sidebar":l,b=f===void 0?"offExamples":f,{isMobile:g,state:v,openMobile:_,setOpenMobile:w}=Tm();if(b==="none"){let Q;t[7]!==r?(Q=cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),t[7]=r,t[8]=Q):Q=t[8];let ne;return t[9]!==n||t[10]!==i||t[11]!==Q?(ne=N.jsx("div",{className:Q,"data-slot":"sidebar",...i,children:n}),t[9]=n,t[10]=i,t[11]=Q,t[12]=ne):ne=t[12],ne}if(g){let Q;t[13]===Symbol.for("react.memo_cache_sentinel")?(Q={"--sidebar-width":X7},t[13]=Q):Q=t[13];let ne;t[14]===Symbol.for("react.memo_cache_sentinel")?(ne=N.jsxs(p7,{className:"sr-only",children:[N.jsx(m7,{children:"Sidebar"}),N.jsx(g7,{children:"Displays the mobile sidebar."})]}),t[14]=ne):ne=t[14];let te;t[15]!==n?(te=N.jsx("div",{className:"flex h-full w-full flex-col",children:n}),t[15]=n,t[16]=te):te=t[16];let F;t[17]!==d||t[18]!==te?(F=N.jsxs(h7,{className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar","data-slot":"sidebar",side:d,style:Q,children:[ne,te]}),t[17]=d,t[18]=te,t[19]=F):F=t[19];let oe;return t[20]!==_||t[21]!==i||t[22]!==w||t[23]!==F?(oe=N.jsx(u7,{onOpenChange:w,open:_,...i,children:F}),t[20]=_,t[21]=i,t[22]=w,t[23]=F,t[24]=oe):oe=t[24],oe}const E=v==="collapsed"?b:"",R=h==="floating"||h==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let C;t[25]!==R?(C=cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offExamples]:w-0","group-data-[side=right]:rotate-180",R),t[25]=R,t[26]=C):C=t[26];let I;t[27]!==C?(I=N.jsx("div",{className:C,"data-slot":"sidebar-gap"}),t[27]=C,t[28]=I):I=t[28];const k=d==="left"?"left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]",T=h==="floating"||h==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let $;t[29]!==r||t[30]!==k||t[31]!==T?($=cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",k,T,r),t[29]=r,t[30]=k,t[31]=T,t[32]=$):$=t[32];let j;t[33]!==n?(j=N.jsx("div",{className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border","data-sidebar":"sidebar","data-slot":"sidebar-inner",children:n}),t[33]=n,t[34]=j):j=t[34];let H;t[35]!==i||t[36]!==$||t[37]!==j?(H=N.jsx("div",{className:$,"data-slot":"sidebar-container",...i,children:j}),t[35]=i,t[36]=$,t[37]=j,t[38]=H):H=t[38];let P;return t[39]!==d||t[40]!==v||t[41]!==H||t[42]!==E||t[43]!==I||t[44]!==h?(P=N.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":E,"data-side":d,"data-slot":"sidebar","data-state":v,"data-variant":h,children:[I,H]}),t[39]=d,t[40]=v,t[41]=H,t[42]=E,t[43]=I,t[44]=h,t[45]=P):P=t[45],P}function rq(e){const t=kt.c(15);let n,r,i;t[0]!==e?({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]);const{toggleSidebar:c}=Tm();let l;t[4]!==n?(l=cn(n),t[4]=n,t[5]=l):l=t[5];let f;t[6]!==r||t[7]!==c?(f=g=>{r?.(g),c()},t[6]=r,t[7]=c,t[8]=f):f=t[8];let d,h;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=N.jsx(S8,{}),h=N.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),t[9]=d,t[10]=h):(d=t[9],h=t[10]);let b;return t[11]!==i||t[12]!==l||t[13]!==f?(b=N.jsxs(Il,{className:l,"data-sidebar":"trigger","data-slot":"sidebar-trigger",onClick:f,size:"icon-lg",variant:"ghost",...i,children:[d,h]}),t[11]=i,t[12]=l,t[13]=f,t[14]=b):b=t[14],b}function oq(e){const t=kt.c(9);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);const{toggleSidebar:i}=Tm();let c;t[3]!==n?(c=cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offExamples]:translate-x-0 hover:group-data-[collapsible=offExamples]:bg-sidebar group-data-[collapsible=offExamples]:after:left-full","[[data-side=left][data-collapsible=offExamples]_&]:-right-2","[[data-side=right][data-collapsible=offExamples]_&]:-left-2",n),t[3]=n,t[4]=c):c=t[4];let l;return t[5]!==r||t[6]!==c||t[7]!==i?(l=N.jsx("button",{"aria-label":"Toggle Sidebar",className:c,"data-sidebar":"rail","data-slot":"sidebar-rail",onClick:i,tabIndex:-1,title:"Toggle Sidebar",...r}),t[5]=r,t[6]=c,t[7]=i,t[8]=l):l=t[8],l}function iq(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("flex flex-col gap-2 p-2",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-sidebar":"footer","data-slot":"sidebar-footer",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function aq(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-sidebar":"content","data-slot":"sidebar-content",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function sp(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("relative flex w-full min-w-0 flex-col px-2 py-1",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("div",{className:i,"data-sidebar":"group","data-slot":"sidebar-group",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function rp(e){const t=kt.c(10);let n,r,i,c;if(t[0]!==e){const{className:d,render:h,...b}=e;n=h,c=pO,r="div",i=vm({className:cn("flex h-8 shrink-0 items-center rounded-md px-2 text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 [&>svg]:size-4 [&>svg]:shrink-0",d)},b),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c}else n=t[1],r=t[2],i=t[3],c=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},t[5]=l):l=t[5];let f;return t[6]!==n||t[7]!==r||t[8]!==i?(f={defaultTagName:r,props:i,render:n,state:l},t[6]=n,t[7]=r,t[8]=i,t[9]=f):f=t[9],c(f)}function lf(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("flex w-full min-w-0 flex-col gap-px",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("ul",{className:i,"data-sidebar":"menu","data-slot":"sidebar-menu",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}function Hr(e){const t=kt.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=cn("group/menu-item relative",n),t[3]=n,t[4]=i):i=t[4];let c;return t[5]!==r||t[6]!==i?(c=N.jsx("li",{className:i,"data-sidebar":"menu-item","data-slot":"sidebar-menu-item",...r}),t[5]=r,t[6]=i,t[7]=c):c=t[7],c}const cq=yO("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Vr(e){const t=kt.c(15);let{render:n,isActive:r,variant:i,size:c,tooltip:l,className:f,...d}=e;const h=r===void 0?!1:r,b=i===void 0?"default":i,g=c===void 0?"default":c,{isMobile:v,state:_}=Tm(),w="button",E=vm({className:cn(cq({variant:b,size:g}),f)},d),R=l?H7:n;let C;t[0]!==h||t[1]!==g?(C={slot:"sidebar-menu-button",sidebar:"menu-button",size:g,active:h},t[0]=h,t[1]=g,t[2]=C):C=t[2];let I;t[3]!==E||t[4]!==R||t[5]!==C?(I={defaultTagName:w,props:E,render:R,state:C},t[3]=E,t[4]=R,t[5]=C,t[6]=I):I=t[6];const k=pO(I);if(!l)return k;if(typeof l=="string"){let H;t[7]!==l?(H={children:l},t[7]=l,t[8]=H):H=t[8],l=H}const T=_!=="collapsed"||v;let $;t[9]!==T||t[10]!==l?($=N.jsx(V7,{align:"center",hidden:T,side:"right",...l}),t[9]=T,t[10]=l,t[11]=$):$=t[11];let j;return t[12]!==k||t[13]!==$?(j=N.jsxs(j7,{children:[k,$]}),t[12]=k,t[13]=$,t[14]=j):j=t[14],j}function lq(){const e=kt.c(8),{theme:t,setTheme:n}=A5();let r;e[0]!==n||e[1]!==t?(r=()=>{n(t==="light"?"dark":t==="dark"?"light":"dark")},e[0]=n,e[1]=t,e[2]=r):r=e[2];const i=r;let c,l,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=N.jsx(E8,{className:"size-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l=N.jsx(g8,{className:"absolute size-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),f=N.jsx("span",{className:"sr-only",children:"Toggle theme"}),e[3]=c,e[4]=l,e[5]=f):(c=e[3],l=e[4],f=e[5]);let d;return e[6]!==i?(d=N.jsxs(Il,{className:"rounded-full",onClick:i,size:"icon-sm",variant:"ghost",children:[c,l,f]}),e[6]=i,e[7]=d):d=e[7],d}function XM(){const e=kt.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=cn("z-50 flex h-10 shrink-0 items-center gap-2 border-sidebar-border border-b bg-sidebar px-4 text-sidebar-foreground","sticky top-0"),n=N.jsx(rq,{className:"-ml-1"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=N.jsxs("header",{className:t,children:[n,N.jsx("div",{className:"flex w-full justify-end",children:N.jsx(lq,{})})]}),e[2]=r):r=e[2],r}function uq(){const e=kt.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=N.jsx("h1",{className:"font-bold text-4xl",children:"404"}),n=N.jsx("p",{className:"text-muted-foreground",children:"Page not found"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=N.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4",children:[t,n,N.jsx($s,{to:"/",children:N.jsx(Il,{variant:"outline",children:"Go back home"})})]}),e[2]=r):r=e[2],r}function de(e,t,n){function r(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const h=l.prototype,b=Object.keys(h);for(let g=0;gn?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class wl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class WM extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const JM={};function oc(e){return JM}function eD(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function gv(e,t){return typeof t=="bigint"?t.toString():t}function bS(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vS(e){return e==null}function SS(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function fq(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const c=n>i?n:i,l=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return l%f/10**c}const FA=Symbol("evaluating");function Dt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==FA)return r===void 0&&(r=FA,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function dc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function aa(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function GA(e){return JSON.stringify(e)}function dq(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const tD="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const hq=bS(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Nf(e){if(Yp(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Yp(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function nD(e){return Nf(e)?{...e}:Array.isArray(e)?[...e]:e}const pq=new Set(["string","number","symbol"]);function Im(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ca(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ue(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function mq(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const gq={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function yq(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=aa(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return dc(this,"shape",l),l},checks:[]});return ca(e,c)}function bq(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=aa(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return dc(this,"shape",l),l},checks:[]});return ca(e,c)}function vq(e,t){if(!Nf(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const c=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(c,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=aa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return dc(this,"shape",c),c}});return ca(e,i)}function Sq(e,t){if(!Nf(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=aa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return dc(this,"shape",r),r}});return ca(e,n)}function _q(e,t){const n=aa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return dc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ca(e,n)}function wq(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=aa(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)d[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return dc(this,"shape",d),d},checks:[]});return ca(t,l)}function Eq(e,t,n){const r=aa(t._zod.def,{get shape(){const i=t._zod.def.shape,c={...i};if(n)for(const l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)c[l]=new e({type:"nonoptional",innerType:i[l]});return dc(this,"shape",c),c}});return ca(t,r)}function gl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function op(e){return typeof e=="string"?e:e?.message}function ic(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=op(e.inst?._zod.def?.error?.(e))??op(t?.error?.(e))??op(n.customError?.(e))??op(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function _S(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Lf(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const rD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oD=de("$ZodError",rD),Om=de("$ZodError",rD,{Parent:Error});function xq(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Rq(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>r({issues:l}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)n._errors.push(t(c));else{let l=n,f=0;for(;f(t,n,r,i)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise)throw new wl;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ic(d,c,oc())));throw tD(f,i?.callee),f}return l.value},jRe=Mm(Om),Dm=e=>async(t,n,r,i)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ic(d,c,oc())));throw tD(f,i?.callee),f}return l.value},HRe=Dm(Om),km=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise)throw new wl;return c.issues.length?{success:!1,error:new(e??oD)(c.issues.map(l=>ic(l,i,oc())))}:{success:!0,data:c.value}},Cq=km(Om),Pm=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},i);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(l=>ic(l,i,oc())))}:{success:!0,data:c.value}},Aq=Pm(Om),Tq=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Mm(e)(t,n,i)},Iq=e=>(t,n,r)=>Mm(e)(t,n,r),Oq=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dm(e)(t,n,i)},Mq=e=>async(t,n,r)=>Dm(e)(t,n,r),Dq=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return km(e)(t,n,i)},kq=e=>(t,n,r)=>km(e)(t,n,r),Pq=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Pm(e)(t,n,i)},Nq=e=>async(t,n,r)=>Pm(e)(t,n,r),Lq=/^[cC][^\s-]{8,}$/,zq=/^[0-9a-z]+$/,Bq=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$q=/^[0-9a-vA-V]{20}$/,Uq=/^[A-Za-z0-9]{27}$/,jq=/^[a-zA-Z0-9_-]{21}$/,Hq=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vq=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ZA=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qq=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Gq(){return new RegExp(Fq,"u")}const Zq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kq=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qq=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yq=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xq=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iD=/^[A-Za-z0-9_-]*$/,Wq=/^\+[1-9]\d{6,14}$/,aD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Jq=new RegExp(`^${aD}$`);function cD(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eF(e){return new RegExp(`^${cD(e)}$`)}function tF(e){const t=cD({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${aD}T(?:${r})$`)}const nF=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sF=/^-?\d+$/,rF=/^-?\d+(?:\.\d+)?$/,oF=/^(?:true|false)$/i,iF=/^[^A-Z]*$/,aF=/^[^a-z]*$/,Rs=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),lD={number:"number",bigint:"bigint",object:"date"},uD=de("$ZodCheckLessThan",(e,t)=>{Rs.init(e,t);const n=lD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,c=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?r.value<=t.value:r.value{Rs.init(e,t);const n=lD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,c=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cF=de("$ZodCheckMultipleOf",(e,t)=>{Rs.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):fq(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),lF=de("$ZodCheckNumberFormat",(e,t)=>{Rs.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,c]=gq[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=i,f.maximum=c,n&&(f.pattern=sF)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}fc&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),uF=de("$ZodCheckMaxLength",(e,t)=>{var n;Rs.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!vS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const i=r.value;if(i.length<=t.maximum)return;const l=_S(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),fF=de("$ZodCheckMinLength",(e,t)=>{var n;Rs.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!vS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=_S(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),dF=de("$ZodCheckLengthEquals",(e,t)=>{var n;Rs.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!vS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,c=i.length;if(c===t.length)return;const l=_S(i),f=c>t.length;r.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Nm=de("$ZodCheckStringFormat",(e,t)=>{var n,r;Rs.init(e,t),e._zod.onattach.push(i=>{const c=i._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),hF=de("$ZodCheckRegex",(e,t)=>{Nm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pF=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iF),Nm.init(e,t)}),mF=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=aF),Nm.init(e,t)}),gF=de("$ZodCheckIncludes",(e,t)=>{Rs.init(e,t);const n=Im(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const c=i._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),yF=de("$ZodCheckStartsWith",(e,t)=>{Rs.init(e,t);const n=new RegExp(`^${Im(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),bF=de("$ZodCheckEndsWith",(e,t)=>{Rs.init(e,t);const n=new RegExp(`.*${Im(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),vF=de("$ZodCheckOverwrite",(e,t)=>{Rs.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class SF{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(` `).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),c=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of c)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,i.join(` -`))}}const _q={major:4,minor:3,patch:6},un=pe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_q;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const c of i._zod.onattach)c(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,f,d)=>{let p=ml(l),b;for(const g of f){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(p)continue;const v=l.issues.length,S=g._zod.check(l);if(S instanceof Promise&&d?.async===!1)throw new _l;if(b||S instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await S,l.issues.length!==v&&(p||(p=ml(l,v)))});else{if(l.issues.length===v)continue;p||(p=ml(l,v))}}return b?b.then(()=>l):l},c=(l,f,d)=>{if(ml(l))return l.aborted=!0,l;const p=i(f,r,d);if(p instanceof Promise){if(d.async===!1)throw new _l;return p.then(b=>e._zod.parse(b,d))}return e._zod.parse(p,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(b=>c(b,l,f)):c(p,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new _l;return d.then(p=>i(p,r,f))}return i(d,r,f)}}Dt(e,"~standard",()=>({validate:i=>{try{const c=CF(e,i);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return AF(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),ES=pe("$ZodString",(e,t)=>{un.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nq(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Xt=pe("$ZodStringFormat",(e,t)=>{Lm.init(e,t),ES.init(e,t)}),wq=pe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=VF),Xt.init(e,t)}),Eq=pe("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=KA(r))}else t.pattern??(t.pattern=KA());Xt.init(e,t)}),xq=pe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=FF),Xt.init(e,t)}),Rq=pe("$ZodURL",(e,t)=>{Xt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Cq=pe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=GF()),Xt.init(e,t)}),Aq=pe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jF),Xt.init(e,t)}),Tq=pe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=LF),Xt.init(e,t)}),Iq=pe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zF),Xt.init(e,t)}),Oq=pe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=BF),Xt.init(e,t)}),Mq=pe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$F),Xt.init(e,t)}),Dq=pe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=UF),Xt.init(e,t)}),kq=pe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tq(t)),Xt.init(e,t)}),Pq=pe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=JF),Xt.init(e,t)}),Nq=pe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eq(t)),Xt.init(e,t)}),Lq=pe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=HF),Xt.init(e,t)}),zq=pe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZF),Xt.init(e,t),e._zod.bag.format="ipv4"}),Bq=pe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=KF),Xt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$q=pe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=QF),Xt.init(e,t)}),Uq=pe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=YF),Xt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,c]=r;if(!c)throw new Error;const l=Number(c);if(`${l}`!==c)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function hD(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jq=pe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=XF),Xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{hD(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Hq(e){if(!cD.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return hD(n)}const Vq=pe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=cD),Xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Hq(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Fq=pe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=WF),Xt.init(e,t)});function qq(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Gq=pe("$ZodJWT",(e,t)=>{Xt.init(e,t),e._zod.check=n=>{qq(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),mD=pe("$ZodNumber",(e,t)=>{un.init(e,t),e._zod.pattern=e._zod.bag.pattern??rq,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const c=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...c?{received:c}:{}}),n}}),Zq=pe("$ZodNumberFormat",(e,t)=>{lq.init(e,t),mD.init(e,t)}),Kq=pe("$ZodBoolean",(e,t)=>{un.init(e,t),e._zod.pattern=oq,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Qq=pe("$ZodUnknown",(e,t)=>{un.init(e,t),e._zod.parse=n=>n}),Yq=pe("$ZodNever",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function QA(e,t,n){e.issues.length&&t.issues.push(...oD(n,e.issues)),t.value[n]=e.value}const Xq=pe("$ZodArray",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const c=[];for(let l=0;lQA(p,n,l))):QA(d,n,l)}return c.length?Promise.all(c).then(()=>n):n}});function Xh(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...oD(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function gD(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=mF(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function yD(e,t,n,r,i,c){const l=[],f=i.keySet,d=i.catchall._zod,p=d.def.type,b=d.optout==="optional";for(const g in t){if(f.has(g))continue;if(p==="never"){l.push(g);continue}const v=d.run({value:t[g],issues:[]},r);v instanceof Promise?e.push(v.then(S=>Xh(S,n,g,t,b))):Xh(v,n,g,t,b)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const Wq=pe("$ZodObject",(e,t)=>{if(un.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...f};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=vS(()=>gD(t));Dt(e._zod,"propValues",()=>{const f=t.shape,d={};for(const p in f){const b=f[p]._zod;if(b.values){d[p]??(d[p]=new Set);for(const g of b.values)d[p].add(g)}}return d});const i=Yh,c=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=r.value);const p=f.value;if(!i(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const b=[],g=l.shape;for(const v of l.keys){const S=g[v],w=S._zod.optout==="optional",E=S._zod.run({value:p[v],issues:[]},d);E instanceof Promise?b.push(E.then(R=>Xh(R,f,v,p,w))):Xh(E,f,v,p,w)}return c?yD(b,p,f,d,r.value,e):b.length?Promise.all(b).then(()=>f):f}}),Jq=pe("$ZodObjectJIT",(e,t)=>{Wq.init(e,t);const n=e._zod.parse,r=vS(()=>gD(t)),i=v=>{const S=new Sq(["shape","payload","ctx"]),w=r.value,E=k=>{const T=ZA(k);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};S.write("const input = payload.value;");const R=Object.create(null);let C=0;for(const k of w.keys)R[k]=`key_${C++}`;S.write("const newResult = {};");for(const k of w.keys){const T=R[k],$=ZA(k),H=v[k]?._zod?.optout==="optional";S.write(`const ${T} = ${E(k)};`),H?S.write(` +`))}}const _F={major:4,minor:3,patch:6},un=de("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_F;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const c of i._zod.onattach)c(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,f,d)=>{let h=gl(l),b;for(const g of f){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(h)continue;const v=l.issues.length,_=g._zod.check(l);if(_ instanceof Promise&&d?.async===!1)throw new wl;if(b||_ instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await _,l.issues.length!==v&&(h||(h=gl(l,v)))});else{if(l.issues.length===v)continue;h||(h=gl(l,v))}}return b?b.then(()=>l):l},c=(l,f,d)=>{if(gl(l))return l.aborted=!0,l;const h=i(f,r,d);if(h instanceof Promise){if(d.async===!1)throw new wl;return h.then(b=>e._zod.parse(b,d))}return e._zod.parse(h,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return h instanceof Promise?h.then(b=>c(b,l,f)):c(h,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new wl;return d.then(h=>i(h,r,f))}return i(d,r,f)}}Dt(e,"~standard",()=>({validate:i=>{try{const c=Cq(e,i);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return Aq(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),wS=de("$ZodString",(e,t)=>{un.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nF(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Xt=de("$ZodStringFormat",(e,t)=>{Nm.init(e,t),wS.init(e,t)}),wF=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Vq),Xt.init(e,t)}),EF=de("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ZA(r))}else t.pattern??(t.pattern=ZA());Xt.init(e,t)}),xF=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qq),Xt.init(e,t)}),RF=de("$ZodURL",(e,t)=>{Xt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),CF=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Gq()),Xt.init(e,t)}),AF=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jq),Xt.init(e,t)}),TF=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Lq),Xt.init(e,t)}),IF=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zq),Xt.init(e,t)}),OF=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Bq),Xt.init(e,t)}),MF=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$q),Xt.init(e,t)}),DF=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Uq),Xt.init(e,t)}),kF=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tF(t)),Xt.init(e,t)}),PF=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Jq),Xt.init(e,t)}),NF=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eF(t)),Xt.init(e,t)}),LF=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hq),Xt.init(e,t)}),zF=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zq),Xt.init(e,t),e._zod.bag.format="ipv4"}),BF=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Kq),Xt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$F=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qq),Xt.init(e,t)}),UF=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yq),Xt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,c]=r;if(!c)throw new Error;const l=Number(c);if(`${l}`!==c)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function dD(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jF=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Xq),Xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{dD(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function HF(e){if(!iD.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return dD(n)}const VF=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iD),Xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{HF(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),qF=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wq),Xt.init(e,t)});function FF(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const GF=de("$ZodJWT",(e,t)=>{Xt.init(e,t),e._zod.check=n=>{FF(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hD=de("$ZodNumber",(e,t)=>{un.init(e,t),e._zod.pattern=e._zod.bag.pattern??rF,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const c=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...c?{received:c}:{}}),n}}),ZF=de("$ZodNumberFormat",(e,t)=>{lF.init(e,t),hD.init(e,t)}),KF=de("$ZodBoolean",(e,t)=>{un.init(e,t),e._zod.pattern=oF,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),QF=de("$ZodUnknown",(e,t)=>{un.init(e,t),e._zod.parse=n=>n}),YF=de("$ZodNever",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function KA(e,t,n){e.issues.length&&t.issues.push(...sD(n,e.issues)),t.value[n]=e.value}const XF=de("$ZodArray",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const c=[];for(let l=0;lKA(h,n,l))):KA(d,n,l)}return c.length?Promise.all(c).then(()=>n):n}});function Xp(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...sD(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function pD(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=mq(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mD(e,t,n,r,i,c){const l=[],f=i.keySet,d=i.catchall._zod,h=d.def.type,b=d.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){l.push(g);continue}const v=d.run({value:t[g],issues:[]},r);v instanceof Promise?e.push(v.then(_=>Xp(_,n,g,t,b))):Xp(v,n,g,t,b)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const WF=de("$ZodObject",(e,t)=>{if(un.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...f};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=bS(()=>pD(t));Dt(e._zod,"propValues",()=>{const f=t.shape,d={};for(const h in f){const b=f[h]._zod;if(b.values){d[h]??(d[h]=new Set);for(const g of b.values)d[h].add(g)}}return d});const i=Yp,c=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=r.value);const h=f.value;if(!i(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const b=[],g=l.shape;for(const v of l.keys){const _=g[v],w=_._zod.optout==="optional",E=_._zod.run({value:h[v],issues:[]},d);E instanceof Promise?b.push(E.then(R=>Xp(R,f,v,h,w))):Xp(E,f,v,h,w)}return c?mD(b,h,f,d,r.value,e):b.length?Promise.all(b).then(()=>f):f}}),JF=de("$ZodObjectJIT",(e,t)=>{WF.init(e,t);const n=e._zod.parse,r=bS(()=>pD(t)),i=v=>{const _=new SF(["shape","payload","ctx"]),w=r.value,E=k=>{const T=GA(k);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};_.write("const input = payload.value;");const R=Object.create(null);let C=0;for(const k of w.keys)R[k]=`key_${C++}`;_.write("const newResult = {};");for(const k of w.keys){const T=R[k],$=GA(k),H=v[k]?._zod?.optout==="optional";_.write(`const ${T} = ${E(k)};`),H?_.write(` if (${T}.issues.length) { if (${$} in input) { payload.issues = payload.issues.concat(${T}.issues.map(iss => ({ @@ -38,7 +38,7 @@ Error generating stack: `+u.message+` newResult[${$}] = ${T}.value; } - `):S.write(` + `):_.write(` if (${T}.issues.length) { payload.issues = payload.issues.concat(${T}.issues.map(iss => ({ ...iss, @@ -54,21 +54,21 @@ Error generating stack: `+u.message+` newResult[${$}] = ${T}.value; } - `)}S.write("payload.value = newResult;"),S.write("return payload;");const O=S.compile();return(k,T)=>O(v,k,T)};let c;const l=Yh,f=!tD.jitless,p=f&&pF.value,b=t.catchall;let g;e._zod.parse=(v,S)=>{g??(g=r.value);const w=v.value;return l(w)?f&&p&&S?.async===!1&&S.jitless!==!0?(c||(c=i(t.shape)),v=c(v,S),b?yD([],w,v,S,g,e):v):n(v,S):(v.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),v)}});function YA(e,t,n,r){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const i=e.filter(c=>!ml(c));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(c=>c.issues.map(l=>ic(l,r,oc())))}),t)}const eG=pe("$ZodUnion",(e,t)=>{un.init(e,t),Dt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Dt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Dt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Dt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${i.map(c=>_S(c.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,c)=>{if(n)return r(i,c);let l=!1;const f=[];for(const d of t.options){const p=d._zod.run({value:i.value,issues:[]},c);if(p instanceof Promise)f.push(p),l=!0;else{if(p.issues.length===0)return p;f.push(p)}}return l?Promise.all(f).then(d=>YA(d,i,e,c)):YA(f,i,e,c)}}),tG=pe("$ZodIntersection",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,c=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return c instanceof Promise||l instanceof Promise?Promise.all([c,l]).then(([d,p])=>XA(n,d,p)):XA(n,c,l)}});function vv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Lf(e)&&Lf(t)){const n=Object.keys(t),r=Object.keys(e).filter(c=>n.indexOf(c)!==-1),i={...e,...t};for(const c of r){const l=vv(e[c],t[c]);if(!l.valid)return{valid:!1,mergeErrorPath:[c,...l.mergeErrorPath]};i[c]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;rf.l&&f.r).map(([f])=>f);if(c.length&&i&&e.issues.push({...i,keys:c}),ml(e))return e;const l=vv(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const nG=pe("$ZodEnum",(e,t)=>{un.init(e,t);const n=nD(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>hF.has(typeof i)).map(i=>typeof i=="string"?Om(i):i.toString()).join("|")})$`),e._zod.parse=(i,c)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),sG=pe("$ZodTransform",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new eD(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new _l;return n.value=i,n}});function WA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const bD=pe("$ZodOptional",(e,t)=>{un.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${_S(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>WA(c,n.value)):WA(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),rG=pe("$ZodExactOptional",(e,t)=>{bD.init(e,t),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),oG=pe("$ZodNullable",(e,t)=>{un.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${_S(n.source)}|null)$`):void 0}),Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),iG=pe("$ZodDefault",(e,t)=>{un.init(e,t),e._zod.optin="optional",Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>JA(c,t)):JA(i,t)}});function JA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const aG=pe("$ZodPrefault",(e,t)=>{un.init(e,t),e._zod.optin="optional",Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),cG=pe("$ZodNonOptional",(e,t)=>{un.init(e,t),Dt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>eT(c,e)):eT(i,e)}});function eT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const lG=pe("$ZodCatch",(e,t)=>{un.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(l=>ic(l,r,oc()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(c=>ic(c,r,oc()))},input:n.value}),n.issues=[]),n)}}),uG=pe("$ZodPipe",(e,t)=>{un.init(e,t),Dt(e._zod,"values",()=>t.in._zod.values),Dt(e._zod,"optin",()=>t.in._zod.optin),Dt(e._zod,"optout",()=>t.out._zod.optout),Dt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const c=t.out._zod.run(n,r);return c instanceof Promise?c.then(l=>ih(l,t.in,r)):ih(c,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(c=>ih(c,t.out,r)):ih(i,t.out,r)}});function ih(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const fG=pe("$ZodReadonly",(e,t)=>{un.init(e,t),Dt(e._zod,"propValues",()=>t.innerType._zod.propValues),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"optin",()=>t.innerType?._zod?.optin),Dt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(tT):tT(i)}});function tT(e){return e.value=Object.freeze(e.value),e}const dG=pe("$ZodCustom",(e,t)=>{Rs.init(e,t),un.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(c=>nT(c,n,r,e));nT(i,n,r,e)}});function nT(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(zf(i))}}var sT;class pG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function hG(){return new pG}(sT=globalThis).__zod_globalRegistry??(sT.__zod_globalRegistry=hG());const yf=globalThis.__zod_globalRegistry;function mG(e,t){return new e({type:"string",...Ue(t)})}function gG(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ue(t)})}function rT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ue(t)})}function yG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ue(t)})}function bG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ue(t)})}function vG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ue(t)})}function SG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ue(t)})}function _G(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ue(t)})}function wG(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ue(t)})}function EG(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ue(t)})}function xG(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ue(t)})}function RG(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ue(t)})}function CG(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ue(t)})}function AG(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ue(t)})}function TG(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ue(t)})}function IG(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ue(t)})}function OG(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ue(t)})}function MG(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ue(t)})}function DG(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ue(t)})}function kG(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ue(t)})}function PG(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ue(t)})}function NG(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ue(t)})}function LG(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ue(t)})}function zG(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ue(t)})}function BG(e,t){return new e({type:"string",format:"date",check:"string_format",...Ue(t)})}function $G(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ue(t)})}function UG(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ue(t)})}function jG(e,t){return new e({type:"number",checks:[],...Ue(t)})}function HG(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ue(t)})}function VG(e,t){return new e({type:"boolean",...Ue(t)})}function FG(e){return new e({type:"unknown"})}function qG(e,t){return new e({type:"never",...Ue(t)})}function oT(e,t){return new dD({check:"less_than",...Ue(t),value:e,inclusive:!1})}function ab(e,t){return new dD({check:"less_than",...Ue(t),value:e,inclusive:!0})}function iT(e,t){return new pD({check:"greater_than",...Ue(t),value:e,inclusive:!1})}function cb(e,t){return new pD({check:"greater_than",...Ue(t),value:e,inclusive:!0})}function aT(e,t){return new cq({check:"multiple_of",...Ue(t),value:e})}function vD(e,t){return new uq({check:"max_length",...Ue(t),maximum:e})}function Wh(e,t){return new fq({check:"min_length",...Ue(t),minimum:e})}function SD(e,t){return new dq({check:"length_equals",...Ue(t),length:e})}function GG(e,t){return new pq({check:"string_format",format:"regex",...Ue(t),pattern:e})}function ZG(e){return new hq({check:"string_format",format:"lowercase",...Ue(e)})}function KG(e){return new mq({check:"string_format",format:"uppercase",...Ue(e)})}function QG(e,t){return new gq({check:"string_format",format:"includes",...Ue(t),includes:e})}function YG(e,t){return new yq({check:"string_format",format:"starts_with",...Ue(t),prefix:e})}function XG(e,t){return new bq({check:"string_format",format:"ends_with",...Ue(t),suffix:e})}function $l(e){return new vq({check:"overwrite",tx:e})}function WG(e){return $l(t=>t.normalize(e))}function JG(){return $l(e=>e.trim())}function eZ(){return $l(e=>e.toLowerCase())}function tZ(){return $l(e=>e.toUpperCase())}function nZ(){return $l(e=>dF(e))}function sZ(e,t,n){return new e({type:"array",element:t,...Ue(n)})}function rZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ue(n)})}function oZ(e){const t=iZ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(zf(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(zf(i))}},e(n.value,n)));return t}function iZ(e,t){const n=new Rs({check:"custom",...Ue(t)});return n._zod.check=e,n}function _D(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??yf,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,b);else{const v=l.schema,S=t.processors[i.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);S(e,t,v,b)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),Vn(g,t,b),t.seen.get(g).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&os(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function wD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const d=r.get(f);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(f,l[0])}}const i=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(l[0])?.id,v=e.external.uri??(w=>w);if(g)return{ref:v(g)};const S=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=S,{defId:S,ref:`${v("__shared")}#/${f}/${S}`}}if(l[1]===n)return{ref:"#"};const p=`#/${f}/`,b=l[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},c=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:p}=i(l);f.def={...f.schema},p&&(f.defId=p);const b=f.schema;for(const g in b)delete b[g];b.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/ + `)}_.write("payload.value = newResult;"),_.write("return payload;");const I=_.compile();return(k,T)=>I(v,k,T)};let c;const l=Yp,f=!JM.jitless,h=f&&hq.value,b=t.catchall;let g;e._zod.parse=(v,_)=>{g??(g=r.value);const w=v.value;return l(w)?f&&h&&_?.async===!1&&_.jitless!==!0?(c||(c=i(t.shape)),v=c(v,_),b?mD([],w,v,_,g,e):v):n(v,_):(v.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),v)}});function QA(e,t,n,r){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const i=e.filter(c=>!gl(c));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(c=>c.issues.map(l=>ic(l,r,oc())))}),t)}const eG=de("$ZodUnion",(e,t)=>{un.init(e,t),Dt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Dt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Dt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Dt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${i.map(c=>SS(c.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,c)=>{if(n)return r(i,c);let l=!1;const f=[];for(const d of t.options){const h=d._zod.run({value:i.value,issues:[]},c);if(h instanceof Promise)f.push(h),l=!0;else{if(h.issues.length===0)return h;f.push(h)}}return l?Promise.all(f).then(d=>QA(d,i,e,c)):QA(f,i,e,c)}}),tG=de("$ZodIntersection",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,c=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return c instanceof Promise||l instanceof Promise?Promise.all([c,l]).then(([d,h])=>YA(n,d,h)):YA(n,c,l)}});function yv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nf(e)&&Nf(t)){const n=Object.keys(t),r=Object.keys(e).filter(c=>n.indexOf(c)!==-1),i={...e,...t};for(const c of r){const l=yv(e[c],t[c]);if(!l.valid)return{valid:!1,mergeErrorPath:[c,...l.mergeErrorPath]};i[c]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;rf.l&&f.r).map(([f])=>f);if(c.length&&i&&e.issues.push({...i,keys:c}),gl(e))return e;const l=yv(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const nG=de("$ZodEnum",(e,t)=>{un.init(e,t);const n=eD(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>pq.has(typeof i)).map(i=>typeof i=="string"?Im(i):i.toString()).join("|")})$`),e._zod.parse=(i,c)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),sG=de("$ZodTransform",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new WM(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new wl;return n.value=i,n}});function XA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const gD=de("$ZodOptional",(e,t)=>{un.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${SS(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>XA(c,n.value)):XA(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),rG=de("$ZodExactOptional",(e,t)=>{gD.init(e,t),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),oG=de("$ZodNullable",(e,t)=>{un.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${SS(n.source)}|null)$`):void 0}),Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),iG=de("$ZodDefault",(e,t)=>{un.init(e,t),e._zod.optin="optional",Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>WA(c,t)):WA(i,t)}});function WA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const aG=de("$ZodPrefault",(e,t)=>{un.init(e,t),e._zod.optin="optional",Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),cG=de("$ZodNonOptional",(e,t)=>{un.init(e,t),Dt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>JA(c,e)):JA(i,e)}});function JA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const lG=de("$ZodCatch",(e,t)=>{un.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(l=>ic(l,r,oc()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(c=>ic(c,r,oc()))},input:n.value}),n.issues=[]),n)}}),uG=de("$ZodPipe",(e,t)=>{un.init(e,t),Dt(e._zod,"values",()=>t.in._zod.values),Dt(e._zod,"optin",()=>t.in._zod.optin),Dt(e._zod,"optout",()=>t.out._zod.optout),Dt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const c=t.out._zod.run(n,r);return c instanceof Promise?c.then(l=>ip(l,t.in,r)):ip(c,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(c=>ip(c,t.out,r)):ip(i,t.out,r)}});function ip(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const fG=de("$ZodReadonly",(e,t)=>{un.init(e,t),Dt(e._zod,"propValues",()=>t.innerType._zod.propValues),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"optin",()=>t.innerType?._zod?.optin),Dt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(eT):eT(i)}});function eT(e){return e.value=Object.freeze(e.value),e}const dG=de("$ZodCustom",(e,t)=>{Rs.init(e,t),un.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(c=>tT(c,n,r,e));tT(i,n,r,e)}});function tT(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Lf(i))}}var nT;class hG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function pG(){return new hG}(nT=globalThis).__zod_globalRegistry??(nT.__zod_globalRegistry=pG());const gf=globalThis.__zod_globalRegistry;function mG(e,t){return new e({type:"string",...Ue(t)})}function gG(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ue(t)})}function sT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ue(t)})}function yG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ue(t)})}function bG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ue(t)})}function vG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ue(t)})}function SG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ue(t)})}function _G(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ue(t)})}function wG(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ue(t)})}function EG(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ue(t)})}function xG(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ue(t)})}function RG(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ue(t)})}function CG(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ue(t)})}function AG(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ue(t)})}function TG(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ue(t)})}function IG(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ue(t)})}function OG(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ue(t)})}function MG(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ue(t)})}function DG(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ue(t)})}function kG(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ue(t)})}function PG(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ue(t)})}function NG(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ue(t)})}function LG(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ue(t)})}function zG(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ue(t)})}function BG(e,t){return new e({type:"string",format:"date",check:"string_format",...Ue(t)})}function $G(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ue(t)})}function UG(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ue(t)})}function jG(e,t){return new e({type:"number",checks:[],...Ue(t)})}function HG(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ue(t)})}function VG(e,t){return new e({type:"boolean",...Ue(t)})}function qG(e){return new e({type:"unknown"})}function FG(e,t){return new e({type:"never",...Ue(t)})}function rT(e,t){return new uD({check:"less_than",...Ue(t),value:e,inclusive:!1})}function ob(e,t){return new uD({check:"less_than",...Ue(t),value:e,inclusive:!0})}function oT(e,t){return new fD({check:"greater_than",...Ue(t),value:e,inclusive:!1})}function ib(e,t){return new fD({check:"greater_than",...Ue(t),value:e,inclusive:!0})}function iT(e,t){return new cF({check:"multiple_of",...Ue(t),value:e})}function yD(e,t){return new uF({check:"max_length",...Ue(t),maximum:e})}function Wp(e,t){return new fF({check:"min_length",...Ue(t),minimum:e})}function bD(e,t){return new dF({check:"length_equals",...Ue(t),length:e})}function GG(e,t){return new hF({check:"string_format",format:"regex",...Ue(t),pattern:e})}function ZG(e){return new pF({check:"string_format",format:"lowercase",...Ue(e)})}function KG(e){return new mF({check:"string_format",format:"uppercase",...Ue(e)})}function QG(e,t){return new gF({check:"string_format",format:"includes",...Ue(t),includes:e})}function YG(e,t){return new yF({check:"string_format",format:"starts_with",...Ue(t),prefix:e})}function XG(e,t){return new bF({check:"string_format",format:"ends_with",...Ue(t),suffix:e})}function $l(e){return new vF({check:"overwrite",tx:e})}function WG(e){return $l(t=>t.normalize(e))}function JG(){return $l(e=>e.trim())}function eZ(){return $l(e=>e.toLowerCase())}function tZ(){return $l(e=>e.toUpperCase())}function nZ(){return $l(e=>dq(e))}function sZ(e,t,n){return new e({type:"array",element:t,...Ue(n)})}function rZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ue(n)})}function oZ(e){const t=iZ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Lf(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Lf(i))}},e(n.value,n)));return t}function iZ(e,t){const n=new Rs({check:"custom",...Ue(t)});return n._zod.check=e,n}function vD(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??gf,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,b);else{const v=l.schema,_=t.processors[i.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);_(e,t,v,b)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),Vn(g,t,b),t.seen.get(g).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&os(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function SD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const d=r.get(f);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(f,l[0])}}const i=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(l[0])?.id,v=e.external.uri??(w=>w);if(g)return{ref:v(g)};const _=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=_,{defId:_,ref:`${v("__shared")}#/${f}/${_}`}}if(l[1]===n)return{ref:"#"};const h=`#/${f}/`,b=l[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:h+b}},c=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:h}=i(l);f.def={...f.schema},h&&(f.defId=h);const b=f.schema;for(const g in b)delete b[g];b.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){c(l);continue}if(e.external){const p=e.external.registry.get(l[0])?.id;if(t!==l[0]&&p){c(l);continue}}if(e.metadataRegistry.get(l[0])?.id){c(l);continue}if(f.cycle){c(l);continue}if(f.count>1&&e.reused==="ref"){c(l);continue}}}function ED(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const d=f.def??f.schema,p={...d},b=f.ref;if(f.ref=null,b){r(b);const v=e.seen.get(b),S=v.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(S)):Object.assign(d,S),Object.assign(d,p),l._zod.parent===b)for(const E in d)E==="$ref"||E==="allOf"||E in p||delete d[E];if(S.$ref&&v.def)for(const E in d)E==="$ref"||E==="allOf"||E in v.def&&JSON.stringify(d[E])===JSON.stringify(v.def[E])&&delete d[E]}const g=l._zod.parent;if(g&&g!==b){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(d.$ref=v.schema.$ref,v.def))for(const S in d)S==="$ref"||S==="allOf"||S in v.def&&JSON.stringify(d[S])===JSON.stringify(v.def[S])&&delete d[S]}e.override({zodSchema:l,jsonSchema:d,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const c=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?i.$defs=c:i.definitions=c);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jh(t,"input",e.processors),output:Jh(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function os(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return os(r.element,n);if(r.type==="set")return os(r.valueType,n);if(r.type==="lazy")return os(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return os(r.innerType,n);if(r.type==="intersection")return os(r.left,n)||os(r.right,n);if(r.type==="record"||r.type==="map")return os(r.keyType,n)||os(r.valueType,n);if(r.type==="pipe")return os(r.in,n)||os(r.out,n);if(r.type==="object"){for(const i in r.shape)if(os(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(os(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(os(i,n))return!0;return!!(r.rest&&os(r.rest,n))}return!1}const aZ=(e,t={})=>n=>{const r=_D({...n,processors:t});return Vn(e,r),wD(r,e),ED(r,e)},Jh=(e,t,n={})=>r=>{const{libraryOptions:i,target:c}=r??{},l=_D({...i??{},target:c,io:t,processors:n});return Vn(e,l),wD(l,e),ED(l,e)},cZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lZ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:c,maximum:l,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(i.minLength=c),typeof l=="number"&&(i.maxLength=l),f&&(i.format=cZ[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),d&&d.size>0){const b=[...d];b.length===1?i.pattern=b[0].source:b.length>1&&(i.allOf=[...b.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},uZ=(e,t,n,r)=>{const i=n,{minimum:c,maximum:l,format:f,multipleOf:d,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof b=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=b,i.exclusiveMinimum=!0):i.exclusiveMinimum=b),typeof c=="number"&&(i.minimum=c,typeof b=="number"&&t.target!=="draft-04"&&(b>=c?delete i.minimum:delete i.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof l=="number"&&(i.maximum=l,typeof p=="number"&&t.target!=="draft-04"&&(p<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},fZ=(e,t,n,r)=>{n.type="boolean"},dZ=(e,t,n,r)=>{n.not={}},pZ=(e,t,n,r)=>{},hZ=(e,t,n,r)=>{const i=e._zod.def,c=nD(i.entries);c.every(l=>typeof l=="number")&&(n.type="number"),c.every(l=>typeof l=="string")&&(n.type="string"),n.enum=c},mZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yZ=(e,t,n,r)=>{const i=n,c=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=Vn(c.element,t,{...r,path:[...r.path,"items"]})},bZ=(e,t,n,r)=>{const i=n,c=e._zod.def;i.type="object",i.properties={};const l=c.shape;for(const p in l)i.properties[p]=Vn(l[p],t,{...r,path:[...r.path,"properties",p]});const f=new Set(Object.keys(l)),d=new Set([...f].filter(p=>{const b=c.shape[p]._zod;return t.io==="input"?b.optin===void 0:b.optout===void 0}));d.size>0&&(i.required=Array.from(d)),c.catchall?._zod.def.type==="never"?i.additionalProperties=!1:c.catchall?c.catchall&&(i.additionalProperties=Vn(c.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},vZ=(e,t,n,r)=>{const i=e._zod.def,c=i.inclusive===!1,l=i.options.map((f,d)=>Vn(f,t,{...r,path:[...r.path,c?"oneOf":"anyOf",d]}));c?n.oneOf=l:n.anyOf=l},SZ=(e,t,n,r)=>{const i=e._zod.def,c=Vn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=Vn(i.right,t,{...r,path:[...r.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,d=[...f(c)?c.allOf:[c],...f(l)?l.allOf:[l]];n.allOf=d},_Z=(e,t,n,r)=>{const i=e._zod.def,c=Vn(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},wZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType},EZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},RZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},CZ=(e,t,n,r)=>{const i=e._zod.def,c=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Vn(c,t,r);const l=t.seen.get(e);l.ref=c},AZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType,n.readOnly=!0},xD=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType},TZ=pe("ZodISODateTime",(e,t)=>{kq.init(e,t),tn.init(e,t)});function IZ(e){return zG(TZ,e)}const OZ=pe("ZodISODate",(e,t)=>{Pq.init(e,t),tn.init(e,t)});function MZ(e){return BG(OZ,e)}const DZ=pe("ZodISOTime",(e,t)=>{Nq.init(e,t),tn.init(e,t)});function kZ(e){return $G(DZ,e)}const PZ=pe("ZodISODuration",(e,t)=>{Lq.init(e,t),tn.init(e,t)});function NZ(e){return UG(PZ,e)}const LZ=(e,t)=>{aD.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>RF(e,n)},flatten:{value:n=>xF(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,bv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,bv,2)}},isEmpty:{get(){return e.issues.length===0}}})},_r=pe("ZodError",LZ,{Parent:Error}),zZ=Dm(_r),BZ=km(_r),$Z=Pm(_r),UZ=Nm(_r),jZ=TF(_r),HZ=IF(_r),VZ=OF(_r),FZ=MF(_r),qZ=DF(_r),GZ=kF(_r),ZZ=PF(_r),KZ=NF(_r),fn=pe("ZodType",(e,t)=>(un.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jh(e,"input"),output:Jh(e,"output")}}),e.toJSONSchema=aZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(aa(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>ca(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>zZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$Z(e,n,r),e.parseAsync=async(n,r)=>BZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>UZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>jZ(e,n,r),e.decode=(n,r)=>HZ(e,n,r),e.encodeAsync=async(n,r)=>VZ(e,n,r),e.decodeAsync=async(n,r)=>FZ(e,n,r),e.safeEncode=(n,r)=>qZ(e,n,r),e.safeDecode=(n,r)=>GZ(e,n,r),e.safeEncodeAsync=async(n,r)=>ZZ(e,n,r),e.safeDecodeAsync=async(n,r)=>KZ(e,n,r),e.refine=(n,r)=>e.check(VK(n,r)),e.superRefine=n=>e.check(FK(n)),e.overwrite=n=>e.check($l(n)),e.optional=()=>dT(e),e.exactOptional=()=>OK(e),e.nullable=()=>pT(e),e.nullish=()=>dT(pT(e)),e.nonoptional=n=>LK(e,n),e.array=()=>vK(e),e.or=n=>EK([e,n]),e.and=n=>RK(e,n),e.transform=n=>hT(e,TK(n)),e.default=n=>kK(e,n),e.prefault=n=>NK(e,n),e.catch=n=>BK(e,n),e.pipe=n=>hT(e,n),e.readonly=()=>jK(e),e.describe=n=>{const r=e.clone();return yf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return yf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return yf.get(e);const r=e.clone();return yf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),RD=pe("_ZodString",(e,t)=>{ES.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,c)=>lZ(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(GG(...r)),e.includes=(...r)=>e.check(QG(...r)),e.startsWith=(...r)=>e.check(YG(...r)),e.endsWith=(...r)=>e.check(XG(...r)),e.min=(...r)=>e.check(Wh(...r)),e.max=(...r)=>e.check(vD(...r)),e.length=(...r)=>e.check(SD(...r)),e.nonempty=(...r)=>e.check(Wh(1,...r)),e.lowercase=r=>e.check(ZG(r)),e.uppercase=r=>e.check(KG(r)),e.trim=()=>e.check(JG()),e.normalize=(...r)=>e.check(WG(...r)),e.toLowerCase=()=>e.check(eZ()),e.toUpperCase=()=>e.check(tZ()),e.slugify=()=>e.check(nZ())}),QZ=pe("ZodString",(e,t)=>{ES.init(e,t),RD.init(e,t),e.email=n=>e.check(gG(YZ,n)),e.url=n=>e.check(_G(XZ,n)),e.jwt=n=>e.check(LG(dK,n)),e.emoji=n=>e.check(wG(WZ,n)),e.guid=n=>e.check(rT(lT,n)),e.uuid=n=>e.check(yG(ah,n)),e.uuidv4=n=>e.check(bG(ah,n)),e.uuidv6=n=>e.check(vG(ah,n)),e.uuidv7=n=>e.check(SG(ah,n)),e.nanoid=n=>e.check(EG(JZ,n)),e.guid=n=>e.check(rT(lT,n)),e.cuid=n=>e.check(xG(eK,n)),e.cuid2=n=>e.check(RG(tK,n)),e.ulid=n=>e.check(CG(nK,n)),e.base64=n=>e.check(kG(lK,n)),e.base64url=n=>e.check(PG(uK,n)),e.xid=n=>e.check(AG(sK,n)),e.ksuid=n=>e.check(TG(rK,n)),e.ipv4=n=>e.check(IG(oK,n)),e.ipv6=n=>e.check(OG(iK,n)),e.cidrv4=n=>e.check(MG(aK,n)),e.cidrv6=n=>e.check(DG(cK,n)),e.e164=n=>e.check(NG(fK,n)),e.datetime=n=>e.check(IZ(n)),e.date=n=>e.check(MZ(n)),e.time=n=>e.check(kZ(n)),e.duration=n=>e.check(NZ(n))});function cT(e){return mG(QZ,e)}const tn=pe("ZodStringFormat",(e,t)=>{Xt.init(e,t),RD.init(e,t)}),YZ=pe("ZodEmail",(e,t)=>{xq.init(e,t),tn.init(e,t)}),lT=pe("ZodGUID",(e,t)=>{wq.init(e,t),tn.init(e,t)}),ah=pe("ZodUUID",(e,t)=>{Eq.init(e,t),tn.init(e,t)}),XZ=pe("ZodURL",(e,t)=>{Rq.init(e,t),tn.init(e,t)}),WZ=pe("ZodEmoji",(e,t)=>{Cq.init(e,t),tn.init(e,t)}),JZ=pe("ZodNanoID",(e,t)=>{Aq.init(e,t),tn.init(e,t)}),eK=pe("ZodCUID",(e,t)=>{Tq.init(e,t),tn.init(e,t)}),tK=pe("ZodCUID2",(e,t)=>{Iq.init(e,t),tn.init(e,t)}),nK=pe("ZodULID",(e,t)=>{Oq.init(e,t),tn.init(e,t)}),sK=pe("ZodXID",(e,t)=>{Mq.init(e,t),tn.init(e,t)}),rK=pe("ZodKSUID",(e,t)=>{Dq.init(e,t),tn.init(e,t)}),oK=pe("ZodIPv4",(e,t)=>{zq.init(e,t),tn.init(e,t)}),iK=pe("ZodIPv6",(e,t)=>{Bq.init(e,t),tn.init(e,t)}),aK=pe("ZodCIDRv4",(e,t)=>{$q.init(e,t),tn.init(e,t)}),cK=pe("ZodCIDRv6",(e,t)=>{Uq.init(e,t),tn.init(e,t)}),lK=pe("ZodBase64",(e,t)=>{jq.init(e,t),tn.init(e,t)}),uK=pe("ZodBase64URL",(e,t)=>{Vq.init(e,t),tn.init(e,t)}),fK=pe("ZodE164",(e,t)=>{Fq.init(e,t),tn.init(e,t)}),dK=pe("ZodJWT",(e,t)=>{Gq.init(e,t),tn.init(e,t)}),CD=pe("ZodNumber",(e,t)=>{mD.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,c)=>uZ(e,r,i),e.gt=(r,i)=>e.check(iT(r,i)),e.gte=(r,i)=>e.check(cb(r,i)),e.min=(r,i)=>e.check(cb(r,i)),e.lt=(r,i)=>e.check(oT(r,i)),e.lte=(r,i)=>e.check(ab(r,i)),e.max=(r,i)=>e.check(ab(r,i)),e.int=r=>e.check(uT(r)),e.safe=r=>e.check(uT(r)),e.positive=r=>e.check(iT(0,r)),e.nonnegative=r=>e.check(cb(0,r)),e.negative=r=>e.check(oT(0,r)),e.nonpositive=r=>e.check(ab(0,r)),e.multipleOf=(r,i)=>e.check(aT(r,i)),e.step=(r,i)=>e.check(aT(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function KRe(e){return jG(CD,e)}const pK=pe("ZodNumberFormat",(e,t)=>{Zq.init(e,t),CD.init(e,t)});function uT(e){return HG(pK,e)}const hK=pe("ZodBoolean",(e,t)=>{Kq.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fZ(e,n,r)});function QRe(e){return VG(hK,e)}const mK=pe("ZodUnknown",(e,t)=>{Qq.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pZ()});function fT(){return FG(mK)}const gK=pe("ZodNever",(e,t)=>{Yq.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dZ(e,n,r)});function yK(e){return qG(gK,e)}const bK=pe("ZodArray",(e,t)=>{Xq.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yZ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Wh(n,r)),e.nonempty=n=>e.check(Wh(1,n)),e.max=(n,r)=>e.check(vD(n,r)),e.length=(n,r)=>e.check(SD(n,r)),e.unwrap=()=>e.element});function vK(e,t){return sZ(bK,e,t)}const SK=pe("ZodObject",(e,t)=>{Jq.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bZ(e,n,r,i),Dt(e,"shape",()=>t.shape),e.keyof=()=>CK(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fT()}),e.loose=()=>e.clone({...e._zod.def,catchall:fT()}),e.strict=()=>e.clone({...e._zod.def,catchall:yK()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>vF(e,n),e.safeExtend=n=>SF(e,n),e.merge=n=>_F(e,n),e.pick=n=>yF(e,n),e.omit=n=>bF(e,n),e.partial=(...n)=>wF(AD,e,n[0]),e.required=(...n)=>EF(TD,e,n[0])});function _K(e,t){const n={type:"object",shape:e??{},...Ue(t)};return new SK(n)}const wK=pe("ZodUnion",(e,t)=>{eG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vZ(e,n,r,i),e.options=t.options});function EK(e,t){return new wK({type:"union",options:e,...Ue(t)})}const xK=pe("ZodIntersection",(e,t)=>{tG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SZ(e,n,r,i)});function RK(e,t){return new xK({type:"intersection",left:e,right:t})}const Sv=pe("ZodEnum",(e,t)=>{nG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,c)=>hZ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const c={};for(const l of r)if(n.has(l))c[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Sv({...t,checks:[],...Ue(i),entries:c})},e.exclude=(r,i)=>{const c={...t.entries};for(const l of r)if(n.has(l))delete c[l];else throw new Error(`Key ${l} not found in enum`);return new Sv({...t,checks:[],...Ue(i),entries:c})}});function CK(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Sv({type:"enum",entries:n,...Ue(t)})}const AK=pe("ZodTransform",(e,t)=>{sG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new eD(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(zf(c,n.value,t));else{const l=c;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(zf(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(c=>(n.value=c,n)):(n.value=i,n)}});function TK(e){return new AK({type:"transform",transform:e})}const AD=pe("ZodOptional",(e,t)=>{bD.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function dT(e){return new AD({type:"optional",innerType:e})}const IK=pe("ZodExactOptional",(e,t)=>{rG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function OK(e){return new IK({type:"optional",innerType:e})}const MK=pe("ZodNullable",(e,t)=>{oG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_Z(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function pT(e){return new MK({type:"nullable",innerType:e})}const DK=pe("ZodDefault",(e,t)=>{iG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kK(e,t){return new DK({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():rD(t)}})}const PK=pe("ZodPrefault",(e,t)=>{aG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function NK(e,t){return new PK({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():rD(t)}})}const TD=pe("ZodNonOptional",(e,t)=>{cG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LK(e,t){return new TD({type:"nonoptional",innerType:e,...Ue(t)})}const zK=pe("ZodCatch",(e,t)=>{lG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BK(e,t){return new zK({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const $K=pe("ZodPipe",(e,t)=>{uG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CZ(e,n,r,i),e.in=t.in,e.out=t.out});function hT(e,t){return new $K({type:"pipe",in:e,out:t})}const UK=pe("ZodReadonly",(e,t)=>{fG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jK(e){return new UK({type:"readonly",innerType:e})}const HK=pe("ZodCustom",(e,t)=>{dG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mZ(e,n)});function VK(e,t={}){return rZ(HK,e,t)}function FK(e){return oZ(e)}const xS="hive:v1:aws-credentials",qK=_K({accessKeyId:cT().min(16,"Access Key ID must be at least 16 characters"),secretAccessKey:cT().min(1,"Secret Access Key is required")});let ko;function zm(){if(ko!==void 0)return ko;try{const e=localStorage.getItem(xS);if(!e)return ko=null,null;const t=JSON.parse(e),n=qK.safeParse(t);return ko=n.success?n.data:null,ko}catch{return ko=null,null}}function YRe(e){try{localStorage.setItem(xS,JSON.stringify(e)),ko=e}catch{ko=e}}function GK(){try{localStorage.removeItem(xS)}catch{}ko=null}const ID=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),OD=e=>({httpHandler:e.httpHandler()});var Bf;(function(e){e.HTTP="http",e.HTTPS="https"})(Bf||(Bf={}));var em;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(em||(em={}));const _v="__smithy_context";class kn{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const n=new kn({...t,headers:{...t.headers}});return n.query&&(n.query=ZK(n.query)),n}static isInstance(t){if(!t)return!1;const n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return kn.clone(this)}}function ZK(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}class ac{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const n=t;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}const KK=e=>t=>async n=>{if(!kn.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let c=r.hostname;r.port!=null&&(c+=`:${r.port}`),r.headers.host=c}return t(n)},QK={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},MD=e=>({applyToStack:t=>{t.add(KK(e),QK)}}),YK=()=>(e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:c,logger:l,dynamoDbDocumentClientOptions:f={}}=t,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:p}=f,b=d??t.inputFilterSensitiveLog,g=p??t.outputFilterSensitiveLog,{$metadata:v,...S}=r.output;return l?.info?.({clientName:i,commandName:c,input:b(n.input),output:g(S),metadata:v}),r}catch(r){const{clientName:i,commandName:c,logger:l,dynamoDbDocumentClientOptions:f={}}=t,{overrideInputFilterSensitiveLog:d}=f,p=d??t.inputFilterSensitiveLog;throw l?.error?.({clientName:i,commandName:c,input:p(n.input),error:r,metadata:r.$metadata}),r}},XK={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},DD=e=>({applyToStack:t=>{t.add(YK(),XK)}}),WK={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},JK=()=>e=>async t=>e(t),kD=e=>({applyToStack:t=>{t.add(JK(),WK)}}),qo=e=>e[_v]||(e[_v]={}),qs=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},eQ=(e,t)=>{if(!t||t.length===0)return e;const n=[];for(const r of t)for(const i of e)i.schemeId.split("#")[1]===r&&n.push(i);for(const r of e)n.find(({schemeId:i})=>i===r.schemeId)||n.push(r);return n};function tQ(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}const nQ=(e,t)=>(n,r)=>async i=>{const c=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),l=e.authSchemePreference?await e.authSchemePreference():[],f=eQ(c,l),d=tQ(e.httpAuthSchemes),p=qo(r),b=[];for(const g of f){const v=d.get(g.schemeId);if(!v){b.push(`HttpAuthScheme \`${g.schemeId}\` was not enabled for this service.`);continue}const S=v.identityProvider(await t.identityProviderConfigProvider(e));if(!S){b.push(`HttpAuthScheme \`${g.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:w={},signingProperties:E={}}=g.propertiesExtractor?.(e,r)||{};g.identityProperties=Object.assign(g.identityProperties||{},w),g.signingProperties=Object.assign(g.signingProperties||{},E),p.selectedHttpAuthScheme={httpAuthOption:g,identity:await S(g.identityProperties),signer:v.signer};break}if(!p.selectedHttpAuthScheme)throw new Error(b.join(` -`));return n(i)},sQ={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},PD=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(nQ(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),sQ)}}),rQ={name:"serializerMiddleware"},oQ=e=>t=>{throw t},iQ=(e,t)=>{},aQ=e=>(t,n)=>async r=>{if(!kn.isInstance(r.request))return t(r);const c=qo(n).selectedHttpAuthScheme;if(!c)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:l={}},identity:f,signer:d}=c,p=await t({...r,request:await d.sign(r.request,f,l)}).catch((d.errorHandler||oQ)(l));return(d.successHandler||iQ)(p.response,l),p},ND={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},LD=e=>({applyToStack:t=>{t.addRelativeTo(aQ(),ND)}}),wl=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},zD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mT=Object.entries(zD).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),cQ=zD.split(""),El=6,Ef=8,lQ=63,cc=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let i=0;i>=El;const f=i/4*3;c>>=l%Ef;const d=Math.floor(l/Ef);for(let p=0;p>b)}}return new Uint8Array(n)},Ho=e=>new TextEncoder().encode(e),$f=e=>typeof e=="string"?Ho(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),pc=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function ea(e){let t;typeof e=="string"?t=Ho(e):t=e;const n=typeof t=="object"&&typeof t.length=="number",r=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let c=0;c>b]}i+="==".slice(0,4-d)}return i}class ec extends Uint8Array{static fromString(t,n="utf-8"){if(typeof t=="string")return n==="base64"?ec.mutate(cc(t)):ec.mutate(Ho(t));throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}static mutate(t){return Object.setPrototypeOf(t,ec.prototype),t}transformToString(t="utf-8"){return t==="base64"?ea(this):pc(this)}}const gT=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),uQ=(e,t)=>{const{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:i,checksumLocationName:c,streamHasher:l}=t,f=n!==void 0&&r!==void 0&&i!==void 0&&c!==void 0&&l!==void 0,d=f?l(i,e):void 0,p=e.getReader();return new ReadableStream({async pull(b){const{value:g,done:v}=await p.read();if(v){if(b.enqueue(`0\r -`),f){const S=n(await d);b.enqueue(`${c}:${S}\r +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){c(l);continue}if(e.external){const h=e.external.registry.get(l[0])?.id;if(t!==l[0]&&h){c(l);continue}}if(e.metadataRegistry.get(l[0])?.id){c(l);continue}if(f.cycle){c(l);continue}if(f.count>1&&e.reused==="ref"){c(l);continue}}}function _D(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const d=f.def??f.schema,h={...d},b=f.ref;if(f.ref=null,b){r(b);const v=e.seen.get(b),_=v.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(_)):Object.assign(d,_),Object.assign(d,h),l._zod.parent===b)for(const E in d)E==="$ref"||E==="allOf"||E in h||delete d[E];if(_.$ref&&v.def)for(const E in d)E==="$ref"||E==="allOf"||E in v.def&&JSON.stringify(d[E])===JSON.stringify(v.def[E])&&delete d[E]}const g=l._zod.parent;if(g&&g!==b){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(d.$ref=v.schema.$ref,v.def))for(const _ in d)_==="$ref"||_==="allOf"||_ in v.def&&JSON.stringify(d[_])===JSON.stringify(v.def[_])&&delete d[_]}e.override({zodSchema:l,jsonSchema:d,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const c=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?i.$defs=c:i.definitions=c);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jp(t,"input",e.processors),output:Jp(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function os(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return os(r.element,n);if(r.type==="set")return os(r.valueType,n);if(r.type==="lazy")return os(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return os(r.innerType,n);if(r.type==="intersection")return os(r.left,n)||os(r.right,n);if(r.type==="record"||r.type==="map")return os(r.keyType,n)||os(r.valueType,n);if(r.type==="pipe")return os(r.in,n)||os(r.out,n);if(r.type==="object"){for(const i in r.shape)if(os(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(os(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(os(i,n))return!0;return!!(r.rest&&os(r.rest,n))}return!1}const aZ=(e,t={})=>n=>{const r=vD({...n,processors:t});return Vn(e,r),SD(r,e),_D(r,e)},Jp=(e,t,n={})=>r=>{const{libraryOptions:i,target:c}=r??{},l=vD({...i??{},target:c,io:t,processors:n});return Vn(e,l),SD(l,e),_D(l,e)},cZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lZ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:c,maximum:l,format:f,patterns:d,contentEncoding:h}=e._zod.bag;if(typeof c=="number"&&(i.minLength=c),typeof l=="number"&&(i.maxLength=l),f&&(i.format=cZ[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),h&&(i.contentEncoding=h),d&&d.size>0){const b=[...d];b.length===1?i.pattern=b[0].source:b.length>1&&(i.allOf=[...b.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},uZ=(e,t,n,r)=>{const i=n,{minimum:c,maximum:l,format:f,multipleOf:d,exclusiveMaximum:h,exclusiveMinimum:b}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof b=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=b,i.exclusiveMinimum=!0):i.exclusiveMinimum=b),typeof c=="number"&&(i.minimum=c,typeof b=="number"&&t.target!=="draft-04"&&(b>=c?delete i.minimum:delete i.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h),typeof l=="number"&&(i.maximum=l,typeof h=="number"&&t.target!=="draft-04"&&(h<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},fZ=(e,t,n,r)=>{n.type="boolean"},dZ=(e,t,n,r)=>{n.not={}},hZ=(e,t,n,r)=>{},pZ=(e,t,n,r)=>{const i=e._zod.def,c=eD(i.entries);c.every(l=>typeof l=="number")&&(n.type="number"),c.every(l=>typeof l=="string")&&(n.type="string"),n.enum=c},mZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yZ=(e,t,n,r)=>{const i=n,c=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=Vn(c.element,t,{...r,path:[...r.path,"items"]})},bZ=(e,t,n,r)=>{const i=n,c=e._zod.def;i.type="object",i.properties={};const l=c.shape;for(const h in l)i.properties[h]=Vn(l[h],t,{...r,path:[...r.path,"properties",h]});const f=new Set(Object.keys(l)),d=new Set([...f].filter(h=>{const b=c.shape[h]._zod;return t.io==="input"?b.optin===void 0:b.optout===void 0}));d.size>0&&(i.required=Array.from(d)),c.catchall?._zod.def.type==="never"?i.additionalProperties=!1:c.catchall?c.catchall&&(i.additionalProperties=Vn(c.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},vZ=(e,t,n,r)=>{const i=e._zod.def,c=i.inclusive===!1,l=i.options.map((f,d)=>Vn(f,t,{...r,path:[...r.path,c?"oneOf":"anyOf",d]}));c?n.oneOf=l:n.anyOf=l},SZ=(e,t,n,r)=>{const i=e._zod.def,c=Vn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=Vn(i.right,t,{...r,path:[...r.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,d=[...f(c)?c.allOf:[c],...f(l)?l.allOf:[l]];n.allOf=d},_Z=(e,t,n,r)=>{const i=e._zod.def,c=Vn(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},wZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType},EZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},RZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},CZ=(e,t,n,r)=>{const i=e._zod.def,c=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Vn(c,t,r);const l=t.seen.get(e);l.ref=c},AZ=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType,n.readOnly=!0},wD=(e,t,n,r)=>{const i=e._zod.def;Vn(i.innerType,t,r);const c=t.seen.get(e);c.ref=i.innerType},TZ=de("ZodISODateTime",(e,t)=>{kF.init(e,t),tn.init(e,t)});function IZ(e){return zG(TZ,e)}const OZ=de("ZodISODate",(e,t)=>{PF.init(e,t),tn.init(e,t)});function MZ(e){return BG(OZ,e)}const DZ=de("ZodISOTime",(e,t)=>{NF.init(e,t),tn.init(e,t)});function kZ(e){return $G(DZ,e)}const PZ=de("ZodISODuration",(e,t)=>{LF.init(e,t),tn.init(e,t)});function NZ(e){return UG(PZ,e)}const LZ=(e,t)=>{oD.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Rq(e,n)},flatten:{value:n=>xq(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,gv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,gv,2)}},isEmpty:{get(){return e.issues.length===0}}})},wr=de("ZodError",LZ,{Parent:Error}),zZ=Mm(wr),BZ=Dm(wr),$Z=km(wr),UZ=Pm(wr),jZ=Tq(wr),HZ=Iq(wr),VZ=Oq(wr),qZ=Mq(wr),FZ=Dq(wr),GZ=kq(wr),ZZ=Pq(wr),KZ=Nq(wr),fn=de("ZodType",(e,t)=>(un.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jp(e,"input"),output:Jp(e,"output")}}),e.toJSONSchema=aZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(aa(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>ca(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>zZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$Z(e,n,r),e.parseAsync=async(n,r)=>BZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>UZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>jZ(e,n,r),e.decode=(n,r)=>HZ(e,n,r),e.encodeAsync=async(n,r)=>VZ(e,n,r),e.decodeAsync=async(n,r)=>qZ(e,n,r),e.safeEncode=(n,r)=>FZ(e,n,r),e.safeDecode=(n,r)=>GZ(e,n,r),e.safeEncodeAsync=async(n,r)=>ZZ(e,n,r),e.safeDecodeAsync=async(n,r)=>KZ(e,n,r),e.refine=(n,r)=>e.check(VK(n,r)),e.superRefine=n=>e.check(qK(n)),e.overwrite=n=>e.check($l(n)),e.optional=()=>fT(e),e.exactOptional=()=>OK(e),e.nullable=()=>dT(e),e.nullish=()=>fT(dT(e)),e.nonoptional=n=>LK(e,n),e.array=()=>vK(e),e.or=n=>EK([e,n]),e.and=n=>RK(e,n),e.transform=n=>hT(e,TK(n)),e.default=n=>kK(e,n),e.prefault=n=>NK(e,n),e.catch=n=>BK(e,n),e.pipe=n=>hT(e,n),e.readonly=()=>jK(e),e.describe=n=>{const r=e.clone();return gf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return gf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return gf.get(e);const r=e.clone();return gf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ED=de("_ZodString",(e,t)=>{wS.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,c)=>lZ(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(GG(...r)),e.includes=(...r)=>e.check(QG(...r)),e.startsWith=(...r)=>e.check(YG(...r)),e.endsWith=(...r)=>e.check(XG(...r)),e.min=(...r)=>e.check(Wp(...r)),e.max=(...r)=>e.check(yD(...r)),e.length=(...r)=>e.check(bD(...r)),e.nonempty=(...r)=>e.check(Wp(1,...r)),e.lowercase=r=>e.check(ZG(r)),e.uppercase=r=>e.check(KG(r)),e.trim=()=>e.check(JG()),e.normalize=(...r)=>e.check(WG(...r)),e.toLowerCase=()=>e.check(eZ()),e.toUpperCase=()=>e.check(tZ()),e.slugify=()=>e.check(nZ())}),QZ=de("ZodString",(e,t)=>{wS.init(e,t),ED.init(e,t),e.email=n=>e.check(gG(YZ,n)),e.url=n=>e.check(_G(XZ,n)),e.jwt=n=>e.check(LG(dK,n)),e.emoji=n=>e.check(wG(WZ,n)),e.guid=n=>e.check(sT(cT,n)),e.uuid=n=>e.check(yG(ap,n)),e.uuidv4=n=>e.check(bG(ap,n)),e.uuidv6=n=>e.check(vG(ap,n)),e.uuidv7=n=>e.check(SG(ap,n)),e.nanoid=n=>e.check(EG(JZ,n)),e.guid=n=>e.check(sT(cT,n)),e.cuid=n=>e.check(xG(eK,n)),e.cuid2=n=>e.check(RG(tK,n)),e.ulid=n=>e.check(CG(nK,n)),e.base64=n=>e.check(kG(lK,n)),e.base64url=n=>e.check(PG(uK,n)),e.xid=n=>e.check(AG(sK,n)),e.ksuid=n=>e.check(TG(rK,n)),e.ipv4=n=>e.check(IG(oK,n)),e.ipv6=n=>e.check(OG(iK,n)),e.cidrv4=n=>e.check(MG(aK,n)),e.cidrv6=n=>e.check(DG(cK,n)),e.e164=n=>e.check(NG(fK,n)),e.datetime=n=>e.check(IZ(n)),e.date=n=>e.check(MZ(n)),e.time=n=>e.check(kZ(n)),e.duration=n=>e.check(NZ(n))});function aT(e){return mG(QZ,e)}const tn=de("ZodStringFormat",(e,t)=>{Xt.init(e,t),ED.init(e,t)}),YZ=de("ZodEmail",(e,t)=>{xF.init(e,t),tn.init(e,t)}),cT=de("ZodGUID",(e,t)=>{wF.init(e,t),tn.init(e,t)}),ap=de("ZodUUID",(e,t)=>{EF.init(e,t),tn.init(e,t)}),XZ=de("ZodURL",(e,t)=>{RF.init(e,t),tn.init(e,t)}),WZ=de("ZodEmoji",(e,t)=>{CF.init(e,t),tn.init(e,t)}),JZ=de("ZodNanoID",(e,t)=>{AF.init(e,t),tn.init(e,t)}),eK=de("ZodCUID",(e,t)=>{TF.init(e,t),tn.init(e,t)}),tK=de("ZodCUID2",(e,t)=>{IF.init(e,t),tn.init(e,t)}),nK=de("ZodULID",(e,t)=>{OF.init(e,t),tn.init(e,t)}),sK=de("ZodXID",(e,t)=>{MF.init(e,t),tn.init(e,t)}),rK=de("ZodKSUID",(e,t)=>{DF.init(e,t),tn.init(e,t)}),oK=de("ZodIPv4",(e,t)=>{zF.init(e,t),tn.init(e,t)}),iK=de("ZodIPv6",(e,t)=>{BF.init(e,t),tn.init(e,t)}),aK=de("ZodCIDRv4",(e,t)=>{$F.init(e,t),tn.init(e,t)}),cK=de("ZodCIDRv6",(e,t)=>{UF.init(e,t),tn.init(e,t)}),lK=de("ZodBase64",(e,t)=>{jF.init(e,t),tn.init(e,t)}),uK=de("ZodBase64URL",(e,t)=>{VF.init(e,t),tn.init(e,t)}),fK=de("ZodE164",(e,t)=>{qF.init(e,t),tn.init(e,t)}),dK=de("ZodJWT",(e,t)=>{GF.init(e,t),tn.init(e,t)}),xD=de("ZodNumber",(e,t)=>{hD.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,c)=>uZ(e,r,i),e.gt=(r,i)=>e.check(oT(r,i)),e.gte=(r,i)=>e.check(ib(r,i)),e.min=(r,i)=>e.check(ib(r,i)),e.lt=(r,i)=>e.check(rT(r,i)),e.lte=(r,i)=>e.check(ob(r,i)),e.max=(r,i)=>e.check(ob(r,i)),e.int=r=>e.check(lT(r)),e.safe=r=>e.check(lT(r)),e.positive=r=>e.check(oT(0,r)),e.nonnegative=r=>e.check(ib(0,r)),e.negative=r=>e.check(rT(0,r)),e.nonpositive=r=>e.check(ob(0,r)),e.multipleOf=(r,i)=>e.check(iT(r,i)),e.step=(r,i)=>e.check(iT(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function VRe(e){return jG(xD,e)}const hK=de("ZodNumberFormat",(e,t)=>{ZF.init(e,t),xD.init(e,t)});function lT(e){return HG(hK,e)}const pK=de("ZodBoolean",(e,t)=>{KF.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fZ(e,n,r)});function qRe(e){return VG(pK,e)}const mK=de("ZodUnknown",(e,t)=>{QF.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hZ()});function uT(){return qG(mK)}const gK=de("ZodNever",(e,t)=>{YF.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dZ(e,n,r)});function yK(e){return FG(gK,e)}const bK=de("ZodArray",(e,t)=>{XF.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yZ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Wp(n,r)),e.nonempty=n=>e.check(Wp(1,n)),e.max=(n,r)=>e.check(yD(n,r)),e.length=(n,r)=>e.check(bD(n,r)),e.unwrap=()=>e.element});function vK(e,t){return sZ(bK,e,t)}const SK=de("ZodObject",(e,t)=>{JF.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bZ(e,n,r,i),Dt(e,"shape",()=>t.shape),e.keyof=()=>CK(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:uT()}),e.loose=()=>e.clone({...e._zod.def,catchall:uT()}),e.strict=()=>e.clone({...e._zod.def,catchall:yK()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>vq(e,n),e.safeExtend=n=>Sq(e,n),e.merge=n=>_q(e,n),e.pick=n=>yq(e,n),e.omit=n=>bq(e,n),e.partial=(...n)=>wq(RD,e,n[0]),e.required=(...n)=>Eq(CD,e,n[0])});function _K(e,t){const n={type:"object",shape:e??{},...Ue(t)};return new SK(n)}const wK=de("ZodUnion",(e,t)=>{eG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vZ(e,n,r,i),e.options=t.options});function EK(e,t){return new wK({type:"union",options:e,...Ue(t)})}const xK=de("ZodIntersection",(e,t)=>{tG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SZ(e,n,r,i)});function RK(e,t){return new xK({type:"intersection",left:e,right:t})}const bv=de("ZodEnum",(e,t)=>{nG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,c)=>pZ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const c={};for(const l of r)if(n.has(l))c[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new bv({...t,checks:[],...Ue(i),entries:c})},e.exclude=(r,i)=>{const c={...t.entries};for(const l of r)if(n.has(l))delete c[l];else throw new Error(`Key ${l} not found in enum`);return new bv({...t,checks:[],...Ue(i),entries:c})}});function CK(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new bv({type:"enum",entries:n,...Ue(t)})}const AK=de("ZodTransform",(e,t)=>{sG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new WM(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(Lf(c,n.value,t));else{const l=c;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Lf(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(c=>(n.value=c,n)):(n.value=i,n)}});function TK(e){return new AK({type:"transform",transform:e})}const RD=de("ZodOptional",(e,t)=>{gD.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function fT(e){return new RD({type:"optional",innerType:e})}const IK=de("ZodExactOptional",(e,t)=>{rG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function OK(e){return new IK({type:"optional",innerType:e})}const MK=de("ZodNullable",(e,t)=>{oG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_Z(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function dT(e){return new MK({type:"nullable",innerType:e})}const DK=de("ZodDefault",(e,t)=>{iG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kK(e,t){return new DK({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():nD(t)}})}const PK=de("ZodPrefault",(e,t)=>{aG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function NK(e,t){return new PK({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():nD(t)}})}const CD=de("ZodNonOptional",(e,t)=>{cG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LK(e,t){return new CD({type:"nonoptional",innerType:e,...Ue(t)})}const zK=de("ZodCatch",(e,t)=>{lG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BK(e,t){return new zK({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const $K=de("ZodPipe",(e,t)=>{uG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CZ(e,n,r,i),e.in=t.in,e.out=t.out});function hT(e,t){return new $K({type:"pipe",in:e,out:t})}const UK=de("ZodReadonly",(e,t)=>{fG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jK(e){return new UK({type:"readonly",innerType:e})}const HK=de("ZodCustom",(e,t)=>{dG.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mZ(e,n)});function VK(e,t={}){return rZ(HK,e,t)}function qK(e){return oZ(e)}const ES="hive:v1:aws-credentials",FK=_K({accessKeyId:aT().min(16,"Access Key ID must be at least 16 characters"),secretAccessKey:aT().min(1,"Secret Access Key is required")});let ko;function Lm(){if(ko!==void 0)return ko;try{const e=localStorage.getItem(ES);if(!e)return ko=null,null;const t=JSON.parse(e),n=FK.safeParse(t);return ko=n.success?n.data:null,ko}catch{return ko=null,null}}function FRe(e){try{localStorage.setItem(ES,JSON.stringify(e)),ko=e}catch{ko=e}}function GK(){try{localStorage.removeItem(ES)}catch{}ko=null}const AD=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),TD=e=>({httpHandler:e.httpHandler()});var zf;(function(e){e.HTTP="http",e.HTTPS="https"})(zf||(zf={}));var Bf;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(Bf||(Bf={}));const vv="__smithy_context";class kn{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const n=new kn({...t,headers:{...t.headers}});return n.query&&(n.query=ZK(n.query)),n}static isInstance(t){if(!t)return!1;const n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return kn.clone(this)}}function ZK(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}class ac{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const n=t;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}const KK=e=>t=>async n=>{if(!kn.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let c=r.hostname;r.port!=null&&(c+=`:${r.port}`),r.headers.host=c}return t(n)},QK={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},ID=e=>({applyToStack:t=>{t.add(KK(e),QK)}}),YK=()=>(e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:c,logger:l,dynamoDbDocumentClientOptions:f={}}=t,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:h}=f,b=d??t.inputFilterSensitiveLog,g=h??t.outputFilterSensitiveLog,{$metadata:v,..._}=r.output;return l?.info?.({clientName:i,commandName:c,input:b(n.input),output:g(_),metadata:v}),r}catch(r){const{clientName:i,commandName:c,logger:l,dynamoDbDocumentClientOptions:f={}}=t,{overrideInputFilterSensitiveLog:d}=f,h=d??t.inputFilterSensitiveLog;throw l?.error?.({clientName:i,commandName:c,input:h(n.input),error:r,metadata:r.$metadata}),r}},XK={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},OD=e=>({applyToStack:t=>{t.add(YK(),XK)}}),WK={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},JK=()=>e=>async t=>e(t),MD=e=>({applyToStack:t=>{t.add(JK(),WK)}}),qo=e=>e[vv]||(e[vv]={}),Fs=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},eQ=(e,t)=>{if(!t||t.length===0)return e;const n=[];for(const r of t)for(const i of e)i.schemeId.split("#")[1]===r&&n.push(i);for(const r of e)n.find(({schemeId:i})=>i===r.schemeId)||n.push(r);return n};function tQ(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}const nQ=(e,t)=>(n,r)=>async i=>{const c=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),l=e.authSchemePreference?await e.authSchemePreference():[],f=eQ(c,l),d=tQ(e.httpAuthSchemes),h=qo(r),b=[];for(const g of f){const v=d.get(g.schemeId);if(!v){b.push(`HttpAuthScheme \`${g.schemeId}\` was not enabled for this service.`);continue}const _=v.identityProvider(await t.identityProviderConfigProvider(e));if(!_){b.push(`HttpAuthScheme \`${g.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:w={},signingProperties:E={}}=g.propertiesExtractor?.(e,r)||{};g.identityProperties=Object.assign(g.identityProperties||{},w),g.signingProperties=Object.assign(g.signingProperties||{},E),h.selectedHttpAuthScheme={httpAuthOption:g,identity:await _(g.identityProperties),signer:v.signer};break}if(!h.selectedHttpAuthScheme)throw new Error(b.join(` +`));return n(i)},sQ={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},DD=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(nQ(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),sQ)}}),rQ={name:"serializerMiddleware"},oQ=e=>t=>{throw t},iQ=(e,t)=>{},aQ=e=>(t,n)=>async r=>{if(!kn.isInstance(r.request))return t(r);const c=qo(n).selectedHttpAuthScheme;if(!c)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:l={}},identity:f,signer:d}=c,h=await t({...r,request:await d.sign(r.request,f,l)}).catch((d.errorHandler||oQ)(l));return(d.successHandler||iQ)(h.response,l),h},kD={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},PD=e=>({applyToStack:t=>{t.addRelativeTo(aQ(),kD)}}),El=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},ND="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pT=Object.entries(ND).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),cQ=ND.split(""),xl=6,wf=8,lQ=63,cc=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let i=0;i>=xl;const f=i/4*3;c>>=l%wf;const d=Math.floor(l/wf);for(let h=0;h>b)}}return new Uint8Array(n)},jo=e=>new TextEncoder().encode(e),$f=e=>typeof e=="string"?jo(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),hc=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function ea(e){let t;typeof e=="string"?t=jo(e):t=e;const n=typeof t=="object"&&typeof t.length=="number",r=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let c=0;c>b]}i+="==".slice(0,4-d)}return i}class ec extends Uint8Array{static fromString(t,n="utf-8"){if(typeof t=="string")return n==="base64"?ec.mutate(cc(t)):ec.mutate(jo(t));throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}static mutate(t){return Object.setPrototypeOf(t,ec.prototype),t}transformToString(t="utf-8"){return t==="base64"?ea(this):hc(this)}}const mT=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),uQ=(e,t)=>{const{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:i,checksumLocationName:c,streamHasher:l}=t,f=n!==void 0&&r!==void 0&&i!==void 0&&c!==void 0&&l!==void 0,d=f?l(i,e):void 0,h=e.getReader();return new ReadableStream({async pull(b){const{value:g,done:v}=await h.read();if(v){if(b.enqueue(`0\r +`),f){const _=n(await d);b.enqueue(`${c}:${_}\r `),b.enqueue(`\r `)}b.close()}else b.enqueue(`${(r(g)||0).toString(16)}\r ${g}\r -`)}})};async function fQ(e,t){let n=0;const r=[],i=e.getReader();let c=!1;for(;!c;){const{done:d,value:p}=await i.read();if(p&&(r.push(p),n+=p?.byteLength??0),n>=t)break;c=d}i.releaseLock();const l=new Uint8Array(Math.min(t,n));let f=0;for(const d of r){if(d.byteLength>l.byteLength-f){l.set(d.subarray(0,l.byteLength-f),f);break}else l.set(d,f);f+=d.length}return l}const tc=e=>encodeURIComponent(e).replace(/[!'()*]/g,dQ),dQ=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function pQ(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=tc(n),Array.isArray(r))for(let i=0,c=r.length;i{e&&setTimeout(()=>{const r=new Error(`Request did not complete within ${e} ms`);r.name="TimeoutError",n(r)},e)})}const lb={supported:void 0};class Bm{config;configProvider;static create(t){return typeof t?.handle=="function"?t:new Bm(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(n=>n||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),lb.supported===void 0&&(lb.supported=typeof Request<"u"&&"keepalive"in yT("https://[::1]"))}destroy(){}async handle(t,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);const i=r??this.config.requestTimeout,c=this.config.keepAlive===!0,l=this.config.credentials;if(n?.aborted){const O=new Error("Request aborted");return O.name="AbortError",Promise.reject(O)}let f=t.path;const d=pQ(t.query||{});d&&(f+=`?${d}`),t.fragment&&(f+=`#${t.fragment}`);let p="";if(t.username!=null||t.password!=null){const O=t.username??"",k=t.password??"";p=`${O}:${k}@`}const{port:b,method:g}=t,v=`${t.protocol}//${p}${t.hostname}${b?`:${b}`:""}${f}`,S=g==="GET"||g==="HEAD"?void 0:t.body,w={body:S,headers:new Headers(t.headers),method:g,credentials:l};this.config?.cache&&(w.cache=this.config.cache),S&&(w.duplex="half"),typeof AbortController<"u"&&(w.signal=n),lb.supported&&(w.keepalive=c),typeof this.config.requestInit=="function"&&Object.assign(w,this.config.requestInit(t));let E=()=>{};const R=yT(v,w),C=[fetch(R).then(O=>{const k=O.headers,T={};for(const j of k.entries())T[j[0]]=j[1];return O.body!=null?{response:new ac({headers:T,reason:O.statusText,statusCode:O.status,body:O.body})}:O.blob().then(j=>({response:new ac({headers:T,reason:O.statusText,statusCode:O.status,body:j})}))}),hQ(i)];return n&&C.push(new Promise((O,k)=>{const T=()=>{const $=new Error("Request aborted");$.name="AbortError",k($)};if(typeof n.addEventListener=="function"){const $=n;$.addEventListener("abort",T,{once:!0}),E=()=>$.removeEventListener("abort",T)}else n.onabort=T})),Promise.race(C).finally(E)}updateHttpClientConfig(t,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>(r[t]=n,r))}httpHandlerConfigs(){return this.config??{}}}const RS=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):mQ(e):gQ(e);async function mQ(e){const t=await yQ(e),n=cc(t);return new Uint8Array(n)}async function gQ(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:f,value:d}=await n.read();d&&(t.push(d),i+=d.length),r=f}const c=new Uint8Array(i);let l=0;for(const f of t)c.set(f,l),l+=f.length;return c}function yQ(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(r.readyState!==2)return n(new Error("Reader aborted too early"));const i=r.result??"",c=i.indexOf(","),l=c>-1?c+1:i.length;t(i.substring(l))},r.onabort=()=>n(new Error("Read aborted")),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}const BD={},wv={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),BD[e]=t,wv[t]=e}function $D(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n{if(!vT(e)&&!gT(e)){const i=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${i}`)}let t=!1;const n=async()=>{if(t)throw new Error(bT);return t=!0,await RS(e)},r=i=>{if(typeof i.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled. -If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(e,{transformToByteArray:n,transformToString:async i=>{const c=await n();if(i==="base64")return ea(c);if(i==="hex")return _s(c);if(i===void 0||i==="utf8"||i==="utf-8")return pc(c);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(c);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(bT);if(t=!0,vT(e))return r(e);if(gT(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},vT=e=>typeof Blob=="function"&&e instanceof Blob;async function bQ(e){return typeof e.stream=="function"&&(e=e.stream()),e.tee()}const Qi=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return ec.mutate(e);if(!e)return ec.mutate(new Uint8Array);const n=t.streamCollector(e);return ec.mutate(await n)};function tm(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}const wh=e=>typeof e=="function"?e():e,jD=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i}),vQ=e=>(t,n)=>async r=>{const{response:i}=await t(r),{operationSchema:c}=qo(n),[,l,f,d,p,b]=c??[];try{const g=await e.protocol.deserializeResponse(jD(l,f,d,p,b),{...e,...n},i);return{response:i,output:g}}catch(g){if(Object.defineProperty(g,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in g)){const v="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{g.message+=` - `+v}catch{!n.logger||n.logger?.constructor?.name==="NoOpLogger"?console.warn(v):n.logger?.warn?.(v)}typeof g.$responseBodyText<"u"&&g.$response&&(g.$response.body=g.$responseBodyText);try{if(ac.isInstance(i)){const{headers:S={}}=i,w=Object.entries(S);g.$metadata={httpStatusCode:i.statusCode,requestId:ub(/^x-[\w-]+-request-?id$/,w),extendedRequestId:ub(/^x-[\w-]+-id-2$/,w),cfId:ub(/^x-[\w-]+-cf-id$/,w)}}}catch{}}throw g}},ub=(e,t)=>(t.find(([n])=>n.match(e))||[void 0,void 0])[1],SQ=e=>(t,n)=>async r=>{const{operationSchema:i}=qo(n),[,c,l,f,d,p]=i??[],b=n.endpointV2?.url&&e.urlParser?async()=>e.urlParser(n.endpointV2.url):e.endpoint,g=await e.protocol.serializeRequest(jD(c,l,f,d,p),r.input,{...e,...n,endpoint:b});return t({...r,request:g})},_Q={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},wQ={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function HD(e){return{applyToStack:t=>{t.add(SQ(e),wQ),t.add(vQ(e),_Q),e.protocol.setSerdeContext(e)}}}function gl(e){if(typeof e=="object")return e;e=e|0;const t={};let n=0;for(const r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(e>>n++&1)===1&&(t[r]=1);return t}const ST={it:Symbol.for("@smithy/nor-struct-it")};class Ct{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=Ct.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,n){this.ref=t,this.memberName=n;const r=[];let i=t,c=t;for(this._isMemberSchema=!1;fb(i);)r.push(i[1]),i=i[0],c=wh(i),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let l=r.length-1;l>=0;--l){const f=r[l];Object.assign(this.memberTraits,gl(f))}}else this.memberTraits=0;if(c instanceof Ct){const l=this.memberTraits;Object.assign(this,c),this.memberTraits=Object.assign({},l,c.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=n??c.memberName;return}if(this.schema=wh(c),EQ(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(c),this.traits=0),this._isMemberSchema&&!n)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](t){const n=this.prototype.isPrototypeOf(t);return!n&&typeof t=="object"&&t!==null?t.symbol===this.symbol:n}static of(t){const n=wh(t);if(n instanceof Ct)return n;if(fb(n)){const[r,i]=n;if(r instanceof Ct)return Object.assign(r.getMergedTraits(),gl(i)),r;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}return new Ct(n)}getSchema(){const t=this.schema;return Array.isArray(t)&&t[0]===0?t[4]:t}getName(t=!1){const{name:n}=this;return!t&&n&&n.includes("#")?n.split("#")[1]:n||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const t=this.getSchema();return typeof t=="number"?t>=64&&t<128:t[0]===1}isMapSchema(){const t=this.getSchema();return typeof t=="number"?t>=128&&t<=255:t[0]===2}isStructSchema(){const t=this.getSchema();if(typeof t!="object")return!1;const n=t[0];return n===3||n===-3||n===4}isUnionSchema(){const t=this.getSchema();return typeof t!="object"?!1:t[0]===4}isBlobSchema(){const t=this.getSchema();return t===21||t===42}isTimestampSchema(){const t=this.getSchema();return typeof t=="number"&&t>=4&&t<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:t}=this.getMergedTraits();return!!t||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return gl(this.memberTraits)}getOwnTraits(){return gl(this.traits)}getKeySchema(){const[t,n]=[this.isDocumentSchema(),this.isMapSchema()];if(!t&&!n)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const r=this.getSchema(),i=t?15:r[4]??0;return ff([i,0],"key")}getValueSchema(){const t=this.getSchema(),[n,r,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],c=typeof t=="number"?63&t:t&&typeof t=="object"&&(r||i)?t[3+t[0]]:n?15:void 0;if(c!=null)return ff([c,0],r?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(t){const n=this.getSchema();if(this.isStructSchema()&&n[4].includes(t)){const r=n[4].indexOf(t),i=n[5][r];return ff(fb(i)?i:[i,0],t)}if(this.isDocumentSchema())return ff([15,0],t);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${t}.`)}getMemberSchemas(){const t={};try{for(const[n,r]of this.structIterator())t[n]=r}catch{}return t}getEventStreamMember(){if(this.isStructSchema()){for(const[t,n]of this.structIterator())if(n.isStreaming()&&n.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const t=this.getSchema(),n=t[4].length;let r=t[ST.it];if(r&&n===r.length){yield*r;return}r=Array(n);for(let i=0;iArray.isArray(e)&&e.length===2,EQ=e=>Array.isArray(e)&&e.length>=5;class ts{namespace;schemas;exceptions;static registries=new Map;constructor(t,n=new Map,r=new Map){this.namespace=t,this.schemas=n,this.exceptions=r}static for(t){return ts.registries.has(t)||ts.registries.set(t,new ts(t)),ts.registries.get(t)}copyFrom(t){const{schemas:n,exceptions:r}=this;for(const[i,c]of t.schemas)n.has(i)||n.set(i,c);for(const[i,c]of t.exceptions)r.has(i)||r.set(i,c)}register(t,n){const r=this.normalizeShapeId(t);for(const i of[this,ts.for(r.split("#")[0])])i.schemas.set(r,n)}getSchema(t){const n=this.normalizeShapeId(t);if(!this.schemas.has(n))throw new Error(`@smithy/core/schema - schema not found for ${n}`);return this.schemas.get(n)}registerError(t,n){const r=t,i=r[1];for(const c of[this,ts.for(i)])c.schemas.set(i+"#"+r[2],r),c.exceptions.set(r,n)}getErrorCtor(t){const n=t;return this.exceptions.has(n)?this.exceptions.get(n):ts.for(n[1]).exceptions.get(n)}getBaseException(){for(const t of this.exceptions.keys())if(Array.isArray(t)){const[,n,r]=t,i=n+"#"+r;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return t}}find(t){return[...this.schemas.values()].find(t)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(t){return t.includes("#")?t:this.namespace+"#"+t}}const xQ=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&DQ.warn(MQ(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},RQ=Math.ceil(2**127*(2-2**-23)),_T=e=>{const t=xQ(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>RQ)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},CQ=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},wT=e=>VD(e,16),ET=e=>VD(e,8),VD=(e,t)=>{const n=CQ(e);if(n!==void 0&&AQ(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},AQ=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},TQ=e=>_T(typeof e=="string"?CS(e):e),IQ=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,CS=e=>{const t=e.match(IQ);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},Ev=e=>wT(typeof e=="string"?CS(e):e),OQ=e=>ET(typeof e=="string"?CS(e):e),MQ=e=>String(new TypeError(e).stack||e).split(` +`)}})};async function fQ(e,t){let n=0;const r=[],i=e.getReader();let c=!1;for(;!c;){const{done:d,value:h}=await i.read();if(h&&(r.push(h),n+=h?.byteLength??0),n>=t)break;c=d}i.releaseLock();const l=new Uint8Array(Math.min(t,n));let f=0;for(const d of r){if(d.byteLength>l.byteLength-f){l.set(d.subarray(0,l.byteLength-f),f);break}else l.set(d,f);f+=d.length}return l}const tc=e=>encodeURIComponent(e).replace(/[!'()*]/g,dQ),dQ=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function hQ(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=tc(n),Array.isArray(r))for(let i=0,c=r.length;i{e&&setTimeout(()=>{const r=new Error(`Request did not complete within ${e} ms`);r.name="TimeoutError",n(r)},e)})}const ab={supported:void 0};class zm{config;configProvider;static create(t){return typeof t?.handle=="function"?t:new zm(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(n=>n||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),ab.supported===void 0&&(ab.supported=typeof Request<"u"&&"keepalive"in gT("https://[::1]"))}destroy(){}async handle(t,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);const i=r??this.config.requestTimeout,c=this.config.keepAlive===!0,l=this.config.credentials;if(n?.aborted){const I=new Error("Request aborted");return I.name="AbortError",Promise.reject(I)}let f=t.path;const d=hQ(t.query||{});d&&(f+=`?${d}`),t.fragment&&(f+=`#${t.fragment}`);let h="";if(t.username!=null||t.password!=null){const I=t.username??"",k=t.password??"";h=`${I}:${k}@`}const{port:b,method:g}=t,v=`${t.protocol}//${h}${t.hostname}${b?`:${b}`:""}${f}`,_=g==="GET"||g==="HEAD"?void 0:t.body,w={body:_,headers:new Headers(t.headers),method:g,credentials:l};this.config?.cache&&(w.cache=this.config.cache),_&&(w.duplex="half"),typeof AbortController<"u"&&(w.signal=n),ab.supported&&(w.keepalive=c),typeof this.config.requestInit=="function"&&Object.assign(w,this.config.requestInit(t));let E=()=>{};const R=gT(v,w),C=[fetch(R).then(I=>{const k=I.headers,T={};for(const j of k.entries())T[j[0]]=j[1];return I.body!=null?{response:new ac({headers:T,reason:I.statusText,statusCode:I.status,body:I.body})}:I.blob().then(j=>({response:new ac({headers:T,reason:I.statusText,statusCode:I.status,body:j})}))}),pQ(i)];return n&&C.push(new Promise((I,k)=>{const T=()=>{const $=new Error("Request aborted");$.name="AbortError",k($)};if(typeof n.addEventListener=="function"){const $=n;$.addEventListener("abort",T,{once:!0}),E=()=>$.removeEventListener("abort",T)}else n.onabort=T})),Promise.race(C).finally(E)}updateHttpClientConfig(t,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>(r[t]=n,r))}httpHandlerConfigs(){return this.config??{}}}const xS=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):mQ(e):gQ(e);async function mQ(e){const t=await yQ(e),n=cc(t);return new Uint8Array(n)}async function gQ(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:f,value:d}=await n.read();d&&(t.push(d),i+=d.length),r=f}const c=new Uint8Array(i);let l=0;for(const f of t)c.set(f,l),l+=f.length;return c}function yQ(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(r.readyState!==2)return n(new Error("Reader aborted too early"));const i=r.result??"",c=i.indexOf(","),l=c>-1?c+1:i.length;t(i.substring(l))},r.onabort=()=>n(new Error("Read aborted")),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}const LD={},Sv={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),LD[e]=t,Sv[t]=e}function zD(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n{if(!bT(e)&&!mT(e)){const i=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${i}`)}let t=!1;const n=async()=>{if(t)throw new Error(yT);return t=!0,await xS(e)},r=i=>{if(typeof i.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled. +If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(e,{transformToByteArray:n,transformToString:async i=>{const c=await n();if(i==="base64")return ea(c);if(i==="hex")return _s(c);if(i===void 0||i==="utf8"||i==="utf-8")return hc(c);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(c);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(yT);if(t=!0,bT(e))return r(e);if(mT(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},bT=e=>typeof Blob=="function"&&e instanceof Blob;async function bQ(e){return typeof e.stream=="function"&&(e=e.stream()),e.tee()}const Ki=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return ec.mutate(e);if(!e)return ec.mutate(new Uint8Array);const n=t.streamCollector(e);return ec.mutate(await n)};function em(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}const wp=e=>typeof e=="function"?e():e,$D=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i}),vQ=e=>(t,n)=>async r=>{const{response:i}=await t(r),{operationSchema:c}=qo(n),[,l,f,d,h,b]=c??[];try{const g=await e.protocol.deserializeResponse($D(l,f,d,h,b),{...e,...n},i);return{response:i,output:g}}catch(g){if(Object.defineProperty(g,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in g)){const v="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{g.message+=` + `+v}catch{!n.logger||n.logger?.constructor?.name==="NoOpLogger"?console.warn(v):n.logger?.warn?.(v)}typeof g.$responseBodyText<"u"&&g.$response&&(g.$response.body=g.$responseBodyText);try{if(ac.isInstance(i)){const{headers:_={}}=i,w=Object.entries(_);g.$metadata={httpStatusCode:i.statusCode,requestId:cb(/^x-[\w-]+-request-?id$/,w),extendedRequestId:cb(/^x-[\w-]+-id-2$/,w),cfId:cb(/^x-[\w-]+-cf-id$/,w)}}}catch{}}throw g}},cb=(e,t)=>(t.find(([n])=>n.match(e))||[void 0,void 0])[1],SQ=e=>(t,n)=>async r=>{const{operationSchema:i}=qo(n),[,c,l,f,d,h]=i??[],b=n.endpointV2?.url&&e.urlParser?async()=>e.urlParser(n.endpointV2.url):e.endpoint,g=await e.protocol.serializeRequest($D(c,l,f,d,h),r.input,{...e,...n,endpoint:b});return t({...r,request:g})},_Q={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},wQ={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function UD(e){return{applyToStack:t=>{t.add(SQ(e),wQ),t.add(vQ(e),_Q),e.protocol.setSerdeContext(e)}}}function yl(e){if(typeof e=="object")return e;e=e|0;const t={};let n=0;for(const r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(e>>n++&1)===1&&(t[r]=1);return t}const vT={it:Symbol.for("@smithy/nor-struct-it")};class At{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=At.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,n){this.ref=t,this.memberName=n;const r=[];let i=t,c=t;for(this._isMemberSchema=!1;lb(i);)r.push(i[1]),i=i[0],c=wp(i),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let l=r.length-1;l>=0;--l){const f=r[l];Object.assign(this.memberTraits,yl(f))}}else this.memberTraits=0;if(c instanceof At){const l=this.memberTraits;Object.assign(this,c),this.memberTraits=Object.assign({},l,c.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=n??c.memberName;return}if(this.schema=wp(c),EQ(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(c),this.traits=0),this._isMemberSchema&&!n)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](t){const n=this.prototype.isPrototypeOf(t);return!n&&typeof t=="object"&&t!==null?t.symbol===this.symbol:n}static of(t){const n=wp(t);if(n instanceof At)return n;if(lb(n)){const[r,i]=n;if(r instanceof At)return Object.assign(r.getMergedTraits(),yl(i)),r;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}return new At(n)}getSchema(){const t=this.schema;return Array.isArray(t)&&t[0]===0?t[4]:t}getName(t=!1){const{name:n}=this;return!t&&n&&n.includes("#")?n.split("#")[1]:n||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const t=this.getSchema();return typeof t=="number"?t>=64&&t<128:t[0]===1}isMapSchema(){const t=this.getSchema();return typeof t=="number"?t>=128&&t<=255:t[0]===2}isStructSchema(){const t=this.getSchema();if(typeof t!="object")return!1;const n=t[0];return n===3||n===-3||n===4}isUnionSchema(){const t=this.getSchema();return typeof t!="object"?!1:t[0]===4}isBlobSchema(){const t=this.getSchema();return t===21||t===42}isTimestampSchema(){const t=this.getSchema();return typeof t=="number"&&t>=4&&t<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:t}=this.getMergedTraits();return!!t||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return yl(this.memberTraits)}getOwnTraits(){return yl(this.traits)}getKeySchema(){const[t,n]=[this.isDocumentSchema(),this.isMapSchema()];if(!t&&!n)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const r=this.getSchema(),i=t?15:r[4]??0;return uf([i,0],"key")}getValueSchema(){const t=this.getSchema(),[n,r,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],c=typeof t=="number"?63&t:t&&typeof t=="object"&&(r||i)?t[3+t[0]]:n?15:void 0;if(c!=null)return uf([c,0],r?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(t){const n=this.getSchema();if(this.isStructSchema()&&n[4].includes(t)){const r=n[4].indexOf(t),i=n[5][r];return uf(lb(i)?i:[i,0],t)}if(this.isDocumentSchema())return uf([15,0],t);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${t}.`)}getMemberSchemas(){const t={};try{for(const[n,r]of this.structIterator())t[n]=r}catch{}return t}getEventStreamMember(){if(this.isStructSchema()){for(const[t,n]of this.structIterator())if(n.isStreaming()&&n.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const t=this.getSchema(),n=t[4].length;let r=t[vT.it];if(r&&n===r.length){yield*r;return}r=Array(n);for(let i=0;iArray.isArray(e)&&e.length===2,EQ=e=>Array.isArray(e)&&e.length>=5;class ts{namespace;schemas;exceptions;static registries=new Map;constructor(t,n=new Map,r=new Map){this.namespace=t,this.schemas=n,this.exceptions=r}static for(t){return ts.registries.has(t)||ts.registries.set(t,new ts(t)),ts.registries.get(t)}copyFrom(t){const{schemas:n,exceptions:r}=this;for(const[i,c]of t.schemas)n.has(i)||n.set(i,c);for(const[i,c]of t.exceptions)r.has(i)||r.set(i,c)}register(t,n){const r=this.normalizeShapeId(t);for(const i of[this,ts.for(r.split("#")[0])])i.schemas.set(r,n)}getSchema(t){const n=this.normalizeShapeId(t);if(!this.schemas.has(n))throw new Error(`@smithy/core/schema - schema not found for ${n}`);return this.schemas.get(n)}registerError(t,n){const r=t,i=r[1];for(const c of[this,ts.for(i)])c.schemas.set(i+"#"+r[2],r),c.exceptions.set(r,n)}getErrorCtor(t){const n=t;return this.exceptions.has(n)?this.exceptions.get(n):ts.for(n[1]).exceptions.get(n)}getBaseException(){for(const t of this.exceptions.keys())if(Array.isArray(t)){const[,n,r]=t,i=n+"#"+r;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return t}}find(t){return[...this.schemas.values()].find(t)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(t){return t.includes("#")?t:this.namespace+"#"+t}}const xQ=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&DQ.warn(MQ(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},RQ=Math.ceil(2**127*(2-2**-23)),ST=e=>{const t=xQ(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>RQ)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},CQ=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},_T=e=>jD(e,16),wT=e=>jD(e,8),jD=(e,t)=>{const n=CQ(e);if(n!==void 0&&AQ(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},AQ=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},TQ=e=>ST(typeof e=="string"?RS(e):e),IQ=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,RS=e=>{const t=e.match(IQ);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},_v=e=>_T(typeof e=="string"?RS(e):e),OQ=e=>wT(typeof e=="string"?RS(e):e),MQ=e=>String(new TypeError(e).stack||e).split(` `).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(` -`),DQ={warn:console.warn},kQ=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function nm(e){const t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),c=e.getUTCHours(),l=e.getUTCMinutes(),f=e.getUTCSeconds(),d=i<10?`0${i}`:`${i}`,p=c<10?`0${c}`:`${c}`,b=l<10?`0${l}`:`${l}`,g=f<10?`0${f}`:`${f}`;return`${kQ[r]}, ${d} ${AS[n]} ${t} ${p}:${b}:${g} GMT`}const PQ=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),NQ=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),LQ=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),XRe=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=PQ.exec(e);if(t){const[n,r,i,c,l,f,d,p]=t;return db(Ev(sm(c)),pb(i),xl(r,"day",1,31),{hours:l,minutes:f,seconds:d,fractionalMilliseconds:p})}if(t=NQ.exec(e),t){const[n,r,i,c,l,f,d,p]=t;return $Q(db(zQ(c),pb(i),xl(r,"day",1,31),{hours:l,minutes:f,seconds:d,fractionalMilliseconds:p}))}if(t=LQ.exec(e),t){const[n,r,i,c,l,f,d,p]=t;return db(Ev(sm(p)),pb(r),xl(i.trimLeft(),"day",1,31),{hours:c,minutes:l,seconds:f,fractionalMilliseconds:d})}throw new TypeError("Invalid RFC-7231 date-time value")},db=(e,t,n,r)=>{const i=t-1;return jQ(e,i,n),new Date(Date.UTC(e,i,n,xl(r.hours,"hour",0,23),xl(r.minutes,"minute",0,59),xl(r.seconds,"seconds",0,60),VQ(r.fractionalMilliseconds)))},zQ=e=>{const t=new Date().getUTCFullYear(),n=Math.floor(t/100)*100+Ev(sm(e));return ne.getTime()-new Date().getTime()>BQ?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,pb=e=>{const t=AS.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},UQ=[31,28,31,30,31,30,31,31,30,31,30,31],jQ=(e,t,n)=>{let r=UQ[t];if(t===1&&HQ(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${AS[t]} in ${e}: ${n}`)},HQ=e=>e%4===0&&(e%100!==0||e%400===0),xl=(e,t,n,r)=>{const i=OQ(sm(e));if(ir)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},VQ=e=>e==null?0:TQ("0."+e)*1e3,sm=e=>{let t=0;for(;tt.toString(16).padStart(2,"0")),$m=()=>{if(xT)return xT();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Yn[e[0]]+Yn[e[1]]+Yn[e[2]]+Yn[e[3]]+"-"+Yn[e[4]]+Yn[e[5]]+"-"+Yn[e[6]]+Yn[e[7]]+"-"+Yn[e[8]]+Yn[e[9]]+"-"+Yn[e[10]]+Yn[e[11]]+Yn[e[12]]+Yn[e[13]]+Yn[e[14]]+Yn[e[15]]},Yi=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};Yi.from=e=>e&&typeof e=="object"&&(e instanceof Yi||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?Yi(String(e)):Yi(JSON.stringify(e));Yi.fromObject=Yi.from;function FQ(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}const TS="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",IS="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",OS="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",FD="(\\d?\\d)",qD="(\\d{4})",qQ=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),GQ=new RegExp(`^${TS}, ${FD} ${IS} ${qD} ${OS} GMT$`),ZQ=new RegExp(`^${TS}, ${FD}-${IS}-(\\d\\d) ${OS} GMT$`),KQ=new RegExp(`^${TS} ${IS} ( [1-9]|\\d\\d) ${OS} ${qD}$`),QQ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],YQ=e=>{if(e==null)return;let t=NaN;if(typeof e=="number")t=e;else if(typeof e=="string"){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else typeof e=="object"&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},XQ=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC3339 timestamps must be strings");const t=qQ.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,n,r,i,c,l,f,,d,p]=t;No(r,1,12),No(i,1,31),No(c,0,23),No(l,0,59),No(f,0,60);const b=new Date(Date.UTC(Number(n),Number(r)-1,Number(i),Number(c),Number(l),Number(f),Number(d)?Math.round(parseFloat(`0.${d}`)*1e3):0));if(b.setUTCFullYear(Number(n)),p.toUpperCase()!="Z"){const[,g,v,S]=/([+-])(\d\d):(\d\d)/.exec(p)||[void 0,"+",0,0],w=g==="-"?1:-1;b.setTime(b.getTime()+w*(Number(v)*60*60*1e3+Number(S)*60*1e3))}return b},WQ=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,n,r,i,c,l,f,d;if((d=GQ.exec(e))?[,t,n,r,i,c,l,f]=d:(d=ZQ.exec(e))?([,t,n,r,i,c,l,f]=d,r=(Number(r)+1900).toString()):(d=KQ.exec(e))&&([,n,t,i,c,l,f,r]=d),r&&l){const p=Date.UTC(Number(r),QQ.indexOf(n),Number(t),Number(i),Number(c),Number(l),f?Math.round(parseFloat(`0.${f}`)*1e3):0);No(t,1,31),No(i,0,23),No(c,0,59),No(l,0,60);const b=new Date(p);return b.setUTCFullYear(Number(r)),b}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)};function No(e,t,n){const r=Number(e);if(rn)throw new Error(`Value ${r} out of range [${t}, ${n}]`)}function JQ(e,t,n){if(!Number.isInteger(n))throw new Error("Invalid number of delimiters ("+n+") for splitEvery.");const r=e.split(t),i=[];let c="";for(let l=0;l{const t=e.length,n=[];let r=!1,i,c=0;for(let l=0;l{l=l.trim();const f=l.length;return f<2?l:(l[0]==='"'&&l[f-1]==='"'&&(l=l.slice(1,f-1)),l.replace(/\\"/g,'"'))})},RT=/^-?\d*(\.\d+)?$/;class Wf{string;type;constructor(t,n){if(this.string=t,this.type=n,!RT.test(t))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!="object")return!1;const n=t;return Wf.prototype.isPrototypeOf(t)||n.type==="bigDecimal"&&RT.test(n.string)}}const eY="modulepreload",tY=function(e){return"/"+e},CT={},xt=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(b=>Promise.resolve(b).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),f=l?.nonce||l?.getAttribute("nonce");i=d(n.map(p=>{if(p=tY(p),p in CT)return;CT[p]=!0;const b=p.endsWith(".css"),g=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=b?"stylesheet":eY,b||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),b)return new Promise((S,w)=>{v.addEventListener("load",S),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(l){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=l,window.dispatchEvent(f),!f.defaultPrevented)throw l}return i.then(l=>{for(const f of l||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};class Um{serdeContext;setSerdeContext(t){this.serdeContext=t}}class ZD extends Um{options;compositeErrorRegistry;constructor(t){super(),this.options=t,this.compositeErrorRegistry=ts.for(t.defaultNamespace);for(const n of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(n)}getRequestType(){return kn}getResponseType(){return ac}setSerdeContext(t){this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,n){if("url"in n){t.protocol=n.url.protocol,t.hostname=n.url.hostname,t.port=n.url.port?Number(n.url.port):void 0,t.path=n.url.pathname,t.fragment=n.url.hash||void 0,t.username=n.url.username||void 0,t.password=n.url.password||void 0,t.query||(t.query={});for(const[r,i]of n.url.searchParams.entries())t.query[r]=i;return t}else return t.protocol=n.protocol,t.hostname=n.hostname,t.port=n.port?Number(n.port):void 0,t.path=n.path,t.query={...n.query},t}setHostPrefix(t,n,r){if(this.serdeContext?.disableHostPrefix)return;const i=Ct.of(n.input),c=gl(n.traits??{});if(c.endpoint){let l=c.endpoint?.[0];if(typeof l=="string"){const f=[...i.structIterator()].filter(([,d])=>d.getMergedTraits().hostLabel);for(const[d]of f){const p=r[d];if(typeof p!="string")throw new Error(`@smithy/core/schema - ${d} in input must be a string as hostLabel.`);l=l.replace(`{${d}}`,p)}t.hostname=l+t.hostname}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:t,requestSchema:n,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:n,initialRequest:r})}async deserializeEventStream({response:t,responseSchema:n,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:n,initialResponseContainer:r})}async loadEventStreamCapability(){const{EventStreamSerde:t}=await xt(async()=>{const{EventStreamSerde:n}=await import("./index2.js");return{EventStreamSerde:n}},[]);return new t({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,n,r,i,c){return[]}getEventStreamMarshaller(){const t=this.serdeContext;if(!t.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}}class nY extends ZD{async serializeRequest(t,n,r){const i={...n??{}},c=this.serializer,l={},f={},d=await r.endpoint(),p=Ct.of(t?.input),b=p.getSchema();let g=!1,v;const S=new kn({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:l,headers:f,body:void 0});if(d){this.updateServiceEndpoint(S,d),this.setHostPrefix(S,t,i);const w=gl(t.traits);if(w.http){S.method=w.http[0];const[E,R]=w.http[1].split("?");S.path=="/"?S.path=E:S.path+=E;const C=new URLSearchParams(R??"");Object.assign(l,Object.fromEntries(C))}}for(const[w,E]of p.structIterator()){const R=E.getMergedTraits()??{},C=i[w];if(C==null&&!E.isIdempotencyToken()){if(R.httpLabel&&(S.path.includes(`{${w}+}`)||S.path.includes(`{${w}}`)))throw new Error(`No value provided for input HTTP label: ${w}.`);continue}if(R.httpPayload)E.isStreaming()?E.isStructSchema()?i[w]&&(v=await this.serializeEventStream({eventStream:i[w],requestSchema:p})):v=C:(c.write(E,C),v=c.flush()),delete i[w];else if(R.httpLabel){c.write(E,C);const O=c.flush();S.path.includes(`{${w}+}`)?S.path=S.path.replace(`{${w}+}`,O.split("/").map(tm).join("/")):S.path.includes(`{${w}}`)&&(S.path=S.path.replace(`{${w}}`,tm(O))),delete i[w]}else if(R.httpHeader)c.write(E,C),f[R.httpHeader.toLowerCase()]=String(c.flush()),delete i[w];else if(typeof R.httpPrefixHeaders=="string"){for(const[O,k]of Object.entries(C)){const T=R.httpPrefixHeaders+O;c.write([E.getValueSchema(),{httpHeader:T}],k),f[T.toLowerCase()]=c.flush()}delete i[w]}else R.httpQuery||R.httpQueryParams?(this.serializeQuery(E,C,l),delete i[w]):g=!0}return g&&i&&(c.write(b,i),v=c.flush()),S.headers=f,S.query=l,S.body=v,S}serializeQuery(t,n,r){const i=this.serializer,c=t.getMergedTraits();if(c.httpQueryParams){for(const[l,f]of Object.entries(n))if(!(l in r)){const d=t.getValueSchema();Object.assign(d.getMergedTraits(),{...c,httpQuery:l,httpQueryParams:void 0}),this.serializeQuery(d,f,r)}return}if(t.isListSchema()){const l=!!t.getMergedTraits().sparse,f=[];for(const d of n){i.write([t.getValueSchema(),c],d);const p=i.flush();(l||p!==void 0)&&f.push(p)}r[c.httpQuery]=f}else i.write([t,c],n),r[c.httpQuery]=i.flush()}async deserializeResponse(t,n,r){const i=this.deserializer,c=Ct.of(t.output),l={};if(r.statusCode>=300){const d=await Qi(r.body,n);throw d.byteLength>0&&Object.assign(l,await i.read(15,d)),await this.handleError(t,n,r,l,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const d in r.headers){const p=r.headers[d];delete r.headers[d],r.headers[d.toLowerCase()]=p}const f=await this.deserializeHttpMessage(c,n,r,l);if(f.length){const d=await Qi(r.body,n);if(d.byteLength>0){const p=await i.read(c,d);for(const b of f)p[b]!=null&&(l[b]=p[b])}}else f.discardResponseBody&&await Qi(r.body,n);return l.$metadata=this.deserializeMetadata(r),l}async deserializeHttpMessage(t,n,r,i,c){let l;i instanceof Set?l=c:l=i;let f=!0;const d=this.deserializer,p=Ct.of(t),b=[];for(const[g,v]of p.structIterator()){const S=v.getMemberTraits();if(S.httpPayload){if(f=!1,v.isStreaming())v.isStructSchema()?l[g]=await this.deserializeEventStream({response:r,responseSchema:p}):l[g]=UD(r.body);else if(r.body){const E=await Qi(r.body,n);E.byteLength>0&&(l[g]=await d.read(v,E))}}else if(S.httpHeader){const w=String(S.httpHeader).toLowerCase(),E=r.headers[w];if(E!=null)if(v.isListSchema()){const R=v.getValueSchema();R.getMergedTraits().httpHeader=w;let C;R.isTimestampSchema()&&R.getSchema()===4?C=JQ(E,",",2):C=GD(E);const O=[];for(const k of C)O.push(await d.read(R,k.trim()));l[g]=O}else l[g]=await d.read(v,E)}else if(S.httpPrefixHeaders!==void 0){l[g]={};for(const[w,E]of Object.entries(r.headers))if(w.startsWith(S.httpPrefixHeaders)){const R=v.getValueSchema();R.getMergedTraits().httpHeader=w,l[g][w.slice(S.httpPrefixHeaders.length)]=await d.read(R,E)}}else S.httpResponseCode?l[g]=r.statusCode:b.push(g)}return b.discardResponseBody=f,b}}class sY extends ZD{async serializeRequest(t,n,r){const i=this.serializer,c={},l={},f=await r.endpoint(),d=Ct.of(t?.input),p=d.getSchema();let b;const g=new kn({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:c,headers:l,body:void 0});f&&(this.updateServiceEndpoint(g,f),this.setHostPrefix(g,t,n));const v={...n};if(n){const S=d.getEventStreamMember();if(S){if(v[S]){const w={};for(const[E,R]of d.structIterator())E!==S&&v[E]&&(i.write(R,v[E]),w[E]=i.flush());b=await this.serializeEventStream({eventStream:v[S],requestSchema:d,initialRequest:w})}}else i.write(p,v),b=i.flush()}return g.headers=l,g.query=c,g.body=b,g.method="POST",g}async deserializeResponse(t,n,r){const i=this.deserializer,c=Ct.of(t.output),l={};if(r.statusCode>=300){const d=await Qi(r.body,n);throw d.byteLength>0&&Object.assign(l,await i.read(15,d)),await this.handleError(t,n,r,l,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const d in r.headers){const p=r.headers[d];delete r.headers[d],r.headers[d.toLowerCase()]=p}const f=c.getEventStreamMember();if(f)l[f]=await this.deserializeEventStream({response:r,responseSchema:c,initialResponseContainer:l});else{const d=await Qi(r.body,n);d.byteLength>0&&Object.assign(l,await i.read(c,d))}return l.$metadata=this.deserializeMetadata(r),l}}function jm(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();const{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:c}=e.getMergedTraits();return(t.httpBindings?typeof r=="string"||i?6:c||n?5:void 0:void 0)??t.timestampFormat.default}class KD extends Um{settings;constructor(t){super(),this.settings=t}read(t,n){const r=Ct.of(t);if(r.isListSchema())return GD(n).map(i=>this.read(r.getValueSchema(),i));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??cc)(n);if(r.isTimestampSchema())switch(jm(r,this.settings)){case 5:return XQ(n);case 6:return WQ(n);case 7:return YQ(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(r.isStringSchema()){const i=r.getMergedTraits().mediaType;let c=n;if(i)return r.getMergedTraits().httpHeader&&(c=this.base64ToUtf8(c)),(i==="application/json"||i.endsWith("+json"))&&(c=Yi.from(c)),c}return r.isNumericSchema()?Number(n):r.isBigIntegerSchema()?BigInt(n):r.isBigDecimalSchema()?new Wf(n,"bigDecimal"):r.isBooleanSchema()?String(n).toLowerCase()==="true":n}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??pc)((this.serdeContext?.base64Decoder??cc)(t))}}class rY extends Um{codecDeserializer;stringDeserializer;constructor(t,n){super(),this.codecDeserializer=t,this.stringDeserializer=new KD(n)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,n){const r=Ct.of(t),i=r.getMergedTraits(),c=this.serdeContext?.utf8Encoder??pc;if(i.httpHeader||i.httpResponseCode)return this.stringDeserializer.read(r,c(n));if(i.httpPayload){if(r.isBlobSchema()){const l=this.serdeContext?.utf8Decoder??Ho;return typeof n=="string"?l(n):n}else if(r.isStringSchema())return"byteLength"in n?c(n):n}return this.codecDeserializer.read(r,n)}}class oY extends Um{settings;stringBuffer="";constructor(t){super(),this.settings=t}write(t,n){const r=Ct.of(t);switch(typeof n){case"object":if(n===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(n instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${n} when schema expected Date in ${r.getName(!0)}`);switch(jm(r,this.settings)){case 5:this.stringBuffer=n.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=nm(n);break;case 7:this.stringBuffer=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",n),this.stringBuffer=String(n.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in n){this.stringBuffer=(this.serdeContext?.base64Encoder??ea)(n);return}if(r.isListSchema()&&Array.isArray(n)){let l="";for(const f of n){this.write([r.getValueSchema(),r.getMergedTraits()],f);const d=this.flush(),p=r.getValueSchema().isTimestampSchema()?d:FQ(d);l!==""&&(l+=", "),l+=p}this.stringBuffer=l;return}this.stringBuffer=JSON.stringify(n,null,2);break;case"string":const i=r.getMergedTraits().mediaType;let c=n;if(i&&((i==="application/json"||i.endsWith("+json"))&&(c=Yi.from(c)),r.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??ea)(c.toString());return}this.stringBuffer=n;break;default:r.isIdempotencyToken()?this.stringBuffer=$m():this.stringBuffer=String(n)}}flush(){const t=this.stringBuffer;return this.stringBuffer="",t}}class iY{codecSerializer;stringSerializer;buffer;constructor(t,n,r=new oY(n)){this.codecSerializer=t,this.stringSerializer=r}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,n){const r=Ct.of(t),i=r.getMergedTraits();if(i.httpHeader||i.httpLabel||i.httpQuery){this.stringSerializer.write(r,n),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,n)}flush(){if(this.buffer!==void 0){const t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}function aY(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}class QD{authSchemes=new Map;constructor(t){for(const[n,r]of Object.entries(t))r!==void 0&&this.authSchemes.set(n,r)}getIdentityProvider(t){return this.authSchemes.get(t)}}const cY=e=>function(n){return YD(n)&&n.expiration.getTime()-Date.now()e.expiration!==void 0,fY=(e,t,n)=>{if(e===void 0)return;const r=typeof e!="function"?async()=>Promise.resolve(e):e;let i,c,l,f=!1;const d=async p=>{c||(c=r(p));try{i=await c,l=!0,f=!1}finally{c=void 0}return i};return t===void 0?async p=>((!l||p?.forceRefresh)&&(i=await d(p)),i):async p=>((!l||p?.forceRefresh)&&(i=await d(p)),f?i:n(i)?(t(i)&&await d(p),i):(f=!0,i))},dY=void 0;function pY(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function XD(e){const t=wl(e.userAgentAppId??dY),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:typeof n=="string"?[[n]]:n,userAgentAppId:async()=>{const r=await t();if(!pY(r)){const i=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof r!="string"?i?.warn("userAgentAppId must be a string or undefined."):r.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}class WD{capacity;data=new Map;parameters=[];constructor({size:t,params:n}){this.capacity=t??50,n&&(this.parameters=n)}get(t,n){const r=this.hash(t);if(r===!1)return n();if(!this.data.has(r)){if(this.data.size>this.capacity+10){const i=this.data.keys();let c=0;for(;;){const{value:l,done:f}=i.next();if(this.data.delete(l),f||++c>10)break}}this.data.set(r,n())}return this.data.get(r)}size(){return this.data.size}hash(t){let n="";const{parameters:r}=this;if(r.length===0)return!1;for(const i of r){const c=String(t[i]??"");if(c.includes("|;"))return!1;n+=c+"|;"}return n}}const hY=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),MS=e=>hY.test(e)||e.startsWith("[")&&e.endsWith("]"),mY=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Jf=(e,t=!1)=>{if(!t)return mY.test(e);const n=e.split(".");for(const r of n)if(!Jf(r))return!1;return!0},kl={},Uf="endpoints";function ta(e){return typeof e!="object"||e==null?e:"ref"in e?`$${ta(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(ta).join(", ")})`:JSON.stringify(e,null,2)}class Zs extends Error{constructor(t){super(t),this.name="EndpointError"}}const gY=(e,t)=>e===t,yY=e=>{const t=e.split("."),n=[];for(const r of t){const i=r.indexOf("[");if(i!==-1){if(r.indexOf("]")!==r.length-1)throw new Zs(`Path: '${e}' does not end with ']'`);const c=r.slice(i+1,-1);if(Number.isNaN(parseInt(c)))throw new Zs(`Invalid array index: '${c}' in path: '${e}'`);i!==0&&n.push(r.slice(0,i)),n.push(c)}else n.push(r)}return n},JD=(e,t)=>yY(t).reduce((n,r)=>{if(typeof n!="object")throw new Zs(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]},e),bY=e=>e!=null,vY=e=>!e,hb={[Bf.HTTP]:80,[Bf.HTTPS]:443},SY=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:v,port:S,protocol:w="",path:E="",query:R={}}=e,C=new URL(`${w}//${v}${S?`:${S}`:""}${E}`);return C.search=Object.entries(R).map(([O,k])=>`${O}=${k}`).join("&"),C}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:i,pathname:c,protocol:l,search:f}=t;if(f)return null;const d=l.slice(0,-1);if(!Object.values(Bf).includes(d))return null;const p=MS(i),b=n.includes(`${r}:${hb[d]}`)||typeof e=="string"&&e.includes(`${r}:${hb[d]}`),g=`${r}${b?`:${hb[d]}`:""}`;return{scheme:d,authority:g,path:c,normalizedPath:c.endsWith("/")?c:`${c}/`,isIp:p}},_Y=(e,t)=>e===t,wY=(e,t,n,r)=>t>=n||e.lengthencodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),xY={booleanEquals:gY,getAttr:JD,isSet:bY,isValidHostLabel:Jf,not:vY,parseURL:SY,stringEquals:_Y,substring:wY,uriEncode:EY},ek=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let i=0;for(;i({...t.endpointParams,...t.referenceRecord})[e],Hm=(e,t,n)=>{if(typeof e=="string")return ek(e,n);if(e.fn)return nk.callFunction(e,n);if(e.ref)return RY(e,n);throw new Zs(`'${t}': ${String(e)} is not a string, function or reference.`)},tk=({fn:e,argv:t},n)=>{const r=t.map(c=>["boolean","number"].includes(typeof c)?c:nk.evaluateExpression(c,"arg",n)),i=e.split(".");return i[0]in kl&&i[1]!=null?kl[i[0]][i[1]](...r):xY[e](...r)},nk={evaluateExpression:Hm,callFunction:tk},CY=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new Zs(`'${e}' is already defined in Reference Record.`);const r=tk(t,n);return n.logger?.debug?.(`${Uf} evaluateCondition: ${ta(t)} = ${ta(r)}`),{result:r===""?!0:!!r,...e!=null&&{toAssign:{name:e,value:r}}}},DS=(e=[],t)=>{const n={};for(const r of e){const{result:i,toAssign:c}=CY(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!i)return{result:i};c&&(n[c.name]=c.value,t.logger?.debug?.(`${Uf} assign: ${c.name} := ${ta(c.value)}`))}return{result:!0,referenceRecord:n}},AY=(e,t)=>Object.entries(e).reduce((n,[r,i])=>({...n,[r]:i.map(c=>{const l=Hm(c,"Header value entry",t);if(typeof l!="string")throw new Zs(`Header '${r}' value '${l}' is not a string`);return l})}),{}),sk=(e,t)=>Object.entries(e).reduce((n,[r,i])=>({...n,[r]:ok.getEndpointProperty(i,t)}),{}),rk=(e,t)=>{if(Array.isArray(e))return e.map(n=>rk(n,t));switch(typeof e){case"string":return ek(e,t);case"object":if(e===null)throw new Zs(`Unexpected endpoint property: ${e}`);return ok.getEndpointProperties(e,t);case"boolean":return e;default:throw new Zs(`Unexpected endpoint property type: ${typeof e}`)}},ok={getEndpointProperty:rk,getEndpointProperties:sk},TY=(e,t)=>{const n=Hm(e,"Endpoint URL",t);if(typeof n=="string")try{return new URL(n)}catch(r){throw console.error(`Failed to construct URL with ${n}`,r),r}throw new Zs(`Endpoint URL must be a string, got ${typeof n}`)},IY=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:i,referenceRecord:c}=DS(n,t);if(!i)return;const l={...t,referenceRecord:{...t.referenceRecord,...c}},{url:f,properties:d,headers:p}=r;return t.logger?.debug?.(`${Uf} Resolving endpoint from template: ${ta(r)}`),{...p!=null&&{headers:AY(p,l)},...d!=null&&{properties:sk(d,l)},url:TY(f,l)}},OY=(e,t)=>{const{conditions:n,error:r}=e,{result:i,referenceRecord:c}=DS(n,t);if(i)throw new Zs(Hm(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...c}}))},ik=(e,t)=>{for(const n of e)if(n.type==="endpoint"){const r=IY(n,t);if(r)return r}else if(n.type==="error")OY(n,t);else if(n.type==="tree"){const r=ak.evaluateTreeRule(n,t);if(r)return r}else throw new Zs(`Unknown endpoint rule: ${n}`);throw new Zs("Rules evaluation failed")},MY=(e,t)=>{const{conditions:n,rules:r}=e,{result:i,referenceRecord:c}=DS(n,t);if(i)return ak.evaluateRules(r,{...t,referenceRecord:{...t.referenceRecord,...c}})},ak={evaluateRules:ik,evaluateTreeRule:MY},ck=(e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:i,rules:c}=e;t.logger?.debug?.(`${Uf} Initial EndpointParams: ${ta(n)}`);const l=Object.entries(i).filter(([,p])=>p.default!=null).map(([p,b])=>[p,b.default]);if(l.length>0)for(const[p,b]of l)n[p]=n[p]??b;const f=Object.entries(i).filter(([,p])=>p.required).map(([p])=>p);for(const p of f)if(n[p]==null)throw new Zs(`Missing required parameter: '${p}'`);const d=ik(c,{endpointParams:n,logger:r,referenceRecord:{}});return t.logger?.debug?.(`${Uf} Resolved endpoint: ${ta(d)}`),d},lk=(e,t=!1)=>{if(t){for(const n of e.split("."))if(!lk(n))return!1;return!0}return!(!Jf(e)||e.length<3||e.length>63||e!==e.toLowerCase()||MS(e))},AT=":",DY="/",kY=e=>{const t=e.split(AT);if(t.length<6)return null;const[n,r,i,c,l,...f]=t;if(n!=="arn"||r===""||i===""||f.join(AT)==="")return null;const d=f.map(p=>p.split(DY)).flat();return{partition:r,service:i,region:c,accountId:l,resourceId:d}},PY=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],NY={partitions:PY};let LY=NY;const zY=e=>{const{partitions:t}=LY;for(const r of t){const{regions:i,outputs:c}=r;for(const[l,f]of Object.entries(i))if(l===e)return{...c,...f}}for(const r of t){const{regionRegex:i,outputs:c}=r;if(new RegExp(i).test(e))return{...c}}const n=t.find(r=>r.id==="aws");if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},BY={isVirtualHostableS3Bucket:lk,parseArn:kY,partition:zY};kl.aws=BY;function $Y(e){const t={};if(e=e.replace(/^\?/,""),e)for(const n of e.split("&")){let[r,i=null]=n.split("=");r=decodeURIComponent(r),i&&(i=decodeURIComponent(i)),r in t?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i}return t}const jf=e=>{if(typeof e=="string")return jf(new URL(e));const{hostname:t,pathname:n,port:r,protocol:i,search:c}=e;let l;return c&&(l=$Y(c)),{hostname:t,port:r?parseInt(r):void 0,protocol:i,path:n,query:l}};function UY(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}function Pr(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}const TT=e=>ac.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,kS=e=>new Date(Date.now()+e),jY=(e,t)=>Math.abs(kS(t).getTime()-e)>=3e5,IT=(e,t)=>{const n=Date.parse(e);return jY(n,t)?n-Date.now():t},xf=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},uk=async e=>{const t=xf("context",e.context),n=xf("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],c=await xf("signer",n.signer)(r),l=e?.signingRegion,f=e?.signingRegionSet,d=e?.signingName;return{config:n,signer:c,signingRegion:l,signingRegionSet:f,signingName:d}};class PS{async sign(t,n,r){if(!kn.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await uk(r),{config:c,signer:l}=i;let{signingRegion:f,signingName:d}=i;const p=r.context;if(p?.authSchemes?.length??!1){const[g,v]=p.authSchemes;g?.name==="sigv4a"&&v?.name==="sigv4"&&(f=v?.signingRegion??f,d=v?.signingName??d)}return await l.sign(t,{signingDate:kS(c.systemClockOffset),signingRegion:f,signingService:d})}errorHandler(t){return n=>{const r=n.ServerTime??TT(n.$response);if(r){const i=xf("config",t.config),c=i.systemClockOffset;i.systemClockOffset=IT(r,i.systemClockOffset),i.systemClockOffset!==c&&n.$metadata&&(n.$metadata.clockSkewCorrected=!0)}throw n}}successHandler(t,n){const r=TT(t);if(r){const i=xf("config",n.config);i.systemClockOffset=IT(r,i.systemClockOffset)}}}class HY extends PS{async sign(t,n,r){if(!kn.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:i,signer:c,signingRegion:l,signingRegionSet:f,signingName:d}=await uk(r),b=(await i.sigv4aSigningRegionSet?.()??f??[l]).join(",");return await c.sign(t,{signingDate:kS(i.systemClockOffset),signingRegion:b,signingService:d})}}const VY=(e,t,n)=>{let r,i,c,l=!1;const f=async()=>{i||(i=e());try{r=await i,c=!0,l=!1}finally{i=void 0}return r};return async d=>((!c||d?.forceRefresh)&&(r=await f()),r)},FY=e=>(e.sigv4aSigningRegionSet=wl(e.sigv4aSigningRegionSet),e),qY="X-Amz-Algorithm",GY="X-Amz-Credential",fk="X-Amz-Date",ZY="X-Amz-SignedHeaders",KY="X-Amz-Expires",dk="X-Amz-Signature",pk="X-Amz-Security-Token",hk="authorization",mk=fk.toLowerCase(),QY="date",YY=[hk,mk,QY],XY=dk.toLowerCase(),xv="x-amz-content-sha256",WY=pk.toLowerCase(),JY={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},eX=/^proxy-/,tX=/^sec-/,mb="AWS4-HMAC-SHA256",nX="AWS4-HMAC-SHA256-PAYLOAD",sX="UNSIGNED-PAYLOAD",rX=50,gk="aws4_request",oX=3600*24*7,ch={},gb=[],yb=(e,t,n)=>`${e}/${t}/${n}/${gk}`,iX=async(e,t,n,r,i)=>{const c=await OT(e,t.secretAccessKey,t.accessKeyId),l=`${n}:${r}:${i}:${_s(c)}:${t.sessionToken}`;if(l in ch)return ch[l];for(gb.push(l);gb.length>rX;)delete ch[gb.shift()];let f=`AWS4${t.secretAccessKey}`;for(const d of[n,r,i,gk])f=await OT(e,f,d);return ch[l]=f},OT=(e,t,n)=>{const r=new e(t);return r.update($f(n)),r.digest()},MT=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(e[i]==null)continue;const c=i.toLowerCase();(c in JY||t?.has(c)||eX.test(c)||tX.test(c))&&(!n||n&&!n.has(c))||(r[c]=e[i].trim().replace(/\s+/g," "))}return r},aX=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",bb=async({headers:e,body:t},n)=>{for(const r of Object.keys(e))if(r.toLowerCase()===xv)return e[r];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||aX(t)){const r=new n;return r.update($f(t)),_s(await r.digest())}return sX};class cX{format(t){const n=[];for(const c of Object.keys(t)){const l=Ho(c);n.push(Uint8Array.from([l.byteLength]),l,this.formatHeaderValue(t[c]))}const r=new Uint8Array(n.reduce((c,l)=>c+l.byteLength,0));let i=0;for(const c of n)r.set(c,i),i+=c.byteLength;return r}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,t.value,!1),new Uint8Array(n.buffer);case"integer":const r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,t.value,!1),new Uint8Array(r.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const c=new DataView(new ArrayBuffer(3+t.value.byteLength));c.setUint8(0,6),c.setUint16(1,t.value.byteLength,!1);const l=new Uint8Array(c.buffer);return l.set(t.value,3),l;case"string":const f=Ho(t.value),d=new DataView(new ArrayBuffer(3+f.byteLength));d.setUint8(0,7),d.setUint16(1,f.byteLength,!1);const p=new Uint8Array(d.buffer);return p.set(f,3),p;case"timestamp":const b=new Uint8Array(9);return b[0]=8,b.set(uX.fromNumber(t.value.valueOf()).bytes,1),b;case"uuid":if(!lX.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const g=new Uint8Array(17);return g[0]=9,g.set($D(t.value.replace(/\-/g,"")),1),g}}}var DT;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(DT||(DT={}));const lX=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let uX=class yk{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const n=new Uint8Array(8);for(let r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)n[r]=i;return t<0&&kT(n),new yk(n)}valueOf(){const t=this.bytes.slice(0),n=t[0]&128;return n&&kT(t),parseInt(_s(t),16)*(n?-1:1)}toString(){return String(this.valueOf())}};function kT(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const fX=(e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1},dX=(e,t={})=>{const{headers:n,query:r={}}=kn.clone(e);for(const i of Object.keys(n)){const c=i.toLowerCase();(c.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(c)||t.hoistableHeaders?.has(c))&&(r[i]=n[i],delete n[i])}return{...e,headers:n,query:r}},PT=e=>{e=kn.clone(e);for(const t of Object.keys(e.headers))YY.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},pX=({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===XY)continue;const i=tc(r);t.push(i);const c=e[r];typeof c=="string"?n[i]=`${i}=${tc(c)}`:Array.isArray(c)&&(n[i]=c.slice(0).reduce((l,f)=>l.concat([`${i}=${tc(f)}`]),[]).sort().join("&"))}return t.sort().map(r=>n[r]).filter(r=>r).join("&")},hX=e=>mX(e).toISOString().replace(/\.\d{3}Z$/,"Z"),mX=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class gX{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:n,region:r,service:i,sha256:c,uriEscapePath:l=!0}){this.service=i,this.sha256=c,this.uriEscapePath=l,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=qs(r),this.credentialProvider=qs(n)}createCanonicalRequest(t,n,r){const i=Object.keys(n).sort();return`${t.method} +`),DQ={warn:console.warn},kQ=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],CS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tm(e){const t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),c=e.getUTCHours(),l=e.getUTCMinutes(),f=e.getUTCSeconds(),d=i<10?`0${i}`:`${i}`,h=c<10?`0${c}`:`${c}`,b=l<10?`0${l}`:`${l}`,g=f<10?`0${f}`:`${f}`;return`${kQ[r]}, ${d} ${CS[n]} ${t} ${h}:${b}:${g} GMT`}const PQ=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),NQ=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),LQ=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),GRe=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=PQ.exec(e);if(t){const[n,r,i,c,l,f,d,h]=t;return ub(_v(nm(c)),fb(i),Rl(r,"day",1,31),{hours:l,minutes:f,seconds:d,fractionalMilliseconds:h})}if(t=NQ.exec(e),t){const[n,r,i,c,l,f,d,h]=t;return $Q(ub(zQ(c),fb(i),Rl(r,"day",1,31),{hours:l,minutes:f,seconds:d,fractionalMilliseconds:h}))}if(t=LQ.exec(e),t){const[n,r,i,c,l,f,d,h]=t;return ub(_v(nm(h)),fb(r),Rl(i.trimLeft(),"day",1,31),{hours:c,minutes:l,seconds:f,fractionalMilliseconds:d})}throw new TypeError("Invalid RFC-7231 date-time value")},ub=(e,t,n,r)=>{const i=t-1;return jQ(e,i,n),new Date(Date.UTC(e,i,n,Rl(r.hours,"hour",0,23),Rl(r.minutes,"minute",0,59),Rl(r.seconds,"seconds",0,60),VQ(r.fractionalMilliseconds)))},zQ=e=>{const t=new Date().getUTCFullYear(),n=Math.floor(t/100)*100+_v(nm(e));return ne.getTime()-new Date().getTime()>BQ?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,fb=e=>{const t=CS.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},UQ=[31,28,31,30,31,30,31,31,30,31,30,31],jQ=(e,t,n)=>{let r=UQ[t];if(t===1&&HQ(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${CS[t]} in ${e}: ${n}`)},HQ=e=>e%4===0&&(e%100!==0||e%400===0),Rl=(e,t,n,r)=>{const i=OQ(nm(e));if(ir)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},VQ=e=>e==null?0:TQ("0."+e)*1e3,nm=e=>{let t=0;for(;tt.toString(16).padStart(2,"0")),Bm=()=>{if(ET)return ET();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Yn[e[0]]+Yn[e[1]]+Yn[e[2]]+Yn[e[3]]+"-"+Yn[e[4]]+Yn[e[5]]+"-"+Yn[e[6]]+Yn[e[7]]+"-"+Yn[e[8]]+Yn[e[9]]+"-"+Yn[e[10]]+Yn[e[11]]+Yn[e[12]]+Yn[e[13]]+Yn[e[14]]+Yn[e[15]]},Qi=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};Qi.from=e=>e&&typeof e=="object"&&(e instanceof Qi||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?Qi(String(e)):Qi(JSON.stringify(e));Qi.fromObject=Qi.from;function qQ(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}const AS="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",TS="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",IS="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",HD="(\\d?\\d)",VD="(\\d{4})",FQ=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),GQ=new RegExp(`^${AS}, ${HD} ${TS} ${VD} ${IS} GMT$`),ZQ=new RegExp(`^${AS}, ${HD}-${TS}-(\\d\\d) ${IS} GMT$`),KQ=new RegExp(`^${AS} ${TS} ( [1-9]|\\d\\d) ${IS} ${VD}$`),QQ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],YQ=e=>{if(e==null)return;let t=NaN;if(typeof e=="number")t=e;else if(typeof e=="string"){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else typeof e=="object"&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},XQ=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC3339 timestamps must be strings");const t=FQ.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,n,r,i,c,l,f,,d,h]=t;No(r,1,12),No(i,1,31),No(c,0,23),No(l,0,59),No(f,0,60);const b=new Date(Date.UTC(Number(n),Number(r)-1,Number(i),Number(c),Number(l),Number(f),Number(d)?Math.round(parseFloat(`0.${d}`)*1e3):0));if(b.setUTCFullYear(Number(n)),h.toUpperCase()!="Z"){const[,g,v,_]=/([+-])(\d\d):(\d\d)/.exec(h)||[void 0,"+",0,0],w=g==="-"?1:-1;b.setTime(b.getTime()+w*(Number(v)*60*60*1e3+Number(_)*60*1e3))}return b},WQ=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,n,r,i,c,l,f,d;if((d=GQ.exec(e))?[,t,n,r,i,c,l,f]=d:(d=ZQ.exec(e))?([,t,n,r,i,c,l,f]=d,r=(Number(r)+1900).toString()):(d=KQ.exec(e))&&([,n,t,i,c,l,f,r]=d),r&&l){const h=Date.UTC(Number(r),QQ.indexOf(n),Number(t),Number(i),Number(c),Number(l),f?Math.round(parseFloat(`0.${f}`)*1e3):0);No(t,1,31),No(i,0,23),No(c,0,59),No(l,0,60);const b=new Date(h);return b.setUTCFullYear(Number(r)),b}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)};function No(e,t,n){const r=Number(e);if(rn)throw new Error(`Value ${r} out of range [${t}, ${n}]`)}function JQ(e,t,n){if(!Number.isInteger(n))throw new Error("Invalid number of delimiters ("+n+") for splitEvery.");const r=e.split(t),i=[];let c="";for(let l=0;l{const t=e.length,n=[];let r=!1,i,c=0;for(let l=0;l{l=l.trim();const f=l.length;return f<2?l:(l[0]==='"'&&l[f-1]==='"'&&(l=l.slice(1,f-1)),l.replace(/\\"/g,'"'))})},xT=/^-?\d*(\.\d+)?$/;class Jf{string;type;constructor(t,n){if(this.string=t,this.type=n,!xT.test(t))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!="object")return!1;const n=t;return Jf.prototype.isPrototypeOf(t)||n.type==="bigDecimal"&&xT.test(n.string)}}const eY="modulepreload",tY=function(e){return"/"+e},RT={},Rt=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(h){return Promise.all(h.map(b=>Promise.resolve(b).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),f=l?.nonce||l?.getAttribute("nonce");i=d(n.map(h=>{if(h=tY(h),h in RT)return;RT[h]=!0;const b=h.endsWith(".css"),g=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const v=document.createElement("link");if(v.rel=b?"stylesheet":eY,b||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),b)return new Promise((_,w)=>{v.addEventListener("load",_),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function c(l){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=l,window.dispatchEvent(f),!f.defaultPrevented)throw l}return i.then(l=>{for(const f of l||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};class $m{serdeContext;setSerdeContext(t){this.serdeContext=t}}class FD extends $m{options;compositeErrorRegistry;constructor(t){super(),this.options=t,this.compositeErrorRegistry=ts.for(t.defaultNamespace);for(const n of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(n)}getRequestType(){return kn}getResponseType(){return ac}setSerdeContext(t){this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,n){if("url"in n){t.protocol=n.url.protocol,t.hostname=n.url.hostname,t.port=n.url.port?Number(n.url.port):void 0,t.path=n.url.pathname,t.fragment=n.url.hash||void 0,t.username=n.url.username||void 0,t.password=n.url.password||void 0,t.query||(t.query={});for(const[r,i]of n.url.searchParams.entries())t.query[r]=i;return t}else return t.protocol=n.protocol,t.hostname=n.hostname,t.port=n.port?Number(n.port):void 0,t.path=n.path,t.query={...n.query},t}setHostPrefix(t,n,r){if(this.serdeContext?.disableHostPrefix)return;const i=At.of(n.input),c=yl(n.traits??{});if(c.endpoint){let l=c.endpoint?.[0];if(typeof l=="string"){const f=[...i.structIterator()].filter(([,d])=>d.getMergedTraits().hostLabel);for(const[d]of f){const h=r[d];if(typeof h!="string")throw new Error(`@smithy/core/schema - ${d} in input must be a string as hostLabel.`);l=l.replace(`{${d}}`,h)}t.hostname=l+t.hostname}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:t,requestSchema:n,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:n,initialRequest:r})}async deserializeEventStream({response:t,responseSchema:n,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:n,initialResponseContainer:r})}async loadEventStreamCapability(){const{EventStreamSerde:t}=await Rt(async()=>{const{EventStreamSerde:n}=await import("./index2.js");return{EventStreamSerde:n}},[]);return new t({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,n,r,i,c){return[]}getEventStreamMarshaller(){const t=this.serdeContext;if(!t.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}}class nY extends FD{async serializeRequest(t,n,r){const i={...n??{}},c=this.serializer,l={},f={},d=await r.endpoint(),h=At.of(t?.input),b=[],g=[];let v=!1,_;const w=new kn({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:l,headers:f,body:void 0});if(d){this.updateServiceEndpoint(w,d),this.setHostPrefix(w,t,i);const E=yl(t.traits);if(E.http){w.method=E.http[0];const[R,C]=E.http[1].split("?");w.path=="/"?w.path=R:w.path+=R;const I=new URLSearchParams(C??"");Object.assign(l,Object.fromEntries(I))}}for(const[E,R]of h.structIterator()){const C=R.getMergedTraits()??{},I=i[E];if(I==null&&!R.isIdempotencyToken()){if(C.httpLabel&&(w.path.includes(`{${E}+}`)||w.path.includes(`{${E}}`)))throw new Error(`No value provided for input HTTP label: ${E}.`);continue}if(C.httpPayload)R.isStreaming()?R.isStructSchema()?i[E]&&(_=await this.serializeEventStream({eventStream:i[E],requestSchema:h})):_=I:(c.write(R,I),_=c.flush()),delete i[E];else if(C.httpLabel){c.write(R,I);const k=c.flush();w.path.includes(`{${E}+}`)?w.path=w.path.replace(`{${E}+}`,k.split("/").map(em).join("/")):w.path.includes(`{${E}}`)&&(w.path=w.path.replace(`{${E}}`,em(k))),delete i[E]}else if(C.httpHeader)c.write(R,I),f[C.httpHeader.toLowerCase()]=String(c.flush()),delete i[E];else if(typeof C.httpPrefixHeaders=="string"){for(const[k,T]of Object.entries(I)){const $=C.httpPrefixHeaders+k;c.write([R.getValueSchema(),{httpHeader:$}],T),f[$.toLowerCase()]=c.flush()}delete i[E]}else C.httpQuery||C.httpQueryParams?(this.serializeQuery(R,I,l),delete i[E]):(v=!0,b.push(E),g.push(R))}if(v&&i){const[E,R]=(h.getName(!0)??"#Unknown").split("#"),C=h.getSchema()[6],I=[3,E,R,h.getMergedTraits(),b,g,void 0];C?I[6]=C:I.pop(),c.write(I,i),_=c.flush()}return w.headers=f,w.query=l,w.body=_,w}serializeQuery(t,n,r){const i=this.serializer,c=t.getMergedTraits();if(c.httpQueryParams){for(const[l,f]of Object.entries(n))if(!(l in r)){const d=t.getValueSchema();Object.assign(d.getMergedTraits(),{...c,httpQuery:l,httpQueryParams:void 0}),this.serializeQuery(d,f,r)}return}if(t.isListSchema()){const l=!!t.getMergedTraits().sparse,f=[];for(const d of n){i.write([t.getValueSchema(),c],d);const h=i.flush();(l||h!==void 0)&&f.push(h)}r[c.httpQuery]=f}else i.write([t,c],n),r[c.httpQuery]=i.flush()}async deserializeResponse(t,n,r){const i=this.deserializer,c=At.of(t.output),l={};if(r.statusCode>=300){const d=await Ki(r.body,n);throw d.byteLength>0&&Object.assign(l,await i.read(15,d)),await this.handleError(t,n,r,l,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const d in r.headers){const h=r.headers[d];delete r.headers[d],r.headers[d.toLowerCase()]=h}const f=await this.deserializeHttpMessage(c,n,r,l);if(f.length){const d=await Ki(r.body,n);if(d.byteLength>0){const h=await i.read(c,d);for(const b of f)h[b]!=null&&(l[b]=h[b])}}else f.discardResponseBody&&await Ki(r.body,n);return l.$metadata=this.deserializeMetadata(r),l}async deserializeHttpMessage(t,n,r,i,c){let l;i instanceof Set?l=c:l=i;let f=!0;const d=this.deserializer,h=At.of(t),b=[];for(const[g,v]of h.structIterator()){const _=v.getMemberTraits();if(_.httpPayload){if(f=!1,v.isStreaming())v.isStructSchema()?l[g]=await this.deserializeEventStream({response:r,responseSchema:h}):l[g]=BD(r.body);else if(r.body){const E=await Ki(r.body,n);E.byteLength>0&&(l[g]=await d.read(v,E))}}else if(_.httpHeader){const w=String(_.httpHeader).toLowerCase(),E=r.headers[w];if(E!=null)if(v.isListSchema()){const R=v.getValueSchema();R.getMergedTraits().httpHeader=w;let C;R.isTimestampSchema()&&R.getSchema()===4?C=JQ(E,",",2):C=qD(E);const I=[];for(const k of C)I.push(await d.read(R,k.trim()));l[g]=I}else l[g]=await d.read(v,E)}else if(_.httpPrefixHeaders!==void 0){l[g]={};for(const[w,E]of Object.entries(r.headers))if(w.startsWith(_.httpPrefixHeaders)){const R=v.getValueSchema();R.getMergedTraits().httpHeader=w,l[g][w.slice(_.httpPrefixHeaders.length)]=await d.read(R,E)}}else _.httpResponseCode?l[g]=r.statusCode:b.push(g)}return b.discardResponseBody=f,b}}class sY extends FD{async serializeRequest(t,n,r){const i=this.serializer,c={},l={},f=await r.endpoint(),d=At.of(t?.input),h=d.getSchema();let b;const g=new kn({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:c,headers:l,body:void 0});f&&(this.updateServiceEndpoint(g,f),this.setHostPrefix(g,t,n));const v={...n};if(n){const _=d.getEventStreamMember();if(_){if(v[_]){const w={};for(const[E,R]of d.structIterator())E!==_&&v[E]&&(i.write(R,v[E]),w[E]=i.flush());b=await this.serializeEventStream({eventStream:v[_],requestSchema:d,initialRequest:w})}}else i.write(h,v),b=i.flush()}return g.headers=l,g.query=c,g.body=b,g.method="POST",g}async deserializeResponse(t,n,r){const i=this.deserializer,c=At.of(t.output),l={};if(r.statusCode>=300){const d=await Ki(r.body,n);throw d.byteLength>0&&Object.assign(l,await i.read(15,d)),await this.handleError(t,n,r,l,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const d in r.headers){const h=r.headers[d];delete r.headers[d],r.headers[d.toLowerCase()]=h}const f=c.getEventStreamMember();if(f)l[f]=await this.deserializeEventStream({response:r,responseSchema:c,initialResponseContainer:l});else{const d=await Ki(r.body,n);d.byteLength>0&&Object.assign(l,await i.read(c,d))}return l.$metadata=this.deserializeMetadata(r),l}}function Um(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();const{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:c}=e.getMergedTraits();return(t.httpBindings?typeof r=="string"||i?6:c||n?5:void 0:void 0)??t.timestampFormat.default}class GD extends $m{settings;constructor(t){super(),this.settings=t}read(t,n){const r=At.of(t);if(r.isListSchema())return qD(n).map(i=>this.read(r.getValueSchema(),i));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??cc)(n);if(r.isTimestampSchema())switch(Um(r,this.settings)){case 5:return XQ(n);case 6:return WQ(n);case 7:return YQ(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(r.isStringSchema()){const i=r.getMergedTraits().mediaType;let c=n;if(i)return r.getMergedTraits().httpHeader&&(c=this.base64ToUtf8(c)),(i==="application/json"||i.endsWith("+json"))&&(c=Qi.from(c)),c}return r.isNumericSchema()?Number(n):r.isBigIntegerSchema()?BigInt(n):r.isBigDecimalSchema()?new Jf(n,"bigDecimal"):r.isBooleanSchema()?String(n).toLowerCase()==="true":n}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??hc)((this.serdeContext?.base64Decoder??cc)(t))}}class rY extends $m{codecDeserializer;stringDeserializer;constructor(t,n){super(),this.codecDeserializer=t,this.stringDeserializer=new GD(n)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,n){const r=At.of(t),i=r.getMergedTraits(),c=this.serdeContext?.utf8Encoder??hc;if(i.httpHeader||i.httpResponseCode)return this.stringDeserializer.read(r,c(n));if(i.httpPayload){if(r.isBlobSchema()){const l=this.serdeContext?.utf8Decoder??jo;return typeof n=="string"?l(n):n}else if(r.isStringSchema())return"byteLength"in n?c(n):n}return this.codecDeserializer.read(r,n)}}class oY extends $m{settings;stringBuffer="";constructor(t){super(),this.settings=t}write(t,n){const r=At.of(t);switch(typeof n){case"object":if(n===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(n instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${n} when schema expected Date in ${r.getName(!0)}`);switch(Um(r,this.settings)){case 5:this.stringBuffer=n.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=tm(n);break;case 7:this.stringBuffer=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",n),this.stringBuffer=String(n.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in n){this.stringBuffer=(this.serdeContext?.base64Encoder??ea)(n);return}if(r.isListSchema()&&Array.isArray(n)){let l="";for(const f of n){this.write([r.getValueSchema(),r.getMergedTraits()],f);const d=this.flush(),h=r.getValueSchema().isTimestampSchema()?d:qQ(d);l!==""&&(l+=", "),l+=h}this.stringBuffer=l;return}this.stringBuffer=JSON.stringify(n,null,2);break;case"string":const i=r.getMergedTraits().mediaType;let c=n;if(i&&((i==="application/json"||i.endsWith("+json"))&&(c=Qi.from(c)),r.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??ea)(c.toString());return}this.stringBuffer=n;break;default:r.isIdempotencyToken()?this.stringBuffer=Bm():this.stringBuffer=String(n)}}flush(){const t=this.stringBuffer;return this.stringBuffer="",t}}class iY{codecSerializer;stringSerializer;buffer;constructor(t,n,r=new oY(n)){this.codecSerializer=t,this.stringSerializer=r}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,n){const r=At.of(t),i=r.getMergedTraits();if(i.httpHeader||i.httpLabel||i.httpQuery){this.stringSerializer.write(r,n),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,n)}flush(){if(this.buffer!==void 0){const t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}function aY(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}class ZD{authSchemes=new Map;constructor(t){for(const[n,r]of Object.entries(t))r!==void 0&&this.authSchemes.set(n,r)}getIdentityProvider(t){return this.authSchemes.get(t)}}const cY=e=>function(n){return KD(n)&&n.expiration.getTime()-Date.now()e.expiration!==void 0,fY=(e,t,n)=>{if(e===void 0)return;const r=typeof e!="function"?async()=>Promise.resolve(e):e;let i,c,l,f=!1;const d=async h=>{c||(c=r(h));try{i=await c,l=!0,f=!1}finally{c=void 0}return i};return t===void 0?async h=>((!l||h?.forceRefresh)&&(i=await d(h)),i):async h=>((!l||h?.forceRefresh)&&(i=await d(h)),f?i:n(i)?(t(i)&&await d(h),i):(f=!0,i))},dY=void 0;function hY(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function QD(e){const t=El(e.userAgentAppId??dY),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:typeof n=="string"?[[n]]:n,userAgentAppId:async()=>{const r=await t();if(!hY(r)){const i=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof r!="string"?i?.warn("userAgentAppId must be a string or undefined."):r.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}class YD{capacity;data=new Map;parameters=[];constructor({size:t,params:n}){this.capacity=t??50,n&&(this.parameters=n)}get(t,n){const r=this.hash(t);if(r===!1)return n();if(!this.data.has(r)){if(this.data.size>this.capacity+10){const i=this.data.keys();let c=0;for(;;){const{value:l,done:f}=i.next();if(this.data.delete(l),f||++c>10)break}}this.data.set(r,n())}return this.data.get(r)}size(){return this.data.size}hash(t){let n="";const{parameters:r}=this;if(r.length===0)return!1;for(const i of r){const c=String(t[i]??"");if(c.includes("|;"))return!1;n+=c+"|;"}return n}}const pY=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),XD=e=>pY.test(e)||e.startsWith("[")&&e.endsWith("]"),mY=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),jm=(e,t=!1)=>{if(!t)return mY.test(e);const n=e.split(".");for(const r of n)if(!jm(r))return!1;return!0},Uf={},jf="endpoints";function ta(e){return typeof e!="object"||e==null?e:"ref"in e?`$${ta(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(ta).join(", ")})`:JSON.stringify(e,null,2)}class Zs extends Error{constructor(t){super(t),this.name="EndpointError"}}const gY=(e,t)=>e===t,yY=e=>{const t=e.split("."),n=[];for(const r of t){const i=r.indexOf("[");if(i!==-1){if(r.indexOf("]")!==r.length-1)throw new Zs(`Path: '${e}' does not end with ']'`);const c=r.slice(i+1,-1);if(Number.isNaN(parseInt(c)))throw new Zs(`Invalid array index: '${c}' in path: '${e}'`);i!==0&&n.push(r.slice(0,i)),n.push(c)}else n.push(r)}return n},WD=(e,t)=>yY(t).reduce((n,r)=>{if(typeof n!="object")throw new Zs(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]},e),bY=e=>e!=null,vY=e=>!e,db={[zf.HTTP]:80,[zf.HTTPS]:443},SY=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:v,port:_,protocol:w="",path:E="",query:R={}}=e,C=new URL(`${w}//${v}${_?`:${_}`:""}${E}`);return C.search=Object.entries(R).map(([I,k])=>`${I}=${k}`).join("&"),C}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:i,pathname:c,protocol:l,search:f}=t;if(f)return null;const d=l.slice(0,-1);if(!Object.values(zf).includes(d))return null;const h=XD(i),b=n.includes(`${r}:${db[d]}`)||typeof e=="string"&&e.includes(`${r}:${db[d]}`),g=`${r}${b?`:${db[d]}`:""}`;return{scheme:d,authority:g,path:c,normalizedPath:c.endsWith("/")?c:`${c}/`,isIp:h}},_Y=(e,t)=>e===t,wY=(e,t,n,r)=>t>=n||e.lengthencodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),xY={booleanEquals:gY,getAttr:WD,isSet:bY,isValidHostLabel:jm,not:vY,parseURL:SY,stringEquals:_Y,substring:wY,uriEncode:EY},JD=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let i=0;for(;i({...t.endpointParams,...t.referenceRecord})[e],Hm=(e,t,n)=>{if(typeof e=="string")return JD(e,n);if(e.fn)return tk.callFunction(e,n);if(e.ref)return RY(e,n);throw new Zs(`'${t}': ${String(e)} is not a string, function or reference.`)},ek=({fn:e,argv:t},n)=>{const r=t.map(c=>["boolean","number"].includes(typeof c)?c:tk.evaluateExpression(c,"arg",n)),i=e.split(".");return i[0]in Uf&&i[1]!=null?Uf[i[0]][i[1]](...r):xY[e](...r)},tk={evaluateExpression:Hm,callFunction:ek},CY=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new Zs(`'${e}' is already defined in Reference Record.`);const r=ek(t,n);return n.logger?.debug?.(`${jf} evaluateCondition: ${ta(t)} = ${ta(r)}`),{result:r===""?!0:!!r,...e!=null&&{toAssign:{name:e,value:r}}}},OS=(e=[],t)=>{const n={};for(const r of e){const{result:i,toAssign:c}=CY(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!i)return{result:i};c&&(n[c.name]=c.value,t.logger?.debug?.(`${jf} assign: ${c.name} := ${ta(c.value)}`))}return{result:!0,referenceRecord:n}},AY=(e,t)=>Object.entries(e).reduce((n,[r,i])=>({...n,[r]:i.map(c=>{const l=Hm(c,"Header value entry",t);if(typeof l!="string")throw new Zs(`Header '${r}' value '${l}' is not a string`);return l})}),{}),nk=(e,t)=>Object.entries(e).reduce((n,[r,i])=>({...n,[r]:rk.getEndpointProperty(i,t)}),{}),sk=(e,t)=>{if(Array.isArray(e))return e.map(n=>sk(n,t));switch(typeof e){case"string":return JD(e,t);case"object":if(e===null)throw new Zs(`Unexpected endpoint property: ${e}`);return rk.getEndpointProperties(e,t);case"boolean":return e;default:throw new Zs(`Unexpected endpoint property type: ${typeof e}`)}},rk={getEndpointProperty:sk,getEndpointProperties:nk},TY=(e,t)=>{const n=Hm(e,"Endpoint URL",t);if(typeof n=="string")try{return new URL(n)}catch(r){throw console.error(`Failed to construct URL with ${n}`,r),r}throw new Zs(`Endpoint URL must be a string, got ${typeof n}`)},IY=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:i,referenceRecord:c}=OS(n,t);if(!i)return;const l={...t,referenceRecord:{...t.referenceRecord,...c}},{url:f,properties:d,headers:h}=r;return t.logger?.debug?.(`${jf} Resolving endpoint from template: ${ta(r)}`),{...h!=null&&{headers:AY(h,l)},...d!=null&&{properties:nk(d,l)},url:TY(f,l)}},OY=(e,t)=>{const{conditions:n,error:r}=e,{result:i,referenceRecord:c}=OS(n,t);if(i)throw new Zs(Hm(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...c}}))},ok=(e,t)=>{for(const n of e)if(n.type==="endpoint"){const r=IY(n,t);if(r)return r}else if(n.type==="error")OY(n,t);else if(n.type==="tree"){const r=ik.evaluateTreeRule(n,t);if(r)return r}else throw new Zs(`Unknown endpoint rule: ${n}`);throw new Zs("Rules evaluation failed")},MY=(e,t)=>{const{conditions:n,rules:r}=e,{result:i,referenceRecord:c}=OS(n,t);if(i)return ik.evaluateRules(r,{...t,referenceRecord:{...t.referenceRecord,...c}})},ik={evaluateRules:ok,evaluateTreeRule:MY},ak=(e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:i,rules:c}=e;t.logger?.debug?.(`${jf} Initial EndpointParams: ${ta(n)}`);const l=Object.entries(i).filter(([,h])=>h.default!=null).map(([h,b])=>[h,b.default]);if(l.length>0)for(const[h,b]of l)n[h]=n[h]??b;const f=Object.entries(i).filter(([,h])=>h.required).map(([h])=>h);for(const h of f)if(n[h]==null)throw new Zs(`Missing required parameter: '${h}'`);const d=ok(c,{endpointParams:n,logger:r,referenceRecord:{}});return t.logger?.debug?.(`${jf} Resolved endpoint: ${ta(d)}`),d},ck=(e,t=!1)=>{if(t){for(const n of e.split("."))if(!ck(n))return!1;return!0}return!(!jm(e)||e.length<3||e.length>63||e!==e.toLowerCase()||XD(e))},CT=":",DY="/",kY=e=>{const t=e.split(CT);if(t.length<6)return null;const[n,r,i,c,l,...f]=t;if(n!=="arn"||r===""||i===""||f.join(CT)==="")return null;const d=f.map(h=>h.split(DY)).flat();return{partition:r,service:i,region:c,accountId:l,resourceId:d}},PY=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],NY={partitions:PY};let LY=NY;const zY=e=>{const{partitions:t}=LY;for(const r of t){const{regions:i,outputs:c}=r;for(const[l,f]of Object.entries(i))if(l===e)return{...c,...f}}for(const r of t){const{regionRegex:i,outputs:c}=r;if(new RegExp(i).test(e))return{...c}}const n=t.find(r=>r.id==="aws");if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},MS={isVirtualHostableS3Bucket:ck,parseArn:kY,partition:zY};Uf.aws=MS;function BY(e){const t={};if(e=e.replace(/^\?/,""),e)for(const n of e.split("&")){let[r,i=null]=n.split("=");r=decodeURIComponent(r),i&&(i=decodeURIComponent(i)),r in t?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i}return t}const Hf=e=>{if(typeof e=="string")return Hf(new URL(e));const{hostname:t,pathname:n,port:r,protocol:i,search:c}=e;let l;return c&&(l=BY(c)),{hostname:t,port:r?parseInt(r):void 0,protocol:i,path:n,query:l}};function $Y(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}function Pr(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}const AT=e=>ac.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,DS=e=>new Date(Date.now()+e),UY=(e,t)=>Math.abs(DS(t).getTime()-e)>=3e5,TT=(e,t)=>{const n=Date.parse(e);return UY(n,t)?n-Date.now():t},Ef=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},lk=async e=>{const t=Ef("context",e.context),n=Ef("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],c=await Ef("signer",n.signer)(r),l=e?.signingRegion,f=e?.signingRegionSet,d=e?.signingName;return{config:n,signer:c,signingRegion:l,signingRegionSet:f,signingName:d}};class kS{async sign(t,n,r){if(!kn.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await lk(r),{config:c,signer:l}=i;let{signingRegion:f,signingName:d}=i;const h=r.context;if(h?.authSchemes?.length??!1){const[g,v]=h.authSchemes;g?.name==="sigv4a"&&v?.name==="sigv4"&&(f=v?.signingRegion??f,d=v?.signingName??d)}return await l.sign(t,{signingDate:DS(c.systemClockOffset),signingRegion:f,signingService:d})}errorHandler(t){return n=>{const r=n.ServerTime??AT(n.$response);if(r){const i=Ef("config",t.config),c=i.systemClockOffset;i.systemClockOffset=TT(r,i.systemClockOffset),i.systemClockOffset!==c&&n.$metadata&&(n.$metadata.clockSkewCorrected=!0)}throw n}}successHandler(t,n){const r=AT(t);if(r){const i=Ef("config",n.config);i.systemClockOffset=TT(r,i.systemClockOffset)}}}class jY extends kS{async sign(t,n,r){if(!kn.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:i,signer:c,signingRegion:l,signingRegionSet:f,signingName:d}=await lk(r),b=(await i.sigv4aSigningRegionSet?.()??f??[l]).join(",");return await c.sign(t,{signingDate:DS(i.systemClockOffset),signingRegion:b,signingService:d})}}const HY=(e,t,n)=>{let r,i,c,l=!1;const f=async()=>{i||(i=e());try{r=await i,c=!0,l=!1}finally{i=void 0}return r};return async d=>((!c||d?.forceRefresh)&&(r=await f()),r)},VY=e=>(e.sigv4aSigningRegionSet=El(e.sigv4aSigningRegionSet),e),qY="X-Amz-Algorithm",FY="X-Amz-Credential",uk="X-Amz-Date",GY="X-Amz-SignedHeaders",ZY="X-Amz-Expires",fk="X-Amz-Signature",dk="X-Amz-Security-Token",hk="authorization",pk=uk.toLowerCase(),KY="date",QY=[hk,pk,KY],YY=fk.toLowerCase(),wv="x-amz-content-sha256",XY=dk.toLowerCase(),WY={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},JY=/^proxy-/,eX=/^sec-/,hb="AWS4-HMAC-SHA256",tX="AWS4-HMAC-SHA256-PAYLOAD",nX="UNSIGNED-PAYLOAD",sX=50,mk="aws4_request",rX=3600*24*7,cp={},pb=[],mb=(e,t,n)=>`${e}/${t}/${n}/${mk}`,oX=async(e,t,n,r,i)=>{const c=await IT(e,t.secretAccessKey,t.accessKeyId),l=`${n}:${r}:${i}:${_s(c)}:${t.sessionToken}`;if(l in cp)return cp[l];for(pb.push(l);pb.length>sX;)delete cp[pb.shift()];let f=`AWS4${t.secretAccessKey}`;for(const d of[n,r,i,mk])f=await IT(e,f,d);return cp[l]=f},IT=(e,t,n)=>{const r=new e(t);return r.update($f(n)),r.digest()},OT=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(e[i]==null)continue;const c=i.toLowerCase();(c in WY||t?.has(c)||JY.test(c)||eX.test(c))&&(!n||n&&!n.has(c))||(r[c]=e[i].trim().replace(/\s+/g," "))}return r},iX=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",gb=async({headers:e,body:t},n)=>{for(const r of Object.keys(e))if(r.toLowerCase()===wv)return e[r];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||iX(t)){const r=new n;return r.update($f(t)),_s(await r.digest())}return nX};class aX{format(t){const n=[];for(const c of Object.keys(t)){const l=jo(c);n.push(Uint8Array.from([l.byteLength]),l,this.formatHeaderValue(t[c]))}const r=new Uint8Array(n.reduce((c,l)=>c+l.byteLength,0));let i=0;for(const c of n)r.set(c,i),i+=c.byteLength;return r}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,t.value,!1),new Uint8Array(n.buffer);case"integer":const r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,t.value,!1),new Uint8Array(r.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const c=new DataView(new ArrayBuffer(3+t.value.byteLength));c.setUint8(0,6),c.setUint16(1,t.value.byteLength,!1);const l=new Uint8Array(c.buffer);return l.set(t.value,3),l;case"string":const f=jo(t.value),d=new DataView(new ArrayBuffer(3+f.byteLength));d.setUint8(0,7),d.setUint16(1,f.byteLength,!1);const h=new Uint8Array(d.buffer);return h.set(f,3),h;case"timestamp":const b=new Uint8Array(9);return b[0]=8,b.set(lX.fromNumber(t.value.valueOf()).bytes,1),b;case"uuid":if(!cX.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const g=new Uint8Array(17);return g[0]=9,g.set(zD(t.value.replace(/\-/g,"")),1),g}}}var MT;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(MT||(MT={}));const cX=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let lX=class gk{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const n=new Uint8Array(8);for(let r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)n[r]=i;return t<0&&DT(n),new gk(n)}valueOf(){const t=this.bytes.slice(0),n=t[0]&128;return n&&DT(t),parseInt(_s(t),16)*(n?-1:1)}toString(){return String(this.valueOf())}};function DT(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const uX=(e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1},fX=(e,t={})=>{const{headers:n,query:r={}}=kn.clone(e);for(const i of Object.keys(n)){const c=i.toLowerCase();(c.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(c)||t.hoistableHeaders?.has(c))&&(r[i]=n[i],delete n[i])}return{...e,headers:n,query:r}},kT=e=>{e=kn.clone(e);for(const t of Object.keys(e.headers))QY.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},dX=({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===YY)continue;const i=tc(r);t.push(i);const c=e[r];typeof c=="string"?n[i]=`${i}=${tc(c)}`:Array.isArray(c)&&(n[i]=c.slice(0).reduce((l,f)=>l.concat([`${i}=${tc(f)}`]),[]).sort().join("&"))}return t.sort().map(r=>n[r]).filter(r=>r).join("&")},hX=e=>pX(e).toISOString().replace(/\.\d{3}Z$/,"Z"),pX=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class mX{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:n,region:r,service:i,sha256:c,uriEscapePath:l=!0}){this.service=i,this.sha256=c,this.uriEscapePath=l,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=Fs(r),this.credentialProvider=Fs(n)}createCanonicalRequest(t,n,r){const i=Object.keys(n).sort();return`${t.method} ${this.getCanonicalPath(t)} -${pX(t)} +${dX(t)} ${i.map(c=>`${c}:${n[c]}`).join(` `)} @@ -76,6 +76,6 @@ ${i.join(";")} ${r}`}async createStringToSign(t,n,r,i){const c=new this.sha256;c.update($f(r));const l=await c.digest();return`${i} ${t} ${n} -${_s(l)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){const n=[];for(const c of t.split("/"))c?.length!==0&&c!=="."&&(c===".."?n.pop():n.push(c));const r=`${t?.startsWith("/")?"/":""}${n.join("/")}${n.length>0&&t?.endsWith("/")?"/":""}`;return tc(r).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!="object"||typeof t.accessKeyId!="string"||typeof t.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(t){const n=hX(t).replace(/[\-:]/g,"");return{longDate:n,shortDate:n.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}class Rv extends gX{headerFormatter=new cX;constructor({applyChecksum:t,credentials:n,region:r,service:i,sha256:c,uriEscapePath:l=!0}){super({applyChecksum:t,credentials:n,region:r,service:i,sha256:c,uriEscapePath:l})}async presign(t,n={}){const{signingDate:r=new Date,expiresIn:i=3600,unsignableHeaders:c,unhoistableHeaders:l,signableHeaders:f,hoistableHeaders:d,signingRegion:p,signingService:b}=n,g=await this.credentialProvider();this.validateResolvedCredentials(g);const v=p??await this.regionProvider(),{longDate:S,shortDate:w}=this.formatDate(r);if(i>oX)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const E=yb(w,v,b??this.service),R=dX(PT(t),{unhoistableHeaders:l,hoistableHeaders:d});g.sessionToken&&(R.query[pk]=g.sessionToken),R.query[qY]=mb,R.query[GY]=`${g.accessKeyId}/${E}`,R.query[fk]=S,R.query[KY]=i.toString(10);const C=MT(R,c,f);return R.query[ZY]=this.getCanonicalHeaderList(C),R.query[dk]=await this.getSignature(S,E,this.getSigningKey(g,v,w,b),this.createCanonicalRequest(R,C,await bb(t,this.sha256))),R}async sign(t,n){return typeof t=="string"?this.signString(t,n):t.headers&&t.payload?this.signEvent(t,n):t.message?this.signMessage(t,n):this.signRequest(t,n)}async signEvent({headers:t,payload:n},{signingDate:r=new Date,priorSignature:i,signingRegion:c,signingService:l}){const f=c??await this.regionProvider(),{shortDate:d,longDate:p}=this.formatDate(r),b=yb(d,f,l??this.service),g=await bb({headers:{},body:n},this.sha256),v=new this.sha256;v.update(t);const S=_s(await v.digest()),w=[nX,p,b,i,S,g].join(` -`);return this.signString(w,{signingDate:r,signingRegion:f,signingService:l})}async signMessage(t,{signingDate:n=new Date,signingRegion:r,signingService:i}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:n,signingRegion:r,signingService:i,priorSignature:t.priorSignature}).then(l=>({message:t.message,signature:l}))}async signString(t,{signingDate:n=new Date,signingRegion:r,signingService:i}={}){const c=await this.credentialProvider();this.validateResolvedCredentials(c);const l=r??await this.regionProvider(),{shortDate:f}=this.formatDate(n),d=new this.sha256(await this.getSigningKey(c,l,f,i));return d.update($f(t)),_s(await d.digest())}async signRequest(t,{signingDate:n=new Date,signableHeaders:r,unsignableHeaders:i,signingRegion:c,signingService:l}={}){const f=await this.credentialProvider();this.validateResolvedCredentials(f);const d=c??await this.regionProvider(),p=PT(t),{longDate:b,shortDate:g}=this.formatDate(n),v=yb(g,d,l??this.service);p.headers[mk]=b,f.sessionToken&&(p.headers[WY]=f.sessionToken);const S=await bb(p,this.sha256);!fX(xv,p.headers)&&this.applyChecksum&&(p.headers[xv]=S);const w=MT(p,i,r),E=await this.getSignature(b,v,this.getSigningKey(f,d,g,l),this.createCanonicalRequest(p,w,S));return p.headers[hk]=`${mb} Credential=${f.accessKeyId}/${v}, SignedHeaders=${this.getCanonicalHeaderList(w)}, Signature=${E}`,p}async getSignature(t,n,r,i){const c=await this.createStringToSign(t,n,i,mb),l=new this.sha256(await r);return l.update($f(c)),_s(await l.digest())}getSigningKey(t,n,r,i){return iX(this.sha256,t,r,n,i||this.service)}}const bk=e=>{let t=e.credentials,n=!!e.credentials,r;Object.defineProperty(e,"credentials",{set(p){p&&p!==t&&p!==r&&(n=!0),t=p;const b=yX(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),g=bX(e,b);if(n&&!g.attributed){const v=typeof t=="object"&&t!==null;r=async S=>{const E=await g(S);return v&&(!E.$source||Object.keys(E.$source).length===0)?UY(E,"CREDENTIALS_CODE","e"):E},r.memoized=g.memoized,r.configBound=g.configBound,r.attributed=!0}else r=g},get(){return r},enumerable:!0,configurable:!0}),e.credentials=t;const{signingEscapePath:i=!0,systemClockOffset:c=e.systemClockOffset||0,sha256:l}=e;let f;return e.signer?f=wl(e.signer):e.regionInfoProvider?f=()=>wl(e.region)().then(async p=>[await e.regionInfoProvider(p,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},p]).then(([p,b])=>{const{signingRegion:g,signingService:v}=p;e.signingRegion=e.signingRegion||g||b,e.signingName=e.signingName||v||e.serviceId;const S={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:i},w=e.signerConstructor||Rv;return new w(S)}):f=async p=>{p=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await wl(e.region)(),properties:{}},p);const b=p.signingRegion,g=p.signingName;e.signingRegion=e.signingRegion||b,e.signingName=e.signingName||g||e.serviceId;const v={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:i},S=e.signerConstructor||Rv;return new S(v)},Object.assign(e,{systemClockOffset:c,signingEscapePath:i,signer:f})};function yX(e,{credentials:t,credentialDefaultProvider:n}){let r;return t?t?.memoized?r=t:r=fY(t,uY,YD):n?r=wl(n(Object.assign({},e,{parentClientConfig:e}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function bX(e,t){if(t.configBound)return t;const n=async r=>t({...r,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}const NT=typeof TextEncoder=="function"?new TextEncoder:null,vk=e=>{if(typeof e=="string"){if(NT)return NT.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},qa=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const r of t)n.push(r);return n},Ui=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,rm=()=>{let e=[],t=[],n=!1;const r=new Set,i=g=>g.sort((v,S)=>LT[S.step]-LT[v.step]||zT[S.priority||"normal"]-zT[v.priority||"normal"]),c=g=>{let v=!1;const S=w=>{const E=qa(w.name,w.aliases);if(E.includes(g)){v=!0;for(const R of E)r.delete(R);return!1}return!0};return e=e.filter(S),t=t.filter(S),v},l=g=>{let v=!1;const S=w=>{if(w.middleware===g){v=!0;for(const E of qa(w.name,w.aliases))r.delete(E);return!1}return!0};return e=e.filter(S),t=t.filter(S),v},f=g=>(e.forEach(v=>{g.add(v.middleware,{...v})}),t.forEach(v=>{g.addRelativeTo(v.middleware,{...v})}),g.identifyOnResolve?.(b.identifyOnResolve()),g),d=g=>{const v=[];return g.before.forEach(S=>{S.before.length===0&&S.after.length===0?v.push(S):v.push(...d(S))}),v.push(g),g.after.reverse().forEach(S=>{S.before.length===0&&S.after.length===0?v.push(S):v.push(...d(S))}),v},p=(g=!1)=>{const v=[],S=[],w={};return e.forEach(R=>{const C={...R,before:[],after:[]};for(const O of qa(C.name,C.aliases))w[O]=C;v.push(C)}),t.forEach(R=>{const C={...R,before:[],after:[]};for(const O of qa(C.name,C.aliases))w[O]=C;S.push(C)}),S.forEach(R=>{if(R.toMiddleware){const C=w[R.toMiddleware];if(C===void 0){if(g)return;throw new Error(`${R.toMiddleware} is not found when adding ${Ui(R.name,R.aliases)} middleware ${R.relation} ${R.toMiddleware}`)}R.relation==="after"&&C.after.push(R),R.relation==="before"&&C.before.push(R)}}),i(v).map(d).reduce((R,C)=>(R.push(...C),R),[])},b={add:(g,v={})=>{const{name:S,override:w,aliases:E}=v,R={step:"initialize",priority:"normal",middleware:g,...v},C=qa(S,E);if(C.length>0){if(C.some(O=>r.has(O))){if(!w)throw new Error(`Duplicate middleware name '${Ui(S,E)}'`);for(const O of C){const k=e.findIndex($=>$.name===O||$.aliases?.some(j=>j===O));if(k===-1)continue;const T=e[k];if(T.step!==R.step||R.priority!==T.priority)throw new Error(`"${Ui(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${Ui(S,E)}" middleware with ${R.priority} priority in ${R.step} step.`);e.splice(k,1)}}for(const O of C)r.add(O)}e.push(R)},addRelativeTo:(g,v)=>{const{name:S,override:w,aliases:E}=v,R={middleware:g,...v},C=qa(S,E);if(C.length>0){if(C.some(O=>r.has(O))){if(!w)throw new Error(`Duplicate middleware name '${Ui(S,E)}'`);for(const O of C){const k=t.findIndex($=>$.name===O||$.aliases?.some(j=>j===O));if(k===-1)continue;const T=t[k];if(T.toMiddleware!==R.toMiddleware||T.relation!==R.relation)throw new Error(`"${Ui(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${Ui(S,E)}" middleware ${R.relation} "${R.toMiddleware}" middleware.`);t.splice(k,1)}}for(const O of C)r.add(O)}t.push(R)},clone:()=>f(rm()),use:g=>{g.applyToStack(b)},remove:g=>typeof g=="string"?c(g):l(g),removeByTag:g=>{let v=!1;const S=w=>{const{tags:E,name:R,aliases:C}=w;if(E&&E.includes(g)){const O=qa(R,C);for(const k of O)r.delete(k);return v=!0,!1}return!0};return e=e.filter(S),t=t.filter(S),v},concat:g=>{const v=f(rm());return v.use(g),v.identifyOnResolve(n||v.identifyOnResolve()||(g.identifyOnResolve?.()??!1)),v},applyToStack:f,identify:()=>p(!0).map(g=>{const v=g.step??g.relation+" "+g.toMiddleware;return Ui(g.name,g.aliases)+" - "+v}),identifyOnResolve(g){return typeof g=="boolean"&&(n=g),n},resolve:(g,v)=>{for(const S of p().map(w=>w.middleware).reverse())g=S(g,v);return n&&console.log(b.identify()),g}};return b},LT={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},zT={high:3,normal:2,low:1};class Sk{config;middlewareStack=rm();initConfig;handlers;constructor(t){this.config=t;const{protocol:n,protocolSettings:r}=t;r&&typeof n=="function"&&(t.protocol=new n(r))}send(t,n,r){const i=typeof n!="function"?n:void 0,c=typeof n=="function"?n:r,l=i===void 0&&this.config.cacheMiddleware===!0;let f;if(l){this.handlers||(this.handlers=new WeakMap);const d=this.handlers;d.has(t.constructor)?f=d.get(t.constructor):(f=t.resolveMiddleware(this.middlewareStack,this.config,i),d.set(t.constructor,f))}else delete this.handlers,f=t.resolveMiddleware(this.middlewareStack,this.config,i);if(c)f(t).then(d=>c(null,d.output),d=>c(d)).catch(()=>{});else return f(t).then(d=>d.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const vb="***SensitiveInformation***";function Cv(e,t){if(t==null)return t;const n=Ct.of(e);if(n.getMergedTraits().sensitive)return vb;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return vb}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return vb}else if(n.isStructSchema()&&typeof t=="object"){const r=t,i={};for(const[c,l]of n.structIterator())r[c]!=null&&(i[c]=Cv(l,r[c]));return i}return t}class Cs{middlewareStack=rm();schema;static classBuilder(){return new vX}resolveMiddlewareWithContext(t,n,r,{middlewareFn:i,clientName:c,commandName:l,inputFilterSensitiveLog:f,outputFilterSensitiveLog:d,smithyContext:p,additionalContext:b,CommandCtor:g}){for(const R of i.bind(this)(g,t,n,r))this.middlewareStack.use(R);const v=t.concat(this.middlewareStack),{logger:S}=n,w={logger:S,clientName:c,commandName:l,inputFilterSensitiveLog:f,outputFilterSensitiveLog:d,[_v]:{commandInstance:this,...p},...b},{requestHandler:E}=n;return v.resolve(R=>E.handle(R.request,r||{}),w)}}class vX{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,n,r={}){return this._smithyContext={service:t,operation:n,...r},this}c(t={}){return this._additionalContext=t,this}n(t,n){return this._clientName=t,this._commandName=n,this}f(t=r=>r,n=r=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=n,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){const t=this;let n;return n=class extends Cs{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super(),this.input=r??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(r,i,c){const l=t._operationSchema,f=l?.[4]??l?.input,d=l?.[5]??l?.output;return this.resolveMiddlewareWithContext(r,i,c,{CommandCtor:n,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(l?Cv.bind(null,f):p=>p),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(l?Cv.bind(null,d):p=>p),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}class Ya extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;const n=t;return Ya.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault==="client"||n.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;const n=t;return this===Ya?Ya.isInstance(t):Ya.isInstance(t)?n.name&&this.name?this.prototype.isPrototypeOf(t)||n.name===this.name:this.prototype.isPrototypeOf(t):!1}}const BT=(e,t={})=>{Object.entries(t).filter(([,r])=>r!==void 0).forEach(([r,i])=>{(e[r]==null||e[r]==="")&&(e[r]=i)});const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},_k=e=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},SX=e=>{const t=[];for(const n in em){const r=em[n];e[r]!==void 0&&t.push({algorithmId:()=>r,checksumConstructor:()=>e[r]})}return{addChecksumAlgorithm(n){t.push(n)},checksumAlgorithms(){return t}}},_X=e=>{const t={};return e.checksumAlgorithms().forEach(n=>{t[n.algorithmId()]=n.checksumConstructor()}),t},wX=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),EX=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t},wk=e=>Object.assign(SX(e),wX(e)),Ek=e=>Object.assign(_X(e),EX(e)),xk=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&e[n][t]!==void 0?e[n]=e[n][t]:typeof e[n]=="object"&&e[n]!==null&&(e[n]=xk(e[n]));return e};class NS{trace(){}debug(){}info(){}warn(){}error(){}}class Rk{queryCompat;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,n){const r=n.getMemberSchemas(),i=Object.values(r).find(c=>!!c.getMergedTraits().httpPayload);if(i){const c=i.getMergedTraits().mediaType;return c||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":t)}else if(!n.isUnitSchema()&&Object.values(r).find(l=>{const{httpQuery:f,httpQueryParams:d,httpHeader:p,httpLabel:b,httpPrefixHeaders:g}=l.getMergedTraits();return!f&&!d&&!p&&!b&&g===void 0}))return t}async getErrorSchemaOrThrowBaseException(t,n,r,i,c,l){let f=n,d=t;t.includes("#")&&([f,d]=t.split("#"));const p={$metadata:c,$fault:r.statusCode<500?"client":"server"},b=ts.for(f);try{return{errorSchema:l?.(b,d)??b.getSchema(t),errorMetadata:p}}catch{i.message=i.message??i.Message??"UnknownError";const v=ts.for("smithy.ts.sdk.synthetic."+f),S=v.getBaseException();if(S){const w=v.getErrorCtor(S)??Error;throw this.decorateServiceException(Object.assign(new w({name:d}),p),i)}throw this.decorateServiceException(Object.assign(new Error(d),p),i)}}decorateServiceException(t,n={}){if(this.queryCompat){const r=t.Message??n.Message,i=BT(t,n);r&&(i.message=r),i.Error={...i.Error,Type:i.Error.Type,Code:i.Error.Code,Message:i.Error.message??i.Error.Message??r};const c=i.$metadata.requestId;return c&&(i.RequestId=c),i}return BT(t,n)}setQueryCompatError(t,n){const r=n.headers?.["x-amzn-query-error"];if(t!==void 0&&r!=null){const[i,c]=r.split(";"),l=Object.entries(t),f={Code:i,Type:c};Object.assign(t,f);for(const[d,p]of l)f[d==="message"?"Message":d]=p;delete f.__type,t.Error=f}}queryCompatOutput(t,n){t.Error&&(n.Error=t.Error),t.Type&&(n.Type=t.Type),t.Code&&(n.Code=t.Code)}findQueryCompatibleError(t,n){try{return t.getSchema(n)}catch{return t.find(i=>Ct.of(i).getMergedTraits().awsQueryError?.[0]===n)}}}class Vm{serdeContext;setSerdeContext(t){this.serdeContext=t}}class xX{from;to;keys;constructor(t,n){this.from=t,this.to=n,this.keys=new Set(Object.keys(this.from).filter(r=>r!=="__type"))}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const t=this.keys.values().next().value,n=this.from[t];this.to.$unknown=[t,n]}}}function RX(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function CX(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\r/g," ").replace(/\n/g," ").replace(/\u0085/g,"…").replace(/\u2028/,"
")}class Av{value;constructor(t){this.value=t}toString(){return CX(""+this.value)}}class as{name;children;attributes={};static of(t,n,r){const i=new as(t);return n!==void 0&&i.addChildNode(new Av(n)),r!==void 0&&i.withName(r),i}constructor(t,n=[]){this.name=t,this.children=n}withName(t){return this.name=t,this}addAttribute(t,n){return this.attributes[t]=n,this}addChildNode(t){return this.children.push(t),this}removeAttribute(t){return delete this.attributes[t],this}n(t){return this.name=t,this}c(t){return this.children.push(t),this}a(t,n){return n!=null&&(this.attributes[t]=n),this}cc(t,n,r=n){if(t[n]!=null){const i=as.of(n,t[n]).withName(r);this.c(i)}}l(t,n,r,i){t[n]!=null&&i().map(l=>{l.withName(r),this.c(l)})}lc(t,n,r,i){if(t[n]!=null){const c=i(),l=new as(r);c.map(f=>{l.c(f)}),this.c(l)}}toString(){const t=!!this.children.length;let n=`<${this.name}`;const r=this.attributes;for(const i of Object.keys(r)){const c=r[i];c!=null&&(n+=` ${i}="${RX(""+c)}"`)}return n+=t?`>${this.children.map(i=>i.toString()).join("")}`:"/>"}}let Sb;function AX(e){Sb||(Sb=new DOMParser);const t=Sb.parseFromString(e,"application/xml");if(t.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const n=r=>{if(r.nodeType===Node.TEXT_NODE&&r.textContent?.trim())return r.textContent;if(r.nodeType===Node.ELEMENT_NODE){const i=r;if(i.attributes.length===0&&i.childNodes.length===0)return"";const c={},l=Array.from(i.attributes);for(const d of l)c[`${d.name}`]=d.value;const f=Array.from(i.childNodes);for(const d of f){const p=n(d);if(p!=null){const b=d.nodeName;if(f.length===1&&l.length===0&&b==="#text")return p;c[b]?Array.isArray(c[b])?c[b].push(p):c[b]=[c[b],p]:c[b]=p}else if(f.length===1&&l.length===0)return i.textContent}return c}return null};return{[t.documentElement.nodeName]:n(t.documentElement)}}class Ck extends Vm{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new KD(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,n,r){const i=Ct.of(t),c=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(c).find(p=>!!p.getMemberTraits().eventPayload)){const p={},b=Object.keys(c)[0];return c[b].isBlobSchema()?p[b]=n:p[b]=this.read(c[b],n),p}const f=(this.serdeContext?.utf8Encoder??pc)(n),d=this.parseXml(f);return this.readSchema(t,r?d[r]:d)}readSchema(t,n){const r=Ct.of(t);if(r.isUnitSchema())return;const i=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(n))return this.readSchema(r,[n]);if(n==null)return n;if(typeof n=="object"){const c=!!i.sparse,l=!!i.xmlFlattened;if(r.isListSchema()){const d=r.getValueSchema(),p=[],b=d.getMergedTraits().xmlName??"member",g=l?n:(n[0]??n)[b],v=Array.isArray(g)?g:[g];for(const S of v)(S!=null||c)&&p.push(this.readSchema(d,S));return p}const f={};if(r.isMapSchema()){const d=r.getKeySchema(),p=r.getValueSchema();let b;l?b=Array.isArray(n)?n:[n]:b=Array.isArray(n.entry)?n.entry:[n.entry];const g=d.getMergedTraits().xmlName??"key",v=p.getMergedTraits().xmlName??"value";for(const S of b){const w=S[g],E=S[v];(E!=null||c)&&(f[w]=this.readSchema(p,E))}return f}if(r.isStructSchema()){const d=r.isUnionSchema();let p;d&&(p=new xX(n,f));for(const[b,g]of r.structIterator()){const v=g.getMergedTraits(),S=v.httpPayload?v.xmlName??g.getName():g.getMemberTraits().xmlName??b;d&&p.mark(S),n[S]!=null&&(f[b]=this.readSchema(g,n[S]))}return d&&p.writeUnknown(),f}if(r.isDocumentSchema())return n;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,n)}parseXml(t){if(t.length){let n;try{n=AX(t)}catch(l){throw l&&typeof l=="object"&&Object.defineProperty(l,"$responseBodyText",{value:t}),l}const r="#text",i=Object.keys(n)[0],c=n[i];return c[r]&&(c[i]=c[r],delete c[r]),xk(c)}return{}}}class TX extends Vm{settings;buffer;constructor(t){super(),this.settings=t}write(t,n,r=""){this.buffer===void 0&&(this.buffer="");const i=Ct.of(t);if(r&&!r.endsWith(".")&&(r+="."),i.isBlobSchema())(typeof n=="string"||n instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??ea)(n)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())n!=null?(this.writeKey(r),this.writeValue(String(n))):i.isIdempotencyToken()&&(this.writeKey(r),this.writeValue($m()));else if(i.isBigIntegerSchema())n!=null&&(this.writeKey(r),this.writeValue(String(n)));else if(i.isBigDecimalSchema())n!=null&&(this.writeKey(r),this.writeValue(n instanceof Wf?n.string:String(n)));else if(i.isTimestampSchema()){if(n instanceof Date)switch(this.writeKey(r),jm(i,this.settings)){case 5:this.writeValue(n.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(nm(n));break;case 7:this.writeValue(String(n.getTime()/1e3));break}}else if(i.isDocumentSchema())Array.isArray(n)?this.write(79,n,r):n instanceof Date?this.write(4,n,r):n instanceof Uint8Array?this.write(21,n,r):n&&typeof n=="object"?this.write(143,n,r):(this.writeKey(r),this.writeValue(String(n)));else if(i.isListSchema()){if(Array.isArray(n))if(n.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{const c=i.getValueSchema(),l=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let f=1;for(const d of n){if(d==null)continue;const p=c.getMergedTraits(),b=this.getKey("member",p.xmlName,p.ec2QueryName),g=l?`${r}${f}`:`${r}${b}.${f}`;this.write(c,d,g),++f}}}else if(i.isMapSchema()){if(n&&typeof n=="object"){const c=i.getKeySchema(),l=i.getValueSchema(),f=i.getMergedTraits().xmlFlattened;let d=1;for(const[p,b]of Object.entries(n)){if(b==null)continue;const g=c.getMergedTraits(),v=this.getKey("key",g.xmlName,g.ec2QueryName),S=f?`${r}${d}.${v}`:`${r}entry.${d}.${v}`,w=l.getMergedTraits(),E=this.getKey("value",w.xmlName,w.ec2QueryName),R=f?`${r}${d}.${E}`:`${r}entry.${d}.${E}`;this.write(c,p,S),this.write(l,b,R),++d}}}else if(i.isStructSchema()){if(n&&typeof n=="object"){let c=!1;for(const[l,f]of i.structIterator()){if(n[l]==null&&!f.isIdempotencyToken())continue;const d=f.getMergedTraits(),p=this.getKey(l,d.xmlName,d.ec2QueryName,"struct"),b=`${r}${p}`;this.write(f,n[l],b),c=!0}if(!c&&i.isUnionSchema()){const{$unknown:l}=n;if(Array.isArray(l)){const[f,d]=l,p=`${r}${f}`;this.write(15,d,p)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,n,r,i){const{ec2:c,capitalizeKeys:l}=this.settings;if(c&&r)return r;const f=n??t;return l&&i==="struct"?f[0].toUpperCase()+f.slice(1):f}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${tm(t)}=`}writeValue(t){this.buffer+=tm(t)}}class IX extends sY{options;serializer;deserializer;mixin=new Rk;constructor(t){super({defaultNamespace:t.defaultNamespace}),this.options=t;const n={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new TX(n),this.deserializer=new Ck(n)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,n,r){const i=await super.serializeRequest(t,n,r);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),(wh(t.input)==="unit"||!i.body)&&(i.body="");const c=t.name.split("#")[1]??t.name;return i.body=`Action=${c}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,n,r){const i=this.deserializer,c=Ct.of(t.output),l={};if(r.statusCode>=300){const g=await Qi(r.body,n);g.byteLength>0&&Object.assign(l,await i.read(15,g)),await this.handleError(t,n,r,l,this.deserializeMetadata(r))}for(const g in r.headers){const v=r.headers[g];delete r.headers[g],r.headers[g.toLowerCase()]=v}const f=t.name.split("#")[1]??t.name,d=c.isStructSchema()&&this.useNestedResult()?f+"Result":void 0,p=await Qi(r.body,n);return p.byteLength>0&&Object.assign(l,await i.read(c,p,d)),{$metadata:this.deserializeMetadata(r),...l}}useNestedResult(){return!0}async handleError(t,n,r,i,c){const l=this.loadQueryErrorCode(r,i)??"Unknown",f=this.loadQueryError(i),d=this.loadQueryErrorMessage(i);f.message=d,f.Error={Type:f.Type,Code:f.Code,Message:d};const{errorSchema:p,errorMetadata:b}=await this.mixin.getErrorSchemaOrThrowBaseException(l,this.options.defaultNamespace,r,f,c,this.mixin.findQueryCompatibleError),g=Ct.of(p),v=ts.for(p[1]).getErrorCtor(p)??Error,S=new v(d),w={Type:f.Error.Type,Code:f.Error.Code,Error:f.Error};for(const[E,R]of g.structIterator()){const C=R.getMergedTraits().xmlName??E,O=f[C]??i[C];w[E]=this.deserializer.readSchema(R,O)}throw this.mixin.decorateServiceException(Object.assign(S,b,{$fault:g.getMergedTraits().error,message:d},w),i)}loadQueryErrorCode(t,n){const r=(n.Errors?.[0]?.Error??n.Errors?.Error??n.Error)?.Code;if(r!==void 0)return r;if(t.statusCode==404)return"NotFound"}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const n=this.loadQueryError(t);return n?.message??n?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}class OX extends IX{options;constructor(t){super(t),this.options=t;const n={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,n)}useNestedResult(){return!1}}const MX=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"};class DX extends Vm{settings;stringBuffer;byteBuffer;buffer;constructor(t){super(),this.settings=t}write(t,n){const r=Ct.of(t);if(r.isStringSchema()&&typeof n=="string")this.stringBuffer=n;else if(r.isBlobSchema())this.byteBuffer="byteLength"in n?n:(this.serdeContext?.base64Decoder??cc)(n);else{this.buffer=this.writeStruct(r,n,void 0);const i=r.getMergedTraits();i.httpPayload&&!i.xmlName&&this.buffer.withName(r.getName())}}flush(){if(this.byteBuffer!==void 0){const n=this.byteBuffer;return delete this.byteBuffer,n}if(this.stringBuffer!==void 0){const n=this.stringBuffer;return delete this.stringBuffer,n}const t=this.buffer;return this.settings.xmlNamespace&&(t?.attributes?.xmlns||t.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,t.toString()}writeStruct(t,n,r){const i=t.getMergedTraits(),c=t.isMemberSchema()&&!i.httpPayload?t.getMemberTraits().xmlName??t.getMemberName():i.xmlName??t.getName();if(!c||!t.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${t.getName(!0)}.`);const l=as.of(c),[f,d]=this.getXmlnsAttribute(t,r);for(const[b,g]of t.structIterator()){const v=n[b];if(v!=null||g.isIdempotencyToken()){if(g.getMergedTraits().xmlAttribute){l.addAttribute(g.getMergedTraits().xmlName??b,this.writeSimple(g,v));continue}if(g.isListSchema())this.writeList(g,v,l,d);else if(g.isMapSchema())this.writeMap(g,v,l,d);else if(g.isStructSchema())l.addChildNode(this.writeStruct(g,v,d));else{const S=as.of(g.getMergedTraits().xmlName??g.getMemberName());this.writeSimpleInto(g,v,S,d),l.addChildNode(S)}}}const{$unknown:p}=n;if(p&&t.isUnionSchema()&&Array.isArray(p)&&Object.keys(n).length===1){const[b,g]=p,v=as.of(b);if(typeof g!="string")if(n instanceof as||n instanceof Av)l.addChildNode(n);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,g,v,d),l.addChildNode(v)}return d&&l.addAttribute(f,d),l}writeList(t,n,r,i){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${t.getName(!0)}`);const c=t.getMergedTraits(),l=t.getValueSchema(),f=l.getMergedTraits(),d=!!f.sparse,p=!!c.xmlFlattened,[b,g]=this.getXmlnsAttribute(t,i),v=(S,w)=>{if(l.isListSchema())this.writeList(l,Array.isArray(w)?w:[w],S,g);else if(l.isMapSchema())this.writeMap(l,w,S,g);else if(l.isStructSchema()){const E=this.writeStruct(l,w,g);S.addChildNode(E.withName(p?c.xmlName??t.getMemberName():f.xmlName??"member"))}else{const E=as.of(p?c.xmlName??t.getMemberName():f.xmlName??"member");this.writeSimpleInto(l,w,E,g),S.addChildNode(E)}};if(p)for(const S of n)(d||S!=null)&&v(r,S);else{const S=as.of(c.xmlName??t.getMemberName());g&&S.addAttribute(b,g);for(const w of n)(d||w!=null)&&v(S,w);r.addChildNode(S)}}writeMap(t,n,r,i,c=!1){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${t.getName(!0)}`);const l=t.getMergedTraits(),f=t.getKeySchema(),p=f.getMergedTraits().xmlName??"key",b=t.getValueSchema(),g=b.getMergedTraits(),v=g.xmlName??"value",S=!!g.sparse,w=!!l.xmlFlattened,[E,R]=this.getXmlnsAttribute(t,i),C=(O,k,T)=>{const $=as.of(p,k),[j,H]=this.getXmlnsAttribute(f,R);H&&$.addAttribute(j,H),O.addChildNode($);let P=as.of(v);b.isListSchema()?this.writeList(b,T,P,R):b.isMapSchema()?this.writeMap(b,T,P,R,!0):b.isStructSchema()?P=this.writeStruct(b,T,R):this.writeSimpleInto(b,T,P,R),O.addChildNode(P)};if(w){for(const[O,k]of Object.entries(n))if(S||k!=null){const T=as.of(l.xmlName??t.getMemberName());C(T,O,k),r.addChildNode(T)}}else{let O;c||(O=as.of(l.xmlName??t.getMemberName()),R&&O.addAttribute(E,R),r.addChildNode(O));for(const[k,T]of Object.entries(n))if(S||T!=null){const $=as.of("entry");C($,k,T),(c?r:O).addChildNode($)}}}writeSimple(t,n){if(n===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");const r=Ct.of(t);let i=null;if(n&&typeof n=="object")if(r.isBlobSchema())i=(this.serdeContext?.base64Encoder??ea)(n);else if(r.isTimestampSchema()&&n instanceof Date)switch(jm(r,this.settings)){case 5:i=n.toISOString().replace(".000Z","Z");break;case 6:i=nm(n);break;case 7:i=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",n),i=nm(n);break}else{if(r.isBigDecimalSchema()&&n)return n instanceof Wf?n.string:String(n);throw r.isMapSchema()||r.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(!0)}`)}if((r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())&&(i=String(n)),r.isStringSchema()&&(n===void 0&&r.isIdempotencyToken()?i=$m():i=String(n)),i===null)throw new Error(`Unhandled schema-value pair ${r.getName(!0)}=${n}`);return i}writeSimpleInto(t,n,r,i){const c=this.writeSimple(t,n),l=Ct.of(t),f=new Av(c),[d,p]=this.getXmlnsAttribute(l,i);p&&r.addAttribute(d,p),r.addChildNode(f)}getXmlnsAttribute(t,n){const r=t.getMergedTraits(),[i,c]=r.xmlNamespace??[];return c&&c!==n?[i?`xmlns:${i}`:"xmlns",c]:[void 0,void 0]}}class kX extends Vm{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new DX(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new Ck(this.settings);return t.setSerdeContext(this.serdeContext),t}}class PX extends nY{codec;serializer;deserializer;mixin=new Rk;constructor(t){super(t);const n={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace};this.codec=new kX(n),this.serializer=new iY(this.codec.createSerializer(),n),this.deserializer=new rY(this.codec.createDeserializer(),n)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(t,n,r){const i=await super.serializeRequest(t,n,r),c=Ct.of(t.input);if(!i.headers["content-type"]){const l=this.mixin.resolveRestContentType(this.getDefaultContentType(),c);l&&(i.headers["content-type"]=l)}return typeof i.body=="string"&&i.headers["content-type"]===this.getDefaultContentType()&&!i.body.startsWith("'+i.body),i}async deserializeResponse(t,n,r){return super.deserializeResponse(t,n,r)}async handleError(t,n,r,i,c){const l=MX(r,i)??"Unknown";if(i.Error&&typeof i.Error=="object")for(const w of Object.keys(i.Error))i[w]=i.Error[w],w.toLowerCase()==="message"&&(i.message=i.Error[w]);i.RequestId&&!c.requestId&&(c.requestId=i.RequestId);const{errorSchema:f,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(l,this.options.defaultNamespace,r,i,c),p=Ct.of(f),b=i.Error?.message??i.Error?.Message??i.message??i.Message??"Unknown",g=ts.for(f[1]).getErrorCtor(f)??Error,v=new g(b);await this.deserializeHttpMessage(f,n,r,i);const S={};for(const[w,E]of p.structIterator()){const R=E.getMergedTraits().xmlName??w,C=i.Error?.[R]??i[R];S[w]=this.codec.createDeserializer().readSchema(E,C)}throw this.mixin.decorateServiceException(Object.assign(v,d,{$fault:p.getMergedTraits().error,message:b},S),i)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(t){for(const[,n]of t.structIterator())if(n.getMergedTraits().httpPayload)return!(n.isStructSchema()||n.isMapSchema()||n.isListSchema());return!1}}const NX=/\d{12}\.ddb/;async function LX(e,t,n){if(n.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Pr(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const c=await t.retryStrategy();typeof c.acquireInitialRetryToken=="function"?c.constructor?.name?.includes("Adaptive")?Pr(e,"RETRY_MODE_ADAPTIVE","F"):Pr(e,"RETRY_MODE_STANDARD","E"):Pr(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){const c=e.endpointV2;switch(String(c?.url?.hostname).match(NX)&&Pr(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":Pr(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Pr(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Pr(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const c=i;c.accountId&&Pr(e,"RESOLVED_ACCOUNT_ID","T");for(const[l,f]of Object.entries(c.$source??{}))Pr(e,l,f)}}const $T="user-agent",_b="x-amz-user-agent",UT=" ",wb="/",zX=/[^!$%&'*+\-.^_`|~\w]/g,BX=/[^!$%&'*+\-.^_`|~\w#]/g,jT="-",$X=1024;function UX(e){let t="";for(const n in e){const r=e[n];if(t.length+r.length+1<=$X){t.length?t+=","+r:t+=r;continue}break}return t}const jX=e=>(t,n)=>async r=>{const{request:i}=r;if(!kn.isInstance(i))return t(r);const{headers:c}=i,l=n?.userAgent?.map(lh)||[],f=(await e.defaultUserAgentProvider()).map(lh);await LX(n,e,r);const d=n;f.push(`m/${UX(Object.assign({},n.__smithy_context?.features,d.__aws_sdk_context?.features))}`);const p=e?.customUserAgent?.map(lh)||[],b=await e.userAgentAppId();b&&f.push(lh(["app",`${b}`]));const g=[].concat([...f,...l,...p]).join(UT),v=[...f.filter(S=>S.startsWith("aws-sdk-")),...p].join(UT);return e.runtime!=="browser"?(v&&(c[_b]=c[_b]?`${c[$T]} ${v}`:v),c[$T]=g):c[_b]=g,t({...r,request:i})},lh=e=>{const t=e[0].split(wb).map(l=>l.replace(zX,jT)).join(wb),n=e[1]?.replace(BX,jT),r=t.indexOf(wb),i=t.substring(0,r);let c=t.substring(r+1);return i==="api"&&(c=c.toLowerCase()),[i,c,n].filter(l=>l&&l.length>0).reduce((l,f,d)=>{switch(d){case 0:return f;case 1:return`${l}/${f}`;default:return`${l}#${f}`}},"")},HX={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Ak=e=>({applyToStack:t=>{t.add(jX(e),HX)}}),Tk=!1,Ik=!1,HT=new Set,VX=(e,t=Jf)=>{if(!HT.has(e)&&!t(e))if(e==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else HT.add(e)},Ok=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),FX=e=>Ok(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,Mk=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const r=typeof t=="function"?await t():t,i=FX(r);return VX(i),i},useFipsEndpoint:async()=>{const r=typeof t=="string"?t:await t();return Ok(r)?!0:typeof n!="function"?Promise.resolve(!!n):n()}})},VT="content-length";function qX(e){return t=>async n=>{const r=n.request;if(kn.isInstance(r)){const{body:i,headers:c}=r;if(i&&Object.keys(c).map(l=>l.toLowerCase()).indexOf(VT)===-1)try{const l=e(i);r.headers={...r.headers,[VT]:String(l)}}catch{}}return t({...n,request:r})}}const GX={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Dk=e=>({applyToStack:t=>{t.add(qX(e.bodyLengthChecker),GX)}}),ZX=async e=>{const t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),WX(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!XX(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},KX=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,QX=/(\d+\.){3}\d+/,YX=/\.\./,XX=e=>KX.test(e)&&!QX.test(e)&&!YX.test(e),WX=e=>{const[t,n,r,,,i]=e.split(":"),c=t==="arn"&&e.split(":").length>=6,l=!!(c&&n&&r&&i);if(c&&!l)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return l},JX=(e,t,n,r=!1)=>{const i=async()=>{let c;return r?c=n.clientContextParams?.[e]??n[e]??n[t]:c=n[e]??n[t],typeof c=="function"?c():c};return e==="credentialScope"||t==="CredentialScope"?async()=>{const c=typeof n.credentials=="function"?await n.credentials():n.credentials;return c?.credentialScope??c?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{const c=typeof n.credentials=="function"?await n.credentials():n.credentials;return c?.accountId??c?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(n.isCustomEndpoint===!1)return;const c=await i();if(c&&typeof c=="object"){if("url"in c)return c.url.href;if("hostname"in c){const{protocol:l,hostname:f,port:d,path:p}=c;return`${l}//${f}${d?":"+d:""}${p}`}}return c}:i},kk=async e=>{},Pk=e=>typeof e=="object"?"url"in e?jf(e.url):e:jf(e),eW=async(e,t,n,r)=>{if(!n.isCustomEndpoint){let l;n.serviceConfiguredEndpoint?l=await n.serviceConfiguredEndpoint():l=await kk(n.serviceId),l&&(n.endpoint=()=>Promise.resolve(Pk(l)),n.isCustomEndpoint=!0)}const i=await Nk(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return n.endpointProvider(i,r)},Nk=async(e,t,n)=>{const r={},i=t?.getEndpointParameterInstructions?.()||{};for(const[c,l]of Object.entries(i))switch(l.type){case"staticContextParams":r[c]=l.value;break;case"contextParams":r[c]=e[l.name];break;case"clientContextParams":case"builtInParams":r[c]=await JX(l.name,c,n,l.type!=="builtInParams")();break;case"operationContextParams":r[c]=l.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(l))}return Object.keys(i).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()==="s3"&&await ZX(r),r},tW=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&aY(r,"ENDPOINT_OVERRIDE","N");const c=await eW(i.input,{getEndpointParameterInstructions(){return t}},{...e},r);r.endpointV2=c,r.authSchemes=c.properties?.authSchemes;const l=r.authSchemes?.[0];if(l){r.signing_region=l.signingRegion,r.signing_service=l.signingName;const d=qo(r)?.selectedHttpAuthScheme?.httpAuthOption;d&&(d.signingProperties=Object.assign(d.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return n({...i})},nW={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:rQ.name},Ks=(e,t)=>({applyToStack:n=>{n.addRelativeTo(tW({config:e,instructions:t}),nW)}}),Lk=e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,c=n!=null?async()=>Pk(await qs(n)()):void 0,f=Object.assign(e,{endpoint:c,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:qs(r??!1),useFipsEndpoint:qs(i??!1)});let d;return f.serviceConfiguredEndpoint=async()=>(e.serviceId&&!d&&(d=kk(e.serviceId)),d),f};var Pl;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(Pl||(Pl={}));const Hf=3,zk=Pl.STANDARD,sW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],rW=["TimeoutError","RequestTimeout","RequestTimeoutException"],oW=[500,502,503,504],iW=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],aW=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],cW=e=>e?.$retryable!==void 0,lW=e=>e.$metadata?.clockSkewCorrected,uW=e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},Bk=e=>e.$metadata?.httpStatusCode===429||sW.includes(e.name)||e.$retryable?.throttling==!0,LS=(e,t=0)=>cW(e)||lW(e)||rW.includes(e.name)||iW.includes(e?.code||"")||aW.includes(e?.code||"")||oW.includes(e.$metadata?.httpStatusCode||0)||uW(e)||e.cause!==void 0&&t<=10&&LS(e.cause,t+1),fW=e=>{if(e.$metadata?.httpStatusCode!==void 0){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!LS(e)}return!1};class zS{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8;const n=this.getCurrentTimeInSeconds();this.lastThrottleTime=n,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){const n=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(r=>zS.setTimeoutFn(r,n))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const n=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+n),this.lastTimestamp=t}updateClientSendingRate(t){let n;if(this.updateMeasuredRate(),Bk(t)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),n=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),n=this.cubicSuccess(this.getCurrentTimeInSeconds());const r=Math.min(n,2*this.measuredTxRate);this.updateTokenBucketRate(r)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),n=Math.floor(t*2)/2;if(this.requestCount++,n>this.lastTxRateBucket){const r=this.requestCount/(n-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(r*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=n}}getPrecise(t){return parseFloat(t.toFixed(8))}}const Tv=100,$k=20*1e3,dW=500,FT=500,pW=5,hW=10,mW=1,gW="amz-sdk-invocation-id",yW="amz-sdk-request",bW=()=>{let e=Tv;return{computeNextBackoffDelay:r=>Math.floor(Math.min($k,Math.random()*2**r*e)),setDelayBase:r=>{e=r}}},qT=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min($k,e),getRetryCost:()=>n});class Uk{maxAttempts;mode=Pl.STANDARD;capacity=FT;retryBackoffStrategy=bW();maxAttemptsProvider;constructor(t){this.maxAttempts=t,this.maxAttemptsProvider=typeof t=="function"?t:async()=>t}async acquireInitialRetryToken(t){return qT({retryDelay:Tv,retryCount:0})}async refreshRetryTokenForRetry(t,n){const r=await this.getMaxAttempts();if(this.shouldRetry(t,n,r)){const i=n.errorType;this.retryBackoffStrategy.setDelayBase(i==="THROTTLING"?dW:Tv);const c=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),l=n.retryAfterHint?Math.max(n.retryAfterHint.getTime()-Date.now()||0,c):c,f=this.getCapacityCost(i);return this.capacity-=f,qT({retryDelay:l,retryCount:t.getRetryCount()+1,retryCost:f})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.max(FT,this.capacity+(t.getRetryCost()??mW))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Hf}`),Hf}}shouldRetry(t,n,r){return t.getRetryCount()+1=this.getCapacityCost(n.errorType)&&this.isRetryableError(n.errorType)}getCapacityCost(t){return t==="TRANSIENT"?hW:pW}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}}class vW{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=Pl.ADAPTIVE;constructor(t,n){this.maxAttemptsProvider=t;const{rateLimiter:r}=n??{};this.rateLimiter=r??new zS,this.standardRetryStrategy=new Uk(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,n){return this.rateLimiter.updateClientSendingRate(n),this.standardRetryStrategy.refreshRetryTokenForRetry(t,n)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}}const SW=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),jk=e=>{const{retryStrategy:t,retryMode:n,maxAttempts:r}=e,i=qs(r??Hf);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await qs(n)()===Pl.ADAPTIVE?new vW(i):new Uk(i))})},_W=e=>e?.body instanceof ReadableStream,wW=e=>(t,n)=>async r=>{let i=await e.retryStrategy();const c=await e.maxAttempts();if(EW(i)){i=i;let l=await i.acquireInitialRetryToken(n.partition_id),f=new Error,d=0,p=0;const{request:b}=r,g=kn.isInstance(b);for(g&&(b.headers[gW]=$m());;)try{g&&(b.headers[yW]=`attempt=${d+1}; max=${c}`);const{response:v,output:S}=await t(r);return i.recordSuccess(l),S.$metadata.attempts=d+1,S.$metadata.totalRetryDelay=p,{response:v,output:S}}catch(v){const S=xW(v);if(f=SW(v),g&&_W(b))throw(n.logger instanceof NS?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),f;try{l=await i.refreshRetryTokenForRetry(l,S)}catch{throw f.$metadata||(f.$metadata={}),f.$metadata.attempts=d+1,f.$metadata.totalRetryDelay=p,f}d=l.getRetryCount();const w=l.getRetryDelay();p+=w,await new Promise(E=>setTimeout(E,w))}}else return i=i,i?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,r)},EW=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",xW=e=>{const t={error:e,errorType:RW(e)},n=AW(e.$response);return n&&(t.retryAfterHint=n),t},RW=e=>Bk(e)?"THROTTLING":LS(e)?"TRANSIENT":fW(e)?"SERVER_ERROR":"CLIENT_ERROR",CW={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Hk=e=>({applyToStack:t=>{t.add(wW(e),CW)}}),AW=e=>{if(!ac.isInstance(e))return;const t=Object.keys(e.headers).find(c=>c.toLowerCase()==="retry-after");if(!t)return;const n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n):new Date(r*1e3)},TW=async(e,t,n)=>({operation:qo(t).operation,region:await qs(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function IW(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"ec2",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}const OW=e=>{const t=[];switch(e.operation){default:t.push(IW(e))}return t},MW=e=>{const t=bk(e);return Object.assign(t,{authSchemePreference:qs(e.authSchemePreference??[])})},DW=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"ec2"}),to={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},kW="3.995.0",PW={version:kW},Vk=e=>new TextEncoder().encode(e);var NW=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:Vk;function lc(e){return e instanceof Uint8Array?e:typeof e=="string"?NW(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function om(e){return typeof e=="string"?e.length===0:e.byteLength===0}function LW(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}function zW(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n0&&c[c.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var pr=64,HW=32,VW=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),FW=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],qW=Math.pow(2,53)-1,Eh=(function(){function e(){this.state=Int32Array.from(FW),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>qW)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===pr&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%pr>=pr-8){for(var i=this.bufferLength;i>>24&255,c[i*4+1]=this.state[i]>>>16&255,c[i*4+2]=this.state[i]>>>8&255,c[i*4+3]=this.state[i]>>>0&255;return c},e.prototype.hashBuffer=function(){for(var t=this,n=t.buffer,r=t.state,i=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5],b=r[6],g=r[7],v=0;v>>17|S<<15)^(S>>>19|S<<13)^S>>>10;S=this.temp[v-15];var E=(S>>>7|S<<25)^(S>>>18|S<<14)^S>>>3;this.temp[v]=(w+this.temp[v-7]|0)+(E+this.temp[v-16]|0)}var R=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&p^~d&b)|0)+(g+(VW[v]+this.temp[v]|0)|0)|0,C=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&c^i&l^c&l)|0;g=b,b=p,p=d,d=f+R|0,f=l,l=c,c=i,i=R+C|0}r[0]+=i,r[1]+=c,r[2]+=l,r[3]+=f,r[4]+=d,r[5]+=p,r[6]+=b,r[7]+=g},e})(),GW=(function(){function e(t){this.secret=t,this.hash=new Eh,this.reset()}return e.prototype.update=function(t){if(!(om(t)||this.error))try{this.hash.update(lc(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return qk(this,void 0,void 0,function(){return Gk(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Eh,this.secret){this.outer=new Eh;var t=ZW(this.secret),n=new Uint8Array(pr);n.set(t);for(var r=0;rpr){var n=new Eh;n.update(t),t=n.digest()}var r=new Uint8Array(pr);return r.set(t),r}var KW=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Zk(e){if(QW(e)&&typeof e.crypto.subtle=="object"){var t=e.crypto.subtle;return YW(t)}return!1}function QW(e){if(typeof e=="object"&&typeof e.crypto=="object"){var t=e.crypto.getRandomValues;return typeof t=="function"}return!1}function YW(e){return e&&KW.every(function(t){return typeof e[t]=="function"})}var Kk=(function(){function e(t){Zk(Ji())?this.hash=new UW(t):this.hash=new GW(t)}return e.prototype.update=function(t,n){this.hash.update(lc(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();const Qk=({serviceId:e,clientVersion:t})=>async n=>{const r=typeof window<"u"?window.navigator:void 0,i=r?.userAgent??"",c=r?.userAgentData?.platform??ZT.os(i)??"other",l=void 0,f=r?.userAgentData?.brands??[],d=f[f.length-1],p=d?.brand??ZT.browser(i)??"unknown",b=d?.version??"unknown",g=[["aws-sdk-js",t],["ua","2.1"],[`os/${c}`,l],["lang/js"],["md/browser",`${p}_${b}`]];e&&g.push([`api/${e}`,t]);const v=await n?.userAgentAppId?.();return v&&g.push([`app/${v}`]),g},ZT={os(e){if(/iPhone|iPad|iPod/.test(e))return"iOS";if(/Macintosh|Mac OS X/.test(e))return"macOS";if(/Windows NT/.test(e))return"Windows";if(/Android/.test(e))return"Android";if(/Linux/.test(e))return"Linux"},browser(e){if(/EdgiOS|EdgA|Edg\//.test(e))return"Microsoft Edge";if(/Firefox\//.test(e))return"Firefox";if(/Chrome\//.test(e))return"Chrome";if(/Safari\//.test(e))return"Safari"}},Yk=e=>()=>Promise.reject(e),XW=["in-region","cross-region","mobile","standard","legacy"],Xk=({defaultsMode:e}={})=>VY(async()=>{const t=typeof e=="function"?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(WW()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${XW.join(", ")}, got ${t}`)}}),WW=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:n,downlink:r}=e?.connection;if(typeof t=="string"&&t!=="4g"||Number(n)>100||Number(r)<10)return!0}return e?.userAgentData?.mobile||typeof e?.maxTouchPoints=="number"&&e?.maxTouchPoints>1},Wk=(e,t=!1)=>{if(t){for(const n of e.split("."))if(!Wk(n))return!1;return!0}return!(!Jf(e)||e.length<3||e.length>63||e!==e.toLowerCase()||MS(e))},KT=":",JW="/",eJ=e=>{const t=e.split(KT);if(t.length<6)return null;const[n,r,i,c,l,...f]=t;if(n!=="arn"||r===""||i===""||f.join(KT)==="")return null;const d=f.map(p=>p.split(JW)).flat();return{partition:r,service:i,region:c,accountId:l,resourceId:d}},tJ=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],nJ={partitions:tJ};let sJ=nJ;const rJ=e=>{const{partitions:t}=sJ;for(const r of t){const{regions:i,outputs:c}=r;for(const[l,f]of Object.entries(i))if(l===e)return{...c,...f}}for(const r of t){const{regionRegex:i,outputs:c}=r;if(new RegExp(i).test(e))return{...c}}const n=t.find(r=>r.id==="aws");if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},BS={isVirtualHostableS3Bucket:Wk,parseArn:eJ,partition:rJ};kl.aws=BS;const Jk="required",mr="fn",gr="argv",Ul="ref",QT=!0,YT="isSet",Vf="booleanEquals",ll="error",ul="endpoint",Oo="tree",$S="PartitionResult",US="getAttr",XT={[Jk]:!1,type:"string"},WT={[Jk]:!0,default:!1,type:"boolean"},JT={[Ul]:"Endpoint"},e3={[mr]:Vf,[gr]:[{[Ul]:"UseFIPS"},!0]},t3={[mr]:Vf,[gr]:[{[Ul]:"UseDualStack"},!0]},ur={},eI={[mr]:US,[gr]:[{[Ul]:$S},"supportsFIPS"]},n3={[Ul]:$S},tI={[mr]:Vf,[gr]:[!0,{[mr]:US,[gr]:[n3,"supportsDualStack"]}]},nI=[e3],sI=[t3],rI=[{[Ul]:"Region"}],oJ={parameters:{Region:XT,UseDualStack:WT,UseFIPS:WT,Endpoint:XT},rules:[{conditions:[{[mr]:YT,[gr]:[JT]}],rules:[{conditions:nI,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ll},{conditions:sI,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ll},{endpoint:{url:JT,properties:ur,headers:ur},type:ul}],type:Oo},{conditions:[{[mr]:YT,[gr]:rI}],rules:[{conditions:[{[mr]:"aws.partition",[gr]:rI,assign:$S}],rules:[{conditions:[e3,t3],rules:[{conditions:[{[mr]:Vf,[gr]:[QT,eI]},tI],rules:[{endpoint:{url:"https://ec2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ur,headers:ur},type:ul}],type:Oo},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ll}],type:Oo},{conditions:nI,rules:[{conditions:[{[mr]:Vf,[gr]:[eI,QT]}],rules:[{conditions:[{[mr]:"stringEquals",[gr]:[{[mr]:US,[gr]:[n3,"name"]},"aws-us-gov"]}],endpoint:{url:"https://ec2.{Region}.amazonaws.com",properties:ur,headers:ur},type:ul},{endpoint:{url:"https://ec2-fips.{Region}.{PartitionResult#dnsSuffix}",properties:ur,headers:ur},type:ul}],type:Oo},{error:"FIPS is enabled but this partition does not support FIPS",type:ll}],type:Oo},{conditions:sI,rules:[{conditions:[tI],rules:[{endpoint:{url:"https://ec2.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ur,headers:ur},type:ul}],type:Oo},{error:"DualStack is enabled but this partition does not support DualStack",type:ll}],type:Oo},{endpoint:{url:"https://ec2.{Region}.{PartitionResult#dnsSuffix}",properties:ur,headers:ur},type:ul}],type:Oo}],type:Oo},{error:"Invalid Configuration: Missing Region",type:ll}]},iJ=oJ,aJ=new WD({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),cJ=(e,t={})=>aJ.get(e,()=>ck(iJ,{endpointParams:e,logger:t.logger}));kl.aws=BS;class jS extends Ya{constructor(t){super(t),Object.setPrototypeOf(this,jS.prototype)}}const lJ="AllAvailabilityZones",uJ="AttributeBooleanValue",fJ="AssociateCarrierIpAddress",dJ="AdditionalFlexibleNetworkInterfaces",pJ="AvailableIpAddressCount",hJ="AssignIpv6AddressOnCreation",s3="AdditionalInfo",HS="AssociationId",r3="AttachmentId",mJ="AmiLaunchIndex",gJ="AttachmentLimitType",yJ="AssociatePublicIpAddress",bJ="AmazonProvidedIpv6CidrBlock",vJ="AutoRecoverySupported",SJ="AllRegions",o3="AssociatedResource",i3="AutoRecovery",a3="AmdSevSnp",_J="ArchitectureTypeList",Fm="AttachTime",wJ="AttachVolumeRequest",EJ="AttributeValue",xJ="AttachVolume",la="AvailabilityZone",RJ="AvailabilityZoneGeography",CJ="AvailabilityZoneGeographyList",jl="AvailabilityZoneId",AJ="AvailabilityZoneList",TJ="AvailabilityZoneMessage",IJ="AvailabilityZoneMessageList",OJ="AvailabilityZoneSubGeography",MJ="AvailabilityZoneSubGeographyList",DJ="AvailabilityZones",c3="Accelerators",kJ="Affinity",l3="Arn",u3="Architecture",f3="Association",PJ="Attribute",d3="Attachment",NJ="Attachments",LJ="BlobAttributeValue",zJ="BaselineBandwidthInGbps",p3="BaselineBandwidthInMbps",VS="BlockDeviceMapping",BJ="BlockDeviceMappingList",$J="BlockDeviceMappingRequestList",ed="BlockDeviceMappings",UJ="BlockDurationMinutes",h3="BaselineIops",m3="BootMode",jJ="BootModeTypeList",HJ="BareMetal",FS="BlockPublicAccessStates",VJ="BurstablePerformanceSupported",g3="BaselineThroughputInMBps",y3="BandwidthWeighting",FJ="BandwidthWeightingTypeList",qJ="BandwidthWeightings",td="CidrBlock",GJ="CidrBlockAssociationSet",ZJ="CapacityBlockId",KJ="CidrBlockState",QJ="CoreCountList",b3="CoreCount",YJ="CpuCredits",v3="CompletionDurationMinutes",XJ="CreationDate",WJ="CurrentGeneration",JJ="CarrierIp",eee="CurrentInstanceBootMode",tee="CreateImageRequest",nee="CreateImageResult",see="CoreInfo",ree="CreateImage",oee="CreateKeyPair",iee="CreateKeyPairRequest",qS="CpuOptions",aee="CustomerOwnedIp",cee="CustomerOwnedIpv4Pool",lee="CpuOptionsRequest",GS="CapacityReservationId",S3="CapacityReservationPreference",_3="CapacityReservationResourceGroupArn",uee="CapacityReservationSpecificationResponse",ZS="CapacityReservationSpecification",KS="CapacityReservationTarget",fee="CapacityReservationTargetResponse",dee="CopySnapshotRequest",pee="CopySnapshotRequestPSU",hee="CopySnapshotResult",mee="CreateSnapshotRequest",gee="CreateSubnetRequest",yee="CreateSubnetResult",bee="CreditSpecificationRequest",vee="CopySnapshot",See="CreditSpecification",_ee="CreateSnapshot",wee="CreateSubnet",Eee="CurrentState",QS="ClientToken",xee="ConnectionTrackingConfiguration",Ree="ConnectionTrackingSpecification",Cee="ConnectionTrackingSpecificationRequest",Aee="ConnectionTrackingSpecificationResponse",Tee="CompletionTime",w3="CreateTime",Iee="CreateVolumeRequest",Oee="CreateVpcRequest",Mee="CreateVpcResult",Dee="CreateVolume",kee="CreateVpc",E3="Code",x3="Configured",ua="Count",R3="DisableApiStop",C3="DisableApiTermination",Pee="DestinationAvailabilityZone",Nee="DescribeAvailabilityZonesRequest",Lee="DescribeAvailabilityZonesResult",zee="DescribeAvailabilityZones",Bee="DefaultCores",$ee="DataEncryptionKeyId",Uee="DefaultEnaQueueCountPerInterface",jee="DefaultForAz",Hee="DedicatedHostsSupported",qm="DeviceIndex",Vee="DiskInfoList",Fee="DescribeImagesRequest",qee="DescribeImagesResult",Gee="DescribeInstancesRequest",Zee="DescribeInstancesResult",Kee="DescribeInstanceTypesRequest",Qee="DescribeInstanceTypesResult",Yee="DescribeInstanceTypes",Xee="DescribeImages",Wee="DescribeInstances",Jee="DiskInfo",ete="DeleteKeyPair",tte="DeleteKeyPairRequest",nte="DeleteKeyPairResult",ste="DescribeKeyPairsRequest",rte="DescribeKeyPairsResult",ote="DescribeKeyPairs",YS="DeviceName",ite="DefaultNetworkCardIndex",ate="DestinationOutpostArn",cte="DhcpOptionsId",fa="DeleteOnTermination",lte="DeregistrationProtection",yt="DryRun",ute="DescribeRegionsRequest",fte="DescribeRegionsResult",dte="DestinationRegion",pte="DescribeRegions",hte="DeleteSnapshotRequest",mte="DeleteSubnetRequest",gte="DescribeSnapshotsRequest",yte="DescribeSnapshotsResult",bte="DescribeSubnetsRequest",vte="DescribeSubnetsResult",Ste="DeleteSnapshot",_te="DeleteSubnet",wte="DescribeSnapshots",Ete="DescribeSubnets",xte="DefaultThreadsPerCore",Rte="DeprecationTime",Cte="DefaultVCpus",Ate="DeleteVolumeRequest",Tte="DeleteVpcRequest",Ite="DescribeVolumesRequest",Ote="DescribeVolumesResult",Mte="DescribeVpcsRequest",Dte="DescribeVpcsResult",kte="DetachVolumeRequest",Pte="DeleteVolume",Nte="DeleteVpc",Lte="DescribeVolumes",zte="DescribeVpcs",Bte="DetachVolume",hc="Description",XS="Device",$te="Disks",Ute="EbsBlockDevice",jte="ExecutableByStringList",A3="ExecutableBy",nd="EbsCardIndex",Hte="EbsCardInfoList",Vte="EbsCardInfo",Fte="EbsCards",qte="EncryptionControl",Gte="EnableDns64",Zte="ElasticFileSystem",Kte="ElasticFileSystemExclusion",Qte="ElasticGpuAssociation",Yte="ElasticGpuAssociationId",Xte="ElasticGpuAssociationList",Wte="ElasticGpuAssociationState",Jte="ElasticGpuAssociationTime",ene="ElasticGpuAssociations",tne="ElasticGpuId",T3="ElasticGpuSpecification",nne="ElasticGpuSpecifications",I3="ElasticInferenceAccelerator",sne="ElasticInferenceAcceleratorAssociation",rne="ElasticInferenceAcceleratorAssociationId",one="ElasticInferenceAcceleratorAssociationList",ine="ElasticInferenceAcceleratorAssociationState",ane="ElasticInferenceAcceleratorAssociationTime",cne="ElasticInferenceAcceleratorArn",lne="ElasticInferenceAcceleratorAssociations",O3="ElasticInferenceAccelerators",une="EbsInstanceBlockDevice",fne="EbsInstanceBlockDeviceSpecification",dne="EncryptionInTransitSupported",M3="EbsInfo",D3="EfaInfo",pne="EnableLniAtDeviceIndex",WS="EbsOptimized",k3="EbsOptimizedInfo",hne="EgressOnlyInternetGateway",mne="EgressOnlyInternetGatewayExclusion",gne="EnclaveOptionsRequest",yne="EbsOptimizedSupport",JS="EnclaveOptions",bne="EnablePrimaryIpv6",P3="EnaQueueCount",e_="EnableResourceNameDnsAAAARecord",t_="EnableResourceNameDnsARecord",N3="EnaSrdEnabled",L3="EnaSrdSpecification",vne="EnaSrdSpecificationRequest",Sne="EnaSrdSupported",z3="EnaSrdUdpEnabled",B3="EnaSrdUdpSpecification",_ne="EnaSrdUdpSpecificationRequest",wne="EfaSupported",$3="EncryptionSupport",Gm="EnaSupport",Ene="EndTime",xne="ExecutableUsers",n_="Ebs",s_="Enabled",sd="Encrypted",Rne="Endpoint",r_="Force",Cne="FpgaDeviceInfo",Ane="FpgaDeviceInfoList",Tne="FpgaDeviceMemoryInfo",Ine="FlexibleEnaQueuesSupport",U3="FpgaInfo",One="FilterList",Mne="FastRestored",Dne="FullSnapshotSizeInBytes",j3="FreeTierEligible",no="Filters",wr="Filter",kne="Fpgas",Zm="Groups",Pne="GetConsoleOutput",Nne="GetConsoleOutputRequest",Lne="GetConsoleOutputResult",zne="GpuDeviceInfo",Bne="GpuDeviceInfoList",$ne="GpuDeviceMemoryInfo",Une="GroupIdentifierList",jne="GroupIdStringList",H3="GpuInfo",o_="GroupId",Hne="GroupIdentifier",Vne="GroupLongName",i_="GroupName",Fne="GpuPartitionSize",V3="Geography",qne="Gpus",F3="HttpEndpoint",Gne="HostId",a_="HibernationOptions",Zne="HibernationOptionsRequest",q3="HttpProtocolIpv6",G3="HttpPutResponseHopLimit",Kne="HostResourceGroupArn",Qne="HibernationSupported",Z3="HttpTokens",c_="HostnameType",Yne="Hibernate",l_="Hypervisor",Xne="Id",u_="Ipv6Addresses",K3="Ipv6AddressAttribute",Q3="Ipv6AddressCount",Wne="InstanceAttachmentEnaSrdSpecification",Jne="InstanceAttachmentEnaSrdUdpSpecification",Y3="InferenceAcceleratorInfo",ese="Ipv4AddressesPerInterface",tse="Ipv6AddressesPerInterface",nse="Ipv4AddressesPerSecondaryInterface",sse="ImageAllowed",f_="Ipv6Address",rse="InstanceBlockDeviceMapping",ose="InstanceBlockDeviceMappingList",ise="InstanceBlockDeviceMappingSpecification",ase="InstanceBlockDeviceMappingSpecificationList",Km="Ipv6CidrBlock",X3="Ipv6CidrBlockAssociationSet",cse="Ipv6CidrBlockNetworkBorderGroup",W3="Ipv6CidrBlockState",lse="IncludeDeprecated",use="InferenceDeviceInfo",fse="InferenceDeviceInfoList",dse="InferenceDeviceMemoryInfo",pse="IncludeDisabled",hse="IsDefault",mse="InternetGateway",gse="InternetGatewayBlockMode",yse="InternetGatewayExclusion",ls="InstanceId",bse="InstanceIpv6Address",vse="InstanceIpv6AddressList",Sse="InstanceInterruptionBehavior",d_="IamInstanceProfile",J3="Ipv6IpamPoolId",eP="Ipv4IpamPoolId",_se="InstanceIpv4PrefixList",wse="InstanceIpv6PrefixList",Ese="IamInstanceProfileSpecification",xse="InstanceIpv4Prefix",Rse="InstanceIpv6Prefix",tP="InstanceInitiatedShutdownBehavior",Cse="ImageIdStringList",Ase="InstanceIdStringList",Hl="ImageId",Tse="ImageIds",rd="InstanceIds",Ise="ImportKeyPair",Ose="ImportKeyPairRequest",Mse="ImportKeyPairResult",Dse="ImageLocation",kse="ImageList",Pse="InstanceLifecycle",Nse="InstanceList",Lse="InstanceMaintenanceOptions",zse="InstanceMaintenanceOptionsRequest",Bse="InstanceMarketOptionsRequest",$se="InstanceMetadataOptionsRequest",Use="InstanceMetadataOptionsResponse",jse="InstanceMarketOptions",nP="InstanceMetadataTags",sP="Ipv6Native",Hse="InstanceNetworkInterface",Vse="InstanceNetworkInterfaceAssociation",Fse="InstanceNetworkInterfaceAttachment",qse="InstanceNetworkInterfaceList",Gse="InstanceNetworkInterfaceSpecification",Zse="InstanceNetworkInterfaceSpecificationList",rP="Ipv6NetmaskLength",oP="Ipv4NetmaskLength",Kse="InstanceNetworkPerformanceOptions",Qse="InstanceNetworkPerformanceOptionsRequest",Yse="ImageOwnerAlias",Xse="IpOwnerId",Wse="InstanceOwningService",Jse="Ipv6PrefixCount",ere="Ipv4PrefixCount",tre="InstancePrivateIpAddress",nre="InstancePrivateIpAddressList",sre="IsPrimaryIpv6",rre="IncludePublicKey",ore="Ipv4PrefixList",ire="Ipv6PrefixList",are="Ipv4PrefixSpecificationRequest",cre="Ipv6PrefixSpecificationRequest",iP="Ipv6Prefixes",p_="Ipv6Prefix",aP="Ipv6Pool",cP="Ipv4Prefixes",h_="Ipv4Prefix",lre="InstanceStateChange",ure="InstanceStateChangeList",fre="InstanceSecondaryInterfaceAttachment",dre="InstanceSecondaryInterfaceList",pre="InstanceSecondaryInterfacePrivateIpAddress",hre="InstanceSecondaryInterfacePrivateIpAddressList",mre="InstanceSecondaryInterfacePrivateIpAddressListRequest",gre="InstanceSecondaryInterfacePrivateIpAddressRequest",yre="InstanceSecondaryInterfaceSpecificationListRequest",bre="InstanceSecondaryInterfaceSpecificationRequest",vre="InstanceSecondaryInterface",lP="InstanceStorageInfo",Sre="InstanceStorageSupported",_re="ImdsSupport",wre="InstanceState",uP="IpSource",Ere="Ipv6Supported",od="InstanceType",xre="InstanceTypeInfoList",Rre="InstanceTypeInfo",Cre="ImageType",fP="InstanceTenancy",dP="InstanceTypes",Qm="InterfaceType",Are="Images",Tre="Image",Ire="Instance",Ore="Instances",Ym="Iops",Mre="Key",Dre="KeyFormat",m_="KeyFingerprint",g_="KernelId",id="KmsKeyId",kre="KeyMaterial",so="KeyName",Pre="KeyNameStringList",Nre="KeyNames",Lre="KeyPairs",mc="KeyPairId",zre="KeyPairIdStringList",Bre="KeyPairIds",$re="KeyPairInfo",Ure="KeyPairList",jre="KeyPair",pP="KeyType",Hre="Kernel",hP="LicenseConfigurationArn",Vre="LicenseConfigurationRequest",Fre="LicenseConfiguration",qre="LambdaExclusion",Gre="LogicalGpuCount",Zre="LicenseList",Kre="LastLaunchedTime",Qre="LicenseSpecifications",Yre="LicenseSpecificationListRequest",Xre="LicenseSpecification",Wre="LaunchTemplate",Jre="LaunchTemplateId",eoe="LaunchTemplateName",toe="LaunchTemplateSpecification",noe="LaunchTime",soe="Latest",roe="Lambda",ooe="Licenses",ioe="Location",y_="MultiAttachEnabled",mP="MediaAcceleratorInfo",gP="MacAddress",yP="MaximumBandwidthInMbps",aoe="MapCustomerOwnedIpOnLaunch",coe="MaxCount",loe="MinCount",uoe="MediaDeviceInfo",foe="MediaDeviceInfoList",doe="MediaDeviceMemoryInfo",poe="MaximumEbsAttachments",hoe="MaximumEbsCards",moe="MaximumEfaInterfaces",goe="MaximumEnaQueueCount",yoe="MaximumEnaQueueCountPerInterface",bP="MaximumIops",boe="ModifyInstanceAttributeRequest",voe="ModifyInstanceAttribute",gc="MemoryInfo",Soe="MaximumNetworkCards",vP="MaximumNetworkInterfaces",SP="MetadataOptions",_P="MaintenanceOptions",_oe="MapPublicIpOnLaunch",woe="MaxPrice",yc="MaxResults",Eoe="MaximumSecondaryNetworkInterfaces",xoe="ModificationState",Roe="MarketType",wP="MaximumThroughputInMBps",Coe="ModifyVolumeRequest",Aoe="ModifyVolumeResult",Toe="ModifyVolume",ad="Manufacturer",Ioe="Managed",EP="Message",Ooe="Messages",xP="Mode",b_="Monitoring",Qs="Name",RP="NetworkBorderGroup",Moe="NetworkCards",cd="NetworkCardIndex",Doe="NetworkCardInfoList",koe="NetworkCardInfo",CP="NoDevice",Poe="NeuronDeviceCoreInfo",Noe="NeuronDeviceInfo",Loe="NeuronDeviceInfoList",zoe="NeuronDeviceMemoryInfo",Boe="NeuronDevices",$oe="NitroEnclavesSupport",Uoe="NatGateway",joe="NatGatewayExclusion",AP="NetworkInterfaceId",TP="NetworkInterfaces",IP="NetworkInfo",OP="NeuronInfo",MP="NetworkPerformanceOptions",DP="NetworkPerformance",Hoe="NoReboot",kP="NvmeSupport",PP="NitroTpmInfo",Voe="NitroTpmSupport",Foe="NitroTpmSupportedVersionsList",As="NextToken",NP="NestedVirtualization",da="OutpostArn",qoe="OwnerAlias",bc="OwnerId",LP="OptInStatus",Goe="OriginalIops",Zoe="OwnerIds",Koe="OriginalMultiAttachEnabled",Qoe="OperatorRequest",Yoe="OperatorResponse",Xoe="OwnerStringList",Woe="OriginalSize",Joe="OriginalThroughput",eie="OriginalVolumeType",Vl="Operator",tie="Output",nie="Owners",v_="Owner",zP="Principal",sie="PeakBandwidthInGbps",rie="ProductCodeId",oie="ProductCodeList",iie="ProductCodeType",aie="ProductCode",BP="ProductCodes",S_="PrivateDnsName",$P="PrivateDnsNameOptions",UP="PrivateDnsNameOptionsOnLaunch",cie="PrivateDnsNameOptionsRequest",lie="PrivateDnsNameOptionsResponse",jP="PublicDnsName",HP="PlatformDetails",VP="PlacementGroupInfo",uie="PlacementGroupStrategyList",fie="PublicIp",die="PrivateIpAddressCount",pie="PrivateIpAddressSpecification",hie="PrivateIpAddressSpecificationList",Go="PrivateIpAddress",Xm="PrivateIpAddresses",mie="PublicIpAddress",gie="PrimaryIpv6",FP="ProcessorInfo",yie="PublicKey",bie="PublicKeyMaterial",vie="PartitionNumber",Sie="PhcSupport",_ie="PreviousState",wie="PresignedUrl",Eie="ParentZoneId",xie="ParentZoneName",qP="Platform",__="Placement",GP="Primary",ZP="Progress",Rie="Public",Cie="Return",Aie="RestorableByUserIds",Tie="RestorableBy",KP="RootDeviceName",QP="RootDeviceType",Iie="RootDeviceTypeList",Oie="RestoreExpiryTime",Mie="ResourceExclusions",Die="RegionGeography",kie="RegionGeographyList",Pie="RunInstancesMonitoringEnabled",Nie="RebootInstancesRequest",Lie="RunInstancesRequest",zie="RunInstancesUserData",w_="RamdiskId",Bie="ReservationId",$ie="RebootInstances",Uie="RequesterId",jie="RunInstances",Hie="RegionList",Vie="ReservationList",Fie="RebootMigrationSupport",qie="RebootMigration",Wm="RegionName",Gie="RegionNameStringList",Zie="RegionNames",Kie="ResourceType",Qie="Ramdisk",Yie="Regions",Xie="Region",Wie="Reservations",Jie="Reservation",eae="SupportedAdditionalProcessorFeatureList",tae="SubnetArn",nae="SupportedArchitectures",sae="SupportedBootModes",rae="SubnetCidrBlockState",oae="SustainedClockSpeedInGhz",Jm="SourceDestCheck",iae="SpreadDomain",aae="SupportedFeatures",cae="SubGeography",E_="SecurityGroupId",lae="SecurityGroupIdStringList",uae="SecurityGroupIds",fae="SecurityGroupStringList",YP="SecurityGroups",XP="SecurityGroup",dae="SubnetIds",pae="SubnetIpv6CidrBlockAssociation",hae="SubnetIpv6CidrBlockAssociationSet",mae="SizeInGB",gae="SourceImageId",yae="SecondaryInterfaceId",bae="SourceInstanceId",Fl="SizeInMiB",vae="SpotInstanceRequestId",Sae="SourceImageRegion",_ae="StartInstancesRequest",wae="StartInstancesResult",Eae="StopInstancesRequest",xae="StopInstancesResult",Rae="SnapshotIdStringList",Cae="SubnetIdStringList",Aae="SpotInstanceType",WP="SecondaryInterfaces",Tae="SecondaryInterface",pa="SnapshotId",Iae="SnapshotIds",Oae="StartingInstances",Mae="StartInstances",Dae="StoppingInstances",kae="StopInstances",ha="SubnetId",Pae="SnapshotLocation",Nae="SnapshotList",Lae="SubnetList",zae="SpotMarketOptions",x_="StatusMessage",R_="StateMessage",Bae="SecondaryNetworkId",C_="SriovNetSupport",$ae="SecondaryNetworkSupported",Uae="SpotOptions",JP="SkipOsShutdown",jae="SecondaryPrivateIpAddressCount",Hae="SupportedRootDeviceTypes",Vae="SourceRegion",A_="StateReason",Fae="SourceSnapshotId",eN="SecondarySubnetId",qae="SupportedStrategies",tN="StartTime",Gae="StateTransitionReason",nN="SseType",Zae="StorageTier",Kae="SupportedUsageClasses",Qae="SensitiveUserData",Yae="SourceVolumeId",Xae="SupportedVirtualizationTypes",Wae="SupportedVersions",T_="Size",Jae="Snapshots",ece="Snapshot",Ts="State",ld="Status",sN="Subnet",tce="Subnets",Er="Tags",rN="TcpEstablishedTimeout",nce="TotalFpgaMemoryInMiB",sce="TotalGpuMemoryInMiB",rce="TerminateInstances",oce="TotalInferenceMemoryInMiB",ice="TerminateInstancesRequest",ace="TerminateInstancesResult",cce="TargetIops",lce="TerminatingInstances",uce="TagList",fce="TargetMultiAttachEnabled",dce="TotalMediaMemoryInMiB",pce="TotalNeuronDeviceMemoryInMiB",oN="ThreadsPerCore",hce="ThreadsPerCoreList",Zo="TagSpecifications",mce="TotalSizeInGB",gce="TagSpecificationList",ro="TagSpecification",yce="TargetSize",iN="TpmSupport",bce="TargetThroughput",vce="TransferType",Sce="TargetVolumeType",aN="Tag",_ce="Tenancy",eg="Throughput",wce="Timestamp",tg="Type",Ece="UsageClassTypeList",cN="UserData",lN="UsageOperation",xce="UsageOperationUpdateTime",uN="UdpStreamTimeout",fN="UdpTimeout",ql="Value",Rce="VolumeAttachmentList",Cce="VolumeAttachment",Ace="VpcCidrBlockAssociation",Tce="VpcCidrBlockAssociationSet",Ice="VpcCidrBlockState",dN="VCpuInfo",Oce="ValidCores",pN="VpcEncryptionControl",Mce="VpcEncryptionControlConfiguration",Dce="VpcEncryptionControlExclusion",kce="VpcEncryptionControlExclusions",Pce="VpcEncryptionControlId",Ko="VpcId",Nce="VpcIpv6CidrBlockAssociation",Lce="VpcIpv6CidrBlockAssociationSet",I_="VolumeInitializationRate",zce="VolumeIdStringList",Bce="VpcIdStringList",Ys="VolumeId",$ce="VolumeIds",Uce="VpcIds",jce="VpcLattice",Hce="VpcLatticeExclusion",Vce="VolumeList",Fce="VpcList",hN="VolumeModification",mN="VirtualName",qce="VolumeOwnerId",Gce="VpcPeeringExclusion",Zce="VirtualPrivateGateway",Kce="VirtualPrivateGatewayExclusion",Qce="VpcPeering",Yce="ValueStringList",gN="VolumeSize",ng="VolumeType",Xce="VirtualizationTypeList",Wce="ValidThreadsPerCore",yN="VirtualizationType",Jce="ValidUntil",ele="Values",bN="Version",tle="Volumes",nle="Volume",vN="Vpc",sle="Vpcs",rle="WorkloadsList",ole="Workloads",O_="ZoneId",ile="ZoneIdStringList",ale="ZoneIds",M_="ZoneName",cle="ZoneNameStringList",lle="ZoneNames",ule="ZoneType",fle="additionalFlexibleNetworkInterfaces",dle="availableIpAddressCount",ple="assignIpv6AddressOnCreation",SN="additionalInfo",D_="associationId",_N="attachmentId",hle="amiLaunchIndex",mle="attachmentLimitType",gle="associatePublicIpAddress",yle="amazonProvidedIpv6CidrBlock",ble="autoRecoverySupported",wN="associatedResource",vle="autoRecovery",Sle="amdSevSnp",_le="attachmentSet",sg="attachTime",ud="availabilityZone",k_="availabilityZoneId",wle="availabilityZoneInfo",EN="accelerators",Ele="affinity",xN="arn",RN="architecture",CN="association",AN="attachment",xle="attribute",Rle="baselineBandwidthInGbps",TN="baselineBandwidthInMbps",rg="blockDeviceMapping",IN="baselineIops",ON="bootMode",Cle="bareMetal",MN="blockPublicAccessStates",Ale="burstablePerformanceSupported",DN="baselineThroughputInMBps",Tle="bandwidthWeighting",Ile="bandwidthWeightings",P_="cidrBlock",Ole="cidrBlockAssociationSet",Mle="capacityBlockId",Dle="cidrBlockState",kle="coreCount",Ple="completionDurationMinutes",Nle="creationDate",Lle="currentGeneration",zle="carrierIp",Ble="currentInstanceBootMode",$le="coreInfo",Ule="cpuOptions",jle="customerOwnedIp",Hle="customerOwnedIpv4Pool",kN="capacityReservationId",Vle="capacityReservationPreference",Fle="capacityReservationResourceGroupArn",qle="capacityReservationSpecification",Gle="capacityReservationTarget",Zle="currentState",PN="clientToken",Kle="connectionTrackingConfiguration",Qle="completionTime",NN="createTime",LN="code",Yle="configured",vc="count",zN="disableApiTermination",Xle="defaultCores",Wle="dataEncryptionKeyId",Jle="defaultEnaQueueCountPerInterface",eue="defaultForAz",tue="dedicatedHostsSupported",N_="deviceIndex",L_="deviceName",nue="defaultNetworkCardIndex",sue="dnsName",rue="dhcpOptionsId",Sc="deleteOnTermination",oue="deregistrationProtection",Rt="dryRun",iue="destinationRegion",aue="defaultThreadsPerCore",cue="deprecationTime",lue="defaultVCpus",fd="description",uue="device",fue="disks",z_="ebsCardIndex",due="ebsCardSet",pue="encryptionControl",hue="enableDns64",mue="elasticFileSystem",gue="elasticGpuAssociationId",yue="elasticGpuAssociationState",bue="elasticGpuAssociationSet",vue="elasticGpuAssociationTime",Sue="elasticGpuId",_ue="elasticInferenceAcceleratorArn",wue="elasticInferenceAcceleratorAssociationId",Eue="elasticInferenceAcceleratorAssociationState",xue="elasticInferenceAcceleratorAssociationSet",Rue="elasticInferenceAcceleratorAssociationTime",Cue="encryptionInTransitSupported",Aue="ebsInfo",Tue="efaInfo",Iue="enableLniAtDeviceIndex",B_="ebsOptimized",Oue="ebsOptimizedInfo",Mue="egressOnlyInternetGateway",Due="ebsOptimizedSupport",kue="enclaveOptions",Pue="enaQueueCount",_="ec2QueryName",BN="enableResourceNameDnsAAAARecord",$N="enableResourceNameDnsARecord",Nue="enaSrdEnabled",Lue="enaSrdSpecification",zue="enaSrdSupported",Bue="enaSrdUdpEnabled",$ue="enaSrdUdpSpecification",Uue="efaSupported",UN="encryptionSupport",og="enaSupport",jue="endTime",$_="ebs",jN="enabled",dd="encrypted",Hue="flexibleEnaQueuesSupport",Vue="fpgaInfo",Fue="fastRestored",que="fullSnapshotSizeInBytes",HN="freeTierEligible",Gue="force",Zue="fpgas",Kue="gpuInfo",U_="groupId",Que="groupLongName",j_="groupName",Yue="gpuPartitionSize",VN="geographySet",H_="groupSet",Xue="gpus",V_="hypervisor",Wue="httpEndpoint",Jue="hostId",efe="hibernationOptions",tfe="httpProtocolIpv6",nfe="httpPutResponseHopLimit",sfe="hostResourceGroupArn",rfe="hibernationSupported",ofe="httpTokens",FN="hostnameType",ife="id",qN="ipv6AddressAttribute",afe="ipv6AddressCount",cfe="inferenceAcceleratorInfo",lfe="ipv4AddressesPerInterface",ufe="ipv6AddressesPerInterface",ffe="ipv4AddressesPerSecondaryInterface",GN="ipv6AddressesSet",dfe="imageAllowed",pfe="ipAddress",ZN="ipv6Address",KN="ipv6CidrBlock",QN="ipv6CidrBlockAssociationSet",YN="ipv6CidrBlockState",hfe="isDefault",mfe="internetGateway",gfe="internetGatewayBlockMode",Gl="instanceId",XN="iamInstanceProfile",WN="instanceInitiatedShutdownBehavior",F_="imageId",yfe="imageLocation",bfe="instanceLifecycle",vfe="instanceMetadataTags",Sfe="ipv6Native",_fe="imageOwnerAlias",wfe="imageOwnerId",Efe="ipOwnerId",xfe="instanceOwningService",Rfe="isPrimaryIpv6",Cfe="ipv4PrefixSet",Afe="ipv6PrefixSet",Tfe="ipv4Prefix",Ife="ipv6Pool",Ofe="ipv6Prefix",Mfe="isPublic",Dfe="instanceStorageInfo",kfe="instanceStorageSupported",Pfe="imagesSet",Nfe="imageState",Lfe="imdsSupport",ig="instancesSet",zfe="instanceState",JN="ipSource",Bfe="ipv6Supported",q_="instanceType",$fe="instanceTypeSet",Ufe="idempotencyToken",jfe="imageType",eL="instanceTenancy",tL="interfaceType",nL="iops",ke="item",Hfe="key",G_="keyFingerprint",sL="kernelId",ag="kmsKeyId",Vfe="keyMaterial",pd="keyName",cg="keyPairId",Ffe="keySet",qfe="keyType",Gfe="kernel",Zfe="licenseConfigurationArn",Kfe="logicalGpuCount",Qfe="lastLaunchedTime",Yfe="licenseSet",Xfe="launchTime",Wfe="lambda",Jfe="multiAttachEnabled",ede="mediaAcceleratorInfo",rL="macAddress",oL="maximumBandwidthInMbps",tde="mapCustomerOwnedIpOnLaunch",nde="maximumEbsAttachments",sde="maximumEbsCards",rde="maximumEfaInterfaces",ode="maximumEnaQueueCount",ide="maximumEnaQueueCountPerInterface",iL="maximumIops",Zl="memoryInfo",ade="maximumNetworkCards",aL="maximumNetworkInterfaces",cde="metadataOptions",lde="maintenanceOptions",ude="mapPublicIpOnLaunch",cL="maxResults",fde="messageSet",dde="maximumSecondaryNetworkInterfaces",pde="modificationState",lL="maximumThroughputInMBps",hd="manufacturer",hde="managed",uL="message",mde="monitoring",gde="mode",xr="name",fL="networkBorderGroup",yde="networkCards",Z_="networkCardIndex",dL="noDevice",bde="neuronDevices",vde="nitroEnclavesSupport",Sde="natGateway",pL="networkInterfaceId",_de="networkInterfaceSet",wde="networkInterface",Ede="networkInfo",xde="neuronInfo",Rde="networkPerformanceOptions",hL="networkPerformance",Cde="noReboot",mL="nvmeSupport",Ade="nitroTpmInfo",Tde="nitroTpmSupport",Qo="nextToken",Ide="nestedVirtualization",md="outpostArn",Ode="ownerAlias",Kl="ownerId",gL="optInStatus",Mde="originalIops",Dde="originalMultiAttachEnabled",kde="originalSize",Pde="originalThroughput",Nde="originalVolumeType",lg="operator",Lde="output",zde="principal",Bde="peakBandwidthInGbps",yL="productCodes",$de="productCode",Ude="privateDnsNameOptions",jde="privateDnsNameOptionsOnLaunch",K_="privateDnsName",Hde="publicDnsName",bL="platformDetails",Vde="placementGroupInfo",Fde="publicIp",vL="privateIpAddressesSet",qde="privateIpAddressSet",_c="privateIpAddress",Gde="processorInfo",Zde="publicKey",Kde="publicKeyMaterial",Qde="partitionNumber",Yde="phcSupport",Xde="previousState",Wde="presignedUrl",Jde="parentZoneId",epe="parentZoneName",SL="platform",tpe="placement",_L="primary",wL="progress",npe="return",EL="rootDeviceName",xL="rootDeviceType",spe="restoreExpiryTime",rpe="regionEndpoint",ope="resourceExclusions",ipe="reservationId",RL="ramdiskId",ape="regionInfo",cpe="requesterId",lpe="rebootMigrationSupport",upe="rebootMigration",CL="regionName",fpe="reservationSet",dpe="resourceType",ppe="ramdisk",hpe="reason",AL="smithy.ts.sdk.synthetic.com.amazonaws.ec2",mpe="supportedArchitectures",gpe="subnetArn",ype="supportedBootModes",bpe="sustainedClockSpeedInGhz",Q_="sourceDestCheck",vpe="spreadDomain",Spe="supportedFeatures",_pe="subGeographySet",wpe="sizeInGB",Epe="sourceInstanceId",xpe="secondaryInterfaceId",Rpe="sourceImageId",Ql="sizeInMiB",Cpe="sourceImageRegion",Ape="spotInstanceRequestId",Tpe="secondaryInterfaceSet",ug="snapshotId",fg="subnetId",dg="statusMessage",TL="stateMessage",Ipe="secondaryNetworkId",Ope="secondaryNetworkSupported",Y_="sriovNetSupport",Mpe="secondaryPrivateIpAddressCount",Dpe="supportedRootDeviceTypes",IL="stateReason",kpe="secondarySubnetId",Ppe="snapshotSet",Npe="subnetSet",Lpe="supportedStrategies",OL="startTime",ML="sseType",zpe="storageTier",Bpe="supportedUsageClasses",$pe="sourceVolumeId",Upe="supportedVirtualizationTypes",jpe="supportedVersions",Hpe="size",ma="state",ga="status",Vpe="subnet",Fpe="tenancy",qpe="tcpEstablishedTimeout",Gpe="totalFpgaMemoryInMiB",Zpe="totalGpuMemoryInMiB",Kpe="totalInferenceMemoryInMiB",Qpe="targetIops",Ype="targetMultiAttachEnabled",Xpe="totalMediaMemoryInMiB",Wpe="totalNeuronDeviceMemoryInMiB",Jpe="threadsPerCore",zr="tagSet",ehe="totalSizeInGB",the="targetSize",DL="tpmSupport",nhe="targetThroughput",she="transferType",rhe="targetVolumeType",kL="throughput",ohe="timestamp",X_="type",ihe="userData",PL="usageOperation",ahe="usageOperationUpdateTime",che="udpStreamTimeout",lhe="udpTimeout",gd="value",uhe="vCpuInfo",fhe="validCores",dhe="vpcEncryptionControlId",yd="vpcId",phe="volumeInitializationRate",Yl="volumeId",hhe="vpcLattice",mhe="volumeModification",NL="virtualName",ghe="volumeOwnerId",yhe="virtualPrivateGateway",bhe="vpcPeering",vhe="volumeSet",LL="volumeSize",She="vpcSet",zL="volumeType",_he="validThreadsPerCore",BL="virtualizationType",whe="version",Ehe="vpc",xhe="workloadSet",y="xmlName",Rhe="zoneId",Che="zoneName",Ahe="zoneState",The="zoneType",I="com.amazonaws.ec2",$L=ts.for(AL);var Ihe=[-3,AL,"EC2ServiceException",0,[],[]];$L.registerError(Ihe,jS);const Ohe=[$L];var Mhe=[0,I,pee,8,0],Dhe=[0,I,zie,8,0],khe=[0,I,Qae,8,0],Phe=[3,I,wJ,0,[XS,ls,Ys,nd,yt],[0,0,0,1,[2,{[_]:"DryRun",[y]:Rt}]],3],df=[3,I,uJ,0,[ql],[[2,{[_]:"Value",[y]:gd}]]],pf=[3,I,EJ,0,[ql],[[0,{[_]:"Value",[y]:gd}]]],Nhe=[3,I,la,0,[LP,Ooe,Wm,M_,O_,i_,RP,ule,xie,Eie,Vne,V3,cae,Ts],[[0,{[_]:"OptInStatus",[y]:gL}],[()=>Vye,{[_]:"MessageSet",[y]:fde}],[0,{[_]:"RegionName",[y]:CL}],[0,{[_]:"ZoneName",[y]:Che}],[0,{[_]:"ZoneId",[y]:Rhe}],[0,{[_]:"GroupName",[y]:j_}],[0,{[_]:"NetworkBorderGroup",[y]:fL}],[0,{[_]:"ZoneType",[y]:The}],[0,{[_]:"ParentZoneName",[y]:epe}],[0,{[_]:"ParentZoneId",[y]:Jde}],[0,{[_]:"GroupLongName",[y]:Que}],[()=>jye,{[_]:"GeographySet",[y]:VN}],[()=>Fye,{[_]:"SubGeographySet",[y]:_pe}],[0,{[_]:"ZoneState",[y]:Ahe}]]],Lhe=[3,I,RJ,0,[Qs],[[0,{[_]:"Name",[y]:xr}]]],zhe=[3,I,TJ,0,[EP],[[0,{[_]:"Message",[y]:uL}]]],Bhe=[3,I,OJ,0,[Qs],[[0,{[_]:"Name",[y]:xr}]]],$he=[3,I,LJ,0,[ql],[[21,{[_]:"Value",[y]:gd}]]],UL=[3,I,VS,0,[n_,CP,YS,mN],[[()=>Pme,{[_]:"Ebs",[y]:$_}],[0,{[_]:"NoDevice",[y]:dL}],[0,{[_]:"DeviceName",[y]:L_}],[0,{[_]:"VirtualName",[y]:NL}]]],jL=[3,I,FS,0,[gse],[[0,{[_]:"InternetGatewayBlockMode",[y]:gfe}]]],Uhe=[3,I,ZS,0,[S3,KS],[0,()=>Hhe]],jhe=[3,I,uee,0,[S3,KS],[[0,{[_]:"CapacityReservationPreference",[y]:Vle}],[()=>Vhe,{[_]:"CapacityReservationTarget",[y]:Gle}]]],Hhe=[3,I,KS,0,[GS,_3],[0,0]],Vhe=[3,I,fee,0,[GS,_3],[[0,{[_]:"CapacityReservationId",[y]:kN}],[0,{[_]:"CapacityReservationResourceGroupArn",[y]:Fle}]]],Fhe=[3,I,Cee,0,[rN,uN,fN],[1,1,1]],qhe=[3,I,Aee,0,[rN,uN,fN],[[1,{[_]:"TcpEstablishedTimeout",[y]:qpe}],[1,{[_]:"UdpStreamTimeout",[y]:che}],[1,{[_]:"UdpTimeout",[y]:lhe}]]],Ghe=[3,I,dee,0,[Vae,Fae,hc,ate,dte,sd,id,wie,Zo,v3,Pee,yt],[0,0,0,0,[0,{[_]:"DestinationRegion",[y]:iue}],[2,{[_]:"Encrypted",[y]:dd}],[0,{[_]:"KmsKeyId",[y]:ag}],[()=>Mhe,{[_]:"PresignedUrl",[y]:Wde}],[()=>Yo,{[y]:ro}],1,0,[2,{[_]:"DryRun",[y]:Rt}]],2],Zhe=[3,I,hee,0,[Er,pa],[[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"SnapshotId",[y]:ug}]]],Khe=[3,I,qS,0,[b3,oN,a3,NP],[[1,{[_]:"CoreCount",[y]:kle}],[1,{[_]:"ThreadsPerCore",[y]:Jpe}],[0,{[_]:"AmdSevSnp",[y]:Sle}],[0,{[_]:"NestedVirtualization",[y]:Ide}]]],Qhe=[3,I,lee,0,[b3,oN,a3,NP],[1,1,0,0]],Yhe=[3,I,tee,0,[ls,Qs,Zo,Pae,yt,hc,Hoe,ed],[[0,{[_]:"InstanceId",[y]:Gl}],[0,{[_]:"Name",[y]:xr}],[()=>Yo,{[y]:ro}],0,[2,{[_]:"DryRun",[y]:Rt}],[0,{[_]:"Description",[y]:fd}],[2,{[_]:"NoReboot",[y]:Cde}],[()=>WL,{[_]:"BlockDeviceMapping",[y]:rg}]],2],Xhe=[3,I,nee,0,[Hl],[[0,{[_]:"ImageId",[y]:F_}]]],Whe=[3,I,iee,0,[so,pP,Zo,Dre,yt],[0,0,[()=>Yo,{[y]:ro}],0,[2,{[_]:"DryRun",[y]:Rt}]],1],Jhe=[3,I,mee,0,[Ys,hc,da,Zo,ioe,yt],[0,0,0,[()=>Yo,{[y]:ro}],0,[2,{[_]:"DryRun",[y]:Rt}]],1],eme=[3,I,gee,0,[Ko,Zo,la,jl,td,Km,da,sP,eP,oP,J3,rP,yt],[0,[()=>Yo,{[y]:ro}],0,0,0,0,0,2,0,1,0,1,[2,{[_]:"DryRun",[y]:Rt}]],1],tme=[3,I,yee,0,[sN],[[()=>KL,{[_]:"Subnet",[y]:Vpe}]]],nme=[3,I,Iee,0,[la,jl,sd,Ym,id,da,T_,pa,ng,Zo,y_,eg,QS,I_,Vl,yt],[0,0,[2,{[_]:"Encrypted",[y]:dd}],1,0,0,1,0,0,[()=>Yo,{[y]:ro}],2,1,[0,4],1,()=>VL,[2,{[_]:"DryRun",[y]:Rt}]]],sme=[3,I,Oee,0,[td,aP,Km,eP,oP,J3,rP,cse,pN,Zo,yt,fP,bJ],[0,0,0,0,1,0,1,0,()=>zye,[()=>Yo,{[y]:ro}],[2,{[_]:"DryRun",[y]:Rt}],[0,{[_]:"InstanceTenancy",[y]:eL}],[2,{[_]:"AmazonProvidedIpv6CidrBlock",[y]:yle}]]],rme=[3,I,Mee,0,[vN],[[()=>YL,{[_]:"Vpc",[y]:Ehe}]]],ome=[3,I,bee,0,[YJ],[0],1],ime=[3,I,tte,0,[so,mc,yt],[0,0,[2,{[_]:"DryRun",[y]:Rt}]]],ame=[3,I,nte,0,[Cie,mc],[[2,{[_]:"Return",[y]:npe}],[0,{[_]:"KeyPairId",[y]:cg}]]],cme=[3,I,hte,0,[pa,yt],[0,[2,{[_]:"DryRun",[y]:Rt}]],1],lme=[3,I,mte,0,[ha,yt],[0,[2,{[_]:"DryRun",[y]:Rt}]],1],ume=[3,I,Ate,0,[Ys,yt],[0,[2,{[_]:"DryRun",[y]:Rt}]],1],fme=[3,I,Tte,0,[Ko,yt],[0,[2,{[_]:"DryRun",[y]:Rt}]],1],dme=[3,I,Nee,0,[lle,ale,lJ,yt,no],[[()=>obe,{[y]:M_}],[()=>rbe,{[y]:O_}],2,[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}]]],pme=[3,I,Lee,0,[DJ],[[()=>Hye,{[_]:"AvailabilityZoneInfo",[y]:wle}]]],hme=[3,I,Fee,0,[xne,Tse,nie,lse,pse,yc,As,yt,no],[[()=>t0e,{[y]:A3}],[()=>o0e,{[y]:Hl}],[()=>JL,{[y]:v_}],2,2,1,0,[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}]]],mme=[3,I,qee,0,[As,Are],[[0,{[_]:"NextToken",[y]:Qo}],[()=>i0e,{[_]:"ImagesSet",[y]:Pfe}]]],gme=[3,I,Gee,0,[rd,yt,no,As,yc],[[()=>bd,{[y]:ls}],[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}],[0,{[_]:"NextToken",[y]:Qo}],[1,{[_]:"MaxResults",[y]:cL}]]],yme=[3,I,Zee,0,[As,Wie],[[0,{[_]:"NextToken",[y]:Qo}],[()=>z0e,{[_]:"ReservationSet",[y]:fpe}]]],bme=[3,I,Kee,0,[yt,dP,no,yc,As],[2,[64,{[y]:od}],[()=>oo,{[y]:wr}],1,0]],vme=[3,I,Qee,0,[dP,As],[[()=>S0e,{[_]:"InstanceTypeSet",[y]:$fe}],[0,{[_]:"NextToken",[y]:Qo}]]],Sme=[3,I,ste,0,[Nre,Bre,rre,yt,no],[[()=>E0e,{[y]:so}],[()=>x0e,{[y]:mc}],2,[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}]]],_me=[3,I,rte,0,[Lre],[[()=>R0e,{[_]:"KeySet",[y]:Ffe}]]],wme=[3,I,ute,0,[Zie,SJ,yt,no],[[()=>L0e,{[y]:Wm}],2,[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}]]],Eme=[3,I,fte,0,[Yie],[[()=>N0e,{[_]:"RegionInfo",[y]:ape}]]],xme=[3,I,gte,0,[yc,As,Zoe,Aie,Iae,yt,no],[1,0,[()=>JL,{[y]:v_}],[64,{[y]:Tie}],[()=>U0e,{[y]:pa}],[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}]]],Rme=[3,I,yte,0,[As,Jae],[[0,{[_]:"NextToken",[y]:Qo}],[()=>j0e,{[_]:"SnapshotSet",[y]:Ppe}]]],Cme=[3,I,bte,0,[no,dae,As,yc,yt],[[()=>oo,{[y]:wr}],[()=>H0e,{[y]:ha}],0,1,[2,{[_]:"DryRun",[y]:Rt}]]],Ame=[3,I,vte,0,[As,tce],[[0,{[_]:"NextToken",[y]:Qo}],[()=>F0e,{[_]:"SubnetSet",[y]:Npe}]]],Tme=[3,I,Ite,0,[$ce,yt,no,As,yc],[[()=>X0e,{[y]:Ys}],[2,{[_]:"DryRun",[y]:Rt}],[()=>oo,{[y]:wr}],[0,{[_]:"NextToken",[y]:Qo}],[1,{[_]:"MaxResults",[y]:cL}]]],Ime=[3,I,Ote,0,[As,tle],[[0,{[_]:"NextToken",[y]:Qo}],[()=>W0e,{[_]:"VolumeSet",[y]:vhe}]]],Ome=[3,I,Mte,0,[no,Uce,As,yc,yt],[[()=>oo,{[y]:wr}],[()=>ebe,{[y]:Ko}],0,1,[2,{[_]:"DryRun",[y]:Rt}]]],Mme=[3,I,Dte,0,[As,sle],[[0,{[_]:"NextToken",[y]:Qo}],[()=>nbe,{[_]:"VpcSet",[y]:She}]]],Dme=[3,I,kte,0,[Ys,XS,r_,ls,yt],[0,0,2,0,[2,{[_]:"DryRun",[y]:Rt}]],1],kme=[3,I,Jee,0,[mae,ua,tg],[[1,{[_]:"SizeInGB",[y]:wpe}],[1,{[_]:"Count",[y]:vc}],[0,{[_]:"Type",[y]:X_}]]],Pme=[3,I,Ute,0,[fa,Ym,pa,gN,ng,id,eg,da,la,sd,I_,jl,nd],[[2,{[_]:"DeleteOnTermination",[y]:Sc}],[1,{[_]:"Iops",[y]:nL}],[0,{[_]:"SnapshotId",[y]:ug}],[1,{[_]:"VolumeSize",[y]:LL}],[0,{[_]:"VolumeType",[y]:zL}],[0,{[_]:"KmsKeyId",[y]:ag}],[1,{[_]:"Throughput",[y]:kL}],[0,{[_]:"OutpostArn",[y]:md}],[0,{[_]:"AvailabilityZone",[y]:ud}],[2,{[_]:"Encrypted",[y]:dd}],1,0,1]],Nme=[3,I,Vte,0,[nd,p3,g3,h3,yP,wP,bP],[[1,{[_]:"EbsCardIndex",[y]:z_}],[1,{[_]:"BaselineBandwidthInMbps",[y]:TN}],[1,{[_]:"BaselineThroughputInMBps",[y]:DN}],[1,{[_]:"BaselineIops",[y]:IN}],[1,{[_]:"MaximumBandwidthInMbps",[y]:oL}],[1,{[_]:"MaximumThroughputInMBps",[y]:lL}],[1,{[_]:"MaximumIops",[y]:iL}]]],Lme=[3,I,M3,0,[yne,$3,k3,kP,poe,gJ,hoe,Fte],[[0,{[_]:"EbsOptimizedSupport",[y]:Due}],[0,{[_]:"EncryptionSupport",[y]:UN}],[()=>$me,{[_]:"EbsOptimizedInfo",[y]:Oue}],[0,{[_]:"NvmeSupport",[y]:mL}],[1,{[_]:"MaximumEbsAttachments",[y]:nde}],[0,{[_]:"AttachmentLimitType",[y]:mle}],[1,{[_]:"MaximumEbsCards",[y]:sde}],[()=>Yye,{[_]:"EbsCardSet",[y]:due}]]],zme=[3,I,une,0,[Fm,fa,ld,Ys,o3,qce,Vl,nd],[[4,{[_]:"AttachTime",[y]:sg}],[2,{[_]:"DeleteOnTermination",[y]:Sc}],[0,{[_]:"Status",[y]:ga}],[0,{[_]:"VolumeId",[y]:Yl}],[0,{[_]:"AssociatedResource",[y]:wN}],[0,{[_]:"VolumeOwnerId",[y]:ghe}],[()=>pg,{[_]:"Operator",[y]:lg}],[1,{[_]:"EbsCardIndex",[y]:z_}]]],Bme=[3,I,fne,0,[Ys,fa],[[0,{[_]:"VolumeId",[y]:Yl}],[2,{[_]:"DeleteOnTermination",[y]:Sc}]]],$me=[3,I,k3,0,[p3,g3,h3,yP,wP,bP],[[1,{[_]:"BaselineBandwidthInMbps",[y]:TN}],[1,{[_]:"BaselineThroughputInMBps",[y]:DN}],[1,{[_]:"BaselineIops",[y]:IN}],[1,{[_]:"MaximumBandwidthInMbps",[y]:oL}],[1,{[_]:"MaximumThroughputInMBps",[y]:lL}],[1,{[_]:"MaximumIops",[y]:iL}]]],Ume=[3,I,D3,0,[moe],[[1,{[_]:"MaximumEfaInterfaces",[y]:rde}]]],jme=[3,I,Qte,0,[tne,Yte,Wte,Jte],[[0,{[_]:"ElasticGpuId",[y]:Sue}],[0,{[_]:"ElasticGpuAssociationId",[y]:gue}],[0,{[_]:"ElasticGpuAssociationState",[y]:yue}],[0,{[_]:"ElasticGpuAssociationTime",[y]:vue}]]],Hme=[3,I,T3,0,[tg],[0],1],Vme=[3,I,I3,0,[tg,ua],[0,1],1],Fme=[3,I,sne,0,[cne,rne,ine,ane],[[0,{[_]:"ElasticInferenceAcceleratorArn",[y]:_ue}],[0,{[_]:"ElasticInferenceAcceleratorAssociationId",[y]:wue}],[0,{[_]:"ElasticInferenceAcceleratorAssociationState",[y]:Eue}],[4,{[_]:"ElasticInferenceAcceleratorAssociationTime",[y]:Rue}]]],qme=[3,I,vne,0,[N3,B3],[2,()=>Gme]],Gme=[3,I,_ne,0,[z3],[2]],Zme=[3,I,JS,0,[s_],[[2,{[_]:"Enabled",[y]:jN}]]],Kme=[3,I,gne,0,[s_],[2]],Qme=[3,I,wr,0,[Qs,ele],[0,[()=>K0e,{[y]:ql}]]],Yme=[3,I,Cne,0,[Qs,ad,ua,gc],[[0,{[_]:"Name",[y]:xr}],[0,{[_]:"Manufacturer",[y]:hd}],[1,{[_]:"Count",[y]:vc}],[()=>Xme,{[_]:"MemoryInfo",[y]:Zl}]]],Xme=[3,I,Tne,0,[Fl],[[1,{[_]:"SizeInMiB",[y]:Ql}]]],Wme=[3,I,U3,0,[kne,nce],[[()=>n0e,{[_]:"Fpgas",[y]:Zue}],[1,{[_]:"TotalFpgaMemoryInMiB",[y]:Gpe}]]],Jme=[3,I,Nne,0,[ls,soe,yt],[0,2,[2,{[_]:"DryRun",[y]:Rt}]],1],ege=[3,I,Lne,0,[ls,wce,tie],[[0,{[_]:"InstanceId",[y]:Gl}],[4,{[_]:"Timestamp",[y]:ohe}],[0,{[_]:"Output",[y]:Lde}]]],tge=[3,I,zne,0,[Qs,ad,ua,Gre,Fne,ole,gc],[[0,{[_]:"Name",[y]:xr}],[0,{[_]:"Manufacturer",[y]:hd}],[1,{[_]:"Count",[y]:vc}],[1,{[_]:"LogicalGpuCount",[y]:Kfe}],[1,{[_]:"GpuPartitionSize",[y]:Yue}],[()=>sbe,{[_]:"WorkloadSet",[y]:xhe}],[()=>nge,{[_]:"MemoryInfo",[y]:Zl}]]],nge=[3,I,$ne,0,[Fl],[[1,{[_]:"SizeInMiB",[y]:Ql}]]],sge=[3,I,H3,0,[qne,sce],[[()=>s0e,{[_]:"Gpus",[y]:Xue}],[1,{[_]:"TotalGpuMemoryInMiB",[y]:Zpe}]]],rge=[3,I,Hne,0,[o_,i_],[[0,{[_]:"GroupId",[y]:U_}],[0,{[_]:"GroupName",[y]:j_}]]],oge=[3,I,a_,0,[x3],[[2,{[_]:"Configured",[y]:Yle}]]],ige=[3,I,Zne,0,[x3],[2]],age=[3,I,d_,0,[l3,Xne],[[0,{[_]:"Arn",[y]:xN}],[0,{[_]:"Id",[y]:ife}]]],cge=[3,I,Ese,0,[l3,Qs],[[0,{[_]:"Arn",[y]:xN}],[0,{[_]:"Name",[y]:xr}]]],lge=[3,I,Tre,0,[HP,lN,ed,hc,Gm,l_,Yse,Qs,KP,QP,C_,A_,Er,yN,m3,iN,Rte,_re,bae,lte,Kre,sse,gae,Sae,j3,Hl,Dse,Ts,bc,XJ,Rie,BP,u3,Cre,g_,w_,qP],[[0,{[_]:"PlatformDetails",[y]:bL}],[0,{[_]:"UsageOperation",[y]:PL}],[()=>Gye,{[_]:"BlockDeviceMapping",[y]:rg}],[0,{[_]:"Description",[y]:fd}],[2,{[_]:"EnaSupport",[y]:og}],[0,{[_]:"Hypervisor",[y]:V_}],[0,{[_]:"ImageOwnerAlias",[y]:_fe}],[0,{[_]:"Name",[y]:xr}],[0,{[_]:"RootDeviceName",[y]:EL}],[0,{[_]:"RootDeviceType",[y]:xL}],[0,{[_]:"SriovNetSupport",[y]:Y_}],[()=>ZL,{[_]:"StateReason",[y]:IL}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"VirtualizationType",[y]:BL}],[0,{[_]:"BootMode",[y]:ON}],[0,{[_]:"TpmSupport",[y]:DL}],[0,{[_]:"DeprecationTime",[y]:cue}],[0,{[_]:"ImdsSupport",[y]:Lfe}],[0,{[_]:"SourceInstanceId",[y]:Epe}],[0,{[_]:"DeregistrationProtection",[y]:oue}],[0,{[_]:"LastLaunchedTime",[y]:Qfe}],[2,{[_]:"ImageAllowed",[y]:dfe}],[0,{[_]:"SourceImageId",[y]:Rpe}],[0,{[_]:"SourceImageRegion",[y]:Cpe}],[2,{[_]:"FreeTierEligible",[y]:HN}],[0,{[_]:"ImageId",[y]:F_}],[0,{[_]:"ImageLocation",[y]:yfe}],[0,{[_]:"ImageState",[y]:Nfe}],[0,{[_]:"ImageOwnerId",[y]:wfe}],[0,{[_]:"CreationDate",[y]:Nle}],[2,{[_]:"IsPublic",[y]:Mfe}],[()=>ez,{[_]:"ProductCodes",[y]:yL}],[0,{[_]:"Architecture",[y]:RN}],[0,{[_]:"ImageType",[y]:jfe}],[0,{[_]:"KernelId",[y]:sL}],[0,{[_]:"RamdiskId",[y]:RL}],[0,{[_]:"Platform",[y]:SL}]]],uge=[3,I,Ose,0,[so,bie,Zo,yt],[[0,{[_]:"KeyName",[y]:pd}],[21,{[_]:"PublicKeyMaterial",[y]:Kde}],[()=>Yo,{[y]:ro}],[2,{[_]:"DryRun",[y]:Rt}]],2],fge=[3,I,Mse,0,[m_,so,mc,Er],[[0,{[_]:"KeyFingerprint",[y]:G_}],[0,{[_]:"KeyName",[y]:pd}],[0,{[_]:"KeyPairId",[y]:cg}],[()=>Rr,{[_]:"TagSet",[y]:zr}]]],dge=[3,I,Y3,0,[c3,oce],[[()=>a0e,{[_]:"Accelerators",[y]:EN}],[1,{[_]:"TotalInferenceMemoryInMiB",[y]:Kpe}]]],pge=[3,I,use,0,[ua,Qs,ad,gc],[[1,{[_]:"Count",[y]:vc}],[0,{[_]:"Name",[y]:xr}],[0,{[_]:"Manufacturer",[y]:hd}],[()=>hge,{[_]:"MemoryInfo",[y]:Zl}]]],hge=[3,I,dse,0,[Fl],[[1,{[_]:"SizeInMiB",[y]:Ql}]]],mge=[3,I,Ire,0,[u3,ed,QS,WS,Gm,l_,d_,Pse,ene,lne,TP,da,KP,QP,YP,Jm,vae,C_,A_,Er,yN,qS,ZJ,GS,ZS,a_,ooe,SP,JS,m3,HP,lN,xce,$P,f_,iN,_P,eee,MP,Vl,WP,ls,Hl,Ts,S_,jP,Gae,so,mJ,BP,od,noe,__,g_,w_,qP,b_,ha,Ko,Go,mie],[[0,{[_]:"Architecture",[y]:RN}],[()=>c0e,{[_]:"BlockDeviceMapping",[y]:rg}],[0,{[_]:"ClientToken",[y]:PN}],[2,{[_]:"EbsOptimized",[y]:B_}],[2,{[_]:"EnaSupport",[y]:og}],[0,{[_]:"Hypervisor",[y]:V_}],[()=>age,{[_]:"IamInstanceProfile",[y]:XN}],[0,{[_]:"InstanceLifecycle",[y]:bfe}],[()=>Xye,{[_]:"ElasticGpuAssociationSet",[y]:bue}],[()=>Jye,{[_]:"ElasticInferenceAcceleratorAssociationSet",[y]:xue}],[()=>p0e,{[_]:"NetworkInterfaceSet",[y]:_de}],[0,{[_]:"OutpostArn",[y]:md}],[0,{[_]:"RootDeviceName",[y]:EL}],[0,{[_]:"RootDeviceType",[y]:xL}],[()=>J_,{[_]:"GroupSet",[y]:H_}],[2,{[_]:"SourceDestCheck",[y]:Q_}],[0,{[_]:"SpotInstanceRequestId",[y]:Ape}],[0,{[_]:"SriovNetSupport",[y]:Y_}],[()=>ZL,{[_]:"StateReason",[y]:IL}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"VirtualizationType",[y]:BL}],[()=>Khe,{[_]:"CpuOptions",[y]:Ule}],[0,{[_]:"CapacityBlockId",[y]:Mle}],[0,{[_]:"CapacityReservationId",[y]:kN}],[()=>jhe,{[_]:"CapacityReservationSpecification",[y]:qle}],[()=>oge,{[_]:"HibernationOptions",[y]:efe}],[()=>C0e,{[_]:"LicenseSet",[y]:Yfe}],[()=>Age,{[_]:"MetadataOptions",[y]:cde}],[()=>Zme,{[_]:"EnclaveOptions",[y]:kue}],[0,{[_]:"BootMode",[y]:ON}],[0,{[_]:"PlatformDetails",[y]:bL}],[0,{[_]:"UsageOperation",[y]:PL}],[4,{[_]:"UsageOperationUpdateTime",[y]:ahe}],[()=>pye,{[_]:"PrivateDnsNameOptions",[y]:Ude}],[0,{[_]:"Ipv6Address",[y]:ZN}],[0,{[_]:"TpmSupport",[y]:DL}],[()=>Ege,{[_]:"MaintenanceOptions",[y]:lde}],[0,{[_]:"CurrentInstanceBootMode",[y]:Ble}],[()=>Mge,{[_]:"NetworkPerformanceOptions",[y]:Rde}],[()=>pg,{[_]:"Operator",[y]:lg}],[()=>g0e,{[_]:"SecondaryInterfaceSet",[y]:Tpe}],[0,{[_]:"InstanceId",[y]:Gl}],[0,{[_]:"ImageId",[y]:F_}],[()=>Iv,{[_]:"InstanceState",[y]:zfe}],[0,{[_]:"PrivateDnsName",[y]:K_}],[0,{[_]:"DnsName",[y]:sue}],[0,{[_]:"Reason",[y]:hpe}],[0,{[_]:"KeyName",[y]:pd}],[1,{[_]:"AmiLaunchIndex",[y]:hle}],[()=>ez,{[_]:"ProductCodes",[y]:yL}],[0,{[_]:"InstanceType",[y]:q_}],[4,{[_]:"LaunchTime",[y]:Xfe}],[()=>FL,{[_]:"Placement",[y]:tpe}],[0,{[_]:"KernelId",[y]:sL}],[0,{[_]:"RamdiskId",[y]:RL}],[0,{[_]:"Platform",[y]:SL}],[()=>nye,{[_]:"Monitoring",[y]:mde}],[0,{[_]:"SubnetId",[y]:fg}],[0,{[_]:"VpcId",[y]:yd}],[0,{[_]:"PrivateIpAddress",[y]:_c}],[0,{[_]:"IpAddress",[y]:pfe}]]],gge=[3,I,Wne,0,[N3,B3],[[2,{[_]:"EnaSrdEnabled",[y]:Nue}],[()=>yge,{[_]:"EnaSrdUdpSpecification",[y]:$ue}]]],yge=[3,I,Jne,0,[z3],[[2,{[_]:"EnaSrdUdpEnabled",[y]:Bue}]]],bge=[3,I,rse,0,[YS,n_],[[0,{[_]:"DeviceName",[y]:L_}],[()=>zme,{[_]:"Ebs",[y]:$_}]]],vge=[3,I,ise,0,[YS,n_,mN,CP],[[0,{[_]:"DeviceName",[y]:L_}],[()=>Bme,{[_]:"Ebs",[y]:$_}],[0,{[_]:"VirtualName",[y]:NL}],[0,{[_]:"NoDevice",[y]:dL}]]],Sge=[3,I,xse,0,[h_],[[0,{[_]:"Ipv4Prefix",[y]:Tfe}]]],_ge=[3,I,bse,0,[f_,sre],[[0,{[_]:"Ipv6Address",[y]:ZN}],[2,{[_]:"IsPrimaryIpv6",[y]:Rfe}]]],wge=[3,I,Rse,0,[p_],[[0,{[_]:"Ipv6Prefix",[y]:Ofe}]]],Ege=[3,I,Lse,0,[i3,qie],[[0,{[_]:"AutoRecovery",[y]:vle}],[0,{[_]:"RebootMigration",[y]:upe}]]],xge=[3,I,zse,0,[i3],[0]],Rge=[3,I,Bse,0,[Roe,Uae],[0,()=>wye]],Cge=[3,I,$se,0,[Z3,G3,F3,q3,nP],[0,1,0,0,0]],Age=[3,I,Use,0,[Ts,Z3,G3,F3,q3,nP],[[0,{[_]:"State",[y]:ma}],[0,{[_]:"HttpTokens",[y]:ofe}],[1,{[_]:"HttpPutResponseHopLimit",[y]:nfe}],[0,{[_]:"HttpEndpoint",[y]:Wue}],[0,{[_]:"HttpProtocolIpv6",[y]:tfe}],[0,{[_]:"InstanceMetadataTags",[y]:vfe}]]],Tge=[3,I,Hse,0,[f3,d3,hc,Zm,u_,gP,AP,bc,S_,Go,Xm,Jm,ld,ha,Ko,Qm,cP,iP,xee,Vl],[[()=>HL,{[_]:"Association",[y]:CN}],[()=>Ige,{[_]:"Attachment",[y]:AN}],[0,{[_]:"Description",[y]:fd}],[()=>J_,{[_]:"GroupSet",[y]:H_}],[()=>ew,{[_]:"Ipv6AddressesSet",[y]:GN}],[0,{[_]:"MacAddress",[y]:rL}],[0,{[_]:"NetworkInterfaceId",[y]:pL}],[0,{[_]:"OwnerId",[y]:Kl}],[0,{[_]:"PrivateDnsName",[y]:K_}],[0,{[_]:"PrivateIpAddress",[y]:_c}],[()=>m0e,{[_]:"PrivateIpAddressesSet",[y]:vL}],[2,{[_]:"SourceDestCheck",[y]:Q_}],[0,{[_]:"Status",[y]:ga}],[0,{[_]:"SubnetId",[y]:fg}],[0,{[_]:"VpcId",[y]:yd}],[0,{[_]:"InterfaceType",[y]:tL}],[()=>u0e,{[_]:"Ipv4PrefixSet",[y]:Cfe}],[()=>f0e,{[_]:"Ipv6PrefixSet",[y]:Afe}],[()=>qhe,{[_]:"ConnectionTrackingConfiguration",[y]:Kle}],[()=>pg,{[_]:"Operator",[y]:lg}]]],HL=[3,I,Vse,0,[JJ,aee,Xse,jP,fie],[[0,{[_]:"CarrierIp",[y]:zle}],[0,{[_]:"CustomerOwnedIp",[y]:jle}],[0,{[_]:"IpOwnerId",[y]:Efe}],[0,{[_]:"PublicDnsName",[y]:Hde}],[0,{[_]:"PublicIp",[y]:Fde}]]],Ige=[3,I,Fse,0,[Fm,r3,fa,qm,ld,cd,L3,P3],[[4,{[_]:"AttachTime",[y]:sg}],[0,{[_]:"AttachmentId",[y]:_N}],[2,{[_]:"DeleteOnTermination",[y]:Sc}],[1,{[_]:"DeviceIndex",[y]:N_}],[0,{[_]:"Status",[y]:ga}],[1,{[_]:"NetworkCardIndex",[y]:Z_}],[()=>gge,{[_]:"EnaSrdSpecification",[y]:Lue}],[1,{[_]:"EnaQueueCount",[y]:Pue}]]],Oge=[3,I,Gse,0,[yJ,fa,hc,qm,Zm,Q3,u_,AP,Go,Xm,jae,ha,fJ,Qm,cd,cP,ere,iP,Jse,gie,L3,Ree,P3],[[2,{[_]:"AssociatePublicIpAddress",[y]:gle}],[2,{[_]:"DeleteOnTermination",[y]:Sc}],[0,{[_]:"Description",[y]:fd}],[1,{[_]:"DeviceIndex",[y]:N_}],[()=>tz,{[y]:E_}],[1,{[_]:"Ipv6AddressCount",[y]:afe}],[()=>ew,{[_]:"Ipv6Addresses",[y]:GN}],[0,{[_]:"NetworkInterfaceId",[y]:pL}],[0,{[_]:"PrivateIpAddress",[y]:_c}],[()=>k0e,{[_]:"PrivateIpAddresses",[y]:vL}],[1,{[_]:"SecondaryPrivateIpAddressCount",[y]:Mpe}],[0,{[_]:"SubnetId",[y]:fg}],2,0,1,[()=>_0e,{[y]:h_}],1,[()=>w0e,{[y]:p_}],1,2,()=>qme,()=>Fhe,1]],Mge=[3,I,Kse,0,[y3],[[0,{[_]:"BandwidthWeighting",[y]:Tle}]]],Dge=[3,I,Qse,0,[y3],[0]],kge=[3,I,tre,0,[f3,GP,S_,Go],[[()=>HL,{[_]:"Association",[y]:CN}],[2,{[_]:"Primary",[y]:_L}],[0,{[_]:"PrivateDnsName",[y]:K_}],[0,{[_]:"PrivateIpAddress",[y]:_c}]]],Pge=[3,I,vre,0,[d3,gP,yae,bc,Xm,Jm,ld,eN,Bae,Qm],[[()=>Nge,{[_]:"Attachment",[y]:AN}],[0,{[_]:"MacAddress",[y]:rL}],[0,{[_]:"SecondaryInterfaceId",[y]:xpe}],[0,{[_]:"OwnerId",[y]:Kl}],[()=>y0e,{[_]:"PrivateIpAddressSet",[y]:qde}],[2,{[_]:"SourceDestCheck",[y]:Q_}],[0,{[_]:"Status",[y]:ga}],[0,{[_]:"SecondarySubnetId",[y]:kpe}],[0,{[_]:"SecondaryNetworkId",[y]:Ipe}],[0,{[_]:"InterfaceType",[y]:tL}]]],Nge=[3,I,fre,0,[Fm,r3,fa,qm,ld,cd],[[4,{[_]:"AttachTime",[y]:sg}],[0,{[_]:"AttachmentId",[y]:_N}],[2,{[_]:"DeleteOnTermination",[y]:Sc}],[1,{[_]:"DeviceIndex",[y]:N_}],[0,{[_]:"Status",[y]:ga}],[1,{[_]:"NetworkCardIndex",[y]:Z_}]]],Lge=[3,I,pre,0,[Go],[[0,{[_]:"PrivateIpAddress",[y]:_c}]]],zge=[3,I,gre,0,[Go],[0],1],Bge=[3,I,bre,0,[fa,qm,Xm,die,eN,Qm,cd],[2,1,[()=>b0e,{[y]:Go}],1,0,0,1]],Iv=[3,I,wre,0,[E3,Qs],[[1,{[_]:"Code",[y]:LN}],[0,{[_]:"Name",[y]:xr}]]],$ge=[3,I,lre,0,[ls,Eee,_ie],[[0,{[_]:"InstanceId",[y]:Gl}],[()=>Iv,{[_]:"CurrentState",[y]:Zle}],[()=>Iv,{[_]:"PreviousState",[y]:Xde}]]],Uge=[3,I,lP,0,[mce,$te,kP,$3],[[1,{[_]:"TotalSizeInGB",[y]:ehe}],[()=>Qye,{[_]:"Disks",[y]:fue}],[0,{[_]:"NvmeSupport",[y]:mL}],[0,{[_]:"EncryptionSupport",[y]:UN}]]],jge=[3,I,Rre,0,[od,WJ,j3,Kae,Hae,Xae,HJ,l_,FP,dN,gc,Sre,lP,M3,IP,H3,U3,VP,Y3,Qne,VJ,Hee,vJ,sae,$oe,Voe,PP,mP,OP,Sie,Fie],[[0,{[_]:"InstanceType",[y]:q_}],[2,{[_]:"CurrentGeneration",[y]:Lle}],[2,{[_]:"FreeTierEligible",[y]:HN}],[()=>Z0e,{[_]:"SupportedUsageClasses",[y]:Bpe}],[()=>B0e,{[_]:"SupportedRootDeviceTypes",[y]:Dpe}],[()=>Q0e,{[_]:"SupportedVirtualizationTypes",[y]:Upe}],[2,{[_]:"BareMetal",[y]:Cle}],[0,{[_]:"Hypervisor",[y]:V_}],[()=>mye,{[_]:"ProcessorInfo",[y]:Gde}],[()=>kye,{[_]:"VCpuInfo",[y]:uhe}],[()=>Wge,{[_]:"MemoryInfo",[y]:Zl}],[2,{[_]:"InstanceStorageSupported",[y]:kfe}],[()=>Uge,{[_]:"InstanceStorageInfo",[y]:Dfe}],[()=>Lme,{[_]:"EbsInfo",[y]:Aue}],[()=>rye,{[_]:"NetworkInfo",[y]:Ede}],[()=>sge,{[_]:"GpuInfo",[y]:Kue}],[()=>Wme,{[_]:"FpgaInfo",[y]:Vue}],[()=>uye,{[_]:"PlacementGroupInfo",[y]:Vde}],[()=>dge,{[_]:"InferenceAcceleratorInfo",[y]:cfe}],[2,{[_]:"HibernationSupported",[y]:rfe}],[2,{[_]:"BurstablePerformanceSupported",[y]:Ale}],[2,{[_]:"DedicatedHostsSupported",[y]:tue}],[2,{[_]:"AutoRecoverySupported",[y]:ble}],[()=>Zye,{[_]:"SupportedBootModes",[y]:ype}],[0,{[_]:"NitroEnclavesSupport",[y]:vde}],[0,{[_]:"NitroTpmSupport",[y]:Tde}],[()=>lye,{[_]:"NitroTpmInfo",[y]:Ade}],[()=>Qge,{[_]:"MediaAcceleratorInfo",[y]:ede}],[()=>cye,{[_]:"NeuronInfo",[y]:xde}],[0,{[_]:"PhcSupport",[y]:Yde}],[0,{[_]:"RebootMigrationSupport",[y]:lpe}]]],Hge=[3,I,are,0,[h_],[0]],Vge=[3,I,cre,0,[p_],[0]],Fge=[3,I,jre,0,[mc,Er,so,m_,kre],[[0,{[_]:"KeyPairId",[y]:cg}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"KeyName",[y]:pd}],[0,{[_]:"KeyFingerprint",[y]:G_}],[()=>khe,{[_]:"KeyMaterial",[y]:Vfe}]]],qge=[3,I,$re,0,[mc,pP,Er,yie,w3,so,m_],[[0,{[_]:"KeyPairId",[y]:cg}],[0,{[_]:"KeyType",[y]:qfe}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"PublicKey",[y]:Zde}],[4,{[_]:"CreateTime",[y]:NN}],[0,{[_]:"KeyName",[y]:pd}],[0,{[_]:"KeyFingerprint",[y]:G_}]]],Gge=[3,I,toe,0,[Jre,eoe,bN],[0,0,0]],Zge=[3,I,Fre,0,[hP],[[0,{[_]:"LicenseConfigurationArn",[y]:Zfe}]]],Kge=[3,I,Vre,0,[hP],[0]],Qge=[3,I,mP,0,[c3,dce],[[()=>T0e,{[_]:"Accelerators",[y]:EN}],[1,{[_]:"TotalMediaMemoryInMiB",[y]:Xpe}]]],Yge=[3,I,uoe,0,[ua,Qs,ad,gc],[[1,{[_]:"Count",[y]:vc}],[0,{[_]:"Name",[y]:xr}],[0,{[_]:"Manufacturer",[y]:hd}],[()=>Xge,{[_]:"MemoryInfo",[y]:Zl}]]],Xge=[3,I,doe,0,[Fl],[[1,{[_]:"SizeInMiB",[y]:Ql}]]],Wge=[3,I,gc,0,[Fl],[[1,{[_]:"SizeInMiB",[y]:Ql}]]],Jge=[3,I,boe,0,[ls,Jm,R3,yt,PJ,ql,ed,C3,od,Hre,Qie,cN,tP,Zm,WS,C_,Gm],[[0,{[_]:"InstanceId",[y]:Gl}],[()=>df,0],[()=>df,0],[2,{[_]:"DryRun",[y]:Rt}],[0,{[_]:"Attribute",[y]:xle}],[0,{[_]:"Value",[y]:gd}],[()=>l0e,{[_]:"BlockDeviceMapping",[y]:rg}],[()=>df,{[_]:"DisableApiTermination",[y]:zN}],[()=>pf,{[_]:"InstanceType",[y]:q_}],[()=>pf,{[_]:"Kernel",[y]:Gfe}],[()=>pf,{[_]:"Ramdisk",[y]:ppe}],[()=>$he,{[_]:"UserData",[y]:ihe}],[()=>pf,{[_]:"InstanceInitiatedShutdownBehavior",[y]:WN}],[()=>r0e,{[y]:o_}],[()=>df,{[_]:"EbsOptimized",[y]:B_}],[()=>pf,{[_]:"SriovNetSupport",[y]:Y_}],[()=>df,{[_]:"EnaSupport",[y]:og}]],1],eye=[3,I,Coe,0,[Ys,yt,T_,ng,Ym,eg,y_],[0,2,1,0,1,1,2],1],tye=[3,I,Aoe,0,[hN],[[()=>Pye,{[_]:"VolumeModification",[y]:mhe}]]],nye=[3,I,b_,0,[Ts],[[0,{[_]:"State",[y]:ma}]]],sye=[3,I,koe,0,[cd,DP,vP,dJ,zJ,sie,Uee,goe,yoe],[[1,{[_]:"NetworkCardIndex",[y]:Z_}],[0,{[_]:"NetworkPerformance",[y]:hL}],[1,{[_]:"MaximumNetworkInterfaces",[y]:aL}],[1,{[_]:"AdditionalFlexibleNetworkInterfaces",[y]:fle}],[1,{[_]:"BaselineBandwidthInGbps",[y]:Rle}],[1,{[_]:"PeakBandwidthInGbps",[y]:Bde}],[1,{[_]:"DefaultEnaQueueCountPerInterface",[y]:Jle}],[1,{[_]:"MaximumEnaQueueCount",[y]:ode}],[1,{[_]:"MaximumEnaQueueCountPerInterface",[y]:ide}]]],rye=[3,I,IP,0,[DP,vP,Soe,ite,Moe,ese,tse,Ere,Gm,wne,D3,dne,Sne,qJ,Ine,$ae,Eoe,nse],[[0,{[_]:"NetworkPerformance",[y]:hL}],[1,{[_]:"MaximumNetworkInterfaces",[y]:aL}],[1,{[_]:"MaximumNetworkCards",[y]:ade}],[1,{[_]:"DefaultNetworkCardIndex",[y]:nue}],[()=>I0e,{[_]:"NetworkCards",[y]:yde}],[1,{[_]:"Ipv4AddressesPerInterface",[y]:lfe}],[1,{[_]:"Ipv6AddressesPerInterface",[y]:ufe}],[2,{[_]:"Ipv6Supported",[y]:Bfe}],[0,{[_]:"EnaSupport",[y]:og}],[2,{[_]:"EfaSupported",[y]:Uue}],[()=>Ume,{[_]:"EfaInfo",[y]:Tue}],[2,{[_]:"EncryptionInTransitSupported",[y]:Cue}],[2,{[_]:"EnaSrdSupported",[y]:zue}],[()=>qye,{[_]:"BandwidthWeightings",[y]:Ile}],[0,{[_]:"FlexibleEnaQueuesSupport",[y]:Hue}],[2,{[_]:"SecondaryNetworkSupported",[y]:Ope}],[1,{[_]:"MaximumSecondaryNetworkInterfaces",[y]:dde}],[1,{[_]:"Ipv4AddressesPerSecondaryInterface",[y]:ffe}]]],oye=[3,I,Poe,0,[ua,bN],[[1,{[_]:"Count",[y]:vc}],[1,{[_]:"Version",[y]:whe}]]],iye=[3,I,Noe,0,[ua,Qs,see,gc],[[1,{[_]:"Count",[y]:vc}],[0,{[_]:"Name",[y]:xr}],[()=>oye,{[_]:"CoreInfo",[y]:$le}],[()=>aye,{[_]:"MemoryInfo",[y]:Zl}]]],aye=[3,I,zoe,0,[Fl],[[1,{[_]:"SizeInMiB",[y]:Ql}]]],cye=[3,I,OP,0,[Boe,pce],[[()=>O0e,{[_]:"NeuronDevices",[y]:bde}],[1,{[_]:"TotalNeuronDeviceMemoryInMiB",[y]:Wpe}]]],lye=[3,I,PP,0,[Wae],[[()=>M0e,{[_]:"SupportedVersions",[y]:jpe}]]],VL=[3,I,Qoe,0,[zP],[0]],pg=[3,I,Yoe,0,[Ioe,zP],[[2,{[_]:"Managed",[y]:hde}],[0,{[_]:"Principal",[y]:zde}]]],FL=[3,I,__,0,[jl,kJ,i_,vie,Gne,_ce,iae,Kne,o_,la],[[0,{[_]:"AvailabilityZoneId",[y]:k_}],[0,{[_]:"Affinity",[y]:Ele}],[0,{[_]:"GroupName",[y]:j_}],[1,{[_]:"PartitionNumber",[y]:Qde}],[0,{[_]:"HostId",[y]:Jue}],[0,{[_]:"Tenancy",[y]:Fpe}],[0,{[_]:"SpreadDomain",[y]:vpe}],[0,{[_]:"HostResourceGroupArn",[y]:sfe}],[0,{[_]:"GroupId",[y]:U_}],[0,{[_]:"AvailabilityZone",[y]:ud}]]],uye=[3,I,VP,0,[qae],[[()=>D0e,{[_]:"SupportedStrategies",[y]:Lpe}]]],fye=[3,I,UP,0,[c_,t_,e_],[[0,{[_]:"HostnameType",[y]:FN}],[2,{[_]:"EnableResourceNameDnsARecord",[y]:$N}],[2,{[_]:"EnableResourceNameDnsAAAARecord",[y]:BN}]]],dye=[3,I,cie,0,[c_,t_,e_],[0,2,2]],pye=[3,I,lie,0,[c_,t_,e_],[[0,{[_]:"HostnameType",[y]:FN}],[2,{[_]:"EnableResourceNameDnsARecord",[y]:$N}],[2,{[_]:"EnableResourceNameDnsAAAARecord",[y]:BN}]]],hye=[3,I,pie,0,[GP,Go],[[2,{[_]:"Primary",[y]:_L}],[0,{[_]:"PrivateIpAddress",[y]:_c}]]],mye=[3,I,FP,0,[nae,oae,aae,ad],[[()=>Uye,{[_]:"SupportedArchitectures",[y]:mpe}],[1,{[_]:"SustainedClockSpeedInGhz",[y]:bpe}],[()=>q0e,{[_]:"SupportedFeatures",[y]:Spe}],[0,{[_]:"Manufacturer",[y]:hd}]]],gye=[3,I,aie,0,[rie,iie],[[0,{[_]:"ProductCode",[y]:$de}],[0,{[_]:"Type",[y]:X_}]]],yye=[3,I,Nie,0,[rd,yt],[[()=>bd,{[y]:ls}],[2,{[_]:"DryRun",[y]:Rt}]],1],bye=[3,I,Xie,0,[LP,V3,Wm,Rne],[[0,{[_]:"OptInStatus",[y]:gL}],[()=>P0e,{[_]:"GeographySet",[y]:VN}],[0,{[_]:"RegionName",[y]:CL}],[0,{[_]:"RegionEndpoint",[y]:rpe}]]],vye=[3,I,Die,0,[Qs],[[0,{[_]:"Name",[y]:xr}]]],qL=[3,I,Jie,0,[Bie,bc,Uie,Zm,Ore],[[0,{[_]:"ReservationId",[y]:ipe}],[0,{[_]:"OwnerId",[y]:Kl}],[0,{[_]:"RequesterId",[y]:cpe}],[()=>J_,{[_]:"GroupSet",[y]:H_}],[()=>d0e,{[_]:"InstancesSet",[y]:ig}]]],Sye=[3,I,Pie,0,[s_],[[2,{[_]:"Enabled",[y]:jN}]],1],_ye=[3,I,Lie,0,[coe,loe,ed,Hl,od,Q3,u_,g_,so,b_,__,w_,uae,YP,ha,cN,T3,O3,Zo,Wre,jse,See,qS,ZS,a_,Qre,SP,JS,$P,_P,R3,bne,MP,Vl,WP,yt,C3,tP,Go,QS,s3,TP,d_,WS],[1,1,[()=>WL,{[y]:VS}],0,0,1,[()=>ew,{[y]:f_}],0,0,[()=>Sye,0],[()=>FL,0],0,[()=>tz,{[y]:E_}],[()=>$0e,{[y]:XP}],0,[()=>Dhe,0],[()=>Wye,0],[()=>e0e,{[y]:I3}],[()=>Yo,{[y]:ro}],()=>Gge,()=>Rge,()=>ome,()=>Qhe,()=>Uhe,()=>ige,[()=>A0e,{[y]:Xre}],()=>Cge,()=>Kme,()=>dye,()=>xge,2,2,()=>Dge,()=>VL,[()=>v0e,{[y]:Tae}],[2,{[_]:"DryRun",[y]:Rt}],[2,{[_]:"DisableApiTermination",[y]:zN}],[0,{[_]:"InstanceInitiatedShutdownBehavior",[y]:WN}],[0,{[_]:"PrivateIpAddress",[y]:_c}],[0,{[_]:"ClientToken",[Ufe]:1,[y]:PN}],[0,{[_]:"AdditionalInfo",[y]:SN}],[()=>h0e,{[_]:"NetworkInterface",[y]:wde}],[()=>cge,{[_]:"IamInstanceProfile",[y]:XN}],[2,{[_]:"EbsOptimized",[y]:B_}]],2],GL=[3,I,ece,0,[qoe,da,Er,Zae,Oie,nN,la,vce,v3,Tee,Dne,pa,Ys,Ts,R_,tN,ZP,bc,hc,gN,sd,id,$ee],[[0,{[_]:"OwnerAlias",[y]:Ode}],[0,{[_]:"OutpostArn",[y]:md}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"StorageTier",[y]:zpe}],[4,{[_]:"RestoreExpiryTime",[y]:spe}],[0,{[_]:"SseType",[y]:ML}],[0,{[_]:"AvailabilityZone",[y]:ud}],[0,{[_]:"TransferType",[y]:she}],[1,{[_]:"CompletionDurationMinutes",[y]:Ple}],[4,{[_]:"CompletionTime",[y]:Qle}],[1,{[_]:"FullSnapshotSizeInBytes",[y]:que}],[0,{[_]:"SnapshotId",[y]:ug}],[0,{[_]:"VolumeId",[y]:Yl}],[0,{[_]:"Status",[y]:ga}],[0,{[_]:"StatusMessage",[y]:dg}],[4,{[_]:"StartTime",[y]:OL}],[0,{[_]:"Progress",[y]:wL}],[0,{[_]:"OwnerId",[y]:Kl}],[0,{[_]:"Description",[y]:fd}],[1,{[_]:"VolumeSize",[y]:LL}],[2,{[_]:"Encrypted",[y]:dd}],[0,{[_]:"KmsKeyId",[y]:ag}],[0,{[_]:"DataEncryptionKeyId",[y]:Wle}]]],wye=[3,I,zae,0,[woe,Aae,UJ,Jce,Sse],[0,0,1,4,0]],Eye=[3,I,_ae,0,[rd,s3,yt],[[()=>bd,{[y]:ls}],[0,{[_]:"AdditionalInfo",[y]:SN}],[2,{[_]:"DryRun",[y]:Rt}]],1],xye=[3,I,wae,0,[Oae],[[()=>tw,{[_]:"InstancesSet",[y]:ig}]]],ZL=[3,I,A_,0,[E3,EP],[[0,{[_]:"Code",[y]:LN}],[0,{[_]:"Message",[y]:uL}]]],Rye=[3,I,Eae,0,[rd,Yne,JP,yt,r_],[[()=>bd,{[y]:ls}],2,2,[2,{[_]:"DryRun",[y]:Rt}],[2,{[_]:"Force",[y]:Gue}]],1],Cye=[3,I,xae,0,[Dae],[[()=>tw,{[_]:"InstancesSet",[y]:ig}]]],KL=[3,I,sN,0,[jl,pne,aoe,cee,bc,hJ,X3,Er,tae,da,Gte,sP,UP,FS,tg,ha,Ts,Ko,td,pJ,la,jee,_oe],[[0,{[_]:"AvailabilityZoneId",[y]:k_}],[1,{[_]:"EnableLniAtDeviceIndex",[y]:Iue}],[2,{[_]:"MapCustomerOwnedIpOnLaunch",[y]:tde}],[0,{[_]:"CustomerOwnedIpv4Pool",[y]:Hle}],[0,{[_]:"OwnerId",[y]:Kl}],[2,{[_]:"AssignIpv6AddressOnCreation",[y]:ple}],[()=>V0e,{[_]:"Ipv6CidrBlockAssociationSet",[y]:QN}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"SubnetArn",[y]:gpe}],[0,{[_]:"OutpostArn",[y]:md}],[2,{[_]:"EnableDns64",[y]:hue}],[2,{[_]:"Ipv6Native",[y]:Sfe}],[()=>fye,{[_]:"PrivateDnsNameOptionsOnLaunch",[y]:jde}],[()=>jL,{[_]:"BlockPublicAccessStates",[y]:MN}],[0,{[_]:"Type",[y]:X_}],[0,{[_]:"SubnetId",[y]:fg}],[0,{[_]:"State",[y]:ma}],[0,{[_]:"VpcId",[y]:yd}],[0,{[_]:"CidrBlock",[y]:P_}],[1,{[_]:"AvailableIpAddressCount",[y]:dle}],[0,{[_]:"AvailabilityZone",[y]:ud}],[2,{[_]:"DefaultForAz",[y]:eue}],[2,{[_]:"MapPublicIpOnLaunch",[y]:ude}]]],Aye=[3,I,rae,0,[Ts,x_],[[0,{[_]:"State",[y]:ma}],[0,{[_]:"StatusMessage",[y]:dg}]]],Tye=[3,I,pae,0,[HS,Km,W3,K3,uP],[[0,{[_]:"AssociationId",[y]:D_}],[0,{[_]:"Ipv6CidrBlock",[y]:KN}],[()=>Aye,{[_]:"Ipv6CidrBlockState",[y]:YN}],[0,{[_]:"Ipv6AddressAttribute",[y]:qN}],[0,{[_]:"IpSource",[y]:JN}]]],Iye=[3,I,aN,0,[Mre,ql],[[0,{[_]:"Key",[y]:Hfe}],[0,{[_]:"Value",[y]:gd}]]],Oye=[3,I,ro,0,[Kie,Er],[[0,{[_]:"ResourceType",[y]:dpe}],[()=>Rr,{[y]:aN}]]],Mye=[3,I,ice,0,[rd,r_,JP,yt],[[()=>bd,{[y]:ls}],2,2,[2,{[_]:"DryRun",[y]:Rt}]],1],Dye=[3,I,ace,0,[lce],[[()=>tw,{[_]:"InstancesSet",[y]:ig}]]],kye=[3,I,dN,0,[Cte,Bee,xte,Oce,Wce],[[1,{[_]:"DefaultVCpus",[y]:lue}],[1,{[_]:"DefaultCores",[y]:Xle}],[1,{[_]:"DefaultThreadsPerCore",[y]:aue}],[()=>Kye,{[_]:"ValidCores",[y]:fhe}],[()=>G0e,{[_]:"ValidThreadsPerCore",[y]:_he}]]],QL=[3,I,nle,0,[jl,da,Yae,Ym,Er,ng,Mne,y_,eg,nN,Vl,I_,Ys,T_,pa,la,Ts,w3,NJ,sd,id],[[0,{[_]:"AvailabilityZoneId",[y]:k_}],[0,{[_]:"OutpostArn",[y]:md}],[0,{[_]:"SourceVolumeId",[y]:$pe}],[1,{[_]:"Iops",[y]:nL}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[0,{[_]:"VolumeType",[y]:zL}],[2,{[_]:"FastRestored",[y]:Fue}],[2,{[_]:"MultiAttachEnabled",[y]:Jfe}],[1,{[_]:"Throughput",[y]:kL}],[0,{[_]:"SseType",[y]:ML}],[()=>pg,{[_]:"Operator",[y]:lg}],[1,{[_]:"VolumeInitializationRate",[y]:phe}],[0,{[_]:"VolumeId",[y]:Yl}],[1,{[_]:"Size",[y]:Hpe}],[0,{[_]:"SnapshotId",[y]:ug}],[0,{[_]:"AvailabilityZone",[y]:ud}],[0,{[_]:"Status",[y]:ga}],[4,{[_]:"CreateTime",[y]:NN}],[()=>Y0e,{[_]:"AttachmentSet",[y]:_le}],[2,{[_]:"Encrypted",[y]:dd}],[0,{[_]:"KmsKeyId",[y]:ag}]]],W_=[3,I,Cce,0,[fa,o3,Wse,nd,Ys,ls,XS,Ts,Fm],[[2,{[_]:"DeleteOnTermination",[y]:Sc}],[0,{[_]:"AssociatedResource",[y]:wN}],[0,{[_]:"InstanceOwningService",[y]:xfe}],[1,{[_]:"EbsCardIndex",[y]:z_}],[0,{[_]:"VolumeId",[y]:Yl}],[0,{[_]:"InstanceId",[y]:Gl}],[0,{[_]:"Device",[y]:uue}],[0,{[_]:"Status",[y]:ga}],[4,{[_]:"AttachTime",[y]:sg}]]],Pye=[3,I,hN,0,[Ys,xoe,x_,yce,cce,Sce,bce,fce,Woe,Goe,eie,Joe,Koe,ZP,tN,Ene],[[0,{[_]:"VolumeId",[y]:Yl}],[0,{[_]:"ModificationState",[y]:pde}],[0,{[_]:"StatusMessage",[y]:dg}],[1,{[_]:"TargetSize",[y]:the}],[1,{[_]:"TargetIops",[y]:Qpe}],[0,{[_]:"TargetVolumeType",[y]:rhe}],[1,{[_]:"TargetThroughput",[y]:nhe}],[2,{[_]:"TargetMultiAttachEnabled",[y]:Ype}],[1,{[_]:"OriginalSize",[y]:kde}],[1,{[_]:"OriginalIops",[y]:Mde}],[0,{[_]:"OriginalVolumeType",[y]:Nde}],[1,{[_]:"OriginalThroughput",[y]:Pde}],[2,{[_]:"OriginalMultiAttachEnabled",[y]:Dde}],[1,{[_]:"Progress",[y]:wL}],[4,{[_]:"StartTime",[y]:OL}],[4,{[_]:"EndTime",[y]:jue}]]],YL=[3,I,vN,0,[bc,fP,X3,GJ,hse,qte,Er,FS,Ko,Ts,td,cte],[[0,{[_]:"OwnerId",[y]:Kl}],[0,{[_]:"InstanceTenancy",[y]:eL}],[()=>tbe,{[_]:"Ipv6CidrBlockAssociationSet",[y]:QN}],[()=>J0e,{[_]:"CidrBlockAssociationSet",[y]:Ole}],[2,{[_]:"IsDefault",[y]:hfe}],[()=>Lye,{[_]:"EncryptionControl",[y]:pue}],[()=>Rr,{[_]:"TagSet",[y]:zr}],[()=>jL,{[_]:"BlockPublicAccessStates",[y]:MN}],[0,{[_]:"VpcId",[y]:yd}],[0,{[_]:"State",[y]:ma}],[0,{[_]:"CidrBlock",[y]:P_}],[0,{[_]:"DhcpOptionsId",[y]:rue}]]],Nye=[3,I,Ace,0,[HS,td,KJ],[[0,{[_]:"AssociationId",[y]:D_}],[0,{[_]:"CidrBlock",[y]:P_}],[()=>XL,{[_]:"CidrBlockState",[y]:Dle}]]],XL=[3,I,Ice,0,[Ts,x_],[[0,{[_]:"State",[y]:ma}],[0,{[_]:"StatusMessage",[y]:dg}]]],Lye=[3,I,pN,0,[Ko,Pce,xP,Ts,R_,Mie,Er],[[0,{[_]:"VpcId",[y]:yd}],[0,{[_]:"VpcEncryptionControlId",[y]:dhe}],[0,{[_]:"Mode",[y]:gde}],[0,{[_]:"State",[y]:ma}],[0,{[_]:"StateMessage",[y]:TL}],[()=>Bye,{[_]:"ResourceExclusions",[y]:ope}],[()=>Rr,{[_]:"TagSet",[y]:zr}]]],zye=[3,I,Mce,0,[xP,yse,mne,joe,Kce,Gce,qre,Hce,Kte],[0,0,0,0,0,0,0,0,0],1],ji=[3,I,Dce,0,[Ts,R_],[[0,{[_]:"State",[y]:ma}],[0,{[_]:"StateMessage",[y]:TL}]]],Bye=[3,I,kce,0,[mse,hne,Uoe,Zce,Qce,roe,jce,Zte],[[()=>ji,{[_]:"InternetGateway",[y]:mfe}],[()=>ji,{[_]:"EgressOnlyInternetGateway",[y]:Mue}],[()=>ji,{[_]:"NatGateway",[y]:Sde}],[()=>ji,{[_]:"VirtualPrivateGateway",[y]:yhe}],[()=>ji,{[_]:"VpcPeering",[y]:bhe}],[()=>ji,{[_]:"Lambda",[y]:Wfe}],[()=>ji,{[_]:"VpcLattice",[y]:hhe}],[()=>ji,{[_]:"ElasticFileSystem",[y]:mue}]]],$ye=[3,I,Nce,0,[HS,Km,W3,RP,aP,K3,uP],[[0,{[_]:"AssociationId",[y]:D_}],[0,{[_]:"Ipv6CidrBlock",[y]:KN}],[()=>XL,{[_]:"Ipv6CidrBlockState",[y]:YN}],[0,{[_]:"NetworkBorderGroup",[y]:fL}],[0,{[_]:"Ipv6Pool",[y]:Ife}],[0,{[_]:"Ipv6AddressAttribute",[y]:qN}],[0,{[_]:"IpSource",[y]:JN}]]],Xl="unit",Uye=[1,I,_J,0,[0,{[y]:ke}]],jye=[1,I,CJ,0,[()=>Lhe,{[y]:ke}]],Hye=[1,I,AJ,0,[()=>Nhe,{[y]:ke}]],Vye=[1,I,IJ,0,[()=>zhe,{[y]:ke}]],Fye=[1,I,MJ,0,[()=>Bhe,{[y]:ke}]],qye=[1,I,FJ,0,[0,{[y]:ke}]],Gye=[1,I,BJ,0,[()=>UL,{[y]:ke}]],WL=[1,I,$J,0,[()=>UL,{[y]:VS}]],Zye=[1,I,jJ,0,[0,{[y]:ke}]],Kye=[1,I,QJ,0,[1,{[y]:ke}]],Qye=[1,I,Vee,0,[()=>kme,{[y]:ke}]],Yye=[1,I,Hte,0,[()=>Nme,{[y]:ke}]],Xye=[1,I,Xte,0,[()=>jme,{[y]:ke}]],Wye=[1,I,nne,0,[()=>Hme,{[y]:ke}]],Jye=[1,I,one,0,[()=>Fme,{[y]:ke}]],e0e=[1,I,O3,0,[()=>Vme,{[y]:ke}]],t0e=[1,I,jte,0,[0,{[y]:A3}]],oo=[1,I,One,0,[()=>Qme,{[y]:wr}]],n0e=[1,I,Ane,0,[()=>Yme,{[y]:ke}]],s0e=[1,I,Bne,0,[()=>tge,{[y]:ke}]],J_=[1,I,Une,0,[()=>rge,{[y]:ke}]],r0e=[1,I,jne,0,[0,{[y]:U_}]],o0e=[1,I,Cse,0,[0,{[y]:Hl}]],i0e=[1,I,kse,0,[()=>lge,{[y]:ke}]],a0e=[1,I,fse,0,[()=>pge,0]],c0e=[1,I,ose,0,[()=>bge,{[y]:ke}]],l0e=[1,I,ase,0,[()=>vge,{[y]:ke}]],bd=[1,I,Ase,0,[0,{[y]:ls}]],u0e=[1,I,_se,0,[()=>Sge,{[y]:ke}]],ew=[1,I,vse,0,[()=>_ge,{[y]:ke}]],f0e=[1,I,wse,0,[()=>wge,{[y]:ke}]],d0e=[1,I,Nse,0,[()=>mge,{[y]:ke}]],p0e=[1,I,qse,0,[()=>Tge,{[y]:ke}]],h0e=[1,I,Zse,0,[()=>Oge,{[y]:ke}]],m0e=[1,I,nre,0,[()=>kge,{[y]:ke}]],g0e=[1,I,dre,0,[()=>Pge,{[y]:ke}]],y0e=[1,I,hre,0,[()=>Lge,{[y]:ke}]],b0e=[1,I,mre,0,[()=>zge,{[y]:ke}]],v0e=[1,I,yre,0,[()=>Bge,{[y]:ke}]],tw=[1,I,ure,0,[()=>$ge,{[y]:ke}]],S0e=[1,I,xre,0,[()=>jge,{[y]:ke}]],_0e=[1,I,ore,0,[()=>Hge,{[y]:ke}]],w0e=[1,I,ire,0,[()=>Vge,{[y]:ke}]],E0e=[1,I,Pre,0,[0,{[y]:so}]],x0e=[1,I,zre,0,[0,{[y]:mc}]],R0e=[1,I,Ure,0,[()=>qge,{[y]:ke}]],C0e=[1,I,Zre,0,[()=>Zge,{[y]:ke}]],A0e=[1,I,Yre,0,[()=>Kge,{[y]:ke}]],T0e=[1,I,foe,0,[()=>Yge,{[y]:ke}]],I0e=[1,I,Doe,0,[()=>sye,{[y]:ke}]],O0e=[1,I,Loe,0,[()=>iye,{[y]:ke}]],M0e=[1,I,Foe,0,[0,{[y]:ke}]],JL=[1,I,Xoe,0,[0,{[y]:v_}]],D0e=[1,I,uie,0,[0,{[y]:ke}]],k0e=[1,I,hie,0,[()=>hye,{[y]:ke}]],ez=[1,I,oie,0,[()=>gye,{[y]:ke}]],P0e=[1,I,kie,0,[()=>vye,{[y]:ke}]],N0e=[1,I,Hie,0,[()=>bye,{[y]:ke}]],L0e=[1,I,Gie,0,[0,{[y]:Wm}]],z0e=[1,I,Vie,0,[()=>qL,{[y]:ke}]],B0e=[1,I,Iie,0,[0,{[y]:ke}]],tz=[1,I,lae,0,[0,{[y]:E_}]],$0e=[1,I,fae,0,[0,{[y]:XP}]],U0e=[1,I,Rae,0,[0,{[y]:pa}]],j0e=[1,I,Nae,0,[()=>GL,{[y]:ke}]],H0e=[1,I,Cae,0,[0,{[y]:ha}]],V0e=[1,I,hae,0,[()=>Tye,{[y]:ke}]],F0e=[1,I,Lae,0,[()=>KL,{[y]:ke}]],q0e=[1,I,eae,0,[0,{[y]:ke}]],Rr=[1,I,uce,0,[()=>Iye,{[y]:ke}]],Yo=[1,I,gce,0,[()=>Oye,{[y]:ke}]],G0e=[1,I,hce,0,[1,{[y]:ke}]],Z0e=[1,I,Ece,0,[0,{[y]:ke}]],K0e=[1,I,Yce,0,[0,{[y]:ke}]],Q0e=[1,I,Xce,0,[0,{[y]:ke}]],Y0e=[1,I,Rce,0,[()=>W_,{[y]:ke}]],X0e=[1,I,zce,0,[0,{[y]:Ys}]],W0e=[1,I,Vce,0,[()=>QL,{[y]:ke}]],J0e=[1,I,Tce,0,[()=>Nye,{[y]:ke}]],ebe=[1,I,Bce,0,[0,{[y]:Ko}]],tbe=[1,I,Lce,0,[()=>$ye,{[y]:ke}]],nbe=[1,I,Fce,0,[()=>YL,{[y]:ke}]],sbe=[1,I,rle,0,[0,{[y]:ke}]],rbe=[1,I,ile,0,[0,{[y]:O_}]],obe=[1,I,cle,0,[0,{[y]:M_}]],WRe=[9,I,xJ,0,()=>Phe,()=>W_],JRe=[9,I,vee,0,()=>Ghe,()=>Zhe],eCe=[9,I,ree,0,()=>Yhe,()=>Xhe],tCe=[9,I,oee,0,()=>Whe,()=>Fge],nCe=[9,I,_ee,0,()=>Jhe,()=>GL],sCe=[9,I,wee,0,()=>eme,()=>tme],rCe=[9,I,Dee,0,()=>nme,()=>QL],oCe=[9,I,kee,0,()=>sme,()=>rme],iCe=[9,I,ete,0,()=>ime,()=>ame],aCe=[9,I,Ste,0,()=>cme,()=>Xl],cCe=[9,I,_te,0,()=>lme,()=>Xl],lCe=[9,I,Pte,0,()=>ume,()=>Xl],uCe=[9,I,Nte,0,()=>fme,()=>Xl],ibe=[9,I,zee,0,()=>dme,()=>pme],abe=[9,I,Xee,0,()=>hme,()=>mme],cbe=[9,I,Wee,0,()=>gme,()=>yme],lbe=[9,I,Yee,0,()=>bme,()=>vme],ube=[9,I,ote,0,()=>Sme,()=>_me],fbe=[9,I,pte,0,()=>wme,()=>Eme],dbe=[9,I,wte,0,()=>xme,()=>Rme],pbe=[9,I,Ete,0,()=>Cme,()=>Ame],hbe=[9,I,Lte,0,()=>Tme,()=>Ime],mbe=[9,I,zte,0,()=>Ome,()=>Mme],fCe=[9,I,Bte,0,()=>Dme,()=>W_],dCe=[9,I,Pne,0,()=>Jme,()=>ege],pCe=[9,I,Ise,0,()=>uge,()=>fge],hCe=[9,I,voe,0,()=>Jge,()=>Xl],mCe=[9,I,Toe,0,()=>eye,()=>tye],gCe=[9,I,$ie,0,()=>yye,()=>Xl],yCe=[9,I,jie,0,()=>_ye,()=>qL],bCe=[9,I,Mae,0,()=>Eye,()=>xye],vCe=[9,I,kae,0,()=>Rye,()=>Cye],SCe=[9,I,rce,0,()=>Mye,()=>Dye];const gbe=e=>({apiVersion:"2016-11-15",base64Decoder:e?.base64Decoder??cc,base64Encoder:e?.base64Encoder??ea,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??cJ,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??OW,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new PS}],logger:e?.logger??new NS,protocol:e?.protocol??OX,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ec2",errorTypeRegistries:Ohe,xmlNamespace:"http://ec2.amazonaws.com/doc/2016-11-15",version:"2016-11-15",serviceTarget:"AmazonEC2"},serviceId:e?.serviceId??"EC2",urlParser:e?.urlParser??jf,utf8Decoder:e?.utf8Decoder??Ho,utf8Encoder:e?.utf8Encoder??pc}),ybe=e=>{const t=Xk(e),n=()=>t().then(_k),r=gbe(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??vk,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Qk({serviceId:r.serviceId,clientVersion:PW.version}),maxAttempts:e?.maxAttempts??Hf,region:e?.region??Yk("Region is missing"),requestHandler:Bm.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||zk),sha256:e?.sha256??Kk,streamCollector:e?.streamCollector??RS,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Tk)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Ik))}},nz=e=>({setRegion(t){e.region=t},region(){return e.region}}),sz=e=>({region:e.region()}),bbe=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(i){const c=t.findIndex(l=>l.schemeId===i.schemeId);c===-1?t.push(i):t.splice(c,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},vbe=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Sbe=(e,t)=>{const n=Object.assign(nz(e),wk(e),ID(e),bbe(e));return t.forEach(r=>r.configure(n)),Object.assign(e,sz(n),Ek(n),OD(n),vbe(n))};class _be extends Sk{config;constructor(...[t]){const n=ybe(t||{});super(n),this.initConfig=n;const r=DW(n),i=XD(r),c=jk(i),l=Mk(c),f=l,d=Lk(f),p=MW(d),b=Sbe(p,t?.extensions||[]);this.config=b,this.middlewareStack.use(HD(this.config)),this.middlewareStack.use(Ak(this.config)),this.middlewareStack.use(Hk(this.config)),this.middlewareStack.use(Dk(this.config)),this.middlewareStack.use(MD(this.config)),this.middlewareStack.use(DD(this.config)),this.middlewareStack.use(kD(this.config)),this.middlewareStack.use(PD(this.config,{httpAuthSchemeParametersProvider:TW,identityProviderConfigProvider:async g=>new QD({"aws.auth#sigv4":g.credentials})})),this.middlewareStack.use(LD(this.config))}destroy(){super.destroy()}}class wbe extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeAvailabilityZones",{}).n("EC2Client","DescribeAvailabilityZonesCommand").sc(ibe).build(){}class rz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeImages",{}).n("EC2Client","DescribeImagesCommand").sc(abe).build(){}class oz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeInstances",{}).n("EC2Client","DescribeInstancesCommand").sc(cbe).build(){}class Ebe extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeInstanceTypes",{}).n("EC2Client","DescribeInstanceTypesCommand").sc(lbe).build(){}class iz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeKeyPairs",{}).n("EC2Client","DescribeKeyPairsCommand").sc(ube).build(){}class xbe extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeRegions",{}).n("EC2Client","DescribeRegionsCommand").sc(fbe).build(){}class az extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeSnapshots",{}).n("EC2Client","DescribeSnapshotsCommand").sc(dbe).build(){}class cz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeSubnets",{}).n("EC2Client","DescribeSubnetsCommand").sc(pbe).build(){}class lz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeVolumes",{}).n("EC2Client","DescribeVolumesCommand").sc(hbe).build(){}class uz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeVpcs",{}).n("EC2Client","DescribeVpcsCommand").sc(mbe).build(){}function Rbe(e){return t=>async n=>{const{request:r}=n;if(e.expectContinueHeader!==!1&&kn.isInstance(r)&&r.body&&e.runtime==="node"&&e.requestHandler?.constructor?.name!=="FetchHttpHandler"){let i=!0;if(typeof e.expectContinueHeader=="number")try{i=(Number(r.headers?.["content-length"])??e.bodyLengthChecker?.(r.body)??1/0)>=e.expectContinueHeader}catch{}else i=!!e.expectContinueHeader;i&&(r.headers.Expect="100-continue")}return t({...n,request:r})}}const Cbe={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Abe=e=>({applyToStack:t=>{t.add(Rbe(e),Cbe)}}),fz={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},Tbe=fz.WHEN_SUPPORTED,_Ce={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},Ibe=fz.WHEN_SUPPORTED;var Ov;(function(e){e.MD5="MD5",e.CRC32="CRC32",e.CRC32C="CRC32C",e.CRC64NVME="CRC64NVME",e.SHA1="SHA1",e.SHA256="SHA256"})(Ov||(Ov={}));var oI;(function(e){e.HEADER="header",e.TRAILER="trailer"})(oI||(oI={}));const wCe=Ov.CRC32;var ECe=(function(){function e(){this.crc32=new im}return e.prototype.update=function(t){om(t)||this.crc32.update(lc(t))},e.prototype.digest=function(){return qk(this,void 0,void 0,function(){return Gk(this,function(t){return[2,LW(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new im},e})(),im=(function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var n,r;try{for(var i=jW(t),c=i.next();!c.done;c=i.next()){var l=c.value;this.checksum=this.checksum>>>8^Mbe[(this.checksum^l)&255]}}catch(f){n={error:f}}finally{try{c&&!c.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e})(),Obe=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Mbe=zW(Obe);const Dbe=e=>{const{requestChecksumCalculation:t,responseChecksumValidation:n,requestStreamBufferSize:r}=e;return Object.assign(e,{requestChecksumCalculation:qs(t??Tbe),responseChecksumValidation:qs(n??Ibe),requestStreamBufferSize:Number(r??0)})},kbe=e=>(t,n)=>async r=>{const i=await e.region(),c=e.region;let l=()=>{};n.__s3RegionRedirect&&(Object.defineProperty(e,"region",{writable:!1,value:async()=>n.__s3RegionRedirect}),l=()=>Object.defineProperty(e,"region",{writable:!0,value:c}));try{const f=await t(r);if(n.__s3RegionRedirect){l();const d=await e.region();if(i!==d)throw new Error("Region was not restored following S3 region redirect.")}return f}catch(f){throw l(),f}},Pbe={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Nbe(e){return(t,n)=>async r=>{try{return await t(r)}catch(i){if(e.followRegionRedirects){const c=i?.$metadata?.httpStatusCode,l=n.commandName==="HeadBucketCommand",f=i?.$response?.headers?.["x-amz-bucket-region"];if(f&&(c===301||c===400&&(i?.name==="IllegalLocationConstraintException"||l))){try{const d=f;n.logger?.debug(`Redirecting from ${await e.region()} to ${d}`),n.__s3RegionRedirect=d}catch(d){throw new Error("Region redirect failed: "+d)}return t(r)}}throw i}}}const Lbe={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},zbe=e=>({applyToStack:t=>{t.add(Nbe(e),Lbe),t.addRelativeTo(kbe(e),Pbe)}});class nw{data;lastPurgeTime=Date.now();static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=3e4;constructor(t={}){this.data=t}get(t){const n=this.data[t];if(n)return n}set(t,n){return this.data[t]=n,n}delete(t){delete this.data[t]}async purgeExpired(){const t=Date.now();if(!(this.lastPurgeTime+nw.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>t))for(const n in this.data){const r=this.data[n];if(!r.isRefreshing){const i=await r.identity;i.expiration&&i.expiration.getTime()(l.expiration?.getTime()??0){i.set(r,new Eb(Promise.resolve(p)))})),l)):i.set(r,new Eb(this.getIdentity(r))).identity}async getIdentity(t){await this.cache.purgeExpired().catch(i=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache: -`+i)});const n=await this.createSessionFn(t);if(!n.Credentials?.AccessKeyId||!n.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:n.Credentials.AccessKeyId,secretAccessKey:n.Credentials.SecretAccessKey,sessionToken:n.Credentials.SessionToken,expiration:n.Credentials.Expiration?new Date(n.Credentials.Expiration):void 0}}}const Bbe="Directory",$be="S3Express",Ube="sigv4-s3express",Mv="X-Amz-S3session-Token",Dv=Mv.toLowerCase();class jbe extends Rv{async signWithCredentials(t,n,r){const i=iI(n);t.headers[Dv]=n.sessionToken;const c=this;return aI(c,i),c.signRequest(t,r??{})}async presignWithCredentials(t,n,r){const i=iI(n);return delete t.headers[Dv],t.headers[Mv]=n.sessionToken,t.query=t.query??{},t.query[Mv]=n.sessionToken,aI(this,i),this.presign(t,r)}}function iI(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function aI(e,t){const n=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),r=e.credentialProvider,i=()=>(clearTimeout(n),e.credentialProvider=r,Promise.resolve(t));e.credentialProvider=i}const Hbe=e=>(t,n)=>async r=>{if(n.endpointV2){const i=n.endpointV2,c=i.properties?.authSchemes?.[0]?.name===Ube;if((i.properties?.backend===$be||i.properties?.bucketType===Bbe)&&(Pr(n,"S3_EXPRESS_BUCKET","J"),n.isS3ExpressBucket=!0),c){const f=r.input.Bucket;if(f){const d=await e.s3ExpressIdentityProvider.getS3ExpressIdentity(await e.credentials(),{Bucket:f});n.s3ExpressIdentity=d,kn.isInstance(r.request)&&d.sessionToken&&(r.request.headers[Dv]=d.sessionToken)}}}return t(r)},Vbe={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Fbe=e=>({applyToStack:t=>{t.add(Hbe(e),Vbe)}}),qbe=async(e,t,n,r)=>{const i=await r.signWithCredentials(n,e,{});if(i.headers["X-Amz-Security-Token"]||i.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return i},Gbe=e=>t=>{throw t},Zbe=(e,t)=>{},Kbe=e=>(t,n)=>async r=>{if(!kn.isInstance(r.request))return t(r);const c=qo(n).selectedHttpAuthScheme;if(!c)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:l={}},identity:f,signer:d}=c;let p;n.s3ExpressIdentity?p=await qbe(n.s3ExpressIdentity,l,r.request,await e.signer()):p=await d.sign(r.request,f,l);const b=await t({...r,request:p}).catch((d.errorHandler||Gbe)(l));return(d.successHandler||Zbe)(b.response,l),b},Qbe=e=>({applyToStack:t=>{t.addRelativeTo(Kbe(e),ND)}}),Ybe=(e,{session:t})=>{const[n,r]=t,{forcePathStyle:i,useAccelerateEndpoint:c,disableMultiregionAccessPoints:l,followRegionRedirects:f,s3ExpressIdentityProvider:d,bucketEndpoint:p,expectContinueHeader:b}=e;return Object.assign(e,{forcePathStyle:i??!1,useAccelerateEndpoint:c??!1,disableMultiregionAccessPoints:l??!1,followRegionRedirects:f??!1,s3ExpressIdentityProvider:d??new sw(async g=>n().send(new r({Bucket:g}))),bucketEndpoint:p??!1,expectContinueHeader:b??2097152})},Xbe={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Wbe=3e3,Jbe=e=>(t,n)=>async r=>{const i=await t(r),{response:c}=i;if(!ac.isInstance(c))return i;const{statusCode:l,body:f}=c;if(l<200||l>=300||!(typeof f?.stream=="function"||typeof f?.pipe=="function"||typeof f?.tee=="function"))return i;let p=f,b=f;f&&typeof f=="object"&&!(f instanceof Uint8Array)&&([p,b]=await bQ(f)),c.body=b;const g=await eve(p,{streamCollector:async S=>fQ(S,Wbe)});typeof p?.destroy=="function"&&p.destroy();const v=e.utf8Encoder(g.subarray(g.length-16));if(g.length===0&&Xbe[n.commandName]){const S=new Error("S3 aborted request");throw S.name="InternalError",S}return v&&v.endsWith("")&&(c.statusCode=400),i},eve=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),tve={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},rw=e=>({applyToStack:t=>{t.addRelativeTo(Jbe(e),tve)}}),nve=e=>typeof e=="string"&&e.indexOf("arn:")===0&&e.split(":").length>=6;function sve(e){return(t,n)=>async r=>{if(e.bucketEndpoint){const i=n.endpointV2;if(i){const c=r.input.Bucket;if(typeof c=="string")try{const l=new URL(c);n.endpointV2={...i,url:l}}catch(l){const f=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${c} could not be parsed as URL.`;throw n.logger?.constructor?.name==="NoOpLogger"?console.warn(f):n.logger?.warn?.(f),l}}}return t(r)}}const rve={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function ove({bucketEndpoint:e}){return t=>async n=>{const{input:{Bucket:r}}=n;if(!e&&typeof r=="string"&&!nve(r)&&r.indexOf("/")>=0){const i=new Error(`Bucket name shouldn't contain '/', received '${r}'`);throw i.name="InvalidBucketName",i}return t({...n})}}const ive={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},ave=e=>({applyToStack:t=>{t.add(ove(e),ive),t.addRelativeTo(sve(e),rve)}}),cve=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)});class dz{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return"none"}constructor(t){this.sigv4Signer=new jbe(t),this.signerOptions=t}async sign(t,n={}){return n.signingRegion==="*"?this.getSigv4aSigner().sign(t,n):this.sigv4Signer.sign(t,n)}async signWithCredentials(t,n,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.signWithCredentials(t,n,r)}async presign(t,n={}){if(n.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.presign(t,n)}async presignWithCredentials(t,n,r={}){if(r.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,n,r)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"):new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");return this.sigv4aSigner}}const ow="required",D="type",ae="rules",U="conditions",X="fn",W="argv",ze="ref",Ye="assign",Re="url",Ce="properties",zo="backend",Dn="authSchemes",bn="disableDoubleEncoding",vn="signingName",jn="signingRegion",Ae="headers",iw="signingRegionSet",lve=6,uve=!1,Fr=!0,Vs="isSet",ln="booleanEquals",Me="error",am="aws.partition",pt="stringEquals",Wt="getAttr",en="name",jt="substring",cI="bucketSuffix",aw="parseURL",he="endpoint",ce="tree",cm="aws.isVirtualHostableS3Bucket",lm="{url#scheme}://{Bucket}.{url#authority}{url#path}",Xr="not",lI="accessPointSuffix",xh="{url#scheme}://{url#authority}{url#path}",pz="hardwareType",hz="regionPrefix",uI="bucketAliasSuffix",kv="outpostId",wc="isValidHostLabel",cw="sigv4a",Ff="s3-outposts",Nl="s3",mz="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",gz="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",fI="https://{Bucket}.s3.{partitionResult#dnsSuffix}",yz="aws.parseArn",bz="bucketArn",vz="arnType",um="",lw="s3-object-lambda",Sz="accesspoint",uw="accessPointName",dI="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",pI="mrapPartition",hI="outpostType",mI="arnPrefix",_z="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",gI="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",yI="https://s3.{partitionResult#dnsSuffix}",fl={[ow]:!1,[D]:"string"},dl={[ow]:!0,default:!1,[D]:"boolean"},hf={[ow]:!1,[D]:"boolean"},dr={[X]:ln,[W]:[{[ze]:"Accelerate"},!0]},Vt={[X]:ln,[W]:[{[ze]:"UseFIPS"},!0]},zt={[X]:ln,[W]:[{[ze]:"UseDualStack"},!0]},an={[X]:Vs,[W]:[{[ze]:"Endpoint"}]},wz={[X]:am,[W]:[{[ze]:"Region"}],[Ye]:"partitionResult"},bI={[X]:pt,[W]:[{[X]:Wt,[W]:[{[ze]:"partitionResult"},en]},"aws-cn"]},Rf={[X]:Vs,[W]:[{[ze]:"Bucket"}]},ft={[ze]:"Bucket"},vI={[U]:[dr],[Me]:"S3Express does not support S3 Accelerate.",[D]:Me},SI={[U]:[an,{[X]:aw,[W]:[{[ze]:"Endpoint"}],[Ye]:"url"}],[ae]:[{[U]:[{[X]:Vs,[W]:[{[ze]:"DisableS3ExpressSessionAuth"}]},{[X]:ln,[W]:[{[ze]:"DisableS3ExpressSessionAuth"},!0]}],[ae]:[{[U]:[{[X]:ln,[W]:[{[X]:Wt,[W]:[{[ze]:"url"},"isIp"]},!0]}],[ae]:[{[U]:[{[X]:"uriEncode",[W]:[ft],[Ye]:"uri_encoded_bucket"}],[ae]:[{[he]:{[Re]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce}],[D]:ce},{[U]:[{[X]:cm,[W]:[ft,!1]}],[ae]:[{[he]:{[Re]:lm,[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce},{[Me]:"S3Express bucket name is not a valid virtual hostable name.",[D]:Me}],[D]:ce},{[U]:[{[X]:ln,[W]:[{[X]:Wt,[W]:[{[ze]:"url"},"isIp"]},!0]}],[ae]:[{[U]:[{[X]:"uriEncode",[W]:[ft],[Ye]:"uri_encoded_bucket"}],[ae]:[{[he]:{[Re]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce}],[D]:ce},{[U]:[{[X]:cm,[W]:[ft,!1]}],[ae]:[{[he]:{[Re]:lm,[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce},{[Me]:"S3Express bucket name is not a valid virtual hostable name.",[D]:Me}],[D]:ce},is={[X]:aw,[W]:[{[ze]:"Endpoint"}],[Ye]:"url"},xb={[X]:ln,[W]:[{[X]:Wt,[W]:[{[ze]:"url"},"isIp"]},!0]},Ez={[ze]:"url"},xz={[X]:"uriEncode",[W]:[ft],[Ye]:"uri_encoded_bucket"},Us={[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:"s3express",[jn]:"{Region}"}]},Ve={},Rz={[X]:cm,[W]:[ft,!1]},_I={[Me]:"S3Express bucket name is not a valid virtual hostable name.",[D]:Me},wI={[X]:Vs,[W]:[{[ze]:"UseS3ExpressControlEndpoint"}]},EI={[X]:ln,[W]:[{[ze]:"UseS3ExpressControlEndpoint"},!0]},Ke={[X]:Xr,[W]:[an]},ot={[X]:ln,[W]:[{[ze]:"UseDualStack"},!1]},et={[X]:ln,[W]:[{[ze]:"UseFIPS"},!1]},uh={[Me]:"Unrecognized S3Express bucket name format.",[D]:Me},xI={[X]:Xr,[W]:[Rf]},RI={[ze]:pz},CI={[U]:[Ke],[Me]:"Expected a endpoint to be specified but no endpoint was found",[D]:Me},fh={[Dn]:[{[bn]:!0,[en]:cw,[vn]:Ff,[iw]:["*"]},{[bn]:!0,[en]:"sigv4",[vn]:Ff,[jn]:"{Region}"}]},Rb={[X]:ln,[W]:[{[ze]:"ForcePathStyle"},!1]},fve={[ze]:"ForcePathStyle"},gn={[X]:ln,[W]:[{[ze]:"Accelerate"},!1]},xn={[X]:pt,[W]:[{[ze]:"Region"},"aws-global"]},Tn={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"us-east-1"}]},lt={[X]:Xr,[W]:[xn]},In={[X]:ln,[W]:[{[ze]:"UseGlobalEndpoint"},!0]},AI={[Re]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"{Region}"}]},[Ae]:{}},_n={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"{Region}"}]},On={[X]:ln,[W]:[{[ze]:"UseGlobalEndpoint"},!1]},TI={[Re]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},II={[Re]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},OI={[Re]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},Cb={[X]:ln,[W]:[{[X]:Wt,[W]:[Ez,"isIp"]},!1]},Ab={[Re]:mz,[Ce]:_n,[Ae]:{}},Pv={[Re]:lm,[Ce]:_n,[Ae]:{}},MI={[he]:Pv,[D]:he},Tb={[Re]:gz,[Ce]:_n,[Ae]:{}},DI={[Re]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},dh={[Me]:"Invalid region: region was not a valid DNS name.",[D]:Me},ws={[ze]:bz},Cz={[ze]:vz},Ib={[X]:Wt,[W]:[ws,"service"]},fw={[ze]:uw},kI={[U]:[zt],[Me]:"S3 Object Lambda does not support Dual-stack",[D]:Me},PI={[U]:[dr],[Me]:"S3 Object Lambda does not support S3 Accelerate",[D]:Me},NI={[U]:[{[X]:Vs,[W]:[{[ze]:"DisableAccessPoints"}]},{[X]:ln,[W]:[{[ze]:"DisableAccessPoints"},!0]}],[Me]:"Access points are not supported for this operation",[D]:Me},Ob={[U]:[{[X]:Vs,[W]:[{[ze]:"UseArnRegion"}]},{[X]:ln,[W]:[{[ze]:"UseArnRegion"},!1]},{[X]:Xr,[W]:[{[X]:pt,[W]:[{[X]:Wt,[W]:[ws,"region"]},"{Region}"]}]}],[Me]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[D]:Me},Az={[X]:Wt,[W]:[{[ze]:"bucketPartition"},en]},Tz={[X]:Wt,[W]:[ws,"accountId"]},Mb={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:lw,[jn]:"{bucketArn#region}"}]},LI={[Me]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[D]:Me},Db={[Me]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[D]:Me},kb={[Me]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[D]:Me},Pb={[Me]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[D]:Me},zI={[Me]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[D]:Me},BI={[Me]:"Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided",[D]:Me},mf={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"{bucketArn#region}"}]},$I={[Dn]:[{[bn]:!0,[en]:cw,[vn]:Ff,[iw]:["*"]},{[bn]:!0,[en]:"sigv4",[vn]:Ff,[jn]:"{bucketArn#region}"}]},UI={[X]:yz,[W]:[ft]},jI={[Re]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},HI={[Re]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},VI={[Re]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},Nb={[Re]:_z,[Ce]:_n,[Ae]:{}},FI={[Re]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},qI={[ze]:"UseObjectLambdaEndpoint"},Lb={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:lw,[jn]:"{Region}"}]},GI={[Re]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},ZI={[Re]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},KI={[Re]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},zb={[Re]:xh,[Ce]:_n,[Ae]:{}},QI={[Re]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},Bb=[{[ze]:"Region"}],dve=[{[ze]:"Endpoint"}],pve=[ft],$b=[dr],pl=[an,is],YI=[{[X]:Vs,[W]:[{[ze]:"DisableS3ExpressSessionAuth"}]},{[X]:ln,[W]:[{[ze]:"DisableS3ExpressSessionAuth"},!0]}],hve=[xz],Ub=[Rz],fr=[wz],jb=[Vt,zt],Cf=[Vt,ot],Af=[et,zt],Tf=[et,ot],XI=[{[X]:jt,[W]:[ft,6,14,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,14,16,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],qr=[{[U]:[Vt,zt],[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he},{[U]:Cf,[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he},{[U]:Af,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he},{[U]:Tf,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he}],WI=[{[X]:jt,[W]:[ft,6,15,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,15,17,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],JI=[{[X]:jt,[W]:[ft,6,19,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,19,21,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],e2=[{[X]:jt,[W]:[ft,6,20,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,20,22,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],t2=[{[X]:jt,[W]:[ft,6,26,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,26,28,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],Gr=[{[U]:[Vt,zt],[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he},{[U]:Cf,[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he},{[U]:Af,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he},{[U]:Tf,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[zo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],n2=[ft,0,7,!0],s2=[{[X]:jt,[W]:[ft,7,15,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,15,17,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],r2=[{[X]:jt,[W]:[ft,7,16,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,16,18,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],o2=[{[X]:jt,[W]:[ft,7,20,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,20,22,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],i2=[{[X]:jt,[W]:[ft,7,21,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,21,23,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],a2=[{[X]:jt,[W]:[ft,7,27,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ft,27,29,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:pt,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],mve=[Rf],c2=[{[X]:wc,[W]:[{[ze]:kv},!1]}],l2=[{[X]:pt,[W]:[{[ze]:hz},"beta"]}],gve=["*"],u2=[{[X]:wc,[W]:[{[ze]:"Region"},!1]}],Hi=[{[X]:pt,[W]:[{[ze]:"Region"},"us-east-1"]}],Hb=[{[X]:pt,[W]:[Cz,Sz]}],f2=[{[X]:Wt,[W]:[ws,"resourceId[1]"],[Ye]:uw},{[X]:Xr,[W]:[{[X]:pt,[W]:[fw,um]}]}],yve=[ws,"resourceId[1]"],d2=[zt],Vb=[{[X]:Xr,[W]:[{[X]:pt,[W]:[{[X]:Wt,[W]:[ws,"region"]},um]}]}],p2=[{[X]:Xr,[W]:[{[X]:Vs,[W]:[{[X]:Wt,[W]:[ws,"resourceId[2]"]}]}]}],bve=[ws,"resourceId[2]"],Fb=[{[X]:am,[W]:[{[X]:Wt,[W]:[ws,"region"]}],[Ye]:"bucketPartition"}],h2=[{[X]:pt,[W]:[Az,{[X]:Wt,[W]:[{[ze]:"partitionResult"},en]}]}],qb=[{[X]:wc,[W]:[{[X]:Wt,[W]:[ws,"region"]},!0]}],Gb=[{[X]:wc,[W]:[Tz,!1]}],m2=[{[X]:wc,[W]:[fw,!1]}],ph=[Vt],g2=[{[X]:wc,[W]:[{[ze]:"Region"},!0]}],vve={parameters:{Bucket:fl,Region:fl,UseFIPS:dl,UseDualStack:dl,Endpoint:fl,ForcePathStyle:dl,Accelerate:dl,UseGlobalEndpoint:dl,UseObjectLambdaEndpoint:hf,Key:fl,Prefix:fl,CopySource:fl,DisableAccessPoints:hf,DisableMultiRegionAccessPoints:dl,UseArnRegion:hf,UseS3ExpressControlEndpoint:hf,DisableS3ExpressSessionAuth:hf},[ae]:[{[U]:[{[X]:Vs,[W]:Bb}],[ae]:[{[U]:[dr,Vt],error:"Accelerate cannot be used with FIPS",[D]:Me},{[U]:[zt,an],error:"Cannot set dual-stack in combination with a custom endpoint.",[D]:Me},{[U]:[an,Vt],error:"A custom endpoint cannot be combined with FIPS",[D]:Me},{[U]:[an,dr],error:"A custom endpoint cannot be combined with S3 Accelerate",[D]:Me},{[U]:[Vt,wz,bI],error:"Partition does not support FIPS",[D]:Me},{[U]:[Rf,{[X]:jt,[W]:[ft,0,lve,Fr],[Ye]:cI},{[X]:pt,[W]:[{[ze]:cI},"--x-s3"]}],[ae]:[vI,SI,{[U]:[wI,EI],[ae]:[{[U]:fr,[ae]:[{[U]:[xz,Ke],[ae]:[{[U]:jb,endpoint:{[Re]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Cf,endpoint:{[Re]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Af,endpoint:{[Re]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Tf,endpoint:{[Re]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he}],[D]:ce}],[D]:ce}],[D]:ce},{[U]:Ub,[ae]:[{[U]:fr,[ae]:[{[U]:YI,[ae]:[{[U]:XI,[ae]:qr,[D]:ce},{[U]:WI,[ae]:qr,[D]:ce},{[U]:JI,[ae]:qr,[D]:ce},{[U]:e2,[ae]:qr,[D]:ce},{[U]:t2,[ae]:qr,[D]:ce},uh],[D]:ce},{[U]:XI,[ae]:Gr,[D]:ce},{[U]:WI,[ae]:Gr,[D]:ce},{[U]:JI,[ae]:Gr,[D]:ce},{[U]:e2,[ae]:Gr,[D]:ce},{[U]:t2,[ae]:Gr,[D]:ce},uh],[D]:ce}],[D]:ce},_I],[D]:ce},{[U]:[Rf,{[X]:jt,[W]:n2,[Ye]:lI},{[X]:pt,[W]:[{[ze]:lI},"--xa-s3"]}],[ae]:[vI,SI,{[U]:Ub,[ae]:[{[U]:fr,[ae]:[{[U]:YI,[ae]:[{[U]:s2,[ae]:qr,[D]:ce},{[U]:r2,[ae]:qr,[D]:ce},{[U]:o2,[ae]:qr,[D]:ce},{[U]:i2,[ae]:qr,[D]:ce},{[U]:a2,[ae]:qr,[D]:ce},uh],[D]:ce},{[U]:s2,[ae]:Gr,[D]:ce},{[U]:r2,[ae]:Gr,[D]:ce},{[U]:o2,[ae]:Gr,[D]:ce},{[U]:i2,[ae]:Gr,[D]:ce},{[U]:a2,[ae]:Gr,[D]:ce},uh],[D]:ce}],[D]:ce},_I],[D]:ce},{[U]:[xI,wI,EI],[ae]:[{[U]:fr,[ae]:[{[U]:pl,endpoint:{[Re]:xh,[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:jb,endpoint:{[Re]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Cf,endpoint:{[Re]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Af,endpoint:{[Re]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Tf,endpoint:{[Re]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he}],[D]:ce}],[D]:ce},{[U]:[Rf,{[X]:jt,[W]:[ft,49,50,Fr],[Ye]:pz},{[X]:jt,[W]:[ft,8,12,Fr],[Ye]:hz},{[X]:jt,[W]:n2,[Ye]:uI},{[X]:jt,[W]:[ft,32,49,Fr],[Ye]:kv},{[X]:am,[W]:Bb,[Ye]:"regionPartition"},{[X]:pt,[W]:[{[ze]:uI},"--op-s3"]}],[ae]:[{[U]:c2,[ae]:[{[U]:Ub,[ae]:[{[U]:[{[X]:pt,[W]:[RI,"e"]}],[ae]:[{[U]:l2,[ae]:[CI,{[U]:pl,endpoint:{[Re]:"https://{Bucket}.ec2.{url#authority}",[Ce]:fh,[Ae]:Ve},[D]:he}],[D]:ce},{endpoint:{[Re]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[Ce]:fh,[Ae]:Ve},[D]:he}],[D]:ce},{[U]:[{[X]:pt,[W]:[RI,"o"]}],[ae]:[{[U]:l2,[ae]:[CI,{[U]:pl,endpoint:{[Re]:"https://{Bucket}.op-{outpostId}.{url#authority}",[Ce]:fh,[Ae]:Ve},[D]:he}],[D]:ce},{endpoint:{[Re]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[Ce]:fh,[Ae]:Ve},[D]:he}],[D]:ce},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[D]:Me}],[D]:ce},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",[D]:Me}],[D]:ce},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[D]:Me}],[D]:ce},{[U]:mve,[ae]:[{[U]:[an,{[X]:Xr,[W]:[{[X]:Vs,[W]:[{[X]:aw,[W]:dve}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[D]:Me},{[U]:[Rb,Rz],[ae]:[{[U]:fr,[ae]:[{[U]:u2,[ae]:[{[U]:[dr,bI],error:"S3 Accelerate cannot be used in this region",[D]:Me},{[U]:[zt,Vt,gn,Ke,xn],endpoint:{[Re]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[zt,Vt,gn,Ke,lt,In],[ae]:[{endpoint:AI,[D]:he}],[D]:ce},{[U]:[zt,Vt,gn,Ke,lt,On],endpoint:AI,[D]:he},{[U]:[ot,Vt,gn,Ke,xn],endpoint:{[Re]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,Vt,gn,Ke,lt,In],[ae]:[{endpoint:TI,[D]:he}],[D]:ce},{[U]:[ot,Vt,gn,Ke,lt,On],endpoint:TI,[D]:he},{[U]:[zt,et,dr,Ke,xn],endpoint:{[Re]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[zt,et,dr,Ke,lt,In],[ae]:[{endpoint:II,[D]:he}],[D]:ce},{[U]:[zt,et,dr,Ke,lt,On],endpoint:II,[D]:he},{[U]:[zt,et,gn,Ke,xn],endpoint:{[Re]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[zt,et,gn,Ke,lt,In],[ae]:[{endpoint:OI,[D]:he}],[D]:ce},{[U]:[zt,et,gn,Ke,lt,On],endpoint:OI,[D]:he},{[U]:[ot,et,gn,an,is,xb,xn],endpoint:{[Re]:mz,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,et,gn,an,is,Cb,xn],endpoint:{[Re]:lm,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,et,gn,an,is,xb,lt,In],[ae]:[{[U]:Hi,endpoint:Ab,[D]:he},{endpoint:Ab,[D]:he}],[D]:ce},{[U]:[ot,et,gn,an,is,Cb,lt,In],[ae]:[{[U]:Hi,endpoint:Pv,[D]:he},MI],[D]:ce},{[U]:[ot,et,gn,an,is,xb,lt,On],endpoint:Ab,[D]:he},{[U]:[ot,et,gn,an,is,Cb,lt,On],endpoint:Pv,[D]:he},{[U]:[ot,et,dr,Ke,xn],endpoint:{[Re]:gz,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,et,dr,Ke,lt,In],[ae]:[{[U]:Hi,endpoint:Tb,[D]:he},{endpoint:Tb,[D]:he}],[D]:ce},{[U]:[ot,et,dr,Ke,lt,On],endpoint:Tb,[D]:he},{[U]:[ot,et,gn,Ke,xn],endpoint:{[Re]:fI,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,et,gn,Ke,lt,In],[ae]:[{[U]:Hi,endpoint:{[Re]:fI,[Ce]:_n,[Ae]:Ve},[D]:he},{endpoint:DI,[D]:he}],[D]:ce},{[U]:[ot,et,gn,Ke,lt,On],endpoint:DI,[D]:he}],[D]:ce},dh],[D]:ce}],[D]:ce},{[U]:[an,is,{[X]:pt,[W]:[{[X]:Wt,[W]:[Ez,"scheme"]},"http"]},{[X]:cm,[W]:[ft,Fr]},Rb,et,ot,gn],[ae]:[{[U]:fr,[ae]:[{[U]:u2,[ae]:[MI],[D]:ce},dh],[D]:ce}],[D]:ce},{[U]:[Rb,{[X]:yz,[W]:pve,[Ye]:bz}],[ae]:[{[U]:[{[X]:Wt,[W]:[ws,"resourceId[0]"],[Ye]:vz},{[X]:Xr,[W]:[{[X]:pt,[W]:[Cz,um]}]}],[ae]:[{[U]:[{[X]:pt,[W]:[Ib,lw]}],[ae]:[{[U]:Hb,[ae]:[{[U]:f2,[ae]:[kI,PI,{[U]:Vb,[ae]:[NI,{[U]:p2,[ae]:[Ob,{[U]:Fb,[ae]:[{[U]:fr,[ae]:[{[U]:h2,[ae]:[{[U]:qb,[ae]:[{[U]:[{[X]:pt,[W]:[Tz,um]}],error:"Invalid ARN: Missing account id",[D]:Me},{[U]:Gb,[ae]:[{[U]:m2,[ae]:[{[U]:pl,endpoint:{[Re]:dI,[Ce]:Mb,[Ae]:Ve},[D]:he},{[U]:ph,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:Mb,[Ae]:Ve},[D]:he},{endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:Mb,[Ae]:Ve},[D]:he}],[D]:ce},LI],[D]:ce},Db],[D]:ce},kb],[D]:ce},Pb],[D]:ce}],[D]:ce}],[D]:ce},zI],[D]:ce},{error:"Invalid ARN: bucket ARN is missing a region",[D]:Me}],[D]:ce},BI],[D]:ce},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[D]:Me}],[D]:ce},{[U]:Hb,[ae]:[{[U]:f2,[ae]:[{[U]:Vb,[ae]:[{[U]:Hb,[ae]:[{[U]:Vb,[ae]:[NI,{[U]:p2,[ae]:[Ob,{[U]:Fb,[ae]:[{[U]:fr,[ae]:[{[U]:[{[X]:pt,[W]:[Az,"{partitionResult#name}"]}],[ae]:[{[U]:qb,[ae]:[{[U]:[{[X]:pt,[W]:[Ib,Nl]}],[ae]:[{[U]:Gb,[ae]:[{[U]:m2,[ae]:[{[U]:$b,error:"Access Points do not support S3 Accelerate",[D]:Me},{[U]:jb,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:mf,[Ae]:Ve},[D]:he},{[U]:Cf,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:mf,[Ae]:Ve},[D]:he},{[U]:Af,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:mf,[Ae]:Ve},[D]:he},{[U]:[et,ot,an,is],endpoint:{[Re]:dI,[Ce]:mf,[Ae]:Ve},[D]:he},{[U]:Tf,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:mf,[Ae]:Ve},[D]:he}],[D]:ce},LI],[D]:ce},Db],[D]:ce},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[D]:Me}],[D]:ce},kb],[D]:ce},Pb],[D]:ce}],[D]:ce}],[D]:ce},zI],[D]:ce}],[D]:ce}],[D]:ce},{[U]:[{[X]:wc,[W]:[fw,Fr]}],[ae]:[{[U]:d2,error:"S3 MRAP does not support dual-stack",[D]:Me},{[U]:ph,error:"S3 MRAP does not support FIPS",[D]:Me},{[U]:$b,error:"S3 MRAP does not support S3 Accelerate",[D]:Me},{[U]:[{[X]:ln,[W]:[{[ze]:"DisableMultiRegionAccessPoints"},Fr]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[D]:Me},{[U]:[{[X]:am,[W]:Bb,[Ye]:pI}],[ae]:[{[U]:[{[X]:pt,[W]:[{[X]:Wt,[W]:[{[ze]:pI},en]},{[X]:Wt,[W]:[ws,"partition"]}]}],[ae]:[{endpoint:{[Re]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[Ce]:{[Dn]:[{[bn]:Fr,name:cw,[vn]:Nl,[iw]:gve}]},[Ae]:Ve},[D]:he}],[D]:ce},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[D]:Me}],[D]:ce}],[D]:ce},{error:"Invalid Access Point Name",[D]:Me}],[D]:ce},BI],[D]:ce},{[U]:[{[X]:pt,[W]:[Ib,Ff]}],[ae]:[{[U]:d2,error:"S3 Outposts does not support Dual-stack",[D]:Me},{[U]:ph,error:"S3 Outposts does not support FIPS",[D]:Me},{[U]:$b,error:"S3 Outposts does not support S3 Accelerate",[D]:Me},{[U]:[{[X]:Vs,[W]:[{[X]:Wt,[W]:[ws,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[D]:Me},{[U]:[{[X]:Wt,[W]:yve,[Ye]:kv}],[ae]:[{[U]:c2,[ae]:[Ob,{[U]:Fb,[ae]:[{[U]:fr,[ae]:[{[U]:h2,[ae]:[{[U]:qb,[ae]:[{[U]:Gb,[ae]:[{[U]:[{[X]:Wt,[W]:bve,[Ye]:hI}],[ae]:[{[U]:[{[X]:Wt,[W]:[ws,"resourceId[3]"],[Ye]:uw}],[ae]:[{[U]:[{[X]:pt,[W]:[{[ze]:hI},Sz]}],[ae]:[{[U]:pl,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[Ce]:$I,[Ae]:Ve},[D]:he},{endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:$I,[Ae]:Ve},[D]:he}],[D]:ce},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[D]:Me}],[D]:ce},{error:"Invalid ARN: expected an access point name",[D]:Me}],[D]:ce},{error:"Invalid ARN: Expected a 4-component resource",[D]:Me}],[D]:ce},Db],[D]:ce},kb],[D]:ce},Pb],[D]:ce}],[D]:ce}],[D]:ce},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[D]:Me}],[D]:ce},{error:"Invalid ARN: The Outpost Id was not set",[D]:Me}],[D]:ce},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[D]:Me}],[D]:ce},{error:"Invalid ARN: No ARN type specified",[D]:Me}],[D]:ce},{[U]:[{[X]:jt,[W]:[ft,0,4,uve],[Ye]:mI},{[X]:pt,[W]:[{[ze]:mI},"arn:"]},{[X]:Xr,[W]:[{[X]:Vs,[W]:[UI]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[D]:Me},{[U]:[{[X]:ln,[W]:[fve,Fr]},UI],error:"Path-style addressing cannot be used with ARN buckets",[D]:Me},{[U]:hve,[ae]:[{[U]:fr,[ae]:[{[U]:[gn],[ae]:[{[U]:[zt,Ke,Vt,xn],endpoint:{[Re]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[zt,Ke,Vt,lt,In],[ae]:[{endpoint:jI,[D]:he}],[D]:ce},{[U]:[zt,Ke,Vt,lt,On],endpoint:jI,[D]:he},{[U]:[ot,Ke,Vt,xn],endpoint:{[Re]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,Ke,Vt,lt,In],[ae]:[{endpoint:HI,[D]:he}],[D]:ce},{[U]:[ot,Ke,Vt,lt,On],endpoint:HI,[D]:he},{[U]:[zt,Ke,et,xn],endpoint:{[Re]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[zt,Ke,et,lt,In],[ae]:[{endpoint:VI,[D]:he}],[D]:ce},{[U]:[zt,Ke,et,lt,On],endpoint:VI,[D]:he},{[U]:[ot,an,is,et,xn],endpoint:{[Re]:_z,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,an,is,et,lt,In],[ae]:[{[U]:Hi,endpoint:Nb,[D]:he},{endpoint:Nb,[D]:he}],[D]:ce},{[U]:[ot,an,is,et,lt,On],endpoint:Nb,[D]:he},{[U]:[ot,Ke,et,xn],endpoint:{[Re]:gI,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[ot,Ke,et,lt,In],[ae]:[{[U]:Hi,endpoint:{[Re]:gI,[Ce]:_n,[Ae]:Ve},[D]:he},{endpoint:FI,[D]:he}],[D]:ce},{[U]:[ot,Ke,et,lt,On],endpoint:FI,[D]:he}],[D]:ce},{error:"Path-style addressing cannot be used with S3 Accelerate",[D]:Me}],[D]:ce}],[D]:ce}],[D]:ce},{[U]:[{[X]:Vs,[W]:[qI]},{[X]:ln,[W]:[qI,Fr]}],[ae]:[{[U]:fr,[ae]:[{[U]:g2,[ae]:[kI,PI,{[U]:pl,endpoint:{[Re]:xh,[Ce]:Lb,[Ae]:Ve},[D]:he},{[U]:ph,endpoint:{[Re]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:Lb,[Ae]:Ve},[D]:he},{endpoint:{[Re]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[Ce]:Lb,[Ae]:Ve},[D]:he}],[D]:ce},dh],[D]:ce}],[D]:ce},{[U]:[xI],[ae]:[{[U]:fr,[ae]:[{[U]:g2,[ae]:[{[U]:[Vt,zt,Ke,xn],endpoint:{[Re]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Vt,zt,Ke,lt,In],[ae]:[{endpoint:GI,[D]:he}],[D]:ce},{[U]:[Vt,zt,Ke,lt,On],endpoint:GI,[D]:he},{[U]:[Vt,ot,Ke,xn],endpoint:{[Re]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Vt,ot,Ke,lt,In],[ae]:[{endpoint:ZI,[D]:he}],[D]:ce},{[U]:[Vt,ot,Ke,lt,On],endpoint:ZI,[D]:he},{[U]:[et,zt,Ke,xn],endpoint:{[Re]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[et,zt,Ke,lt,In],[ae]:[{endpoint:KI,[D]:he}],[D]:ce},{[U]:[et,zt,Ke,lt,On],endpoint:KI,[D]:he},{[U]:[et,ot,an,is,xn],endpoint:{[Re]:xh,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[et,ot,an,is,lt,In],[ae]:[{[U]:Hi,endpoint:zb,[D]:he},{endpoint:zb,[D]:he}],[D]:ce},{[U]:[et,ot,an,is,lt,On],endpoint:zb,[D]:he},{[U]:[et,ot,Ke,xn],endpoint:{[Re]:yI,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[et,ot,Ke,lt,In],[ae]:[{[U]:Hi,endpoint:{[Re]:yI,[Ce]:_n,[Ae]:Ve},[D]:he},{endpoint:QI,[D]:he}],[D]:ce},{[U]:[et,ot,Ke,lt,On],endpoint:QI,[D]:he}],[D]:ce},dh],[D]:ce}],[D]:ce}],[D]:ce},{error:"A region must be set when sending requests to S3.",[D]:Me}]},Sve=vve,_ve=new WD({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Iz=(e,t={})=>_ve.get(e,()=>ck(Sve,{endpointParams:e,logger:t.logger}));kl.aws=BS;const wve=e=>async(t,n,r)=>{if(!r)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const i=await e(t,n,r),c=qo(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!c)throw new Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);const l=await Nk(r,{getEndpointParameterInstructions:c},t);return Object.assign(i,l)},Eve=async(e,t,n)=>({operation:qo(t).operation,region:await qs(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),xve=wve(Eve);function Oz(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function Mz(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}const Rve=(e,t,n)=>i=>{const l=e(i).properties?.authSchemes;if(!l)return t(i);const f=[];for(const d of l){const{name:p,properties:b={},...g}=d,v=p.toLowerCase();p!==v&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${p}' to '${v}'`);let S;if(v==="sigv4a"){S="aws.auth#sigv4a";const R=l.find(C=>{const O=C.name.toLowerCase();return O!=="sigv4a"&&O.startsWith("sigv4")});if(dz.sigv4aDependency()==="none"&&R)continue}else if(v.startsWith("sigv4"))S="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${v}'`);const w=n[S];if(!w)throw new Error(`Could not find HttpAuthOption create function for '${S}'`);const E=w(i);E.schemeId=S,E.signingProperties={...E.signingProperties||{},...g,...b},f.push(E)}return f},Cve=e=>{const t=[];switch(e.operation){default:t.push(Oz(e)),t.push(Mz(e))}return t},Ave=Rve(Iz,Cve,{"aws.auth#sigv4":Oz,"aws.auth#sigv4a":Mz}),Tve=e=>{const t=bk(e),n=FY(t);return Object.assign(n,{authSchemePreference:qs(e.authSchemePreference??[])})},Ive=e=>Object.assign(e,{useFipsEndpoint:e.useFipsEndpoint??!1,useDualstackEndpoint:e.useDualstackEndpoint??!1,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:e.clientContextParams??{}}),dw={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class Pn extends Ya{constructor(t){super(t),Object.setPrototypeOf(this,Pn.prototype)}}class pw extends Pn{name="NoSuchUpload";$fault="client";constructor(t){super({name:"NoSuchUpload",$fault:"client",...t}),Object.setPrototypeOf(this,pw.prototype)}}class hw extends Pn{name="AccessDenied";$fault="client";constructor(t){super({name:"AccessDenied",$fault:"client",...t}),Object.setPrototypeOf(this,hw.prototype)}}class mw extends Pn{name="ObjectNotInActiveTierError";$fault="client";constructor(t){super({name:"ObjectNotInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,mw.prototype)}}class gw extends Pn{name="BucketAlreadyExists";$fault="client";constructor(t){super({name:"BucketAlreadyExists",$fault:"client",...t}),Object.setPrototypeOf(this,gw.prototype)}}class yw extends Pn{name="BucketAlreadyOwnedByYou";$fault="client";constructor(t){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...t}),Object.setPrototypeOf(this,yw.prototype)}}class bw extends Pn{name="NoSuchBucket";$fault="client";constructor(t){super({name:"NoSuchBucket",$fault:"client",...t}),Object.setPrototypeOf(this,bw.prototype)}}class vw extends Pn{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(t){super({name:"InvalidObjectState",$fault:"client",...t}),Object.setPrototypeOf(this,vw.prototype),this.StorageClass=t.StorageClass,this.AccessTier=t.AccessTier}}class Sw extends Pn{name="NoSuchKey";$fault="client";constructor(t){super({name:"NoSuchKey",$fault:"client",...t}),Object.setPrototypeOf(this,Sw.prototype)}}class _w extends Pn{name="NotFound";$fault="client";constructor(t){super({name:"NotFound",$fault:"client",...t}),Object.setPrototypeOf(this,_w.prototype)}}class ww extends Pn{name="EncryptionTypeMismatch";$fault="client";constructor(t){super({name:"EncryptionTypeMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,ww.prototype)}}class Ew extends Pn{name="InvalidRequest";$fault="client";constructor(t){super({name:"InvalidRequest",$fault:"client",...t}),Object.setPrototypeOf(this,Ew.prototype)}}class xw extends Pn{name="InvalidWriteOffset";$fault="client";constructor(t){super({name:"InvalidWriteOffset",$fault:"client",...t}),Object.setPrototypeOf(this,xw.prototype)}}class Rw extends Pn{name="TooManyParts";$fault="client";constructor(t){super({name:"TooManyParts",$fault:"client",...t}),Object.setPrototypeOf(this,Rw.prototype)}}class Cw extends Pn{name="IdempotencyParameterMismatch";$fault="client";constructor(t){super({name:"IdempotencyParameterMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,Cw.prototype)}}class Aw extends Pn{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(t){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,Aw.prototype)}}const Tw="ACL",Ove="AccessDenied",Mve="AbortDate",y2="AccessKeyId",Dve="AbortMultipartUpload",kve="AbortMultipartUploadOutput",Pve="AbortMultipartUploadRequest",Nve="AcceptRanges",Lve="AbortRuleId",zve="AccessTier",Fn="Bucket",Dz="BucketArn",Bve="BucketAlreadyExists",$ve="BucketAlreadyOwnedByYou",Uve="BypassGovernanceRetention",jve="BucketInfo",Xo="BucketKeyEnabled",kz="BucketRegion",Iw="Body",Pz="Buckets",Wl="ChecksumAlgorithm",Hve="CreateBucket",Nv="CreateBucketConfiguration",Vve="CreateBucketOutput",Fve="CreateBucketRequest",Ow="CacheControl",ya="ChecksumCRC32",ba="ChecksumCRC32C",va="ChecksumCRC64NVME",Mw="Cache-Control",qve="CreationDate",Dw="Content-Disposition",kw="ContentDisposition",Pw="Content-Encoding",Nw="ContentEncoding",Lw="ContentLanguage",zw="Content-Language",Bw="Content-Length",$w="ContentLength",Uw="Content-MD5",jw="ContentMD5",Gve="CompletedMultipartUpload",Zve="CompleteMultipartUploadOutput",Kve="CreateMultipartUploadOutput",Qve="CompleteMultipartUploadResult",Yve="CompleteMultipartUploadRequest",Xve="CreateMultipartUploadRequest",Nz="CompleteMultipartUpload",Wve="CreateMultipartUpload",Jve="ChecksumMode",eSe="CommonPrefix",tSe="CommonPrefixList",nSe="CompletedPartList",sSe="CompletedPart",rSe="CommonPrefixes",oSe="ContentRange",iSe="Content-Range",Sa="ChecksumSHA1",_a="ChecksumSHA256",aSe="CreateSessionOutput",cSe="CreateSessionResult",lSe="CreateSessionRequest",uSe="CreateSession",Ec="ChecksumType",Hw="Content-Type",Vw="ContentType",hg="ContinuationToken",fSe="Contents",b2="Credentials",Lz="DeleteMarker",dSe="DisplayName",pSe="DeleteObjectOutput",hSe="DeleteObjectRequest",mSe="DeleteObject",gSe="DataRedundancy",zz="Delimiter",qf="Expiration",Wo="ExpectedBucketOwner",v2="ExpiresString",ySe="EncryptionTypeMismatch",Vo="ETag",Bz="EncodingType",Ll="Expires",bSe="FetchOwner",Fw="GrantFullControl",vSe="GetObject",SSe="GetObjectOutput",_Se="GetObjectRequest",qw="GrantRead",Gw="GrantReadACP",wSe="GrantWrite",Zw="GrantWriteACP",ESe="ID",mg="IfMatch",xSe="IfMatchInitiatedTime",RSe="IfMatchLastModifiedTime",CSe="IfMatchSize",ASe="If-Modified-Since",TSe="IfModifiedSince",ISe="InitiateMultipartUploadResult",gg="If-Match",Kw="IfNoneMatch",Qw="If-None-Match",OSe="InvalidObjectState",MSe="IdempotencyParameterMismatch",DSe="InvalidRequest",kSe="IsRestoreInProgress",PSe="IsTruncated",NSe="IfUnmodifiedSince",LSe="If-Unmodified-Since",zSe="InvalidWriteOffset",Cr="Key",BSe="KeyCount",fm="Location",$Se="ListAllMyBucketsResult",USe="ListBuckets",jSe="ListBucketsOutput",HSe="ListBucketsRequest",VSe="ListBucketResult",FSe="LocationConstraint",qSe="LocationInfo",$z="LastModified",GSe="Last-Modified",ZSe="ListObjectsV2",KSe="ListObjectsV2Output",QSe="ListObjectsV2Request",Yw="Metadata",YSe="MaxBuckets",XSe="MFA",Uz="MaxKeys",WSe="MissingMeta",JSe="MpuObjectSize",e_e="MultipartUpload",Xw="Name",t_e="NextContinuationToken",n_e="NotFound",s_e="NoSuchBucket",r_e="NoSuchKey",o_e="NoSuchUpload",Ww="Owner",i_e="ObjectAlreadyInActiveTierError",a_e="ObjectLockEnabledForBucket",Jw="ObjectLockLegalHoldStatus",eE="ObjectLockMode",tE="ObjectLockRetainUntilDate",c_e="ObjectList",l_e="ObjectNotInActiveTierError",u_e="ObjectOwnership",f_e="OptionalObjectAttributes",d_e="Object",vd="Prefix",p_e="PartsCount",nE="PartNumber",h_e="PutObject",m_e="PutObjectOutput",g_e="PutObjectRequest",y_e="PutObjectTagging",b_e="PutObjectTaggingOutput",v_e="PutObjectTaggingRequest",S_e="Parts",__e="Part",wa="RequestCharged",w_e="ResponseCacheControl",E_e="ResponseContentDisposition",x_e="ResponseContentEncoding",R_e="ResponseContentLanguage",C_e="ResponseContentType",A_e="ResponseExpires",T_e="RestoreExpiryDate",Jo="RequestPayer",I_e="ReplicationStatus",jz="RestoreStatus",S2="Range",O_e="Restore",Hz="StartAfter",_2="SecretAccessKey",M_e="StreamingBlob",Sd="StorageClass",D_e="SessionCredentialValue",k_e="SessionCredentials",P_e="SessionMode",ei="ServerSideEncryption",ti="SSECustomerAlgorithm",Jl="SSECustomerKey",ni="SSECustomerKeyMD5",xc="SSEKMSEncryptionContext",io="SSEKMSKeyId",w2="SessionToken",Vz="Size",N_e="Tags",L_e="TagCount",z_e="TooManyParts",Fz="TagSet",qz="Tag",Gf="Tagging",Gz="Type",yg="UploadId",B_e="UploadPart",$_e="UploadPartOutput",U_e="UploadPartRequest",j_e="Value",Ea="VersionId",H_e="WriteOffsetBytes",sE="WebsiteRedirectLocation",V_e="accept-ranges",F_e="bucket-region",us="client",Zz="continuation-token",q_e="delimiter",fs="error",G_e="encoding-type",Z_e="fetch-owner",Ar="http",bg="httpChecksum",Is="httpError",L="httpHeader",rE="httpPayload",oE="httpPrefixHeaders",Zt="httpQuery",K_e="max-buckets",Q_e="max-keys",Kz="prefix",Qz="partNumber",Y_e="response-cache-control",X_e="response-content-disposition",W_e="response-content-encoding",J_e="response-content-language",ewe="response-content-type",twe="response-expires",Yz="smithy.ts.sdk.synthetic.com.amazonaws.s3",nwe="start-after",swe="streaming",iE="uploadId",aE="versionId",dm="xmlFlattened",Hn="xmlName",cE="x-amz-acl",rwe="x-amz-abort-date",owe="x-amz-abort-rule-id",iwe="x-amz-bucket-arn",awe="x-amz-bypass-governance-retention",cwe="x-amz-bucket-object-lock-enabled",Xz="x-amz-checksum-algorithm",eu="x-amz-checksum-crc32",tu="x-amz-checksum-crc32c",nu="x-amz-checksum-crc64nvme",lwe="x-amz-checksum-mode",su="x-amz-checksum-sha1",ru="x-amz-checksum-sha256",uwe="x-amz-create-session-mode",_d="x-amz-checksum-type",Wz="x-amz-delete-marker",lE="x-amz-expiration",si="x-amz-expected-bucket-owner",uE="x-amz-grant-full-control",fE="x-amz-grant-read",dE="x-amz-grant-read-acp",fwe="x-amz-grant-write",pE="x-amz-grant-write-acp",dwe="x-amz-if-match-initiated-time",pwe="x-amz-if-match-last-modified-time",hwe="x-amz-if-match-size",hE="x-amz-meta-",mwe="x-amz-mfa",gwe="x-amz-missing-meta",ywe="x-amz-mp-object-size",bwe="x-amz-mp-parts-count",mE="x-amz-object-lock-legal-hold",gE="x-amz-object-lock-mode",yE="x-amz-object-lock-retain-until-date",vwe="x-amz-object-ownership",Swe="x-amz-optional-object-attributes",_we="x-amz-object-size",wwe="x-amz-restore",xa="x-amz-request-charged",ri="x-amz-request-payer",Ewe="x-amz-replication-status",bE="x-amz-storage-class",vE="x-amz-sdk-checksum-algorithm",oi="x-amz-server-side-encryption",ii="x-amz-server-side-encryption-aws-kms-key-id",ai="x-amz-server-side-encryption-bucket-key-enabled",ou="x-amz-server-side-encryption-context",ci="x-amz-server-side-encryption-customer-algorithm",wd="x-amz-server-side-encryption-customer-key",li="x-amz-server-side-encryption-customer-key-MD5",Jz="x-amz-tagging",xwe="x-amz-tagging-count",Ed="x-amz-version-id",Rwe="x-amz-write-offset-bytes",SE="x-amz-website-redirect-location",Ie="com.amazonaws.s3",e4=ts.for(Yz);var Cwe=[-3,Yz,"S3ServiceException",0,[],[]];e4.registerError(Cwe,Pn);const ss=ts.for(Ie);var Awe=[-3,Ie,Ove,{[fs]:us,[Is]:403},[],[]];ss.registerError(Awe,hw);var Twe=[-3,Ie,Bve,{[fs]:us,[Is]:409},[],[]];ss.registerError(Twe,gw);var Iwe=[-3,Ie,$ve,{[fs]:us,[Is]:409},[],[]];ss.registerError(Iwe,yw);var Owe=[-3,Ie,ySe,{[fs]:us,[Is]:400},[],[]];ss.registerError(Owe,ww);var Mwe=[-3,Ie,MSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(Mwe,Cw);var Dwe=[-3,Ie,OSe,{[fs]:us,[Is]:403},[Sd,zve],[0,0]];ss.registerError(Dwe,vw);var kwe=[-3,Ie,DSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(kwe,Ew);var Pwe=[-3,Ie,zSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(Pwe,xw);var Nwe=[-3,Ie,s_e,{[fs]:us,[Is]:404},[],[]];ss.registerError(Nwe,bw);var Lwe=[-3,Ie,r_e,{[fs]:us,[Is]:404},[],[]];ss.registerError(Lwe,Sw);var zwe=[-3,Ie,o_e,{[fs]:us,[Is]:404},[],[]];ss.registerError(zwe,pw);var Bwe=[-3,Ie,n_e,{[fs]:us},[],[]];ss.registerError(Bwe,_w);var $we=[-3,Ie,i_e,{[fs]:us,[Is]:403},[],[]];ss.registerError($we,Aw);var Uwe=[-3,Ie,l_e,{[fs]:us,[Is]:403},[],[]];ss.registerError(Uwe,mw);var jwe=[-3,Ie,z_e,{[fs]:us,[Is]:400},[],[]];ss.registerError(jwe,Rw);const Hwe=[e4,ss];var E2=[0,Ie,D_e,8,0],xd=[0,Ie,Jl,8,0],iu=[0,Ie,xc,8,0],ui=[0,Ie,io,8,0],_E=[0,Ie,M_e,{[swe]:1},42],Vwe=[3,Ie,kve,0,[wa],[[0,{[L]:xa}]]],Fwe=[3,Ie,Pve,0,[Fn,Cr,yg,Jo,Wo,xSe],[[0,1],[0,1],[0,{[Zt]:iE}],[0,{[L]:ri}],[0,{[L]:si}],[6,{[L]:dwe}]],3],qwe=[3,Ie,Fn,0,[Xw,qve,kz,Dz],[0,4,0,0]],Gwe=[3,Ie,jve,0,[gSe,Gz],[0,0]],Zwe=[3,Ie,eSe,0,[vd],[0]],Kwe=[3,Ie,Gve,0,[S_e],[[()=>AEe,{[dm]:1,[Hn]:__e}]]],Qwe=[3,Ie,sSe,0,[Vo,ya,ba,va,Sa,_a,nE],[0,0,0,0,0,0,1]],Ywe=[3,Ie,Zve,{[Hn]:Qve},[fm,Fn,Cr,qf,Vo,ya,ba,va,Sa,_a,Ec,ei,Ea,io,Xo,wa],[0,0,0,[0,{[L]:lE}],0,0,0,0,0,0,0,[0,{[L]:oi}],[0,{[L]:Ed}],[()=>ui,{[L]:ii}],[2,{[L]:ai}],[0,{[L]:xa}]]],Xwe=[3,Ie,Yve,0,[Fn,Cr,yg,e_e,ya,ba,va,Sa,_a,Ec,JSe,Jo,Wo,mg,Kw,ti,Jl,ni],[[0,1],[0,1],[0,{[Zt]:iE}],[()=>Kwe,{[rE]:1,[Hn]:Nz}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:_d}],[1,{[L]:ywe}],[0,{[L]:ri}],[0,{[L]:si}],[0,{[L]:gg}],[0,{[L]:Qw}],[0,{[L]:ci}],[()=>xd,{[L]:wd}],[0,{[L]:li}]],3],Wwe=[3,Ie,Nv,0,[FSe,fm,Fn,N_e],[0,()=>pEe,()=>Gwe,[()=>n4,0]]],Jwe=[3,Ie,Vve,0,[fm,Dz],[[0,{[L]:fm}],[0,{[L]:iwe}]]],eEe=[3,Ie,Fve,0,[Fn,Tw,Nv,Fw,qw,Gw,wSe,Zw,a_e,u_e],[[0,1],[0,{[L]:cE}],[()=>Wwe,{[rE]:1,[Hn]:Nv}],[0,{[L]:uE}],[0,{[L]:fE}],[0,{[L]:dE}],[0,{[L]:fwe}],[0,{[L]:pE}],[2,{[L]:cwe}],[0,{[L]:vwe}]],1],tEe=[3,Ie,Kve,{[Hn]:ISe},[Mve,Lve,Fn,Cr,yg,ei,ti,ni,io,xc,Xo,wa,Wl,Ec],[[4,{[L]:rwe}],[0,{[L]:owe}],[0,{[Hn]:Fn}],0,0,[0,{[L]:oi}],[0,{[L]:ci}],[0,{[L]:li}],[()=>ui,{[L]:ii}],[()=>iu,{[L]:ou}],[2,{[L]:ai}],[0,{[L]:xa}],[0,{[L]:Xz}],[0,{[L]:_d}]]],nEe=[3,Ie,Xve,0,[Fn,Cr,Tw,Ow,kw,Nw,Lw,Vw,Ll,Fw,qw,Gw,Zw,Yw,ei,Sd,sE,ti,Jl,ni,io,xc,Xo,Jo,Gf,eE,tE,Jw,Wo,Wl,Ec],[[0,1],[0,1],[0,{[L]:cE}],[0,{[L]:Mw}],[0,{[L]:Dw}],[0,{[L]:Pw}],[0,{[L]:zw}],[0,{[L]:Hw}],[4,{[L]:Ll}],[0,{[L]:uE}],[0,{[L]:fE}],[0,{[L]:dE}],[0,{[L]:pE}],[128,{[oE]:hE}],[0,{[L]:oi}],[0,{[L]:bE}],[0,{[L]:SE}],[0,{[L]:ci}],[()=>xd,{[L]:wd}],[0,{[L]:li}],[()=>ui,{[L]:ii}],[()=>iu,{[L]:ou}],[2,{[L]:ai}],[0,{[L]:ri}],[0,{[L]:Jz}],[0,{[L]:gE}],[5,{[L]:yE}],[0,{[L]:mE}],[0,{[L]:si}],[0,{[L]:Xz}],[0,{[L]:_d}]],2],sEe=[3,Ie,aSe,{[Hn]:cSe},[b2,ei,io,xc,Xo],[[()=>SEe,{[Hn]:b2}],[0,{[L]:oi}],[()=>ui,{[L]:ii}],[()=>iu,{[L]:ou}],[2,{[L]:ai}]],1],rEe=[3,Ie,lSe,0,[Fn,P_e,ei,io,xc,Xo],[[0,1],[0,{[L]:uwe}],[0,{[L]:oi}],[()=>ui,{[L]:ii}],[()=>iu,{[L]:ou}],[2,{[L]:ai}]],1],oEe=[3,Ie,pSe,0,[Lz,Ea,wa],[[2,{[L]:Wz}],[0,{[L]:Ed}],[0,{[L]:xa}]]],iEe=[3,Ie,hSe,0,[Fn,Cr,XSe,Ea,Jo,Uve,Wo,mg,RSe,CSe],[[0,1],[0,1],[0,{[L]:mwe}],[0,{[Zt]:aE}],[0,{[L]:ri}],[2,{[L]:awe}],[0,{[L]:si}],[0,{[L]:gg}],[6,{[L]:pwe}],[1,{[L]:hwe}]],2],aEe=[3,Ie,SSe,0,[Iw,Lz,Nve,qf,O_e,$z,$w,Vo,ya,ba,va,Sa,_a,Ec,WSe,Ea,Ow,kw,Nw,Lw,oSe,Vw,Ll,v2,sE,ei,Yw,ti,ni,io,Xo,Sd,wa,I_e,p_e,L_e,eE,tE,Jw],[[()=>_E,16],[2,{[L]:Wz}],[0,{[L]:V_e}],[0,{[L]:lE}],[0,{[L]:wwe}],[4,{[L]:GSe}],[1,{[L]:Bw}],[0,{[L]:Vo}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:_d}],[1,{[L]:gwe}],[0,{[L]:Ed}],[0,{[L]:Mw}],[0,{[L]:Dw}],[0,{[L]:Pw}],[0,{[L]:zw}],[0,{[L]:iSe}],[0,{[L]:Hw}],[4,{[L]:Ll}],[0,{[L]:v2}],[0,{[L]:SE}],[0,{[L]:oi}],[128,{[oE]:hE}],[0,{[L]:ci}],[0,{[L]:li}],[()=>ui,{[L]:ii}],[2,{[L]:ai}],[0,{[L]:bE}],[0,{[L]:xa}],[0,{[L]:Ewe}],[1,{[L]:bwe}],[1,{[L]:xwe}],[0,{[L]:gE}],[5,{[L]:yE}],[0,{[L]:mE}]]],cEe=[3,Ie,_Se,0,[Fn,Cr,mg,TSe,Kw,NSe,S2,w_e,E_e,x_e,R_e,C_e,A_e,Ea,ti,Jl,ni,Jo,nE,Wo,Jve],[[0,1],[0,1],[0,{[L]:gg}],[4,{[L]:ASe}],[0,{[L]:Qw}],[4,{[L]:LSe}],[0,{[L]:S2}],[0,{[Zt]:Y_e}],[0,{[Zt]:X_e}],[0,{[Zt]:W_e}],[0,{[Zt]:J_e}],[0,{[Zt]:ewe}],[6,{[Zt]:twe}],[0,{[Zt]:aE}],[0,{[L]:ci}],[()=>xd,{[L]:wd}],[0,{[L]:li}],[0,{[L]:ri}],[1,{[Zt]:Qz}],[0,{[L]:si}],[0,{[L]:lwe}]],2],lEe=[3,Ie,jSe,{[Hn]:$Se},[Pz,Ww,hg,vd],[[()=>REe,0],()=>t4,0,0]],uEe=[3,Ie,HSe,0,[YSe,hg,vd,kz],[[1,{[Zt]:K_e}],[0,{[Zt]:Zz}],[0,{[Zt]:Kz}],[0,{[Zt]:F_e}]]],fEe=[3,Ie,KSe,{[Hn]:VSe},[PSe,fSe,Xw,vd,zz,Uz,rSe,Bz,BSe,hg,t_e,Hz,wa],[2,[()=>TEe,{[dm]:1}],0,0,0,1,[()=>CEe,{[dm]:1}],0,1,0,0,0,[0,{[L]:xa}]]],dEe=[3,Ie,QSe,0,[Fn,zz,Bz,Uz,vd,hg,bSe,Hz,Jo,Wo,f_e],[[0,1],[0,{[Zt]:q_e}],[0,{[Zt]:G_e}],[1,{[Zt]:Q_e}],[0,{[Zt]:Kz}],[0,{[Zt]:Zz}],[2,{[Zt]:Z_e}],[0,{[Zt]:nwe}],[0,{[L]:ri}],[0,{[L]:si}],[64,{[L]:Swe}]],1],pEe=[3,Ie,qSe,0,[Gz,Xw],[0,0]],hEe=[3,Ie,d_e,0,[Cr,$z,Vo,Wl,Ec,Vz,Sd,Ww,jz],[0,4,0,[64,{[dm]:1}],0,1,0,()=>t4,()=>vEe]],t4=[3,Ie,Ww,0,[dSe,ESe],[0,0]],mEe=[3,Ie,m_e,0,[qf,Vo,ya,ba,va,Sa,_a,Ec,ei,Ea,ti,ni,io,xc,Xo,Vz,wa],[[0,{[L]:lE}],[0,{[L]:Vo}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:_d}],[0,{[L]:oi}],[0,{[L]:Ed}],[0,{[L]:ci}],[0,{[L]:li}],[()=>ui,{[L]:ii}],[()=>iu,{[L]:ou}],[2,{[L]:ai}],[1,{[L]:_we}],[0,{[L]:xa}]]],gEe=[3,Ie,g_e,0,[Fn,Cr,Tw,Iw,Ow,kw,Nw,Lw,$w,jw,Vw,Wl,ya,ba,va,Sa,_a,Ll,mg,Kw,Fw,qw,Gw,Zw,H_e,Yw,ei,Sd,sE,ti,Jl,ni,io,xc,Xo,Jo,Gf,eE,tE,Jw,Wo],[[0,1],[0,1],[0,{[L]:cE}],[()=>_E,16],[0,{[L]:Mw}],[0,{[L]:Dw}],[0,{[L]:Pw}],[0,{[L]:zw}],[1,{[L]:Bw}],[0,{[L]:Uw}],[0,{[L]:Hw}],[0,{[L]:vE}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[4,{[L]:Ll}],[0,{[L]:gg}],[0,{[L]:Qw}],[0,{[L]:uE}],[0,{[L]:fE}],[0,{[L]:dE}],[0,{[L]:pE}],[1,{[L]:Rwe}],[128,{[oE]:hE}],[0,{[L]:oi}],[0,{[L]:bE}],[0,{[L]:SE}],[0,{[L]:ci}],[()=>xd,{[L]:wd}],[0,{[L]:li}],[()=>ui,{[L]:ii}],[()=>iu,{[L]:ou}],[2,{[L]:ai}],[0,{[L]:ri}],[0,{[L]:Jz}],[0,{[L]:gE}],[5,{[L]:yE}],[0,{[L]:mE}],[0,{[L]:si}]],2],yEe=[3,Ie,b_e,0,[Ea],[[0,{[L]:Ed}]]],bEe=[3,Ie,v_e,0,[Fn,Cr,Gf,Ea,jw,Wl,Wo,Jo],[[0,1],[0,1],[()=>wEe,{[rE]:1,[Hn]:Gf}],[0,{[Zt]:aE}],[0,{[L]:Uw}],[0,{[L]:vE}],[0,{[L]:si}],[0,{[L]:ri}]],3],vEe=[3,Ie,jz,0,[kSe,T_e],[2,4]],SEe=[3,Ie,k_e,0,[y2,_2,w2,qf],[[0,{[Hn]:y2}],[()=>E2,{[Hn]:_2}],[()=>E2,{[Hn]:w2}],[4,{[Hn]:qf}]],4],_Ee=[3,Ie,qz,0,[Cr,j_e],[0,0],2],wEe=[3,Ie,Gf,0,[Fz],[[()=>n4,0]],1],EEe=[3,Ie,$_e,0,[ei,Vo,ya,ba,va,Sa,_a,ti,ni,io,Xo,wa],[[0,{[L]:oi}],[0,{[L]:Vo}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:ci}],[0,{[L]:li}],[()=>ui,{[L]:ii}],[2,{[L]:ai}],[0,{[L]:xa}]]],xEe=[3,Ie,U_e,0,[Fn,Cr,nE,yg,Iw,$w,jw,Wl,ya,ba,va,Sa,_a,ti,Jl,ni,Jo,Wo],[[0,1],[0,1],[1,{[Zt]:Qz}],[0,{[Zt]:iE}],[()=>_E,16],[1,{[L]:Bw}],[0,{[L]:Uw}],[0,{[L]:vE}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:ci}],[()=>xd,{[L]:wd}],[0,{[L]:li}],[0,{[L]:ri}],[0,{[L]:si}]],4],REe=[1,Ie,Pz,0,[()=>qwe,{[Hn]:Fn}]],CEe=[1,Ie,tSe,0,()=>Zwe],AEe=[1,Ie,nSe,0,()=>Qwe],TEe=[1,Ie,c_e,0,[()=>hEe,0]],n4=[1,Ie,Fz,0,[()=>_Ee,{[Hn]:qz}]],xCe=[9,Ie,Dve,{[Ar]:["DELETE","/{Key+}?x-id=AbortMultipartUpload",204]},()=>Fwe,()=>Vwe],RCe=[9,Ie,Nz,{[Ar]:["POST","/{Key+}",200]},()=>Xwe,()=>Ywe],CCe=[9,Ie,Hve,{[Ar]:["PUT","/",200]},()=>eEe,()=>Jwe],ACe=[9,Ie,Wve,{[Ar]:["POST","/{Key+}?uploads",200]},()=>nEe,()=>tEe],IEe=[9,Ie,uSe,{[Ar]:["GET","/?session",200]},()=>rEe,()=>sEe],TCe=[9,Ie,mSe,{[Ar]:["DELETE","/{Key+}?x-id=DeleteObject",204]},()=>iEe,()=>oEe],ICe=[9,Ie,vSe,{[bg]:"-",[Ar]:["GET","/{Key+}?x-id=GetObject",200]},()=>cEe,()=>aEe],OEe=[9,Ie,USe,{[Ar]:["GET","/?x-id=ListBuckets",200]},()=>uEe,()=>lEe],MEe=[9,Ie,ZSe,{[Ar]:["GET","/?list-type=2",200]},()=>dEe,()=>fEe],OCe=[9,Ie,h_e,{[bg]:"-",[Ar]:["PUT","/{Key+}?x-id=PutObject",200]},()=>gEe,()=>mEe],MCe=[9,Ie,y_e,{[bg]:"-",[Ar]:["PUT","/{Key+}?tagging",200]},()=>bEe,()=>yEe],DCe=[9,Ie,B_e,{[bg]:"-",[Ar]:["PUT","/{Key+}?x-id=UploadPart",200]},()=>xEe,()=>EEe];class DEe extends Cs.classBuilder().ep({...dw,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions()),rw(r)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(IEe).build(){}const kEe="3.995.0",PEe={version:kEe};function x2(e){return typeof e=="string"?e.length===0:e.byteLength===0}var s4={name:"SHA-1"},R2={name:"HMAC",hash:s4},NEe=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]),LEe=(function(){function e(t){this.toHash=new Uint8Array(0),t!==void 0&&(this.key=new Promise(function(n,r){Ji().crypto.subtle.importKey("raw",C2(t),R2,!1,["sign"]).then(n,r)}),this.key.catch(function(){}))}return e.prototype.update=function(t){if(!x2(t)){var n=C2(t),r=new Uint8Array(this.toHash.byteLength+n.byteLength);r.set(this.toHash,0),r.set(n,this.toHash.byteLength),this.toHash=r}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(n){return Ji().crypto.subtle.sign(R2,n,t.toHash).then(function(r){return new Uint8Array(r)})}):x2(this.toHash)?Promise.resolve(NEe):Promise.resolve().then(function(){return Ji().crypto.subtle.digest(s4,t.toHash)}).then(function(n){return Promise.resolve(new Uint8Array(n))})},e.prototype.reset=function(){this.toHash=new Uint8Array(0)},e})();function C2(e){return typeof e=="string"?Vk(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var zEe=(function(){function e(t){if(Zk(Ji()))this.hash=new LEe(t);else throw new Error("SHA1 not supported")}return e.prototype.update=function(t,n){this.hash.update(lc(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();class If{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const n=new Uint8Array(8);for(let r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)n[r]=i;return t<0&&A2(n),new If(n)}valueOf(){const t=this.bytes.slice(0),n=t[0]&128;return n&&A2(t),parseInt(_s(t),16)*(n?-1:1)}toString(){return String(this.valueOf())}}function A2(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}class BEe{toUtf8;fromUtf8;constructor(t,n){this.toUtf8=t,this.fromUtf8=n}format(t){const n=[];for(const c of Object.keys(t)){const l=this.fromUtf8(c);n.push(Uint8Array.from([l.byteLength]),l,this.formatHeaderValue(t[c]))}const r=new Uint8Array(n.reduce((c,l)=>c+l.byteLength,0));let i=0;for(const c of n)r.set(c,i),i+=c.byteLength;return r}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,t.value,!1),new Uint8Array(n.buffer);case"integer":const r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,t.value,!1),new Uint8Array(r.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const c=new DataView(new ArrayBuffer(3+t.value.byteLength));c.setUint8(0,6),c.setUint16(1,t.value.byteLength,!1);const l=new Uint8Array(c.buffer);return l.set(t.value,3),l;case"string":const f=this.fromUtf8(t.value),d=new DataView(new ArrayBuffer(3+f.byteLength));d.setUint8(0,7),d.setUint16(1,f.byteLength,!1);const p=new Uint8Array(d.buffer);return p.set(f,3),p;case"timestamp":const b=new Uint8Array(9);return b[0]=8,b.set(If.fromNumber(t.value.valueOf()).bytes,1),b;case"uuid":if(!ZEe.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const g=new Uint8Array(17);return g[0]=9,g.set($D(t.value.replace(/\-/g,"")),1),g}}parse(t){const n={};let r=0;for(;r{if(typeof f!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+f);t=f,n=4,r=new Uint8Array(f),new DataView(r.buffer).setUint32(0,f,!1)},l=async function*(){const f=e[Symbol.asyncIterator]();for(;;){const{value:d,done:p}=await f.next();if(p){if(t)if(t===n)yield r;else throw new Error("Truncated event message received.");else return;return}const b=d.length;let g=0;for(;g({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)return;yield r}}finally{t.releaseLock()}}}),oxe=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(n){const{done:r,value:i}=await t.next();if(r)return n.close();n.enqueue(i)}})};class ixe{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:n}){this.universalMarshaller=new sxe({utf8Decoder:n,utf8Encoder:t})}deserialize(t,n){const r=axe(t)?rxe(t):t;return this.universalMarshaller.deserialize(r,n)}serialize(t,n){const r=this.universalMarshaller.serialize(t,n);return typeof ReadableStream=="function"?oxe(r):r}}const axe=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,cxe=e=>new ixe(e);async function lxe(e,t,n=1024*1024){const r=e.size;let i=0;for(;i{r.update(i)}),r.digest()},Vi=64,fxe=16,dxe=[1732584193,4023233417,2562383102,271733878];class pxe{state;buffer;bufferLength;bytesHashed;finished;constructor(){this.reset()}update(t){if(hxe(t))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const n=mxe(t);let r=0,{byteLength:i}=n;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,n[r++]),i--,this.bufferLength===Vi&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:n,bufferLength:r,bytesHashed:i}=this,c=i*8;if(n.setUint8(this.bufferLength++,128),r%Vi>=Vi-8){for(let l=this.bufferLength;l>>0,!0),n.setUint32(Vi-4,Math.floor(c/4294967296),!0),this.hashBuffer(),this.finished=!0}const t=new DataView(new ArrayBuffer(fxe));for(let n=0;n<4;n++)t.setUint32(n*4,this.state[n],!0);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}hashBuffer(){const{buffer:t,state:n}=this;let r=n[0],i=n[1],c=n[2],l=n[3];r=Xn(r,i,c,l,t.getUint32(0,!0),7,3614090360),l=Xn(l,r,i,c,t.getUint32(4,!0),12,3905402710),c=Xn(c,l,r,i,t.getUint32(8,!0),17,606105819),i=Xn(i,c,l,r,t.getUint32(12,!0),22,3250441966),r=Xn(r,i,c,l,t.getUint32(16,!0),7,4118548399),l=Xn(l,r,i,c,t.getUint32(20,!0),12,1200080426),c=Xn(c,l,r,i,t.getUint32(24,!0),17,2821735955),i=Xn(i,c,l,r,t.getUint32(28,!0),22,4249261313),r=Xn(r,i,c,l,t.getUint32(32,!0),7,1770035416),l=Xn(l,r,i,c,t.getUint32(36,!0),12,2336552879),c=Xn(c,l,r,i,t.getUint32(40,!0),17,4294925233),i=Xn(i,c,l,r,t.getUint32(44,!0),22,2304563134),r=Xn(r,i,c,l,t.getUint32(48,!0),7,1804603682),l=Xn(l,r,i,c,t.getUint32(52,!0),12,4254626195),c=Xn(c,l,r,i,t.getUint32(56,!0),17,2792965006),i=Xn(i,c,l,r,t.getUint32(60,!0),22,1236535329),r=Wn(r,i,c,l,t.getUint32(4,!0),5,4129170786),l=Wn(l,r,i,c,t.getUint32(24,!0),9,3225465664),c=Wn(c,l,r,i,t.getUint32(44,!0),14,643717713),i=Wn(i,c,l,r,t.getUint32(0,!0),20,3921069994),r=Wn(r,i,c,l,t.getUint32(20,!0),5,3593408605),l=Wn(l,r,i,c,t.getUint32(40,!0),9,38016083),c=Wn(c,l,r,i,t.getUint32(60,!0),14,3634488961),i=Wn(i,c,l,r,t.getUint32(16,!0),20,3889429448),r=Wn(r,i,c,l,t.getUint32(36,!0),5,568446438),l=Wn(l,r,i,c,t.getUint32(56,!0),9,3275163606),c=Wn(c,l,r,i,t.getUint32(12,!0),14,4107603335),i=Wn(i,c,l,r,t.getUint32(32,!0),20,1163531501),r=Wn(r,i,c,l,t.getUint32(52,!0),5,2850285829),l=Wn(l,r,i,c,t.getUint32(8,!0),9,4243563512),c=Wn(c,l,r,i,t.getUint32(28,!0),14,1735328473),i=Wn(i,c,l,r,t.getUint32(48,!0),20,2368359562),r=Jn(r,i,c,l,t.getUint32(20,!0),4,4294588738),l=Jn(l,r,i,c,t.getUint32(32,!0),11,2272392833),c=Jn(c,l,r,i,t.getUint32(44,!0),16,1839030562),i=Jn(i,c,l,r,t.getUint32(56,!0),23,4259657740),r=Jn(r,i,c,l,t.getUint32(4,!0),4,2763975236),l=Jn(l,r,i,c,t.getUint32(16,!0),11,1272893353),c=Jn(c,l,r,i,t.getUint32(28,!0),16,4139469664),i=Jn(i,c,l,r,t.getUint32(40,!0),23,3200236656),r=Jn(r,i,c,l,t.getUint32(52,!0),4,681279174),l=Jn(l,r,i,c,t.getUint32(0,!0),11,3936430074),c=Jn(c,l,r,i,t.getUint32(12,!0),16,3572445317),i=Jn(i,c,l,r,t.getUint32(24,!0),23,76029189),r=Jn(r,i,c,l,t.getUint32(36,!0),4,3654602809),l=Jn(l,r,i,c,t.getUint32(48,!0),11,3873151461),c=Jn(c,l,r,i,t.getUint32(60,!0),16,530742520),i=Jn(i,c,l,r,t.getUint32(8,!0),23,3299628645),r=es(r,i,c,l,t.getUint32(0,!0),6,4096336452),l=es(l,r,i,c,t.getUint32(28,!0),10,1126891415),c=es(c,l,r,i,t.getUint32(56,!0),15,2878612391),i=es(i,c,l,r,t.getUint32(20,!0),21,4237533241),r=es(r,i,c,l,t.getUint32(48,!0),6,1700485571),l=es(l,r,i,c,t.getUint32(12,!0),10,2399980690),c=es(c,l,r,i,t.getUint32(40,!0),15,4293915773),i=es(i,c,l,r,t.getUint32(4,!0),21,2240044497),r=es(r,i,c,l,t.getUint32(32,!0),6,1873313359),l=es(l,r,i,c,t.getUint32(60,!0),10,4264355552),c=es(c,l,r,i,t.getUint32(24,!0),15,2734768916),i=es(i,c,l,r,t.getUint32(52,!0),21,1309151649),r=es(r,i,c,l,t.getUint32(16,!0),6,4149444226),l=es(l,r,i,c,t.getUint32(44,!0),10,3174756917),c=es(c,l,r,i,t.getUint32(8,!0),15,718787259),i=es(i,c,l,r,t.getUint32(36,!0),21,3951481745),n[0]=r+n[0]&4294967295,n[1]=i+n[1]&4294967295,n[2]=c+n[2]&4294967295,n[3]=l+n[3]&4294967295}reset(){this.state=Uint32Array.from(dxe),this.buffer=new DataView(new ArrayBuffer(Vi)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function vg(e,t,n,r,i,c){return t=(t+e&4294967295)+(r+c&4294967295)&4294967295,(t<>>32-i)+n&4294967295}function Xn(e,t,n,r,i,c,l){return vg(t&n|~t&r,e,t,i,c,l)}function Wn(e,t,n,r,i,c,l){return vg(t&r|n&~r,e,t,i,c,l)}function Jn(e,t,n,r,i,c,l){return vg(t^n^r,e,t,i,c,l)}function es(e,t,n,r,i,c,l){return vg(n^(t|~r),e,t,i,c,l)}function hxe(e){return typeof e=="string"?e.length===0:e.byteLength===0}function mxe(e){return typeof e=="string"?Ho(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}const gxe=e=>({apiVersion:"2006-03-01",base64Decoder:e?.base64Decoder??cc,base64Encoder:e?.base64Encoder??ea,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Iz,extensions:e?.extensions??[],getAwsChunkedEncodingStream:e?.getAwsChunkedEncodingStream??uQ,httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Ave,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new PS},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new HY}],logger:e?.logger??new NS,protocol:e?.protocol??PX,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:Hwe,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:e?.sdkStreamMixin??UD,serviceId:e?.serviceId??"S3",signerConstructor:e?.signerConstructor??dz,signingEscapePath:e?.signingEscapePath??!1,urlParser:e?.urlParser??jf,useArnRegion:e?.useArnRegion??void 0,utf8Decoder:e?.utf8Decoder??Ho,utf8Encoder:e?.utf8Encoder??pc}),yxe=e=>{const t=Xk(e),n=()=>t().then(_k),r=gxe(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??vk,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Qk({serviceId:r.serviceId,clientVersion:PEe.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??cxe,maxAttempts:e?.maxAttempts??Hf,md5:e?.md5??pxe,region:e?.region??Yk("Region is missing"),requestHandler:Bm.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||zk),sha1:e?.sha1??zEe,sha256:e?.sha256??Kk,streamCollector:e?.streamCollector??RS,streamHasher:e?.streamHasher??uxe,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Tk)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Ik))}},bxe=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(i){const c=t.findIndex(l=>l.schemeId===i.schemeId);c===-1?t.push(i):t.splice(c,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},vxe=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Sxe=(e,t)=>{const n=Object.assign(nz(e),wk(e),ID(e),bxe(e));return t.forEach(r=>r.configure(n)),Object.assign(e,sz(n),Ek(n),OD(n),vxe(n))};class _xe extends Sk{config;constructor(...[t]){const n=yxe(t||{});super(n),this.initConfig=n;const r=Ive(n),i=XD(r),c=Dbe(i),l=jk(c),f=Mk(l),d=f,p=Lk(d),b=cve(p),g=Tve(b),v=Ybe(g,{session:[()=>this,DEe]}),S=Sxe(v,t?.extensions||[]);this.config=S,this.middlewareStack.use(HD(this.config)),this.middlewareStack.use(Ak(this.config)),this.middlewareStack.use(Hk(this.config)),this.middlewareStack.use(Dk(this.config)),this.middlewareStack.use(MD(this.config)),this.middlewareStack.use(DD(this.config)),this.middlewareStack.use(kD(this.config)),this.middlewareStack.use(PD(this.config,{httpAuthSchemeParametersProvider:xve,identityProviderConfigProvider:async w=>new QD({"aws.auth#sigv4":w.credentials,"aws.auth#sigv4a":w.credentials})})),this.middlewareStack.use(LD(this.config)),this.middlewareStack.use(ave(this.config)),this.middlewareStack.use(Abe(this.config)),this.middlewareStack.use(zbe(this.config)),this.middlewareStack.use(Fbe(this.config)),this.middlewareStack.use(Qbe(this.config))}destroy(){super.destroy()}}class wxe extends Cs.classBuilder().ep(dw).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions()),rw(r)]}).s("AmazonS3","ListBuckets",{}).n("S3Client","ListBucketsCommand").sc(OEe).build(){}class Exe extends Cs.classBuilder().ep({...dw,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions()),rw(r)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(MEe).build(){}let Rh=null,bf=null;function qn(){if(!Rh){const e=zm();if(!e)throw new Error("AWS credentials not configured");Rh=new _be({endpoint:"https://localhost:9999",region:"ap-southeast-2",credentials:{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey}})}return Rh}function o4(){if(!bf){const e=zm();if(!e)throw new Error("AWS credentials not configured");bf=new _xe({endpoint:"https://localhost:8443",region:"ap-southeast-2",credentials:{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey},forcePathStyle:!0}),bf.middlewareStack.use({applyToStack:t=>{t.add(n=>r=>{const i=r.request;return i?.path?.endsWith("/")&&i.path!=="/"&&(i.path=i.path.slice(0,-1)),n(r)},{step:"build",name:"removeTrailingSlash"})}})}return bf}function xxe(){Rh=null,bf=null}function i4(){const e=kt.c(82);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:Rxe},e[0]=t):t=e[0];const n=f5(t),r=vm(),i=B2();let c;e[1]!==r||e[2]!==i?(c=function(){GK(),xxe(),i.clear(),r({to:"/login"})},e[1]=r,e[2]=i,e[3]=c):c=e[3];const l=c;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=N.jsx(rh,{children:"General"}),e[4]=f):f=e[4];const d=n==="/";let p,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=N.jsx(i8,{className:"size-4"}),b=N.jsx("span",{children:"Dashboard"}),e[5]=p,e[6]=b):(p=e[5],b=e[6]);let g;e[7]!==d?(g=N.jsxs(sh,{children:[f,N.jsx(uf,{children:N.jsx(Hr,{children:N.jsx($s,{to:"/",children:N.jsxs(Vr,{isActive:d,tooltip:"Dashboard",children:[p,b]})})})})]}),e[7]=d,e[8]=g):g=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=N.jsx(rh,{children:"EC2"}),e[9]=v):v=e[9];let S;e[10]!==n?(S=n.startsWith("/ec2/describe-instances")||n.startsWith("/ec2/run-instances"),e[10]=n,e[11]=S):S=e[11];let w,E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=N.jsx(lA,{className:"size-4"}),w=N.jsx("span",{children:"Instances"}),e[12]=w,e[13]=E):(w=e[12],E=e[13]);let R;e[14]!==S?(R=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-instances",children:N.jsxs(Vr,{isActive:S,tooltip:"EC2 Instances",children:[E,w]})})}),e[14]=S,e[15]=R):R=e[15];let C;e[16]!==n?(C=n.startsWith("/ec2/describe-images"),e[16]=n,e[17]=C):C=e[17];let O,k;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=N.jsx(c8,{className:"size-4"}),k=N.jsx("span",{children:"Images"}),e[18]=O,e[19]=k):(O=e[18],k=e[19]);let T;e[20]!==C?(T=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-images",children:N.jsxs(Vr,{isActive:C,tooltip:"Images",children:[O,k]})})}),e[20]=C,e[21]=T):T=e[21];let $;e[22]!==n?($=n.startsWith("/ec2/describe-key-pairs"),e[22]=n,e[23]=$):$=e[23];let j,H;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=N.jsx(u8,{className:"size-4"}),H=N.jsx("span",{children:"Key Pairs"}),e[24]=j,e[25]=H):(j=e[24],H=e[25]);let P;e[26]!==$?(P=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-key-pairs",children:N.jsxs(Vr,{isActive:$,tooltip:"Key Pairs",children:[j,H]})})}),e[26]=$,e[27]=P):P=e[27];let Y;e[28]!==n?(Y=n.startsWith("/ec2/describe-volumes")||n.startsWith("/ec2/create-volume")||n.startsWith("/ec2/modify-volume"),e[28]=n,e[29]=Y):Y=e[29];let ne,re;e[30]===Symbol.for("react.memo_cache_sentinel")?(ne=N.jsx(r8,{className:"size-4"}),re=N.jsx("span",{children:"Volumes"}),e[30]=ne,e[31]=re):(ne=e[30],re=e[31]);let G;e[32]!==Y?(G=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-volumes",children:N.jsxs(Vr,{isActive:Y,tooltip:"Volumes",children:[ne,re]})})}),e[32]=Y,e[33]=G):G=e[33];let te;e[34]!==n?(te=n.startsWith("/ec2/describe-snapshots")||n.startsWith("/ec2/create-snapshot"),e[34]=n,e[35]=te):te=e[35];let ue,ye;e[36]===Symbol.for("react.memo_cache_sentinel")?(ue=N.jsx(e8,{className:"size-4"}),ye=N.jsx("span",{children:"Snapshots"}),e[36]=ue,e[37]=ye):(ue=e[36],ye=e[37]);let V;e[38]!==te?(V=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-snapshots",children:N.jsxs(Vr,{isActive:te,tooltip:"Snapshots",children:[ue,ye]})})}),e[38]=te,e[39]=V):V=e[39];let oe;e[40]!==R||e[41]!==T||e[42]!==P||e[43]!==G||e[44]!==V?(oe=N.jsxs(sh,{children:[v,N.jsxs(uf,{children:[R,T,P,G,V]})]}),e[40]=R,e[41]=T,e[42]=P,e[43]=G,e[44]=V,e[45]=oe):oe=e[45];let J;e[46]===Symbol.for("react.memo_cache_sentinel")?(J=N.jsx(rh,{children:"Networking"}),e[46]=J):J=e[46];let ve;e[47]!==n?(ve=n.startsWith("/ec2/describe-vpcs")||n.startsWith("/ec2/create-vpc"),e[47]=n,e[48]=ve):ve=e[48];let fe,B;e[49]===Symbol.for("react.memo_cache_sentinel")?(fe=N.jsx(b8,{className:"size-4"}),B=N.jsx("span",{children:"VPCs"}),e[49]=fe,e[50]=B):(fe=e[49],B=e[50]);let ee;e[51]!==ve?(ee=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-vpcs",children:N.jsxs(Vr,{isActive:ve,tooltip:"VPCs",children:[fe,B]})})}),e[51]=ve,e[52]=ee):ee=e[52];let ge;e[53]!==n?(ge=n.startsWith("/ec2/describe-subnets")||n.startsWith("/ec2/create-subnet"),e[53]=n,e[54]=ge):ge=e[54];let be,xe;e[55]===Symbol.for("react.memo_cache_sentinel")?(be=N.jsx(d8,{className:"size-4"}),xe=N.jsx("span",{children:"Subnets"}),e[55]=be,e[56]=xe):(be=e[55],xe=e[56]);let _e;e[57]!==ge?(_e=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-subnets",children:N.jsxs(Vr,{isActive:ge,tooltip:"Subnets",children:[be,xe]})})}),e[57]=ge,e[58]=_e):_e=e[58];let Te;e[59]!==ee||e[60]!==_e?(Te=N.jsxs(sh,{children:[J,N.jsxs(uf,{children:[ee,_e]})]}),e[59]=ee,e[60]=_e,e[61]=Te):Te=e[61];let Fe;e[62]===Symbol.for("react.memo_cache_sentinel")?(Fe=N.jsx(rh,{children:"S3"}),e[62]=Fe):Fe=e[62];let Se;e[63]!==n?(Se=n.startsWith("/s3/ls"),e[63]=n,e[64]=Se):Se=e[64];let Xe,_t;e[65]===Symbol.for("react.memo_cache_sentinel")?(Xe=N.jsx(lA,{className:"size-4"}),_t=N.jsx("span",{children:"Buckets"}),e[65]=Xe,e[66]=_t):(Xe=e[65],_t=e[66]);let me;e[67]!==Se?(me=N.jsxs(sh,{children:[Fe,N.jsx(uf,{children:N.jsx(Hr,{children:N.jsx($s,{to:"/s3/ls",children:N.jsxs(Vr,{isActive:Se,tooltip:"Buckets",children:[Xe,_t]})})})})]}),e[67]=Se,e[68]=me):me=e[68];let Ee;e[69]!==oe||e[70]!==Te||e[71]!==me||e[72]!==g?(Ee=N.jsxs(aF,{children:[g,oe,Te,me]}),e[69]=oe,e[70]=Te,e[71]=me,e[72]=g,e[73]=Ee):Ee=e[73];let we,qe;e[74]===Symbol.for("react.memo_cache_sentinel")?(we=N.jsx(h8,{className:"size-4"}),qe=N.jsx("span",{children:"Sign out"}),e[74]=we,e[75]=qe):(we=e[74],qe=e[75]);let Oe;e[76]!==l?(Oe=N.jsx(iF,{children:N.jsx(uf,{children:N.jsx(Hr,{children:N.jsxs(Vr,{onClick:l,tooltip:"Sign out",children:[we,qe]})})})}),e[76]=l,e[77]=Oe):Oe=e[77];let je;e[78]===Symbol.for("react.memo_cache_sentinel")?(je=N.jsx(oF,{}),e[78]=je):je=e[78];let De;return e[79]!==Ee||e[80]!==Oe?(De=N.jsxs(sF,{collapsible:"icon",children:[Ee,Oe,je]}),e[79]=Ee,e[80]=Oe,e[81]=De):De=e[81],De}function Rxe(e){return e.pathname}function Cxe(e){const t=kt.c(18),{error:n,reset:r}=e,i=ns(),c=B2();let l;t[0]!==c||t[1]!==r||t[2]!==i?(l=function(){c.invalidateQueries(),r(),i.invalidate()},t[0]=c,t[1]=r,t[2]=i,t[3]=l):l=t[3];const f=l;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=N.jsx(i4,{}),t[4]=d):d=t[4];let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=N.jsx(JM,{}),t[5]=p):p=t[5];let b,g;t[6]===Symbol.for("react.memo_cache_sentinel")?(b=N.jsx("div",{className:"flex justify-center",children:N.jsx(n8,{className:"size-12 text-destructive"})}),g=N.jsx("h1",{className:"font-semibold text-2xl",children:"Something went wrong"}),t[6]=b,t[7]=g):(b=t[6],g=t[7]);const v=n.message||"An unexpected error occurred";let S;t[8]!==v?(S=N.jsx("p",{className:"text-muted-foreground",children:v}),t[8]=v,t[9]=S):S=t[9];let w;t[10]!==f?(w=N.jsx(Tl,{onClick:f,variant:"default",children:"Try Again"}),t[10]=f,t[11]=w):w=t[11];let E;t[12]===Symbol.for("react.memo_cache_sentinel")?(E=N.jsx($s,{to:"/",children:N.jsx(Tl,{variant:"outline",children:"Go Home"})}),t[12]=E):E=t[12];let R;t[13]!==w?(R=N.jsxs("div",{className:"flex justify-center gap-2",children:[w,E]}),t[13]=w,t[14]=R):R=t[14];let C;return t[15]!==R||t[16]!==S?(C=N.jsxs(N.Fragment,{children:[d,N.jsxs("main",{className:"flex flex-1 flex-col",children:[p,N.jsx("div",{className:"flex flex-1 items-center justify-center p-6 pt-0",children:N.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[b,g,S,R]})})]})]}),t[15]=R,t[16]=S,t[17]=C):C=t[17],C}const wE=XU()({head:()=>({meta:[{title:"Mulga"}]}),component:()=>N.jsxs(N.Fragment,{children:[N.jsx(g5,{}),N.jsx(i4,{}),N.jsxs("main",{className:"flex flex-1 flex-col",children:[N.jsx(JM,{}),N.jsx("div",{className:"flex flex-1 flex-col p-8",children:N.jsx(lO,{})})]})]}),errorComponent:Cxe,notFoundComponent:uF}),Axe=()=>xt(()=>import("./login.js"),__vite__mapDeps([0,1,2,3])),Txe=St("/login")({beforeLoad:()=>{if(zm())throw Fv({to:"/"})},component:At(Axe,"component")}),Ixe=()=>xt(()=>import("./route.js"),[]),Oxe=St("/_auth")({beforeLoad:()=>{if(!zm())throw Fv({to:"/login"})},component:At(Ixe,"component")}),a4={queryKey:["ec2","availabilityZones"],queryFn:()=>{const e=new wbe({});return qn().send(e)},staleTime:3e5},c4={queryKey:["ec2","instances"],queryFn:()=>{const e=new oz({});return qn().send(e)},refetchInterval:5e3},Mxe=e=>({queryKey:["ec2","instances",e],queryFn:()=>{const t=new oz({InstanceIds:[e]});return qn().send(t)},refetchInterval:5e3}),l4={queryKey:["ec2","instances","types"],queryFn:()=>{const e=new Ebe({Filters:[{Name:"capacity",Values:["true"]}]});return qn().send(e)},refetchInterval:5e3},u4={queryKey:["ec2","images"],queryFn:()=>{const e=new rz({});return qn().send(e)}},f4=e=>({queryKey:["ec2","images",e??"none"],queryFn:()=>{if(!e)return{Images:[],$metadata:{}};const t=new rz({ImageIds:[e]});return qn().send(t)}}),d4={queryKey:["ec2","keypairs"],queryFn:()=>{const e=new iz({});return qn().send(e)}},Dxe=e=>({queryKey:["ec2","keypairs",e],queryFn:()=>{const t=new iz({KeyPairIds:[e]});return qn().send(t)}}),p4={queryKey:["ec2","regions"],queryFn:()=>{const e=new xbe({});return qn().send(e)},staleTime:3e5},EE={queryKey:["ec2","subnets"],queryFn:()=>{const e=new cz({});return qn().send(e)}},kxe=e=>({queryKey:["ec2","subnets",e],queryFn:()=>{const t=new cz({SubnetIds:[e]});return qn().send(t)}}),Pxe={queryKey:["ec2","snapshots"],queryFn:()=>{const e=new az({});return qn().send(e)},refetchInterval:5e3},Nxe=e=>({queryKey:["ec2","snapshots",e],queryFn:()=>{const t=new az({SnapshotIds:[e]});return qn().send(t)},refetchInterval:5e3}),h4={queryKey:["ec2","vpcs"],queryFn:()=>{const e=new uz({});return qn().send(e)}},Lxe=e=>({queryKey:["ec2","vpcs",e],queryFn:()=>{const t=new uz({VpcIds:[e]});return qn().send(t)}}),m4={queryKey:["ec2","volumes"],queryFn:()=>{const e=new lz({});return qn().send(e)},refetchInterval:5e3},g4=e=>({queryKey:["ec2","volumes",e],queryFn:()=>{const t=new lz({VolumeIds:[e]});return qn().send(t)},refetchInterval:5e3}),zxe=()=>xt(()=>import("./index3.js"),__vite__mapDeps([4,5,6])),Bxe=St("/_auth/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(p4)},head:()=>({meta:[{title:"Dashboard | Mulga"}]}),component:At(zxe,"component")}),$xe={queryKey:["s3","buckets"],queryFn:async()=>{try{const e=new wxe({});return await o4().send(e)}catch{throw new Error("Failed to fetch S3 buckets")}}},y4=(e,t)=>({queryKey:["s3","buckets",e,"objects",t??""],queryFn:async()=>{try{const n=new Exe({Bucket:e,Prefix:t,Delimiter:"/"});return await o4().send(n)}catch{throw new Error("Failed to fetch S3 bucket objects")}}}),Uxe=()=>xt(()=>import("./index4.js"),__vite__mapDeps([7,5,8,6])),jxe=St("/_auth/s3/ls/")({head:()=>({meta:[{title:"Buckets | S3 | Mulga"}]}),loader:async({context:e})=>{await e.queryClient.ensureQueryData($xe)},component:At(Uxe,"component")}),Hxe=()=>xt(()=>import("./create-bucket.js"),__vite__mapDeps([9,1,10,11,6,2,3,12])),Vxe=St("/_auth/s3/(buckets)/create-bucket")({head:()=>({meta:[{title:"Create Bucket | S3 | Mulga"}]}),component:At(Hxe,"component")}),Fxe=()=>xt(()=>import("./create-vpc.js"),__vite__mapDeps([13,1,10,11,6,2,3,14,15])),qxe=St("/_auth/ec2/(vpc)/create-vpc")({head:()=>({meta:[{title:"Create VPC | EC2 | Mulga"}]}),component:At(Fxe,"component")}),Gxe=()=>xt(()=>import("./create-volume.js"),__vite__mapDeps([16,1,5,10,11,6,2,3,17,18,14,15])),Zxe=St("/_auth/ec2/(volumes)/create-volume")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(a4)},head:()=>({meta:[{title:"Create Volume | EC2 | Mulga"}]}),component:At(Gxe,"component")}),Kxe=()=>xt(()=>import("./create-subnet.js"),__vite__mapDeps([19,1,5,10,11,6,2,3,17,18,14,15])),Qxe=St("/_auth/ec2/(subnet)/create-subnet")({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(h4),e.queryClient.ensureQueryData(a4)])},head:()=>({meta:[{title:"Create Subnet | EC2 | Mulga"}]}),component:At(Kxe,"component")}),Yxe=()=>xt(()=>import("./create-snapshot.js"),__vite__mapDeps([20,1,5,10,11,6,2,17,18,21,14,15])),Xxe=St("/_auth/ec2/(snapshots)/create-snapshot")({validateSearch:e=>({volumeId:typeof e.volumeId=="string"?e.volumeId:void 0}),loader:async({context:e})=>{await e.queryClient.ensureQueryData(m4)},head:()=>({meta:[{title:"Create Snapshot | EC2 | Mulga"}]}),component:At(Yxe,"component")}),Wxe=()=>xt(()=>import("./import-key-pair.js"),__vite__mapDeps([22,1,10,11,6,2,3,21,14,15])),Jxe=St("/_auth/ec2/(key)/import-key-pair")({head:()=>({meta:[{title:"Import Key Pair | EC2 | Mulga"}]}),component:At(Wxe,"component")}),e1e=()=>xt(()=>import("./create-key-pair.js"),__vite__mapDeps([23,1,10,11,6,2,3,14,15,24,21,18,25])),t1e=St("/_auth/ec2/(key)/create-key-pair")({head:()=>({meta:[{title:"Create Key Pair | EC2 | Mulga"}]}),component:At(e1e,"component")}),n1e=()=>xt(()=>import("./run-instances.js"),__vite__mapDeps([26,1,5,10,11,6,2,3,17,18,14,15])),s1e=St("/_auth/ec2/(instances)/run-instances")({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(u4),e.queryClient.ensureQueryData(d4),e.queryClient.ensureQueryData(l4),e.queryClient.ensureQueryData(EE)])},head:()=>({meta:[{title:"Run Instances | EC2 | Mulga"}]}),component:At(n1e,"component")}),r1e=()=>xt(()=>import("./route2.js"),[]),o1e=St("/_auth/s3/ls/$bucket")({component:At(r1e,"component")}),i1e=()=>xt(()=>import("./index5.js"),__vite__mapDeps([27,5,10,11,6,12,28,24,25,29])),a1e=St("/_auth/s3/ls/$bucket/")({loader:async({context:e,params:t})=>{await e.queryClient.ensureQueryData(y4(t.bucket))},head:({params:e})=>({meta:[{title:`${e.bucket} | S3 | Mulga`}]}),component:At(i1e,"component")}),c1e=()=>xt(()=>import("./index6.js"),__vite__mapDeps([30,5,8,6,31])),l1e=St("/_auth/ec2/(vpc)/describe-vpcs/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(h4)},head:()=>({meta:[{title:"VPCs | EC2 | Mulga"}]}),component:At(c1e,"component")}),u1e=()=>xt(()=>import("./index7.js"),__vite__mapDeps([32,5,8,6,31])),f1e=St("/_auth/ec2/(volumes)/describe-volumes/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(m4)},head:()=>({meta:[{title:"Volumes | EC2 | Mulga"}]}),component:At(u1e,"component")}),d1e=()=>xt(()=>import("./index8.js"),__vite__mapDeps([33,5,8,6,31])),p1e=St("/_auth/ec2/(subnet)/describe-subnets/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(EE)},head:()=>({meta:[{title:"Subnets | EC2 | Mulga"}]}),component:At(d1e,"component")}),h1e=()=>xt(()=>import("./index9.js"),__vite__mapDeps([34,5,8,6,31])),m1e=St("/_auth/ec2/(snapshots)/describe-snapshots/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Pxe)},head:()=>({meta:[{title:"Snapshots | EC2 | Mulga"}]}),component:At(h1e,"component")}),g1e=()=>xt(()=>import("./index10.js"),__vite__mapDeps([35,5,8,6])),y1e=St("/_auth/ec2/(key)/describe-key-pairs/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(d4)},head:()=>({meta:[{title:"Key Pairs | EC2 | Mulga"}]}),component:At(g1e,"component")}),b1e=()=>xt(()=>import("./index11.js"),__vite__mapDeps([36,5,8,6,31])),v1e=St("/_auth/ec2/(instances)/describe-instances/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(c4)},head:()=>({meta:[{title:"Instances | EC2 | Mulga"}]}),component:At(b1e,"component")}),S1e=()=>xt(()=>import("./index12.js"),__vite__mapDeps([37,5,8,6,31])),_1e=St("/_auth/ec2/(images)/describe-images/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(u4)},head:()=>({meta:[{title:"Images | EC2 | Mulga"}]}),component:At(S1e,"component")}),w1e=()=>xt(()=>import("./_.js"),__vite__mapDeps([38,5,10,11,12,28,24,25,29])),E1e=St("/_auth/s3/ls/$bucket/$")({loader:async({context:e,params:t})=>{const n=Nj(t._splat||"");await e.queryClient.ensureQueryData(y4(t.bucket,n))},head:({params:e})=>({meta:[{title:`${Lj(e._splat||"",`${e.bucket}/`)} | S3 | Mulga`}]}),component:At(w1e,"component")}),x1e=()=>xt(()=>import("./_id.js"),__vite__mapDeps([39,5,10,40,11,6,31,24,14,29])),R1e=St("/_auth/ec2/(vpc)/describe-vpcs/$id")({loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.ensureQueryData(Lxe(t.id)),e.queryClient.ensureQueryData(EE)])},head:({params:e})=>({meta:[{title:`${e.id} | VPC | Mulga`}]}),component:At(x1e,"component")}),C1e=()=>xt(()=>import("./_id2.js"),__vite__mapDeps([41,1,5,10,11,6,2,3,14,15])),A1e=St("/_auth/ec2/(volumes)/modify-volume/$id")({loader:async({context:e,params:t})=>{await e.queryClient.ensureQueryData(g4(t.id))},head:({params:e})=>({meta:[{title:`Resize ${e.id} | EC2 | Mulga`}]}),component:At(C1e,"component")}),T1e=()=>xt(()=>import("./_id3.js"),__vite__mapDeps([42,5,10,40,11,6,31,24,2,3,17,18,14,29])),I1e=St("/_auth/ec2/(volumes)/describe-volumes/$id")({loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.ensureQueryData(g4(t.id)),e.queryClient.ensureQueryData(c4)])},head:({params:e})=>({meta:[{title:`${e.id} | EC2 | Mulga`}]}),component:At(T1e,"component")}),O1e=()=>xt(()=>import("./_id4.js"),__vite__mapDeps([43,5,10,40,11,6,31,24,14,29])),M1e=St("/_auth/ec2/(subnet)/describe-subnets/$id")({loader:async({context:e,params:t})=>{await e.queryClient.ensureQueryData(kxe(t.id))},head:({params:e})=>({meta:[{title:`${e.id} | Subnet | Mulga`}]}),component:At(O1e,"component")}),D1e=()=>xt(()=>import("./_id5.js"),__vite__mapDeps([44,5,10,40,11,6,31,24,2,3,14,29])),k1e=St("/_auth/ec2/(snapshots)/describe-snapshots/$id")({loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.ensureQueryData(Nxe(t.id)),e.queryClient.ensureQueryData(p4)])},head:({params:e})=>({meta:[{title:`${e.id} | EC2 | Mulga`}]}),component:At(D1e,"component")}),P1e=()=>xt(()=>import("./_id6.js"),__vite__mapDeps([45,5,10,40,11,6,24,14,29])),N1e=St("/_auth/ec2/(key)/describe-key-pairs/$id")({loader:async({context:e,params:t})=>await e.queryClient.ensureQueryData(Dxe(t.id)),head:({loaderData:e})=>({meta:[{title:`${e?.KeyPairs?.[0]?.KeyName??"Key Pair"} | EC2 | Mulga`}]}),component:At(P1e,"component")}),L1e=()=>xt(()=>import("./_id7.js"),__vite__mapDeps([46,5,10,40,11,6,31,24,2,17,18,14,47,3,21,29])),z1e=St("/_auth/ec2/(instances)/describe-instances/$id")({loader:async({context:e,params:t})=>{const n=await e.queryClient.ensureQueryData(Mxe(t.id)),r=n.Reservations?.[0]?.Instances?.[0]?.ImageId;return await Promise.all([e.queryClient.ensureQueryData(f4(r)),e.queryClient.ensureQueryData(l4)]),n},head:({loaderData:e})=>({meta:[{title:`${e?.Reservations?.[0]?.Instances?.[0]?.InstanceId??"Instance"} | EC2 | Mulga`}]}),component:At(L1e,"component")}),B1e=()=>xt(()=>import("./_id8.js"),__vite__mapDeps([48,5,10,6,31,47,40])),$1e=St("/_auth/ec2/(images)/describe-images/$id")({loader:async({context:e,params:t})=>await e.queryClient.ensureQueryData(f4(t.id)),head:({loaderData:e})=>({meta:[{title:`${e?.Images?.[0]?.Name??"Image"} | EC2 | Mulga`}]}),component:At(B1e,"component")}),U1e=Txe.update({id:"/login",path:"/login",getParentRoute:()=>wE}),Ht=Oxe.update({id:"/_auth",getParentRoute:()=>wE}),j1e=Bxe.update({id:"/",path:"/",getParentRoute:()=>Ht}),H1e=jxe.update({id:"/s3/ls/",path:"/s3/ls/",getParentRoute:()=>Ht}),V1e=Vxe.update({id:"/s3/(buckets)/create-bucket",path:"/s3/create-bucket",getParentRoute:()=>Ht}),F1e=qxe.update({id:"/ec2/(vpc)/create-vpc",path:"/ec2/create-vpc",getParentRoute:()=>Ht}),q1e=Zxe.update({id:"/ec2/(volumes)/create-volume",path:"/ec2/create-volume",getParentRoute:()=>Ht}),G1e=Qxe.update({id:"/ec2/(subnet)/create-subnet",path:"/ec2/create-subnet",getParentRoute:()=>Ht}),Z1e=Xxe.update({id:"/ec2/(snapshots)/create-snapshot",path:"/ec2/create-snapshot",getParentRoute:()=>Ht}),K1e=Jxe.update({id:"/ec2/(key)/import-key-pair",path:"/ec2/import-key-pair",getParentRoute:()=>Ht}),Q1e=t1e.update({id:"/ec2/(key)/create-key-pair",path:"/ec2/create-key-pair",getParentRoute:()=>Ht}),Y1e=s1e.update({id:"/ec2/(instances)/run-instances",path:"/ec2/run-instances",getParentRoute:()=>Ht}),xE=o1e.update({id:"/s3/ls/$bucket",path:"/s3/ls/$bucket",getParentRoute:()=>Ht}),X1e=a1e.update({id:"/",path:"/",getParentRoute:()=>xE}),W1e=l1e.update({id:"/ec2/(vpc)/describe-vpcs/",path:"/ec2/describe-vpcs/",getParentRoute:()=>Ht}),J1e=f1e.update({id:"/ec2/(volumes)/describe-volumes/",path:"/ec2/describe-volumes/",getParentRoute:()=>Ht}),eRe=p1e.update({id:"/ec2/(subnet)/describe-subnets/",path:"/ec2/describe-subnets/",getParentRoute:()=>Ht}),tRe=m1e.update({id:"/ec2/(snapshots)/describe-snapshots/",path:"/ec2/describe-snapshots/",getParentRoute:()=>Ht}),nRe=y1e.update({id:"/ec2/(key)/describe-key-pairs/",path:"/ec2/describe-key-pairs/",getParentRoute:()=>Ht}),sRe=v1e.update({id:"/ec2/(instances)/describe-instances/",path:"/ec2/describe-instances/",getParentRoute:()=>Ht}),rRe=_1e.update({id:"/ec2/(images)/describe-images/",path:"/ec2/describe-images/",getParentRoute:()=>Ht}),oRe=E1e.update({id:"/$",path:"/$",getParentRoute:()=>xE}),iRe=R1e.update({id:"/ec2/(vpc)/describe-vpcs/$id",path:"/ec2/describe-vpcs/$id",getParentRoute:()=>Ht}),aRe=A1e.update({id:"/ec2/(volumes)/modify-volume/$id",path:"/ec2/modify-volume/$id",getParentRoute:()=>Ht}),cRe=I1e.update({id:"/ec2/(volumes)/describe-volumes/$id",path:"/ec2/describe-volumes/$id",getParentRoute:()=>Ht}),lRe=M1e.update({id:"/ec2/(subnet)/describe-subnets/$id",path:"/ec2/describe-subnets/$id",getParentRoute:()=>Ht}),uRe=k1e.update({id:"/ec2/(snapshots)/describe-snapshots/$id",path:"/ec2/describe-snapshots/$id",getParentRoute:()=>Ht}),fRe=N1e.update({id:"/ec2/(key)/describe-key-pairs/$id",path:"/ec2/describe-key-pairs/$id",getParentRoute:()=>Ht}),dRe=z1e.update({id:"/ec2/(instances)/describe-instances/$id",path:"/ec2/describe-instances/$id",getParentRoute:()=>Ht}),pRe=$1e.update({id:"/ec2/(images)/describe-images/$id",path:"/ec2/describe-images/$id",getParentRoute:()=>Ht}),hRe={AuthS3LsBucketSplatRoute:oRe,AuthS3LsBucketIndexRoute:X1e},mRe=xE._addFileChildren(hRe),gRe={AuthIndexRoute:j1e,AuthS3LsBucketRouteRoute:mRe,AuthEc2instancesRunInstancesRoute:Y1e,AuthEc2keyCreateKeyPairRoute:Q1e,AuthEc2keyImportKeyPairRoute:K1e,AuthEc2snapshotsCreateSnapshotRoute:Z1e,AuthEc2subnetCreateSubnetRoute:G1e,AuthEc2volumesCreateVolumeRoute:q1e,AuthEc2vpcCreateVpcRoute:F1e,AuthS3bucketsCreateBucketRoute:V1e,AuthS3LsIndexRoute:H1e,AuthEc2imagesDescribeImagesIdRoute:pRe,AuthEc2instancesDescribeInstancesIdRoute:dRe,AuthEc2keyDescribeKeyPairsIdRoute:fRe,AuthEc2snapshotsDescribeSnapshotsIdRoute:uRe,AuthEc2subnetDescribeSubnetsIdRoute:lRe,AuthEc2volumesDescribeVolumesIdRoute:cRe,AuthEc2volumesModifyVolumeIdRoute:aRe,AuthEc2vpcDescribeVpcsIdRoute:iRe,AuthEc2imagesDescribeImagesIndexRoute:rRe,AuthEc2instancesDescribeInstancesIndexRoute:sRe,AuthEc2keyDescribeKeyPairsIndexRoute:nRe,AuthEc2snapshotsDescribeSnapshotsIndexRoute:tRe,AuthEc2subnetDescribeSubnetsIndexRoute:eRe,AuthEc2volumesDescribeVolumesIndexRoute:J1e,AuthEc2vpcDescribeVpcsIndexRoute:W1e},yRe=Ht._addFileChildren(gRe),bRe={AuthRouteRoute:yRe,LoginRoute:U1e},vRe=wE._addFileChildren(bRe)._addFileTypes(),b4=new o6({defaultOptions:{queries:{staleTime:5e3}}}),SRe=a5({routeTree:vRe,context:{queryClient:b4},defaultPreload:"intent",scrollRestoration:!0,defaultStructuralSharing:!0,defaultPreloadStaleTime:0}),Zb=document.getElementById("app");Zb&&!Zb.innerHTML&&w5.createRoot(Zb).render(N.jsx(M.StrictMode,{children:N.jsx(C5,{defaultTheme:"system",storageKey:"hive-ui-theme",children:N.jsx(a6,{client:b4,children:N.jsx(eF,{children:N.jsx(u5,{router:SRe})})})})}));export{ECe as $,NRe as A,Tl as B,Lj as C,XRe as D,Cs as E,dw as F,Ks as G,ac as H,ICe as I,kRe as J,o4 as K,$s as L,gT as M,ea as N,lO as O,Ov as P,wCe as Q,Xxe as R,fz as S,aX as T,om as U,lc as V,Gk as W,LW as X,jW as Y,zW as Z,qk as _,cn as a,bA as a$,$f as a0,kn as a1,Pr as a2,_Ce as a3,NS as a4,rw as a5,xCe as a6,RCe as a7,CCe as a8,ACe as a9,kxe as aA,k1e as aB,Nxe as aC,N1e as aD,Dxe as aE,z1e as aF,Mxe as aG,f4 as aH,BRe as aI,Gj as aJ,$Re as aK,LRe as aL,zRe as aM,Qp as aN,qh as aO,sM as aP,Il as aQ,Pf as aR,Yj as aS,Jt as aT,oS as aU,Hs as aV,uv as aW,Qr as aX,Cm as aY,Yf as aZ,ht as a_,TCe as aa,OCe as ab,MCe as ac,DCe as ad,wRe as ae,_Re as af,Pk as ag,eW as ah,tm as ai,B2 as aj,R1e as ak,Lxe as al,A1e as am,g4 as an,KRe as ao,uT as ap,QRe as aq,Rl as ar,GRe as as,ZRe as at,aD as au,I1e as av,zj as aw,e8 as ax,DRe as ay,M1e as az,qK as b,KV as b$,Ge as b0,eb as b1,Do as b2,Kt as b3,gt as b4,jRe as b5,yn as b6,Ss as b7,oM as b8,Kj as b9,MRe as bA,t7 as bB,P7 as bC,ZV as bD,GV as bE,Qf as bF,YM as bG,Sn as bH,$O as bI,na as bJ,nH as bK,VRe as bL,lS as bM,VV as bN,URe as bO,mO as bP,sS as bQ,Et as bR,vO as bS,fc as bT,i7 as bU,r7 as bV,aM as bW,qV as bX,l7 as bY,U9 as bZ,$9 as b_,Qj as ba,Fo as bb,it as bc,ORe as bd,T9 as be,s7 as bf,vr as bg,bV as bh,TM as bi,rM as bj,uS as bk,EV as bl,EM as bm,NM as bn,Sm as bo,VM as bp,Nh as bq,qRe as br,uM as bs,fS as bt,wO as bu,Sr as bv,FRe as bw,HRe as bx,L9 as by,X9 as bz,kt as c,B9 as c0,to as c1,WRe as c2,pQ as c3,Rv as c4,JRe as c5,eCe as c6,tCe as c7,nCe as c8,sCe as c9,Z$ as cA,$$ as cB,Qb as cC,hm as cD,z$ as cE,B$ as cF,Kb as cG,k2 as cH,J$ as cI,H$ as cJ,pc as cK,Ho as cL,rCe as ca,oCe as cb,iCe as cc,aCe as cd,cCe as ce,lCe as cf,uCe as cg,fCe as ch,dCe as ci,pCe as cj,hCe as ck,mCe as cl,gCe as cm,yCe as cn,bCe as co,vCe as cp,SCe as cq,qn as cr,pm as cs,ERe as ct,Of as cu,n6 as cv,cs as cw,Nr as cx,xRe as cy,$1e as cz,$xe as d,p4 as e,cT as f,a4 as g,h4 as h,m4 as i,N as j,xs as k,u4 as l,d4 as m,l4 as n,_K as o,EE as p,a1e as q,M as r,YRe as s,PRe as t,vm as u,y4 as v,Pxe as w,c4 as x,E1e as y,Nj as z}; +${_s(l)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){const n=[];for(const c of t.split("/"))c?.length!==0&&c!=="."&&(c===".."?n.pop():n.push(c));const r=`${t?.startsWith("/")?"/":""}${n.join("/")}${n.length>0&&t?.endsWith("/")?"/":""}`;return tc(r).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!="object"||typeof t.accessKeyId!="string"||typeof t.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(t){const n=hX(t).replace(/[\-:]/g,"");return{longDate:n,shortDate:n.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}class Ev extends mX{headerFormatter=new aX;constructor({applyChecksum:t,credentials:n,region:r,service:i,sha256:c,uriEscapePath:l=!0}){super({applyChecksum:t,credentials:n,region:r,service:i,sha256:c,uriEscapePath:l})}async presign(t,n={}){const{signingDate:r=new Date,expiresIn:i=3600,unsignableHeaders:c,unhoistableHeaders:l,signableHeaders:f,hoistableHeaders:d,signingRegion:h,signingService:b}=n,g=await this.credentialProvider();this.validateResolvedCredentials(g);const v=h??await this.regionProvider(),{longDate:_,shortDate:w}=this.formatDate(r);if(i>rX)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const E=mb(w,v,b??this.service),R=fX(kT(t),{unhoistableHeaders:l,hoistableHeaders:d});g.sessionToken&&(R.query[dk]=g.sessionToken),R.query[qY]=hb,R.query[FY]=`${g.accessKeyId}/${E}`,R.query[uk]=_,R.query[ZY]=i.toString(10);const C=OT(R,c,f);return R.query[GY]=this.getCanonicalHeaderList(C),R.query[fk]=await this.getSignature(_,E,this.getSigningKey(g,v,w,b),this.createCanonicalRequest(R,C,await gb(t,this.sha256))),R}async sign(t,n){return typeof t=="string"?this.signString(t,n):t.headers&&t.payload?this.signEvent(t,n):t.message?this.signMessage(t,n):this.signRequest(t,n)}async signEvent({headers:t,payload:n},{signingDate:r=new Date,priorSignature:i,signingRegion:c,signingService:l}){const f=c??await this.regionProvider(),{shortDate:d,longDate:h}=this.formatDate(r),b=mb(d,f,l??this.service),g=await gb({headers:{},body:n},this.sha256),v=new this.sha256;v.update(t);const _=_s(await v.digest()),w=[tX,h,b,i,_,g].join(` +`);return this.signString(w,{signingDate:r,signingRegion:f,signingService:l})}async signMessage(t,{signingDate:n=new Date,signingRegion:r,signingService:i}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:n,signingRegion:r,signingService:i,priorSignature:t.priorSignature}).then(l=>({message:t.message,signature:l}))}async signString(t,{signingDate:n=new Date,signingRegion:r,signingService:i}={}){const c=await this.credentialProvider();this.validateResolvedCredentials(c);const l=r??await this.regionProvider(),{shortDate:f}=this.formatDate(n),d=new this.sha256(await this.getSigningKey(c,l,f,i));return d.update($f(t)),_s(await d.digest())}async signRequest(t,{signingDate:n=new Date,signableHeaders:r,unsignableHeaders:i,signingRegion:c,signingService:l}={}){const f=await this.credentialProvider();this.validateResolvedCredentials(f);const d=c??await this.regionProvider(),h=kT(t),{longDate:b,shortDate:g}=this.formatDate(n),v=mb(g,d,l??this.service);h.headers[pk]=b,f.sessionToken&&(h.headers[XY]=f.sessionToken);const _=await gb(h,this.sha256);!uX(wv,h.headers)&&this.applyChecksum&&(h.headers[wv]=_);const w=OT(h,i,r),E=await this.getSignature(b,v,this.getSigningKey(f,d,g,l),this.createCanonicalRequest(h,w,_));return h.headers[hk]=`${hb} Credential=${f.accessKeyId}/${v}, SignedHeaders=${this.getCanonicalHeaderList(w)}, Signature=${E}`,h}async getSignature(t,n,r,i){const c=await this.createStringToSign(t,n,i,hb),l=new this.sha256(await r);return l.update($f(c)),_s(await l.digest())}getSigningKey(t,n,r,i){return oX(this.sha256,t,r,n,i||this.service)}}const yk=e=>{let t=e.credentials,n=!!e.credentials,r;Object.defineProperty(e,"credentials",{set(h){h&&h!==t&&h!==r&&(n=!0),t=h;const b=gX(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),g=yX(e,b);if(n&&!g.attributed){const v=typeof t=="object"&&t!==null;r=async _=>{const E=await g(_);return v&&(!E.$source||Object.keys(E.$source).length===0)?$Y(E,"CREDENTIALS_CODE","e"):E},r.memoized=g.memoized,r.configBound=g.configBound,r.attributed=!0}else r=g},get(){return r},enumerable:!0,configurable:!0}),e.credentials=t;const{signingEscapePath:i=!0,systemClockOffset:c=e.systemClockOffset||0,sha256:l}=e;let f;return e.signer?f=El(e.signer):e.regionInfoProvider?f=()=>El(e.region)().then(async h=>[await e.regionInfoProvider(h,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},h]).then(([h,b])=>{const{signingRegion:g,signingService:v}=h;e.signingRegion=e.signingRegion||g||b,e.signingName=e.signingName||v||e.serviceId;const _={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:i},w=e.signerConstructor||Ev;return new w(_)}):f=async h=>{h=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await El(e.region)(),properties:{}},h);const b=h.signingRegion,g=h.signingName;e.signingRegion=e.signingRegion||b,e.signingName=e.signingName||g||e.serviceId;const v={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:i},_=e.signerConstructor||Ev;return new _(v)},Object.assign(e,{systemClockOffset:c,signingEscapePath:i,signer:f})};function gX(e,{credentials:t,credentialDefaultProvider:n}){let r;return t?t?.memoized?r=t:r=fY(t,uY,KD):n?r=El(n(Object.assign({},e,{parentClientConfig:e}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function yX(e,t){if(t.configBound)return t;const n=async r=>t({...r,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}const PT=typeof TextEncoder=="function"?new TextEncoder:null,bk=e=>{if(typeof e=="string"){if(PT)return PT.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},Fa=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const r of t)n.push(r);return n},$i=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,sm=()=>{let e=[],t=[],n=!1;const r=new Set,i=g=>g.sort((v,_)=>NT[_.step]-NT[v.step]||LT[_.priority||"normal"]-LT[v.priority||"normal"]),c=g=>{let v=!1;const _=w=>{const E=Fa(w.name,w.aliases);if(E.includes(g)){v=!0;for(const R of E)r.delete(R);return!1}return!0};return e=e.filter(_),t=t.filter(_),v},l=g=>{let v=!1;const _=w=>{if(w.middleware===g){v=!0;for(const E of Fa(w.name,w.aliases))r.delete(E);return!1}return!0};return e=e.filter(_),t=t.filter(_),v},f=g=>(e.forEach(v=>{g.add(v.middleware,{...v})}),t.forEach(v=>{g.addRelativeTo(v.middleware,{...v})}),g.identifyOnResolve?.(b.identifyOnResolve()),g),d=g=>{const v=[];return g.before.forEach(_=>{_.before.length===0&&_.after.length===0?v.push(_):v.push(...d(_))}),v.push(g),g.after.reverse().forEach(_=>{_.before.length===0&&_.after.length===0?v.push(_):v.push(...d(_))}),v},h=(g=!1)=>{const v=[],_=[],w={};return e.forEach(R=>{const C={...R,before:[],after:[]};for(const I of Fa(C.name,C.aliases))w[I]=C;v.push(C)}),t.forEach(R=>{const C={...R,before:[],after:[]};for(const I of Fa(C.name,C.aliases))w[I]=C;_.push(C)}),_.forEach(R=>{if(R.toMiddleware){const C=w[R.toMiddleware];if(C===void 0){if(g)return;throw new Error(`${R.toMiddleware} is not found when adding ${$i(R.name,R.aliases)} middleware ${R.relation} ${R.toMiddleware}`)}R.relation==="after"&&C.after.push(R),R.relation==="before"&&C.before.push(R)}}),i(v).map(d).reduce((R,C)=>(R.push(...C),R),[])},b={add:(g,v={})=>{const{name:_,override:w,aliases:E}=v,R={step:"initialize",priority:"normal",middleware:g,...v},C=Fa(_,E);if(C.length>0){if(C.some(I=>r.has(I))){if(!w)throw new Error(`Duplicate middleware name '${$i(_,E)}'`);for(const I of C){const k=e.findIndex($=>$.name===I||$.aliases?.some(j=>j===I));if(k===-1)continue;const T=e[k];if(T.step!==R.step||R.priority!==T.priority)throw new Error(`"${$i(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${$i(_,E)}" middleware with ${R.priority} priority in ${R.step} step.`);e.splice(k,1)}}for(const I of C)r.add(I)}e.push(R)},addRelativeTo:(g,v)=>{const{name:_,override:w,aliases:E}=v,R={middleware:g,...v},C=Fa(_,E);if(C.length>0){if(C.some(I=>r.has(I))){if(!w)throw new Error(`Duplicate middleware name '${$i(_,E)}'`);for(const I of C){const k=t.findIndex($=>$.name===I||$.aliases?.some(j=>j===I));if(k===-1)continue;const T=t[k];if(T.toMiddleware!==R.toMiddleware||T.relation!==R.relation)throw new Error(`"${$i(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${$i(_,E)}" middleware ${R.relation} "${R.toMiddleware}" middleware.`);t.splice(k,1)}}for(const I of C)r.add(I)}t.push(R)},clone:()=>f(sm()),use:g=>{g.applyToStack(b)},remove:g=>typeof g=="string"?c(g):l(g),removeByTag:g=>{let v=!1;const _=w=>{const{tags:E,name:R,aliases:C}=w;if(E&&E.includes(g)){const I=Fa(R,C);for(const k of I)r.delete(k);return v=!0,!1}return!0};return e=e.filter(_),t=t.filter(_),v},concat:g=>{const v=f(sm());return v.use(g),v.identifyOnResolve(n||v.identifyOnResolve()||(g.identifyOnResolve?.()??!1)),v},applyToStack:f,identify:()=>h(!0).map(g=>{const v=g.step??g.relation+" "+g.toMiddleware;return $i(g.name,g.aliases)+" - "+v}),identifyOnResolve(g){return typeof g=="boolean"&&(n=g),n},resolve:(g,v)=>{for(const _ of h().map(w=>w.middleware).reverse())g=_(g,v);return n&&console.log(b.identify()),g}};return b},NT={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},LT={high:3,normal:2,low:1};class vk{config;middlewareStack=sm();initConfig;handlers;constructor(t){this.config=t;const{protocol:n,protocolSettings:r}=t;r&&typeof n=="function"&&(t.protocol=new n(r))}send(t,n,r){const i=typeof n!="function"?n:void 0,c=typeof n=="function"?n:r,l=i===void 0&&this.config.cacheMiddleware===!0;let f;if(l){this.handlers||(this.handlers=new WeakMap);const d=this.handlers;d.has(t.constructor)?f=d.get(t.constructor):(f=t.resolveMiddleware(this.middlewareStack,this.config,i),d.set(t.constructor,f))}else delete this.handlers,f=t.resolveMiddleware(this.middlewareStack,this.config,i);if(c)f(t).then(d=>c(null,d.output),d=>c(d)).catch(()=>{});else return f(t).then(d=>d.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const yb="***SensitiveInformation***";function xv(e,t){if(t==null)return t;const n=At.of(e);if(n.getMergedTraits().sensitive)return yb;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return yb}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return yb}else if(n.isStructSchema()&&typeof t=="object"){const r=t,i={};for(const[c,l]of n.structIterator())r[c]!=null&&(i[c]=xv(l,r[c]));return i}return t}class Cs{middlewareStack=sm();schema;static classBuilder(){return new bX}resolveMiddlewareWithContext(t,n,r,{middlewareFn:i,clientName:c,commandName:l,inputFilterSensitiveLog:f,outputFilterSensitiveLog:d,smithyContext:h,additionalContext:b,CommandCtor:g}){for(const R of i.bind(this)(g,t,n,r))this.middlewareStack.use(R);const v=t.concat(this.middlewareStack),{logger:_}=n,w={logger:_,clientName:c,commandName:l,inputFilterSensitiveLog:f,outputFilterSensitiveLog:d,[vv]:{commandInstance:this,...h},...b},{requestHandler:E}=n;return v.resolve(R=>E.handle(R.request,r||{}),w)}}class bX{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,n,r={}){return this._smithyContext={service:t,operation:n,...r},this}c(t={}){return this._additionalContext=t,this}n(t,n){return this._clientName=t,this._commandName=n,this}f(t=r=>r,n=r=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=n,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){const t=this;let n;return n=class extends Cs{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super(),this.input=r??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(r,i,c){const l=t._operationSchema,f=l?.[4]??l?.input,d=l?.[5]??l?.output;return this.resolveMiddlewareWithContext(r,i,c,{CommandCtor:n,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(l?xv.bind(null,f):h=>h),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(l?xv.bind(null,d):h=>h),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}class Ya extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;const n=t;return Ya.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault==="client"||n.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;const n=t;return this===Ya?Ya.isInstance(t):Ya.isInstance(t)?n.name&&this.name?this.prototype.isPrototypeOf(t)||n.name===this.name:this.prototype.isPrototypeOf(t):!1}}const zT=(e,t={})=>{Object.entries(t).filter(([,r])=>r!==void 0).forEach(([r,i])=>{(e[r]==null||e[r]==="")&&(e[r]=i)});const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},Sk=e=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},_k=Object.values(Bf),vX=e=>{const t=[];for(const n in Bf){const r=Bf[n];e[r]!==void 0&&t.push({algorithmId:()=>r,checksumConstructor:()=>e[r]})}for(const[n,r]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){e.checksumAlgorithms=e.checksumAlgorithms??{};const r=n.algorithmId(),i=n.checksumConstructor();_k.includes(r)?e.checksumAlgorithms[r.toUpperCase()]=i:e.checksumAlgorithms[r]=i,t.push(n)},checksumAlgorithms(){return t}}},SX=e=>{const t={};return e.checksumAlgorithms().forEach(n=>{const r=n.algorithmId();_k.includes(r)&&(t[r]=n.checksumConstructor())}),t},_X=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),wX=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t},wk=e=>Object.assign(vX(e),_X(e)),Ek=e=>Object.assign(SX(e),wX(e)),xk=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&e[n][t]!==void 0?e[n]=e[n][t]:typeof e[n]=="object"&&e[n]!==null&&(e[n]=xk(e[n]));return e};class PS{trace(){}debug(){}info(){}warn(){}error(){}}class Rk{queryCompat;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,n){const r=n.getMemberSchemas(),i=Object.values(r).find(c=>!!c.getMergedTraits().httpPayload);if(i){const c=i.getMergedTraits().mediaType;return c||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":t)}else if(!n.isUnitSchema()&&Object.values(r).find(l=>{const{httpQuery:f,httpQueryParams:d,httpHeader:h,httpLabel:b,httpPrefixHeaders:g}=l.getMergedTraits();return!f&&!d&&!h&&!b&&g===void 0}))return t}async getErrorSchemaOrThrowBaseException(t,n,r,i,c,l){let f=n,d=t;t.includes("#")&&([f,d]=t.split("#"));const h={$metadata:c,$fault:r.statusCode<500?"client":"server"},b=ts.for(f);try{return{errorSchema:l?.(b,d)??b.getSchema(t),errorMetadata:h}}catch{i.message=i.message??i.Message??"UnknownError";const v=ts.for("smithy.ts.sdk.synthetic."+f),_=v.getBaseException();if(_){const w=v.getErrorCtor(_)??Error;throw this.decorateServiceException(Object.assign(new w({name:d}),h),i)}throw this.decorateServiceException(Object.assign(new Error(d),h),i)}}decorateServiceException(t,n={}){if(this.queryCompat){const r=t.Message??n.Message,i=zT(t,n);r&&(i.message=r),i.Error={...i.Error,Type:i.Error?.Type,Code:i.Error?.Code,Message:i.Error?.message??i.Error?.Message??r};const c=i.$metadata.requestId;return c&&(i.RequestId=c),i}return zT(t,n)}setQueryCompatError(t,n){const r=n.headers?.["x-amzn-query-error"];if(t!==void 0&&r!=null){const[i,c]=r.split(";"),l=Object.entries(t),f={Code:i,Type:c};Object.assign(t,f);for(const[d,h]of l)f[d==="message"?"Message":d]=h;delete f.__type,t.Error=f}}queryCompatOutput(t,n){t.Error&&(n.Error=t.Error),t.Type&&(n.Type=t.Type),t.Code&&(n.Code=t.Code)}findQueryCompatibleError(t,n){try{return t.getSchema(n)}catch{return t.find(i=>At.of(i).getMergedTraits().awsQueryError?.[0]===n)}}}class Vm{serdeContext;setSerdeContext(t){this.serdeContext=t}}class EX{from;to;keys;constructor(t,n){this.from=t,this.to=n,this.keys=new Set(Object.keys(this.from).filter(r=>r!=="__type"))}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const t=this.keys.values().next().value,n=this.from[t];this.to.$unknown=[t,n]}}}function xX(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function RX(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\r/g," ").replace(/\n/g," ").replace(/\u0085/g,"…").replace(/\u2028/,"
")}class Rv{value;constructor(t){this.value=t}toString(){return RX(""+this.value)}}class as{name;children;attributes={};static of(t,n,r){const i=new as(t);return n!==void 0&&i.addChildNode(new Rv(n)),r!==void 0&&i.withName(r),i}constructor(t,n=[]){this.name=t,this.children=n}withName(t){return this.name=t,this}addAttribute(t,n){return this.attributes[t]=n,this}addChildNode(t){return this.children.push(t),this}removeAttribute(t){return delete this.attributes[t],this}n(t){return this.name=t,this}c(t){return this.children.push(t),this}a(t,n){return n!=null&&(this.attributes[t]=n),this}cc(t,n,r=n){if(t[n]!=null){const i=as.of(n,t[n]).withName(r);this.c(i)}}l(t,n,r,i){t[n]!=null&&i().map(l=>{l.withName(r),this.c(l)})}lc(t,n,r,i){if(t[n]!=null){const c=i(),l=new as(r);c.map(f=>{l.c(f)}),this.c(l)}}toString(){const t=!!this.children.length;let n=`<${this.name}`;const r=this.attributes;for(const i of Object.keys(r)){const c=r[i];c!=null&&(n+=` ${i}="${xX(""+c)}"`)}return n+=t?`>${this.children.map(i=>i.toString()).join("")}`:"/>"}}let bb;function CX(e){bb||(bb=new DOMParser);const t=bb.parseFromString(e,"application/xml");if(t.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const n=r=>{if(r.nodeType===Node.TEXT_NODE&&r.textContent?.trim())return r.textContent;if(r.nodeType===Node.ELEMENT_NODE){const i=r;if(i.attributes.length===0&&i.childNodes.length===0)return"";const c={},l=Array.from(i.attributes);for(const d of l)c[`${d.name}`]=d.value;const f=Array.from(i.childNodes);for(const d of f){const h=n(d);if(h!=null){const b=d.nodeName;if(f.length===1&&l.length===0&&b==="#text")return h;c[b]?Array.isArray(c[b])?c[b].push(h):c[b]=[c[b],h]:c[b]=h}else if(f.length===1&&l.length===0)return i.textContent}return c}return null};return{[t.documentElement.nodeName]:n(t.documentElement)}}class Ck extends Vm{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new GD(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,n,r){const i=At.of(t),c=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(c).find(h=>!!h.getMemberTraits().eventPayload)){const h={},b=Object.keys(c)[0];return c[b].isBlobSchema()?h[b]=n:h[b]=this.read(c[b],n),h}const f=(this.serdeContext?.utf8Encoder??hc)(n),d=this.parseXml(f);return this.readSchema(t,r?d[r]:d)}readSchema(t,n){const r=At.of(t);if(r.isUnitSchema())return;const i=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(n))return this.readSchema(r,[n]);if(n==null)return n;if(typeof n=="object"){const c=!!i.sparse,l=!!i.xmlFlattened;if(r.isListSchema()){const d=r.getValueSchema(),h=[],b=d.getMergedTraits().xmlName??"member",g=l?n:(n[0]??n)[b],v=Array.isArray(g)?g:[g];for(const _ of v)(_!=null||c)&&h.push(this.readSchema(d,_));return h}const f={};if(r.isMapSchema()){const d=r.getKeySchema(),h=r.getValueSchema();let b;l?b=Array.isArray(n)?n:[n]:b=Array.isArray(n.entry)?n.entry:[n.entry];const g=d.getMergedTraits().xmlName??"key",v=h.getMergedTraits().xmlName??"value";for(const _ of b){const w=_[g],E=_[v];(E!=null||c)&&(f[w]=this.readSchema(h,E))}return f}if(r.isStructSchema()){const d=r.isUnionSchema();let h;d&&(h=new EX(n,f));for(const[b,g]of r.structIterator()){const v=g.getMergedTraits(),_=v.httpPayload?v.xmlName??g.getName():g.getMemberTraits().xmlName??b;d&&h.mark(_),n[_]!=null&&(f[b]=this.readSchema(g,n[_]))}return d&&h.writeUnknown(),f}if(r.isDocumentSchema())return n;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,n)}parseXml(t){if(t.length){let n;try{n=CX(t)}catch(l){throw l&&typeof l=="object"&&Object.defineProperty(l,"$responseBodyText",{value:t}),l}const r="#text",i=Object.keys(n)[0],c=n[i];return c[r]&&(c[i]=c[r],delete c[r]),xk(c)}return{}}}class AX extends Vm{settings;buffer;constructor(t){super(),this.settings=t}write(t,n,r=""){this.buffer===void 0&&(this.buffer="");const i=At.of(t);if(r&&!r.endsWith(".")&&(r+="."),i.isBlobSchema())(typeof n=="string"||n instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??ea)(n)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())n!=null?(this.writeKey(r),this.writeValue(String(n))):i.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(Bm()));else if(i.isBigIntegerSchema())n!=null&&(this.writeKey(r),this.writeValue(String(n)));else if(i.isBigDecimalSchema())n!=null&&(this.writeKey(r),this.writeValue(n instanceof Jf?n.string:String(n)));else if(i.isTimestampSchema()){if(n instanceof Date)switch(this.writeKey(r),Um(i,this.settings)){case 5:this.writeValue(n.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(tm(n));break;case 7:this.writeValue(String(n.getTime()/1e3));break}}else if(i.isDocumentSchema())Array.isArray(n)?this.write(79,n,r):n instanceof Date?this.write(4,n,r):n instanceof Uint8Array?this.write(21,n,r):n&&typeof n=="object"?this.write(143,n,r):(this.writeKey(r),this.writeValue(String(n)));else if(i.isListSchema()){if(Array.isArray(n))if(n.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{const c=i.getValueSchema(),l=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let f=1;for(const d of n){if(d==null)continue;const h=c.getMergedTraits(),b=this.getKey("member",h.xmlName,h.ec2QueryName),g=l?`${r}${f}`:`${r}${b}.${f}`;this.write(c,d,g),++f}}}else if(i.isMapSchema()){if(n&&typeof n=="object"){const c=i.getKeySchema(),l=i.getValueSchema(),f=i.getMergedTraits().xmlFlattened;let d=1;for(const[h,b]of Object.entries(n)){if(b==null)continue;const g=c.getMergedTraits(),v=this.getKey("key",g.xmlName,g.ec2QueryName),_=f?`${r}${d}.${v}`:`${r}entry.${d}.${v}`,w=l.getMergedTraits(),E=this.getKey("value",w.xmlName,w.ec2QueryName),R=f?`${r}${d}.${E}`:`${r}entry.${d}.${E}`;this.write(c,h,_),this.write(l,b,R),++d}}}else if(i.isStructSchema()){if(n&&typeof n=="object"){let c=!1;for(const[l,f]of i.structIterator()){if(n[l]==null&&!f.isIdempotencyToken())continue;const d=f.getMergedTraits(),h=this.getKey(l,d.xmlName,d.ec2QueryName,"struct"),b=`${r}${h}`;this.write(f,n[l],b),c=!0}if(!c&&i.isUnionSchema()){const{$unknown:l}=n;if(Array.isArray(l)){const[f,d]=l,h=`${r}${f}`;this.write(15,d,h)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,n,r,i){const{ec2:c,capitalizeKeys:l}=this.settings;if(c&&r)return r;const f=n??t;return l&&i==="struct"?f[0].toUpperCase()+f.slice(1):f}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${em(t)}=`}writeValue(t){this.buffer+=em(t)}}class TX extends sY{options;serializer;deserializer;mixin=new Rk;constructor(t){super({defaultNamespace:t.defaultNamespace}),this.options=t;const n={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new AX(n),this.deserializer=new Ck(n)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,n,r){const i=await super.serializeRequest(t,n,r);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),(wp(t.input)==="unit"||!i.body)&&(i.body="");const c=t.name.split("#")[1]??t.name;return i.body=`Action=${c}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,n,r){const i=this.deserializer,c=At.of(t.output),l={};if(r.statusCode>=300){const g=await Ki(r.body,n);g.byteLength>0&&Object.assign(l,await i.read(15,g)),await this.handleError(t,n,r,l,this.deserializeMetadata(r))}for(const g in r.headers){const v=r.headers[g];delete r.headers[g],r.headers[g.toLowerCase()]=v}const f=t.name.split("#")[1]??t.name,d=c.isStructSchema()&&this.useNestedResult()?f+"Result":void 0,h=await Ki(r.body,n);return h.byteLength>0&&Object.assign(l,await i.read(c,h,d)),{$metadata:this.deserializeMetadata(r),...l}}useNestedResult(){return!0}async handleError(t,n,r,i,c){const l=this.loadQueryErrorCode(r,i)??"Unknown",f=this.loadQueryError(i)??{},d=this.loadQueryErrorMessage(i);f.message=d,f.Error={Type:f.Type,Code:f.Code,Message:d};const{errorSchema:h,errorMetadata:b}=await this.mixin.getErrorSchemaOrThrowBaseException(l,this.options.defaultNamespace,r,f,c,this.mixin.findQueryCompatibleError),g=At.of(h),v=ts.for(h[1]).getErrorCtor(h)??Error,_=new v(d),w={Type:f.Error.Type,Code:f.Error.Code,Error:f.Error};for(const[E,R]of g.structIterator()){const C=R.getMergedTraits().xmlName??E,I=f[C]??i[C];w[E]=this.deserializer.readSchema(R,I)}throw this.mixin.decorateServiceException(Object.assign(_,b,{$fault:g.getMergedTraits().error,message:d},w),i)}loadQueryErrorCode(t,n){const r=(n.Errors?.[0]?.Error??n.Errors?.Error??n.Error)?.Code;if(r!==void 0)return r;if(t.statusCode==404)return"NotFound"}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const n=this.loadQueryError(t);return n?.message??n?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}class IX extends TX{options;constructor(t){super(t),this.options=t;const n={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,n)}useNestedResult(){return!1}}const OX=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"};class MX extends Vm{settings;stringBuffer;byteBuffer;buffer;constructor(t){super(),this.settings=t}write(t,n){const r=At.of(t);if(r.isStringSchema()&&typeof n=="string")this.stringBuffer=n;else if(r.isBlobSchema())this.byteBuffer="byteLength"in n?n:(this.serdeContext?.base64Decoder??cc)(n);else{this.buffer=this.writeStruct(r,n,void 0);const i=r.getMergedTraits();i.httpPayload&&!i.xmlName&&this.buffer.withName(r.getName())}}flush(){if(this.byteBuffer!==void 0){const n=this.byteBuffer;return delete this.byteBuffer,n}if(this.stringBuffer!==void 0){const n=this.stringBuffer;return delete this.stringBuffer,n}const t=this.buffer;return this.settings.xmlNamespace&&(t?.attributes?.xmlns||t.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,t.toString()}writeStruct(t,n,r){const i=t.getMergedTraits(),c=t.isMemberSchema()&&!i.httpPayload?t.getMemberTraits().xmlName??t.getMemberName():i.xmlName??t.getName();if(!c||!t.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${t.getName(!0)}.`);const l=as.of(c),[f,d]=this.getXmlnsAttribute(t,r);for(const[b,g]of t.structIterator()){const v=n[b];if(v!=null||g.isIdempotencyToken()){if(g.getMergedTraits().xmlAttribute){l.addAttribute(g.getMergedTraits().xmlName??b,this.writeSimple(g,v));continue}if(g.isListSchema())this.writeList(g,v,l,d);else if(g.isMapSchema())this.writeMap(g,v,l,d);else if(g.isStructSchema())l.addChildNode(this.writeStruct(g,v,d));else{const _=as.of(g.getMergedTraits().xmlName??g.getMemberName());this.writeSimpleInto(g,v,_,d),l.addChildNode(_)}}}const{$unknown:h}=n;if(h&&t.isUnionSchema()&&Array.isArray(h)&&Object.keys(n).length===1){const[b,g]=h,v=as.of(b);if(typeof g!="string")if(n instanceof as||n instanceof Rv)l.addChildNode(n);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,g,v,d),l.addChildNode(v)}return d&&l.addAttribute(f,d),l}writeList(t,n,r,i){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${t.getName(!0)}`);const c=t.getMergedTraits(),l=t.getValueSchema(),f=l.getMergedTraits(),d=!!f.sparse,h=!!c.xmlFlattened,[b,g]=this.getXmlnsAttribute(t,i),v=(_,w)=>{if(l.isListSchema())this.writeList(l,Array.isArray(w)?w:[w],_,g);else if(l.isMapSchema())this.writeMap(l,w,_,g);else if(l.isStructSchema()){const E=this.writeStruct(l,w,g);_.addChildNode(E.withName(h?c.xmlName??t.getMemberName():f.xmlName??"member"))}else{const E=as.of(h?c.xmlName??t.getMemberName():f.xmlName??"member");this.writeSimpleInto(l,w,E,g),_.addChildNode(E)}};if(h)for(const _ of n)(d||_!=null)&&v(r,_);else{const _=as.of(c.xmlName??t.getMemberName());g&&_.addAttribute(b,g);for(const w of n)(d||w!=null)&&v(_,w);r.addChildNode(_)}}writeMap(t,n,r,i,c=!1){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${t.getName(!0)}`);const l=t.getMergedTraits(),f=t.getKeySchema(),h=f.getMergedTraits().xmlName??"key",b=t.getValueSchema(),g=b.getMergedTraits(),v=g.xmlName??"value",_=!!g.sparse,w=!!l.xmlFlattened,[E,R]=this.getXmlnsAttribute(t,i),C=(I,k,T)=>{const $=as.of(h,k),[j,H]=this.getXmlnsAttribute(f,R);H&&$.addAttribute(j,H),I.addChildNode($);let P=as.of(v);b.isListSchema()?this.writeList(b,T,P,R):b.isMapSchema()?this.writeMap(b,T,P,R,!0):b.isStructSchema()?P=this.writeStruct(b,T,R):this.writeSimpleInto(b,T,P,R),I.addChildNode(P)};if(w){for(const[I,k]of Object.entries(n))if(_||k!=null){const T=as.of(l.xmlName??t.getMemberName());C(T,I,k),r.addChildNode(T)}}else{let I;c||(I=as.of(l.xmlName??t.getMemberName()),R&&I.addAttribute(E,R),r.addChildNode(I));for(const[k,T]of Object.entries(n))if(_||T!=null){const $=as.of("entry");C($,k,T),(c?r:I).addChildNode($)}}}writeSimple(t,n){if(n===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");const r=At.of(t);let i=null;if(n&&typeof n=="object")if(r.isBlobSchema())i=(this.serdeContext?.base64Encoder??ea)(n);else if(r.isTimestampSchema()&&n instanceof Date)switch(Um(r,this.settings)){case 5:i=n.toISOString().replace(".000Z","Z");break;case 6:i=tm(n);break;case 7:i=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",n),i=tm(n);break}else{if(r.isBigDecimalSchema()&&n)return n instanceof Jf?n.string:String(n);throw r.isMapSchema()||r.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(!0)}`)}if((r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())&&(i=String(n)),r.isStringSchema()&&(n===void 0&&r.isIdempotencyToken()?i=Bm():i=String(n)),i===null)throw new Error(`Unhandled schema-value pair ${r.getName(!0)}=${n}`);return i}writeSimpleInto(t,n,r,i){const c=this.writeSimple(t,n),l=At.of(t),f=new Rv(c),[d,h]=this.getXmlnsAttribute(l,i);h&&r.addAttribute(d,h),r.addChildNode(f)}getXmlnsAttribute(t,n){const r=t.getMergedTraits(),[i,c]=r.xmlNamespace??[];return c&&c!==n?[i?`xmlns:${i}`:"xmlns",c]:[void 0,void 0]}}class DX extends Vm{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new MX(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new Ck(this.settings);return t.setSerdeContext(this.serdeContext),t}}class kX extends nY{codec;serializer;deserializer;mixin=new Rk;constructor(t){super(t);const n={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace};this.codec=new DX(n),this.serializer=new iY(this.codec.createSerializer(),n),this.deserializer=new rY(this.codec.createDeserializer(),n)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(t,n,r){const i=await super.serializeRequest(t,n,r),c=At.of(t.input);if(!i.headers["content-type"]){const l=this.mixin.resolveRestContentType(this.getDefaultContentType(),c);l&&(i.headers["content-type"]=l)}return typeof i.body=="string"&&i.headers["content-type"]===this.getDefaultContentType()&&!i.body.startsWith("'+i.body),i}async deserializeResponse(t,n,r){return super.deserializeResponse(t,n,r)}async handleError(t,n,r,i,c){const l=OX(r,i)??"Unknown";if(i.Error&&typeof i.Error=="object")for(const w of Object.keys(i.Error))i[w]=i.Error[w],w.toLowerCase()==="message"&&(i.message=i.Error[w]);i.RequestId&&!c.requestId&&(c.requestId=i.RequestId);const{errorSchema:f,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(l,this.options.defaultNamespace,r,i,c),h=At.of(f),b=i.Error?.message??i.Error?.Message??i.message??i.Message??"Unknown",g=ts.for(f[1]).getErrorCtor(f)??Error,v=new g(b);await this.deserializeHttpMessage(f,n,r,i);const _={};for(const[w,E]of h.structIterator()){const R=E.getMergedTraits().xmlName??w,C=i.Error?.[R]??i[R];_[w]=this.codec.createDeserializer().readSchema(E,C)}throw this.mixin.decorateServiceException(Object.assign(v,d,{$fault:h.getMergedTraits().error,message:b},_),i)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(t){for(const[,n]of t.structIterator())if(n.getMergedTraits().httpPayload)return!(n.isStructSchema()||n.isMapSchema()||n.isListSchema());return!1}}const PX=/\d{12}\.ddb/;async function NX(e,t,n){if(n.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Pr(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const c=await t.retryStrategy();typeof c.acquireInitialRetryToken=="function"?c.constructor?.name?.includes("Adaptive")?Pr(e,"RETRY_MODE_ADAPTIVE","F"):Pr(e,"RETRY_MODE_STANDARD","E"):Pr(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){const c=e.endpointV2;switch(String(c?.url?.hostname).match(PX)&&Pr(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":Pr(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Pr(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Pr(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const c=i;c.accountId&&Pr(e,"RESOLVED_ACCOUNT_ID","T");for(const[l,f]of Object.entries(c.$source??{}))Pr(e,l,f)}}const BT="user-agent",vb="x-amz-user-agent",$T=" ",Sb="/",LX=/[^!$%&'*+\-.^_`|~\w]/g,zX=/[^!$%&'*+\-.^_`|~\w#]/g,UT="-",BX=1024;function $X(e){let t="";for(const n in e){const r=e[n];if(t.length+r.length+1<=BX){t.length?t+=","+r:t+=r;continue}break}return t}const UX=e=>(t,n)=>async r=>{const{request:i}=r;if(!kn.isInstance(i))return t(r);const{headers:c}=i,l=n?.userAgent?.map(lp)||[],f=(await e.defaultUserAgentProvider()).map(lp);await NX(n,e,r);const d=n;f.push(`m/${$X(Object.assign({},n.__smithy_context?.features,d.__aws_sdk_context?.features))}`);const h=e?.customUserAgent?.map(lp)||[],b=await e.userAgentAppId();b&&f.push(lp(["app",`${b}`]));const g=[].concat([...f,...l,...h]).join($T),v=[...f.filter(_=>_.startsWith("aws-sdk-")),...h].join($T);return e.runtime!=="browser"?(v&&(c[vb]=c[vb]?`${c[BT]} ${v}`:v),c[BT]=g):c[vb]=g,t({...r,request:i})},lp=e=>{const t=e[0].split(Sb).map(l=>l.replace(LX,UT)).join(Sb),n=e[1]?.replace(zX,UT),r=t.indexOf(Sb),i=t.substring(0,r);let c=t.substring(r+1);return i==="api"&&(c=c.toLowerCase()),[i,c,n].filter(l=>l&&l.length>0).reduce((l,f,d)=>{switch(d){case 0:return f;case 1:return`${l}/${f}`;default:return`${l}#${f}`}},"")},jX={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Ak=e=>({applyToStack:t=>{t.add(UX(e),jX)}}),Tk=!1,Ik=!1,jT=new Set,HX=(e,t=jm)=>{if(!jT.has(e)&&!t(e))if(e==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else jT.add(e)},Ok=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),VX=e=>Ok(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,Mk=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const r=typeof t=="function"?await t():t,i=VX(r);return HX(i),i},useFipsEndpoint:async()=>{const r=typeof t=="string"?t:await t();return Ok(r)?!0:typeof n!="function"?Promise.resolve(!!n):n()}})},HT="content-length";function qX(e){return t=>async n=>{const r=n.request;if(kn.isInstance(r)){const{body:i,headers:c}=r;if(i&&Object.keys(c).map(l=>l.toLowerCase()).indexOf(HT)===-1)try{const l=e(i);r.headers={...r.headers,[HT]:String(l)}}catch{}}return t({...n,request:r})}}const FX={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Dk=e=>({applyToStack:t=>{t.add(qX(e.bodyLengthChecker),FX)}}),GX=async e=>{const t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),XX(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!YX(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},ZX=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,KX=/(\d+\.){3}\d+/,QX=/\.\./,YX=e=>ZX.test(e)&&!KX.test(e)&&!QX.test(e),XX=e=>{const[t,n,r,,,i]=e.split(":"),c=t==="arn"&&e.split(":").length>=6,l=!!(c&&n&&r&&i);if(c&&!l)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return l},WX=(e,t,n,r=!1)=>{const i=async()=>{let c;return r?c=n.clientContextParams?.[e]??n[e]??n[t]:c=n[e]??n[t],typeof c=="function"?c():c};return e==="credentialScope"||t==="CredentialScope"?async()=>{const c=typeof n.credentials=="function"?await n.credentials():n.credentials;return c?.credentialScope??c?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{const c=typeof n.credentials=="function"?await n.credentials():n.credentials;return c?.accountId??c?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(n.isCustomEndpoint===!1)return;const c=await i();if(c&&typeof c=="object"){if("url"in c)return c.url.href;if("hostname"in c){const{protocol:l,hostname:f,port:d,path:h}=c;return`${l}//${f}${d?":"+d:""}${h}`}}return c}:i},kk=async e=>{},Pk=e=>typeof e=="object"?"url"in e?Hf(e.url):e:Hf(e),JX=async(e,t,n,r)=>{if(!n.isCustomEndpoint){let l;n.serviceConfiguredEndpoint?l=await n.serviceConfiguredEndpoint():l=await kk(n.serviceId),l&&(n.endpoint=()=>Promise.resolve(Pk(l)),n.isCustomEndpoint=!0)}const i=await Nk(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return n.endpointProvider(i,r)},Nk=async(e,t,n)=>{const r={},i=t?.getEndpointParameterInstructions?.()||{};for(const[c,l]of Object.entries(i))switch(l.type){case"staticContextParams":r[c]=l.value;break;case"contextParams":r[c]=e[l.name];break;case"clientContextParams":case"builtInParams":r[c]=await WX(l.name,c,n,l.type!=="builtInParams")();break;case"operationContextParams":r[c]=l.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(l))}return Object.keys(i).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()==="s3"&&await GX(r),r},eW=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&aY(r,"ENDPOINT_OVERRIDE","N");const c=await JX(i.input,{getEndpointParameterInstructions(){return t}},{...e},r);r.endpointV2=c,r.authSchemes=c.properties?.authSchemes;const l=r.authSchemes?.[0];if(l){r.signing_region=l.signingRegion,r.signing_service=l.signingName;const d=qo(r)?.selectedHttpAuthScheme?.httpAuthOption;d&&(d.signingProperties=Object.assign(d.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return n({...i})},tW={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:rQ.name},Ks=(e,t)=>({applyToStack:n=>{n.addRelativeTo(eW({config:e,instructions:t}),tW)}}),Lk=e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,c=n!=null?async()=>Pk(await Fs(n)()):void 0,f=Object.assign(e,{endpoint:c,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Fs(r??!1),useFipsEndpoint:Fs(i??!1)});let d;return f.serviceConfiguredEndpoint=async()=>(e.serviceId&&!d&&(d=kk(e.serviceId)),d),f};var Pl;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(Pl||(Pl={}));const Vf=3,zk=Pl.STANDARD,nW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],sW=["TimeoutError","RequestTimeout","RequestTimeoutException"],rW=[500,502,503,504],oW=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],iW=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],aW=e=>e?.$retryable!==void 0,cW=e=>e.$metadata?.clockSkewCorrected,lW=e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},Bk=e=>e.$metadata?.httpStatusCode===429||nW.includes(e.name)||e.$retryable?.throttling==!0,NS=(e,t=0)=>aW(e)||cW(e)||sW.includes(e.name)||oW.includes(e?.code||"")||iW.includes(e?.code||"")||rW.includes(e.$metadata?.httpStatusCode||0)||lW(e)||e.cause!==void 0&&t<=10&&NS(e.cause,t+1),uW=e=>{if(e.$metadata?.httpStatusCode!==void 0){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!NS(e)}return!1};class LS{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8;const n=this.getCurrentTimeInSeconds();this.lastThrottleTime=n,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){const n=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(r=>LS.setTimeoutFn(r,n))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const n=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+n),this.lastTimestamp=t}updateClientSendingRate(t){let n;if(this.updateMeasuredRate(),Bk(t)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),n=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),n=this.cubicSuccess(this.getCurrentTimeInSeconds());const r=Math.min(n,2*this.measuredTxRate);this.updateTokenBucketRate(r)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),n=Math.floor(t*2)/2;if(this.requestCount++,n>this.lastTxRateBucket){const r=this.requestCount/(n-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(r*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=n}}getPrecise(t){return parseFloat(t.toFixed(8))}}const Cv=100,$k=20*1e3,fW=500,VT=500,dW=5,hW=10,pW=1,mW="amz-sdk-invocation-id",gW="amz-sdk-request",yW=()=>{let e=Cv;return{computeNextBackoffDelay:r=>Math.floor(Math.min($k,Math.random()*2**r*e)),setDelayBase:r=>{e=r}}},qT=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min($k,e),getRetryCost:()=>n});class Uk{maxAttempts;mode=Pl.STANDARD;capacity=VT;retryBackoffStrategy=yW();maxAttemptsProvider;constructor(t){this.maxAttempts=t,this.maxAttemptsProvider=typeof t=="function"?t:async()=>t}async acquireInitialRetryToken(t){return qT({retryDelay:Cv,retryCount:0})}async refreshRetryTokenForRetry(t,n){const r=await this.getMaxAttempts();if(this.shouldRetry(t,n,r)){const i=n.errorType;this.retryBackoffStrategy.setDelayBase(i==="THROTTLING"?fW:Cv);const c=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),l=n.retryAfterHint?Math.max(n.retryAfterHint.getTime()-Date.now()||0,c):c,f=this.getCapacityCost(i);return this.capacity-=f,qT({retryDelay:l,retryCount:t.getRetryCount()+1,retryCost:f})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.max(VT,this.capacity+(t.getRetryCost()??pW))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Vf}`),Vf}}shouldRetry(t,n,r){return t.getRetryCount()+1=this.getCapacityCost(n.errorType)&&this.isRetryableError(n.errorType)}getCapacityCost(t){return t==="TRANSIENT"?hW:dW}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}}class bW{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=Pl.ADAPTIVE;constructor(t,n){this.maxAttemptsProvider=t;const{rateLimiter:r}=n??{};this.rateLimiter=r??new LS,this.standardRetryStrategy=new Uk(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,n){return this.rateLimiter.updateClientSendingRate(n),this.standardRetryStrategy.refreshRetryTokenForRetry(t,n)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}}const vW=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),jk=e=>{const{retryStrategy:t,retryMode:n,maxAttempts:r}=e,i=Fs(r??Vf);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await Fs(n)()===Pl.ADAPTIVE?new bW(i):new Uk(i))})},SW=e=>e?.body instanceof ReadableStream,_W=e=>(t,n)=>async r=>{let i=await e.retryStrategy();const c=await e.maxAttempts();if(wW(i)){i=i;let l=await i.acquireInitialRetryToken(n.partition_id),f=new Error,d=0,h=0;const{request:b}=r,g=kn.isInstance(b);for(g&&(b.headers[mW]=Bm());;)try{g&&(b.headers[gW]=`attempt=${d+1}; max=${c}`);const{response:v,output:_}=await t(r);return i.recordSuccess(l),_.$metadata.attempts=d+1,_.$metadata.totalRetryDelay=h,{response:v,output:_}}catch(v){const _=EW(v);if(f=vW(v),g&&SW(b))throw(n.logger instanceof PS?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),f;try{l=await i.refreshRetryTokenForRetry(l,_)}catch{throw f.$metadata||(f.$metadata={}),f.$metadata.attempts=d+1,f.$metadata.totalRetryDelay=h,f}d=l.getRetryCount();const w=l.getRetryDelay();h+=w,await new Promise(E=>setTimeout(E,w))}}else return i=i,i?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,r)},wW=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",EW=e=>{const t={error:e,errorType:xW(e)},n=CW(e.$response);return n&&(t.retryAfterHint=n),t},xW=e=>Bk(e)?"THROTTLING":NS(e)?"TRANSIENT":uW(e)?"SERVER_ERROR":"CLIENT_ERROR",RW={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Hk=e=>({applyToStack:t=>{t.add(_W(e),RW)}}),CW=e=>{if(!ac.isInstance(e))return;const t=Object.keys(e.headers).find(c=>c.toLowerCase()==="retry-after");if(!t)return;const n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n):new Date(r*1e3)},AW=async(e,t,n)=>({operation:qo(t).operation,region:await Fs(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function TW(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"ec2",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}const IW=e=>{const t=[];switch(e.operation){default:t.push(TW(e))}return t},OW=e=>{const t=yk(e);return Object.assign(t,{authSchemePreference:Fs(e.authSchemePreference??[])})},MW=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"ec2"}),to={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},DW="3.1000.0",kW={version:DW},Vk=e=>new TextEncoder().encode(e);var PW=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:Vk;function lc(e){return e instanceof Uint8Array?e:typeof e=="string"?PW(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function rm(e){return typeof e=="string"?e.length===0:e.byteLength===0}function NW(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}function LW(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n0&&c[c.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!c||h[1]>c[0]&&h[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var pr=64,jW=32,HW=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),VW=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],qW=Math.pow(2,53)-1,Ep=(function(){function e(){this.state=Int32Array.from(VW),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>qW)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===pr&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%pr>=pr-8){for(var i=this.bufferLength;i>>24&255,c[i*4+1]=this.state[i]>>>16&255,c[i*4+2]=this.state[i]>>>8&255,c[i*4+3]=this.state[i]>>>0&255;return c},e.prototype.hashBuffer=function(){for(var t=this,n=t.buffer,r=t.state,i=r[0],c=r[1],l=r[2],f=r[3],d=r[4],h=r[5],b=r[6],g=r[7],v=0;v>>17|_<<15)^(_>>>19|_<<13)^_>>>10;_=this.temp[v-15];var E=(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3;this.temp[v]=(w+this.temp[v-7]|0)+(E+this.temp[v-16]|0)}var R=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&h^~d&b)|0)+(g+(HW[v]+this.temp[v]|0)|0)|0,C=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&c^i&l^c&l)|0;g=b,b=h,h=d,d=f+R|0,f=l,l=c,c=i,i=R+C|0}r[0]+=i,r[1]+=c,r[2]+=l,r[3]+=f,r[4]+=d,r[5]+=h,r[6]+=b,r[7]+=g},e})(),FW=(function(){function e(t){this.secret=t,this.hash=new Ep,this.reset()}return e.prototype.update=function(t){if(!(rm(t)||this.error))try{this.hash.update(lc(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return Fk(this,void 0,void 0,function(){return Gk(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Ep,this.secret){this.outer=new Ep;var t=GW(this.secret),n=new Uint8Array(pr);n.set(t);for(var r=0;rpr){var n=new Ep;n.update(t),t=n.digest()}var r=new Uint8Array(pr);return r.set(t),r}var ZW=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Zk(e){if(KW(e)&&typeof e.crypto.subtle=="object"){var t=e.crypto.subtle;return QW(t)}return!1}function KW(e){if(typeof e=="object"&&typeof e.crypto=="object"){var t=e.crypto.getRandomValues;return typeof t=="function"}return!1}function QW(e){return e&&ZW.every(function(t){return typeof e[t]=="function"})}var Kk=(function(){function e(t){Zk(Ji())?this.hash=new $W(t):this.hash=new FW(t)}return e.prototype.update=function(t,n){this.hash.update(lc(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();const Qk=({serviceId:e,clientVersion:t})=>async n=>{const r=typeof window<"u"?window.navigator:void 0,i=r?.userAgent??"",c=r?.userAgentData?.platform??GT.os(i)??"other",l=void 0,f=r?.userAgentData?.brands??[],d=f[f.length-1],h=d?.brand??GT.browser(i)??"unknown",b=d?.version??"unknown",g=[["aws-sdk-js",t],["ua","2.1"],[`os/${c}`,l],["lang/js"],["md/browser",`${h}_${b}`]];e&&g.push([`api/${e}`,t]);const v=await n?.userAgentAppId?.();return v&&g.push([`app/${v}`]),g},GT={os(e){if(/iPhone|iPad|iPod/.test(e))return"iOS";if(/Macintosh|Mac OS X/.test(e))return"macOS";if(/Windows NT/.test(e))return"Windows";if(/Android/.test(e))return"Android";if(/Linux/.test(e))return"Linux"},browser(e){if(/EdgiOS|EdgA|Edg\//.test(e))return"Microsoft Edge";if(/Firefox\//.test(e))return"Firefox";if(/Chrome\//.test(e))return"Chrome";if(/Safari\//.test(e))return"Safari"}},Yk=e=>()=>Promise.reject(e),YW=["in-region","cross-region","mobile","standard","legacy"],Xk=({defaultsMode:e}={})=>HY(async()=>{const t=typeof e=="function"?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(XW()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${YW.join(", ")}, got ${t}`)}}),XW=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:n,downlink:r}=e?.connection;if(typeof t=="string"&&t!=="4g"||Number(n)>100||Number(r)<10)return!0}return e?.userAgentData?.mobile||typeof e?.maxTouchPoints=="number"&&e?.maxTouchPoints>1},Wk="required",gr="fn",yr="argv",Ul="ref",ZT=!0,KT="isSet",qf="booleanEquals",ul="error",fl="endpoint",Oo="tree",zS="PartitionResult",BS="getAttr",QT={[Wk]:!1,type:"string"},YT={[Wk]:!0,default:!1,type:"boolean"},XT={[Ul]:"Endpoint"},Jk={[gr]:qf,[yr]:[{[Ul]:"UseFIPS"},!0]},e3={[gr]:qf,[yr]:[{[Ul]:"UseDualStack"},!0]},fr={},WT={[gr]:BS,[yr]:[{[Ul]:zS},"supportsFIPS"]},t3={[Ul]:zS},JT={[gr]:qf,[yr]:[!0,{[gr]:BS,[yr]:[t3,"supportsDualStack"]}]},eI=[Jk],tI=[e3],nI=[{[Ul]:"Region"}],WW={parameters:{Region:QT,UseDualStack:YT,UseFIPS:YT,Endpoint:QT},rules:[{conditions:[{[gr]:KT,[yr]:[XT]}],rules:[{conditions:eI,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ul},{conditions:tI,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ul},{endpoint:{url:XT,properties:fr,headers:fr},type:fl}],type:Oo},{conditions:[{[gr]:KT,[yr]:nI}],rules:[{conditions:[{[gr]:"aws.partition",[yr]:nI,assign:zS}],rules:[{conditions:[Jk,e3],rules:[{conditions:[{[gr]:qf,[yr]:[ZT,WT]},JT],rules:[{endpoint:{url:"https://ec2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:fr,headers:fr},type:fl}],type:Oo},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ul}],type:Oo},{conditions:eI,rules:[{conditions:[{[gr]:qf,[yr]:[WT,ZT]}],rules:[{conditions:[{[gr]:"stringEquals",[yr]:[{[gr]:BS,[yr]:[t3,"name"]},"aws-us-gov"]}],endpoint:{url:"https://ec2.{Region}.amazonaws.com",properties:fr,headers:fr},type:fl},{endpoint:{url:"https://ec2-fips.{Region}.{PartitionResult#dnsSuffix}",properties:fr,headers:fr},type:fl}],type:Oo},{error:"FIPS is enabled but this partition does not support FIPS",type:ul}],type:Oo},{conditions:tI,rules:[{conditions:[JT],rules:[{endpoint:{url:"https://ec2.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:fr,headers:fr},type:fl}],type:Oo},{error:"DualStack is enabled but this partition does not support DualStack",type:ul}],type:Oo},{endpoint:{url:"https://ec2.{Region}.{PartitionResult#dnsSuffix}",properties:fr,headers:fr},type:fl}],type:Oo}],type:Oo},{error:"Invalid Configuration: Missing Region",type:ul}]},JW=WW,eJ=new YD({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),tJ=(e,t={})=>eJ.get(e,()=>ak(JW,{endpointParams:e,logger:t.logger}));Uf.aws=MS;class $S extends Ya{constructor(t){super(t),Object.setPrototypeOf(this,$S.prototype)}}const nJ="AllAvailabilityZones",sJ="AttributeBooleanValue",rJ="AssociateCarrierIpAddress",oJ="AdditionalFlexibleNetworkInterfaces",iJ="AvailableIpAddressCount",aJ="AssignIpv6AddressOnCreation",n3="AdditionalInfo",US="AssociationId",s3="AttachmentId",cJ="AmiLaunchIndex",lJ="AttachmentLimitType",uJ="AssociatePublicIpAddress",fJ="AmazonProvidedIpv6CidrBlock",dJ="AutoRecoverySupported",hJ="AllRegions",r3="AssociatedResource",o3="AutoRecovery",i3="AmdSevSnp",pJ="ArchitectureTypeList",qm="AttachTime",mJ="AttachVolumeRequest",gJ="AttributeValue",yJ="AttachVolume",la="AvailabilityZone",bJ="AvailabilityZoneGeography",vJ="AvailabilityZoneGeographyList",jl="AvailabilityZoneId",SJ="AvailabilityZoneList",_J="AvailabilityZoneMessage",wJ="AvailabilityZoneMessageList",EJ="AvailabilityZoneSubGeography",xJ="AvailabilityZoneSubGeographyList",RJ="AvailabilityZones",a3="Accelerators",CJ="Affinity",c3="Arn",l3="Architecture",u3="Association",AJ="Attribute",f3="Attachment",TJ="Attachments",IJ="BlobAttributeValue",OJ="BaselineBandwidthInGbps",d3="BaselineBandwidthInMbps",jS="BlockDeviceMapping",MJ="BlockDeviceMappingList",DJ="BlockDeviceMappingRequestList",ed="BlockDeviceMappings",kJ="BlockDurationMinutes",h3="BaselineIops",p3="BootMode",PJ="BootModeTypeList",NJ="BareMetal",HS="BlockPublicAccessStates",LJ="BurstablePerformanceSupported",m3="BaselineThroughputInMBps",g3="BandwidthWeighting",zJ="BandwidthWeightingTypeList",BJ="BandwidthWeightings",td="CidrBlock",$J="CidrBlockAssociationSet",UJ="CapacityBlockId",jJ="CidrBlockState",HJ="CoreCountList",y3="CoreCount",VJ="CpuCredits",b3="CompletionDurationMinutes",qJ="CreationDate",FJ="CurrentGeneration",GJ="CarrierIp",ZJ="CurrentInstanceBootMode",KJ="CreateImageRequest",QJ="CreateImageResult",YJ="CoreInfo",XJ="CreateImage",WJ="CreateKeyPair",JJ="CreateKeyPairRequest",VS="CpuOptions",eee="CustomerOwnedIp",tee="CustomerOwnedIpv4Pool",nee="CpuOptionsRequest",qS="CapacityReservationId",v3="CapacityReservationPreference",S3="CapacityReservationResourceGroupArn",see="CapacityReservationSpecificationResponse",FS="CapacityReservationSpecification",GS="CapacityReservationTarget",ree="CapacityReservationTargetResponse",oee="CopySnapshotRequest",iee="CopySnapshotRequestPSU",aee="CopySnapshotResult",cee="CreateSnapshotRequest",lee="CreateSubnetRequest",uee="CreateSubnetResult",fee="CreditSpecificationRequest",dee="CopySnapshot",hee="CreditSpecification",pee="CreateSnapshot",mee="CreateSubnet",gee="CurrentState",ZS="ClientToken",yee="ConnectionTrackingConfiguration",bee="ConnectionTrackingSpecification",vee="ConnectionTrackingSpecificationRequest",See="ConnectionTrackingSpecificationResponse",_ee="CompletionTime",_3="CreateTime",wee="CreateVolumeRequest",Eee="CreateVpcRequest",xee="CreateVpcResult",Ree="CreateVolume",Cee="CreateVpc",w3="Code",E3="Configured",ua="Count",x3="DisableApiStop",R3="DisableApiTermination",Aee="DestinationAvailabilityZone",Tee="DescribeAvailabilityZonesRequest",Iee="DescribeAvailabilityZonesResult",Oee="DescribeAvailabilityZones",Mee="DefaultCores",Dee="DataEncryptionKeyId",kee="DefaultEnaQueueCountPerInterface",Pee="DefaultForAz",Nee="DedicatedHostsSupported",Fm="DeviceIndex",Lee="DiskInfoList",zee="DescribeImagesRequest",Bee="DescribeImagesResult",$ee="DescribeInstancesRequest",Uee="DescribeInstancesResult",jee="DescribeInstanceTypesRequest",Hee="DescribeInstanceTypesResult",Vee="DescribeInstanceTypes",qee="DescribeImages",Fee="DescribeInstances",Gee="DiskInfo",Zee="DeleteKeyPair",Kee="DeleteKeyPairRequest",Qee="DeleteKeyPairResult",Yee="DescribeKeyPairsRequest",Xee="DescribeKeyPairsResult",Wee="DescribeKeyPairs",KS="DeviceName",Jee="DefaultNetworkCardIndex",ete="DestinationOutpostArn",tte="DhcpOptionsId",fa="DeleteOnTermination",nte="DeregistrationProtection",bt="DryRun",ste="DescribeRegionsRequest",rte="DescribeRegionsResult",ote="DestinationRegion",ite="DescribeRegions",ate="DeleteSnapshotRequest",cte="DeleteSubnetRequest",lte="DescribeSnapshotsRequest",ute="DescribeSnapshotsResult",fte="DescribeSubnetsRequest",dte="DescribeSubnetsResult",hte="DeleteSnapshot",pte="DeleteSubnet",mte="DescribeSnapshots",gte="DescribeSubnets",yte="DefaultThreadsPerCore",bte="DeprecationTime",vte="DefaultVCpus",Ste="DeleteVolumeRequest",_te="DeleteVpcRequest",wte="DescribeVolumesRequest",Ete="DescribeVolumesResult",xte="DescribeVpcsRequest",Rte="DescribeVpcsResult",Cte="DetachVolumeRequest",Ate="DeleteVolume",Tte="DeleteVpc",Ite="DescribeVolumes",Ote="DescribeVpcs",Mte="DetachVolume",pc="Description",QS="Device",Dte="Disks",kte="EbsBlockDevice",Pte="ExecutableByStringList",C3="ExecutableBy",nd="EbsCardIndex",Nte="EbsCardInfoList",Lte="EbsCardInfo",zte="EbsCards",Bte="EncryptionControl",$te="EnableDns64",Ute="ElasticFileSystem",jte="ElasticFileSystemExclusion",Hte="ElasticGpuAssociation",Vte="ElasticGpuAssociationId",qte="ElasticGpuAssociationList",Fte="ElasticGpuAssociationState",Gte="ElasticGpuAssociationTime",Zte="ElasticGpuAssociations",Kte="ElasticGpuId",A3="ElasticGpuSpecification",Qte="ElasticGpuSpecifications",T3="ElasticInferenceAccelerator",Yte="ElasticInferenceAcceleratorAssociation",Xte="ElasticInferenceAcceleratorAssociationId",Wte="ElasticInferenceAcceleratorAssociationList",Jte="ElasticInferenceAcceleratorAssociationState",ene="ElasticInferenceAcceleratorAssociationTime",tne="ElasticInferenceAcceleratorArn",nne="ElasticInferenceAcceleratorAssociations",I3="ElasticInferenceAccelerators",sne="EbsInstanceBlockDevice",rne="EbsInstanceBlockDeviceSpecification",one="EncryptionInTransitSupported",O3="EbsInfo",M3="EfaInfo",ine="EnableLniAtDeviceIndex",YS="EbsOptimized",D3="EbsOptimizedInfo",ane="EgressOnlyInternetGateway",cne="EgressOnlyInternetGatewayExclusion",lne="EnclaveOptionsRequest",une="EbsOptimizedSupport",XS="EnclaveOptions",fne="EnablePrimaryIpv6",k3="EnaQueueCount",WS="EnableResourceNameDnsAAAARecord",JS="EnableResourceNameDnsARecord",P3="EnaSrdEnabled",N3="EnaSrdSpecification",dne="EnaSrdSpecificationRequest",hne="EnaSrdSupported",L3="EnaSrdUdpEnabled",z3="EnaSrdUdpSpecification",pne="EnaSrdUdpSpecificationRequest",mne="EfaSupported",B3="EncryptionSupport",Gm="EnaSupport",gne="EndTime",yne="ExecutableUsers",e_="Ebs",t_="Enabled",sd="Encrypted",bne="Endpoint",n_="Force",vne="FpgaDeviceInfo",Sne="FpgaDeviceInfoList",_ne="FpgaDeviceMemoryInfo",wne="FlexibleEnaQueuesSupport",$3="FpgaInfo",Ene="FilterList",xne="FastRestored",Rne="FullSnapshotSizeInBytes",U3="FreeTierEligible",no="Filters",Er="Filter",Cne="Fpgas",Zm="Groups",Ane="GetConsoleOutput",Tne="GetConsoleOutputRequest",Ine="GetConsoleOutputResult",One="GpuDeviceInfo",Mne="GpuDeviceInfoList",Dne="GpuDeviceMemoryInfo",kne="GroupIdentifierList",Pne="GroupIdStringList",j3="GpuInfo",s_="GroupId",Nne="GroupIdentifier",Lne="GroupLongName",r_="GroupName",zne="GpuPartitionSize",H3="Geography",Bne="Gpus",V3="HttpEndpoint",$ne="HostId",o_="HibernationOptions",Une="HibernationOptionsRequest",q3="HttpProtocolIpv6",F3="HttpPutResponseHopLimit",jne="HostResourceGroupArn",Hne="HibernationSupported",G3="HttpTokens",i_="HostnameType",Vne="Hibernate",a_="Hypervisor",qne="Id",c_="Ipv6Addresses",Z3="Ipv6AddressAttribute",K3="Ipv6AddressCount",Fne="InstanceAttachmentEnaSrdSpecification",Gne="InstanceAttachmentEnaSrdUdpSpecification",Q3="InferenceAcceleratorInfo",Zne="Ipv4AddressesPerInterface",Kne="Ipv6AddressesPerInterface",Qne="Ipv4AddressesPerSecondaryInterface",Yne="ImageAllowed",l_="Ipv6Address",Xne="InstanceBlockDeviceMapping",Wne="InstanceBlockDeviceMappingList",Jne="InstanceBlockDeviceMappingSpecification",ese="InstanceBlockDeviceMappingSpecificationList",Km="Ipv6CidrBlock",Y3="Ipv6CidrBlockAssociationSet",tse="Ipv6CidrBlockNetworkBorderGroup",X3="Ipv6CidrBlockState",nse="IncludeDeprecated",sse="InferenceDeviceInfo",rse="InferenceDeviceInfoList",ose="InferenceDeviceMemoryInfo",ise="IncludeDisabled",ase="IsDefault",cse="InternetGateway",lse="InternetGatewayBlockMode",use="InternetGatewayExclusion",ls="InstanceId",fse="InstanceIpv6Address",dse="InstanceIpv6AddressList",hse="InstanceInterruptionBehavior",u_="IamInstanceProfile",W3="Ipv6IpamPoolId",J3="Ipv4IpamPoolId",pse="InstanceIpv4PrefixList",mse="InstanceIpv6PrefixList",gse="IamInstanceProfileSpecification",yse="InstanceIpv4Prefix",bse="InstanceIpv6Prefix",eP="InstanceInitiatedShutdownBehavior",vse="ImageIdStringList",Sse="InstanceIdStringList",Hl="ImageId",_se="ImageIds",rd="InstanceIds",wse="ImportKeyPair",Ese="ImportKeyPairRequest",xse="ImportKeyPairResult",Rse="ImageLocation",Cse="ImageList",Ase="InstanceLifecycle",Tse="InstanceList",Ise="InstanceMaintenanceOptions",Ose="InstanceMaintenanceOptionsRequest",Mse="InstanceMarketOptionsRequest",Dse="InstanceMetadataOptionsRequest",kse="InstanceMetadataOptionsResponse",Pse="InstanceMarketOptions",tP="InstanceMetadataTags",nP="Ipv6Native",Nse="InstanceNetworkInterface",Lse="InstanceNetworkInterfaceAssociation",zse="InstanceNetworkInterfaceAttachment",Bse="InstanceNetworkInterfaceList",$se="InstanceNetworkInterfaceSpecification",Use="InstanceNetworkInterfaceSpecificationList",sP="Ipv6NetmaskLength",rP="Ipv4NetmaskLength",jse="InstanceNetworkPerformanceOptions",Hse="InstanceNetworkPerformanceOptionsRequest",Vse="ImageOwnerAlias",qse="IpOwnerId",Fse="InstanceOwningService",Gse="Ipv6PrefixCount",Zse="Ipv4PrefixCount",Kse="InstancePrivateIpAddress",Qse="InstancePrivateIpAddressList",Yse="IsPrimaryIpv6",Xse="IncludePublicKey",Wse="Ipv4PrefixList",Jse="Ipv6PrefixList",ere="Ipv4PrefixSpecificationRequest",tre="Ipv6PrefixSpecificationRequest",oP="Ipv6Prefixes",f_="Ipv6Prefix",iP="Ipv6Pool",aP="Ipv4Prefixes",d_="Ipv4Prefix",nre="InstanceStateChange",sre="InstanceStateChangeList",rre="InstanceSecondaryInterfaceAttachment",ore="InstanceSecondaryInterfaceList",ire="InstanceSecondaryInterfacePrivateIpAddress",are="InstanceSecondaryInterfacePrivateIpAddressList",cre="InstanceSecondaryInterfacePrivateIpAddressListRequest",lre="InstanceSecondaryInterfacePrivateIpAddressRequest",ure="InstanceSecondaryInterfaceSpecificationListRequest",fre="InstanceSecondaryInterfaceSpecificationRequest",dre="InstanceSecondaryInterface",cP="InstanceStorageInfo",hre="InstanceStorageSupported",pre="ImdsSupport",mre="InstanceState",lP="IpSource",gre="Ipv6Supported",od="InstanceType",yre="InstanceTypeInfoList",bre="InstanceTypeInfo",vre="ImageType",uP="InstanceTenancy",fP="InstanceTypes",Qm="InterfaceType",Sre="Images",_re="Image",wre="Instance",Ere="Instances",Ym="Iops",xre="Key",Rre="KeyFormat",h_="KeyFingerprint",p_="KernelId",id="KmsKeyId",Cre="KeyMaterial",so="KeyName",Are="KeyNameStringList",Tre="KeyNames",Ire="KeyPairs",mc="KeyPairId",Ore="KeyPairIdStringList",Mre="KeyPairIds",Dre="KeyPairInfo",kre="KeyPairList",Pre="KeyPair",dP="KeyType",Nre="Kernel",hP="LicenseConfigurationArn",Lre="LicenseConfigurationRequest",zre="LicenseConfiguration",Bre="LambdaExclusion",$re="LogicalGpuCount",Ure="LicenseList",jre="LastLaunchedTime",Hre="LicenseSpecifications",Vre="LicenseSpecificationListRequest",qre="LicenseSpecification",Fre="LaunchTemplate",Gre="LaunchTemplateId",Zre="LaunchTemplateName",Kre="LaunchTemplateSpecification",Qre="LaunchTime",Yre="Latest",Xre="Lambda",Wre="Licenses",Jre="Location",m_="MultiAttachEnabled",pP="MediaAcceleratorInfo",mP="MacAddress",gP="MaximumBandwidthInMbps",eoe="MapCustomerOwnedIpOnLaunch",toe="MaxCount",noe="MinCount",soe="MediaDeviceInfo",roe="MediaDeviceInfoList",ooe="MediaDeviceMemoryInfo",ioe="MaximumEbsAttachments",aoe="MaximumEbsCards",coe="MaximumEfaInterfaces",loe="MaximumEnaQueueCount",uoe="MaximumEnaQueueCountPerInterface",yP="MaximumIops",foe="ModifyInstanceAttributeRequest",doe="ModifyInstanceAttribute",gc="MemoryInfo",hoe="MaximumNetworkCards",bP="MaximumNetworkInterfaces",vP="MetadataOptions",SP="MaintenanceOptions",poe="MapPublicIpOnLaunch",moe="MaxPrice",yc="MaxResults",goe="MaximumSecondaryNetworkInterfaces",yoe="ModificationState",boe="MarketType",_P="MaximumThroughputInMBps",voe="ModifyVolumeRequest",Soe="ModifyVolumeResult",_oe="ModifyVolume",ad="Manufacturer",woe="Managed",wP="Message",Eoe="Messages",EP="Mode",g_="Monitoring",Qs="Name",xP="NetworkBorderGroup",xoe="NetworkCards",cd="NetworkCardIndex",Roe="NetworkCardInfoList",Coe="NetworkCardInfo",RP="NoDevice",Aoe="NeuronDeviceCoreInfo",Toe="NeuronDeviceInfo",Ioe="NeuronDeviceInfoList",Ooe="NeuronDeviceMemoryInfo",Moe="NeuronDevices",Doe="NitroEnclavesSupport",koe="NatGateway",Poe="NatGatewayExclusion",CP="NetworkInterfaceId",AP="NetworkInterfaces",TP="NetworkInfo",IP="NeuronInfo",OP="NetworkPerformanceOptions",MP="NetworkPerformance",Noe="NoReboot",DP="NvmeSupport",kP="NitroTpmInfo",Loe="NitroTpmSupport",zoe="NitroTpmSupportedVersionsList",As="NextToken",PP="NestedVirtualization",da="OutpostArn",Boe="OwnerAlias",bc="OwnerId",NP="OptInStatus",$oe="OriginalIops",Uoe="OwnerIds",joe="OriginalMultiAttachEnabled",Hoe="OperatorRequest",Voe="OperatorResponse",qoe="OwnerStringList",Foe="OriginalSize",Goe="OriginalThroughput",Zoe="OriginalVolumeType",Vl="Operator",Koe="Output",Qoe="Owners",y_="Owner",LP="Principal",Yoe="PeakBandwidthInGbps",Xoe="ProductCodeId",Woe="ProductCodeList",Joe="ProductCodeType",eie="ProductCode",zP="ProductCodes",b_="PrivateDnsName",BP="PrivateDnsNameOptions",$P="PrivateDnsNameOptionsOnLaunch",tie="PrivateDnsNameOptionsRequest",nie="PrivateDnsNameOptionsResponse",UP="PublicDnsName",jP="PlatformDetails",HP="PlacementGroupInfo",sie="PlacementGroupStrategyList",rie="PublicIp",oie="PrivateIpAddressCount",iie="PrivateIpAddressSpecification",aie="PrivateIpAddressSpecificationList",Fo="PrivateIpAddress",Xm="PrivateIpAddresses",cie="PublicIpAddress",lie="PrimaryIpv6",VP="ProcessorInfo",uie="PublicKey",fie="PublicKeyMaterial",die="PartitionNumber",hie="PhcSupport",pie="PreviousState",mie="PresignedUrl",gie="ParentZoneId",yie="ParentZoneName",qP="Platform",v_="Placement",FP="Primary",GP="Progress",bie="Public",vie="Return",Sie="RestorableByUserIds",_ie="RestorableBy",ZP="RootDeviceName",KP="RootDeviceType",wie="RootDeviceTypeList",Eie="RestoreExpiryTime",xie="ResourceExclusions",Rie="RegionGeography",Cie="RegionGeographyList",Aie="RunInstancesMonitoringEnabled",Tie="RebootInstancesRequest",Iie="RunInstancesRequest",Oie="RunInstancesUserData",S_="RamdiskId",Mie="ReservationId",Die="RebootInstances",kie="RequesterId",Pie="RunInstances",Nie="RegionList",Lie="ReservationList",zie="RebootMigrationSupport",Bie="RebootMigration",Wm="RegionName",$ie="RegionNameStringList",Uie="RegionNames",jie="ResourceType",Hie="Ramdisk",Vie="Regions",qie="Region",Fie="Reservations",Gie="Reservation",Zie="SupportedAdditionalProcessorFeatureList",Kie="SubnetArn",Qie="SupportedArchitectures",Yie="SupportedBootModes",Xie="SubnetCidrBlockState",Wie="SustainedClockSpeedInGhz",Jm="SourceDestCheck",Jie="SpreadDomain",eae="SupportedFeatures",tae="SubGeography",__="SecurityGroupId",nae="SecurityGroupIdStringList",sae="SecurityGroupIds",rae="SecurityGroupStringList",QP="SecurityGroups",YP="SecurityGroup",oae="SubnetIds",iae="SubnetIpv6CidrBlockAssociation",aae="SubnetIpv6CidrBlockAssociationSet",cae="SizeInGB",lae="SourceImageId",uae="SecondaryInterfaceId",fae="SourceInstanceId",ql="SizeInMiB",dae="SpotInstanceRequestId",hae="SourceImageRegion",pae="StartInstancesRequest",mae="StartInstancesResult",gae="StopInstancesRequest",yae="StopInstancesResult",bae="SnapshotIdStringList",vae="SubnetIdStringList",Sae="SpotInstanceType",XP="SecondaryInterfaces",_ae="SecondaryInterface",ha="SnapshotId",wae="SnapshotIds",Eae="StartingInstances",xae="StartInstances",Rae="StoppingInstances",Cae="StopInstances",pa="SubnetId",Aae="SnapshotLocation",Tae="SnapshotList",Iae="SubnetList",Oae="SpotMarketOptions",w_="StatusMessage",E_="StateMessage",Mae="SecondaryNetworkId",x_="SriovNetSupport",Dae="SecondaryNetworkSupported",kae="SpotOptions",WP="SkipOsShutdown",Pae="SecondaryPrivateIpAddressCount",Nae="SupportedRootDeviceTypes",Lae="SourceRegion",R_="StateReason",zae="SourceSnapshotId",JP="SecondarySubnetId",Bae="SupportedStrategies",eN="StartTime",$ae="StateTransitionReason",tN="SseType",Uae="StorageTier",jae="SupportedUsageClasses",Hae="SensitiveUserData",Vae="SourceVolumeId",qae="SupportedVirtualizationTypes",Fae="SupportedVersions",C_="Size",Gae="Snapshots",Zae="Snapshot",Ts="State",ld="Status",nN="Subnet",Kae="Subnets",xr="Tags",sN="TcpEstablishedTimeout",Qae="TotalFpgaMemoryInMiB",Yae="TotalGpuMemoryInMiB",Xae="TerminateInstances",Wae="TotalInferenceMemoryInMiB",Jae="TerminateInstancesRequest",ece="TerminateInstancesResult",tce="TargetIops",nce="TerminatingInstances",sce="TagList",rce="TargetMultiAttachEnabled",oce="TotalMediaMemoryInMiB",ice="TotalNeuronDeviceMemoryInMiB",rN="ThreadsPerCore",ace="ThreadsPerCoreList",Go="TagSpecifications",cce="TotalSizeInGB",lce="TagSpecificationList",ro="TagSpecification",uce="TargetSize",oN="TpmSupport",fce="TargetThroughput",dce="TransferType",hce="TargetVolumeType",iN="Tag",pce="Tenancy",eg="Throughput",mce="Timestamp",tg="Type",gce="UsageClassTypeList",aN="UserData",cN="UsageOperation",yce="UsageOperationUpdateTime",lN="UdpStreamTimeout",uN="UdpTimeout",Fl="Value",bce="VolumeAttachmentList",vce="VolumeAttachment",Sce="VpcCidrBlockAssociation",_ce="VpcCidrBlockAssociationSet",wce="VpcCidrBlockState",fN="VCpuInfo",Ece="ValidCores",dN="VpcEncryptionControl",xce="VpcEncryptionControlConfiguration",Rce="VpcEncryptionControlExclusion",Cce="VpcEncryptionControlExclusions",Ace="VpcEncryptionControlId",Zo="VpcId",Tce="VpcIpv6CidrBlockAssociation",Ice="VpcIpv6CidrBlockAssociationSet",A_="VolumeInitializationRate",Oce="VolumeIdStringList",Mce="VpcIdStringList",Ys="VolumeId",Dce="VolumeIds",kce="VpcIds",Pce="VpcLattice",Nce="VpcLatticeExclusion",Lce="VolumeList",zce="VpcList",hN="VolumeModification",pN="VirtualName",Bce="VolumeOwnerId",$ce="VpcPeeringExclusion",Uce="VirtualPrivateGateway",jce="VirtualPrivateGatewayExclusion",Hce="VpcPeering",Vce="ValueStringList",mN="VolumeSize",ng="VolumeType",qce="VirtualizationTypeList",Fce="ValidThreadsPerCore",gN="VirtualizationType",Gce="ValidUntil",Zce="Values",yN="Version",Kce="Volumes",Qce="Volume",bN="Vpc",Yce="Vpcs",Xce="WorkloadsList",Wce="Workloads",T_="ZoneId",Jce="ZoneIdStringList",ele="ZoneIds",I_="ZoneName",tle="ZoneNameStringList",nle="ZoneNames",sle="ZoneType",rle="additionalFlexibleNetworkInterfaces",ole="availableIpAddressCount",ile="assignIpv6AddressOnCreation",vN="additionalInfo",O_="associationId",SN="attachmentId",ale="amiLaunchIndex",cle="attachmentLimitType",lle="associatePublicIpAddress",ule="amazonProvidedIpv6CidrBlock",fle="autoRecoverySupported",_N="associatedResource",dle="autoRecovery",hle="amdSevSnp",ple="attachmentSet",sg="attachTime",ud="availabilityZone",M_="availabilityZoneId",mle="availabilityZoneInfo",wN="accelerators",gle="affinity",EN="arn",xN="architecture",RN="association",CN="attachment",yle="attribute",ble="baselineBandwidthInGbps",AN="baselineBandwidthInMbps",rg="blockDeviceMapping",TN="baselineIops",IN="bootMode",vle="bareMetal",ON="blockPublicAccessStates",Sle="burstablePerformanceSupported",MN="baselineThroughputInMBps",_le="bandwidthWeighting",wle="bandwidthWeightings",D_="cidrBlock",Ele="cidrBlockAssociationSet",xle="capacityBlockId",Rle="cidrBlockState",Cle="coreCount",Ale="completionDurationMinutes",Tle="creationDate",Ile="currentGeneration",Ole="carrierIp",Mle="currentInstanceBootMode",Dle="coreInfo",kle="cpuOptions",Ple="customerOwnedIp",Nle="customerOwnedIpv4Pool",DN="capacityReservationId",Lle="capacityReservationPreference",zle="capacityReservationResourceGroupArn",Ble="capacityReservationSpecification",$le="capacityReservationTarget",Ule="currentState",kN="clientToken",jle="connectionTrackingConfiguration",Hle="completionTime",PN="createTime",NN="code",Vle="configured",vc="count",LN="disableApiTermination",qle="defaultCores",Fle="dataEncryptionKeyId",Gle="defaultEnaQueueCountPerInterface",Zle="defaultForAz",Kle="dedicatedHostsSupported",k_="deviceIndex",P_="deviceName",Qle="defaultNetworkCardIndex",Yle="dnsName",Xle="dhcpOptionsId",Sc="deleteOnTermination",Wle="deregistrationProtection",Ct="dryRun",Jle="destinationRegion",eue="defaultThreadsPerCore",tue="deprecationTime",nue="defaultVCpus",fd="description",sue="device",rue="disks",N_="ebsCardIndex",oue="ebsCardSet",iue="encryptionControl",aue="enableDns64",cue="elasticFileSystem",lue="elasticGpuAssociationId",uue="elasticGpuAssociationState",fue="elasticGpuAssociationSet",due="elasticGpuAssociationTime",hue="elasticGpuId",pue="elasticInferenceAcceleratorArn",mue="elasticInferenceAcceleratorAssociationId",gue="elasticInferenceAcceleratorAssociationState",yue="elasticInferenceAcceleratorAssociationSet",bue="elasticInferenceAcceleratorAssociationTime",vue="encryptionInTransitSupported",Sue="ebsInfo",_ue="efaInfo",wue="enableLniAtDeviceIndex",L_="ebsOptimized",Eue="ebsOptimizedInfo",xue="egressOnlyInternetGateway",Rue="ebsOptimizedSupport",Cue="enclaveOptions",Aue="enaQueueCount",S="ec2QueryName",zN="enableResourceNameDnsAAAARecord",BN="enableResourceNameDnsARecord",Tue="enaSrdEnabled",Iue="enaSrdSpecification",Oue="enaSrdSupported",Mue="enaSrdUdpEnabled",Due="enaSrdUdpSpecification",kue="efaSupported",$N="encryptionSupport",og="enaSupport",Pue="endTime",z_="ebs",UN="enabled",dd="encrypted",Nue="flexibleEnaQueuesSupport",Lue="fpgaInfo",zue="fastRestored",Bue="fullSnapshotSizeInBytes",jN="freeTierEligible",$ue="force",Uue="fpgas",jue="gpuInfo",B_="groupId",Hue="groupLongName",$_="groupName",Vue="gpuPartitionSize",HN="geographySet",U_="groupSet",que="gpus",j_="hypervisor",Fue="httpEndpoint",Gue="hostId",Zue="hibernationOptions",Kue="httpProtocolIpv6",Que="httpPutResponseHopLimit",Yue="hostResourceGroupArn",Xue="hibernationSupported",Wue="httpTokens",VN="hostnameType",Jue="id",qN="ipv6AddressAttribute",efe="ipv6AddressCount",tfe="inferenceAcceleratorInfo",nfe="ipv4AddressesPerInterface",sfe="ipv6AddressesPerInterface",rfe="ipv4AddressesPerSecondaryInterface",FN="ipv6AddressesSet",ofe="imageAllowed",ife="ipAddress",GN="ipv6Address",ZN="ipv6CidrBlock",KN="ipv6CidrBlockAssociationSet",QN="ipv6CidrBlockState",afe="isDefault",cfe="internetGateway",lfe="internetGatewayBlockMode",Gl="instanceId",YN="iamInstanceProfile",XN="instanceInitiatedShutdownBehavior",H_="imageId",ufe="imageLocation",ffe="instanceLifecycle",dfe="instanceMetadataTags",hfe="ipv6Native",pfe="imageOwnerAlias",mfe="imageOwnerId",gfe="ipOwnerId",yfe="instanceOwningService",bfe="isPrimaryIpv6",vfe="ipv4PrefixSet",Sfe="ipv6PrefixSet",_fe="ipv4Prefix",wfe="ipv6Pool",Efe="ipv6Prefix",xfe="isPublic",Rfe="instanceStorageInfo",Cfe="instanceStorageSupported",Afe="imagesSet",Tfe="imageState",Ife="imdsSupport",ig="instancesSet",Ofe="instanceState",WN="ipSource",Mfe="ipv6Supported",V_="instanceType",Dfe="instanceTypeSet",kfe="idempotencyToken",Pfe="imageType",JN="instanceTenancy",eL="interfaceType",tL="iops",ke="item",Nfe="key",q_="keyFingerprint",nL="kernelId",ag="kmsKeyId",Lfe="keyMaterial",hd="keyName",cg="keyPairId",zfe="keySet",Bfe="keyType",$fe="kernel",Ufe="licenseConfigurationArn",jfe="logicalGpuCount",Hfe="lastLaunchedTime",Vfe="licenseSet",qfe="launchTime",Ffe="lambda",Gfe="multiAttachEnabled",Zfe="mediaAcceleratorInfo",sL="macAddress",rL="maximumBandwidthInMbps",Kfe="mapCustomerOwnedIpOnLaunch",Qfe="maximumEbsAttachments",Yfe="maximumEbsCards",Xfe="maximumEfaInterfaces",Wfe="maximumEnaQueueCount",Jfe="maximumEnaQueueCountPerInterface",oL="maximumIops",Zl="memoryInfo",ede="maximumNetworkCards",iL="maximumNetworkInterfaces",tde="metadataOptions",nde="maintenanceOptions",sde="mapPublicIpOnLaunch",aL="maxResults",rde="messageSet",ode="maximumSecondaryNetworkInterfaces",ide="modificationState",cL="maximumThroughputInMBps",pd="manufacturer",ade="managed",lL="message",cde="monitoring",lde="mode",Rr="name",uL="networkBorderGroup",ude="networkCards",F_="networkCardIndex",fL="noDevice",fde="neuronDevices",dde="nitroEnclavesSupport",hde="natGateway",dL="networkInterfaceId",pde="networkInterfaceSet",mde="networkInterface",gde="networkInfo",yde="neuronInfo",bde="networkPerformanceOptions",hL="networkPerformance",vde="noReboot",pL="nvmeSupport",Sde="nitroTpmInfo",_de="nitroTpmSupport",Ko="nextToken",wde="nestedVirtualization",md="outpostArn",Ede="ownerAlias",Kl="ownerId",mL="optInStatus",xde="originalIops",Rde="originalMultiAttachEnabled",Cde="originalSize",Ade="originalThroughput",Tde="originalVolumeType",lg="operator",Ide="output",Ode="principal",Mde="peakBandwidthInGbps",gL="productCodes",Dde="productCode",kde="privateDnsNameOptions",Pde="privateDnsNameOptionsOnLaunch",G_="privateDnsName",Nde="publicDnsName",yL="platformDetails",Lde="placementGroupInfo",zde="publicIp",bL="privateIpAddressesSet",Bde="privateIpAddressSet",_c="privateIpAddress",$de="processorInfo",Ude="publicKey",jde="publicKeyMaterial",Hde="partitionNumber",Vde="phcSupport",qde="previousState",Fde="presignedUrl",Gde="parentZoneId",Zde="parentZoneName",vL="platform",Kde="placement",SL="primary",_L="progress",Qde="return",wL="rootDeviceName",EL="rootDeviceType",Yde="restoreExpiryTime",Xde="regionEndpoint",Wde="resourceExclusions",Jde="reservationId",xL="ramdiskId",ehe="regionInfo",the="requesterId",nhe="rebootMigrationSupport",she="rebootMigration",RL="regionName",rhe="reservationSet",ohe="resourceType",ihe="ramdisk",ahe="reason",CL="smithy.ts.sdk.synthetic.com.amazonaws.ec2",che="supportedArchitectures",lhe="subnetArn",uhe="supportedBootModes",fhe="sustainedClockSpeedInGhz",Z_="sourceDestCheck",dhe="spreadDomain",hhe="supportedFeatures",phe="subGeographySet",mhe="sizeInGB",ghe="sourceInstanceId",yhe="secondaryInterfaceId",bhe="sourceImageId",Ql="sizeInMiB",vhe="sourceImageRegion",She="spotInstanceRequestId",_he="secondaryInterfaceSet",ug="snapshotId",fg="subnetId",dg="statusMessage",AL="stateMessage",whe="secondaryNetworkId",Ehe="secondaryNetworkSupported",K_="sriovNetSupport",xhe="secondaryPrivateIpAddressCount",Rhe="supportedRootDeviceTypes",TL="stateReason",Che="secondarySubnetId",Ahe="snapshotSet",The="subnetSet",Ihe="supportedStrategies",IL="startTime",OL="sseType",Ohe="storageTier",Mhe="supportedUsageClasses",Dhe="sourceVolumeId",khe="supportedVirtualizationTypes",Phe="supportedVersions",Nhe="size",ma="state",ga="status",Lhe="subnet",zhe="tenancy",Bhe="tcpEstablishedTimeout",$he="totalFpgaMemoryInMiB",Uhe="totalGpuMemoryInMiB",jhe="totalInferenceMemoryInMiB",Hhe="targetIops",Vhe="targetMultiAttachEnabled",qhe="totalMediaMemoryInMiB",Fhe="totalNeuronDeviceMemoryInMiB",Ghe="threadsPerCore",zr="tagSet",Zhe="totalSizeInGB",Khe="targetSize",ML="tpmSupport",Qhe="targetThroughput",Yhe="transferType",Xhe="targetVolumeType",DL="throughput",Whe="timestamp",Q_="type",Jhe="userData",kL="usageOperation",epe="usageOperationUpdateTime",tpe="udpStreamTimeout",npe="udpTimeout",gd="value",spe="vCpuInfo",rpe="validCores",ope="vpcEncryptionControlId",yd="vpcId",ipe="volumeInitializationRate",Yl="volumeId",ape="vpcLattice",cpe="volumeModification",PL="virtualName",lpe="volumeOwnerId",upe="virtualPrivateGateway",fpe="vpcPeering",dpe="volumeSet",NL="volumeSize",hpe="vpcSet",LL="volumeType",ppe="validThreadsPerCore",zL="virtualizationType",mpe="version",gpe="vpc",ype="workloadSet",y="xmlName",bpe="zoneId",vpe="zoneName",Spe="zoneState",_pe="zoneType",O="com.amazonaws.ec2",BL=ts.for(CL);var wpe=[-3,CL,"EC2ServiceException",0,[],[]];BL.registerError(wpe,$S);const Epe=[BL];var xpe=[0,O,iee,8,0],Rpe=[0,O,Oie,8,0],Cpe=[0,O,Hae,8,0],Ape=[3,O,mJ,0,[QS,ls,Ys,nd,bt],[0,0,0,1,[2,{[S]:"DryRun",[y]:Ct}]],3],ff=[3,O,sJ,0,[Fl],[[2,{[S]:"Value",[y]:gd}]]],df=[3,O,gJ,0,[Fl],[[0,{[S]:"Value",[y]:gd}]]],Tpe=[3,O,la,0,[NP,Eoe,Wm,I_,T_,r_,xP,sle,yie,gie,Lne,H3,tae,Ts],[[0,{[S]:"OptInStatus",[y]:mL}],[()=>Lye,{[S]:"MessageSet",[y]:rde}],[0,{[S]:"RegionName",[y]:RL}],[0,{[S]:"ZoneName",[y]:vpe}],[0,{[S]:"ZoneId",[y]:bpe}],[0,{[S]:"GroupName",[y]:$_}],[0,{[S]:"NetworkBorderGroup",[y]:uL}],[0,{[S]:"ZoneType",[y]:_pe}],[0,{[S]:"ParentZoneName",[y]:Zde}],[0,{[S]:"ParentZoneId",[y]:Gde}],[0,{[S]:"GroupLongName",[y]:Hue}],[()=>Pye,{[S]:"GeographySet",[y]:HN}],[()=>zye,{[S]:"SubGeographySet",[y]:phe}],[0,{[S]:"ZoneState",[y]:Spe}]]],Ipe=[3,O,bJ,0,[Qs],[[0,{[S]:"Name",[y]:Rr}]]],Ope=[3,O,_J,0,[wP],[[0,{[S]:"Message",[y]:lL}]]],Mpe=[3,O,EJ,0,[Qs],[[0,{[S]:"Name",[y]:Rr}]]],Dpe=[3,O,IJ,0,[Fl],[[21,{[S]:"Value",[y]:gd}]]],$L=[3,O,jS,0,[e_,RP,KS,pN],[[()=>Ame,{[S]:"Ebs",[y]:z_}],[0,{[S]:"NoDevice",[y]:fL}],[0,{[S]:"DeviceName",[y]:P_}],[0,{[S]:"VirtualName",[y]:PL}]]],UL=[3,O,HS,0,[lse],[[0,{[S]:"InternetGatewayBlockMode",[y]:lfe}]]],kpe=[3,O,FS,0,[v3,GS],[0,()=>Npe]],Ppe=[3,O,see,0,[v3,GS],[[0,{[S]:"CapacityReservationPreference",[y]:Lle}],[()=>Lpe,{[S]:"CapacityReservationTarget",[y]:$le}]]],Npe=[3,O,GS,0,[qS,S3],[0,0]],Lpe=[3,O,ree,0,[qS,S3],[[0,{[S]:"CapacityReservationId",[y]:DN}],[0,{[S]:"CapacityReservationResourceGroupArn",[y]:zle}]]],zpe=[3,O,vee,0,[sN,lN,uN],[1,1,1]],Bpe=[3,O,See,0,[sN,lN,uN],[[1,{[S]:"TcpEstablishedTimeout",[y]:Bhe}],[1,{[S]:"UdpStreamTimeout",[y]:tpe}],[1,{[S]:"UdpTimeout",[y]:npe}]]],$pe=[3,O,oee,0,[Lae,zae,pc,ete,ote,sd,id,mie,Go,b3,Aee,bt],[0,0,0,0,[0,{[S]:"DestinationRegion",[y]:Jle}],[2,{[S]:"Encrypted",[y]:dd}],[0,{[S]:"KmsKeyId",[y]:ag}],[()=>xpe,{[S]:"PresignedUrl",[y]:Fde}],[()=>Qo,{[y]:ro}],1,0,[2,{[S]:"DryRun",[y]:Ct}]],2],Upe=[3,O,aee,0,[xr,ha],[[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"SnapshotId",[y]:ug}]]],jpe=[3,O,VS,0,[y3,rN,i3,PP],[[1,{[S]:"CoreCount",[y]:Cle}],[1,{[S]:"ThreadsPerCore",[y]:Ghe}],[0,{[S]:"AmdSevSnp",[y]:hle}],[0,{[S]:"NestedVirtualization",[y]:wde}]]],Hpe=[3,O,nee,0,[y3,rN,i3,PP],[1,1,0,0]],Vpe=[3,O,KJ,0,[ls,Qs,Go,Aae,bt,pc,Noe,ed],[[0,{[S]:"InstanceId",[y]:Gl}],[0,{[S]:"Name",[y]:Rr}],[()=>Qo,{[y]:ro}],0,[2,{[S]:"DryRun",[y]:Ct}],[0,{[S]:"Description",[y]:fd}],[2,{[S]:"NoReboot",[y]:vde}],[()=>XL,{[S]:"BlockDeviceMapping",[y]:rg}]],2],qpe=[3,O,QJ,0,[Hl],[[0,{[S]:"ImageId",[y]:H_}]]],Fpe=[3,O,JJ,0,[so,dP,Go,Rre,bt],[0,0,[()=>Qo,{[y]:ro}],0,[2,{[S]:"DryRun",[y]:Ct}]],1],Gpe=[3,O,cee,0,[Ys,pc,da,Go,Jre,bt],[0,0,0,[()=>Qo,{[y]:ro}],0,[2,{[S]:"DryRun",[y]:Ct}]],1],Zpe=[3,O,lee,0,[Zo,Go,la,jl,td,Km,da,nP,J3,rP,W3,sP,bt],[0,[()=>Qo,{[y]:ro}],0,0,0,0,0,2,0,1,0,1,[2,{[S]:"DryRun",[y]:Ct}]],1],Kpe=[3,O,uee,0,[nN],[[()=>ZL,{[S]:"Subnet",[y]:Lhe}]]],Qpe=[3,O,wee,0,[la,jl,sd,Ym,id,da,C_,ha,ng,Go,m_,eg,ZS,A_,Vl,bt],[0,0,[2,{[S]:"Encrypted",[y]:dd}],1,0,0,1,0,0,[()=>Qo,{[y]:ro}],2,1,[0,4],1,()=>HL,[2,{[S]:"DryRun",[y]:Ct}]]],Ype=[3,O,Eee,0,[td,iP,Km,J3,rP,W3,sP,tse,dN,Go,bt,uP,fJ],[0,0,0,0,1,0,1,0,()=>Oye,[()=>Qo,{[y]:ro}],[2,{[S]:"DryRun",[y]:Ct}],[0,{[S]:"InstanceTenancy",[y]:JN}],[2,{[S]:"AmazonProvidedIpv6CidrBlock",[y]:ule}]]],Xpe=[3,O,xee,0,[bN],[[()=>QL,{[S]:"Vpc",[y]:gpe}]]],Wpe=[3,O,fee,0,[VJ],[0],1],Jpe=[3,O,Kee,0,[so,mc,bt],[0,0,[2,{[S]:"DryRun",[y]:Ct}]]],eme=[3,O,Qee,0,[vie,mc],[[2,{[S]:"Return",[y]:Qde}],[0,{[S]:"KeyPairId",[y]:cg}]]],tme=[3,O,ate,0,[ha,bt],[0,[2,{[S]:"DryRun",[y]:Ct}]],1],nme=[3,O,cte,0,[pa,bt],[0,[2,{[S]:"DryRun",[y]:Ct}]],1],sme=[3,O,Ste,0,[Ys,bt],[0,[2,{[S]:"DryRun",[y]:Ct}]],1],rme=[3,O,_te,0,[Zo,bt],[0,[2,{[S]:"DryRun",[y]:Ct}]],1],ome=[3,O,Tee,0,[nle,ele,nJ,bt,no],[[()=>W0e,{[y]:I_}],[()=>X0e,{[y]:T_}],2,[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}]]],ime=[3,O,Iee,0,[RJ],[[()=>Nye,{[S]:"AvailabilityZoneInfo",[y]:mle}]]],ame=[3,O,zee,0,[yne,_se,Qoe,nse,ise,yc,As,bt,no],[[()=>Kye,{[y]:C3}],[()=>Wye,{[y]:Hl}],[()=>WL,{[y]:y_}],2,2,1,0,[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}]]],cme=[3,O,Bee,0,[As,Sre],[[0,{[S]:"NextToken",[y]:Ko}],[()=>Jye,{[S]:"ImagesSet",[y]:Afe}]]],lme=[3,O,$ee,0,[rd,bt,no,As,yc],[[()=>bd,{[y]:ls}],[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}],[0,{[S]:"NextToken",[y]:Ko}],[1,{[S]:"MaxResults",[y]:aL}]]],ume=[3,O,Uee,0,[As,Fie],[[0,{[S]:"NextToken",[y]:Ko}],[()=>O0e,{[S]:"ReservationSet",[y]:rhe}]]],fme=[3,O,jee,0,[bt,fP,no,yc,As],[2,[64,{[y]:od}],[()=>oo,{[y]:Er}],1,0]],dme=[3,O,Hee,0,[fP,As],[[()=>h0e,{[S]:"InstanceTypeSet",[y]:Dfe}],[0,{[S]:"NextToken",[y]:Ko}]]],hme=[3,O,Yee,0,[Tre,Mre,Xse,bt,no],[[()=>g0e,{[y]:so}],[()=>y0e,{[y]:mc}],2,[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}]]],pme=[3,O,Xee,0,[Ire],[[()=>b0e,{[S]:"KeySet",[y]:zfe}]]],mme=[3,O,ste,0,[Uie,hJ,bt,no],[[()=>I0e,{[y]:Wm}],2,[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}]]],gme=[3,O,rte,0,[Vie],[[()=>T0e,{[S]:"RegionInfo",[y]:ehe}]]],yme=[3,O,lte,0,[yc,As,Uoe,Sie,wae,bt,no],[1,0,[()=>WL,{[y]:y_}],[64,{[y]:_ie}],[()=>k0e,{[y]:ha}],[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}]]],bme=[3,O,ute,0,[As,Gae],[[0,{[S]:"NextToken",[y]:Ko}],[()=>P0e,{[S]:"SnapshotSet",[y]:Ahe}]]],vme=[3,O,fte,0,[no,oae,As,yc,bt],[[()=>oo,{[y]:Er}],[()=>N0e,{[y]:pa}],0,1,[2,{[S]:"DryRun",[y]:Ct}]]],Sme=[3,O,dte,0,[As,Kae],[[0,{[S]:"NextToken",[y]:Ko}],[()=>z0e,{[S]:"SubnetSet",[y]:The}]]],_me=[3,O,wte,0,[Dce,bt,no,As,yc],[[()=>q0e,{[y]:Ys}],[2,{[S]:"DryRun",[y]:Ct}],[()=>oo,{[y]:Er}],[0,{[S]:"NextToken",[y]:Ko}],[1,{[S]:"MaxResults",[y]:aL}]]],wme=[3,O,Ete,0,[As,Kce],[[0,{[S]:"NextToken",[y]:Ko}],[()=>F0e,{[S]:"VolumeSet",[y]:dpe}]]],Eme=[3,O,xte,0,[no,kce,As,yc,bt],[[()=>oo,{[y]:Er}],[()=>Z0e,{[y]:Zo}],0,1,[2,{[S]:"DryRun",[y]:Ct}]]],xme=[3,O,Rte,0,[As,Yce],[[0,{[S]:"NextToken",[y]:Ko}],[()=>Q0e,{[S]:"VpcSet",[y]:hpe}]]],Rme=[3,O,Cte,0,[Ys,QS,n_,ls,bt],[0,0,2,0,[2,{[S]:"DryRun",[y]:Ct}]],1],Cme=[3,O,Gee,0,[cae,ua,tg],[[1,{[S]:"SizeInGB",[y]:mhe}],[1,{[S]:"Count",[y]:vc}],[0,{[S]:"Type",[y]:Q_}]]],Ame=[3,O,kte,0,[fa,Ym,ha,mN,ng,id,eg,da,la,sd,A_,jl,nd],[[2,{[S]:"DeleteOnTermination",[y]:Sc}],[1,{[S]:"Iops",[y]:tL}],[0,{[S]:"SnapshotId",[y]:ug}],[1,{[S]:"VolumeSize",[y]:NL}],[0,{[S]:"VolumeType",[y]:LL}],[0,{[S]:"KmsKeyId",[y]:ag}],[1,{[S]:"Throughput",[y]:DL}],[0,{[S]:"OutpostArn",[y]:md}],[0,{[S]:"AvailabilityZone",[y]:ud}],[2,{[S]:"Encrypted",[y]:dd}],1,0,1]],Tme=[3,O,Lte,0,[nd,d3,m3,h3,gP,_P,yP],[[1,{[S]:"EbsCardIndex",[y]:N_}],[1,{[S]:"BaselineBandwidthInMbps",[y]:AN}],[1,{[S]:"BaselineThroughputInMBps",[y]:MN}],[1,{[S]:"BaselineIops",[y]:TN}],[1,{[S]:"MaximumBandwidthInMbps",[y]:rL}],[1,{[S]:"MaximumThroughputInMBps",[y]:cL}],[1,{[S]:"MaximumIops",[y]:oL}]]],Ime=[3,O,O3,0,[une,B3,D3,DP,ioe,lJ,aoe,zte],[[0,{[S]:"EbsOptimizedSupport",[y]:Rue}],[0,{[S]:"EncryptionSupport",[y]:$N}],[()=>Dme,{[S]:"EbsOptimizedInfo",[y]:Eue}],[0,{[S]:"NvmeSupport",[y]:pL}],[1,{[S]:"MaximumEbsAttachments",[y]:Qfe}],[0,{[S]:"AttachmentLimitType",[y]:cle}],[1,{[S]:"MaximumEbsCards",[y]:Yfe}],[()=>Vye,{[S]:"EbsCardSet",[y]:oue}]]],Ome=[3,O,sne,0,[qm,fa,ld,Ys,r3,Bce,Vl,nd],[[4,{[S]:"AttachTime",[y]:sg}],[2,{[S]:"DeleteOnTermination",[y]:Sc}],[0,{[S]:"Status",[y]:ga}],[0,{[S]:"VolumeId",[y]:Yl}],[0,{[S]:"AssociatedResource",[y]:_N}],[0,{[S]:"VolumeOwnerId",[y]:lpe}],[()=>hg,{[S]:"Operator",[y]:lg}],[1,{[S]:"EbsCardIndex",[y]:N_}]]],Mme=[3,O,rne,0,[Ys,fa],[[0,{[S]:"VolumeId",[y]:Yl}],[2,{[S]:"DeleteOnTermination",[y]:Sc}]]],Dme=[3,O,D3,0,[d3,m3,h3,gP,_P,yP],[[1,{[S]:"BaselineBandwidthInMbps",[y]:AN}],[1,{[S]:"BaselineThroughputInMBps",[y]:MN}],[1,{[S]:"BaselineIops",[y]:TN}],[1,{[S]:"MaximumBandwidthInMbps",[y]:rL}],[1,{[S]:"MaximumThroughputInMBps",[y]:cL}],[1,{[S]:"MaximumIops",[y]:oL}]]],kme=[3,O,M3,0,[coe],[[1,{[S]:"MaximumEfaInterfaces",[y]:Xfe}]]],Pme=[3,O,Hte,0,[Kte,Vte,Fte,Gte],[[0,{[S]:"ElasticGpuId",[y]:hue}],[0,{[S]:"ElasticGpuAssociationId",[y]:lue}],[0,{[S]:"ElasticGpuAssociationState",[y]:uue}],[0,{[S]:"ElasticGpuAssociationTime",[y]:due}]]],Nme=[3,O,A3,0,[tg],[0],1],Lme=[3,O,T3,0,[tg,ua],[0,1],1],zme=[3,O,Yte,0,[tne,Xte,Jte,ene],[[0,{[S]:"ElasticInferenceAcceleratorArn",[y]:pue}],[0,{[S]:"ElasticInferenceAcceleratorAssociationId",[y]:mue}],[0,{[S]:"ElasticInferenceAcceleratorAssociationState",[y]:gue}],[4,{[S]:"ElasticInferenceAcceleratorAssociationTime",[y]:bue}]]],Bme=[3,O,dne,0,[P3,z3],[2,()=>$me]],$me=[3,O,pne,0,[L3],[2]],Ume=[3,O,XS,0,[t_],[[2,{[S]:"Enabled",[y]:UN}]]],jme=[3,O,lne,0,[t_],[2]],Hme=[3,O,Er,0,[Qs,Zce],[0,[()=>j0e,{[y]:Fl}]]],Vme=[3,O,vne,0,[Qs,ad,ua,gc],[[0,{[S]:"Name",[y]:Rr}],[0,{[S]:"Manufacturer",[y]:pd}],[1,{[S]:"Count",[y]:vc}],[()=>qme,{[S]:"MemoryInfo",[y]:Zl}]]],qme=[3,O,_ne,0,[ql],[[1,{[S]:"SizeInMiB",[y]:Ql}]]],Fme=[3,O,$3,0,[Cne,Qae],[[()=>Qye,{[S]:"Fpgas",[y]:Uue}],[1,{[S]:"TotalFpgaMemoryInMiB",[y]:$he}]]],Gme=[3,O,Tne,0,[ls,Yre,bt],[0,2,[2,{[S]:"DryRun",[y]:Ct}]],1],Zme=[3,O,Ine,0,[ls,mce,Koe],[[0,{[S]:"InstanceId",[y]:Gl}],[4,{[S]:"Timestamp",[y]:Whe}],[0,{[S]:"Output",[y]:Ide}]]],Kme=[3,O,One,0,[Qs,ad,ua,$re,zne,Wce,gc],[[0,{[S]:"Name",[y]:Rr}],[0,{[S]:"Manufacturer",[y]:pd}],[1,{[S]:"Count",[y]:vc}],[1,{[S]:"LogicalGpuCount",[y]:jfe}],[1,{[S]:"GpuPartitionSize",[y]:Vue}],[()=>Y0e,{[S]:"WorkloadSet",[y]:ype}],[()=>Qme,{[S]:"MemoryInfo",[y]:Zl}]]],Qme=[3,O,Dne,0,[ql],[[1,{[S]:"SizeInMiB",[y]:Ql}]]],Yme=[3,O,j3,0,[Bne,Yae],[[()=>Yye,{[S]:"Gpus",[y]:que}],[1,{[S]:"TotalGpuMemoryInMiB",[y]:Uhe}]]],Xme=[3,O,Nne,0,[s_,r_],[[0,{[S]:"GroupId",[y]:B_}],[0,{[S]:"GroupName",[y]:$_}]]],Wme=[3,O,o_,0,[E3],[[2,{[S]:"Configured",[y]:Vle}]]],Jme=[3,O,Une,0,[E3],[2]],ege=[3,O,u_,0,[c3,qne],[[0,{[S]:"Arn",[y]:EN}],[0,{[S]:"Id",[y]:Jue}]]],tge=[3,O,gse,0,[c3,Qs],[[0,{[S]:"Arn",[y]:EN}],[0,{[S]:"Name",[y]:Rr}]]],nge=[3,O,_re,0,[jP,cN,ed,pc,Gm,a_,Vse,Qs,ZP,KP,x_,R_,xr,gN,p3,oN,bte,pre,fae,nte,jre,Yne,lae,hae,U3,Hl,Rse,Ts,bc,qJ,bie,zP,l3,vre,p_,S_,qP],[[0,{[S]:"PlatformDetails",[y]:yL}],[0,{[S]:"UsageOperation",[y]:kL}],[()=>$ye,{[S]:"BlockDeviceMapping",[y]:rg}],[0,{[S]:"Description",[y]:fd}],[2,{[S]:"EnaSupport",[y]:og}],[0,{[S]:"Hypervisor",[y]:j_}],[0,{[S]:"ImageOwnerAlias",[y]:pfe}],[0,{[S]:"Name",[y]:Rr}],[0,{[S]:"RootDeviceName",[y]:wL}],[0,{[S]:"RootDeviceType",[y]:EL}],[0,{[S]:"SriovNetSupport",[y]:K_}],[()=>GL,{[S]:"StateReason",[y]:TL}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"VirtualizationType",[y]:zL}],[0,{[S]:"BootMode",[y]:IN}],[0,{[S]:"TpmSupport",[y]:ML}],[0,{[S]:"DeprecationTime",[y]:tue}],[0,{[S]:"ImdsSupport",[y]:Ife}],[0,{[S]:"SourceInstanceId",[y]:ghe}],[0,{[S]:"DeregistrationProtection",[y]:Wle}],[0,{[S]:"LastLaunchedTime",[y]:Hfe}],[2,{[S]:"ImageAllowed",[y]:ofe}],[0,{[S]:"SourceImageId",[y]:bhe}],[0,{[S]:"SourceImageRegion",[y]:vhe}],[2,{[S]:"FreeTierEligible",[y]:jN}],[0,{[S]:"ImageId",[y]:H_}],[0,{[S]:"ImageLocation",[y]:ufe}],[0,{[S]:"ImageState",[y]:Tfe}],[0,{[S]:"ImageOwnerId",[y]:mfe}],[0,{[S]:"CreationDate",[y]:Tle}],[2,{[S]:"IsPublic",[y]:xfe}],[()=>JL,{[S]:"ProductCodes",[y]:gL}],[0,{[S]:"Architecture",[y]:xN}],[0,{[S]:"ImageType",[y]:Pfe}],[0,{[S]:"KernelId",[y]:nL}],[0,{[S]:"RamdiskId",[y]:xL}],[0,{[S]:"Platform",[y]:vL}]]],sge=[3,O,Ese,0,[so,fie,Go,bt],[[0,{[S]:"KeyName",[y]:hd}],[21,{[S]:"PublicKeyMaterial",[y]:jde}],[()=>Qo,{[y]:ro}],[2,{[S]:"DryRun",[y]:Ct}]],2],rge=[3,O,xse,0,[h_,so,mc,xr],[[0,{[S]:"KeyFingerprint",[y]:q_}],[0,{[S]:"KeyName",[y]:hd}],[0,{[S]:"KeyPairId",[y]:cg}],[()=>Cr,{[S]:"TagSet",[y]:zr}]]],oge=[3,O,Q3,0,[a3,Wae],[[()=>e0e,{[S]:"Accelerators",[y]:wN}],[1,{[S]:"TotalInferenceMemoryInMiB",[y]:jhe}]]],ige=[3,O,sse,0,[ua,Qs,ad,gc],[[1,{[S]:"Count",[y]:vc}],[0,{[S]:"Name",[y]:Rr}],[0,{[S]:"Manufacturer",[y]:pd}],[()=>age,{[S]:"MemoryInfo",[y]:Zl}]]],age=[3,O,ose,0,[ql],[[1,{[S]:"SizeInMiB",[y]:Ql}]]],cge=[3,O,wre,0,[l3,ed,ZS,YS,Gm,a_,u_,Ase,Zte,nne,AP,da,ZP,KP,QP,Jm,dae,x_,R_,xr,gN,VS,UJ,qS,FS,o_,Wre,vP,XS,p3,jP,cN,yce,BP,l_,oN,SP,ZJ,OP,Vl,XP,ls,Hl,Ts,b_,UP,$ae,so,cJ,zP,od,Qre,v_,p_,S_,qP,g_,pa,Zo,Fo,cie],[[0,{[S]:"Architecture",[y]:xN}],[()=>t0e,{[S]:"BlockDeviceMapping",[y]:rg}],[0,{[S]:"ClientToken",[y]:kN}],[2,{[S]:"EbsOptimized",[y]:L_}],[2,{[S]:"EnaSupport",[y]:og}],[0,{[S]:"Hypervisor",[y]:j_}],[()=>ege,{[S]:"IamInstanceProfile",[y]:YN}],[0,{[S]:"InstanceLifecycle",[y]:ffe}],[()=>qye,{[S]:"ElasticGpuAssociationSet",[y]:fue}],[()=>Gye,{[S]:"ElasticInferenceAcceleratorAssociationSet",[y]:yue}],[()=>i0e,{[S]:"NetworkInterfaceSet",[y]:pde}],[0,{[S]:"OutpostArn",[y]:md}],[0,{[S]:"RootDeviceName",[y]:wL}],[0,{[S]:"RootDeviceType",[y]:EL}],[()=>X_,{[S]:"GroupSet",[y]:U_}],[2,{[S]:"SourceDestCheck",[y]:Z_}],[0,{[S]:"SpotInstanceRequestId",[y]:She}],[0,{[S]:"SriovNetSupport",[y]:K_}],[()=>GL,{[S]:"StateReason",[y]:TL}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"VirtualizationType",[y]:zL}],[()=>jpe,{[S]:"CpuOptions",[y]:kle}],[0,{[S]:"CapacityBlockId",[y]:xle}],[0,{[S]:"CapacityReservationId",[y]:DN}],[()=>Ppe,{[S]:"CapacityReservationSpecification",[y]:Ble}],[()=>Wme,{[S]:"HibernationOptions",[y]:Zue}],[()=>v0e,{[S]:"LicenseSet",[y]:Vfe}],[()=>Sge,{[S]:"MetadataOptions",[y]:tde}],[()=>Ume,{[S]:"EnclaveOptions",[y]:Cue}],[0,{[S]:"BootMode",[y]:IN}],[0,{[S]:"PlatformDetails",[y]:yL}],[0,{[S]:"UsageOperation",[y]:kL}],[4,{[S]:"UsageOperationUpdateTime",[y]:epe}],[()=>iye,{[S]:"PrivateDnsNameOptions",[y]:kde}],[0,{[S]:"Ipv6Address",[y]:GN}],[0,{[S]:"TpmSupport",[y]:ML}],[()=>gge,{[S]:"MaintenanceOptions",[y]:nde}],[0,{[S]:"CurrentInstanceBootMode",[y]:Mle}],[()=>xge,{[S]:"NetworkPerformanceOptions",[y]:bde}],[()=>hg,{[S]:"Operator",[y]:lg}],[()=>l0e,{[S]:"SecondaryInterfaceSet",[y]:_he}],[0,{[S]:"InstanceId",[y]:Gl}],[0,{[S]:"ImageId",[y]:H_}],[()=>Av,{[S]:"InstanceState",[y]:Ofe}],[0,{[S]:"PrivateDnsName",[y]:G_}],[0,{[S]:"DnsName",[y]:Yle}],[0,{[S]:"Reason",[y]:ahe}],[0,{[S]:"KeyName",[y]:hd}],[1,{[S]:"AmiLaunchIndex",[y]:ale}],[()=>JL,{[S]:"ProductCodes",[y]:gL}],[0,{[S]:"InstanceType",[y]:V_}],[4,{[S]:"LaunchTime",[y]:qfe}],[()=>VL,{[S]:"Placement",[y]:Kde}],[0,{[S]:"KernelId",[y]:nL}],[0,{[S]:"RamdiskId",[y]:xL}],[0,{[S]:"Platform",[y]:vL}],[()=>Qge,{[S]:"Monitoring",[y]:cde}],[0,{[S]:"SubnetId",[y]:fg}],[0,{[S]:"VpcId",[y]:yd}],[0,{[S]:"PrivateIpAddress",[y]:_c}],[0,{[S]:"IpAddress",[y]:ife}]]],lge=[3,O,Fne,0,[P3,z3],[[2,{[S]:"EnaSrdEnabled",[y]:Tue}],[()=>uge,{[S]:"EnaSrdUdpSpecification",[y]:Due}]]],uge=[3,O,Gne,0,[L3],[[2,{[S]:"EnaSrdUdpEnabled",[y]:Mue}]]],fge=[3,O,Xne,0,[KS,e_],[[0,{[S]:"DeviceName",[y]:P_}],[()=>Ome,{[S]:"Ebs",[y]:z_}]]],dge=[3,O,Jne,0,[KS,e_,pN,RP],[[0,{[S]:"DeviceName",[y]:P_}],[()=>Mme,{[S]:"Ebs",[y]:z_}],[0,{[S]:"VirtualName",[y]:PL}],[0,{[S]:"NoDevice",[y]:fL}]]],hge=[3,O,yse,0,[d_],[[0,{[S]:"Ipv4Prefix",[y]:_fe}]]],pge=[3,O,fse,0,[l_,Yse],[[0,{[S]:"Ipv6Address",[y]:GN}],[2,{[S]:"IsPrimaryIpv6",[y]:bfe}]]],mge=[3,O,bse,0,[f_],[[0,{[S]:"Ipv6Prefix",[y]:Efe}]]],gge=[3,O,Ise,0,[o3,Bie],[[0,{[S]:"AutoRecovery",[y]:dle}],[0,{[S]:"RebootMigration",[y]:she}]]],yge=[3,O,Ose,0,[o3],[0]],bge=[3,O,Mse,0,[boe,kae],[0,()=>mye]],vge=[3,O,Dse,0,[G3,F3,V3,q3,tP],[0,1,0,0,0]],Sge=[3,O,kse,0,[Ts,G3,F3,V3,q3,tP],[[0,{[S]:"State",[y]:ma}],[0,{[S]:"HttpTokens",[y]:Wue}],[1,{[S]:"HttpPutResponseHopLimit",[y]:Que}],[0,{[S]:"HttpEndpoint",[y]:Fue}],[0,{[S]:"HttpProtocolIpv6",[y]:Kue}],[0,{[S]:"InstanceMetadataTags",[y]:dfe}]]],_ge=[3,O,Nse,0,[u3,f3,pc,Zm,c_,mP,CP,bc,b_,Fo,Xm,Jm,ld,pa,Zo,Qm,aP,oP,yee,Vl],[[()=>jL,{[S]:"Association",[y]:RN}],[()=>wge,{[S]:"Attachment",[y]:CN}],[0,{[S]:"Description",[y]:fd}],[()=>X_,{[S]:"GroupSet",[y]:U_}],[()=>W_,{[S]:"Ipv6AddressesSet",[y]:FN}],[0,{[S]:"MacAddress",[y]:sL}],[0,{[S]:"NetworkInterfaceId",[y]:dL}],[0,{[S]:"OwnerId",[y]:Kl}],[0,{[S]:"PrivateDnsName",[y]:G_}],[0,{[S]:"PrivateIpAddress",[y]:_c}],[()=>c0e,{[S]:"PrivateIpAddressesSet",[y]:bL}],[2,{[S]:"SourceDestCheck",[y]:Z_}],[0,{[S]:"Status",[y]:ga}],[0,{[S]:"SubnetId",[y]:fg}],[0,{[S]:"VpcId",[y]:yd}],[0,{[S]:"InterfaceType",[y]:eL}],[()=>s0e,{[S]:"Ipv4PrefixSet",[y]:vfe}],[()=>r0e,{[S]:"Ipv6PrefixSet",[y]:Sfe}],[()=>Bpe,{[S]:"ConnectionTrackingConfiguration",[y]:jle}],[()=>hg,{[S]:"Operator",[y]:lg}]]],jL=[3,O,Lse,0,[GJ,eee,qse,UP,rie],[[0,{[S]:"CarrierIp",[y]:Ole}],[0,{[S]:"CustomerOwnedIp",[y]:Ple}],[0,{[S]:"IpOwnerId",[y]:gfe}],[0,{[S]:"PublicDnsName",[y]:Nde}],[0,{[S]:"PublicIp",[y]:zde}]]],wge=[3,O,zse,0,[qm,s3,fa,Fm,ld,cd,N3,k3],[[4,{[S]:"AttachTime",[y]:sg}],[0,{[S]:"AttachmentId",[y]:SN}],[2,{[S]:"DeleteOnTermination",[y]:Sc}],[1,{[S]:"DeviceIndex",[y]:k_}],[0,{[S]:"Status",[y]:ga}],[1,{[S]:"NetworkCardIndex",[y]:F_}],[()=>lge,{[S]:"EnaSrdSpecification",[y]:Iue}],[1,{[S]:"EnaQueueCount",[y]:Aue}]]],Ege=[3,O,$se,0,[uJ,fa,pc,Fm,Zm,K3,c_,CP,Fo,Xm,Pae,pa,rJ,Qm,cd,aP,Zse,oP,Gse,lie,N3,bee,k3],[[2,{[S]:"AssociatePublicIpAddress",[y]:lle}],[2,{[S]:"DeleteOnTermination",[y]:Sc}],[0,{[S]:"Description",[y]:fd}],[1,{[S]:"DeviceIndex",[y]:k_}],[()=>ez,{[y]:__}],[1,{[S]:"Ipv6AddressCount",[y]:efe}],[()=>W_,{[S]:"Ipv6Addresses",[y]:FN}],[0,{[S]:"NetworkInterfaceId",[y]:dL}],[0,{[S]:"PrivateIpAddress",[y]:_c}],[()=>C0e,{[S]:"PrivateIpAddresses",[y]:bL}],[1,{[S]:"SecondaryPrivateIpAddressCount",[y]:xhe}],[0,{[S]:"SubnetId",[y]:fg}],2,0,1,[()=>p0e,{[y]:d_}],1,[()=>m0e,{[y]:f_}],1,2,()=>Bme,()=>zpe,1]],xge=[3,O,jse,0,[g3],[[0,{[S]:"BandwidthWeighting",[y]:_le}]]],Rge=[3,O,Hse,0,[g3],[0]],Cge=[3,O,Kse,0,[u3,FP,b_,Fo],[[()=>jL,{[S]:"Association",[y]:RN}],[2,{[S]:"Primary",[y]:SL}],[0,{[S]:"PrivateDnsName",[y]:G_}],[0,{[S]:"PrivateIpAddress",[y]:_c}]]],Age=[3,O,dre,0,[f3,mP,uae,bc,Xm,Jm,ld,JP,Mae,Qm],[[()=>Tge,{[S]:"Attachment",[y]:CN}],[0,{[S]:"MacAddress",[y]:sL}],[0,{[S]:"SecondaryInterfaceId",[y]:yhe}],[0,{[S]:"OwnerId",[y]:Kl}],[()=>u0e,{[S]:"PrivateIpAddressSet",[y]:Bde}],[2,{[S]:"SourceDestCheck",[y]:Z_}],[0,{[S]:"Status",[y]:ga}],[0,{[S]:"SecondarySubnetId",[y]:Che}],[0,{[S]:"SecondaryNetworkId",[y]:whe}],[0,{[S]:"InterfaceType",[y]:eL}]]],Tge=[3,O,rre,0,[qm,s3,fa,Fm,ld,cd],[[4,{[S]:"AttachTime",[y]:sg}],[0,{[S]:"AttachmentId",[y]:SN}],[2,{[S]:"DeleteOnTermination",[y]:Sc}],[1,{[S]:"DeviceIndex",[y]:k_}],[0,{[S]:"Status",[y]:ga}],[1,{[S]:"NetworkCardIndex",[y]:F_}]]],Ige=[3,O,ire,0,[Fo],[[0,{[S]:"PrivateIpAddress",[y]:_c}]]],Oge=[3,O,lre,0,[Fo],[0],1],Mge=[3,O,fre,0,[fa,Fm,Xm,oie,JP,Qm,cd],[2,1,[()=>f0e,{[y]:Fo}],1,0,0,1]],Av=[3,O,mre,0,[w3,Qs],[[1,{[S]:"Code",[y]:NN}],[0,{[S]:"Name",[y]:Rr}]]],Dge=[3,O,nre,0,[ls,gee,pie],[[0,{[S]:"InstanceId",[y]:Gl}],[()=>Av,{[S]:"CurrentState",[y]:Ule}],[()=>Av,{[S]:"PreviousState",[y]:qde}]]],kge=[3,O,cP,0,[cce,Dte,DP,B3],[[1,{[S]:"TotalSizeInGB",[y]:Zhe}],[()=>Hye,{[S]:"Disks",[y]:rue}],[0,{[S]:"NvmeSupport",[y]:pL}],[0,{[S]:"EncryptionSupport",[y]:$N}]]],Pge=[3,O,bre,0,[od,FJ,U3,jae,Nae,qae,NJ,a_,VP,fN,gc,hre,cP,O3,TP,j3,$3,HP,Q3,Hne,LJ,Nee,dJ,Yie,Doe,Loe,kP,pP,IP,hie,zie],[[0,{[S]:"InstanceType",[y]:V_}],[2,{[S]:"CurrentGeneration",[y]:Ile}],[2,{[S]:"FreeTierEligible",[y]:jN}],[()=>U0e,{[S]:"SupportedUsageClasses",[y]:Mhe}],[()=>M0e,{[S]:"SupportedRootDeviceTypes",[y]:Rhe}],[()=>H0e,{[S]:"SupportedVirtualizationTypes",[y]:khe}],[2,{[S]:"BareMetal",[y]:vle}],[0,{[S]:"Hypervisor",[y]:j_}],[()=>cye,{[S]:"ProcessorInfo",[y]:$de}],[()=>Cye,{[S]:"VCpuInfo",[y]:spe}],[()=>Fge,{[S]:"MemoryInfo",[y]:Zl}],[2,{[S]:"InstanceStorageSupported",[y]:Cfe}],[()=>kge,{[S]:"InstanceStorageInfo",[y]:Rfe}],[()=>Ime,{[S]:"EbsInfo",[y]:Sue}],[()=>Xge,{[S]:"NetworkInfo",[y]:gde}],[()=>Yme,{[S]:"GpuInfo",[y]:jue}],[()=>Fme,{[S]:"FpgaInfo",[y]:Lue}],[()=>sye,{[S]:"PlacementGroupInfo",[y]:Lde}],[()=>oge,{[S]:"InferenceAcceleratorInfo",[y]:tfe}],[2,{[S]:"HibernationSupported",[y]:Xue}],[2,{[S]:"BurstablePerformanceSupported",[y]:Sle}],[2,{[S]:"DedicatedHostsSupported",[y]:Kle}],[2,{[S]:"AutoRecoverySupported",[y]:fle}],[()=>Uye,{[S]:"SupportedBootModes",[y]:uhe}],[0,{[S]:"NitroEnclavesSupport",[y]:dde}],[0,{[S]:"NitroTpmSupport",[y]:_de}],[()=>nye,{[S]:"NitroTpmInfo",[y]:Sde}],[()=>Hge,{[S]:"MediaAcceleratorInfo",[y]:Zfe}],[()=>tye,{[S]:"NeuronInfo",[y]:yde}],[0,{[S]:"PhcSupport",[y]:Vde}],[0,{[S]:"RebootMigrationSupport",[y]:nhe}]]],Nge=[3,O,ere,0,[d_],[0]],Lge=[3,O,tre,0,[f_],[0]],zge=[3,O,Pre,0,[mc,xr,so,h_,Cre],[[0,{[S]:"KeyPairId",[y]:cg}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"KeyName",[y]:hd}],[0,{[S]:"KeyFingerprint",[y]:q_}],[()=>Cpe,{[S]:"KeyMaterial",[y]:Lfe}]]],Bge=[3,O,Dre,0,[mc,dP,xr,uie,_3,so,h_],[[0,{[S]:"KeyPairId",[y]:cg}],[0,{[S]:"KeyType",[y]:Bfe}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"PublicKey",[y]:Ude}],[4,{[S]:"CreateTime",[y]:PN}],[0,{[S]:"KeyName",[y]:hd}],[0,{[S]:"KeyFingerprint",[y]:q_}]]],$ge=[3,O,Kre,0,[Gre,Zre,yN],[0,0,0]],Uge=[3,O,zre,0,[hP],[[0,{[S]:"LicenseConfigurationArn",[y]:Ufe}]]],jge=[3,O,Lre,0,[hP],[0]],Hge=[3,O,pP,0,[a3,oce],[[()=>_0e,{[S]:"Accelerators",[y]:wN}],[1,{[S]:"TotalMediaMemoryInMiB",[y]:qhe}]]],Vge=[3,O,soe,0,[ua,Qs,ad,gc],[[1,{[S]:"Count",[y]:vc}],[0,{[S]:"Name",[y]:Rr}],[0,{[S]:"Manufacturer",[y]:pd}],[()=>qge,{[S]:"MemoryInfo",[y]:Zl}]]],qge=[3,O,ooe,0,[ql],[[1,{[S]:"SizeInMiB",[y]:Ql}]]],Fge=[3,O,gc,0,[ql],[[1,{[S]:"SizeInMiB",[y]:Ql}]]],Gge=[3,O,foe,0,[ls,Jm,x3,bt,AJ,Fl,ed,R3,od,Nre,Hie,aN,eP,Zm,YS,x_,Gm],[[0,{[S]:"InstanceId",[y]:Gl}],[()=>ff,0],[()=>ff,0],[2,{[S]:"DryRun",[y]:Ct}],[0,{[S]:"Attribute",[y]:yle}],[0,{[S]:"Value",[y]:gd}],[()=>n0e,{[S]:"BlockDeviceMapping",[y]:rg}],[()=>ff,{[S]:"DisableApiTermination",[y]:LN}],[()=>df,{[S]:"InstanceType",[y]:V_}],[()=>df,{[S]:"Kernel",[y]:$fe}],[()=>df,{[S]:"Ramdisk",[y]:ihe}],[()=>Dpe,{[S]:"UserData",[y]:Jhe}],[()=>df,{[S]:"InstanceInitiatedShutdownBehavior",[y]:XN}],[()=>Xye,{[y]:s_}],[()=>ff,{[S]:"EbsOptimized",[y]:L_}],[()=>df,{[S]:"SriovNetSupport",[y]:K_}],[()=>ff,{[S]:"EnaSupport",[y]:og}]],1],Zge=[3,O,voe,0,[Ys,bt,C_,ng,Ym,eg,m_],[0,2,1,0,1,1,2],1],Kge=[3,O,Soe,0,[hN],[[()=>Aye,{[S]:"VolumeModification",[y]:cpe}]]],Qge=[3,O,g_,0,[Ts],[[0,{[S]:"State",[y]:ma}]]],Yge=[3,O,Coe,0,[cd,MP,bP,oJ,OJ,Yoe,kee,loe,uoe],[[1,{[S]:"NetworkCardIndex",[y]:F_}],[0,{[S]:"NetworkPerformance",[y]:hL}],[1,{[S]:"MaximumNetworkInterfaces",[y]:iL}],[1,{[S]:"AdditionalFlexibleNetworkInterfaces",[y]:rle}],[1,{[S]:"BaselineBandwidthInGbps",[y]:ble}],[1,{[S]:"PeakBandwidthInGbps",[y]:Mde}],[1,{[S]:"DefaultEnaQueueCountPerInterface",[y]:Gle}],[1,{[S]:"MaximumEnaQueueCount",[y]:Wfe}],[1,{[S]:"MaximumEnaQueueCountPerInterface",[y]:Jfe}]]],Xge=[3,O,TP,0,[MP,bP,hoe,Jee,xoe,Zne,Kne,gre,Gm,mne,M3,one,hne,BJ,wne,Dae,goe,Qne],[[0,{[S]:"NetworkPerformance",[y]:hL}],[1,{[S]:"MaximumNetworkInterfaces",[y]:iL}],[1,{[S]:"MaximumNetworkCards",[y]:ede}],[1,{[S]:"DefaultNetworkCardIndex",[y]:Qle}],[()=>w0e,{[S]:"NetworkCards",[y]:ude}],[1,{[S]:"Ipv4AddressesPerInterface",[y]:nfe}],[1,{[S]:"Ipv6AddressesPerInterface",[y]:sfe}],[2,{[S]:"Ipv6Supported",[y]:Mfe}],[0,{[S]:"EnaSupport",[y]:og}],[2,{[S]:"EfaSupported",[y]:kue}],[()=>kme,{[S]:"EfaInfo",[y]:_ue}],[2,{[S]:"EncryptionInTransitSupported",[y]:vue}],[2,{[S]:"EnaSrdSupported",[y]:Oue}],[()=>Bye,{[S]:"BandwidthWeightings",[y]:wle}],[0,{[S]:"FlexibleEnaQueuesSupport",[y]:Nue}],[2,{[S]:"SecondaryNetworkSupported",[y]:Ehe}],[1,{[S]:"MaximumSecondaryNetworkInterfaces",[y]:ode}],[1,{[S]:"Ipv4AddressesPerSecondaryInterface",[y]:rfe}]]],Wge=[3,O,Aoe,0,[ua,yN],[[1,{[S]:"Count",[y]:vc}],[1,{[S]:"Version",[y]:mpe}]]],Jge=[3,O,Toe,0,[ua,Qs,YJ,gc],[[1,{[S]:"Count",[y]:vc}],[0,{[S]:"Name",[y]:Rr}],[()=>Wge,{[S]:"CoreInfo",[y]:Dle}],[()=>eye,{[S]:"MemoryInfo",[y]:Zl}]]],eye=[3,O,Ooe,0,[ql],[[1,{[S]:"SizeInMiB",[y]:Ql}]]],tye=[3,O,IP,0,[Moe,ice],[[()=>E0e,{[S]:"NeuronDevices",[y]:fde}],[1,{[S]:"TotalNeuronDeviceMemoryInMiB",[y]:Fhe}]]],nye=[3,O,kP,0,[Fae],[[()=>x0e,{[S]:"SupportedVersions",[y]:Phe}]]],HL=[3,O,Hoe,0,[LP],[0]],hg=[3,O,Voe,0,[woe,LP],[[2,{[S]:"Managed",[y]:ade}],[0,{[S]:"Principal",[y]:Ode}]]],VL=[3,O,v_,0,[jl,CJ,r_,die,$ne,pce,Jie,jne,s_,la],[[0,{[S]:"AvailabilityZoneId",[y]:M_}],[0,{[S]:"Affinity",[y]:gle}],[0,{[S]:"GroupName",[y]:$_}],[1,{[S]:"PartitionNumber",[y]:Hde}],[0,{[S]:"HostId",[y]:Gue}],[0,{[S]:"Tenancy",[y]:zhe}],[0,{[S]:"SpreadDomain",[y]:dhe}],[0,{[S]:"HostResourceGroupArn",[y]:Yue}],[0,{[S]:"GroupId",[y]:B_}],[0,{[S]:"AvailabilityZone",[y]:ud}]]],sye=[3,O,HP,0,[Bae],[[()=>R0e,{[S]:"SupportedStrategies",[y]:Ihe}]]],rye=[3,O,$P,0,[i_,JS,WS],[[0,{[S]:"HostnameType",[y]:VN}],[2,{[S]:"EnableResourceNameDnsARecord",[y]:BN}],[2,{[S]:"EnableResourceNameDnsAAAARecord",[y]:zN}]]],oye=[3,O,tie,0,[i_,JS,WS],[0,2,2]],iye=[3,O,nie,0,[i_,JS,WS],[[0,{[S]:"HostnameType",[y]:VN}],[2,{[S]:"EnableResourceNameDnsARecord",[y]:BN}],[2,{[S]:"EnableResourceNameDnsAAAARecord",[y]:zN}]]],aye=[3,O,iie,0,[FP,Fo],[[2,{[S]:"Primary",[y]:SL}],[0,{[S]:"PrivateIpAddress",[y]:_c}]]],cye=[3,O,VP,0,[Qie,Wie,eae,ad],[[()=>kye,{[S]:"SupportedArchitectures",[y]:che}],[1,{[S]:"SustainedClockSpeedInGhz",[y]:fhe}],[()=>B0e,{[S]:"SupportedFeatures",[y]:hhe}],[0,{[S]:"Manufacturer",[y]:pd}]]],lye=[3,O,eie,0,[Xoe,Joe],[[0,{[S]:"ProductCode",[y]:Dde}],[0,{[S]:"Type",[y]:Q_}]]],uye=[3,O,Tie,0,[rd,bt],[[()=>bd,{[y]:ls}],[2,{[S]:"DryRun",[y]:Ct}]],1],fye=[3,O,qie,0,[NP,H3,Wm,bne],[[0,{[S]:"OptInStatus",[y]:mL}],[()=>A0e,{[S]:"GeographySet",[y]:HN}],[0,{[S]:"RegionName",[y]:RL}],[0,{[S]:"RegionEndpoint",[y]:Xde}]]],dye=[3,O,Rie,0,[Qs],[[0,{[S]:"Name",[y]:Rr}]]],qL=[3,O,Gie,0,[Mie,bc,kie,Zm,Ere],[[0,{[S]:"ReservationId",[y]:Jde}],[0,{[S]:"OwnerId",[y]:Kl}],[0,{[S]:"RequesterId",[y]:the}],[()=>X_,{[S]:"GroupSet",[y]:U_}],[()=>o0e,{[S]:"InstancesSet",[y]:ig}]]],hye=[3,O,Aie,0,[t_],[[2,{[S]:"Enabled",[y]:UN}]],1],pye=[3,O,Iie,0,[toe,noe,ed,Hl,od,K3,c_,p_,so,g_,v_,S_,sae,QP,pa,aN,A3,I3,Go,Fre,Pse,hee,VS,FS,o_,Hre,vP,XS,BP,SP,x3,fne,OP,Vl,XP,bt,R3,eP,Fo,ZS,n3,AP,u_,YS],[1,1,[()=>XL,{[y]:jS}],0,0,1,[()=>W_,{[y]:l_}],0,0,[()=>hye,0],[()=>VL,0],0,[()=>ez,{[y]:__}],[()=>D0e,{[y]:YP}],0,[()=>Rpe,0],[()=>Fye,0],[()=>Zye,{[y]:T3}],[()=>Qo,{[y]:ro}],()=>$ge,()=>bge,()=>Wpe,()=>Hpe,()=>kpe,()=>Jme,[()=>S0e,{[y]:qre}],()=>vge,()=>jme,()=>oye,()=>yge,2,2,()=>Rge,()=>HL,[()=>d0e,{[y]:_ae}],[2,{[S]:"DryRun",[y]:Ct}],[2,{[S]:"DisableApiTermination",[y]:LN}],[0,{[S]:"InstanceInitiatedShutdownBehavior",[y]:XN}],[0,{[S]:"PrivateIpAddress",[y]:_c}],[0,{[S]:"ClientToken",[kfe]:1,[y]:kN}],[0,{[S]:"AdditionalInfo",[y]:vN}],[()=>a0e,{[S]:"NetworkInterface",[y]:mde}],[()=>tge,{[S]:"IamInstanceProfile",[y]:YN}],[2,{[S]:"EbsOptimized",[y]:L_}]],2],FL=[3,O,Zae,0,[Boe,da,xr,Uae,Eie,tN,la,dce,b3,_ee,Rne,ha,Ys,Ts,E_,eN,GP,bc,pc,mN,sd,id,Dee],[[0,{[S]:"OwnerAlias",[y]:Ede}],[0,{[S]:"OutpostArn",[y]:md}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"StorageTier",[y]:Ohe}],[4,{[S]:"RestoreExpiryTime",[y]:Yde}],[0,{[S]:"SseType",[y]:OL}],[0,{[S]:"AvailabilityZone",[y]:ud}],[0,{[S]:"TransferType",[y]:Yhe}],[1,{[S]:"CompletionDurationMinutes",[y]:Ale}],[4,{[S]:"CompletionTime",[y]:Hle}],[1,{[S]:"FullSnapshotSizeInBytes",[y]:Bue}],[0,{[S]:"SnapshotId",[y]:ug}],[0,{[S]:"VolumeId",[y]:Yl}],[0,{[S]:"Status",[y]:ga}],[0,{[S]:"StatusMessage",[y]:dg}],[4,{[S]:"StartTime",[y]:IL}],[0,{[S]:"Progress",[y]:_L}],[0,{[S]:"OwnerId",[y]:Kl}],[0,{[S]:"Description",[y]:fd}],[1,{[S]:"VolumeSize",[y]:NL}],[2,{[S]:"Encrypted",[y]:dd}],[0,{[S]:"KmsKeyId",[y]:ag}],[0,{[S]:"DataEncryptionKeyId",[y]:Fle}]]],mye=[3,O,Oae,0,[moe,Sae,kJ,Gce,hse],[0,0,1,4,0]],gye=[3,O,pae,0,[rd,n3,bt],[[()=>bd,{[y]:ls}],[0,{[S]:"AdditionalInfo",[y]:vN}],[2,{[S]:"DryRun",[y]:Ct}]],1],yye=[3,O,mae,0,[Eae],[[()=>J_,{[S]:"InstancesSet",[y]:ig}]]],GL=[3,O,R_,0,[w3,wP],[[0,{[S]:"Code",[y]:NN}],[0,{[S]:"Message",[y]:lL}]]],bye=[3,O,gae,0,[rd,Vne,WP,bt,n_],[[()=>bd,{[y]:ls}],2,2,[2,{[S]:"DryRun",[y]:Ct}],[2,{[S]:"Force",[y]:$ue}]],1],vye=[3,O,yae,0,[Rae],[[()=>J_,{[S]:"InstancesSet",[y]:ig}]]],ZL=[3,O,nN,0,[jl,ine,eoe,tee,bc,aJ,Y3,xr,Kie,da,$te,nP,$P,HS,tg,pa,Ts,Zo,td,iJ,la,Pee,poe],[[0,{[S]:"AvailabilityZoneId",[y]:M_}],[1,{[S]:"EnableLniAtDeviceIndex",[y]:wue}],[2,{[S]:"MapCustomerOwnedIpOnLaunch",[y]:Kfe}],[0,{[S]:"CustomerOwnedIpv4Pool",[y]:Nle}],[0,{[S]:"OwnerId",[y]:Kl}],[2,{[S]:"AssignIpv6AddressOnCreation",[y]:ile}],[()=>L0e,{[S]:"Ipv6CidrBlockAssociationSet",[y]:KN}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"SubnetArn",[y]:lhe}],[0,{[S]:"OutpostArn",[y]:md}],[2,{[S]:"EnableDns64",[y]:aue}],[2,{[S]:"Ipv6Native",[y]:hfe}],[()=>rye,{[S]:"PrivateDnsNameOptionsOnLaunch",[y]:Pde}],[()=>UL,{[S]:"BlockPublicAccessStates",[y]:ON}],[0,{[S]:"Type",[y]:Q_}],[0,{[S]:"SubnetId",[y]:fg}],[0,{[S]:"State",[y]:ma}],[0,{[S]:"VpcId",[y]:yd}],[0,{[S]:"CidrBlock",[y]:D_}],[1,{[S]:"AvailableIpAddressCount",[y]:ole}],[0,{[S]:"AvailabilityZone",[y]:ud}],[2,{[S]:"DefaultForAz",[y]:Zle}],[2,{[S]:"MapPublicIpOnLaunch",[y]:sde}]]],Sye=[3,O,Xie,0,[Ts,w_],[[0,{[S]:"State",[y]:ma}],[0,{[S]:"StatusMessage",[y]:dg}]]],_ye=[3,O,iae,0,[US,Km,X3,Z3,lP],[[0,{[S]:"AssociationId",[y]:O_}],[0,{[S]:"Ipv6CidrBlock",[y]:ZN}],[()=>Sye,{[S]:"Ipv6CidrBlockState",[y]:QN}],[0,{[S]:"Ipv6AddressAttribute",[y]:qN}],[0,{[S]:"IpSource",[y]:WN}]]],wye=[3,O,iN,0,[xre,Fl],[[0,{[S]:"Key",[y]:Nfe}],[0,{[S]:"Value",[y]:gd}]]],Eye=[3,O,ro,0,[jie,xr],[[0,{[S]:"ResourceType",[y]:ohe}],[()=>Cr,{[y]:iN}]]],xye=[3,O,Jae,0,[rd,n_,WP,bt],[[()=>bd,{[y]:ls}],2,2,[2,{[S]:"DryRun",[y]:Ct}]],1],Rye=[3,O,ece,0,[nce],[[()=>J_,{[S]:"InstancesSet",[y]:ig}]]],Cye=[3,O,fN,0,[vte,Mee,yte,Ece,Fce],[[1,{[S]:"DefaultVCpus",[y]:nue}],[1,{[S]:"DefaultCores",[y]:qle}],[1,{[S]:"DefaultThreadsPerCore",[y]:eue}],[()=>jye,{[S]:"ValidCores",[y]:rpe}],[()=>$0e,{[S]:"ValidThreadsPerCore",[y]:ppe}]]],KL=[3,O,Qce,0,[jl,da,Vae,Ym,xr,ng,xne,m_,eg,tN,Vl,A_,Ys,C_,ha,la,Ts,_3,TJ,sd,id],[[0,{[S]:"AvailabilityZoneId",[y]:M_}],[0,{[S]:"OutpostArn",[y]:md}],[0,{[S]:"SourceVolumeId",[y]:Dhe}],[1,{[S]:"Iops",[y]:tL}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[0,{[S]:"VolumeType",[y]:LL}],[2,{[S]:"FastRestored",[y]:zue}],[2,{[S]:"MultiAttachEnabled",[y]:Gfe}],[1,{[S]:"Throughput",[y]:DL}],[0,{[S]:"SseType",[y]:OL}],[()=>hg,{[S]:"Operator",[y]:lg}],[1,{[S]:"VolumeInitializationRate",[y]:ipe}],[0,{[S]:"VolumeId",[y]:Yl}],[1,{[S]:"Size",[y]:Nhe}],[0,{[S]:"SnapshotId",[y]:ug}],[0,{[S]:"AvailabilityZone",[y]:ud}],[0,{[S]:"Status",[y]:ga}],[4,{[S]:"CreateTime",[y]:PN}],[()=>V0e,{[S]:"AttachmentSet",[y]:ple}],[2,{[S]:"Encrypted",[y]:dd}],[0,{[S]:"KmsKeyId",[y]:ag}]]],Y_=[3,O,vce,0,[fa,r3,Fse,nd,Ys,ls,QS,Ts,qm],[[2,{[S]:"DeleteOnTermination",[y]:Sc}],[0,{[S]:"AssociatedResource",[y]:_N}],[0,{[S]:"InstanceOwningService",[y]:yfe}],[1,{[S]:"EbsCardIndex",[y]:N_}],[0,{[S]:"VolumeId",[y]:Yl}],[0,{[S]:"InstanceId",[y]:Gl}],[0,{[S]:"Device",[y]:sue}],[0,{[S]:"Status",[y]:ga}],[4,{[S]:"AttachTime",[y]:sg}]]],Aye=[3,O,hN,0,[Ys,yoe,w_,uce,tce,hce,fce,rce,Foe,$oe,Zoe,Goe,joe,GP,eN,gne],[[0,{[S]:"VolumeId",[y]:Yl}],[0,{[S]:"ModificationState",[y]:ide}],[0,{[S]:"StatusMessage",[y]:dg}],[1,{[S]:"TargetSize",[y]:Khe}],[1,{[S]:"TargetIops",[y]:Hhe}],[0,{[S]:"TargetVolumeType",[y]:Xhe}],[1,{[S]:"TargetThroughput",[y]:Qhe}],[2,{[S]:"TargetMultiAttachEnabled",[y]:Vhe}],[1,{[S]:"OriginalSize",[y]:Cde}],[1,{[S]:"OriginalIops",[y]:xde}],[0,{[S]:"OriginalVolumeType",[y]:Tde}],[1,{[S]:"OriginalThroughput",[y]:Ade}],[2,{[S]:"OriginalMultiAttachEnabled",[y]:Rde}],[1,{[S]:"Progress",[y]:_L}],[4,{[S]:"StartTime",[y]:IL}],[4,{[S]:"EndTime",[y]:Pue}]]],QL=[3,O,bN,0,[bc,uP,Y3,$J,ase,Bte,xr,HS,Zo,Ts,td,tte],[[0,{[S]:"OwnerId",[y]:Kl}],[0,{[S]:"InstanceTenancy",[y]:JN}],[()=>K0e,{[S]:"Ipv6CidrBlockAssociationSet",[y]:KN}],[()=>G0e,{[S]:"CidrBlockAssociationSet",[y]:Ele}],[2,{[S]:"IsDefault",[y]:afe}],[()=>Iye,{[S]:"EncryptionControl",[y]:iue}],[()=>Cr,{[S]:"TagSet",[y]:zr}],[()=>UL,{[S]:"BlockPublicAccessStates",[y]:ON}],[0,{[S]:"VpcId",[y]:yd}],[0,{[S]:"State",[y]:ma}],[0,{[S]:"CidrBlock",[y]:D_}],[0,{[S]:"DhcpOptionsId",[y]:Xle}]]],Tye=[3,O,Sce,0,[US,td,jJ],[[0,{[S]:"AssociationId",[y]:O_}],[0,{[S]:"CidrBlock",[y]:D_}],[()=>YL,{[S]:"CidrBlockState",[y]:Rle}]]],YL=[3,O,wce,0,[Ts,w_],[[0,{[S]:"State",[y]:ma}],[0,{[S]:"StatusMessage",[y]:dg}]]],Iye=[3,O,dN,0,[Zo,Ace,EP,Ts,E_,xie,xr],[[0,{[S]:"VpcId",[y]:yd}],[0,{[S]:"VpcEncryptionControlId",[y]:ope}],[0,{[S]:"Mode",[y]:lde}],[0,{[S]:"State",[y]:ma}],[0,{[S]:"StateMessage",[y]:AL}],[()=>Mye,{[S]:"ResourceExclusions",[y]:Wde}],[()=>Cr,{[S]:"TagSet",[y]:zr}]]],Oye=[3,O,xce,0,[EP,use,cne,Poe,jce,$ce,Bre,Nce,jte],[0,0,0,0,0,0,0,0,0],1],Ui=[3,O,Rce,0,[Ts,E_],[[0,{[S]:"State",[y]:ma}],[0,{[S]:"StateMessage",[y]:AL}]]],Mye=[3,O,Cce,0,[cse,ane,koe,Uce,Hce,Xre,Pce,Ute],[[()=>Ui,{[S]:"InternetGateway",[y]:cfe}],[()=>Ui,{[S]:"EgressOnlyInternetGateway",[y]:xue}],[()=>Ui,{[S]:"NatGateway",[y]:hde}],[()=>Ui,{[S]:"VirtualPrivateGateway",[y]:upe}],[()=>Ui,{[S]:"VpcPeering",[y]:fpe}],[()=>Ui,{[S]:"Lambda",[y]:Ffe}],[()=>Ui,{[S]:"VpcLattice",[y]:ape}],[()=>Ui,{[S]:"ElasticFileSystem",[y]:cue}]]],Dye=[3,O,Tce,0,[US,Km,X3,xP,iP,Z3,lP],[[0,{[S]:"AssociationId",[y]:O_}],[0,{[S]:"Ipv6CidrBlock",[y]:ZN}],[()=>YL,{[S]:"Ipv6CidrBlockState",[y]:QN}],[0,{[S]:"NetworkBorderGroup",[y]:uL}],[0,{[S]:"Ipv6Pool",[y]:wfe}],[0,{[S]:"Ipv6AddressAttribute",[y]:qN}],[0,{[S]:"IpSource",[y]:WN}]]],Xl="unit",kye=[1,O,pJ,0,[0,{[y]:ke}]],Pye=[1,O,vJ,0,[()=>Ipe,{[y]:ke}]],Nye=[1,O,SJ,0,[()=>Tpe,{[y]:ke}]],Lye=[1,O,wJ,0,[()=>Ope,{[y]:ke}]],zye=[1,O,xJ,0,[()=>Mpe,{[y]:ke}]],Bye=[1,O,zJ,0,[0,{[y]:ke}]],$ye=[1,O,MJ,0,[()=>$L,{[y]:ke}]],XL=[1,O,DJ,0,[()=>$L,{[y]:jS}]],Uye=[1,O,PJ,0,[0,{[y]:ke}]],jye=[1,O,HJ,0,[1,{[y]:ke}]],Hye=[1,O,Lee,0,[()=>Cme,{[y]:ke}]],Vye=[1,O,Nte,0,[()=>Tme,{[y]:ke}]],qye=[1,O,qte,0,[()=>Pme,{[y]:ke}]],Fye=[1,O,Qte,0,[()=>Nme,{[y]:ke}]],Gye=[1,O,Wte,0,[()=>zme,{[y]:ke}]],Zye=[1,O,I3,0,[()=>Lme,{[y]:ke}]],Kye=[1,O,Pte,0,[0,{[y]:C3}]],oo=[1,O,Ene,0,[()=>Hme,{[y]:Er}]],Qye=[1,O,Sne,0,[()=>Vme,{[y]:ke}]],Yye=[1,O,Mne,0,[()=>Kme,{[y]:ke}]],X_=[1,O,kne,0,[()=>Xme,{[y]:ke}]],Xye=[1,O,Pne,0,[0,{[y]:B_}]],Wye=[1,O,vse,0,[0,{[y]:Hl}]],Jye=[1,O,Cse,0,[()=>nge,{[y]:ke}]],e0e=[1,O,rse,0,[()=>ige,0]],t0e=[1,O,Wne,0,[()=>fge,{[y]:ke}]],n0e=[1,O,ese,0,[()=>dge,{[y]:ke}]],bd=[1,O,Sse,0,[0,{[y]:ls}]],s0e=[1,O,pse,0,[()=>hge,{[y]:ke}]],W_=[1,O,dse,0,[()=>pge,{[y]:ke}]],r0e=[1,O,mse,0,[()=>mge,{[y]:ke}]],o0e=[1,O,Tse,0,[()=>cge,{[y]:ke}]],i0e=[1,O,Bse,0,[()=>_ge,{[y]:ke}]],a0e=[1,O,Use,0,[()=>Ege,{[y]:ke}]],c0e=[1,O,Qse,0,[()=>Cge,{[y]:ke}]],l0e=[1,O,ore,0,[()=>Age,{[y]:ke}]],u0e=[1,O,are,0,[()=>Ige,{[y]:ke}]],f0e=[1,O,cre,0,[()=>Oge,{[y]:ke}]],d0e=[1,O,ure,0,[()=>Mge,{[y]:ke}]],J_=[1,O,sre,0,[()=>Dge,{[y]:ke}]],h0e=[1,O,yre,0,[()=>Pge,{[y]:ke}]],p0e=[1,O,Wse,0,[()=>Nge,{[y]:ke}]],m0e=[1,O,Jse,0,[()=>Lge,{[y]:ke}]],g0e=[1,O,Are,0,[0,{[y]:so}]],y0e=[1,O,Ore,0,[0,{[y]:mc}]],b0e=[1,O,kre,0,[()=>Bge,{[y]:ke}]],v0e=[1,O,Ure,0,[()=>Uge,{[y]:ke}]],S0e=[1,O,Vre,0,[()=>jge,{[y]:ke}]],_0e=[1,O,roe,0,[()=>Vge,{[y]:ke}]],w0e=[1,O,Roe,0,[()=>Yge,{[y]:ke}]],E0e=[1,O,Ioe,0,[()=>Jge,{[y]:ke}]],x0e=[1,O,zoe,0,[0,{[y]:ke}]],WL=[1,O,qoe,0,[0,{[y]:y_}]],R0e=[1,O,sie,0,[0,{[y]:ke}]],C0e=[1,O,aie,0,[()=>aye,{[y]:ke}]],JL=[1,O,Woe,0,[()=>lye,{[y]:ke}]],A0e=[1,O,Cie,0,[()=>dye,{[y]:ke}]],T0e=[1,O,Nie,0,[()=>fye,{[y]:ke}]],I0e=[1,O,$ie,0,[0,{[y]:Wm}]],O0e=[1,O,Lie,0,[()=>qL,{[y]:ke}]],M0e=[1,O,wie,0,[0,{[y]:ke}]],ez=[1,O,nae,0,[0,{[y]:__}]],D0e=[1,O,rae,0,[0,{[y]:YP}]],k0e=[1,O,bae,0,[0,{[y]:ha}]],P0e=[1,O,Tae,0,[()=>FL,{[y]:ke}]],N0e=[1,O,vae,0,[0,{[y]:pa}]],L0e=[1,O,aae,0,[()=>_ye,{[y]:ke}]],z0e=[1,O,Iae,0,[()=>ZL,{[y]:ke}]],B0e=[1,O,Zie,0,[0,{[y]:ke}]],Cr=[1,O,sce,0,[()=>wye,{[y]:ke}]],Qo=[1,O,lce,0,[()=>Eye,{[y]:ke}]],$0e=[1,O,ace,0,[1,{[y]:ke}]],U0e=[1,O,gce,0,[0,{[y]:ke}]],j0e=[1,O,Vce,0,[0,{[y]:ke}]],H0e=[1,O,qce,0,[0,{[y]:ke}]],V0e=[1,O,bce,0,[()=>Y_,{[y]:ke}]],q0e=[1,O,Oce,0,[0,{[y]:Ys}]],F0e=[1,O,Lce,0,[()=>KL,{[y]:ke}]],G0e=[1,O,_ce,0,[()=>Tye,{[y]:ke}]],Z0e=[1,O,Mce,0,[0,{[y]:Zo}]],K0e=[1,O,Ice,0,[()=>Dye,{[y]:ke}]],Q0e=[1,O,zce,0,[()=>QL,{[y]:ke}]],Y0e=[1,O,Xce,0,[0,{[y]:ke}]],X0e=[1,O,Jce,0,[0,{[y]:T_}]],W0e=[1,O,tle,0,[0,{[y]:I_}]],ZRe=[9,O,yJ,0,()=>Ape,()=>Y_],KRe=[9,O,dee,0,()=>$pe,()=>Upe],QRe=[9,O,XJ,0,()=>Vpe,()=>qpe],YRe=[9,O,WJ,0,()=>Fpe,()=>zge],XRe=[9,O,pee,0,()=>Gpe,()=>FL],WRe=[9,O,mee,0,()=>Zpe,()=>Kpe],JRe=[9,O,Ree,0,()=>Qpe,()=>KL],eCe=[9,O,Cee,0,()=>Ype,()=>Xpe],tCe=[9,O,Zee,0,()=>Jpe,()=>eme],nCe=[9,O,hte,0,()=>tme,()=>Xl],sCe=[9,O,pte,0,()=>nme,()=>Xl],rCe=[9,O,Ate,0,()=>sme,()=>Xl],oCe=[9,O,Tte,0,()=>rme,()=>Xl],J0e=[9,O,Oee,0,()=>ome,()=>ime],ebe=[9,O,qee,0,()=>ame,()=>cme],tbe=[9,O,Fee,0,()=>lme,()=>ume],nbe=[9,O,Vee,0,()=>fme,()=>dme],sbe=[9,O,Wee,0,()=>hme,()=>pme],rbe=[9,O,ite,0,()=>mme,()=>gme],obe=[9,O,mte,0,()=>yme,()=>bme],ibe=[9,O,gte,0,()=>vme,()=>Sme],abe=[9,O,Ite,0,()=>_me,()=>wme],cbe=[9,O,Ote,0,()=>Eme,()=>xme],iCe=[9,O,Mte,0,()=>Rme,()=>Y_],aCe=[9,O,Ane,0,()=>Gme,()=>Zme],cCe=[9,O,wse,0,()=>sge,()=>rge],lCe=[9,O,doe,0,()=>Gge,()=>Xl],uCe=[9,O,_oe,0,()=>Zge,()=>Kge],fCe=[9,O,Die,0,()=>uye,()=>Xl],dCe=[9,O,Pie,0,()=>pye,()=>qL],hCe=[9,O,xae,0,()=>gye,()=>yye],pCe=[9,O,Cae,0,()=>bye,()=>vye],mCe=[9,O,Xae,0,()=>xye,()=>Rye];const lbe=e=>({apiVersion:"2016-11-15",base64Decoder:e?.base64Decoder??cc,base64Encoder:e?.base64Encoder??ea,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??tJ,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??IW,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new kS}],logger:e?.logger??new PS,protocol:e?.protocol??IX,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ec2",errorTypeRegistries:Epe,xmlNamespace:"http://ec2.amazonaws.com/doc/2016-11-15",version:"2016-11-15",serviceTarget:"AmazonEC2"},serviceId:e?.serviceId??"EC2",urlParser:e?.urlParser??Hf,utf8Decoder:e?.utf8Decoder??jo,utf8Encoder:e?.utf8Encoder??hc}),ube=e=>{const t=Xk(e),n=()=>t().then(Sk),r=lbe(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??bk,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Qk({serviceId:r.serviceId,clientVersion:kW.version}),maxAttempts:e?.maxAttempts??Vf,region:e?.region??Yk("Region is missing"),requestHandler:zm.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||zk),sha256:e?.sha256??Kk,streamCollector:e?.streamCollector??xS,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Tk)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Ik))}},tz=e=>({setRegion(t){e.region=t},region(){return e.region}}),nz=e=>({region:e.region()}),fbe=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(i){const c=t.findIndex(l=>l.schemeId===i.schemeId);c===-1?t.push(i):t.splice(c,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},dbe=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),hbe=(e,t)=>{const n=Object.assign(tz(e),wk(e),AD(e),fbe(e));return t.forEach(r=>r.configure(n)),Object.assign(e,nz(n),Ek(n),TD(n),dbe(n))};class pbe extends vk{config;constructor(...[t]){const n=ube(t||{});super(n),this.initConfig=n;const r=MW(n),i=QD(r),c=jk(i),l=Mk(c),f=l,d=Lk(f),h=OW(d),b=hbe(h,t?.extensions||[]);this.config=b,this.middlewareStack.use(UD(this.config)),this.middlewareStack.use(Ak(this.config)),this.middlewareStack.use(Hk(this.config)),this.middlewareStack.use(Dk(this.config)),this.middlewareStack.use(ID(this.config)),this.middlewareStack.use(OD(this.config)),this.middlewareStack.use(MD(this.config)),this.middlewareStack.use(DD(this.config,{httpAuthSchemeParametersProvider:AW,identityProviderConfigProvider:async g=>new ZD({"aws.auth#sigv4":g.credentials})})),this.middlewareStack.use(PD(this.config))}destroy(){super.destroy()}}class mbe extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeAvailabilityZones",{}).n("EC2Client","DescribeAvailabilityZonesCommand").sc(J0e).build(){}class sz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeImages",{}).n("EC2Client","DescribeImagesCommand").sc(ebe).build(){}class rz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeInstances",{}).n("EC2Client","DescribeInstancesCommand").sc(tbe).build(){}class gbe extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeInstanceTypes",{}).n("EC2Client","DescribeInstanceTypesCommand").sc(nbe).build(){}class oz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeKeyPairs",{}).n("EC2Client","DescribeKeyPairsCommand").sc(sbe).build(){}class ybe extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeRegions",{}).n("EC2Client","DescribeRegionsCommand").sc(rbe).build(){}class iz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeSnapshots",{}).n("EC2Client","DescribeSnapshotsCommand").sc(obe).build(){}class az extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeSubnets",{}).n("EC2Client","DescribeSubnetsCommand").sc(ibe).build(){}class cz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeVolumes",{}).n("EC2Client","DescribeVolumesCommand").sc(abe).build(){}class lz extends Cs.classBuilder().ep(to).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions())]}).s("AmazonEC2","DescribeVpcs",{}).n("EC2Client","DescribeVpcsCommand").sc(cbe).build(){}function bbe(e){return t=>async n=>{const{request:r}=n;if(e.expectContinueHeader!==!1&&kn.isInstance(r)&&r.body&&e.runtime==="node"&&e.requestHandler?.constructor?.name!=="FetchHttpHandler"){let i=!0;if(typeof e.expectContinueHeader=="number")try{i=(Number(r.headers?.["content-length"])??e.bodyLengthChecker?.(r.body)??1/0)>=e.expectContinueHeader}catch{}else i=!!e.expectContinueHeader;i&&(r.headers.Expect="100-continue")}return t({...n,request:r})}}const vbe={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Sbe=e=>({applyToStack:t=>{t.add(bbe(e),vbe)}}),uz={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},_be=uz.WHEN_SUPPORTED,gCe={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},wbe=uz.WHEN_SUPPORTED;var Tv;(function(e){e.MD5="MD5",e.CRC32="CRC32",e.CRC32C="CRC32C",e.CRC64NVME="CRC64NVME",e.SHA1="SHA1",e.SHA256="SHA256"})(Tv||(Tv={}));var sI;(function(e){e.HEADER="header",e.TRAILER="trailer"})(sI||(sI={}));const yCe=Tv.CRC32;var bCe=(function(){function e(){this.crc32=new om}return e.prototype.update=function(t){rm(t)||this.crc32.update(lc(t))},e.prototype.digest=function(){return Fk(this,void 0,void 0,function(){return Gk(this,function(t){return[2,NW(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new om},e})(),om=(function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var n,r;try{for(var i=UW(t),c=i.next();!c.done;c=i.next()){var l=c.value;this.checksum=this.checksum>>>8^xbe[(this.checksum^l)&255]}}catch(f){n={error:f}}finally{try{c&&!c.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e})(),Ebe=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],xbe=LW(Ebe);const Rbe=e=>{const{requestChecksumCalculation:t,responseChecksumValidation:n,requestStreamBufferSize:r}=e;return Object.assign(e,{requestChecksumCalculation:Fs(t??_be),responseChecksumValidation:Fs(n??wbe),requestStreamBufferSize:Number(r??0),checksumAlgorithms:e.checksumAlgorithms??{}})},Cbe=e=>(t,n)=>async r=>{const i=await e.region(),c=e.region;let l=()=>{};n.__s3RegionRedirect&&(Object.defineProperty(e,"region",{writable:!1,value:async()=>n.__s3RegionRedirect}),l=()=>Object.defineProperty(e,"region",{writable:!0,value:c}));try{const f=await t(r);if(n.__s3RegionRedirect){l();const d=await e.region();if(i!==d)throw new Error("Region was not restored following S3 region redirect.")}return f}catch(f){throw l(),f}},Abe={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Tbe(e){return(t,n)=>async r=>{try{return await t(r)}catch(i){if(e.followRegionRedirects){const c=i?.$metadata?.httpStatusCode,l=n.commandName==="HeadBucketCommand",f=i?.$response?.headers?.["x-amz-bucket-region"];if(f&&(c===301||c===400&&(i?.name==="IllegalLocationConstraintException"||l))){try{const d=f;n.logger?.debug(`Redirecting from ${await e.region()} to ${d}`),n.__s3RegionRedirect=d}catch(d){throw new Error("Region redirect failed: "+d)}return t(r)}}throw i}}}const Ibe={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Obe=e=>({applyToStack:t=>{t.add(Tbe(e),Ibe),t.addRelativeTo(Cbe(e),Abe)}});class ew{data;lastPurgeTime=Date.now();static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=3e4;constructor(t={}){this.data=t}get(t){const n=this.data[t];if(n)return n}set(t,n){return this.data[t]=n,n}delete(t){delete this.data[t]}async purgeExpired(){const t=Date.now();if(!(this.lastPurgeTime+ew.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>t))for(const n in this.data){const r=this.data[n];if(!r.isRefreshing){const i=await r.identity;i.expiration&&i.expiration.getTime()(l.expiration?.getTime()??0){i.set(r,new _b(Promise.resolve(h)))})),l)):i.set(r,new _b(this.getIdentity(r))).identity}async getIdentity(t){await this.cache.purgeExpired().catch(i=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache: +`+i)});const n=await this.createSessionFn(t);if(!n.Credentials?.AccessKeyId||!n.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:n.Credentials.AccessKeyId,secretAccessKey:n.Credentials.SecretAccessKey,sessionToken:n.Credentials.SessionToken,expiration:n.Credentials.Expiration?new Date(n.Credentials.Expiration):void 0}}}const Mbe="Directory",Dbe="S3Express",kbe="sigv4-s3express",Iv="X-Amz-S3session-Token",Ov=Iv.toLowerCase();class Pbe extends Ev{async signWithCredentials(t,n,r){const i=rI(n);t.headers[Ov]=n.sessionToken;const c=this;return oI(c,i),c.signRequest(t,r??{})}async presignWithCredentials(t,n,r){const i=rI(n);return delete t.headers[Ov],t.headers[Iv]=n.sessionToken,t.query=t.query??{},t.query[Iv]=n.sessionToken,oI(this,i),this.presign(t,r)}}function rI(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function oI(e,t){const n=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),r=e.credentialProvider,i=()=>(clearTimeout(n),e.credentialProvider=r,Promise.resolve(t));e.credentialProvider=i}const Nbe=e=>(t,n)=>async r=>{if(n.endpointV2){const i=n.endpointV2,c=i.properties?.authSchemes?.[0]?.name===kbe;if((i.properties?.backend===Dbe||i.properties?.bucketType===Mbe)&&(Pr(n,"S3_EXPRESS_BUCKET","J"),n.isS3ExpressBucket=!0),c){const f=r.input.Bucket;if(f){const d=await e.s3ExpressIdentityProvider.getS3ExpressIdentity(await e.credentials(),{Bucket:f});n.s3ExpressIdentity=d,kn.isInstance(r.request)&&d.sessionToken&&(r.request.headers[Ov]=d.sessionToken)}}}return t(r)},Lbe={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},zbe=e=>({applyToStack:t=>{t.add(Nbe(e),Lbe)}}),Bbe=async(e,t,n,r)=>{const i=await r.signWithCredentials(n,e,{});if(i.headers["X-Amz-Security-Token"]||i.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return i},$be=e=>t=>{throw t},Ube=(e,t)=>{},jbe=e=>(t,n)=>async r=>{if(!kn.isInstance(r.request))return t(r);const c=qo(n).selectedHttpAuthScheme;if(!c)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:l={}},identity:f,signer:d}=c;let h;n.s3ExpressIdentity?h=await Bbe(n.s3ExpressIdentity,l,r.request,await e.signer()):h=await d.sign(r.request,f,l);const b=await t({...r,request:h}).catch((d.errorHandler||$be)(l));return(d.successHandler||Ube)(b.response,l),b},Hbe=e=>({applyToStack:t=>{t.addRelativeTo(jbe(e),kD)}}),Vbe=(e,{session:t})=>{const[n,r]=t,{forcePathStyle:i,useAccelerateEndpoint:c,disableMultiregionAccessPoints:l,followRegionRedirects:f,s3ExpressIdentityProvider:d,bucketEndpoint:h,expectContinueHeader:b}=e;return Object.assign(e,{forcePathStyle:i??!1,useAccelerateEndpoint:c??!1,disableMultiregionAccessPoints:l??!1,followRegionRedirects:f??!1,s3ExpressIdentityProvider:d??new tw(async g=>n().send(new r({Bucket:g}))),bucketEndpoint:h??!1,expectContinueHeader:b??2097152})},qbe={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Fbe=3e3,Gbe=e=>(t,n)=>async r=>{const i=await t(r),{response:c}=i;if(!ac.isInstance(c))return i;const{statusCode:l,body:f}=c;if(l<200||l>=300||!(typeof f?.stream=="function"||typeof f?.pipe=="function"||typeof f?.tee=="function"))return i;let h=f,b=f;f&&typeof f=="object"&&!(f instanceof Uint8Array)&&([h,b]=await bQ(f)),c.body=b;const g=await Zbe(h,{streamCollector:async _=>fQ(_,Fbe)});typeof h?.destroy=="function"&&h.destroy();const v=e.utf8Encoder(g.subarray(g.length-16));if(g.length===0&&qbe[n.commandName]){const _=new Error("S3 aborted request");throw _.name="InternalError",_}return v&&v.endsWith("")&&(c.statusCode=400),i},Zbe=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),Kbe={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},nw=e=>({applyToStack:t=>{t.addRelativeTo(Gbe(e),Kbe)}}),Qbe=e=>typeof e=="string"&&e.indexOf("arn:")===0&&e.split(":").length>=6;function Ybe(e){return(t,n)=>async r=>{if(e.bucketEndpoint){const i=n.endpointV2;if(i){const c=r.input.Bucket;if(typeof c=="string")try{const l=new URL(c);n.endpointV2={...i,url:l}}catch(l){const f=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${c} could not be parsed as URL.`;throw n.logger?.constructor?.name==="NoOpLogger"?console.warn(f):n.logger?.warn?.(f),l}}}return t(r)}}const Xbe={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Wbe({bucketEndpoint:e}){return t=>async n=>{const{input:{Bucket:r}}=n;if(!e&&typeof r=="string"&&!Qbe(r)&&r.indexOf("/")>=0){const i=new Error(`Bucket name shouldn't contain '/', received '${r}'`);throw i.name="InvalidBucketName",i}return t({...n})}}const Jbe={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},eve=e=>({applyToStack:t=>{t.add(Wbe(e),Jbe),t.addRelativeTo(Ybe(e),Xbe)}}),tve=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)});class fz{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return"none"}constructor(t){this.sigv4Signer=new Pbe(t),this.signerOptions=t}async sign(t,n={}){return n.signingRegion==="*"?this.getSigv4aSigner().sign(t,n):this.sigv4Signer.sign(t,n)}async signWithCredentials(t,n,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.signWithCredentials(t,n,r)}async presign(t,n={}){if(n.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.presign(t,n)}async presignWithCredentials(t,n,r={}){if(r.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,n,r)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"):new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");return this.sigv4aSigner}}const sw="required",D="type",ae="rules",U="conditions",X="fn",W="argv",ze="ref",Ye="assign",Re="url",Ce="properties",Lo="backend",Dn="authSchemes",bn="disableDoubleEncoding",vn="signingName",jn="signingRegion",Ae="headers",rw="signingRegionSet",nve=6,sve=!1,qr=!0,Vs="isSet",ln="booleanEquals",De="error",im="aws.partition",ht="stringEquals",Wt="getAttr",en="name",jt="substring",iI="bucketSuffix",ow="parseURL",he="endpoint",ce="tree",am="aws.isVirtualHostableS3Bucket",cm="{url#scheme}://{Bucket}.{url#authority}{url#path}",Xr="not",aI="accessPointSuffix",xp="{url#scheme}://{url#authority}{url#path}",dz="hardwareType",hz="regionPrefix",cI="bucketAliasSuffix",Mv="outpostId",wc="isValidHostLabel",iw="sigv4a",Ff="s3-outposts",Nl="s3",pz="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",mz="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",lI="https://{Bucket}.s3.{partitionResult#dnsSuffix}",gz="aws.parseArn",yz="bucketArn",bz="arnType",lm="",aw="s3-object-lambda",vz="accesspoint",cw="accessPointName",uI="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",fI="mrapPartition",dI="outpostType",hI="arnPrefix",Sz="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",pI="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",mI="https://s3.{partitionResult#dnsSuffix}",dl={[sw]:!1,[D]:"string"},hl={[sw]:!0,default:!1,[D]:"boolean"},hf={[sw]:!1,[D]:"boolean"},hr={[X]:ln,[W]:[{[ze]:"Accelerate"},!0]},Vt={[X]:ln,[W]:[{[ze]:"UseFIPS"},!0]},Bt={[X]:ln,[W]:[{[ze]:"UseDualStack"},!0]},an={[X]:Vs,[W]:[{[ze]:"Endpoint"}]},_z={[X]:im,[W]:[{[ze]:"Region"}],[Ye]:"partitionResult"},gI={[X]:ht,[W]:[{[X]:Wt,[W]:[{[ze]:"partitionResult"},en]},"aws-cn"]},xf={[X]:Vs,[W]:[{[ze]:"Bucket"}]},ut={[ze]:"Bucket"},yI={[U]:[hr],[De]:"S3Express does not support S3 Accelerate.",[D]:De},bI={[U]:[an,{[X]:ow,[W]:[{[ze]:"Endpoint"}],[Ye]:"url"}],[ae]:[{[U]:[{[X]:Vs,[W]:[{[ze]:"DisableS3ExpressSessionAuth"}]},{[X]:ln,[W]:[{[ze]:"DisableS3ExpressSessionAuth"},!0]}],[ae]:[{[U]:[{[X]:ln,[W]:[{[X]:Wt,[W]:[{[ze]:"url"},"isIp"]},!0]}],[ae]:[{[U]:[{[X]:"uriEncode",[W]:[ut],[Ye]:"uri_encoded_bucket"}],[ae]:[{[he]:{[Re]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce}],[D]:ce},{[U]:[{[X]:am,[W]:[ut,!1]}],[ae]:[{[he]:{[Re]:cm,[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce},{[De]:"S3Express bucket name is not a valid virtual hostable name.",[D]:De}],[D]:ce},{[U]:[{[X]:ln,[W]:[{[X]:Wt,[W]:[{[ze]:"url"},"isIp"]},!0]}],[ae]:[{[U]:[{[X]:"uriEncode",[W]:[ut],[Ye]:"uri_encoded_bucket"}],[ae]:[{[he]:{[Re]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce}],[D]:ce},{[U]:[{[X]:am,[W]:[ut,!1]}],[ae]:[{[he]:{[Re]:cm,[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],[D]:ce},{[De]:"S3Express bucket name is not a valid virtual hostable name.",[D]:De}],[D]:ce},is={[X]:ow,[W]:[{[ze]:"Endpoint"}],[Ye]:"url"},wb={[X]:ln,[W]:[{[X]:Wt,[W]:[{[ze]:"url"},"isIp"]},!0]},wz={[ze]:"url"},Ez={[X]:"uriEncode",[W]:[ut],[Ye]:"uri_encoded_bucket"},Us={[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:"s3express",[jn]:"{Region}"}]},Ve={},xz={[X]:am,[W]:[ut,!1]},vI={[De]:"S3Express bucket name is not a valid virtual hostable name.",[D]:De},SI={[X]:Vs,[W]:[{[ze]:"UseS3ExpressControlEndpoint"}]},_I={[X]:ln,[W]:[{[ze]:"UseS3ExpressControlEndpoint"},!0]},Ke={[X]:Xr,[W]:[an]},rt={[X]:ln,[W]:[{[ze]:"UseDualStack"},!1]},et={[X]:ln,[W]:[{[ze]:"UseFIPS"},!1]},up={[De]:"Unrecognized S3Express bucket name format.",[D]:De},wI={[X]:Xr,[W]:[xf]},EI={[ze]:dz},xI={[U]:[Ke],[De]:"Expected a endpoint to be specified but no endpoint was found",[D]:De},fp={[Dn]:[{[bn]:!0,[en]:iw,[vn]:Ff,[rw]:["*"]},{[bn]:!0,[en]:"sigv4",[vn]:Ff,[jn]:"{Region}"}]},Eb={[X]:ln,[W]:[{[ze]:"ForcePathStyle"},!1]},rve={[ze]:"ForcePathStyle"},gn={[X]:ln,[W]:[{[ze]:"Accelerate"},!1]},Rn={[X]:ht,[W]:[{[ze]:"Region"},"aws-global"]},Tn={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"us-east-1"}]},ct={[X]:Xr,[W]:[Rn]},In={[X]:ln,[W]:[{[ze]:"UseGlobalEndpoint"},!0]},RI={[Re]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"{Region}"}]},[Ae]:{}},_n={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"{Region}"}]},On={[X]:ln,[W]:[{[ze]:"UseGlobalEndpoint"},!1]},CI={[Re]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},AI={[Re]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},TI={[Re]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},xb={[X]:ln,[W]:[{[X]:Wt,[W]:[wz,"isIp"]},!1]},Rb={[Re]:pz,[Ce]:_n,[Ae]:{}},Dv={[Re]:cm,[Ce]:_n,[Ae]:{}},II={[he]:Dv,[D]:he},Cb={[Re]:mz,[Ce]:_n,[Ae]:{}},OI={[Re]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},dp={[De]:"Invalid region: region was not a valid DNS name.",[D]:De},ws={[ze]:yz},Rz={[ze]:bz},Ab={[X]:Wt,[W]:[ws,"service"]},lw={[ze]:cw},MI={[U]:[Bt],[De]:"S3 Object Lambda does not support Dual-stack",[D]:De},DI={[U]:[hr],[De]:"S3 Object Lambda does not support S3 Accelerate",[D]:De},kI={[U]:[{[X]:Vs,[W]:[{[ze]:"DisableAccessPoints"}]},{[X]:ln,[W]:[{[ze]:"DisableAccessPoints"},!0]}],[De]:"Access points are not supported for this operation",[D]:De},Tb={[U]:[{[X]:Vs,[W]:[{[ze]:"UseArnRegion"}]},{[X]:ln,[W]:[{[ze]:"UseArnRegion"},!1]},{[X]:Xr,[W]:[{[X]:ht,[W]:[{[X]:Wt,[W]:[ws,"region"]},"{Region}"]}]}],[De]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[D]:De},Cz={[X]:Wt,[W]:[{[ze]:"bucketPartition"},en]},Az={[X]:Wt,[W]:[ws,"accountId"]},Ib={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:aw,[jn]:"{bucketArn#region}"}]},PI={[De]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[D]:De},Ob={[De]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[D]:De},Mb={[De]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[D]:De},Db={[De]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[D]:De},NI={[De]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[D]:De},LI={[De]:"Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided",[D]:De},pf={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:Nl,[jn]:"{bucketArn#region}"}]},zI={[Dn]:[{[bn]:!0,[en]:iw,[vn]:Ff,[rw]:["*"]},{[bn]:!0,[en]:"sigv4",[vn]:Ff,[jn]:"{bucketArn#region}"}]},BI={[X]:gz,[W]:[ut]},$I={[Re]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},UI={[Re]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},jI={[Re]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},kb={[Re]:Sz,[Ce]:_n,[Ae]:{}},HI={[Re]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:_n,[Ae]:{}},VI={[ze]:"UseObjectLambdaEndpoint"},Pb={[Dn]:[{[bn]:!0,[en]:"sigv4",[vn]:aw,[jn]:"{Region}"}]},qI={[Re]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},FI={[Re]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},GI={[Re]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},Nb={[Re]:xp,[Ce]:_n,[Ae]:{}},ZI={[Re]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[Ce]:_n,[Ae]:{}},Lb=[{[ze]:"Region"}],ove=[{[ze]:"Endpoint"}],ive=[ut],zb=[hr],pl=[an,is],KI=[{[X]:Vs,[W]:[{[ze]:"DisableS3ExpressSessionAuth"}]},{[X]:ln,[W]:[{[ze]:"DisableS3ExpressSessionAuth"},!0]}],ave=[Ez],Bb=[xz],dr=[_z],$b=[Vt,Bt],Rf=[Vt,rt],Cf=[et,Bt],Af=[et,rt],QI=[{[X]:jt,[W]:[ut,6,14,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,14,16,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],Fr=[{[U]:[Vt,Bt],[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he},{[U]:Rf,[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he},{[U]:Cf,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he},{[U]:Af,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:{}},[D]:he}],YI=[{[X]:jt,[W]:[ut,6,15,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,15,17,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],XI=[{[X]:jt,[W]:[ut,6,19,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,19,21,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],WI=[{[X]:jt,[W]:[ut,6,20,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,20,22,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],JI=[{[X]:jt,[W]:[ut,6,26,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,26,28,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],Gr=[{[U]:[Vt,Bt],[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he},{[U]:Rf,[he]:{[Re]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he},{[U]:Cf,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he},{[U]:Af,[he]:{[Re]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[Ce]:{[Lo]:"S3Express",[Dn]:[{[bn]:!0,[en]:"sigv4-s3express",[vn]:"s3express",[jn]:"{Region}"}]},[Ae]:{}},[D]:he}],e2=[ut,0,7,!0],t2=[{[X]:jt,[W]:[ut,7,15,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,15,17,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],n2=[{[X]:jt,[W]:[ut,7,16,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,16,18,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],s2=[{[X]:jt,[W]:[ut,7,20,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,20,22,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],r2=[{[X]:jt,[W]:[ut,7,21,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,21,23,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],o2=[{[X]:jt,[W]:[ut,7,27,!0],[Ye]:"s3expressAvailabilityZoneId"},{[X]:jt,[W]:[ut,27,29,!0],[Ye]:"s3expressAvailabilityZoneDelim"},{[X]:ht,[W]:[{[ze]:"s3expressAvailabilityZoneDelim"},"--"]}],cve=[xf],i2=[{[X]:wc,[W]:[{[ze]:Mv},!1]}],a2=[{[X]:ht,[W]:[{[ze]:hz},"beta"]}],lve=["*"],c2=[{[X]:wc,[W]:[{[ze]:"Region"},!1]}],ji=[{[X]:ht,[W]:[{[ze]:"Region"},"us-east-1"]}],Ub=[{[X]:ht,[W]:[Rz,vz]}],l2=[{[X]:Wt,[W]:[ws,"resourceId[1]"],[Ye]:cw},{[X]:Xr,[W]:[{[X]:ht,[W]:[lw,lm]}]}],uve=[ws,"resourceId[1]"],u2=[Bt],jb=[{[X]:Xr,[W]:[{[X]:ht,[W]:[{[X]:Wt,[W]:[ws,"region"]},lm]}]}],f2=[{[X]:Xr,[W]:[{[X]:Vs,[W]:[{[X]:Wt,[W]:[ws,"resourceId[2]"]}]}]}],fve=[ws,"resourceId[2]"],Hb=[{[X]:im,[W]:[{[X]:Wt,[W]:[ws,"region"]}],[Ye]:"bucketPartition"}],d2=[{[X]:ht,[W]:[Cz,{[X]:Wt,[W]:[{[ze]:"partitionResult"},en]}]}],Vb=[{[X]:wc,[W]:[{[X]:Wt,[W]:[ws,"region"]},!0]}],qb=[{[X]:wc,[W]:[Az,!1]}],h2=[{[X]:wc,[W]:[lw,!1]}],hp=[Vt],p2=[{[X]:wc,[W]:[{[ze]:"Region"},!0]}],dve={parameters:{Bucket:dl,Region:dl,UseFIPS:hl,UseDualStack:hl,Endpoint:dl,ForcePathStyle:hl,Accelerate:hl,UseGlobalEndpoint:hl,UseObjectLambdaEndpoint:hf,Key:dl,Prefix:dl,CopySource:dl,DisableAccessPoints:hf,DisableMultiRegionAccessPoints:hl,UseArnRegion:hf,UseS3ExpressControlEndpoint:hf,DisableS3ExpressSessionAuth:hf},[ae]:[{[U]:[{[X]:Vs,[W]:Lb}],[ae]:[{[U]:[hr,Vt],error:"Accelerate cannot be used with FIPS",[D]:De},{[U]:[Bt,an],error:"Cannot set dual-stack in combination with a custom endpoint.",[D]:De},{[U]:[an,Vt],error:"A custom endpoint cannot be combined with FIPS",[D]:De},{[U]:[an,hr],error:"A custom endpoint cannot be combined with S3 Accelerate",[D]:De},{[U]:[Vt,_z,gI],error:"Partition does not support FIPS",[D]:De},{[U]:[xf,{[X]:jt,[W]:[ut,0,nve,qr],[Ye]:iI},{[X]:ht,[W]:[{[ze]:iI},"--x-s3"]}],[ae]:[yI,bI,{[U]:[SI,_I],[ae]:[{[U]:dr,[ae]:[{[U]:[Ez,Ke],[ae]:[{[U]:$b,endpoint:{[Re]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Rf,endpoint:{[Re]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Cf,endpoint:{[Re]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Af,endpoint:{[Re]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Us,[Ae]:Ve},[D]:he}],[D]:ce}],[D]:ce}],[D]:ce},{[U]:Bb,[ae]:[{[U]:dr,[ae]:[{[U]:KI,[ae]:[{[U]:QI,[ae]:Fr,[D]:ce},{[U]:YI,[ae]:Fr,[D]:ce},{[U]:XI,[ae]:Fr,[D]:ce},{[U]:WI,[ae]:Fr,[D]:ce},{[U]:JI,[ae]:Fr,[D]:ce},up],[D]:ce},{[U]:QI,[ae]:Gr,[D]:ce},{[U]:YI,[ae]:Gr,[D]:ce},{[U]:XI,[ae]:Gr,[D]:ce},{[U]:WI,[ae]:Gr,[D]:ce},{[U]:JI,[ae]:Gr,[D]:ce},up],[D]:ce}],[D]:ce},vI],[D]:ce},{[U]:[xf,{[X]:jt,[W]:e2,[Ye]:aI},{[X]:ht,[W]:[{[ze]:aI},"--xa-s3"]}],[ae]:[yI,bI,{[U]:Bb,[ae]:[{[U]:dr,[ae]:[{[U]:KI,[ae]:[{[U]:t2,[ae]:Fr,[D]:ce},{[U]:n2,[ae]:Fr,[D]:ce},{[U]:s2,[ae]:Fr,[D]:ce},{[U]:r2,[ae]:Fr,[D]:ce},{[U]:o2,[ae]:Fr,[D]:ce},up],[D]:ce},{[U]:t2,[ae]:Gr,[D]:ce},{[U]:n2,[ae]:Gr,[D]:ce},{[U]:s2,[ae]:Gr,[D]:ce},{[U]:r2,[ae]:Gr,[D]:ce},{[U]:o2,[ae]:Gr,[D]:ce},up],[D]:ce}],[D]:ce},vI],[D]:ce},{[U]:[wI,SI,_I],[ae]:[{[U]:dr,[ae]:[{[U]:pl,endpoint:{[Re]:xp,[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:$b,endpoint:{[Re]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Rf,endpoint:{[Re]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Cf,endpoint:{[Re]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he},{[U]:Af,endpoint:{[Re]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",[Ce]:Us,[Ae]:Ve},[D]:he}],[D]:ce}],[D]:ce},{[U]:[xf,{[X]:jt,[W]:[ut,49,50,qr],[Ye]:dz},{[X]:jt,[W]:[ut,8,12,qr],[Ye]:hz},{[X]:jt,[W]:e2,[Ye]:cI},{[X]:jt,[W]:[ut,32,49,qr],[Ye]:Mv},{[X]:im,[W]:Lb,[Ye]:"regionPartition"},{[X]:ht,[W]:[{[ze]:cI},"--op-s3"]}],[ae]:[{[U]:i2,[ae]:[{[U]:Bb,[ae]:[{[U]:[{[X]:ht,[W]:[EI,"e"]}],[ae]:[{[U]:a2,[ae]:[xI,{[U]:pl,endpoint:{[Re]:"https://{Bucket}.ec2.{url#authority}",[Ce]:fp,[Ae]:Ve},[D]:he}],[D]:ce},{endpoint:{[Re]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[Ce]:fp,[Ae]:Ve},[D]:he}],[D]:ce},{[U]:[{[X]:ht,[W]:[EI,"o"]}],[ae]:[{[U]:a2,[ae]:[xI,{[U]:pl,endpoint:{[Re]:"https://{Bucket}.op-{outpostId}.{url#authority}",[Ce]:fp,[Ae]:Ve},[D]:he}],[D]:ce},{endpoint:{[Re]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[Ce]:fp,[Ae]:Ve},[D]:he}],[D]:ce},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[D]:De}],[D]:ce},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",[D]:De}],[D]:ce},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[D]:De}],[D]:ce},{[U]:cve,[ae]:[{[U]:[an,{[X]:Xr,[W]:[{[X]:Vs,[W]:[{[X]:ow,[W]:ove}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[D]:De},{[U]:[Eb,xz],[ae]:[{[U]:dr,[ae]:[{[U]:c2,[ae]:[{[U]:[hr,gI],error:"S3 Accelerate cannot be used in this region",[D]:De},{[U]:[Bt,Vt,gn,Ke,Rn],endpoint:{[Re]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Bt,Vt,gn,Ke,ct,In],[ae]:[{endpoint:RI,[D]:he}],[D]:ce},{[U]:[Bt,Vt,gn,Ke,ct,On],endpoint:RI,[D]:he},{[U]:[rt,Vt,gn,Ke,Rn],endpoint:{[Re]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,Vt,gn,Ke,ct,In],[ae]:[{endpoint:CI,[D]:he}],[D]:ce},{[U]:[rt,Vt,gn,Ke,ct,On],endpoint:CI,[D]:he},{[U]:[Bt,et,hr,Ke,Rn],endpoint:{[Re]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Bt,et,hr,Ke,ct,In],[ae]:[{endpoint:AI,[D]:he}],[D]:ce},{[U]:[Bt,et,hr,Ke,ct,On],endpoint:AI,[D]:he},{[U]:[Bt,et,gn,Ke,Rn],endpoint:{[Re]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Bt,et,gn,Ke,ct,In],[ae]:[{endpoint:TI,[D]:he}],[D]:ce},{[U]:[Bt,et,gn,Ke,ct,On],endpoint:TI,[D]:he},{[U]:[rt,et,gn,an,is,wb,Rn],endpoint:{[Re]:pz,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,et,gn,an,is,xb,Rn],endpoint:{[Re]:cm,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,et,gn,an,is,wb,ct,In],[ae]:[{[U]:ji,endpoint:Rb,[D]:he},{endpoint:Rb,[D]:he}],[D]:ce},{[U]:[rt,et,gn,an,is,xb,ct,In],[ae]:[{[U]:ji,endpoint:Dv,[D]:he},II],[D]:ce},{[U]:[rt,et,gn,an,is,wb,ct,On],endpoint:Rb,[D]:he},{[U]:[rt,et,gn,an,is,xb,ct,On],endpoint:Dv,[D]:he},{[U]:[rt,et,hr,Ke,Rn],endpoint:{[Re]:mz,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,et,hr,Ke,ct,In],[ae]:[{[U]:ji,endpoint:Cb,[D]:he},{endpoint:Cb,[D]:he}],[D]:ce},{[U]:[rt,et,hr,Ke,ct,On],endpoint:Cb,[D]:he},{[U]:[rt,et,gn,Ke,Rn],endpoint:{[Re]:lI,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,et,gn,Ke,ct,In],[ae]:[{[U]:ji,endpoint:{[Re]:lI,[Ce]:_n,[Ae]:Ve},[D]:he},{endpoint:OI,[D]:he}],[D]:ce},{[U]:[rt,et,gn,Ke,ct,On],endpoint:OI,[D]:he}],[D]:ce},dp],[D]:ce}],[D]:ce},{[U]:[an,is,{[X]:ht,[W]:[{[X]:Wt,[W]:[wz,"scheme"]},"http"]},{[X]:am,[W]:[ut,qr]},Eb,et,rt,gn],[ae]:[{[U]:dr,[ae]:[{[U]:c2,[ae]:[II],[D]:ce},dp],[D]:ce}],[D]:ce},{[U]:[Eb,{[X]:gz,[W]:ive,[Ye]:yz}],[ae]:[{[U]:[{[X]:Wt,[W]:[ws,"resourceId[0]"],[Ye]:bz},{[X]:Xr,[W]:[{[X]:ht,[W]:[Rz,lm]}]}],[ae]:[{[U]:[{[X]:ht,[W]:[Ab,aw]}],[ae]:[{[U]:Ub,[ae]:[{[U]:l2,[ae]:[MI,DI,{[U]:jb,[ae]:[kI,{[U]:f2,[ae]:[Tb,{[U]:Hb,[ae]:[{[U]:dr,[ae]:[{[U]:d2,[ae]:[{[U]:Vb,[ae]:[{[U]:[{[X]:ht,[W]:[Az,lm]}],error:"Invalid ARN: Missing account id",[D]:De},{[U]:qb,[ae]:[{[U]:h2,[ae]:[{[U]:pl,endpoint:{[Re]:uI,[Ce]:Ib,[Ae]:Ve},[D]:he},{[U]:hp,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:Ib,[Ae]:Ve},[D]:he},{endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:Ib,[Ae]:Ve},[D]:he}],[D]:ce},PI],[D]:ce},Ob],[D]:ce},Mb],[D]:ce},Db],[D]:ce}],[D]:ce}],[D]:ce},NI],[D]:ce},{error:"Invalid ARN: bucket ARN is missing a region",[D]:De}],[D]:ce},LI],[D]:ce},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[D]:De}],[D]:ce},{[U]:Ub,[ae]:[{[U]:l2,[ae]:[{[U]:jb,[ae]:[{[U]:Ub,[ae]:[{[U]:jb,[ae]:[kI,{[U]:f2,[ae]:[Tb,{[U]:Hb,[ae]:[{[U]:dr,[ae]:[{[U]:[{[X]:ht,[W]:[Cz,"{partitionResult#name}"]}],[ae]:[{[U]:Vb,[ae]:[{[U]:[{[X]:ht,[W]:[Ab,Nl]}],[ae]:[{[U]:qb,[ae]:[{[U]:h2,[ae]:[{[U]:zb,error:"Access Points do not support S3 Accelerate",[D]:De},{[U]:$b,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:pf,[Ae]:Ve},[D]:he},{[U]:Rf,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:pf,[Ae]:Ve},[D]:he},{[U]:Cf,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:pf,[Ae]:Ve},[D]:he},{[U]:[et,rt,an,is],endpoint:{[Re]:uI,[Ce]:pf,[Ae]:Ve},[D]:he},{[U]:Af,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:pf,[Ae]:Ve},[D]:he}],[D]:ce},PI],[D]:ce},Ob],[D]:ce},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[D]:De}],[D]:ce},Mb],[D]:ce},Db],[D]:ce}],[D]:ce}],[D]:ce},NI],[D]:ce}],[D]:ce}],[D]:ce},{[U]:[{[X]:wc,[W]:[lw,qr]}],[ae]:[{[U]:u2,error:"S3 MRAP does not support dual-stack",[D]:De},{[U]:hp,error:"S3 MRAP does not support FIPS",[D]:De},{[U]:zb,error:"S3 MRAP does not support S3 Accelerate",[D]:De},{[U]:[{[X]:ln,[W]:[{[ze]:"DisableMultiRegionAccessPoints"},qr]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[D]:De},{[U]:[{[X]:im,[W]:Lb,[Ye]:fI}],[ae]:[{[U]:[{[X]:ht,[W]:[{[X]:Wt,[W]:[{[ze]:fI},en]},{[X]:Wt,[W]:[ws,"partition"]}]}],[ae]:[{endpoint:{[Re]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[Ce]:{[Dn]:[{[bn]:qr,name:iw,[vn]:Nl,[rw]:lve}]},[Ae]:Ve},[D]:he}],[D]:ce},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[D]:De}],[D]:ce}],[D]:ce},{error:"Invalid Access Point Name",[D]:De}],[D]:ce},LI],[D]:ce},{[U]:[{[X]:ht,[W]:[Ab,Ff]}],[ae]:[{[U]:u2,error:"S3 Outposts does not support Dual-stack",[D]:De},{[U]:hp,error:"S3 Outposts does not support FIPS",[D]:De},{[U]:zb,error:"S3 Outposts does not support S3 Accelerate",[D]:De},{[U]:[{[X]:Vs,[W]:[{[X]:Wt,[W]:[ws,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[D]:De},{[U]:[{[X]:Wt,[W]:uve,[Ye]:Mv}],[ae]:[{[U]:i2,[ae]:[Tb,{[U]:Hb,[ae]:[{[U]:dr,[ae]:[{[U]:d2,[ae]:[{[U]:Vb,[ae]:[{[U]:qb,[ae]:[{[U]:[{[X]:Wt,[W]:fve,[Ye]:dI}],[ae]:[{[U]:[{[X]:Wt,[W]:[ws,"resourceId[3]"],[Ye]:cw}],[ae]:[{[U]:[{[X]:ht,[W]:[{[ze]:dI},vz]}],[ae]:[{[U]:pl,endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[Ce]:zI,[Ae]:Ve},[D]:he},{endpoint:{[Re]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[Ce]:zI,[Ae]:Ve},[D]:he}],[D]:ce},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[D]:De}],[D]:ce},{error:"Invalid ARN: expected an access point name",[D]:De}],[D]:ce},{error:"Invalid ARN: Expected a 4-component resource",[D]:De}],[D]:ce},Ob],[D]:ce},Mb],[D]:ce},Db],[D]:ce}],[D]:ce}],[D]:ce},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[D]:De}],[D]:ce},{error:"Invalid ARN: The Outpost Id was not set",[D]:De}],[D]:ce},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[D]:De}],[D]:ce},{error:"Invalid ARN: No ARN type specified",[D]:De}],[D]:ce},{[U]:[{[X]:jt,[W]:[ut,0,4,sve],[Ye]:hI},{[X]:ht,[W]:[{[ze]:hI},"arn:"]},{[X]:Xr,[W]:[{[X]:Vs,[W]:[BI]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[D]:De},{[U]:[{[X]:ln,[W]:[rve,qr]},BI],error:"Path-style addressing cannot be used with ARN buckets",[D]:De},{[U]:ave,[ae]:[{[U]:dr,[ae]:[{[U]:[gn],[ae]:[{[U]:[Bt,Ke,Vt,Rn],endpoint:{[Re]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Bt,Ke,Vt,ct,In],[ae]:[{endpoint:$I,[D]:he}],[D]:ce},{[U]:[Bt,Ke,Vt,ct,On],endpoint:$I,[D]:he},{[U]:[rt,Ke,Vt,Rn],endpoint:{[Re]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,Ke,Vt,ct,In],[ae]:[{endpoint:UI,[D]:he}],[D]:ce},{[U]:[rt,Ke,Vt,ct,On],endpoint:UI,[D]:he},{[U]:[Bt,Ke,et,Rn],endpoint:{[Re]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Bt,Ke,et,ct,In],[ae]:[{endpoint:jI,[D]:he}],[D]:ce},{[U]:[Bt,Ke,et,ct,On],endpoint:jI,[D]:he},{[U]:[rt,an,is,et,Rn],endpoint:{[Re]:Sz,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,an,is,et,ct,In],[ae]:[{[U]:ji,endpoint:kb,[D]:he},{endpoint:kb,[D]:he}],[D]:ce},{[U]:[rt,an,is,et,ct,On],endpoint:kb,[D]:he},{[U]:[rt,Ke,et,Rn],endpoint:{[Re]:pI,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[rt,Ke,et,ct,In],[ae]:[{[U]:ji,endpoint:{[Re]:pI,[Ce]:_n,[Ae]:Ve},[D]:he},{endpoint:HI,[D]:he}],[D]:ce},{[U]:[rt,Ke,et,ct,On],endpoint:HI,[D]:he}],[D]:ce},{error:"Path-style addressing cannot be used with S3 Accelerate",[D]:De}],[D]:ce}],[D]:ce}],[D]:ce},{[U]:[{[X]:Vs,[W]:[VI]},{[X]:ln,[W]:[VI,qr]}],[ae]:[{[U]:dr,[ae]:[{[U]:p2,[ae]:[MI,DI,{[U]:pl,endpoint:{[Re]:xp,[Ce]:Pb,[Ae]:Ve},[D]:he},{[U]:hp,endpoint:{[Re]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[Ce]:Pb,[Ae]:Ve},[D]:he},{endpoint:{[Re]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[Ce]:Pb,[Ae]:Ve},[D]:he}],[D]:ce},dp],[D]:ce}],[D]:ce},{[U]:[wI],[ae]:[{[U]:dr,[ae]:[{[U]:p2,[ae]:[{[U]:[Vt,Bt,Ke,Rn],endpoint:{[Re]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Vt,Bt,Ke,ct,In],[ae]:[{endpoint:qI,[D]:he}],[D]:ce},{[U]:[Vt,Bt,Ke,ct,On],endpoint:qI,[D]:he},{[U]:[Vt,rt,Ke,Rn],endpoint:{[Re]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[Vt,rt,Ke,ct,In],[ae]:[{endpoint:FI,[D]:he}],[D]:ce},{[U]:[Vt,rt,Ke,ct,On],endpoint:FI,[D]:he},{[U]:[et,Bt,Ke,Rn],endpoint:{[Re]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[et,Bt,Ke,ct,In],[ae]:[{endpoint:GI,[D]:he}],[D]:ce},{[U]:[et,Bt,Ke,ct,On],endpoint:GI,[D]:he},{[U]:[et,rt,an,is,Rn],endpoint:{[Re]:xp,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[et,rt,an,is,ct,In],[ae]:[{[U]:ji,endpoint:Nb,[D]:he},{endpoint:Nb,[D]:he}],[D]:ce},{[U]:[et,rt,an,is,ct,On],endpoint:Nb,[D]:he},{[U]:[et,rt,Ke,Rn],endpoint:{[Re]:mI,[Ce]:Tn,[Ae]:Ve},[D]:he},{[U]:[et,rt,Ke,ct,In],[ae]:[{[U]:ji,endpoint:{[Re]:mI,[Ce]:_n,[Ae]:Ve},[D]:he},{endpoint:ZI,[D]:he}],[D]:ce},{[U]:[et,rt,Ke,ct,On],endpoint:ZI,[D]:he}],[D]:ce},dp],[D]:ce}],[D]:ce}],[D]:ce},{error:"A region must be set when sending requests to S3.",[D]:De}]},hve=dve,pve=new YD({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Tz=(e,t={})=>pve.get(e,()=>ak(hve,{endpointParams:e,logger:t.logger}));Uf.aws=MS;const mve=e=>async(t,n,r)=>{if(!r)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const i=await e(t,n,r),c=qo(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!c)throw new Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);const l=await Nk(r,{getEndpointParameterInstructions:c},t);return Object.assign(i,l)},gve=async(e,t,n)=>({operation:qo(t).operation,region:await Fs(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),yve=mve(gve);function Iz(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function Oz(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}const bve=(e,t,n)=>i=>{const l=e(i).properties?.authSchemes;if(!l)return t(i);const f=[];for(const d of l){const{name:h,properties:b={},...g}=d,v=h.toLowerCase();h!==v&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${h}' to '${v}'`);let _;if(v==="sigv4a"){_="aws.auth#sigv4a";const R=l.find(C=>{const I=C.name.toLowerCase();return I!=="sigv4a"&&I.startsWith("sigv4")});if(fz.sigv4aDependency()==="none"&&R)continue}else if(v.startsWith("sigv4"))_="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${v}'`);const w=n[_];if(!w)throw new Error(`Could not find HttpAuthOption create function for '${_}'`);const E=w(i);E.schemeId=_,E.signingProperties={...E.signingProperties||{},...g,...b},f.push(E)}return f},vve=e=>{const t=[];switch(e.operation){default:t.push(Iz(e)),t.push(Oz(e))}return t},Sve=bve(Tz,vve,{"aws.auth#sigv4":Iz,"aws.auth#sigv4a":Oz}),_ve=e=>{const t=yk(e),n=VY(t);return Object.assign(n,{authSchemePreference:Fs(e.authSchemePreference??[])})},wve=e=>Object.assign(e,{useFipsEndpoint:e.useFipsEndpoint??!1,useDualstackEndpoint:e.useDualstackEndpoint??!1,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:e.clientContextParams??{}}),uw={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class Pn extends Ya{constructor(t){super(t),Object.setPrototypeOf(this,Pn.prototype)}}class fw extends Pn{name="NoSuchUpload";$fault="client";constructor(t){super({name:"NoSuchUpload",$fault:"client",...t}),Object.setPrototypeOf(this,fw.prototype)}}class dw extends Pn{name="AccessDenied";$fault="client";constructor(t){super({name:"AccessDenied",$fault:"client",...t}),Object.setPrototypeOf(this,dw.prototype)}}class hw extends Pn{name="ObjectNotInActiveTierError";$fault="client";constructor(t){super({name:"ObjectNotInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,hw.prototype)}}class pw extends Pn{name="BucketAlreadyExists";$fault="client";constructor(t){super({name:"BucketAlreadyExists",$fault:"client",...t}),Object.setPrototypeOf(this,pw.prototype)}}class mw extends Pn{name="BucketAlreadyOwnedByYou";$fault="client";constructor(t){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...t}),Object.setPrototypeOf(this,mw.prototype)}}class gw extends Pn{name="NoSuchBucket";$fault="client";constructor(t){super({name:"NoSuchBucket",$fault:"client",...t}),Object.setPrototypeOf(this,gw.prototype)}}class yw extends Pn{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(t){super({name:"InvalidObjectState",$fault:"client",...t}),Object.setPrototypeOf(this,yw.prototype),this.StorageClass=t.StorageClass,this.AccessTier=t.AccessTier}}class bw extends Pn{name="NoSuchKey";$fault="client";constructor(t){super({name:"NoSuchKey",$fault:"client",...t}),Object.setPrototypeOf(this,bw.prototype)}}class vw extends Pn{name="NotFound";$fault="client";constructor(t){super({name:"NotFound",$fault:"client",...t}),Object.setPrototypeOf(this,vw.prototype)}}class Sw extends Pn{name="EncryptionTypeMismatch";$fault="client";constructor(t){super({name:"EncryptionTypeMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,Sw.prototype)}}class _w extends Pn{name="InvalidRequest";$fault="client";constructor(t){super({name:"InvalidRequest",$fault:"client",...t}),Object.setPrototypeOf(this,_w.prototype)}}class ww extends Pn{name="InvalidWriteOffset";$fault="client";constructor(t){super({name:"InvalidWriteOffset",$fault:"client",...t}),Object.setPrototypeOf(this,ww.prototype)}}class Ew extends Pn{name="TooManyParts";$fault="client";constructor(t){super({name:"TooManyParts",$fault:"client",...t}),Object.setPrototypeOf(this,Ew.prototype)}}class xw extends Pn{name="IdempotencyParameterMismatch";$fault="client";constructor(t){super({name:"IdempotencyParameterMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,xw.prototype)}}class Rw extends Pn{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(t){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,Rw.prototype)}}const Cw="ACL",Eve="AccessDenied",xve="AbortDate",m2="AccessKeyId",Rve="AbortMultipartUpload",Cve="AbortMultipartUploadOutput",Ave="AbortMultipartUploadRequest",Tve="AcceptRanges",Ive="AbortRuleId",Ove="AccessTier",qn="Bucket",Mz="BucketArn",Mve="BucketAlreadyExists",Dve="BucketAlreadyOwnedByYou",kve="BypassGovernanceRetention",Pve="BucketInfo",Yo="BucketKeyEnabled",Dz="BucketRegion",Aw="Body",kz="Buckets",Wl="ChecksumAlgorithm",Nve="CreateBucket",kv="CreateBucketConfiguration",Lve="CreateBucketOutput",zve="CreateBucketRequest",Tw="CacheControl",ya="ChecksumCRC32",ba="ChecksumCRC32C",va="ChecksumCRC64NVME",Iw="Cache-Control",Bve="CreationDate",Ow="Content-Disposition",Mw="ContentDisposition",Dw="Content-Encoding",kw="ContentEncoding",Pw="ContentLanguage",Nw="Content-Language",Lw="Content-Length",zw="ContentLength",Bw="Content-MD5",$w="ContentMD5",$ve="CompletedMultipartUpload",Uve="CompleteMultipartUploadOutput",jve="CreateMultipartUploadOutput",Hve="CompleteMultipartUploadResult",Vve="CompleteMultipartUploadRequest",qve="CreateMultipartUploadRequest",Pz="CompleteMultipartUpload",Fve="CreateMultipartUpload",Gve="ChecksumMode",Zve="CommonPrefix",Kve="CommonPrefixList",Qve="CompletedPartList",Yve="CompletedPart",Xve="CommonPrefixes",Wve="ContentRange",Jve="Content-Range",Sa="ChecksumSHA1",_a="ChecksumSHA256",eSe="CreateSessionOutput",tSe="CreateSessionResult",nSe="CreateSessionRequest",sSe="CreateSession",Ec="ChecksumType",Uw="Content-Type",jw="ContentType",pg="ContinuationToken",rSe="Contents",g2="Credentials",Nz="DeleteMarker",oSe="DisplayName",iSe="DeleteObjectOutput",aSe="DeleteObjectRequest",cSe="DeleteObject",lSe="DataRedundancy",Lz="Delimiter",Gf="Expiration",Xo="ExpectedBucketOwner",y2="ExpiresString",uSe="EncryptionTypeMismatch",Ho="ETag",zz="EncodingType",Ll="Expires",fSe="FetchOwner",Hw="GrantFullControl",dSe="GetObject",hSe="GetObjectOutput",pSe="GetObjectRequest",Vw="GrantRead",qw="GrantReadACP",mSe="GrantWrite",Fw="GrantWriteACP",gSe="ID",mg="IfMatch",ySe="IfMatchInitiatedTime",bSe="IfMatchLastModifiedTime",vSe="IfMatchSize",SSe="If-Modified-Since",_Se="IfModifiedSince",wSe="InitiateMultipartUploadResult",gg="If-Match",Gw="IfNoneMatch",Zw="If-None-Match",ESe="InvalidObjectState",xSe="IdempotencyParameterMismatch",RSe="InvalidRequest",CSe="IsRestoreInProgress",ASe="IsTruncated",TSe="IfUnmodifiedSince",ISe="If-Unmodified-Since",OSe="InvalidWriteOffset",Ar="Key",MSe="KeyCount",um="Location",DSe="ListAllMyBucketsResult",kSe="ListBuckets",PSe="ListBucketsOutput",NSe="ListBucketsRequest",LSe="ListBucketResult",zSe="LocationConstraint",BSe="LocationInfo",Bz="LastModified",$Se="Last-Modified",USe="ListObjectsV2",jSe="ListObjectsV2Output",HSe="ListObjectsV2Request",Kw="Metadata",VSe="MaxBuckets",qSe="MFA",$z="MaxKeys",FSe="MissingMeta",GSe="MpuObjectSize",ZSe="MultipartUpload",Qw="Name",KSe="NextContinuationToken",QSe="NotFound",YSe="NoSuchBucket",XSe="NoSuchKey",WSe="NoSuchUpload",Yw="Owner",JSe="ObjectAlreadyInActiveTierError",e_e="ObjectLockEnabledForBucket",Xw="ObjectLockLegalHoldStatus",Ww="ObjectLockMode",Jw="ObjectLockRetainUntilDate",t_e="ObjectList",n_e="ObjectNotInActiveTierError",s_e="ObjectOwnership",r_e="OptionalObjectAttributes",o_e="Object",vd="Prefix",i_e="PartsCount",eE="PartNumber",a_e="PutObject",c_e="PutObjectOutput",l_e="PutObjectRequest",u_e="PutObjectTagging",f_e="PutObjectTaggingOutput",d_e="PutObjectTaggingRequest",h_e="Parts",p_e="Part",wa="RequestCharged",m_e="ResponseCacheControl",g_e="ResponseContentDisposition",y_e="ResponseContentEncoding",b_e="ResponseContentLanguage",v_e="ResponseContentType",S_e="ResponseExpires",__e="RestoreExpiryDate",Wo="RequestPayer",w_e="ReplicationStatus",Uz="RestoreStatus",b2="Range",E_e="Restore",jz="StartAfter",v2="SecretAccessKey",x_e="StreamingBlob",Sd="StorageClass",R_e="SessionCredentialValue",C_e="SessionCredentials",A_e="SessionMode",Jo="ServerSideEncryption",ei="SSECustomerAlgorithm",Jl="SSECustomerKey",ti="SSECustomerKeyMD5",xc="SSEKMSEncryptionContext",io="SSEKMSKeyId",S2="SessionToken",Hz="Size",T_e="Tags",I_e="TagCount",O_e="TooManyParts",Vz="TagSet",qz="Tag",Zf="Tagging",Fz="Type",yg="UploadId",M_e="UploadPart",D_e="UploadPartOutput",k_e="UploadPartRequest",P_e="Value",Ea="VersionId",N_e="WriteOffsetBytes",tE="WebsiteRedirectLocation",L_e="accept-ranges",z_e="bucket-region",us="client",Gz="continuation-token",B_e="delimiter",fs="error",$_e="encoding-type",U_e="fetch-owner",Tr="http",bg="httpChecksum",Is="httpError",L="httpHeader",nE="httpPayload",sE="httpPrefixHeaders",Zt="httpQuery",j_e="max-buckets",H_e="max-keys",Zz="prefix",Kz="partNumber",V_e="response-cache-control",q_e="response-content-disposition",F_e="response-content-encoding",G_e="response-content-language",Z_e="response-content-type",K_e="response-expires",Qz="smithy.ts.sdk.synthetic.com.amazonaws.s3",Q_e="start-after",Y_e="streaming",rE="uploadId",oE="versionId",fm="xmlFlattened",Hn="xmlName",iE="x-amz-acl",X_e="x-amz-abort-date",W_e="x-amz-abort-rule-id",J_e="x-amz-bucket-arn",ewe="x-amz-bypass-governance-retention",twe="x-amz-bucket-object-lock-enabled",Yz="x-amz-checksum-algorithm",eu="x-amz-checksum-crc32",tu="x-amz-checksum-crc32c",nu="x-amz-checksum-crc64nvme",nwe="x-amz-checksum-mode",su="x-amz-checksum-sha1",ru="x-amz-checksum-sha256",swe="x-amz-create-session-mode",_d="x-amz-checksum-type",Xz="x-amz-delete-marker",aE="x-amz-expiration",ni="x-amz-expected-bucket-owner",cE="x-amz-grant-full-control",lE="x-amz-grant-read",uE="x-amz-grant-read-acp",rwe="x-amz-grant-write",fE="x-amz-grant-write-acp",owe="x-amz-if-match-initiated-time",iwe="x-amz-if-match-last-modified-time",awe="x-amz-if-match-size",dE="x-amz-meta-",cwe="x-amz-mfa",lwe="x-amz-missing-meta",uwe="x-amz-mp-object-size",fwe="x-amz-mp-parts-count",hE="x-amz-object-lock-legal-hold",pE="x-amz-object-lock-mode",mE="x-amz-object-lock-retain-until-date",dwe="x-amz-object-ownership",hwe="x-amz-optional-object-attributes",pwe="x-amz-object-size",mwe="x-amz-restore",xa="x-amz-request-charged",si="x-amz-request-payer",gwe="x-amz-replication-status",gE="x-amz-storage-class",yE="x-amz-sdk-checksum-algorithm",ri="x-amz-server-side-encryption",oi="x-amz-server-side-encryption-aws-kms-key-id",ii="x-amz-server-side-encryption-bucket-key-enabled",ou="x-amz-server-side-encryption-context",ai="x-amz-server-side-encryption-customer-algorithm",wd="x-amz-server-side-encryption-customer-key",ci="x-amz-server-side-encryption-customer-key-MD5",Wz="x-amz-tagging",ywe="x-amz-tagging-count",Ed="x-amz-version-id",bwe="x-amz-write-offset-bytes",bE="x-amz-website-redirect-location",Te="com.amazonaws.s3",Jz=ts.for(Qz);var vwe=[-3,Qz,"S3ServiceException",0,[],[]];Jz.registerError(vwe,Pn);const ss=ts.for(Te);var Swe=[-3,Te,Eve,{[fs]:us,[Is]:403},[],[]];ss.registerError(Swe,dw);var _we=[-3,Te,Mve,{[fs]:us,[Is]:409},[],[]];ss.registerError(_we,pw);var wwe=[-3,Te,Dve,{[fs]:us,[Is]:409},[],[]];ss.registerError(wwe,mw);var Ewe=[-3,Te,uSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(Ewe,Sw);var xwe=[-3,Te,xSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(xwe,xw);var Rwe=[-3,Te,ESe,{[fs]:us,[Is]:403},[Sd,Ove],[0,0]];ss.registerError(Rwe,yw);var Cwe=[-3,Te,RSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(Cwe,_w);var Awe=[-3,Te,OSe,{[fs]:us,[Is]:400},[],[]];ss.registerError(Awe,ww);var Twe=[-3,Te,YSe,{[fs]:us,[Is]:404},[],[]];ss.registerError(Twe,gw);var Iwe=[-3,Te,XSe,{[fs]:us,[Is]:404},[],[]];ss.registerError(Iwe,bw);var Owe=[-3,Te,WSe,{[fs]:us,[Is]:404},[],[]];ss.registerError(Owe,fw);var Mwe=[-3,Te,QSe,{[fs]:us},[],[]];ss.registerError(Mwe,vw);var Dwe=[-3,Te,JSe,{[fs]:us,[Is]:403},[],[]];ss.registerError(Dwe,Rw);var kwe=[-3,Te,n_e,{[fs]:us,[Is]:403},[],[]];ss.registerError(kwe,hw);var Pwe=[-3,Te,O_e,{[fs]:us,[Is]:400},[],[]];ss.registerError(Pwe,Ew);const Nwe=[Jz,ss];var _2=[0,Te,R_e,8,0],xd=[0,Te,Jl,8,0],iu=[0,Te,xc,8,0],li=[0,Te,io,8,0],vE=[0,Te,x_e,{[Y_e]:1},42],Lwe=[3,Te,Cve,0,[wa],[[0,{[L]:xa}]]],zwe=[3,Te,Ave,0,[qn,Ar,yg,Wo,Xo,ySe],[[0,1],[0,1],[0,{[Zt]:rE}],[0,{[L]:si}],[0,{[L]:ni}],[6,{[L]:owe}]],3],Bwe=[3,Te,qn,0,[Qw,Bve,Dz,Mz],[0,4,0,0]],$we=[3,Te,Pve,0,[lSe,Fz],[0,0]],Uwe=[3,Te,Zve,0,[vd],[0]],jwe=[3,Te,$ve,0,[h_e],[[()=>SEe,{[fm]:1,[Hn]:p_e}]]],Hwe=[3,Te,Yve,0,[Ho,ya,ba,va,Sa,_a,eE],[0,0,0,0,0,0,1]],Vwe=[3,Te,Uve,{[Hn]:Hve},[um,qn,Ar,Gf,Ho,ya,ba,va,Sa,_a,Ec,Jo,Ea,io,Yo,wa],[0,0,0,[0,{[L]:aE}],0,0,0,0,0,0,0,[0,{[L]:ri}],[0,{[L]:Ed}],[()=>li,{[L]:oi}],[2,{[L]:ii}],[0,{[L]:xa}]]],qwe=[3,Te,Vve,0,[qn,Ar,yg,ZSe,ya,ba,va,Sa,_a,Ec,GSe,Wo,Xo,mg,Gw,ei,Jl,ti],[[0,1],[0,1],[0,{[Zt]:rE}],[()=>jwe,{[nE]:1,[Hn]:Pz}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:_d}],[1,{[L]:uwe}],[0,{[L]:si}],[0,{[L]:ni}],[0,{[L]:gg}],[0,{[L]:Zw}],[0,{[L]:ai}],[()=>xd,{[L]:wd}],[0,{[L]:ci}]],3],Fwe=[3,Te,kv,0,[zSe,um,qn,T_e],[0,()=>iEe,()=>$we,[()=>t4,0]]],Gwe=[3,Te,Lve,0,[um,Mz],[[0,{[L]:um}],[0,{[L]:J_e}]]],Zwe=[3,Te,zve,0,[qn,Cw,kv,Hw,Vw,qw,mSe,Fw,e_e,s_e],[[0,1],[0,{[L]:iE}],[()=>Fwe,{[nE]:1,[Hn]:kv}],[0,{[L]:cE}],[0,{[L]:lE}],[0,{[L]:uE}],[0,{[L]:rwe}],[0,{[L]:fE}],[2,{[L]:twe}],[0,{[L]:dwe}]],1],Kwe=[3,Te,jve,{[Hn]:wSe},[xve,Ive,qn,Ar,yg,Jo,ei,ti,io,xc,Yo,wa,Wl,Ec],[[4,{[L]:X_e}],[0,{[L]:W_e}],[0,{[Hn]:qn}],0,0,[0,{[L]:ri}],[0,{[L]:ai}],[0,{[L]:ci}],[()=>li,{[L]:oi}],[()=>iu,{[L]:ou}],[2,{[L]:ii}],[0,{[L]:xa}],[0,{[L]:Yz}],[0,{[L]:_d}]]],Qwe=[3,Te,qve,0,[qn,Ar,Cw,Tw,Mw,kw,Pw,jw,Ll,Hw,Vw,qw,Fw,Kw,Jo,Sd,tE,ei,Jl,ti,io,xc,Yo,Wo,Zf,Ww,Jw,Xw,Xo,Wl,Ec],[[0,1],[0,1],[0,{[L]:iE}],[0,{[L]:Iw}],[0,{[L]:Ow}],[0,{[L]:Dw}],[0,{[L]:Nw}],[0,{[L]:Uw}],[4,{[L]:Ll}],[0,{[L]:cE}],[0,{[L]:lE}],[0,{[L]:uE}],[0,{[L]:fE}],[128,{[sE]:dE}],[0,{[L]:ri}],[0,{[L]:gE}],[0,{[L]:bE}],[0,{[L]:ai}],[()=>xd,{[L]:wd}],[0,{[L]:ci}],[()=>li,{[L]:oi}],[()=>iu,{[L]:ou}],[2,{[L]:ii}],[0,{[L]:si}],[0,{[L]:Wz}],[0,{[L]:pE}],[5,{[L]:mE}],[0,{[L]:hE}],[0,{[L]:ni}],[0,{[L]:Yz}],[0,{[L]:_d}]],2],Ywe=[3,Te,eSe,{[Hn]:tSe},[g2,Jo,io,xc,Yo],[[()=>hEe,{[Hn]:g2}],[0,{[L]:ri}],[()=>li,{[L]:oi}],[()=>iu,{[L]:ou}],[2,{[L]:ii}]],1],Xwe=[3,Te,nSe,0,[qn,A_e,Jo,io,xc,Yo],[[0,1],[0,{[L]:swe}],[0,{[L]:ri}],[()=>li,{[L]:oi}],[()=>iu,{[L]:ou}],[2,{[L]:ii}]],1],Wwe=[3,Te,iSe,0,[Nz,Ea,wa],[[2,{[L]:Xz}],[0,{[L]:Ed}],[0,{[L]:xa}]]],Jwe=[3,Te,aSe,0,[qn,Ar,qSe,Ea,Wo,kve,Xo,mg,bSe,vSe],[[0,1],[0,1],[0,{[L]:cwe}],[0,{[Zt]:oE}],[0,{[L]:si}],[2,{[L]:ewe}],[0,{[L]:ni}],[0,{[L]:gg}],[6,{[L]:iwe}],[1,{[L]:awe}]],2],eEe=[3,Te,hSe,0,[Aw,Nz,Tve,Gf,E_e,Bz,zw,Ho,ya,ba,va,Sa,_a,Ec,FSe,Ea,Tw,Mw,kw,Pw,Wve,jw,Ll,y2,tE,Jo,Kw,ei,ti,io,Yo,Sd,wa,w_e,i_e,I_e,Ww,Jw,Xw],[[()=>vE,16],[2,{[L]:Xz}],[0,{[L]:L_e}],[0,{[L]:aE}],[0,{[L]:mwe}],[4,{[L]:$Se}],[1,{[L]:Lw}],[0,{[L]:Ho}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:_d}],[1,{[L]:lwe}],[0,{[L]:Ed}],[0,{[L]:Iw}],[0,{[L]:Ow}],[0,{[L]:Dw}],[0,{[L]:Nw}],[0,{[L]:Jve}],[0,{[L]:Uw}],[4,{[L]:Ll}],[0,{[L]:y2}],[0,{[L]:bE}],[0,{[L]:ri}],[128,{[sE]:dE}],[0,{[L]:ai}],[0,{[L]:ci}],[()=>li,{[L]:oi}],[2,{[L]:ii}],[0,{[L]:gE}],[0,{[L]:xa}],[0,{[L]:gwe}],[1,{[L]:fwe}],[1,{[L]:ywe}],[0,{[L]:pE}],[5,{[L]:mE}],[0,{[L]:hE}]]],tEe=[3,Te,pSe,0,[qn,Ar,mg,_Se,Gw,TSe,b2,m_e,g_e,y_e,b_e,v_e,S_e,Ea,ei,Jl,ti,Wo,eE,Xo,Gve],[[0,1],[0,1],[0,{[L]:gg}],[4,{[L]:SSe}],[0,{[L]:Zw}],[4,{[L]:ISe}],[0,{[L]:b2}],[0,{[Zt]:V_e}],[0,{[Zt]:q_e}],[0,{[Zt]:F_e}],[0,{[Zt]:G_e}],[0,{[Zt]:Z_e}],[6,{[Zt]:K_e}],[0,{[Zt]:oE}],[0,{[L]:ai}],[()=>xd,{[L]:wd}],[0,{[L]:ci}],[0,{[L]:si}],[1,{[Zt]:Kz}],[0,{[L]:ni}],[0,{[L]:nwe}]],2],nEe=[3,Te,PSe,{[Hn]:DSe},[kz,Yw,pg,vd],[[()=>bEe,0],()=>e4,0,0]],sEe=[3,Te,NSe,0,[VSe,pg,vd,Dz],[[1,{[Zt]:j_e}],[0,{[Zt]:Gz}],[0,{[Zt]:Zz}],[0,{[Zt]:z_e}]]],rEe=[3,Te,jSe,{[Hn]:LSe},[ASe,rSe,Qw,vd,Lz,$z,Xve,zz,MSe,pg,KSe,jz,wa],[2,[()=>_Ee,{[fm]:1}],0,0,0,1,[()=>vEe,{[fm]:1}],0,1,0,0,0,[0,{[L]:xa}]]],oEe=[3,Te,HSe,0,[qn,Lz,zz,$z,vd,pg,fSe,jz,Wo,Xo,r_e],[[0,1],[0,{[Zt]:B_e}],[0,{[Zt]:$_e}],[1,{[Zt]:H_e}],[0,{[Zt]:Zz}],[0,{[Zt]:Gz}],[2,{[Zt]:U_e}],[0,{[Zt]:Q_e}],[0,{[L]:si}],[0,{[L]:ni}],[64,{[L]:hwe}]],1],iEe=[3,Te,BSe,0,[Fz,Qw],[0,0]],aEe=[3,Te,o_e,0,[Ar,Bz,Ho,Wl,Ec,Hz,Sd,Yw,Uz],[0,4,0,[64,{[fm]:1}],0,1,0,()=>e4,()=>dEe]],e4=[3,Te,Yw,0,[oSe,gSe],[0,0]],cEe=[3,Te,c_e,0,[Gf,Ho,ya,ba,va,Sa,_a,Ec,Jo,Ea,ei,ti,io,xc,Yo,Hz,wa],[[0,{[L]:aE}],[0,{[L]:Ho}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:_d}],[0,{[L]:ri}],[0,{[L]:Ed}],[0,{[L]:ai}],[0,{[L]:ci}],[()=>li,{[L]:oi}],[()=>iu,{[L]:ou}],[2,{[L]:ii}],[1,{[L]:pwe}],[0,{[L]:xa}]]],lEe=[3,Te,l_e,0,[qn,Ar,Cw,Aw,Tw,Mw,kw,Pw,zw,$w,jw,Wl,ya,ba,va,Sa,_a,Ll,mg,Gw,Hw,Vw,qw,Fw,N_e,Kw,Jo,Sd,tE,ei,Jl,ti,io,xc,Yo,Wo,Zf,Ww,Jw,Xw,Xo],[[0,1],[0,1],[0,{[L]:iE}],[()=>vE,16],[0,{[L]:Iw}],[0,{[L]:Ow}],[0,{[L]:Dw}],[0,{[L]:Nw}],[1,{[L]:Lw}],[0,{[L]:Bw}],[0,{[L]:Uw}],[0,{[L]:yE}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[4,{[L]:Ll}],[0,{[L]:gg}],[0,{[L]:Zw}],[0,{[L]:cE}],[0,{[L]:lE}],[0,{[L]:uE}],[0,{[L]:fE}],[1,{[L]:bwe}],[128,{[sE]:dE}],[0,{[L]:ri}],[0,{[L]:gE}],[0,{[L]:bE}],[0,{[L]:ai}],[()=>xd,{[L]:wd}],[0,{[L]:ci}],[()=>li,{[L]:oi}],[()=>iu,{[L]:ou}],[2,{[L]:ii}],[0,{[L]:si}],[0,{[L]:Wz}],[0,{[L]:pE}],[5,{[L]:mE}],[0,{[L]:hE}],[0,{[L]:ni}]],2],uEe=[3,Te,f_e,0,[Ea],[[0,{[L]:Ed}]]],fEe=[3,Te,d_e,0,[qn,Ar,Zf,Ea,$w,Wl,Xo,Wo],[[0,1],[0,1],[()=>mEe,{[nE]:1,[Hn]:Zf}],[0,{[Zt]:oE}],[0,{[L]:Bw}],[0,{[L]:yE}],[0,{[L]:ni}],[0,{[L]:si}]],3],dEe=[3,Te,Uz,0,[CSe,__e],[2,4]],hEe=[3,Te,C_e,0,[m2,v2,S2,Gf],[[0,{[Hn]:m2}],[()=>_2,{[Hn]:v2}],[()=>_2,{[Hn]:S2}],[4,{[Hn]:Gf}]],4],pEe=[3,Te,qz,0,[Ar,P_e],[0,0],2],mEe=[3,Te,Zf,0,[Vz],[[()=>t4,0]],1],gEe=[3,Te,D_e,0,[Jo,Ho,ya,ba,va,Sa,_a,ei,ti,io,Yo,wa],[[0,{[L]:ri}],[0,{[L]:Ho}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:ai}],[0,{[L]:ci}],[()=>li,{[L]:oi}],[2,{[L]:ii}],[0,{[L]:xa}]]],yEe=[3,Te,k_e,0,[qn,Ar,eE,yg,Aw,zw,$w,Wl,ya,ba,va,Sa,_a,ei,Jl,ti,Wo,Xo],[[0,1],[0,1],[1,{[Zt]:Kz}],[0,{[Zt]:rE}],[()=>vE,16],[1,{[L]:Lw}],[0,{[L]:Bw}],[0,{[L]:yE}],[0,{[L]:eu}],[0,{[L]:tu}],[0,{[L]:nu}],[0,{[L]:su}],[0,{[L]:ru}],[0,{[L]:ai}],[()=>xd,{[L]:wd}],[0,{[L]:ci}],[0,{[L]:si}],[0,{[L]:ni}]],4],bEe=[1,Te,kz,0,[()=>Bwe,{[Hn]:qn}]],vEe=[1,Te,Kve,0,()=>Uwe],SEe=[1,Te,Qve,0,()=>Hwe],_Ee=[1,Te,t_e,0,[()=>aEe,0]],t4=[1,Te,Vz,0,[()=>pEe,{[Hn]:qz}]],vCe=[9,Te,Rve,{[Tr]:["DELETE","/{Key+}?x-id=AbortMultipartUpload",204]},()=>zwe,()=>Lwe],SCe=[9,Te,Pz,{[Tr]:["POST","/{Key+}",200]},()=>qwe,()=>Vwe],_Ce=[9,Te,Nve,{[Tr]:["PUT","/",200]},()=>Zwe,()=>Gwe],wCe=[9,Te,Fve,{[Tr]:["POST","/{Key+}?uploads",200]},()=>Qwe,()=>Kwe],wEe=[9,Te,sSe,{[Tr]:["GET","/?session",200]},()=>Xwe,()=>Ywe],ECe=[9,Te,cSe,{[Tr]:["DELETE","/{Key+}?x-id=DeleteObject",204]},()=>Jwe,()=>Wwe],xCe=[9,Te,dSe,{[bg]:"-",[Tr]:["GET","/{Key+}?x-id=GetObject",200]},()=>tEe,()=>eEe],EEe=[9,Te,kSe,{[Tr]:["GET","/?x-id=ListBuckets",200]},()=>sEe,()=>nEe],xEe=[9,Te,USe,{[Tr]:["GET","/?list-type=2",200]},()=>oEe,()=>rEe],RCe=[9,Te,a_e,{[bg]:"-",[Tr]:["PUT","/{Key+}?x-id=PutObject",200]},()=>lEe,()=>cEe],CCe=[9,Te,u_e,{[bg]:"-",[Tr]:["PUT","/{Key+}?tagging",200]},()=>fEe,()=>uEe],ACe=[9,Te,M_e,{[bg]:"-",[Tr]:["PUT","/{Key+}?x-id=UploadPart",200]},()=>yEe,()=>gEe];class REe extends Cs.classBuilder().ep({...uw,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions()),nw(r)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(wEe).build(){}const CEe="3.1000.0",AEe={version:CEe};function w2(e){return typeof e=="string"?e.length===0:e.byteLength===0}var n4={name:"SHA-1"},E2={name:"HMAC",hash:n4},TEe=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]),IEe=(function(){function e(t){this.toHash=new Uint8Array(0),t!==void 0&&(this.key=new Promise(function(n,r){Ji().crypto.subtle.importKey("raw",x2(t),E2,!1,["sign"]).then(n,r)}),this.key.catch(function(){}))}return e.prototype.update=function(t){if(!w2(t)){var n=x2(t),r=new Uint8Array(this.toHash.byteLength+n.byteLength);r.set(this.toHash,0),r.set(n,this.toHash.byteLength),this.toHash=r}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(n){return Ji().crypto.subtle.sign(E2,n,t.toHash).then(function(r){return new Uint8Array(r)})}):w2(this.toHash)?Promise.resolve(TEe):Promise.resolve().then(function(){return Ji().crypto.subtle.digest(n4,t.toHash)}).then(function(n){return Promise.resolve(new Uint8Array(n))})},e.prototype.reset=function(){this.toHash=new Uint8Array(0)},e})();function x2(e){return typeof e=="string"?Vk(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var OEe=(function(){function e(t){if(Zk(Ji()))this.hash=new IEe(t);else throw new Error("SHA1 not supported")}return e.prototype.update=function(t,n){this.hash.update(lc(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();class Tf{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const n=new Uint8Array(8);for(let r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)n[r]=i;return t<0&&R2(n),new Tf(n)}valueOf(){const t=this.bytes.slice(0),n=t[0]&128;return n&&R2(t),parseInt(_s(t),16)*(n?-1:1)}toString(){return String(this.valueOf())}}function R2(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}class MEe{toUtf8;fromUtf8;constructor(t,n){this.toUtf8=t,this.fromUtf8=n}format(t){const n=[];for(const c of Object.keys(t)){const l=this.fromUtf8(c);n.push(Uint8Array.from([l.byteLength]),l,this.formatHeaderValue(t[c]))}const r=new Uint8Array(n.reduce((c,l)=>c+l.byteLength,0));let i=0;for(const c of n)r.set(c,i),i+=c.byteLength;return r}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,t.value,!1),new Uint8Array(n.buffer);case"integer":const r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,t.value,!1),new Uint8Array(r.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const c=new DataView(new ArrayBuffer(3+t.value.byteLength));c.setUint8(0,6),c.setUint16(1,t.value.byteLength,!1);const l=new Uint8Array(c.buffer);return l.set(t.value,3),l;case"string":const f=this.fromUtf8(t.value),d=new DataView(new ArrayBuffer(3+f.byteLength));d.setUint8(0,7),d.setUint16(1,f.byteLength,!1);const h=new Uint8Array(d.buffer);return h.set(f,3),h;case"timestamp":const b=new Uint8Array(9);return b[0]=8,b.set(Tf.fromNumber(t.value.valueOf()).bytes,1),b;case"uuid":if(!UEe.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const g=new Uint8Array(17);return g[0]=9,g.set(zD(t.value.replace(/\-/g,"")),1),g}}parse(t){const n={};let r=0;for(;r{if(typeof f!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+f);t=f,n=4,r=new Uint8Array(f),new DataView(r.buffer).setUint32(0,f,!1)},l=async function*(){const f=e[Symbol.asyncIterator]();for(;;){const{value:d,done:h}=await f.next();if(h){if(t)if(t===n)yield r;else throw new Error("Truncated event message received.");else return;return}const b=d.length;let g=0;for(;g({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)return;yield r}}finally{t.releaseLock()}}}),WEe=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(n){const{done:r,value:i}=await t.next();if(r)return n.close();n.enqueue(i)}})};class JEe{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:n}){this.universalMarshaller=new YEe({utf8Decoder:n,utf8Encoder:t})}deserialize(t,n){const r=exe(t)?XEe(t):t;return this.universalMarshaller.deserialize(r,n)}serialize(t,n){const r=this.universalMarshaller.serialize(t,n);return typeof ReadableStream=="function"?WEe(r):r}}const exe=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,txe=e=>new JEe(e);async function nxe(e,t,n=1024*1024){const r=e.size;let i=0;for(;i{r.update(i)}),r.digest()},Hi=64,rxe=16,oxe=[1732584193,4023233417,2562383102,271733878];class ixe{state;buffer;bufferLength;bytesHashed;finished;constructor(){this.reset()}update(t){if(axe(t))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const n=cxe(t);let r=0,{byteLength:i}=n;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,n[r++]),i--,this.bufferLength===Hi&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:n,bufferLength:r,bytesHashed:i}=this,c=i*8;if(n.setUint8(this.bufferLength++,128),r%Hi>=Hi-8){for(let l=this.bufferLength;l>>0,!0),n.setUint32(Hi-4,Math.floor(c/4294967296),!0),this.hashBuffer(),this.finished=!0}const t=new DataView(new ArrayBuffer(rxe));for(let n=0;n<4;n++)t.setUint32(n*4,this.state[n],!0);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}hashBuffer(){const{buffer:t,state:n}=this;let r=n[0],i=n[1],c=n[2],l=n[3];r=Xn(r,i,c,l,t.getUint32(0,!0),7,3614090360),l=Xn(l,r,i,c,t.getUint32(4,!0),12,3905402710),c=Xn(c,l,r,i,t.getUint32(8,!0),17,606105819),i=Xn(i,c,l,r,t.getUint32(12,!0),22,3250441966),r=Xn(r,i,c,l,t.getUint32(16,!0),7,4118548399),l=Xn(l,r,i,c,t.getUint32(20,!0),12,1200080426),c=Xn(c,l,r,i,t.getUint32(24,!0),17,2821735955),i=Xn(i,c,l,r,t.getUint32(28,!0),22,4249261313),r=Xn(r,i,c,l,t.getUint32(32,!0),7,1770035416),l=Xn(l,r,i,c,t.getUint32(36,!0),12,2336552879),c=Xn(c,l,r,i,t.getUint32(40,!0),17,4294925233),i=Xn(i,c,l,r,t.getUint32(44,!0),22,2304563134),r=Xn(r,i,c,l,t.getUint32(48,!0),7,1804603682),l=Xn(l,r,i,c,t.getUint32(52,!0),12,4254626195),c=Xn(c,l,r,i,t.getUint32(56,!0),17,2792965006),i=Xn(i,c,l,r,t.getUint32(60,!0),22,1236535329),r=Wn(r,i,c,l,t.getUint32(4,!0),5,4129170786),l=Wn(l,r,i,c,t.getUint32(24,!0),9,3225465664),c=Wn(c,l,r,i,t.getUint32(44,!0),14,643717713),i=Wn(i,c,l,r,t.getUint32(0,!0),20,3921069994),r=Wn(r,i,c,l,t.getUint32(20,!0),5,3593408605),l=Wn(l,r,i,c,t.getUint32(40,!0),9,38016083),c=Wn(c,l,r,i,t.getUint32(60,!0),14,3634488961),i=Wn(i,c,l,r,t.getUint32(16,!0),20,3889429448),r=Wn(r,i,c,l,t.getUint32(36,!0),5,568446438),l=Wn(l,r,i,c,t.getUint32(56,!0),9,3275163606),c=Wn(c,l,r,i,t.getUint32(12,!0),14,4107603335),i=Wn(i,c,l,r,t.getUint32(32,!0),20,1163531501),r=Wn(r,i,c,l,t.getUint32(52,!0),5,2850285829),l=Wn(l,r,i,c,t.getUint32(8,!0),9,4243563512),c=Wn(c,l,r,i,t.getUint32(28,!0),14,1735328473),i=Wn(i,c,l,r,t.getUint32(48,!0),20,2368359562),r=Jn(r,i,c,l,t.getUint32(20,!0),4,4294588738),l=Jn(l,r,i,c,t.getUint32(32,!0),11,2272392833),c=Jn(c,l,r,i,t.getUint32(44,!0),16,1839030562),i=Jn(i,c,l,r,t.getUint32(56,!0),23,4259657740),r=Jn(r,i,c,l,t.getUint32(4,!0),4,2763975236),l=Jn(l,r,i,c,t.getUint32(16,!0),11,1272893353),c=Jn(c,l,r,i,t.getUint32(28,!0),16,4139469664),i=Jn(i,c,l,r,t.getUint32(40,!0),23,3200236656),r=Jn(r,i,c,l,t.getUint32(52,!0),4,681279174),l=Jn(l,r,i,c,t.getUint32(0,!0),11,3936430074),c=Jn(c,l,r,i,t.getUint32(12,!0),16,3572445317),i=Jn(i,c,l,r,t.getUint32(24,!0),23,76029189),r=Jn(r,i,c,l,t.getUint32(36,!0),4,3654602809),l=Jn(l,r,i,c,t.getUint32(48,!0),11,3873151461),c=Jn(c,l,r,i,t.getUint32(60,!0),16,530742520),i=Jn(i,c,l,r,t.getUint32(8,!0),23,3299628645),r=es(r,i,c,l,t.getUint32(0,!0),6,4096336452),l=es(l,r,i,c,t.getUint32(28,!0),10,1126891415),c=es(c,l,r,i,t.getUint32(56,!0),15,2878612391),i=es(i,c,l,r,t.getUint32(20,!0),21,4237533241),r=es(r,i,c,l,t.getUint32(48,!0),6,1700485571),l=es(l,r,i,c,t.getUint32(12,!0),10,2399980690),c=es(c,l,r,i,t.getUint32(40,!0),15,4293915773),i=es(i,c,l,r,t.getUint32(4,!0),21,2240044497),r=es(r,i,c,l,t.getUint32(32,!0),6,1873313359),l=es(l,r,i,c,t.getUint32(60,!0),10,4264355552),c=es(c,l,r,i,t.getUint32(24,!0),15,2734768916),i=es(i,c,l,r,t.getUint32(52,!0),21,1309151649),r=es(r,i,c,l,t.getUint32(16,!0),6,4149444226),l=es(l,r,i,c,t.getUint32(44,!0),10,3174756917),c=es(c,l,r,i,t.getUint32(8,!0),15,718787259),i=es(i,c,l,r,t.getUint32(36,!0),21,3951481745),n[0]=r+n[0]&4294967295,n[1]=i+n[1]&4294967295,n[2]=c+n[2]&4294967295,n[3]=l+n[3]&4294967295}reset(){this.state=Uint32Array.from(oxe),this.buffer=new DataView(new ArrayBuffer(Hi)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function vg(e,t,n,r,i,c){return t=(t+e&4294967295)+(r+c&4294967295)&4294967295,(t<>>32-i)+n&4294967295}function Xn(e,t,n,r,i,c,l){return vg(t&n|~t&r,e,t,i,c,l)}function Wn(e,t,n,r,i,c,l){return vg(t&r|n&~r,e,t,i,c,l)}function Jn(e,t,n,r,i,c,l){return vg(t^n^r,e,t,i,c,l)}function es(e,t,n,r,i,c,l){return vg(n^(t|~r),e,t,i,c,l)}function axe(e){return typeof e=="string"?e.length===0:e.byteLength===0}function cxe(e){return typeof e=="string"?jo(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}const lxe=e=>({apiVersion:"2006-03-01",base64Decoder:e?.base64Decoder??cc,base64Encoder:e?.base64Encoder??ea,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Tz,extensions:e?.extensions??[],getAwsChunkedEncodingStream:e?.getAwsChunkedEncodingStream??uQ,httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Sve,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new kS},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new jY}],logger:e?.logger??new PS,protocol:e?.protocol??kX,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:Nwe,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:e?.sdkStreamMixin??BD,serviceId:e?.serviceId??"S3",signerConstructor:e?.signerConstructor??fz,signingEscapePath:e?.signingEscapePath??!1,urlParser:e?.urlParser??Hf,useArnRegion:e?.useArnRegion??void 0,utf8Decoder:e?.utf8Decoder??jo,utf8Encoder:e?.utf8Encoder??hc}),uxe=e=>{const t=Xk(e),n=()=>t().then(Sk),r=lxe(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??bk,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Qk({serviceId:r.serviceId,clientVersion:AEe.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??txe,maxAttempts:e?.maxAttempts??Vf,md5:e?.md5??ixe,region:e?.region??Yk("Region is missing"),requestHandler:zm.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||zk),sha1:e?.sha1??OEe,sha256:e?.sha256??Kk,streamCollector:e?.streamCollector??xS,streamHasher:e?.streamHasher??sxe,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Tk)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Ik))}},fxe=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(i){const c=t.findIndex(l=>l.schemeId===i.schemeId);c===-1?t.push(i):t.splice(c,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},dxe=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),hxe=(e,t)=>{const n=Object.assign(tz(e),wk(e),AD(e),fxe(e));return t.forEach(r=>r.configure(n)),Object.assign(e,nz(n),Ek(n),TD(n),dxe(n))};class pxe extends vk{config;constructor(...[t]){const n=uxe(t||{});super(n),this.initConfig=n;const r=wve(n),i=QD(r),c=Rbe(i),l=jk(c),f=Mk(l),d=f,h=Lk(d),b=tve(h),g=_ve(b),v=Vbe(g,{session:[()=>this,REe]}),_=hxe(v,t?.extensions||[]);this.config=_,this.middlewareStack.use(UD(this.config)),this.middlewareStack.use(Ak(this.config)),this.middlewareStack.use(Hk(this.config)),this.middlewareStack.use(Dk(this.config)),this.middlewareStack.use(ID(this.config)),this.middlewareStack.use(OD(this.config)),this.middlewareStack.use(MD(this.config)),this.middlewareStack.use(DD(this.config,{httpAuthSchemeParametersProvider:yve,identityProviderConfigProvider:async w=>new ZD({"aws.auth#sigv4":w.credentials,"aws.auth#sigv4a":w.credentials})})),this.middlewareStack.use(PD(this.config)),this.middlewareStack.use(eve(this.config)),this.middlewareStack.use(Sbe(this.config)),this.middlewareStack.use(Obe(this.config)),this.middlewareStack.use(zbe(this.config)),this.middlewareStack.use(Hbe(this.config))}destroy(){super.destroy()}}class mxe extends Cs.classBuilder().ep(uw).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions()),nw(r)]}).s("AmazonS3","ListBuckets",{}).n("S3Client","ListBucketsCommand").sc(EEe).build(){}class gxe extends Cs.classBuilder().ep({...uw,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(t,n,r,i){return[Ks(r,t.getEndpointParameterInstructions()),nw(r)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(xEe).build(){}const yxe=`${window.location.protocol}//${window.location.hostname}:9999`,bxe=`${window.location.protocol}//${window.location.hostname}:8443`;let Rp=null,yf=null;function Fn(){if(!Rp){const e=Lm();if(!e)throw new Error("AWS credentials not configured");Rp=new pbe({endpoint:yxe,region:"ap-southeast-2",credentials:{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey}})}return Rp}function r4(){if(!yf){const e=Lm();if(!e)throw new Error("AWS credentials not configured");yf=new pxe({endpoint:bxe,region:"ap-southeast-2",credentials:{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey},forcePathStyle:!0}),yf.middlewareStack.use({applyToStack:t=>{t.add(n=>r=>{const i=r.request;return i?.path?.endsWith("/")&&i.path!=="/"&&(i.path=i.path.slice(0,-1)),n(r)},{step:"build",name:"removeTrailingSlash"})}})}return yf}function vxe(){Rp=null,yf=null}function o4(){const e=kt.c(82);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:Sxe},e[0]=t):t=e[0];const n=f5(t),r=bm(),i=L2();let c;e[1]!==r||e[2]!==i?(c=function(){GK(),vxe(),i.clear(),r({to:"/login"})},e[1]=r,e[2]=i,e[3]=c):c=e[3];const l=c;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=N.jsx(rp,{children:"General"}),e[4]=f):f=e[4];const d=n==="/";let h,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=N.jsx(i8,{className:"size-4"}),b=N.jsx("span",{children:"Dashboard"}),e[5]=h,e[6]=b):(h=e[5],b=e[6]);let g;e[7]!==d?(g=N.jsxs(sp,{children:[f,N.jsx(lf,{children:N.jsx(Hr,{children:N.jsx($s,{to:"/",children:N.jsxs(Vr,{isActive:d,tooltip:"Dashboard",children:[h,b]})})})})]}),e[7]=d,e[8]=g):g=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=N.jsx(rp,{children:"EC2"}),e[9]=v):v=e[9];let _;e[10]!==n?(_=n.startsWith("/ec2/describe-instances")||n.startsWith("/ec2/run-instances"),e[10]=n,e[11]=_):_=e[11];let w,E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=N.jsx(cA,{className:"size-4"}),w=N.jsx("span",{children:"Instances"}),e[12]=w,e[13]=E):(w=e[12],E=e[13]);let R;e[14]!==_?(R=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-instances",children:N.jsxs(Vr,{isActive:_,tooltip:"EC2 Instances",children:[E,w]})})}),e[14]=_,e[15]=R):R=e[15];let C;e[16]!==n?(C=n.startsWith("/ec2/describe-images"),e[16]=n,e[17]=C):C=e[17];let I,k;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=N.jsx(c8,{className:"size-4"}),k=N.jsx("span",{children:"Images"}),e[18]=I,e[19]=k):(I=e[18],k=e[19]);let T;e[20]!==C?(T=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-images",children:N.jsxs(Vr,{isActive:C,tooltip:"Images",children:[I,k]})})}),e[20]=C,e[21]=T):T=e[21];let $;e[22]!==n?($=n.startsWith("/ec2/describe-key-pairs"),e[22]=n,e[23]=$):$=e[23];let j,H;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=N.jsx(u8,{className:"size-4"}),H=N.jsx("span",{children:"Key Pairs"}),e[24]=j,e[25]=H):(j=e[24],H=e[25]);let P;e[26]!==$?(P=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-key-pairs",children:N.jsxs(Vr,{isActive:$,tooltip:"Key Pairs",children:[j,H]})})}),e[26]=$,e[27]=P):P=e[27];let Q;e[28]!==n?(Q=n.startsWith("/ec2/describe-volumes")||n.startsWith("/ec2/create-volume")||n.startsWith("/ec2/modify-volume"),e[28]=n,e[29]=Q):Q=e[29];let ne,te;e[30]===Symbol.for("react.memo_cache_sentinel")?(ne=N.jsx(r8,{className:"size-4"}),te=N.jsx("span",{children:"Volumes"}),e[30]=ne,e[31]=te):(ne=e[30],te=e[31]);let F;e[32]!==Q?(F=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-volumes",children:N.jsxs(Vr,{isActive:Q,tooltip:"Volumes",children:[ne,te]})})}),e[32]=Q,e[33]=F):F=e[33];let oe;e[34]!==n?(oe=n.startsWith("/ec2/describe-snapshots")||n.startsWith("/ec2/create-snapshot"),e[34]=n,e[35]=oe):oe=e[35];let me,ge;e[36]===Symbol.for("react.memo_cache_sentinel")?(me=N.jsx(e8,{className:"size-4"}),ge=N.jsx("span",{children:"Snapshots"}),e[36]=me,e[37]=ge):(me=e[36],ge=e[37]);let V;e[38]!==oe?(V=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-snapshots",children:N.jsxs(Vr,{isActive:oe,tooltip:"Snapshots",children:[me,ge]})})}),e[38]=oe,e[39]=V):V=e[39];let re;e[40]!==R||e[41]!==T||e[42]!==P||e[43]!==F||e[44]!==V?(re=N.jsxs(sp,{children:[v,N.jsxs(lf,{children:[R,T,P,F,V]})]}),e[40]=R,e[41]=T,e[42]=P,e[43]=F,e[44]=V,e[45]=re):re=e[45];let J;e[46]===Symbol.for("react.memo_cache_sentinel")?(J=N.jsx(rp,{children:"Networking"}),e[46]=J):J=e[46];let be;e[47]!==n?(be=n.startsWith("/ec2/describe-vpcs")||n.startsWith("/ec2/create-vpc"),e[47]=n,e[48]=be):be=e[48];let ue,z;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=N.jsx(b8,{className:"size-4"}),z=N.jsx("span",{children:"VPCs"}),e[49]=ue,e[50]=z):(ue=e[49],z=e[50]);let ee;e[51]!==be?(ee=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-vpcs",children:N.jsxs(Vr,{isActive:be,tooltip:"VPCs",children:[ue,z]})})}),e[51]=be,e[52]=ee):ee=e[52];let ye;e[53]!==n?(ye=n.startsWith("/ec2/describe-subnets")||n.startsWith("/ec2/create-subnet"),e[53]=n,e[54]=ye):ye=e[54];let we,Ee;e[55]===Symbol.for("react.memo_cache_sentinel")?(we=N.jsx(d8,{className:"size-4"}),Ee=N.jsx("span",{children:"Subnets"}),e[55]=we,e[56]=Ee):(we=e[55],Ee=e[56]);let Se;e[57]!==ye?(Se=N.jsx(Hr,{children:N.jsx($s,{to:"/ec2/describe-subnets",children:N.jsxs(Vr,{isActive:ye,tooltip:"Subnets",children:[we,Ee]})})}),e[57]=ye,e[58]=Se):Se=e[58];let Ie;e[59]!==ee||e[60]!==Se?(Ie=N.jsxs(sp,{children:[J,N.jsxs(lf,{children:[ee,Se]})]}),e[59]=ee,e[60]=Se,e[61]=Ie):Ie=e[61];let qe;e[62]===Symbol.for("react.memo_cache_sentinel")?(qe=N.jsx(rp,{children:"S3"}),e[62]=qe):qe=e[62];let ve;e[63]!==n?(ve=n.startsWith("/s3/ls"),e[63]=n,e[64]=ve):ve=e[64];let Je,wt;e[65]===Symbol.for("react.memo_cache_sentinel")?(Je=N.jsx(cA,{className:"size-4"}),wt=N.jsx("span",{children:"Buckets"}),e[65]=Je,e[66]=wt):(Je=e[65],wt=e[66]);let pe;e[67]!==ve?(pe=N.jsxs(sp,{children:[qe,N.jsx(lf,{children:N.jsx(Hr,{children:N.jsx($s,{to:"/s3/ls",children:N.jsxs(Vr,{isActive:ve,tooltip:"Buckets",children:[Je,wt]})})})})]}),e[67]=ve,e[68]=pe):pe=e[68];let xe;e[69]!==re||e[70]!==Ie||e[71]!==pe||e[72]!==g?(xe=N.jsxs(aq,{children:[g,re,Ie,pe]}),e[69]=re,e[70]=Ie,e[71]=pe,e[72]=g,e[73]=xe):xe=e[73];let _e,Ge;e[74]===Symbol.for("react.memo_cache_sentinel")?(_e=N.jsx(p8,{className:"size-4"}),Ge=N.jsx("span",{children:"Sign out"}),e[74]=_e,e[75]=Ge):(_e=e[74],Ge=e[75]);let Oe;e[76]!==l?(Oe=N.jsx(iq,{children:N.jsx(lf,{children:N.jsx(Hr,{children:N.jsxs(Vr,{onClick:l,tooltip:"Sign out",children:[_e,Ge]})})})}),e[76]=l,e[77]=Oe):Oe=e[77];let He;e[78]===Symbol.for("react.memo_cache_sentinel")?(He=N.jsx(oq,{}),e[78]=He):He=e[78];let Me;return e[79]!==xe||e[80]!==Oe?(Me=N.jsxs(sq,{collapsible:"icon",children:[xe,Oe,He]}),e[79]=xe,e[80]=Oe,e[81]=Me):Me=e[81],Me}function Sxe(e){return e.pathname}function _xe(e){const t=kt.c(18),{error:n,reset:r}=e,i=ns(),c=L2();let l;t[0]!==c||t[1]!==r||t[2]!==i?(l=function(){c.invalidateQueries(),r(),i.invalidate()},t[0]=c,t[1]=r,t[2]=i,t[3]=l):l=t[3];const f=l;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=N.jsx(o4,{}),t[4]=d):d=t[4];let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=N.jsx(XM,{}),t[5]=h):h=t[5];let b,g;t[6]===Symbol.for("react.memo_cache_sentinel")?(b=N.jsx("div",{className:"flex justify-center",children:N.jsx(n8,{className:"size-12 text-destructive"})}),g=N.jsx("h1",{className:"font-semibold text-2xl",children:"Something went wrong"}),t[6]=b,t[7]=g):(b=t[6],g=t[7]);const v=n.message||"An unexpected error occurred";let _;t[8]!==v?(_=N.jsx("p",{className:"text-muted-foreground",children:v}),t[8]=v,t[9]=_):_=t[9];let w;t[10]!==f?(w=N.jsx(Il,{onClick:f,variant:"default",children:"Try Again"}),t[10]=f,t[11]=w):w=t[11];let E;t[12]===Symbol.for("react.memo_cache_sentinel")?(E=N.jsx($s,{to:"/",children:N.jsx(Il,{variant:"outline",children:"Go Home"})}),t[12]=E):E=t[12];let R;t[13]!==w?(R=N.jsxs("div",{className:"flex justify-center gap-2",children:[w,E]}),t[13]=w,t[14]=R):R=t[14];let C;return t[15]!==R||t[16]!==_?(C=N.jsxs(N.Fragment,{children:[d,N.jsxs("main",{className:"flex flex-1 flex-col",children:[h,N.jsx("div",{className:"flex flex-1 items-center justify-center p-6 pt-0",children:N.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[b,g,_,R]})})]})]}),t[15]=R,t[16]=_,t[17]=C):C=t[17],C}const SE=XU()({head:()=>({meta:[{title:"Mulga"}]}),component:()=>N.jsxs(N.Fragment,{children:[N.jsx(g5,{}),N.jsx(o4,{}),N.jsxs("main",{className:"flex flex-1 flex-col",children:[N.jsx(XM,{}),N.jsx("div",{className:"flex flex-1 flex-col p-8",children:N.jsx(aO,{})})]})]}),errorComponent:_xe,notFoundComponent:uq}),wxe=()=>Rt(()=>import("./login.js"),__vite__mapDeps([0,1,2,3])),Exe=_t("/login")({beforeLoad:()=>{if(Lm())throw Vv({to:"/"})},component:Tt(wxe,"component")}),xxe=()=>Rt(()=>import("./route.js"),[]),Rxe=_t("/_auth")({beforeLoad:()=>{if(!Lm())throw Vv({to:"/login"})},component:Tt(xxe,"component")}),i4={queryKey:["ec2","availabilityZones"],queryFn:()=>{const e=new mbe({});return Fn().send(e)},staleTime:3e5},a4={queryKey:["ec2","instances"],queryFn:()=>{const e=new rz({});return Fn().send(e)},refetchInterval:5e3},Cxe=e=>({queryKey:["ec2","instances",e],queryFn:()=>{const t=new rz({InstanceIds:[e]});return Fn().send(t)},refetchInterval:5e3}),c4={queryKey:["ec2","instances","types"],queryFn:()=>{const e=new gbe({Filters:[{Name:"capacity",Values:["true"]}]});return Fn().send(e)},refetchInterval:5e3},l4={queryKey:["ec2","images"],queryFn:()=>{const e=new sz({});return Fn().send(e)}},u4=e=>({queryKey:["ec2","images",e??"none"],queryFn:()=>{if(!e)return{Images:[],$metadata:{}};const t=new sz({ImageIds:[e]});return Fn().send(t)}}),f4={queryKey:["ec2","keypairs"],queryFn:()=>{const e=new oz({});return Fn().send(e)}},Axe=e=>({queryKey:["ec2","keypairs",e],queryFn:()=>{const t=new oz({KeyPairIds:[e]});return Fn().send(t)}}),d4={queryKey:["ec2","regions"],queryFn:()=>{const e=new ybe({});return Fn().send(e)},staleTime:3e5},_E={queryKey:["ec2","subnets"],queryFn:()=>{const e=new az({});return Fn().send(e)}},Txe=e=>({queryKey:["ec2","subnets",e],queryFn:()=>{const t=new az({SubnetIds:[e]});return Fn().send(t)}}),Ixe={queryKey:["ec2","snapshots"],queryFn:()=>{const e=new iz({});return Fn().send(e)},refetchInterval:5e3},Oxe=e=>({queryKey:["ec2","snapshots",e],queryFn:()=>{const t=new iz({SnapshotIds:[e]});return Fn().send(t)},refetchInterval:5e3}),h4={queryKey:["ec2","vpcs"],queryFn:()=>{const e=new lz({});return Fn().send(e)}},Mxe=e=>({queryKey:["ec2","vpcs",e],queryFn:()=>{const t=new lz({VpcIds:[e]});return Fn().send(t)}}),p4={queryKey:["ec2","volumes"],queryFn:()=>{const e=new cz({});return Fn().send(e)},refetchInterval:5e3},m4=e=>({queryKey:["ec2","volumes",e],queryFn:()=>{const t=new cz({VolumeIds:[e]});return Fn().send(t)},refetchInterval:5e3}),Dxe=()=>Rt(()=>import("./index3.js"),__vite__mapDeps([4,5,6])),kxe=_t("/_auth/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(d4)},head:()=>({meta:[{title:"Dashboard | Mulga"}]}),component:Tt(Dxe,"component")}),Pxe={queryKey:["s3","buckets"],queryFn:async()=>{try{const e=new mxe({});return await r4().send(e)}catch{throw new Error("Failed to fetch S3 buckets")}}},g4=(e,t)=>({queryKey:["s3","buckets",e,"objects",t??""],queryFn:async()=>{try{const n=new gxe({Bucket:e,Prefix:t,Delimiter:"/"});return await r4().send(n)}catch{throw new Error("Failed to fetch S3 bucket objects")}}}),Nxe=()=>Rt(()=>import("./index4.js"),__vite__mapDeps([7,5,8,6])),Lxe=_t("/_auth/s3/ls/")({head:()=>({meta:[{title:"Buckets | S3 | Mulga"}]}),loader:async({context:e})=>{await e.queryClient.ensureQueryData(Pxe)},component:Tt(Nxe,"component")}),zxe=()=>Rt(()=>import("./create-bucket.js"),__vite__mapDeps([9,1,10,11,6,2,3,12])),Bxe=_t("/_auth/s3/(buckets)/create-bucket")({head:()=>({meta:[{title:"Create Bucket | S3 | Mulga"}]}),component:Tt(zxe,"component")}),$xe=()=>Rt(()=>import("./create-vpc.js"),__vite__mapDeps([13,1,10,11,6,2,3,14,15])),Uxe=_t("/_auth/ec2/(vpc)/create-vpc")({head:()=>({meta:[{title:"Create VPC | EC2 | Mulga"}]}),component:Tt($xe,"component")}),jxe=()=>Rt(()=>import("./create-volume.js"),__vite__mapDeps([16,1,5,10,11,6,2,3,17,18,14,15])),Hxe=_t("/_auth/ec2/(volumes)/create-volume")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(i4)},head:()=>({meta:[{title:"Create Volume | EC2 | Mulga"}]}),component:Tt(jxe,"component")}),Vxe=()=>Rt(()=>import("./create-subnet.js"),__vite__mapDeps([19,1,5,10,11,6,2,3,17,18,14,15])),qxe=_t("/_auth/ec2/(subnet)/create-subnet")({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(h4),e.queryClient.ensureQueryData(i4)])},head:()=>({meta:[{title:"Create Subnet | EC2 | Mulga"}]}),component:Tt(Vxe,"component")}),Fxe=()=>Rt(()=>import("./create-snapshot.js"),__vite__mapDeps([20,1,5,10,11,6,2,17,18,21,14,15])),Gxe=_t("/_auth/ec2/(snapshots)/create-snapshot")({validateSearch:e=>({volumeId:typeof e.volumeId=="string"?e.volumeId:void 0}),loader:async({context:e})=>{await e.queryClient.ensureQueryData(p4)},head:()=>({meta:[{title:"Create Snapshot | EC2 | Mulga"}]}),component:Tt(Fxe,"component")}),Zxe=()=>Rt(()=>import("./import-key-pair.js"),__vite__mapDeps([22,1,10,11,6,2,3,21,14,15])),Kxe=_t("/_auth/ec2/(key)/import-key-pair")({head:()=>({meta:[{title:"Import Key Pair | EC2 | Mulga"}]}),component:Tt(Zxe,"component")}),Qxe=()=>Rt(()=>import("./create-key-pair.js"),__vite__mapDeps([23,1,10,11,6,2,3,14,15,24,21,18,25])),Yxe=_t("/_auth/ec2/(key)/create-key-pair")({head:()=>({meta:[{title:"Create Key Pair | EC2 | Mulga"}]}),component:Tt(Qxe,"component")}),Xxe=()=>Rt(()=>import("./run-instances.js"),__vite__mapDeps([26,1,5,10,11,6,2,3,17,18,14,15])),Wxe=_t("/_auth/ec2/(instances)/run-instances")({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(l4),e.queryClient.ensureQueryData(f4),e.queryClient.ensureQueryData(c4),e.queryClient.ensureQueryData(_E)])},head:()=>({meta:[{title:"Run Instances | EC2 | Mulga"}]}),component:Tt(Xxe,"component")}),Jxe=()=>Rt(()=>import("./route2.js"),[]),e1e=_t("/_auth/s3/ls/$bucket")({component:Tt(Jxe,"component")}),t1e=()=>Rt(()=>import("./index5.js"),__vite__mapDeps([27,5,10,11,6,12,28,24,25,29])),n1e=_t("/_auth/s3/ls/$bucket/")({loader:async({context:e,params:t})=>{await e.queryClient.ensureQueryData(g4(t.bucket))},head:({params:e})=>({meta:[{title:`${e.bucket} | S3 | Mulga`}]}),component:Tt(t1e,"component")}),s1e=()=>Rt(()=>import("./index6.js"),__vite__mapDeps([30,5,8,6,31])),r1e=_t("/_auth/ec2/(vpc)/describe-vpcs/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(h4)},head:()=>({meta:[{title:"VPCs | EC2 | Mulga"}]}),component:Tt(s1e,"component")}),o1e=()=>Rt(()=>import("./index7.js"),__vite__mapDeps([32,5,8,6,31])),i1e=_t("/_auth/ec2/(volumes)/describe-volumes/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(p4)},head:()=>({meta:[{title:"Volumes | EC2 | Mulga"}]}),component:Tt(o1e,"component")}),a1e=()=>Rt(()=>import("./index8.js"),__vite__mapDeps([33,5,8,6,31])),c1e=_t("/_auth/ec2/(subnet)/describe-subnets/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(_E)},head:()=>({meta:[{title:"Subnets | EC2 | Mulga"}]}),component:Tt(a1e,"component")}),l1e=()=>Rt(()=>import("./index9.js"),__vite__mapDeps([34,5,8,6,31])),u1e=_t("/_auth/ec2/(snapshots)/describe-snapshots/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Ixe)},head:()=>({meta:[{title:"Snapshots | EC2 | Mulga"}]}),component:Tt(l1e,"component")}),f1e=()=>Rt(()=>import("./index10.js"),__vite__mapDeps([35,5,8,6])),d1e=_t("/_auth/ec2/(key)/describe-key-pairs/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(f4)},head:()=>({meta:[{title:"Key Pairs | EC2 | Mulga"}]}),component:Tt(f1e,"component")}),h1e=()=>Rt(()=>import("./index11.js"),__vite__mapDeps([36,5,8,6,31])),p1e=_t("/_auth/ec2/(instances)/describe-instances/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(a4)},head:()=>({meta:[{title:"Instances | EC2 | Mulga"}]}),component:Tt(h1e,"component")}),m1e=()=>Rt(()=>import("./index12.js"),__vite__mapDeps([37,5,8,6,31])),g1e=_t("/_auth/ec2/(images)/describe-images/")({loader:async({context:e})=>{await e.queryClient.ensureQueryData(l4)},head:()=>({meta:[{title:"Images | EC2 | Mulga"}]}),component:Tt(m1e,"component")}),y1e=()=>Rt(()=>import("./_.js"),__vite__mapDeps([38,5,10,11,12,28,24,25,29])),b1e=_t("/_auth/s3/ls/$bucket/$")({loader:async({context:e,params:t})=>{const n=Nj(t._splat||"");await e.queryClient.ensureQueryData(g4(t.bucket,n))},head:({params:e})=>({meta:[{title:`${Lj(e._splat||"",`${e.bucket}/`)} | S3 | Mulga`}]}),component:Tt(y1e,"component")}),v1e=()=>Rt(()=>import("./_id.js"),__vite__mapDeps([39,5,10,40,11,6,31,24,14,29])),S1e=_t("/_auth/ec2/(vpc)/describe-vpcs/$id")({loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.ensureQueryData(Mxe(t.id)),e.queryClient.ensureQueryData(_E)])},head:({params:e})=>({meta:[{title:`${e.id} | VPC | Mulga`}]}),component:Tt(v1e,"component")}),_1e=()=>Rt(()=>import("./_id2.js"),__vite__mapDeps([41,1,5,10,11,6,2,3,14,15])),w1e=_t("/_auth/ec2/(volumes)/modify-volume/$id")({loader:async({context:e,params:t})=>{await e.queryClient.ensureQueryData(m4(t.id))},head:({params:e})=>({meta:[{title:`Resize ${e.id} | EC2 | Mulga`}]}),component:Tt(_1e,"component")}),E1e=()=>Rt(()=>import("./_id3.js"),__vite__mapDeps([42,5,10,40,11,6,31,24,2,3,17,18,14,29])),x1e=_t("/_auth/ec2/(volumes)/describe-volumes/$id")({loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.ensureQueryData(m4(t.id)),e.queryClient.ensureQueryData(a4)])},head:({params:e})=>({meta:[{title:`${e.id} | EC2 | Mulga`}]}),component:Tt(E1e,"component")}),R1e=()=>Rt(()=>import("./_id4.js"),__vite__mapDeps([43,5,10,40,11,6,31,24,14,29])),C1e=_t("/_auth/ec2/(subnet)/describe-subnets/$id")({loader:async({context:e,params:t})=>{await e.queryClient.ensureQueryData(Txe(t.id))},head:({params:e})=>({meta:[{title:`${e.id} | Subnet | Mulga`}]}),component:Tt(R1e,"component")}),A1e=()=>Rt(()=>import("./_id5.js"),__vite__mapDeps([44,5,10,40,11,6,31,24,2,3,14,29])),T1e=_t("/_auth/ec2/(snapshots)/describe-snapshots/$id")({loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.ensureQueryData(Oxe(t.id)),e.queryClient.ensureQueryData(d4)])},head:({params:e})=>({meta:[{title:`${e.id} | EC2 | Mulga`}]}),component:Tt(A1e,"component")}),I1e=()=>Rt(()=>import("./_id6.js"),__vite__mapDeps([45,5,10,40,11,6,24,14,29])),O1e=_t("/_auth/ec2/(key)/describe-key-pairs/$id")({loader:async({context:e,params:t})=>await e.queryClient.ensureQueryData(Axe(t.id)),head:({loaderData:e})=>({meta:[{title:`${e?.KeyPairs?.[0]?.KeyName??"Key Pair"} | EC2 | Mulga`}]}),component:Tt(I1e,"component")}),M1e=()=>Rt(()=>import("./_id7.js"),__vite__mapDeps([46,5,10,40,11,6,31,24,2,17,18,14,47,3,21,29])),D1e=_t("/_auth/ec2/(instances)/describe-instances/$id")({loader:async({context:e,params:t})=>{const n=await e.queryClient.ensureQueryData(Cxe(t.id)),r=n.Reservations?.[0]?.Instances?.[0]?.ImageId;return await Promise.all([e.queryClient.ensureQueryData(u4(r)),e.queryClient.ensureQueryData(c4)]),n},head:({loaderData:e})=>({meta:[{title:`${e?.Reservations?.[0]?.Instances?.[0]?.InstanceId??"Instance"} | EC2 | Mulga`}]}),component:Tt(M1e,"component")}),k1e=()=>Rt(()=>import("./_id8.js"),__vite__mapDeps([48,5,10,6,31,47,40])),P1e=_t("/_auth/ec2/(images)/describe-images/$id")({loader:async({context:e,params:t})=>await e.queryClient.ensureQueryData(u4(t.id)),head:({loaderData:e})=>({meta:[{title:`${e?.Images?.[0]?.Name??"Image"} | EC2 | Mulga`}]}),component:Tt(k1e,"component")}),N1e=Exe.update({id:"/login",path:"/login",getParentRoute:()=>SE}),Ht=Rxe.update({id:"/_auth",getParentRoute:()=>SE}),L1e=kxe.update({id:"/",path:"/",getParentRoute:()=>Ht}),z1e=Lxe.update({id:"/s3/ls/",path:"/s3/ls/",getParentRoute:()=>Ht}),B1e=Bxe.update({id:"/s3/(buckets)/create-bucket",path:"/s3/create-bucket",getParentRoute:()=>Ht}),$1e=Uxe.update({id:"/ec2/(vpc)/create-vpc",path:"/ec2/create-vpc",getParentRoute:()=>Ht}),U1e=Hxe.update({id:"/ec2/(volumes)/create-volume",path:"/ec2/create-volume",getParentRoute:()=>Ht}),j1e=qxe.update({id:"/ec2/(subnet)/create-subnet",path:"/ec2/create-subnet",getParentRoute:()=>Ht}),H1e=Gxe.update({id:"/ec2/(snapshots)/create-snapshot",path:"/ec2/create-snapshot",getParentRoute:()=>Ht}),V1e=Kxe.update({id:"/ec2/(key)/import-key-pair",path:"/ec2/import-key-pair",getParentRoute:()=>Ht}),q1e=Yxe.update({id:"/ec2/(key)/create-key-pair",path:"/ec2/create-key-pair",getParentRoute:()=>Ht}),F1e=Wxe.update({id:"/ec2/(instances)/run-instances",path:"/ec2/run-instances",getParentRoute:()=>Ht}),wE=e1e.update({id:"/s3/ls/$bucket",path:"/s3/ls/$bucket",getParentRoute:()=>Ht}),G1e=n1e.update({id:"/",path:"/",getParentRoute:()=>wE}),Z1e=r1e.update({id:"/ec2/(vpc)/describe-vpcs/",path:"/ec2/describe-vpcs/",getParentRoute:()=>Ht}),K1e=i1e.update({id:"/ec2/(volumes)/describe-volumes/",path:"/ec2/describe-volumes/",getParentRoute:()=>Ht}),Q1e=c1e.update({id:"/ec2/(subnet)/describe-subnets/",path:"/ec2/describe-subnets/",getParentRoute:()=>Ht}),Y1e=u1e.update({id:"/ec2/(snapshots)/describe-snapshots/",path:"/ec2/describe-snapshots/",getParentRoute:()=>Ht}),X1e=d1e.update({id:"/ec2/(key)/describe-key-pairs/",path:"/ec2/describe-key-pairs/",getParentRoute:()=>Ht}),W1e=p1e.update({id:"/ec2/(instances)/describe-instances/",path:"/ec2/describe-instances/",getParentRoute:()=>Ht}),J1e=g1e.update({id:"/ec2/(images)/describe-images/",path:"/ec2/describe-images/",getParentRoute:()=>Ht}),eRe=b1e.update({id:"/$",path:"/$",getParentRoute:()=>wE}),tRe=S1e.update({id:"/ec2/(vpc)/describe-vpcs/$id",path:"/ec2/describe-vpcs/$id",getParentRoute:()=>Ht}),nRe=w1e.update({id:"/ec2/(volumes)/modify-volume/$id",path:"/ec2/modify-volume/$id",getParentRoute:()=>Ht}),sRe=x1e.update({id:"/ec2/(volumes)/describe-volumes/$id",path:"/ec2/describe-volumes/$id",getParentRoute:()=>Ht}),rRe=C1e.update({id:"/ec2/(subnet)/describe-subnets/$id",path:"/ec2/describe-subnets/$id",getParentRoute:()=>Ht}),oRe=T1e.update({id:"/ec2/(snapshots)/describe-snapshots/$id",path:"/ec2/describe-snapshots/$id",getParentRoute:()=>Ht}),iRe=O1e.update({id:"/ec2/(key)/describe-key-pairs/$id",path:"/ec2/describe-key-pairs/$id",getParentRoute:()=>Ht}),aRe=D1e.update({id:"/ec2/(instances)/describe-instances/$id",path:"/ec2/describe-instances/$id",getParentRoute:()=>Ht}),cRe=P1e.update({id:"/ec2/(images)/describe-images/$id",path:"/ec2/describe-images/$id",getParentRoute:()=>Ht}),lRe={AuthS3LsBucketSplatRoute:eRe,AuthS3LsBucketIndexRoute:G1e},uRe=wE._addFileChildren(lRe),fRe={AuthIndexRoute:L1e,AuthS3LsBucketRouteRoute:uRe,AuthEc2instancesRunInstancesRoute:F1e,AuthEc2keyCreateKeyPairRoute:q1e,AuthEc2keyImportKeyPairRoute:V1e,AuthEc2snapshotsCreateSnapshotRoute:H1e,AuthEc2subnetCreateSubnetRoute:j1e,AuthEc2volumesCreateVolumeRoute:U1e,AuthEc2vpcCreateVpcRoute:$1e,AuthS3bucketsCreateBucketRoute:B1e,AuthS3LsIndexRoute:z1e,AuthEc2imagesDescribeImagesIdRoute:cRe,AuthEc2instancesDescribeInstancesIdRoute:aRe,AuthEc2keyDescribeKeyPairsIdRoute:iRe,AuthEc2snapshotsDescribeSnapshotsIdRoute:oRe,AuthEc2subnetDescribeSubnetsIdRoute:rRe,AuthEc2volumesDescribeVolumesIdRoute:sRe,AuthEc2volumesModifyVolumeIdRoute:nRe,AuthEc2vpcDescribeVpcsIdRoute:tRe,AuthEc2imagesDescribeImagesIndexRoute:J1e,AuthEc2instancesDescribeInstancesIndexRoute:W1e,AuthEc2keyDescribeKeyPairsIndexRoute:X1e,AuthEc2snapshotsDescribeSnapshotsIndexRoute:Y1e,AuthEc2subnetDescribeSubnetsIndexRoute:Q1e,AuthEc2volumesDescribeVolumesIndexRoute:K1e,AuthEc2vpcDescribeVpcsIndexRoute:Z1e},dRe=Ht._addFileChildren(fRe),hRe={AuthRouteRoute:dRe,LoginRoute:N1e},pRe=SE._addFileChildren(hRe)._addFileTypes(),y4=new r6({defaultOptions:{queries:{staleTime:5e3}}}),mRe=a5({routeTree:pRe,context:{queryClient:y4},defaultPreload:"intent",scrollRestoration:!0,defaultStructuralSharing:!0,defaultPreloadStaleTime:0}),Fb=document.getElementById("app");Fb&&!Fb.innerHTML&&w5.createRoot(Fb).render(N.jsx(M.StrictMode,{children:N.jsx(C5,{defaultTheme:"system",storageKey:"hive-ui-theme",children:N.jsx(i6,{client:y4,children:N.jsx(eq,{children:N.jsx(u5,{router:mRe})})})})}));export{bCe as $,ORe as A,Il as B,Lj as C,GRe as D,Cs as E,uw as F,Ks as G,ac as H,xCe as I,TRe as J,r4 as K,$s as L,mT as M,ea as N,aO as O,yCe as P,uz as Q,Gxe as R,Tv as S,iX as T,rm as U,lc as V,Gk as W,NW as X,UW as Y,LW as Z,Fk as _,cn as a,yA as a$,$f as a0,kn as a1,Pr as a2,gCe as a3,PS as a4,nw as a5,vCe as a6,SCe as a7,_Ce as a8,wCe as a9,Txe as aA,T1e as aB,Oxe as aC,O1e as aD,Axe as aE,D1e as aF,Cxe as aG,u4 as aH,kRe as aI,Gj as aJ,PRe as aK,MRe as aL,DRe as aM,Qh as aN,Fp as aO,tM as aP,Ol as aQ,kf as aR,Yj as aS,Jt as aT,rS as aU,Hs as aV,cv as aW,Qr as aX,Rm as aY,Xf as aZ,pt as a_,ECe as aa,RCe as ab,CCe as ac,ACe as ad,yRe as ae,gRe as af,Pk as ag,JX as ah,em as ai,L2 as aj,S1e as ak,Mxe as al,w1e as am,m4 as an,VRe as ao,lT as ap,qRe as aq,Cl as ar,jRe as as,HRe as at,oD as au,x1e as av,zj as aw,e8 as ax,ARe as ay,C1e as az,FK as b,KV as b$,Fe as b0,W0 as b1,Do as b2,Kt as b3,yt as b4,LRe as b5,yn as b6,Ss as b7,sM as b8,Kj as b9,CRe as bA,t7 as bB,P7 as bC,ZV as bD,GV as bE,Yf as bF,KM as bG,Sn as bH,zO as bI,na as bJ,nH as bK,BRe as bL,cS as bM,VV as bN,NRe as bO,hO as bP,nS as bQ,xt as bR,yO as bS,fc as bT,i7 as bU,r7 as bV,oM as bW,FV as bX,l7 as bY,U9 as bZ,$9 as b_,Qj as ba,Vo as bb,ot as bc,RRe as bd,T9 as be,s7 as bf,Sr as bg,bV as bh,CM as bi,nM as bj,lS as bk,EV as bl,_M as bm,kM as bn,vm as bo,jM as bp,Np as bq,URe as br,cM as bs,uS as bt,SO as bu,_r as bv,$Re as bw,zRe as bx,L9 as by,X9 as bz,kt as c,B9 as c0,to as c1,ZRe as c2,hQ as c3,Ev as c4,KRe as c5,QRe as c6,YRe as c7,XRe as c8,WRe as c9,G$ as cA,B$ as cB,Zb as cC,hm as cD,L$ as cE,z$ as cF,Gb as cG,M2 as cH,W$ as cI,j$ as cJ,hc as cK,jo as cL,JRe as ca,eCe as cb,tCe as cc,nCe as cd,sCe as ce,rCe as cf,oCe as cg,iCe as ch,aCe as ci,cCe as cj,lCe as ck,uCe as cl,fCe as cm,dCe as cn,hCe as co,pCe as cp,mCe as cq,Fn as cr,dm as cs,bRe as ct,If as cu,t6 as cv,cs as cw,Nr as cx,vRe as cy,P1e as cz,Pxe as d,d4 as e,aT as f,i4 as g,h4 as h,p4 as i,N as j,xs as k,l4 as l,f4 as m,c4 as n,_K as o,_E as p,n1e as q,M as r,FRe as s,IRe as t,bm as u,g4 as v,Ixe as w,a4 as x,b1e as y,Nj as z}; diff --git a/hive/services/hiveui/frontend/dist/assets/login.js b/hive/services/hiveui/frontend/dist/assets/login.js index c513d39a0..e3a629f62 100644 --- a/hive/services/hiveui/frontend/dist/assets/login.js +++ b/hive/services/hiveui/frontend/dist/assets/login.js @@ -1 +1 @@ -import{c as b,a as K,j as c,u as P,b as R,s as L,B as X}from"./index.js";import{a as B,u as G}from"./zod.js";import{F,a as z,b as $,c as O}from"./field.js";import{I as D}from"./input.js";function T(e){const s=b.c(10);let l,t,r;s[0]!==e?({className:l,size:r,...t}=e,s[0]=e,s[1]=l,s[2]=t,s[3]=r):(l=s[1],t=s[2],r=s[3]);const a=r===void 0?"default":r;let i;s[4]!==l?(i=K("group/card flex flex-col gap-4 overflow-hidden rounded-lg bg-card py-4 text-card-foreground text-xs/relaxed ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg",l),s[4]=l,s[5]=i):i=s[5];let o;return s[6]!==t||s[7]!==a||s[8]!==i?(o=c.jsx("div",{className:i,"data-size":a,"data-slot":"card",...t}),s[6]=t,s[7]=a,s[8]=i,s[9]=o):o=s[9],o}function Y(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=K("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",l),s[3]=l,s[4]=r):r=s[4];let a;return s[5]!==t||s[6]!==r?(a=c.jsx("div",{className:r,"data-slot":"card-header",...t}),s[5]=t,s[6]=r,s[7]=a):a=s[7],a}function H(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=K("font-medium text-sm",l),s[3]=l,s[4]=r):r=s[4];let a;return s[5]!==t||s[6]!==r?(a=c.jsx("div",{className:r,"data-slot":"card-title",...t}),s[5]=t,s[6]=r,s[7]=a):a=s[7],a}function J(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=K("text-muted-foreground text-xs/relaxed",l),s[3]=l,s[4]=r):r=s[4];let a;return s[5]!==t||s[6]!==r?(a=c.jsx("div",{className:r,"data-slot":"card-description",...t}),s[5]=t,s[6]=r,s[7]=a):a=s[7],a}function U(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=K("px-4 group-data-[size=sm]/card:px-3",l),s[3]=l,s[4]=r):r=s[4];let a;return s[5]!==t||s[6]!==r?(a=c.jsx("div",{className:r,"data-slot":"card-content",...t}),s[5]=t,s[6]=r,s[7]=a):a=s[7],a}function Z(){const e=b.c(39),s=P();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={resolver:B(R)},e[0]=l):l=e[0];const{register:t,handleSubmit:r,formState:a}=G(l),{errors:i,isSubmitting:o}=a;let N;e[1]!==s?(N=function(M){L(M),s({to:"/"})},e[1]=s,e[2]=N):N=e[2];const _=N;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(H,{children:"AWS Credentials"}),e[3]=S):S=e[3];let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsxs(Y,{children:[S,c.jsxs(J,{children:["Run ",c.jsx("code",{children:"cat ~/hive/config/hive.toml"})," to get your credentials"]})]}),e[4]=v):v=e[4];let d;e[5]!==r||e[6]!==_?(d=r(_),e[5]=r,e[6]=_,e[7]=d):d=e[7];let A;e[8]===Symbol.for("react.memo_cache_sentinel")?(A=c.jsx(z,{children:c.jsx("label",{htmlFor:"accessKeyId",children:"Access Key ID"})}),e[8]=A):A=e[8];const w=!!i.accessKeyId;let n;e[9]!==t?(n=t("accessKeyId"),e[9]=t,e[10]=n):n=e[10];let m;e[11]!==w||e[12]!==n?(m=c.jsx(D,{"aria-invalid":w,autoComplete:"username",id:"accessKeyId",placeholder:"AKIAIOSFODNN7EXAMPLE",...n}),e[11]=w,e[12]=n,e[13]=m):m=e[13];let f;e[14]!==i.accessKeyId?(f=c.jsx(F,{errors:[i.accessKeyId]}),e[14]=i.accessKeyId,e[15]=f):f=e[15];let u;e[16]!==f||e[17]!==m?(u=c.jsxs($,{children:[A,m,f]}),e[16]=f,e[17]=m,e[18]=u):u=e[18];let I;e[19]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsx(z,{children:c.jsx("label",{htmlFor:"secretAccessKey",children:"Secret Access Key"})}),e[19]=I):I=e[19];const E=!!i.secretAccessKey;let p;e[20]!==t?(p=t("secretAccessKey"),e[20]=t,e[21]=p):p=e[21];let x;e[22]!==E||e[23]!==p?(x=c.jsx(D,{"aria-invalid":E,autoComplete:"current-password",id:"secretAccessKey",placeholder:"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",type:"password",...p}),e[22]=E,e[23]=p,e[24]=x):x=e[24];let h;e[25]!==i.secretAccessKey?(h=c.jsx(F,{errors:[i.secretAccessKey]}),e[25]=i.secretAccessKey,e[26]=h):h=e[26];let g;e[27]!==x||e[28]!==h?(g=c.jsxs($,{children:[I,x,h]}),e[27]=x,e[28]=h,e[29]=g):g=e[29];let j;e[30]!==o?(j=c.jsx(X,{className:"w-full",disabled:o,type:"submit",children:"Sign In"}),e[30]=o,e[31]=j):j=e[31];let y;e[32]!==u||e[33]!==g||e[34]!==j?(y=c.jsxs(O,{children:[u,g,j]}),e[32]=u,e[33]=g,e[34]=j,e[35]=y):y=e[35];let C;return e[36]!==y||e[37]!==d?(C=c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsxs(T,{className:"w-full max-w-sm",children:[v,c.jsx(U,{children:c.jsx("form",{onSubmit:d,children:y})})]})}),e[36]=y,e[37]=d,e[38]=C):C=e[38],C}export{Z as component}; +import{c as b,a as v,j as a,u as P,b as D,s as L,B as R}from"./index.js";import{a as X,u as B}from"./zod.js";import{F,a as _,b as z,c as G}from"./field.js";import{I as $}from"./input.js";function O(e){const s=b.c(10);let l,t,r;s[0]!==e?({className:l,size:r,...t}=e,s[0]=e,s[1]=l,s[2]=t,s[3]=r):(l=s[1],t=s[2],r=s[3]);const c=r===void 0?"default":r;let i;s[4]!==l?(i=v("group/card flex flex-col gap-4 overflow-hidden rounded-lg bg-card py-4 text-card-foreground text-xs/relaxed ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg",l),s[4]=l,s[5]=i):i=s[5];let o;return s[6]!==t||s[7]!==c||s[8]!==i?(o=a.jsx("div",{className:i,"data-size":c,"data-slot":"card",...t}),s[6]=t,s[7]=c,s[8]=i,s[9]=o):o=s[9],o}function T(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=v("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",l),s[3]=l,s[4]=r):r=s[4];let c;return s[5]!==t||s[6]!==r?(c=a.jsx("div",{className:r,"data-slot":"card-header",...t}),s[5]=t,s[6]=r,s[7]=c):c=s[7],c}function Y(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=v("font-medium text-sm",l),s[3]=l,s[4]=r):r=s[4];let c;return s[5]!==t||s[6]!==r?(c=a.jsx("div",{className:r,"data-slot":"card-title",...t}),s[5]=t,s[6]=r,s[7]=c):c=s[7],c}function H(e){const s=b.c(8);let l,t;s[0]!==e?({className:l,...t}=e,s[0]=e,s[1]=l,s[2]=t):(l=s[1],t=s[2]);let r;s[3]!==l?(r=v("px-4 group-data-[size=sm]/card:px-3",l),s[3]=l,s[4]=r):r=s[4];let c;return s[5]!==t||s[6]!==r?(c=a.jsx("div",{className:r,"data-slot":"card-content",...t}),s[5]=t,s[6]=r,s[7]=c):c=s[7],c}function Q(){const e=b.c(38),s=P();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={resolver:X(D)},e[0]=l):l=e[0];const{register:t,handleSubmit:r,formState:c}=B(l),{errors:i,isSubmitting:o}=c;let K;e[1]!==s?(K=function(M){L(M),s({to:"/"})},e[1]=s,e[2]=K):K=e[2];const C=K;let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx(T,{children:a.jsx(Y,{children:"AWS Credentials"})}),e[3]=N):N=e[3];let d;e[4]!==r||e[5]!==C?(d=r(C),e[4]=r,e[5]=C,e[6]=d):d=e[6];let S;e[7]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(_,{children:a.jsx("label",{htmlFor:"accessKeyId",children:"Access Key ID"})}),e[7]=S):S=e[7];const w=!!i.accessKeyId;let n;e[8]!==t?(n=t("accessKeyId"),e[8]=t,e[9]=n):n=e[9];let m;e[10]!==w||e[11]!==n?(m=a.jsx($,{"aria-invalid":w,autoComplete:"username",id:"accessKeyId",placeholder:"AKIAIOSFODNN7EXAMPLE",...n}),e[10]=w,e[11]=n,e[12]=m):m=e[12];let f;e[13]!==i.accessKeyId?(f=a.jsx(F,{errors:[i.accessKeyId]}),e[13]=i.accessKeyId,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=a.jsxs(z,{children:[S,m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=a.jsx(_,{children:a.jsx("label",{htmlFor:"secretAccessKey",children:"Secret Access Key"})}),e[18]=A):A=e[18];const E=!!i.secretAccessKey;let p;e[19]!==t?(p=t("secretAccessKey"),e[19]=t,e[20]=p):p=e[20];let x;e[21]!==E||e[22]!==p?(x=a.jsx($,{"aria-invalid":E,autoComplete:"current-password",id:"secretAccessKey",placeholder:"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",type:"password",...p}),e[21]=E,e[22]=p,e[23]=x):x=e[23];let h;e[24]!==i.secretAccessKey?(h=a.jsx(F,{errors:[i.secretAccessKey]}),e[24]=i.secretAccessKey,e[25]=h):h=e[25];let g;e[26]!==x||e[27]!==h?(g=a.jsxs(z,{children:[A,x,h]}),e[26]=x,e[27]=h,e[28]=g):g=e[28];let j;e[29]!==o?(j=a.jsx(R,{className:"w-full",disabled:o,type:"submit",children:"Sign In"}),e[29]=o,e[30]=j):j=e[30];let y;e[31]!==u||e[32]!==g||e[33]!==j?(y=a.jsxs(G,{children:[u,g,j]}),e[31]=u,e[32]=g,e[33]=j,e[34]=y):y=e[34];let I;return e[35]!==y||e[36]!==d?(I=a.jsx("div",{className:"flex flex-1 items-center justify-center",children:a.jsxs(O,{className:"w-full max-w-sm",children:[N,a.jsx(H,{children:a.jsx("form",{onSubmit:d,children:y})})]})}),e[35]=y,e[36]=d,e[37]=I):I=e[37],I}export{Q as component}; diff --git a/hive/services/hiveui/frontend/dist/assets/s3.js b/hive/services/hiveui/frontend/dist/assets/s3.js index e5467fef4..12082c10e 100644 --- a/hive/services/hiveui/frontend/dist/assets/s3.js +++ b/hive/services/hiveui/frontend/dist/assets/s3.js @@ -1,6 +1,6 @@ -import{M as cr,N as hr,P as G,Q as ot,S as Me,T as dr,U as pr,V as yr,_ as mr,W as Er,X as wr,Y as gr,Z as br,$ as vr,a0 as xr,a1 as yt,a2 as ae,a3 as Ie,a4 as _r,E as fe,F as le,G as ce,a5 as he,a6 as Cr,a7 as Sr,a8 as Ar,a9 as Rr,aa as Br,ab as Fr,ac as Tr,ad as Dr,ae as Lr,af as we,ag as Mr,ah as kr,ai as St,c as mt,aj as Et,K as wt}from"./index.js";import{u as gt}from"./error-banner.js";const Pr=typeof ReadableStream=="function"?ReadableStream:function(){};class Nr extends Pr{}const Ir=({expectedChecksum:a,checksum:n,source:f,checksumSourceLocation:l,base64Encoder:y})=>{if(!cr(f))throw new Error(`@smithy/util-stream: unsupported source type ${f?.constructor?.name??f} in ChecksumStream.`);const c=y??hr;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const h=new TransformStream({start(){},async transform(d,g){n.update(d),g.enqueue(d)},async flush(d){const g=await n.digest(),F=c(g);if(a!==F){const R=new Error(`Checksum mismatch: expected "${a}" but received "${F}" in response header "${l}".`);d.error(R)}else d.terminate()}});f.pipeThrough(h);const i=h.readable;return Object.setPrototypeOf(i,Nr.prototype),i};class Ur{allocByteArray;byteLength=0;byteArrays=[];constructor(n){this.allocByteArray=n}push(n){this.byteArrays.push(n),this.byteLength+=n.byteLength}flush(){if(this.byteArrays.length===1){const l=this.byteArrays[0];return this.reset(),l}const n=this.allocByteArray(this.byteLength);let f=0;for(let l=0;lnew Uint8Array(g))];let i=-1;const d=async g=>{const{value:F,done:R}=await l.read(),B=F;if(R){if(i!==-1){const C=Ue(h,i);Se(C)>0&&g.enqueue(C)}g.close()}else{const C=jr(B,!1);if(i!==C&&(i>=0&&g.enqueue(Ue(h,i)),i=C),i===-1){g.enqueue(B);return}const _=Se(B);c+=_;const L=Se(h[i]);if(_>=n&&L===0)g.enqueue(B);else{const T=Hr(h,i,B);!y&&c>n*2&&(y=!0,f?.warn(`@smithy/util-stream - stream chunk size ${_} is below threshold of ${n}, automatically buffering.`)),T>=n?g.enqueue(Ue(h,i)):await d(g)}}};return new ReadableStream({pull:d})}const qr=Or;function Hr(a,n,f){switch(n){case 0:return a[0]+=f,Se(a[0]);case 1:case 2:return a[n].push(f),Se(a[n])}}function Ue(a,n){switch(n){case 0:const f=a[0];return a[0]="",f;case 1:case 2:return a[n].flush()}throw new Error(`@smithy/util-stream - invalid index ${n} given to flush()`)}function Se(a){return a?.byteLength??a?.length??0}function jr(a,n=!0){return n&&typeof Buffer<"u"&&a instanceof Buffer?2:a instanceof Uint8Array?1:typeof a=="string"?0:-1}const st=[G.CRC32,G.CRC32C,G.CRC64NVME,G.SHA1,G.SHA256],Wr=[G.SHA256,G.SHA1,G.CRC32,G.CRC32C,G.CRC64NVME],Kr=(a,{requestChecksumRequired:n,requestAlgorithmMember:f,requestChecksumCalculation:l})=>{if(!f)return l===Me.WHEN_SUPPORTED||n?ot:void 0;if(!a[f])return;const y=a[f];if(!st.includes(y))throw new Error(`The checksum algorithm "${y}" is not supported by the client. Select one of ${st}.`);return y},bt=a=>a===G.MD5?"content-md5":`x-amz-checksum-${a.toLowerCase()}`,$r=(a,n)=>{const f=a.toLowerCase();for(const l of Object.keys(n))if(f===l.toLowerCase())return!0;return!1},zr=(a,n)=>{const f=a.toLowerCase();for(const l of Object.keys(n))if(l.toLowerCase().startsWith(f))return!0;return!1},er=a=>a!==void 0&&typeof a!="string"&&!ArrayBuffer.isView(a)&&!dr(a);var Vr=(function(){function a(){this.crc32c=new At}return a.prototype.update=function(n){pr(n)||this.crc32c.update(yr(n))},a.prototype.digest=function(){return mr(this,void 0,void 0,function(){return Er(this,function(n){return[2,wr(this.crc32c.digest())]})})},a.prototype.reset=function(){this.crc32c=new At},a})(),At=(function(){function a(){this.checksum=4294967295}return a.prototype.update=function(n){var f,l;try{for(var y=gr(n),c=y.next();!c.done;c=y.next()){var h=c.value;this.checksum=this.checksum>>>8^Yr[(this.checksum^h)&255]}}catch(i){f={error:i}}finally{try{c&&!c.done&&(l=y.return)&&l.call(y)}finally{if(f)throw f.error}}return this},a.prototype.digest=function(){return(this.checksum^4294967295)>>>0},a})(),Gr=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],Yr=br(Gr);const Xr=()=>{const n=new Array(8);for(let f=0;f<8;f++){const l=new Array(512);for(let y=0;y<256;y++){let c=BigInt(y);for(let h=0;h<8*(f+1);h++)c&1n?c=c>>1n^0x9a6c9329ac4bc9b5n:c=c>>1n;l[y*2]=Number(c>>32n&0xffffffffn),l[y*2+1]=Number(c&0xffffffffn)}n[f]=new Uint32Array(l)}return n};let Oe,Ce,ut,ft,lt,ct,ht,dt,pt;const Qr=()=>{Oe||(Oe=Xr(),[Ce,ut,ft,lt,ct,ht,dt,pt]=Oe)};class Zr{c1=0;c2=0;constructor(){Qr(),this.reset()}update(n){const f=n.length;let l=0,y=this.c1,c=this.c2;for(;l+8<=f;){const h=((c^n[l++])&255)<<1,i=((c>>>8^n[l++])&255)<<1,d=((c>>>16^n[l++])&255)<<1,g=((c>>>24^n[l++])&255)<<1,F=((y^n[l++])&255)<<1,R=((y>>>8^n[l++])&255)<<1,B=((y>>>16^n[l++])&255)<<1,C=((y>>>24^n[l++])&255)<<1;y=pt[h]^dt[i]^ht[d]^ct[g]^lt[F]^ft[R]^ut[B]^Ce[C],c=pt[h+1]^dt[i+1]^ht[d+1]^ct[g+1]^lt[F+1]^ft[R+1]^ut[B+1]^Ce[C+1]}for(;l>>8|(y&255)<<24)>>>0,y=y>>>8^Ce[h],c^=Ce[h+1],l++}this.c1=y,this.c2=c}async digest(){const n=this.c1^4294967295,f=this.c2^4294967295;return new Uint8Array([n>>>24,n>>>16&255,n>>>8&255,n&255,f>>>24,f>>>16&255,f>>>8&255,f&255])}reset(){this.c1=4294967295,this.c2=4294967295}}const Jr=()=>vr,tr=(a,n)=>{switch(a){case G.MD5:return n.md5;case G.CRC32:return Jr();case G.CRC32C:return Vr;case G.CRC64NVME:return Zr;case G.SHA1:return n.sha1;case G.SHA256:return n.sha256;default:throw new Error(`Unsupported checksum algorithm: ${a}`)}},rr=(a,n)=>{const f=new a;return f.update(xr(n||"")),f.digest()},en={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},tn=(a,n)=>(f,l)=>async y=>{if(!yt.isInstance(y.request)||zr("x-amz-checksum-",y.request.headers))return f(y);const{request:c,input:h}=y,{body:i,headers:d}=c,{base64Encoder:g,streamHasher:F}=a,{requestChecksumRequired:R,requestAlgorithmMember:B}=n,C=await a.requestChecksumCalculation(),_=B?.name,L=B?.httpHeader;_&&!h[_]&&(C===Me.WHEN_SUPPORTED||R)&&(h[_]=ot,L&&(d[L]=ot));const T=Kr(h,{requestChecksumRequired:R,requestAlgorithmMember:B?.name,requestChecksumCalculation:C});let p=i,x=d;if(T){switch(T){case G.CRC32:ae(l,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case G.CRC32C:ae(l,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case G.CRC64NVME:ae(l,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case G.SHA1:ae(l,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case G.SHA256:ae(l,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const A=bt(T),E=tr(T,a);if(er(i)){const{getAwsChunkedEncodingStream:m,bodyLengthChecker:S}=a;p=m(typeof a.requestStreamBufferSize=="number"&&a.requestStreamBufferSize>=8*1024?qr(i,a.requestStreamBufferSize,l.logger):i,{base64Encoder:g,bodyLengthChecker:S,checksumLocationName:A,checksumAlgorithmFn:E,streamHasher:F}),x={...d,"content-encoding":d["content-encoding"]?`${d["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":d["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":A},delete x["content-length"]}else if(!$r(A,d)){const m=await rr(E,i);x={...d,[A]:g(m)}}}try{return await f({...y,request:{...c,headers:x,body:p}})}catch(A){if(A instanceof Error&&A.name==="InvalidChunkSizeError")try{A.message.endsWith(".")||(A.message+="."),A.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch{}throw A}},rn={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},nn=(a,n)=>(f,l)=>async y=>{const c=y.input,{requestValidationModeMember:h}=n,i=await a.requestChecksumCalculation(),d=await a.responseChecksumValidation();switch(i){case Me.WHEN_REQUIRED:ae(l,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case Me.WHEN_SUPPORTED:ae(l,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(d){case Ie.WHEN_REQUIRED:ae(l,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case Ie.WHEN_SUPPORTED:ae(l,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}return h&&!c[h]&&d===Ie.WHEN_SUPPORTED&&(c[h]="ENABLED"),f(y)},nr=(a=[])=>{const n=[];for(const f of Wr)!a.includes(f)||!st.includes(f)||n.push(f);return n},an=a=>{const n=a.lastIndexOf("-");if(n!==-1){const f=a.slice(n+1);if(!f.startsWith("0")){const l=parseInt(f,10);if(!isNaN(l)&&l>=1&&l<=1e4)return!0}}return!1},on=async(a,{checksumAlgorithmFn:n,base64Encoder:f})=>f(await rr(n,a)),sn=async(a,{config:n,responseAlgorithms:f,logger:l})=>{const y=nr(f),{body:c,headers:h}=a;for(const i of y){const d=bt(i),g=h[d];if(g){let F;try{F=tr(i,n)}catch(C){if(i===G.CRC64NVME){l?.warn(`Skipping ${G.CRC64NVME} checksum validation: ${C.message}`);continue}throw C}const{base64Encoder:R}=n;if(er(c)){a.body=Ir({expectedChecksum:g,checksumSourceLocation:d,checksum:new F,source:c,base64Encoder:R});return}const B=await on(c,{checksumAlgorithmFn:F,base64Encoder:R});if(B===g)break;throw new Error(`Checksum mismatch: expected "${B}" but received "${g}" in response header "${d}".`)}}},un={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},fn=(a,n)=>(f,l)=>async y=>{if(!yt.isInstance(y.request))return f(y);const c=y.input,h=await f(y),i=h.response,{requestValidationModeMember:d,responseAlgorithms:g}=n;if(d&&c[d]==="ENABLED"){const{clientName:F,commandName:R}=l;if(F==="S3Client"&&R==="GetObjectCommand"&&nr(g).every(C=>{const _=bt(C),L=i.headers[_];return!L||an(L)}))return h;await sn(i,{config:a,responseAlgorithms:g,logger:l.logger})}return h},vt=(a,n)=>({applyToStack:f=>{f.add(tn(a,n),en),f.addRelativeTo(nn(a,n),rn),f.addRelativeTo(fn(a,n),un)}}),ln="content-length",cn="x-amz-decoded-content-length";function hn(){return(a,n)=>async f=>{const{request:l}=f;if(yt.isInstance(l)&&!(ln in l.headers)&&!(cn in l.headers)){const y="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof n?.logger?.warn=="function"&&!(n.logger instanceof _r)?n.logger.warn(y):console.warn(y)}return a({...f})}}const dn={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},pn=a=>({applyToStack:n=>{n.add(hn(),dn)}});class yn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l)]}).s("AmazonS3","AbortMultipartUpload",{}).n("S3Client","AbortMultipartUploadCommand").sc(Cr).build(){}function mn(a){return n=>async f=>{const l={...f.input},y=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const c of y){const h=l[c.target];if(h){let i;typeof h=="string"?wn(h,a)?i=a.base64Decoder(h):(i=a.utf8Decoder(h),l[c.target]=a.base64Encoder(i)):(i=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),l[c.target]=a.base64Encoder(i));const d=new a.md5;d.update(i),l[c.hash]=a.base64Encoder(await d.digest())}}return n({...f,input:l})}}const En={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Pe=a=>({applyToStack:n=>{n.add(mn(a),En)}});function wn(a,n){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a))return!1;try{return n.base64Decoder(a).length===32}catch{return!1}}class gn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l),Pe(l)]}).s("AmazonS3","CompleteMultipartUpload",{}).n("S3Client","CompleteMultipartUploadCommand").sc(Sr).build(){}function bn(a){return n=>async f=>{const{CreateBucketConfiguration:l}=f.input,y=await a.region();return!l?.LocationConstraint&&!l?.Location&&y!=="us-east-1"&&(f.input.CreateBucketConfiguration=f.input.CreateBucketConfiguration??{},f.input.CreateBucketConfiguration.LocationConstraint=y),n(f)}}const vn={step:"initialize",tags:["LOCATION_CONSTRAINT","CREATE_BUCKET_CONFIGURATION"],name:"locationConstraintMiddleware",override:!0},xn=a=>({applyToStack:n=>{n.add(bn(a),vn)}});class _n extends fe.classBuilder().ep({...le,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},DisableAccessPoints:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l),xn(l)]}).s("AmazonS3","CreateBucket",{}).n("S3Client","CreateBucketCommand").sc(Ar).build(){}class Cn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l),Pe(l)]}).s("AmazonS3","CreateMultipartUpload",{}).n("S3Client","CreateMultipartUploadCommand").sc(Rr).build(){}class Sn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l)]}).s("AmazonS3","DeleteObject",{}).n("S3Client","DeleteObjectCommand").sc(Br).build(){}class Rt extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),vt(l,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),pn(),he(l),Pe(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(Fr).build(){}class An extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),vt(l,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),he(l)]}).s("AmazonS3","PutObjectTagging",{}).n("S3Client","PutObjectTaggingCommand").sc(Tr).build(){}class Rn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,f,l,y){return[ce(l,n.getEndpointParameterInstructions()),vt(l,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),he(l),Pe(l)]}).s("AmazonS3","UploadPart",{}).n("S3Client","UploadPartCommand").sc(Dr).build(){}const Bn={CRC32:"CRC32"};class Fn{onabort=null;_aborted=!1;constructor(){Object.defineProperty(this,"_aborted",{value:!1,writable:!0})}get aborted(){return this._aborted}abort(){this._aborted=!0,this.onabort&&(this.onabort(this),this.onabort=null)}}class Tn{signal=new Fn;abort(){this.signal.abort()}}var Be={exports:{}},Bt;function Ne(){if(Bt)return Be.exports;Bt=1;var a=typeof Reflect=="object"?Reflect:null,n=a&&typeof a.apply=="function"?a.apply:function(m,S,I){return Function.prototype.apply.call(m,S,I)},f;a&&typeof a.ownKeys=="function"?f=a.ownKeys:Object.getOwnPropertySymbols?f=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:f=function(m){return Object.getOwnPropertyNames(m)};function l(E){console&&console.warn&&console.warn(E)}var y=Number.isNaN||function(m){return m!==m};function c(){c.init.call(this)}Be.exports=c,Be.exports.once=p,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var h=10;function i(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(E){if(typeof E!="number"||E<0||y(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");h=E}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||y(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function d(E){return E._maxListeners===void 0?c.defaultMaxListeners:E._maxListeners}c.prototype.getMaxListeners=function(){return d(this)},c.prototype.emit=function(m){for(var S=[],I=1;I0&&(H=S[0]),H instanceof Error)throw H;var Q=new Error("Unhandled error."+(H?" ("+H.message+")":""));throw Q.context=H,Q}var J=U[m];if(J===void 0)return!1;if(typeof J=="function")n(J,this,S);else for(var ee=J.length,oe=_(J,ee),I=0;I0&&H.length>N&&!H.warned){H.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=E,Q.type=m,Q.count=H.length,l(Q)}return E}c.prototype.addListener=function(m,S){return g(this,m,S,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(m,S){return g(this,m,S,!0)};function F(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(E,m,S){var I={fired:!1,wrapFn:void 0,target:E,type:m,listener:S},N=F.bind(I);return N.listener=S,I.wrapFn=N,N}c.prototype.once=function(m,S){return i(S),this.on(m,R(this,m,S)),this},c.prototype.prependOnceListener=function(m,S){return i(S),this.prependListener(m,R(this,m,S)),this},c.prototype.removeListener=function(m,S){var I,N,U,H,Q;if(i(S),N=this._events,N===void 0)return this;if(I=N[m],I===void 0)return this;if(I===S||I.listener===S)--this._eventsCount===0?this._events=Object.create(null):(delete N[m],N.removeListener&&this.emit("removeListener",m,I.listener||S));else if(typeof I!="function"){for(U=-1,H=I.length-1;H>=0;H--)if(I[H]===S||I[H].listener===S){Q=I[H].listener,U=H;break}if(U<0)return this;U===0?I.shift():L(I,U),I.length===1&&(N[m]=I[0]),N.removeListener!==void 0&&this.emit("removeListener",m,Q||S)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(m){var S,I,N;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[m]),this;if(arguments.length===0){var U=Object.keys(I),H;for(N=0;N=0;N--)this.removeListener(m,S[N]);return this};function B(E,m,S){var I=E._events;if(I===void 0)return[];var N=I[m];return N===void 0?[]:typeof N=="function"?S?[N.listener||N]:[N]:S?T(N):_(N,N.length)}c.prototype.listeners=function(m){return B(this,m,!0)},c.prototype.rawListeners=function(m){return B(this,m,!1)},c.listenerCount=function(E,m){return typeof E.listenerCount=="function"?E.listenerCount(m):C.call(E,m)},c.prototype.listenerCount=C;function C(E){var m=this._events;if(m!==void 0){var S=m[E];if(typeof S=="function")return 1;if(S!==void 0)return S.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function _(E,m){for(var S=new Array(m),I=0;I0)throw new Error("Invalid string. Length must be a multiple of 4");var L=C.indexOf("=");L===-1&&(L=_);var T=L===_?0:4-L%4;return[L,T]}function i(C){var _=h(C),L=_[0],T=_[1];return(L+T)*3/4-T}function d(C,_,L){return(_+L)*3/4-L}function g(C){var _,L=h(C),T=L[0],p=L[1],x=new f(d(C,T,p)),A=0,E=p>0?T-4:T,m;for(m=0;m>16&255,x[A++]=_>>8&255,x[A++]=_&255;return p===2&&(_=n[C.charCodeAt(m)]<<2|n[C.charCodeAt(m+1)]>>4,x[A++]=_&255),p===1&&(_=n[C.charCodeAt(m)]<<10|n[C.charCodeAt(m+1)]<<4|n[C.charCodeAt(m+2)]>>2,x[A++]=_>>8&255,x[A++]=_&255),x}function F(C){return a[C>>18&63]+a[C>>12&63]+a[C>>6&63]+a[C&63]}function R(C,_,L){for(var T,p=[],x=_;xE?E:A+x));return T===1?(_=C[L-1],p.push(a[_>>2]+a[_<<4&63]+"==")):T===2&&(_=(C[L-2]<<8)+C[L-1],p.push(a[_>>10]+a[_>>4&63]+a[_<<2&63]+"=")),p.join("")}return _e}var Fe={};var Tt;function Ln(){return Tt||(Tt=1,Fe.read=function(a,n,f,l,y){var c,h,i=y*8-l-1,d=(1<>1,F=-7,R=f?y-1:0,B=f?-1:1,C=a[n+R];for(R+=B,c=C&(1<<-F)-1,C>>=-F,F+=i;F>0;c=c*256+a[n+R],R+=B,F-=8);for(h=c&(1<<-F)-1,c>>=-F,F+=l;F>0;h=h*256+a[n+R],R+=B,F-=8);if(c===0)c=1-g;else{if(c===d)return h?NaN:(C?-1:1)*(1/0);h=h+Math.pow(2,l),c=c-g}return(C?-1:1)*h*Math.pow(2,c-l)},Fe.write=function(a,n,f,l,y,c){var h,i,d,g=c*8-y-1,F=(1<>1,B=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=l?0:c-1,_=l?1:-1,L=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(i=isNaN(n)?1:0,h=F):(h=Math.floor(Math.log(n)/Math.LN2),n*(d=Math.pow(2,-h))<1&&(h--,d*=2),h+R>=1?n+=B/d:n+=B*Math.pow(2,1-R),n*d>=2&&(h++,d/=2),h+R>=F?(i=0,h=F):h+R>=1?(i=(n*d-1)*Math.pow(2,y),h=h+R):(i=n*Math.pow(2,R-1)*Math.pow(2,y),h=0));y>=8;a[f+C]=i&255,C+=_,i/=256,y-=8);for(h=h<0;a[f+C]=h&255,C+=_,h/=256,g-=8);a[f+C-_]|=L*128}),Fe}var Dt;function Re(){return Dt||(Dt=1,(function(a){var n=Dn(),f=Ln(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=i,a.SlowBuffer=p,a.INSPECT_MAX_BYTES=50;var y=2147483647;a.kMaxLength=y,i.TYPED_ARRAY_SUPPORT=c(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function h(r){if(r>y)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,i.prototype),e}function i(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(r)}return d(r,e,t)}i.poolSize=8192;function d(r,e,t){if(typeof r=="string")return B(r,e);if(ArrayBuffer.isView(r))return C(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(D(r,ArrayBuffer)||r&&D(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(D(r,SharedArrayBuffer)||r&&D(r.buffer,SharedArrayBuffer)))return _(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var s=r.valueOf&&r.valueOf();if(s!=null&&s!==r)return i.from(s,e,t);var w=L(r);if(w)return w;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return i.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}i.from=function(r,e,t){return d(r,e,t)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function g(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function F(r,e,t){return g(r),r<=0?h(r):e!==void 0?typeof t=="string"?h(r).fill(e,t):h(r).fill(e):h(r)}i.alloc=function(r,e,t){return F(r,e,t)};function R(r){return g(r),h(r<0?0:T(r)|0)}i.allocUnsafe=function(r){return R(r)},i.allocUnsafeSlow=function(r){return R(r)};function B(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=x(r,e)|0,s=h(t),w=s.write(r,e);return w!==t&&(s=s.slice(0,w)),s}function C(r){for(var e=r.length<0?0:T(r.length)|0,t=h(e),s=0;s=y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y.toString(16)+" bytes");return r|0}function p(r){return+r!=r&&(r=0),i.alloc(+r)}i.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==i.prototype},i.compare=function(e,t){if(D(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var s=e.length,w=t.length,M=0,k=Math.min(s,w);M2&&arguments[2]===!0;if(!s&&t===0)return 0;for(var w=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return P(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return o(r).length;default:if(w)return s?-1:P(r).length;e=(""+e).toLowerCase(),w=!0}}i.byteLength=x;function A(r,e,t){var s=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return se(this,e,t);case"utf8":case"utf-8":return oe(this,e,t);case"ascii":return ie(this,e,t);case"latin1":case"binary":return pe(this,e,t);case"base64":return ee(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,e,t);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),s=!0}}i.prototype._isBuffer=!0;function E(r,e,t){var s=r[e];r[e]=r[t],r[t]=s}i.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tt&&(e+=" ... "),""},l&&(i.prototype[l]=i.prototype.inspect),i.prototype.compare=function(e,t,s,w,M){if(D(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),s===void 0&&(s=e?e.length:0),w===void 0&&(w=0),M===void 0&&(M=this.length),t<0||s>e.length||w<0||M>this.length)throw new RangeError("out of range index");if(w>=M&&t>=s)return 0;if(w>=M)return-1;if(t>=s)return 1;if(t>>>=0,s>>>=0,w>>>=0,M>>>=0,this===e)return 0;for(var k=M-w,W=s-t,K=Math.min(k,W),z=this.slice(w,M),X=e.slice(t,s),$=0;$2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,O(t)&&(t=w?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(w)return-1;t=r.length-1}else if(t<0)if(w)t=0;else return-1;if(typeof e=="string"&&(e=i.from(e,s)),i.isBuffer(e))return e.length===0?-1:S(r,e,t,s,w);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?w?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):S(r,[e],t,s,w);throw new TypeError("val must be string, number or Buffer")}function S(r,e,t,s,w){var M=1,k=r.length,W=e.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(r.length<2||e.length<2)return-1;M=2,k/=2,W/=2,t/=2}function K(_t,Ct){return M===1?_t[Ct]:_t.readUInt16BE(Ct*M)}var z;if(w){var X=-1;for(z=t;zk&&(t=k-W),z=t;z>=0;z--){for(var $=!0,te=0;tew&&(s=w)):s=w;var M=e.length;s>M/2&&(s=M/2);for(var k=0;k>>0,isFinite(s)?(s=s>>>0,w===void 0&&(w="utf8")):(w=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var M=this.length-t;if((s===void 0||s>M)&&(s=M),e.length>0&&(s<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");for(var k=!1;;)switch(w){case"hex":return I(this,e,t,s);case"utf8":case"utf-8":return N(this,e,t,s);case"ascii":return U(this,e,t,s);case"latin1":case"binary":return H(this,e,t,s);case"base64":return Q(this,e,t,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,e,t,s);default:if(k)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),k=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(r,e,t){return e===0&&t===r.length?n.fromByteArray(r):n.fromByteArray(r.slice(e,t))}function oe(r,e,t){t=Math.min(r.length,t);for(var s=[],w=e;w239?4:M>223?3:M>191?2:1;if(w+W<=t){var K,z,X,$;switch(W){case 1:M<128&&(k=M);break;case 2:K=r[w+1],(K&192)===128&&($=(M&31)<<6|K&63,$>127&&(k=$));break;case 3:K=r[w+1],z=r[w+2],(K&192)===128&&(z&192)===128&&($=(M&15)<<12|(K&63)<<6|z&63,$>2047&&($<55296||$>57343)&&(k=$));break;case 4:K=r[w+1],z=r[w+2],X=r[w+3],(K&192)===128&&(z&192)===128&&(X&192)===128&&($=(M&15)<<18|(K&63)<<12|(z&63)<<6|X&63,$>65535&&$<1114112&&(k=$))}}k===null?(k=65533,W=1):k>65535&&(k-=65536,s.push(k>>>10&1023|55296),k=56320|k&1023),s.push(k),w+=W}return xe(s)}var de=4096;function xe(r){var e=r.length;if(e<=de)return String.fromCharCode.apply(String,r);for(var t="",s=0;ss)&&(t=s);for(var w="",M=e;Ms&&(e=s),t<0?(t+=s,t<0&&(t=0)):t>s&&(t=s),tt)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);for(var w=this[e],M=1,k=0;++k>>0,t=t>>>0,s||Y(e,t,this.length);for(var w=this[e+--t],M=1;t>0&&(M*=256);)w+=this[e+--t]*M;return w},i.prototype.readUInt8=function(e,t){return e=e>>>0,t||Y(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Y(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Y(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},i.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);for(var w=this[e],M=1,k=0;++k=M&&(w-=Math.pow(2,8*t)),w},i.prototype.readIntBE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);for(var w=t,M=1,k=this[e+--w];w>0&&(M*=256);)k+=this[e+--w]*M;return M*=128,k>=M&&(k-=Math.pow(2,8*t)),k},i.prototype.readInt8=function(e,t){return e=e>>>0,t||Y(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,t){e=e>>>0,t||Y(e,2,this.length);var s=this[e]|this[e+1]<<8;return s&32768?s|4294901760:s},i.prototype.readInt16BE=function(e,t){e=e>>>0,t||Y(e,2,this.length);var s=this[e+1]|this[e]<<8;return s&32768?s|4294901760:s},i.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Y(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Y(e,8,this.length),f.read(this,e,!1,52,8)};function Z(r,e,t,s,w,M){if(!i.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>w||er.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(e,t,s,w){if(e=+e,t=t>>>0,s=s>>>0,!w){var M=Math.pow(2,8*s)-1;Z(this,e,t,s,M,0)}var k=1,W=0;for(this[t]=e&255;++W>>0,s=s>>>0,!w){var M=Math.pow(2,8*s)-1;Z(this,e,t,s,M,0)}var k=s-1,W=1;for(this[t+k]=e&255;--k>=0&&(W*=256);)this[t+k]=e/W&255;return t+s},i.prototype.writeUInt8=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,1,255,0),this[t]=e&255,t+1},i.prototype.writeUInt16LE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},i.prototype.writeUInt32LE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},i.prototype.writeUInt32BE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},i.prototype.writeIntLE=function(e,t,s,w){if(e=+e,t=t>>>0,!w){var M=Math.pow(2,8*s-1);Z(this,e,t,s,M-1,-M)}var k=0,W=1,K=0;for(this[t]=e&255;++k>0)-K&255;return t+s},i.prototype.writeIntBE=function(e,t,s,w){if(e=+e,t=t>>>0,!w){var M=Math.pow(2,8*s-1);Z(this,e,t,s,M-1,-M)}var k=s-1,W=1,K=0;for(this[t+k]=e&255;--k>=0&&(W*=256);)e<0&&K===0&&this[t+k+1]!==0&&(K=1),this[t+k]=(e/W>>0)-K&255;return t+s},i.prototype.writeInt8=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},i.prototype.writeInt16LE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},i.prototype.writeInt32LE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,s){return e=+e,t=t>>>0,s||Z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function re(r,e,t,s,w,M){if(t+s>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function me(r,e,t,s,w){return e=+e,t=t>>>0,w||re(r,e,t,4),f.write(r,e,t,s,23,4),t+4}i.prototype.writeFloatLE=function(e,t,s){return me(this,e,t,!0,s)},i.prototype.writeFloatBE=function(e,t,s){return me(this,e,t,!1,s)};function Ee(r,e,t,s,w){return e=+e,t=t>>>0,w||re(r,e,t,8),f.write(r,e,t,s,52,8),t+8}i.prototype.writeDoubleLE=function(e,t,s){return Ee(this,e,t,!0,s)},i.prototype.writeDoubleBE=function(e,t,s){return Ee(this,e,t,!1,s)},i.prototype.copy=function(e,t,s,w){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(s||(s=0),!w&&w!==0&&(w=this.length),t>=e.length&&(t=e.length),t||(t=0),w>0&&w=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),e.length-t=0;--k)e[k+t]=this[k+s];else Uint8Array.prototype.set.call(e,this.subarray(s,w),t);return M},i.prototype.fill=function(e,t,s,w){if(typeof e=="string"){if(typeof t=="string"?(w=t,t=0,s=this.length):typeof s=="string"&&(w=s,s=this.length),w!==void 0&&typeof w!="string")throw new TypeError("encoding must be a string");if(typeof w=="string"&&!i.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(e.length===1){var M=e.charCodeAt(0);(w==="utf8"&&M<128||w==="latin1")&&(e=M)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length>>0,s=s===void 0?this.length:s>>>0,e||(e=0);var k;if(typeof e=="number")for(k=t;k55295&&t<57344){if(!w){if(t>56319){(e-=3)>-1&&M.push(239,191,189);continue}else if(k+1===s){(e-=3)>-1&&M.push(239,191,189);continue}w=t;continue}if(t<56320){(e-=3)>-1&&M.push(239,191,189),w=t;continue}t=(w-55296<<10|t-56320)+65536}else w&&(e-=3)>-1&&M.push(239,191,189);if(w=null,t<128){if((e-=1)<0)break;M.push(t)}else if(t<2048){if((e-=2)<0)break;M.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;M.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;M.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return M}function q(r){for(var e=[],t=0;t>8,w=t%256,M.push(w),M.push(s);return M}function o(r){return n.toByteArray(b(r))}function u(r,e,t,s){for(var w=0;w=e.length||w>=r.length);++w)e[w+t]=r[w];return w}function D(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function O(r){return r!==r}var V=(function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var s=t*16,w=0;w<16;++w)e[s+w]=r[t]+r[w];return e})()})(He)),He}var ue=Re();const Mn={lstatSync:()=>{},isFileReadStream(a){return!1}},ke={...Mn,runtime:"browser"},Te=a=>{if(a==null)return 0;if(typeof a=="string")return ue.Buffer.byteLength(a);if(typeof a.byteLength=="number")return a.byteLength;if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size;if(typeof a.start=="number"&&typeof a.end=="number")return a.end+1-a.start;if(ke.isFileReadStream(a))try{return ke.lstatSync(a.path).size}catch{return}};var ne;(function(a){a.EMPTY_INPUT="a null or undefined Body",a.CONTENT_LENGTH="the ContentLength property of the params set by the caller",a.STRING_LENGTH="the encoded byte length of the Body string",a.TYPED_ARRAY="the byteLength of a typed byte array such as Uint8Array",a.LENGTH="the value of Body.length",a.SIZE="the value of Body.size",a.START_END_DIFF="the numeric difference between Body.start and Body.end",a.LSTAT="the size of the file given by Body.path on disk as reported by lstatSync"})(ne||(ne={}));const kn=(a,n)=>{if(n!=null)return ne.CONTENT_LENGTH;if(a==null)return ne.EMPTY_INPUT;if(typeof a=="string")return ne.STRING_LENGTH;if(typeof a.byteLength=="number")return ne.TYPED_ARRAY;if(typeof a.length=="number")return ne.LENGTH;if(typeof a.size=="number")return ne.SIZE;if(typeof a.start=="number"&&typeof a.end=="number")return ne.START_END_DIFF;if(ke.isFileReadStream(a))try{return ke.lstatSync(a.path).size,ne.LSTAT}catch{return}};var De={exports:{}},Lt;function be(){return Lt||(Lt=1,typeof Object.create=="function"?De.exports=function(n,f){f&&(n.super_=f,n.prototype=Object.create(f.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:De.exports=function(n,f){if(f){n.super_=f;var l=function(){};l.prototype=f.prototype,n.prototype=new l,n.prototype.constructor=n}}),De.exports}var je,Mt;function ir(){return Mt||(Mt=1,je=Ne().EventEmitter),je}const Pn={},Nn=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),ar=Lr(Nn);var We,kt;function In(){if(kt)return We;kt=1;function a(_,L){var T=Object.keys(_);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(_);L&&(p=p.filter(function(x){return Object.getOwnPropertyDescriptor(_,x).enumerable})),T.push.apply(T,p)}return T}function n(_){for(var L=1;L0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(T){var p={data:T,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var p=this.head,x=""+p.data;p=p.next;)x+=T+p.data;return x}},{key:"concat",value:function(T){if(this.length===0)return g.alloc(0);for(var p=g.allocUnsafe(T>>>0),x=this.head,A=0;x;)C(x.data,p,A),A+=x.data.length,x=x.next;return p}},{key:"consume",value:function(T,p){var x;return TE.length?E.length:T;if(m===E.length?A+=E:A+=E.slice(0,T),T-=m,T===0){m===E.length?(++x,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=E.slice(m));break}++x}return this.length-=x,A}},{key:"_getBuffer",value:function(T){var p=g.allocUnsafe(T),x=this.head,A=1;for(x.data.copy(p),T-=x.data.length;x=x.next;){var E=x.data,m=T>E.length?E.length:T;if(E.copy(p,p.length-T,0,m),T-=m,T===0){m===E.length?(++A,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=E.slice(m));break}++A}return this.length-=A,p}},{key:B,value:function(T,p){return R(this,n(n({},p),{},{depth:0,customInspect:!1}))}}]),_})(),We}var Ke,Pt;function or(){if(Pt)return Ke;Pt=1;function a(h,i){var d=this,g=this._readableState&&this._readableState.destroyed,F=this._writableState&&this._writableState.destroyed;return g||F?(i?i(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(y,this,h)):process.nextTick(y,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(R){!i&&R?d._writableState?d._writableState.errorEmitted?process.nextTick(f,d):(d._writableState.errorEmitted=!0,process.nextTick(n,d,R)):process.nextTick(n,d,R):i?(process.nextTick(f,d),i(R)):process.nextTick(f,d)}),this)}function n(h,i){y(h,i),f(h)}function f(h){h._writableState&&!h._writableState.emitClose||h._readableState&&!h._readableState.emitClose||h.emit("close")}function l(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function y(h,i){h.emit("error",i)}function c(h,i){var d=h._readableState,g=h._writableState;d&&d.autoDestroy||g&&g.autoDestroy?h.destroy(i):h.emit("error",i)}return Ke={destroy:a,undestroy:l,errorOrDestroy:c},Ke}var $e={},Nt;function ve(){if(Nt)return $e;Nt=1;function a(i,d){i.prototype=Object.create(d.prototype),i.prototype.constructor=i,i.__proto__=d}var n={};function f(i,d,g){g||(g=Error);function F(B,C,_){return typeof d=="string"?d:d(B,C,_)}var R=(function(B){a(C,B);function C(_,L,T){return B.call(this,F(_,L,T))||this}return C})(g);R.prototype.name=g.name,R.prototype.code=i,n[i]=R}function l(i,d){if(Array.isArray(i)){var g=i.length;return i=i.map(function(F){return String(F)}),g>2?"one of ".concat(d," ").concat(i.slice(0,g-1).join(", "),", or ")+i[g-1]:g===2?"one of ".concat(d," ").concat(i[0]," or ").concat(i[1]):"of ".concat(d," ").concat(i[0])}else return"of ".concat(d," ").concat(String(i))}function y(i,d,g){return i.substr(0,d.length)===d}function c(i,d,g){return(g===void 0||g>i.length)&&(g=i.length),i.substring(g-d.length,g)===d}function h(i,d,g){return typeof g!="number"&&(g=0),g+d.length>i.length?!1:i.indexOf(d,g)!==-1}return f("ERR_INVALID_OPT_VALUE",function(i,d){return'The value "'+d+'" is invalid for option "'+i+'"'},TypeError),f("ERR_INVALID_ARG_TYPE",function(i,d,g){var F;typeof d=="string"&&y(d,"not ")?(F="must not be",d=d.replace(/^not /,"")):F="must be";var R;if(c(i," argument"))R="The ".concat(i," ").concat(F," ").concat(l(d,"type"));else{var B=h(i,".")?"property":"argument";R='The "'.concat(i,'" ').concat(B," ").concat(F," ").concat(l(d,"type"))}return R+=". Received type ".concat(typeof g),R},TypeError),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),f("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),f("ERR_STREAM_PREMATURE_CLOSE","Premature close"),f("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),f("ERR_STREAM_WRITE_AFTER_END","write after end"),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$e.codes=n,$e}var ze,It;function sr(){if(It)return ze;It=1;var a=ve().codes.ERR_INVALID_OPT_VALUE;function n(l,y,c){return l.highWaterMark!=null?l.highWaterMark:y?l[c]:null}function f(l,y,c,h){var i=n(y,h,c);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var d=h?c:"highWaterMark";throw new a(d,i)}return Math.floor(i)}return l.objectMode?16:16*1024}return ze={getHighWaterMark:f},ze}var Ve,Ut;function Un(){if(Ut)return Ve;Ut=1,Ve=a;function a(f,l){if(n("noDeprecation"))return f;var y=!1;function c(){if(!y){if(n("throwDeprecation"))throw new Error(l);n("traceDeprecation")?console.trace(l):console.warn(l),y=!0}return f.apply(this,arguments)}return c}function n(f){try{if(!we.localStorage)return!1}catch{return!1}var l=we.localStorage[f];return l==null?!1:String(l).toLowerCase()==="true"}return Ve}var Ge,Ot;function ur(){if(Ot)return Ge;Ot=1,Ge=N;function a(v){var b=this;this.next=null,this.entry=null,this.finish=function(){Ee(b,v)}}var n;N.WritableState=S;var f={deprecate:Un()},l=ir(),y=Re().Buffer,c=(typeof we<"u"?we:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function h(v){return y.from(v)}function i(v){return y.isBuffer(v)||v instanceof c}var d=or(),g=sr(),F=g.getHighWaterMark,R=ve().codes,B=R.ERR_INVALID_ARG_TYPE,C=R.ERR_METHOD_NOT_IMPLEMENTED,_=R.ERR_MULTIPLE_CALLBACK,L=R.ERR_STREAM_CANNOT_PIPE,T=R.ERR_STREAM_DESTROYED,p=R.ERR_STREAM_NULL_VALUES,x=R.ERR_STREAM_WRITE_AFTER_END,A=R.ERR_UNKNOWN_ENCODING,E=d.errorOrDestroy;be()(N,l);function m(){}function S(v,b,P){n=n||ge(),v=v||{},typeof P!="boolean"&&(P=b instanceof n),this.objectMode=!!v.objectMode,P&&(this.objectMode=this.objectMode||!!v.writableObjectMode),this.highWaterMark=F(this,v,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var q=v.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=v.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(j){xe(b,j)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=v.emitClose!==!1,this.autoDestroy=!!v.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}S.prototype.getBuffer=function(){for(var b=this.bufferedRequest,P=[];b;)P.push(b),b=b.next;return P},(function(){try{Object.defineProperty(S.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(b){return I.call(this,b)?!0:this!==N?!1:b&&b._writableState instanceof S}})):I=function(b){return b instanceof this};function N(v){n=n||ge();var b=this instanceof n;if(!b&&!I.call(N,this))return new N(v);this._writableState=new S(v,this,b),this.writable=!0,v&&(typeof v.write=="function"&&(this._write=v.write),typeof v.writev=="function"&&(this._writev=v.writev),typeof v.destroy=="function"&&(this._destroy=v.destroy),typeof v.final=="function"&&(this._final=v.final)),l.call(this)}N.prototype.pipe=function(){E(this,new L)};function U(v,b){var P=new x;E(v,P),process.nextTick(b,P)}function H(v,b,P,q){var j;return P===null?j=new p:typeof P!="string"&&!b.objectMode&&(j=new B("chunk",["string","Buffer"],P)),j?(E(v,j),process.nextTick(q,j),!1):!0}N.prototype.write=function(v,b,P){var q=this._writableState,j=!1,o=!q.objectMode&&i(v);return o&&!y.isBuffer(v)&&(v=h(v)),typeof b=="function"&&(P=b,b=null),o?b="buffer":b||(b=q.defaultEncoding),typeof P!="function"&&(P=m),q.ending?U(this,P):(o||H(this,q,v,P))&&(q.pendingcb++,j=J(this,q,o,v,b,P)),j},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){var v=this._writableState;v.corked&&(v.corked--,!v.writing&&!v.corked&&!v.bufferProcessing&&v.bufferedRequest&&se(this,v))},N.prototype.setDefaultEncoding=function(b){if(typeof b=="string"&&(b=b.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((b+"").toLowerCase())>-1))throw new A(b);return this._writableState.defaultEncoding=b,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(v,b,P){return!v.objectMode&&v.decodeStrings!==!1&&typeof b=="string"&&(b=y.from(b,P)),b}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function J(v,b,P,q,j,o){if(!P){var u=Q(b,q,j);q!==u&&(P=!0,j="buffer",q=u)}var D=b.objectMode?1:q.length;b.length+=D;var O=b.length>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function h(p,x,A){var E=x.length-1;if(E=0?(m>0&&(p.lastNeed=m-1),m):--E=0?(m>0&&(p.lastNeed=m-2),m):--E=0?(m>0&&(m===2?m=0:p.lastNeed=m-3),m):0))}function i(p,x,A){if((x[0]&192)!==128)return p.lastNeed=0,"ļæ½";if(p.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return p.lastNeed=1,"ļæ½";if(p.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return p.lastNeed=2,"ļæ½"}}function d(p){var x=this.lastTotal-this.lastNeed,A=i(this,p);if(A!==void 0)return A;if(this.lastNeed<=p.length)return p.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,x,0,p.length),this.lastNeed-=p.length}function g(p,x){var A=h(this,p,x);if(!this.lastNeed)return p.toString("utf8",x);this.lastTotal=A;var E=p.length-(A-this.lastNeed);return p.copy(this.lastChar,0,E),p.toString("utf8",x,E)}function F(p){var x=p&&p.length?this.write(p):"";return this.lastNeed?x+"ļæ½":x}function R(p,x){if((p.length-x)%2===0){var A=p.toString("utf16le",x);if(A){var E=A.charCodeAt(A.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",x,p.length-1)}function B(p){var x=p&&p.length?this.write(p):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,A)}return x}function C(p,x){var A=(p.length-x)%3;return A===0?p.toString("base64",x):(this.lastNeed=3-A,this.lastTotal=3,A===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",x,p.length-A))}function _(p){var x=p&&p.length?this.write(p):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function L(p){return p.toString(this.encoding)}function T(p){return p&&p.length?this.write(p):""}return Xe}var Qe,Kt;function xt(){if(Kt)return Qe;Kt=1;var a=ve().codes.ERR_STREAM_PREMATURE_CLOSE;function n(c){var h=!1;return function(){if(!h){h=!0;for(var i=arguments.length,d=new Array(i),g=0;g0)if(typeof u!="string"&&!r.objectMode&&Object.getPrototypeOf(u)!==l.prototype&&(u=c(u)),O)r.endEmitted?m(o,new p):Q(o,r,u,!0);else if(r.ended)m(o,new L);else{if(r.destroyed)return!1;r.reading=!1,r.decoder&&!D?(u=r.decoder.write(u),r.objectMode||u.length!==0?Q(o,r,u,!1):se(o,r)):Q(o,r,u,!1)}else O||(r.reading=!1,se(o,r))}return!r.ended&&(r.length=ee?o=ee:(o--,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o++),o}function de(o,u){return o<=0||u.length===0&&u.ended?0:u.objectMode?1:o!==o?u.flowing&&u.length?u.buffer.head.data.length:u.length:(o>u.highWaterMark&&(u.highWaterMark=oe(o)),o<=u.length?o:u.ended?u.length:(u.needReadable=!0,0))}U.prototype.read=function(o){d("read",o),o=parseInt(o,10);var u=this._readableState,D=o;if(o!==0&&(u.emittedReadable=!1),o===0&&u.needReadable&&((u.highWaterMark!==0?u.length>=u.highWaterMark:u.length>0)||u.ended))return d("read: emitReadable",u.length,u.ended),u.length===0&&u.ended?P(this):ie(this),null;if(o=de(o,u),o===0&&u.ended)return u.length===0&&P(this),null;var O=u.needReadable;d("need readable",O),(u.length===0||u.length-o0?V=b(o,u):V=null,V===null?(u.needReadable=u.length<=u.highWaterMark,o=0):(u.length-=o,u.awaitDrain=0),u.length===0&&(u.ended||(u.needReadable=!0),D!==o&&u.ended&&P(this)),V!==null&&this.emit("data",V),V};function xe(o,u){if(d("onEofChunk"),!u.ended){if(u.decoder){var D=u.decoder.end();D&&D.length&&(u.buffer.push(D),u.length+=u.objectMode?1:D.length)}u.ended=!0,u.sync?ie(o):(u.needReadable=!1,u.emittedReadable||(u.emittedReadable=!0,pe(o)))}}function ie(o){var u=o._readableState;d("emitReadable",u.needReadable,u.emittedReadable),u.needReadable=!1,u.emittedReadable||(d("emitReadable",u.flowing),u.emittedReadable=!0,process.nextTick(pe,o))}function pe(o){var u=o._readableState;d("emitReadable_",u.destroyed,u.length,u.ended),!u.destroyed&&(u.length||u.ended)&&(o.emit("readable"),u.emittedReadable=!1),u.needReadable=!u.flowing&&!u.ended&&u.length<=u.highWaterMark,v(o)}function se(o,u){u.readingMore||(u.readingMore=!0,process.nextTick(ye,o,u))}function ye(o,u){for(;!u.reading&&!u.ended&&(u.length1&&j(O.pipes,o)!==-1)&&!w&&(d("false write response, pause",O.awaitDrain),O.awaitDrain++),D.pause())}function W($){d("onerror",$),X(),o.removeListener("error",W),n(o,"error")===0&&m(o,$)}I(o,"error",W);function K(){o.removeListener("finish",z),X()}o.once("close",K);function z(){d("onfinish"),o.removeListener("close",K),X()}o.once("finish",z);function X(){d("unpipe"),D.unpipe(o)}return o.emit("pipe",D),O.flowing||(d("pipe resume"),D.resume()),o};function Y(o){return function(){var D=o._readableState;d("pipeOnDrain",D.awaitDrain),D.awaitDrain&&D.awaitDrain--,D.awaitDrain===0&&n(o,"data")&&(D.flowing=!0,v(o))}}U.prototype.unpipe=function(o){var u=this._readableState,D={hasUnpiped:!1};if(u.pipesCount===0)return this;if(u.pipesCount===1)return o&&o!==u.pipes?this:(o||(o=u.pipes),u.pipes=null,u.pipesCount=0,u.flowing=!1,o&&o.emit("unpipe",this,D),this);if(!o){var O=u.pipes,V=u.pipesCount;u.pipes=null,u.pipesCount=0,u.flowing=!1;for(var r=0;r0,O.flowing!==!1&&this.resume()):o==="readable"&&!O.endEmitted&&!O.readableListening&&(O.readableListening=O.needReadable=!0,O.flowing=!1,O.emittedReadable=!1,d("on readable",O.length,O.reading),O.length?ie(this):O.reading||process.nextTick(re,this)),D},U.prototype.addListener=U.prototype.on,U.prototype.removeListener=function(o,u){var D=f.prototype.removeListener.call(this,o,u);return o==="readable"&&process.nextTick(Z,this),D},U.prototype.removeAllListeners=function(o){var u=f.prototype.removeAllListeners.apply(this,arguments);return(o==="readable"||o===void 0)&&process.nextTick(Z,this),u};function Z(o){var u=o._readableState;u.readableListening=o.listenerCount("readable")>0,u.resumeScheduled&&!u.paused?u.flowing=!0:o.listenerCount("data")>0&&o.resume()}function re(o){d("readable nexttick read 0"),o.read(0)}U.prototype.resume=function(){var o=this._readableState;return o.flowing||(d("resume"),o.flowing=!o.readableListening,me(this,o)),o.paused=!1,this};function me(o,u){u.resumeScheduled||(u.resumeScheduled=!0,process.nextTick(Ee,o,u))}function Ee(o,u){d("resume",u.reading),u.reading||o.read(0),u.resumeScheduled=!1,o.emit("resume"),v(o),u.flowing&&!u.reading&&o.read(0)}U.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function v(o){var u=o._readableState;for(d("flow",u.flowing);u.flowing&&o.read()!==null;);}U.prototype.wrap=function(o){var u=this,D=this._readableState,O=!1;o.on("end",function(){if(d("wrapped end"),D.decoder&&!D.ended){var e=D.decoder.end();e&&e.length&&u.push(e)}u.push(null)}),o.on("data",function(e){if(d("wrapped data"),D.decoder&&(e=D.decoder.write(e)),!(D.objectMode&&e==null)&&!(!D.objectMode&&(!e||!e.length))){var t=u.push(e);t||(O=!0,o.pause())}});for(var V in o)this[V]===void 0&&typeof o[V]=="function"&&(this[V]=(function(t){return function(){return o[t].apply(o,arguments)}})(V));for(var r=0;r=u.length?(u.decoder?D=u.buffer.join(""):u.buffer.length===1?D=u.buffer.first():D=u.buffer.concat(u.length),u.buffer.clear()):D=u.buffer.consume(o,u.decoder),D}function P(o){var u=o._readableState;d("endReadable",u.endEmitted),u.endEmitted||(u.ended=!0,process.nextTick(q,u,o))}function q(o,u){if(d("endReadableNT",o.endEmitted,o.length),!o.endEmitted&&o.length===0&&(o.endEmitted=!0,u.readable=!1,u.emit("end"),o.autoDestroy)){var D=u._writableState;(!D||D.autoDestroy&&D.finished)&&u.destroy()}}typeof Symbol=="function"&&(U.from=function(o,u){return E===void 0&&(E=Hn()),E(U,o,u)});function j(o,u){for(var D=0,O=o.length;D0;return i(x,E,m,function(S){T||(T=S),S&&p.forEach(d),!E&&(p.forEach(d),L(T))})});return C.reduce(g)}return nt=R,nt}var it,Qt;function Kn(){if(Qt)return it;Qt=1,it=f;var a=Ne().EventEmitter,n=be();n(f,a),f.Readable=fr(),f.Writable=ur(),f.Duplex=ge(),f.Transform=lr(),f.PassThrough=jn(),f.finished=xt(),f.pipeline=Wn(),f.Stream=f;function f(){a.call(this)}return f.prototype.pipe=function(l,y){var c=this;function h(C){l.writable&&l.write(C)===!1&&c.pause&&c.pause()}c.on("data",h);function i(){c.readable&&c.resume&&c.resume()}l.on("drain",i),!l._isStdio&&(!y||y.end!==!1)&&(c.on("end",g),c.on("close",F));var d=!1;function g(){d||(d=!0,l.end())}function F(){d||(d=!0,typeof l.destroy=="function"&&l.destroy())}function R(C){if(B(),a.listenerCount(this,"error")===0)throw C}c.on("error",R),l.on("error",R);function B(){c.removeListener("data",h),l.removeListener("drain",i),c.removeListener("end",g),c.removeListener("close",F),c.removeListener("error",R),l.removeListener("error",R),c.removeListener("end",B),c.removeListener("close",B),l.removeListener("close",B)}return c.on("end",B),c.on("close",B),l.on("close",B),l.emit("pipe",c),l},it}var $n=Kn();async function*at(a,n,f){let l=1;const y={chunks:[],length:0};for await(const c of f(a))for(y.chunks.push(c),y.length+=c.byteLength;y.length>n;){const h=y.chunks.length>1?ue.Buffer.concat(y.chunks):y.chunks[0];yield{partNumber:l,data:h.subarray(0,n)},y.chunks=[h.subarray(n)],y.length=y.chunks[0].byteLength,l+=1}yield{partNumber:l,data:y.chunks.length!==1?ue.Buffer.concat(y.chunks):y.chunks[0],lastPart:!0}}async function*Zt(a,n){let f=1,l=0,y=n;for(;y{if(a instanceof Uint8Array)return Zt(a,n);if(a instanceof $n.Readable)return at(a,n,zn);if(a instanceof String||typeof a=="string")return Zt(ue.Buffer.from(a),n);if(typeof a.stream=="function")return at(a.stream(),n,Jt);if(a instanceof ReadableStream)return at(a,n,Jt);throw new Error("Body Data is unsupported format, expected data to be one of: string | Uint8Array | Buffer | Readable | ReadableStream | Blob;.")};class Ae extends qe.EventEmitter{static MIN_PART_SIZE=1024*1024*5;MAX_PARTS=1e4;queueSize=4;partSize;leavePartsOnError=!1;tags=[];client;params;totalBytes;totalBytesSource;bytesUploadedSoFar;abortController;concurrentUploaders=[];createMultiPartPromise;abortMultipartUploadCommand=null;uploadedParts=[];uploadEnqueuedPartsCount=0;expectedPartsCount;uploadId;uploadEvent;isMultiPart=!0;singleUploadResult;sent=!1;constructor(n){if(super(),this.queueSize=n.queueSize||this.queueSize,this.leavePartsOnError=n.leavePartsOnError||this.leavePartsOnError,this.tags=n.tags||this.tags,this.client=n.client,this.params=n.params,!this.params)throw new Error("InputError: Upload requires params to be passed to upload.");this.totalBytes=this.params.ContentLength??Te(this.params.Body),this.totalBytesSource=kn(this.params.Body,this.params.ContentLength),this.bytesUploadedSoFar=0,this.abortController=n.abortController??new Tn,this.partSize=n.partSize||Math.max(Ae.MIN_PART_SIZE,Math.floor((this.totalBytes||0)/this.MAX_PARTS)),this.totalBytes!==void 0&&(this.expectedPartsCount=Math.ceil(this.totalBytes/this.partSize)),this.__validateInput()}async abort(){this.abortController.abort()}async done(){if(this.sent)throw new Error("@aws-sdk/lib-storage: this instance of Upload has already executed .done(). Create a new instance.");return this.sent=!0,await Promise.race([this.__doMultipartUpload(),this.__abortTimeout(this.abortController.signal)])}on(n,f){return this.uploadEvent=n,super.on(n,f)}async __uploadUsingPut(n){this.isMultiPart=!1;const f={...this.params,Body:n.data},l=this.client.config,y=l.requestHandler,c=y instanceof qe.EventEmitter?y:null,h=_=>{this.bytesUploadedSoFar=_.loaded,this.totalBytes=_.total,this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:n.partNumber,Key:this.params.Key,Bucket:this.params.Bucket})};c!==null&&c.on("xhr.upload.progress",h);const i=await Promise.all([this.client.send(new Rt(f)),l?.endpoint?.()]),d=i[0];let g=i[1];if(g||(g=Mr(await kr(f,Rt,{...l}))),!g)throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()" nor EndpointsV2.');c!==null&&c.off("xhr.upload.progress",h);const F=this.params.Key.split("/").map(_=>St(_)).join("/"),R=St(this.params.Bucket),B=(()=>{const _=g.hostname.startsWith(`${R}.`),L=this.client.config.forcePathStyle,T=g.port?`:${g.port}`:"";return L?`${g.protocol}//${g.hostname}${T}/${R}/${F}`:_?`${g.protocol}//${g.hostname}${T}/${F}`:`${g.protocol}//${R}.${g.hostname}${T}/${F}`})();this.singleUploadResult={...d,Bucket:this.params.Bucket,Key:this.params.Key,Location:B};const C=Te(n.data);this.__notifyProgress({loaded:C,total:C,part:1,Key:this.params.Key,Bucket:this.params.Bucket})}async __createMultipartUpload(){const n=await this.client.config.requestChecksumCalculation();if(!this.createMultiPartPromise){const f={...this.params,Body:void 0};n==="WHEN_SUPPORTED"&&(f.ChecksumAlgorithm=this.params.ChecksumAlgorithm||Bn.CRC32),this.createMultiPartPromise=this.client.send(new Cn(f)).then(l=>(this.abortMultipartUploadCommand=new yn({Bucket:this.params.Bucket,Key:this.params.Key,UploadId:l.UploadId}),l))}return this.createMultiPartPromise}async __doConcurrentUpload(n){for await(const f of n){if(this.uploadEnqueuedPartsCount>this.MAX_PARTS)throw new Error(`Exceeded ${this.MAX_PARTS} parts in multipart upload to Bucket: ${this.params.Bucket} Key: ${this.params.Key}.`);if(this.abortController.signal.aborted)return;if(f.partNumber===1&&f.lastPart)return await this.__uploadUsingPut(f);if(!this.uploadId){const{UploadId:g}=await this.__createMultipartUpload();if(this.uploadId=g,this.abortController.signal.aborted)return}const l=Te(f.data)||0,y=this.client.config.requestHandler,c=y instanceof qe.EventEmitter?y:null;let h=0;const i=(g,F)=>{(Number(F.query.partNumber)||-1)===f.partNumber&&(g.total&&l&&(this.bytesUploadedSoFar+=g.loaded-h,h=g.loaded),this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:f.partNumber,Key:this.params.Key,Bucket:this.params.Bucket}))};c!==null&&c.on("xhr.upload.progress",i),this.uploadEnqueuedPartsCount+=1,this.__validateUploadPart(f);const d=await this.client.send(new Rn({...this.params,ContentLength:void 0,UploadId:this.uploadId,Body:f.data,PartNumber:f.partNumber}));if(c!==null&&c.off("xhr.upload.progress",i),this.abortController.signal.aborted)return;if(!d.ETag)throw new Error(`Part ${f.partNumber} is missing ETag in UploadPart response. Missing Bucket CORS configuration for ETag header?`);this.uploadedParts.push({PartNumber:f.partNumber,ETag:d.ETag,...d.ChecksumCRC32&&{ChecksumCRC32:d.ChecksumCRC32},...d.ChecksumCRC32C&&{ChecksumCRC32C:d.ChecksumCRC32C},...d.ChecksumSHA1&&{ChecksumSHA1:d.ChecksumSHA1},...d.ChecksumSHA256&&{ChecksumSHA256:d.ChecksumSHA256}}),c===null&&(this.bytesUploadedSoFar+=l),this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:f.partNumber,Key:this.params.Key,Bucket:this.params.Bucket})}}async __doMultipartUpload(){const n=Vn(this.params.Body,this.partSize),f=[];for(let y=0;y{f.push(h)});this.concurrentUploaders.push(c)}if(await Promise.all(this.concurrentUploaders),f.length>=1)throw await this.markUploadAsAborted(),f[0];if(this.abortController.signal.aborted)throw await this.markUploadAsAborted(),Object.assign(new Error("Upload aborted."),{name:"AbortError"});let l;if(this.isMultiPart){const{expectedPartsCount:y,uploadedParts:c,totalBytes:h,totalBytesSource:i}=this;if(h!==void 0&&y!==void 0&&c.length!==y)throw new Error(`Expected ${y} part(s) but uploaded ${c.length} part(s). +import{M as cr,N as hr,P as ot,Q as Le,S as G,T as dr,U as pr,V as yr,_ as mr,W as Er,X as wr,Y as gr,Z as br,$ as vr,a0 as xr,a1 as pt,a2 as ae,a3 as Ie,a4 as _r,E as fe,F as le,G as ce,a5 as he,a6 as Cr,a7 as Sr,a8 as Ar,a9 as Rr,aa as Br,ab as Fr,ac as Tr,ad as Dr,ae as Mr,af as we,ag as Lr,ah as kr,ai as Ct,c as yt,aj as mt,K as Et}from"./index.js";import{u as wt}from"./error-banner.js";const Pr=typeof ReadableStream=="function"?ReadableStream:function(){};class Nr extends Pr{}const Ir=({expectedChecksum:a,checksum:n,source:o,checksumSourceLocation:l,base64Encoder:y})=>{if(!cr(o))throw new Error(`@smithy/util-stream: unsupported source type ${o?.constructor?.name??o} in ChecksumStream.`);const c=y??hr;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const h=new TransformStream({start(){},async transform(d,g){n.update(d),g.enqueue(d)},async flush(d){const g=await n.digest(),F=c(g);if(a!==F){const R=new Error(`Checksum mismatch: expected "${a}" but received "${F}" in response header "${l}".`);d.error(R)}else d.terminate()}});o.pipeThrough(h);const i=h.readable;return Object.setPrototypeOf(i,Nr.prototype),i};class Ur{allocByteArray;byteLength=0;byteArrays=[];constructor(n){this.allocByteArray=n}push(n){this.byteArrays.push(n),this.byteLength+=n.byteLength}flush(){if(this.byteArrays.length===1){const l=this.byteArrays[0];return this.reset(),l}const n=this.allocByteArray(this.byteLength);let o=0;for(let l=0;lnew Uint8Array(g))];let i=-1;const d=async g=>{const{value:F,done:R}=await l.read(),B=F;if(R){if(i!==-1){const C=Ue(h,i);Se(C)>0&&g.enqueue(C)}g.close()}else{const C=jr(B,!1);if(i!==C&&(i>=0&&g.enqueue(Ue(h,i)),i=C),i===-1){g.enqueue(B);return}const _=Se(B);c+=_;const M=Se(h[i]);if(_>=n&&M===0)g.enqueue(B);else{const T=Hr(h,i,B);!y&&c>n*2&&(y=!0,o?.warn(`@smithy/util-stream - stream chunk size ${_} is below threshold of ${n}, automatically buffering.`)),T>=n?g.enqueue(Ue(h,i)):await d(g)}}};return new ReadableStream({pull:d})}const qr=Or;function Hr(a,n,o){switch(n){case 0:return a[0]+=o,Se(a[0]);case 1:case 2:return a[n].push(o),Se(a[n])}}function Ue(a,n){switch(n){case 0:const o=a[0];return a[0]="",o;case 1:case 2:return a[n].flush()}throw new Error(`@smithy/util-stream - invalid index ${n} given to flush()`)}function Se(a){return a?.byteLength??a?.length??0}function jr(a,n=!0){return n&&typeof Buffer<"u"&&a instanceof Buffer?2:a instanceof Uint8Array?1:typeof a=="string"?0:-1}const Wr=(a,{requestChecksumRequired:n,requestAlgorithmMember:o,requestChecksumCalculation:l})=>o?a[o]?a[o]:void 0:l===Le.WHEN_SUPPORTED||n?ot:void 0,gt=a=>a===G.MD5?"content-md5":`x-amz-checksum-${a.toLowerCase()}`,Kr=(a,n)=>{const o=a.toLowerCase();for(const l of Object.keys(n))if(o===l.toLowerCase())return!0;return!1},$r=(a,n)=>{const o=a.toLowerCase();for(const l of Object.keys(n))if(l.toLowerCase().startsWith(o))return!0;return!1},Jt=a=>a!==void 0&&typeof a!="string"&&!ArrayBuffer.isView(a)&&!dr(a);var zr=(function(){function a(){this.crc32c=new St}return a.prototype.update=function(n){pr(n)||this.crc32c.update(yr(n))},a.prototype.digest=function(){return mr(this,void 0,void 0,function(){return Er(this,function(n){return[2,wr(this.crc32c.digest())]})})},a.prototype.reset=function(){this.crc32c=new St},a})(),St=(function(){function a(){this.checksum=4294967295}return a.prototype.update=function(n){var o,l;try{for(var y=gr(n),c=y.next();!c.done;c=y.next()){var h=c.value;this.checksum=this.checksum>>>8^Gr[(this.checksum^h)&255]}}catch(i){o={error:i}}finally{try{c&&!c.done&&(l=y.return)&&l.call(y)}finally{if(o)throw o.error}}return this},a.prototype.digest=function(){return(this.checksum^4294967295)>>>0},a})(),Vr=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],Gr=br(Vr);const Yr=()=>{const n=new Array(8);for(let o=0;o<8;o++){const l=new Array(512);for(let y=0;y<256;y++){let c=BigInt(y);for(let h=0;h<8*(o+1);h++)c&1n?c=c>>1n^0x9a6c9329ac4bc9b5n:c=c>>1n;l[y*2]=Number(c>>32n&0xffffffffn),l[y*2+1]=Number(c&0xffffffffn)}n[o]=new Uint32Array(l)}return n};let Oe,Ce,st,ut,ft,lt,ct,ht,dt;const Xr=()=>{Oe||(Oe=Yr(),[Ce,st,ut,ft,lt,ct,ht,dt]=Oe)};class Qr{c1=0;c2=0;constructor(){Xr(),this.reset()}update(n){const o=n.length;let l=0,y=this.c1,c=this.c2;for(;l+8<=o;){const h=((c^n[l++])&255)<<1,i=((c>>>8^n[l++])&255)<<1,d=((c>>>16^n[l++])&255)<<1,g=((c>>>24^n[l++])&255)<<1,F=((y^n[l++])&255)<<1,R=((y>>>8^n[l++])&255)<<1,B=((y>>>16^n[l++])&255)<<1,C=((y>>>24^n[l++])&255)<<1;y=dt[h]^ht[i]^ct[d]^lt[g]^ft[F]^ut[R]^st[B]^Ce[C],c=dt[h+1]^ht[i+1]^ct[d+1]^lt[g+1]^ft[F+1]^ut[R+1]^st[B+1]^Ce[C+1]}for(;l>>8|(y&255)<<24)>>>0,y=y>>>8^Ce[h],c^=Ce[h+1],l++}this.c1=y,this.c2=c}async digest(){const n=this.c1^4294967295,o=this.c2^4294967295;return new Uint8Array([n>>>24,n>>>16&255,n>>>8&255,n&255,o>>>24,o>>>16&255,o>>>8&255,o&255])}reset(){this.c1=4294967295,this.c2=4294967295}}const Zr=()=>vr,er=[G.CRC32,G.CRC32C,G.CRC64NVME,G.SHA1,G.SHA256],Jr=[G.SHA256,G.SHA1,G.CRC32,G.CRC32C,G.CRC64NVME],tr=(a,n)=>{const{checksumAlgorithms:o={}}=n;switch(a){case G.MD5:return o?.MD5??n.md5;case G.CRC32:return o?.CRC32??Zr();case G.CRC32C:return o?.CRC32C??zr;case G.CRC64NVME:return o?.CRC64NVME??Qr;case G.SHA1:return o?.SHA1??n.sha1;case G.SHA256:return o?.SHA256??n.sha256;default:if(o?.[a])return o[a];throw new Error(`The checksum algorithm "${a}" is not supported by the client. Select one of ${er}, or provide an implementation to the client constructor checksums field.`)}},rr=(a,n)=>{const o=new a;return o.update(xr(n||"")),o.digest()},en={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},tn=(a,n)=>(o,l)=>async y=>{if(!pt.isInstance(y.request)||$r("x-amz-checksum-",y.request.headers))return o(y);const{request:c,input:h}=y,{body:i,headers:d}=c,{base64Encoder:g,streamHasher:F}=a,{requestChecksumRequired:R,requestAlgorithmMember:B}=n,C=await a.requestChecksumCalculation(),_=B?.name,M=B?.httpHeader;_&&!h[_]&&(C===Le.WHEN_SUPPORTED||R)&&(h[_]=ot,M&&(d[M]=ot));const T=Wr(h,{requestChecksumRequired:R,requestAlgorithmMember:B?.name,requestChecksumCalculation:C});let p=i,x=d;if(T){switch(T){case G.CRC32:ae(l,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case G.CRC32C:ae(l,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case G.CRC64NVME:ae(l,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case G.SHA1:ae(l,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case G.SHA256:ae(l,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const A=gt(T),E=tr(T,a);if(Jt(i)){const{getAwsChunkedEncodingStream:m,bodyLengthChecker:S}=a;p=m(typeof a.requestStreamBufferSize=="number"&&a.requestStreamBufferSize>=8*1024?qr(i,a.requestStreamBufferSize,l.logger):i,{base64Encoder:g,bodyLengthChecker:S,checksumLocationName:A,checksumAlgorithmFn:E,streamHasher:F}),x={...d,"content-encoding":d["content-encoding"]?`${d["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":d["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":A},delete x["content-length"]}else if(!Kr(A,d)){const m=await rr(E,i);x={...d,[A]:g(m)}}}try{return await o({...y,request:{...c,headers:x,body:p}})}catch(A){if(A instanceof Error&&A.name==="InvalidChunkSizeError")try{A.message.endsWith(".")||(A.message+="."),A.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch{}throw A}},rn={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},nn=(a,n)=>(o,l)=>async y=>{const c=y.input,{requestValidationModeMember:h}=n,i=await a.requestChecksumCalculation(),d=await a.responseChecksumValidation();switch(i){case Le.WHEN_REQUIRED:ae(l,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case Le.WHEN_SUPPORTED:ae(l,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(d){case Ie.WHEN_REQUIRED:ae(l,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case Ie.WHEN_SUPPORTED:ae(l,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}return h&&!c[h]&&d===Ie.WHEN_SUPPORTED&&(c[h]="ENABLED"),o(y)},nr=(a=[])=>{const n=[];for(const o of Jr)!a.includes(o)||!er.includes(o)||n.push(o);return n},an=a=>{const n=a.lastIndexOf("-");if(n!==-1){const o=a.slice(n+1);if(!o.startsWith("0")){const l=parseInt(o,10);if(!isNaN(l)&&l>=1&&l<=1e4)return!0}}return!1},on=async(a,{checksumAlgorithmFn:n,base64Encoder:o})=>o(await rr(n,a)),sn=async(a,{config:n,responseAlgorithms:o,logger:l})=>{const y=nr(o),{body:c,headers:h}=a;for(const i of y){const d=gt(i),g=h[d];if(g){let F;try{F=tr(i,n)}catch(C){if(i===G.CRC64NVME){l?.warn(`Skipping ${G.CRC64NVME} checksum validation: ${C.message}`);continue}throw C}const{base64Encoder:R}=n;if(Jt(c)){a.body=Ir({expectedChecksum:g,checksumSourceLocation:d,checksum:new F,source:c,base64Encoder:R});return}const B=await on(c,{checksumAlgorithmFn:F,base64Encoder:R});if(B===g)break;throw new Error(`Checksum mismatch: expected "${B}" but received "${g}" in response header "${d}".`)}}},un={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},fn=(a,n)=>(o,l)=>async y=>{if(!pt.isInstance(y.request))return o(y);const c=y.input,h=await o(y),i=h.response,{requestValidationModeMember:d,responseAlgorithms:g}=n;if(d&&c[d]==="ENABLED"){const{clientName:F,commandName:R}=l;if(F==="S3Client"&&R==="GetObjectCommand"&&nr(g).every(C=>{const _=gt(C),M=i.headers[_];return!M||an(M)}))return h;await sn(i,{config:a,responseAlgorithms:g,logger:l.logger})}return h},bt=(a,n)=>({applyToStack:o=>{o.add(tn(a,n),en),o.addRelativeTo(nn(a,n),rn),o.addRelativeTo(fn(a,n),un)}}),ln="content-length",cn="x-amz-decoded-content-length";function hn(){return(a,n)=>async o=>{const{request:l}=o;if(pt.isInstance(l)&&!(ln in l.headers)&&!(cn in l.headers)){const y="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof n?.logger?.warn=="function"&&!(n.logger instanceof _r)?n.logger.warn(y):console.warn(y)}return a({...o})}}const dn={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},pn=a=>({applyToStack:n=>{n.add(hn(),dn)}});class yn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l)]}).s("AmazonS3","AbortMultipartUpload",{}).n("S3Client","AbortMultipartUploadCommand").sc(Cr).build(){}function mn(a){return n=>async o=>{const l={...o.input},y=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const c of y){const h=l[c.target];if(h){let i;typeof h=="string"?wn(h,a)?i=a.base64Decoder(h):(i=a.utf8Decoder(h),l[c.target]=a.base64Encoder(i)):(i=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),l[c.target]=a.base64Encoder(i));const d=new a.md5;d.update(i),l[c.hash]=a.base64Encoder(await d.digest())}}return n({...o,input:l})}}const En={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Pe=a=>({applyToStack:n=>{n.add(mn(a),En)}});function wn(a,n){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a))return!1;try{return n.base64Decoder(a).length===32}catch{return!1}}class gn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l),Pe(l)]}).s("AmazonS3","CompleteMultipartUpload",{}).n("S3Client","CompleteMultipartUploadCommand").sc(Sr).build(){}function bn(a){return n=>async o=>{const{CreateBucketConfiguration:l}=o.input,y=await a.region();return!l?.LocationConstraint&&!l?.Location&&y!=="us-east-1"&&(o.input.CreateBucketConfiguration=o.input.CreateBucketConfiguration??{},o.input.CreateBucketConfiguration.LocationConstraint=y),n(o)}}const vn={step:"initialize",tags:["LOCATION_CONSTRAINT","CREATE_BUCKET_CONFIGURATION"],name:"locationConstraintMiddleware",override:!0},xn=a=>({applyToStack:n=>{n.add(bn(a),vn)}});class _n extends fe.classBuilder().ep({...le,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},DisableAccessPoints:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l),xn(l)]}).s("AmazonS3","CreateBucket",{}).n("S3Client","CreateBucketCommand").sc(Ar).build(){}class Cn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l),Pe(l)]}).s("AmazonS3","CreateMultipartUpload",{}).n("S3Client","CreateMultipartUploadCommand").sc(Rr).build(){}class Sn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),he(l)]}).s("AmazonS3","DeleteObject",{}).n("S3Client","DeleteObjectCommand").sc(Br).build(){}class At extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),bt(l,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),pn(),he(l),Pe(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(Fr).build(){}class An extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),bt(l,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),he(l)]}).s("AmazonS3","PutObjectTagging",{}).n("S3Client","PutObjectTaggingCommand").sc(Tr).build(){}class Rn extends fe.classBuilder().ep({...le,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(n,o,l,y){return[ce(l,n.getEndpointParameterInstructions()),bt(l,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),he(l),Pe(l)]}).s("AmazonS3","UploadPart",{}).n("S3Client","UploadPartCommand").sc(Dr).build(){}const Bn={CRC32:"CRC32"};class Fn{onabort=null;_aborted=!1;constructor(){Object.defineProperty(this,"_aborted",{value:!1,writable:!0})}get aborted(){return this._aborted}abort(){this._aborted=!0,this.onabort&&(this.onabort(this),this.onabort=null)}}class Tn{signal=new Fn;abort(){this.signal.abort()}}var Be={exports:{}},Rt;function Ne(){if(Rt)return Be.exports;Rt=1;var a=typeof Reflect=="object"?Reflect:null,n=a&&typeof a.apply=="function"?a.apply:function(m,S,I){return Function.prototype.apply.call(m,S,I)},o;a&&typeof a.ownKeys=="function"?o=a.ownKeys:Object.getOwnPropertySymbols?o=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:o=function(m){return Object.getOwnPropertyNames(m)};function l(E){console&&console.warn&&console.warn(E)}var y=Number.isNaN||function(m){return m!==m};function c(){c.init.call(this)}Be.exports=c,Be.exports.once=p,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var h=10;function i(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(E){if(typeof E!="number"||E<0||y(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");h=E}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||y(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function d(E){return E._maxListeners===void 0?c.defaultMaxListeners:E._maxListeners}c.prototype.getMaxListeners=function(){return d(this)},c.prototype.emit=function(m){for(var S=[],I=1;I0&&(H=S[0]),H instanceof Error)throw H;var Q=new Error("Unhandled error."+(H?" ("+H.message+")":""));throw Q.context=H,Q}var J=U[m];if(J===void 0)return!1;if(typeof J=="function")n(J,this,S);else for(var ee=J.length,oe=_(J,ee),I=0;I0&&H.length>N&&!H.warned){H.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=E,Q.type=m,Q.count=H.length,l(Q)}return E}c.prototype.addListener=function(m,S){return g(this,m,S,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(m,S){return g(this,m,S,!0)};function F(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(E,m,S){var I={fired:!1,wrapFn:void 0,target:E,type:m,listener:S},N=F.bind(I);return N.listener=S,I.wrapFn=N,N}c.prototype.once=function(m,S){return i(S),this.on(m,R(this,m,S)),this},c.prototype.prependOnceListener=function(m,S){return i(S),this.prependListener(m,R(this,m,S)),this},c.prototype.removeListener=function(m,S){var I,N,U,H,Q;if(i(S),N=this._events,N===void 0)return this;if(I=N[m],I===void 0)return this;if(I===S||I.listener===S)--this._eventsCount===0?this._events=Object.create(null):(delete N[m],N.removeListener&&this.emit("removeListener",m,I.listener||S));else if(typeof I!="function"){for(U=-1,H=I.length-1;H>=0;H--)if(I[H]===S||I[H].listener===S){Q=I[H].listener,U=H;break}if(U<0)return this;U===0?I.shift():M(I,U),I.length===1&&(N[m]=I[0]),N.removeListener!==void 0&&this.emit("removeListener",m,Q||S)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(m){var S,I,N;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[m]),this;if(arguments.length===0){var U=Object.keys(I),H;for(N=0;N=0;N--)this.removeListener(m,S[N]);return this};function B(E,m,S){var I=E._events;if(I===void 0)return[];var N=I[m];return N===void 0?[]:typeof N=="function"?S?[N.listener||N]:[N]:S?T(N):_(N,N.length)}c.prototype.listeners=function(m){return B(this,m,!0)},c.prototype.rawListeners=function(m){return B(this,m,!1)},c.listenerCount=function(E,m){return typeof E.listenerCount=="function"?E.listenerCount(m):C.call(E,m)},c.prototype.listenerCount=C;function C(E){var m=this._events;if(m!==void 0){var S=m[E];if(typeof S=="function")return 1;if(S!==void 0)return S.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]};function _(E,m){for(var S=new Array(m),I=0;I0)throw new Error("Invalid string. Length must be a multiple of 4");var M=C.indexOf("=");M===-1&&(M=_);var T=M===_?0:4-M%4;return[M,T]}function i(C){var _=h(C),M=_[0],T=_[1];return(M+T)*3/4-T}function d(C,_,M){return(_+M)*3/4-M}function g(C){var _,M=h(C),T=M[0],p=M[1],x=new o(d(C,T,p)),A=0,E=p>0?T-4:T,m;for(m=0;m>16&255,x[A++]=_>>8&255,x[A++]=_&255;return p===2&&(_=n[C.charCodeAt(m)]<<2|n[C.charCodeAt(m+1)]>>4,x[A++]=_&255),p===1&&(_=n[C.charCodeAt(m)]<<10|n[C.charCodeAt(m+1)]<<4|n[C.charCodeAt(m+2)]>>2,x[A++]=_>>8&255,x[A++]=_&255),x}function F(C){return a[C>>18&63]+a[C>>12&63]+a[C>>6&63]+a[C&63]}function R(C,_,M){for(var T,p=[],x=_;xE?E:A+x));return T===1?(_=C[M-1],p.push(a[_>>2]+a[_<<4&63]+"==")):T===2&&(_=(C[M-2]<<8)+C[M-1],p.push(a[_>>10]+a[_>>4&63]+a[_<<2&63]+"=")),p.join("")}return _e}var Fe={};var Ft;function Mn(){return Ft||(Ft=1,Fe.read=function(a,n,o,l,y){var c,h,i=y*8-l-1,d=(1<>1,F=-7,R=o?y-1:0,B=o?-1:1,C=a[n+R];for(R+=B,c=C&(1<<-F)-1,C>>=-F,F+=i;F>0;c=c*256+a[n+R],R+=B,F-=8);for(h=c&(1<<-F)-1,c>>=-F,F+=l;F>0;h=h*256+a[n+R],R+=B,F-=8);if(c===0)c=1-g;else{if(c===d)return h?NaN:(C?-1:1)*(1/0);h=h+Math.pow(2,l),c=c-g}return(C?-1:1)*h*Math.pow(2,c-l)},Fe.write=function(a,n,o,l,y,c){var h,i,d,g=c*8-y-1,F=(1<>1,B=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=l?0:c-1,_=l?1:-1,M=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(i=isNaN(n)?1:0,h=F):(h=Math.floor(Math.log(n)/Math.LN2),n*(d=Math.pow(2,-h))<1&&(h--,d*=2),h+R>=1?n+=B/d:n+=B*Math.pow(2,1-R),n*d>=2&&(h++,d/=2),h+R>=F?(i=0,h=F):h+R>=1?(i=(n*d-1)*Math.pow(2,y),h=h+R):(i=n*Math.pow(2,R-1)*Math.pow(2,y),h=0));y>=8;a[o+C]=i&255,C+=_,i/=256,y-=8);for(h=h<0;a[o+C]=h&255,C+=_,h/=256,g-=8);a[o+C-_]|=M*128}),Fe}var Tt;function Re(){return Tt||(Tt=1,(function(a){var n=Dn(),o=Mn(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=i,a.SlowBuffer=p,a.INSPECT_MAX_BYTES=50;var y=2147483647;a.kMaxLength=y,i.TYPED_ARRAY_SUPPORT=c(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function h(r){if(r>y)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,i.prototype),e}function i(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(r)}return d(r,e,t)}i.poolSize=8192;function d(r,e,t){if(typeof r=="string")return B(r,e);if(ArrayBuffer.isView(r))return C(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(D(r,ArrayBuffer)||r&&D(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(D(r,SharedArrayBuffer)||r&&D(r.buffer,SharedArrayBuffer)))return _(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var u=r.valueOf&&r.valueOf();if(u!=null&&u!==r)return i.from(u,e,t);var w=M(r);if(w)return w;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return i.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}i.from=function(r,e,t){return d(r,e,t)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function g(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function F(r,e,t){return g(r),r<=0?h(r):e!==void 0?typeof t=="string"?h(r).fill(e,t):h(r).fill(e):h(r)}i.alloc=function(r,e,t){return F(r,e,t)};function R(r){return g(r),h(r<0?0:T(r)|0)}i.allocUnsafe=function(r){return R(r)},i.allocUnsafeSlow=function(r){return R(r)};function B(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=x(r,e)|0,u=h(t),w=u.write(r,e);return w!==t&&(u=u.slice(0,w)),u}function C(r){for(var e=r.length<0?0:T(r.length)|0,t=h(e),u=0;u=y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y.toString(16)+" bytes");return r|0}function p(r){return+r!=r&&(r=0),i.alloc(+r)}i.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==i.prototype},i.compare=function(e,t){if(D(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var u=e.length,w=t.length,L=0,k=Math.min(u,w);L2&&arguments[2]===!0;if(!u&&t===0)return 0;for(var w=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return P(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return s(r).length;default:if(w)return u?-1:P(r).length;e=(""+e).toLowerCase(),w=!0}}i.byteLength=x;function A(r,e,t){var u=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return se(this,e,t);case"utf8":case"utf-8":return oe(this,e,t);case"ascii":return ie(this,e,t);case"latin1":case"binary":return pe(this,e,t);case"base64":return ee(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,e,t);default:if(u)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),u=!0}}i.prototype._isBuffer=!0;function E(r,e,t){var u=r[e];r[e]=r[t],r[t]=u}i.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tt&&(e+=" ... "),""},l&&(i.prototype[l]=i.prototype.inspect),i.prototype.compare=function(e,t,u,w,L){if(D(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),u===void 0&&(u=e?e.length:0),w===void 0&&(w=0),L===void 0&&(L=this.length),t<0||u>e.length||w<0||L>this.length)throw new RangeError("out of range index");if(w>=L&&t>=u)return 0;if(w>=L)return-1;if(t>=u)return 1;if(t>>>=0,u>>>=0,w>>>=0,L>>>=0,this===e)return 0;for(var k=L-w,W=u-t,K=Math.min(k,W),z=this.slice(w,L),X=e.slice(t,u),$=0;$2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,O(t)&&(t=w?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(w)return-1;t=r.length-1}else if(t<0)if(w)t=0;else return-1;if(typeof e=="string"&&(e=i.from(e,u)),i.isBuffer(e))return e.length===0?-1:S(r,e,t,u,w);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?w?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):S(r,[e],t,u,w);throw new TypeError("val must be string, number or Buffer")}function S(r,e,t,u,w){var L=1,k=r.length,W=e.length;if(u!==void 0&&(u=String(u).toLowerCase(),u==="ucs2"||u==="ucs-2"||u==="utf16le"||u==="utf-16le")){if(r.length<2||e.length<2)return-1;L=2,k/=2,W/=2,t/=2}function K(xt,_t){return L===1?xt[_t]:xt.readUInt16BE(_t*L)}var z;if(w){var X=-1;for(z=t;zk&&(t=k-W),z=t;z>=0;z--){for(var $=!0,te=0;tew&&(u=w)):u=w;var L=e.length;u>L/2&&(u=L/2);for(var k=0;k>>0,isFinite(u)?(u=u>>>0,w===void 0&&(w="utf8")):(w=u,u=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var L=this.length-t;if((u===void 0||u>L)&&(u=L),e.length>0&&(u<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");for(var k=!1;;)switch(w){case"hex":return I(this,e,t,u);case"utf8":case"utf-8":return N(this,e,t,u);case"ascii":return U(this,e,t,u);case"latin1":case"binary":return H(this,e,t,u);case"base64":return Q(this,e,t,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,e,t,u);default:if(k)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),k=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(r,e,t){return e===0&&t===r.length?n.fromByteArray(r):n.fromByteArray(r.slice(e,t))}function oe(r,e,t){t=Math.min(r.length,t);for(var u=[],w=e;w239?4:L>223?3:L>191?2:1;if(w+W<=t){var K,z,X,$;switch(W){case 1:L<128&&(k=L);break;case 2:K=r[w+1],(K&192)===128&&($=(L&31)<<6|K&63,$>127&&(k=$));break;case 3:K=r[w+1],z=r[w+2],(K&192)===128&&(z&192)===128&&($=(L&15)<<12|(K&63)<<6|z&63,$>2047&&($<55296||$>57343)&&(k=$));break;case 4:K=r[w+1],z=r[w+2],X=r[w+3],(K&192)===128&&(z&192)===128&&(X&192)===128&&($=(L&15)<<18|(K&63)<<12|(z&63)<<6|X&63,$>65535&&$<1114112&&(k=$))}}k===null?(k=65533,W=1):k>65535&&(k-=65536,u.push(k>>>10&1023|55296),k=56320|k&1023),u.push(k),w+=W}return xe(u)}var de=4096;function xe(r){var e=r.length;if(e<=de)return String.fromCharCode.apply(String,r);for(var t="",u=0;uu)&&(t=u);for(var w="",L=e;Lu&&(e=u),t<0?(t+=u,t<0&&(t=0)):t>u&&(t=u),tt)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(e,t,u){e=e>>>0,t=t>>>0,u||Y(e,t,this.length);for(var w=this[e],L=1,k=0;++k>>0,t=t>>>0,u||Y(e,t,this.length);for(var w=this[e+--t],L=1;t>0&&(L*=256);)w+=this[e+--t]*L;return w},i.prototype.readUInt8=function(e,t){return e=e>>>0,t||Y(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Y(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Y(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},i.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,u){e=e>>>0,t=t>>>0,u||Y(e,t,this.length);for(var w=this[e],L=1,k=0;++k=L&&(w-=Math.pow(2,8*t)),w},i.prototype.readIntBE=function(e,t,u){e=e>>>0,t=t>>>0,u||Y(e,t,this.length);for(var w=t,L=1,k=this[e+--w];w>0&&(L*=256);)k+=this[e+--w]*L;return L*=128,k>=L&&(k-=Math.pow(2,8*t)),k},i.prototype.readInt8=function(e,t){return e=e>>>0,t||Y(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,t){e=e>>>0,t||Y(e,2,this.length);var u=this[e]|this[e+1]<<8;return u&32768?u|4294901760:u},i.prototype.readInt16BE=function(e,t){e=e>>>0,t||Y(e,2,this.length);var u=this[e+1]|this[e]<<8;return u&32768?u|4294901760:u},i.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),o.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),o.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Y(e,8,this.length),o.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Y(e,8,this.length),o.read(this,e,!1,52,8)};function Z(r,e,t,u,w,L){if(!i.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>w||er.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(e,t,u,w){if(e=+e,t=t>>>0,u=u>>>0,!w){var L=Math.pow(2,8*u)-1;Z(this,e,t,u,L,0)}var k=1,W=0;for(this[t]=e&255;++W>>0,u=u>>>0,!w){var L=Math.pow(2,8*u)-1;Z(this,e,t,u,L,0)}var k=u-1,W=1;for(this[t+k]=e&255;--k>=0&&(W*=256);)this[t+k]=e/W&255;return t+u},i.prototype.writeUInt8=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,1,255,0),this[t]=e&255,t+1},i.prototype.writeUInt16LE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},i.prototype.writeUInt32LE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},i.prototype.writeUInt32BE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},i.prototype.writeIntLE=function(e,t,u,w){if(e=+e,t=t>>>0,!w){var L=Math.pow(2,8*u-1);Z(this,e,t,u,L-1,-L)}var k=0,W=1,K=0;for(this[t]=e&255;++k>0)-K&255;return t+u},i.prototype.writeIntBE=function(e,t,u,w){if(e=+e,t=t>>>0,!w){var L=Math.pow(2,8*u-1);Z(this,e,t,u,L-1,-L)}var k=u-1,W=1,K=0;for(this[t+k]=e&255;--k>=0&&(W*=256);)e<0&&K===0&&this[t+k+1]!==0&&(K=1),this[t+k]=(e/W>>0)-K&255;return t+u},i.prototype.writeInt8=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},i.prototype.writeInt16LE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},i.prototype.writeInt32LE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,u){return e=+e,t=t>>>0,u||Z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function re(r,e,t,u,w,L){if(t+u>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function me(r,e,t,u,w){return e=+e,t=t>>>0,w||re(r,e,t,4),o.write(r,e,t,u,23,4),t+4}i.prototype.writeFloatLE=function(e,t,u){return me(this,e,t,!0,u)},i.prototype.writeFloatBE=function(e,t,u){return me(this,e,t,!1,u)};function Ee(r,e,t,u,w){return e=+e,t=t>>>0,w||re(r,e,t,8),o.write(r,e,t,u,52,8),t+8}i.prototype.writeDoubleLE=function(e,t,u){return Ee(this,e,t,!0,u)},i.prototype.writeDoubleBE=function(e,t,u){return Ee(this,e,t,!1,u)},i.prototype.copy=function(e,t,u,w){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(u||(u=0),!w&&w!==0&&(w=this.length),t>=e.length&&(t=e.length),t||(t=0),w>0&&w=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),e.length-t=0;--k)e[k+t]=this[k+u];else Uint8Array.prototype.set.call(e,this.subarray(u,w),t);return L},i.prototype.fill=function(e,t,u,w){if(typeof e=="string"){if(typeof t=="string"?(w=t,t=0,u=this.length):typeof u=="string"&&(w=u,u=this.length),w!==void 0&&typeof w!="string")throw new TypeError("encoding must be a string");if(typeof w=="string"&&!i.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(e.length===1){var L=e.charCodeAt(0);(w==="utf8"&&L<128||w==="latin1")&&(e=L)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length>>0,u=u===void 0?this.length:u>>>0,e||(e=0);var k;if(typeof e=="number")for(k=t;k55295&&t<57344){if(!w){if(t>56319){(e-=3)>-1&&L.push(239,191,189);continue}else if(k+1===u){(e-=3)>-1&&L.push(239,191,189);continue}w=t;continue}if(t<56320){(e-=3)>-1&&L.push(239,191,189),w=t;continue}t=(w-55296<<10|t-56320)+65536}else w&&(e-=3)>-1&&L.push(239,191,189);if(w=null,t<128){if((e-=1)<0)break;L.push(t)}else if(t<2048){if((e-=2)<0)break;L.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;L.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;L.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return L}function q(r){for(var e=[],t=0;t>8,w=t%256,L.push(w),L.push(u);return L}function s(r){return n.toByteArray(b(r))}function f(r,e,t,u){for(var w=0;w=e.length||w>=r.length);++w)e[w+t]=r[w];return w}function D(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function O(r){return r!==r}var V=(function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var u=t*16,w=0;w<16;++w)e[u+w]=r[t]+r[w];return e})()})(He)),He}var ue=Re();const Ln={lstatSync:()=>{},isFileReadStream(a){return!1}},ke={...Ln,runtime:"browser"},Te=a=>{if(a==null)return 0;if(typeof a=="string")return ue.Buffer.byteLength(a);if(typeof a.byteLength=="number")return a.byteLength;if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size;if(typeof a.start=="number"&&typeof a.end=="number")return a.end+1-a.start;if(ke.isFileReadStream(a))try{return ke.lstatSync(a.path).size}catch{return}};var ne;(function(a){a.EMPTY_INPUT="a null or undefined Body",a.CONTENT_LENGTH="the ContentLength property of the params set by the caller",a.STRING_LENGTH="the encoded byte length of the Body string",a.TYPED_ARRAY="the byteLength of a typed byte array such as Uint8Array",a.LENGTH="the value of Body.length",a.SIZE="the value of Body.size",a.START_END_DIFF="the numeric difference between Body.start and Body.end",a.LSTAT="the size of the file given by Body.path on disk as reported by lstatSync"})(ne||(ne={}));const kn=(a,n)=>{if(n!=null)return ne.CONTENT_LENGTH;if(a==null)return ne.EMPTY_INPUT;if(typeof a=="string")return ne.STRING_LENGTH;if(typeof a.byteLength=="number")return ne.TYPED_ARRAY;if(typeof a.length=="number")return ne.LENGTH;if(typeof a.size=="number")return ne.SIZE;if(typeof a.start=="number"&&typeof a.end=="number")return ne.START_END_DIFF;if(ke.isFileReadStream(a))try{return ke.lstatSync(a.path).size,ne.LSTAT}catch{return}};var De={exports:{}},Dt;function be(){return Dt||(Dt=1,typeof Object.create=="function"?De.exports=function(n,o){o&&(n.super_=o,n.prototype=Object.create(o.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:De.exports=function(n,o){if(o){n.super_=o;var l=function(){};l.prototype=o.prototype,n.prototype=new l,n.prototype.constructor=n}}),De.exports}var je,Mt;function ir(){return Mt||(Mt=1,je=Ne().EventEmitter),je}const Pn={},Nn=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),ar=Mr(Nn);var We,Lt;function In(){if(Lt)return We;Lt=1;function a(_,M){var T=Object.keys(_);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(_);M&&(p=p.filter(function(x){return Object.getOwnPropertyDescriptor(_,x).enumerable})),T.push.apply(T,p)}return T}function n(_){for(var M=1;M0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(T){var p={data:T,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var p=this.head,x=""+p.data;p=p.next;)x+=T+p.data;return x}},{key:"concat",value:function(T){if(this.length===0)return g.alloc(0);for(var p=g.allocUnsafe(T>>>0),x=this.head,A=0;x;)C(x.data,p,A),A+=x.data.length,x=x.next;return p}},{key:"consume",value:function(T,p){var x;return TE.length?E.length:T;if(m===E.length?A+=E:A+=E.slice(0,T),T-=m,T===0){m===E.length?(++x,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=E.slice(m));break}++x}return this.length-=x,A}},{key:"_getBuffer",value:function(T){var p=g.allocUnsafe(T),x=this.head,A=1;for(x.data.copy(p),T-=x.data.length;x=x.next;){var E=x.data,m=T>E.length?E.length:T;if(E.copy(p,p.length-T,0,m),T-=m,T===0){m===E.length?(++A,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=E.slice(m));break}++A}return this.length-=A,p}},{key:B,value:function(T,p){return R(this,n(n({},p),{},{depth:0,customInspect:!1}))}}]),_})(),We}var Ke,kt;function or(){if(kt)return Ke;kt=1;function a(h,i){var d=this,g=this._readableState&&this._readableState.destroyed,F=this._writableState&&this._writableState.destroyed;return g||F?(i?i(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(y,this,h)):process.nextTick(y,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(R){!i&&R?d._writableState?d._writableState.errorEmitted?process.nextTick(o,d):(d._writableState.errorEmitted=!0,process.nextTick(n,d,R)):process.nextTick(n,d,R):i?(process.nextTick(o,d),i(R)):process.nextTick(o,d)}),this)}function n(h,i){y(h,i),o(h)}function o(h){h._writableState&&!h._writableState.emitClose||h._readableState&&!h._readableState.emitClose||h.emit("close")}function l(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function y(h,i){h.emit("error",i)}function c(h,i){var d=h._readableState,g=h._writableState;d&&d.autoDestroy||g&&g.autoDestroy?h.destroy(i):h.emit("error",i)}return Ke={destroy:a,undestroy:l,errorOrDestroy:c},Ke}var $e={},Pt;function ve(){if(Pt)return $e;Pt=1;function a(i,d){i.prototype=Object.create(d.prototype),i.prototype.constructor=i,i.__proto__=d}var n={};function o(i,d,g){g||(g=Error);function F(B,C,_){return typeof d=="string"?d:d(B,C,_)}var R=(function(B){a(C,B);function C(_,M,T){return B.call(this,F(_,M,T))||this}return C})(g);R.prototype.name=g.name,R.prototype.code=i,n[i]=R}function l(i,d){if(Array.isArray(i)){var g=i.length;return i=i.map(function(F){return String(F)}),g>2?"one of ".concat(d," ").concat(i.slice(0,g-1).join(", "),", or ")+i[g-1]:g===2?"one of ".concat(d," ").concat(i[0]," or ").concat(i[1]):"of ".concat(d," ").concat(i[0])}else return"of ".concat(d," ").concat(String(i))}function y(i,d,g){return i.substr(0,d.length)===d}function c(i,d,g){return(g===void 0||g>i.length)&&(g=i.length),i.substring(g-d.length,g)===d}function h(i,d,g){return typeof g!="number"&&(g=0),g+d.length>i.length?!1:i.indexOf(d,g)!==-1}return o("ERR_INVALID_OPT_VALUE",function(i,d){return'The value "'+d+'" is invalid for option "'+i+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(i,d,g){var F;typeof d=="string"&&y(d,"not ")?(F="must not be",d=d.replace(/^not /,"")):F="must be";var R;if(c(i," argument"))R="The ".concat(i," ").concat(F," ").concat(l(d,"type"));else{var B=h(i,".")?"property":"argument";R='The "'.concat(i,'" ').concat(B," ").concat(F," ").concat(l(d,"type"))}return R+=". Received type ".concat(typeof g),R},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$e.codes=n,$e}var ze,Nt;function sr(){if(Nt)return ze;Nt=1;var a=ve().codes.ERR_INVALID_OPT_VALUE;function n(l,y,c){return l.highWaterMark!=null?l.highWaterMark:y?l[c]:null}function o(l,y,c,h){var i=n(y,h,c);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var d=h?c:"highWaterMark";throw new a(d,i)}return Math.floor(i)}return l.objectMode?16:16*1024}return ze={getHighWaterMark:o},ze}var Ve,It;function Un(){if(It)return Ve;It=1,Ve=a;function a(o,l){if(n("noDeprecation"))return o;var y=!1;function c(){if(!y){if(n("throwDeprecation"))throw new Error(l);n("traceDeprecation")?console.trace(l):console.warn(l),y=!0}return o.apply(this,arguments)}return c}function n(o){try{if(!we.localStorage)return!1}catch{return!1}var l=we.localStorage[o];return l==null?!1:String(l).toLowerCase()==="true"}return Ve}var Ge,Ut;function ur(){if(Ut)return Ge;Ut=1,Ge=N;function a(v){var b=this;this.next=null,this.entry=null,this.finish=function(){Ee(b,v)}}var n;N.WritableState=S;var o={deprecate:Un()},l=ir(),y=Re().Buffer,c=(typeof we<"u"?we:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function h(v){return y.from(v)}function i(v){return y.isBuffer(v)||v instanceof c}var d=or(),g=sr(),F=g.getHighWaterMark,R=ve().codes,B=R.ERR_INVALID_ARG_TYPE,C=R.ERR_METHOD_NOT_IMPLEMENTED,_=R.ERR_MULTIPLE_CALLBACK,M=R.ERR_STREAM_CANNOT_PIPE,T=R.ERR_STREAM_DESTROYED,p=R.ERR_STREAM_NULL_VALUES,x=R.ERR_STREAM_WRITE_AFTER_END,A=R.ERR_UNKNOWN_ENCODING,E=d.errorOrDestroy;be()(N,l);function m(){}function S(v,b,P){n=n||ge(),v=v||{},typeof P!="boolean"&&(P=b instanceof n),this.objectMode=!!v.objectMode,P&&(this.objectMode=this.objectMode||!!v.writableObjectMode),this.highWaterMark=F(this,v,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var q=v.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=v.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(j){xe(b,j)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=v.emitClose!==!1,this.autoDestroy=!!v.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}S.prototype.getBuffer=function(){for(var b=this.bufferedRequest,P=[];b;)P.push(b),b=b.next;return P},(function(){try{Object.defineProperty(S.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(b){return I.call(this,b)?!0:this!==N?!1:b&&b._writableState instanceof S}})):I=function(b){return b instanceof this};function N(v){n=n||ge();var b=this instanceof n;if(!b&&!I.call(N,this))return new N(v);this._writableState=new S(v,this,b),this.writable=!0,v&&(typeof v.write=="function"&&(this._write=v.write),typeof v.writev=="function"&&(this._writev=v.writev),typeof v.destroy=="function"&&(this._destroy=v.destroy),typeof v.final=="function"&&(this._final=v.final)),l.call(this)}N.prototype.pipe=function(){E(this,new M)};function U(v,b){var P=new x;E(v,P),process.nextTick(b,P)}function H(v,b,P,q){var j;return P===null?j=new p:typeof P!="string"&&!b.objectMode&&(j=new B("chunk",["string","Buffer"],P)),j?(E(v,j),process.nextTick(q,j),!1):!0}N.prototype.write=function(v,b,P){var q=this._writableState,j=!1,s=!q.objectMode&&i(v);return s&&!y.isBuffer(v)&&(v=h(v)),typeof b=="function"&&(P=b,b=null),s?b="buffer":b||(b=q.defaultEncoding),typeof P!="function"&&(P=m),q.ending?U(this,P):(s||H(this,q,v,P))&&(q.pendingcb++,j=J(this,q,s,v,b,P)),j},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){var v=this._writableState;v.corked&&(v.corked--,!v.writing&&!v.corked&&!v.bufferProcessing&&v.bufferedRequest&&se(this,v))},N.prototype.setDefaultEncoding=function(b){if(typeof b=="string"&&(b=b.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((b+"").toLowerCase())>-1))throw new A(b);return this._writableState.defaultEncoding=b,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(v,b,P){return!v.objectMode&&v.decodeStrings!==!1&&typeof b=="string"&&(b=y.from(b,P)),b}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function J(v,b,P,q,j,s){if(!P){var f=Q(b,q,j);q!==f&&(P=!0,j="buffer",q=f)}var D=b.objectMode?1:q.length;b.length+=D;var O=b.length>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function h(p,x,A){var E=x.length-1;if(E=0?(m>0&&(p.lastNeed=m-1),m):--E=0?(m>0&&(p.lastNeed=m-2),m):--E=0?(m>0&&(m===2?m=0:p.lastNeed=m-3),m):0))}function i(p,x,A){if((x[0]&192)!==128)return p.lastNeed=0,"ļæ½";if(p.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return p.lastNeed=1,"ļæ½";if(p.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return p.lastNeed=2,"ļæ½"}}function d(p){var x=this.lastTotal-this.lastNeed,A=i(this,p);if(A!==void 0)return A;if(this.lastNeed<=p.length)return p.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,x,0,p.length),this.lastNeed-=p.length}function g(p,x){var A=h(this,p,x);if(!this.lastNeed)return p.toString("utf8",x);this.lastTotal=A;var E=p.length-(A-this.lastNeed);return p.copy(this.lastChar,0,E),p.toString("utf8",x,E)}function F(p){var x=p&&p.length?this.write(p):"";return this.lastNeed?x+"ļæ½":x}function R(p,x){if((p.length-x)%2===0){var A=p.toString("utf16le",x);if(A){var E=A.charCodeAt(A.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",x,p.length-1)}function B(p){var x=p&&p.length?this.write(p):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,A)}return x}function C(p,x){var A=(p.length-x)%3;return A===0?p.toString("base64",x):(this.lastNeed=3-A,this.lastTotal=3,A===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",x,p.length-A))}function _(p){var x=p&&p.length?this.write(p):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function M(p){return p.toString(this.encoding)}function T(p){return p&&p.length?this.write(p):""}return Xe}var Qe,Wt;function vt(){if(Wt)return Qe;Wt=1;var a=ve().codes.ERR_STREAM_PREMATURE_CLOSE;function n(c){var h=!1;return function(){if(!h){h=!0;for(var i=arguments.length,d=new Array(i),g=0;g0)if(typeof f!="string"&&!r.objectMode&&Object.getPrototypeOf(f)!==l.prototype&&(f=c(f)),O)r.endEmitted?m(s,new p):Q(s,r,f,!0);else if(r.ended)m(s,new M);else{if(r.destroyed)return!1;r.reading=!1,r.decoder&&!D?(f=r.decoder.write(f),r.objectMode||f.length!==0?Q(s,r,f,!1):se(s,r)):Q(s,r,f,!1)}else O||(r.reading=!1,se(s,r))}return!r.ended&&(r.length=ee?s=ee:(s--,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s++),s}function de(s,f){return s<=0||f.length===0&&f.ended?0:f.objectMode?1:s!==s?f.flowing&&f.length?f.buffer.head.data.length:f.length:(s>f.highWaterMark&&(f.highWaterMark=oe(s)),s<=f.length?s:f.ended?f.length:(f.needReadable=!0,0))}U.prototype.read=function(s){d("read",s),s=parseInt(s,10);var f=this._readableState,D=s;if(s!==0&&(f.emittedReadable=!1),s===0&&f.needReadable&&((f.highWaterMark!==0?f.length>=f.highWaterMark:f.length>0)||f.ended))return d("read: emitReadable",f.length,f.ended),f.length===0&&f.ended?P(this):ie(this),null;if(s=de(s,f),s===0&&f.ended)return f.length===0&&P(this),null;var O=f.needReadable;d("need readable",O),(f.length===0||f.length-s0?V=b(s,f):V=null,V===null?(f.needReadable=f.length<=f.highWaterMark,s=0):(f.length-=s,f.awaitDrain=0),f.length===0&&(f.ended||(f.needReadable=!0),D!==s&&f.ended&&P(this)),V!==null&&this.emit("data",V),V};function xe(s,f){if(d("onEofChunk"),!f.ended){if(f.decoder){var D=f.decoder.end();D&&D.length&&(f.buffer.push(D),f.length+=f.objectMode?1:D.length)}f.ended=!0,f.sync?ie(s):(f.needReadable=!1,f.emittedReadable||(f.emittedReadable=!0,pe(s)))}}function ie(s){var f=s._readableState;d("emitReadable",f.needReadable,f.emittedReadable),f.needReadable=!1,f.emittedReadable||(d("emitReadable",f.flowing),f.emittedReadable=!0,process.nextTick(pe,s))}function pe(s){var f=s._readableState;d("emitReadable_",f.destroyed,f.length,f.ended),!f.destroyed&&(f.length||f.ended)&&(s.emit("readable"),f.emittedReadable=!1),f.needReadable=!f.flowing&&!f.ended&&f.length<=f.highWaterMark,v(s)}function se(s,f){f.readingMore||(f.readingMore=!0,process.nextTick(ye,s,f))}function ye(s,f){for(;!f.reading&&!f.ended&&(f.length1&&j(O.pipes,s)!==-1)&&!w&&(d("false write response, pause",O.awaitDrain),O.awaitDrain++),D.pause())}function W($){d("onerror",$),X(),s.removeListener("error",W),n(s,"error")===0&&m(s,$)}I(s,"error",W);function K(){s.removeListener("finish",z),X()}s.once("close",K);function z(){d("onfinish"),s.removeListener("close",K),X()}s.once("finish",z);function X(){d("unpipe"),D.unpipe(s)}return s.emit("pipe",D),O.flowing||(d("pipe resume"),D.resume()),s};function Y(s){return function(){var D=s._readableState;d("pipeOnDrain",D.awaitDrain),D.awaitDrain&&D.awaitDrain--,D.awaitDrain===0&&n(s,"data")&&(D.flowing=!0,v(s))}}U.prototype.unpipe=function(s){var f=this._readableState,D={hasUnpiped:!1};if(f.pipesCount===0)return this;if(f.pipesCount===1)return s&&s!==f.pipes?this:(s||(s=f.pipes),f.pipes=null,f.pipesCount=0,f.flowing=!1,s&&s.emit("unpipe",this,D),this);if(!s){var O=f.pipes,V=f.pipesCount;f.pipes=null,f.pipesCount=0,f.flowing=!1;for(var r=0;r0,O.flowing!==!1&&this.resume()):s==="readable"&&!O.endEmitted&&!O.readableListening&&(O.readableListening=O.needReadable=!0,O.flowing=!1,O.emittedReadable=!1,d("on readable",O.length,O.reading),O.length?ie(this):O.reading||process.nextTick(re,this)),D},U.prototype.addListener=U.prototype.on,U.prototype.removeListener=function(s,f){var D=o.prototype.removeListener.call(this,s,f);return s==="readable"&&process.nextTick(Z,this),D},U.prototype.removeAllListeners=function(s){var f=o.prototype.removeAllListeners.apply(this,arguments);return(s==="readable"||s===void 0)&&process.nextTick(Z,this),f};function Z(s){var f=s._readableState;f.readableListening=s.listenerCount("readable")>0,f.resumeScheduled&&!f.paused?f.flowing=!0:s.listenerCount("data")>0&&s.resume()}function re(s){d("readable nexttick read 0"),s.read(0)}U.prototype.resume=function(){var s=this._readableState;return s.flowing||(d("resume"),s.flowing=!s.readableListening,me(this,s)),s.paused=!1,this};function me(s,f){f.resumeScheduled||(f.resumeScheduled=!0,process.nextTick(Ee,s,f))}function Ee(s,f){d("resume",f.reading),f.reading||s.read(0),f.resumeScheduled=!1,s.emit("resume"),v(s),f.flowing&&!f.reading&&s.read(0)}U.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function v(s){var f=s._readableState;for(d("flow",f.flowing);f.flowing&&s.read()!==null;);}U.prototype.wrap=function(s){var f=this,D=this._readableState,O=!1;s.on("end",function(){if(d("wrapped end"),D.decoder&&!D.ended){var e=D.decoder.end();e&&e.length&&f.push(e)}f.push(null)}),s.on("data",function(e){if(d("wrapped data"),D.decoder&&(e=D.decoder.write(e)),!(D.objectMode&&e==null)&&!(!D.objectMode&&(!e||!e.length))){var t=f.push(e);t||(O=!0,s.pause())}});for(var V in s)this[V]===void 0&&typeof s[V]=="function"&&(this[V]=(function(t){return function(){return s[t].apply(s,arguments)}})(V));for(var r=0;r=f.length?(f.decoder?D=f.buffer.join(""):f.buffer.length===1?D=f.buffer.first():D=f.buffer.concat(f.length),f.buffer.clear()):D=f.buffer.consume(s,f.decoder),D}function P(s){var f=s._readableState;d("endReadable",f.endEmitted),f.endEmitted||(f.ended=!0,process.nextTick(q,f,s))}function q(s,f){if(d("endReadableNT",s.endEmitted,s.length),!s.endEmitted&&s.length===0&&(s.endEmitted=!0,f.readable=!1,f.emit("end"),s.autoDestroy)){var D=f._writableState;(!D||D.autoDestroy&&D.finished)&&f.destroy()}}typeof Symbol=="function"&&(U.from=function(s,f){return E===void 0&&(E=Hn()),E(U,s,f)});function j(s,f){for(var D=0,O=s.length;D0;return i(x,E,m,function(S){T||(T=S),S&&p.forEach(d),!E&&(p.forEach(d),M(T))})});return C.reduce(g)}return nt=R,nt}var it,Xt;function Kn(){if(Xt)return it;Xt=1,it=o;var a=Ne().EventEmitter,n=be();n(o,a),o.Readable=fr(),o.Writable=ur(),o.Duplex=ge(),o.Transform=lr(),o.PassThrough=jn(),o.finished=vt(),o.pipeline=Wn(),o.Stream=o;function o(){a.call(this)}return o.prototype.pipe=function(l,y){var c=this;function h(C){l.writable&&l.write(C)===!1&&c.pause&&c.pause()}c.on("data",h);function i(){c.readable&&c.resume&&c.resume()}l.on("drain",i),!l._isStdio&&(!y||y.end!==!1)&&(c.on("end",g),c.on("close",F));var d=!1;function g(){d||(d=!0,l.end())}function F(){d||(d=!0,typeof l.destroy=="function"&&l.destroy())}function R(C){if(B(),a.listenerCount(this,"error")===0)throw C}c.on("error",R),l.on("error",R);function B(){c.removeListener("data",h),l.removeListener("drain",i),c.removeListener("end",g),c.removeListener("close",F),c.removeListener("error",R),l.removeListener("error",R),c.removeListener("end",B),c.removeListener("close",B),l.removeListener("close",B)}return c.on("end",B),c.on("close",B),l.on("close",B),l.emit("pipe",c),l},it}var $n=Kn();async function*at(a,n,o){let l=1;const y={chunks:[],length:0};for await(const c of o(a))for(y.chunks.push(c),y.length+=c.byteLength;y.length>n;){const h=y.chunks.length>1?ue.Buffer.concat(y.chunks):y.chunks[0];yield{partNumber:l,data:h.subarray(0,n)},y.chunks=[h.subarray(n)],y.length=y.chunks[0].byteLength,l+=1}yield{partNumber:l,data:y.chunks.length!==1?ue.Buffer.concat(y.chunks):y.chunks[0],lastPart:!0}}async function*Qt(a,n){let o=1,l=0,y=n;for(;y{if(a instanceof Uint8Array)return Qt(a,n);if(a instanceof $n.Readable)return at(a,n,zn);if(a instanceof String||typeof a=="string")return Qt(ue.Buffer.from(a),n);if(typeof a.stream=="function")return at(a.stream(),n,Zt);if(a instanceof ReadableStream)return at(a,n,Zt);throw new Error("Body Data is unsupported format, expected data to be one of: string | Uint8Array | Buffer | Readable | ReadableStream | Blob;.")};class Ae extends qe.EventEmitter{static MIN_PART_SIZE=1024*1024*5;MAX_PARTS=1e4;queueSize=4;partSize;leavePartsOnError=!1;tags=[];client;params;totalBytes;totalBytesSource;bytesUploadedSoFar;abortController;concurrentUploaders=[];createMultiPartPromise;abortMultipartUploadCommand=null;uploadedParts=[];uploadEnqueuedPartsCount=0;expectedPartsCount;uploadId;uploadEvent;isMultiPart=!0;singleUploadResult;sent=!1;constructor(n){if(super(),this.queueSize=n.queueSize||this.queueSize,this.leavePartsOnError=n.leavePartsOnError||this.leavePartsOnError,this.tags=n.tags||this.tags,this.client=n.client,this.params=n.params,!this.params)throw new Error("InputError: Upload requires params to be passed to upload.");this.totalBytes=this.params.ContentLength??Te(this.params.Body),this.totalBytesSource=kn(this.params.Body,this.params.ContentLength),this.bytesUploadedSoFar=0,this.abortController=n.abortController??new Tn,this.partSize=n.partSize||Math.max(Ae.MIN_PART_SIZE,Math.floor((this.totalBytes||0)/this.MAX_PARTS)),this.totalBytes!==void 0&&(this.expectedPartsCount=Math.ceil(this.totalBytes/this.partSize)),this.__validateInput()}async abort(){this.abortController.abort()}async done(){if(this.sent)throw new Error("@aws-sdk/lib-storage: this instance of Upload has already executed .done(). Create a new instance.");return this.sent=!0,await Promise.race([this.__doMultipartUpload(),this.__abortTimeout(this.abortController.signal)])}on(n,o){return this.uploadEvent=n,super.on(n,o)}async __uploadUsingPut(n){this.isMultiPart=!1;const o={...this.params,Body:n.data},l=this.client.config,y=l.requestHandler,c=y instanceof qe.EventEmitter?y:null,h=_=>{this.bytesUploadedSoFar=_.loaded,this.totalBytes=_.total,this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:n.partNumber,Key:this.params.Key,Bucket:this.params.Bucket})};c!==null&&c.on("xhr.upload.progress",h);const i=await Promise.all([this.client.send(new At(o)),l?.endpoint?.()]),d=i[0];let g=i[1];if(g||(g=Lr(await kr(o,At,{...l}))),!g)throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()" nor EndpointsV2.');c!==null&&c.off("xhr.upload.progress",h);const F=this.params.Key.split("/").map(_=>Ct(_)).join("/"),R=Ct(this.params.Bucket),B=(()=>{const _=g.hostname.startsWith(`${R}.`),M=this.client.config.forcePathStyle,T=g.port?`:${g.port}`:"";return M?`${g.protocol}//${g.hostname}${T}/${R}/${F}`:_?`${g.protocol}//${g.hostname}${T}/${F}`:`${g.protocol}//${R}.${g.hostname}${T}/${F}`})();this.singleUploadResult={...d,Bucket:this.params.Bucket,Key:this.params.Key,Location:B};const C=Te(n.data);this.__notifyProgress({loaded:C,total:C,part:1,Key:this.params.Key,Bucket:this.params.Bucket})}async __createMultipartUpload(){const n=await this.client.config.requestChecksumCalculation();if(!this.createMultiPartPromise){const o={...this.params,Body:void 0};n==="WHEN_SUPPORTED"&&(o.ChecksumAlgorithm=this.params.ChecksumAlgorithm||Bn.CRC32),this.createMultiPartPromise=this.client.send(new Cn(o)).then(l=>(this.abortMultipartUploadCommand=new yn({Bucket:this.params.Bucket,Key:this.params.Key,UploadId:l.UploadId}),l))}return this.createMultiPartPromise}async __doConcurrentUpload(n){for await(const o of n){if(this.uploadEnqueuedPartsCount>this.MAX_PARTS)throw new Error(`Exceeded ${this.MAX_PARTS} parts in multipart upload to Bucket: ${this.params.Bucket} Key: ${this.params.Key}.`);if(this.abortController.signal.aborted)return;if(o.partNumber===1&&o.lastPart)return await this.__uploadUsingPut(o);if(!this.uploadId){const{UploadId:g}=await this.__createMultipartUpload();if(this.uploadId=g,this.abortController.signal.aborted)return}const l=Te(o.data)||0,y=this.client.config.requestHandler,c=y instanceof qe.EventEmitter?y:null;let h=0;const i=(g,F)=>{(Number(F.query.partNumber)||-1)===o.partNumber&&(g.total&&l&&(this.bytesUploadedSoFar+=g.loaded-h,h=g.loaded),this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:o.partNumber,Key:this.params.Key,Bucket:this.params.Bucket}))};c!==null&&c.on("xhr.upload.progress",i),this.uploadEnqueuedPartsCount+=1,this.__validateUploadPart(o);const d=await this.client.send(new Rn({...this.params,ContentLength:void 0,UploadId:this.uploadId,Body:o.data,PartNumber:o.partNumber}));if(c!==null&&c.off("xhr.upload.progress",i),this.abortController.signal.aborted)return;if(!d.ETag)throw new Error(`Part ${o.partNumber} is missing ETag in UploadPart response. Missing Bucket CORS configuration for ETag header?`);this.uploadedParts.push({PartNumber:o.partNumber,ETag:d.ETag,...d.ChecksumCRC32&&{ChecksumCRC32:d.ChecksumCRC32},...d.ChecksumCRC32C&&{ChecksumCRC32C:d.ChecksumCRC32C},...d.ChecksumSHA1&&{ChecksumSHA1:d.ChecksumSHA1},...d.ChecksumSHA256&&{ChecksumSHA256:d.ChecksumSHA256}}),c===null&&(this.bytesUploadedSoFar+=l),this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:o.partNumber,Key:this.params.Key,Bucket:this.params.Bucket})}}async __doMultipartUpload(){const n=Vn(this.params.Body,this.partSize),o=[];for(let y=0;y{o.push(h)});this.concurrentUploaders.push(c)}if(await Promise.all(this.concurrentUploaders),o.length>=1)throw await this.markUploadAsAborted(),o[0];if(this.abortController.signal.aborted)throw await this.markUploadAsAborted(),Object.assign(new Error("Upload aborted."),{name:"AbortError"});let l;if(this.isMultiPart){const{expectedPartsCount:y,uploadedParts:c,totalBytes:h,totalBytesSource:i}=this;if(h!==void 0&&y!==void 0&&c.length!==y)throw new Error(`Expected ${y} part(s) but uploaded ${c.length} part(s). The expected part count is based on the byte-count of the input.params.Body, which was read from ${i} and is ${h}. If this is not correct, provide an override value by setting a number to input.params.ContentLength in bytes. -`);this.uploadedParts.sort((g,F)=>g.PartNumber-F.PartNumber);const d={...this.params,Body:void 0,UploadId:this.uploadId,MultipartUpload:{Parts:this.uploadedParts}};l=await this.client.send(new gn(d)),typeof l?.Location=="string"&&l.Location.includes("%2F")&&(l.Location=l.Location.replace(/%2F/g,"/"))}else l=this.singleUploadResult;return this.abortMultipartUploadCommand=null,this.tags.length&&await this.client.send(new An({...this.params,Tagging:{TagSet:this.tags}})),l}async markUploadAsAborted(){this.uploadId&&!this.leavePartsOnError&&this.abortMultipartUploadCommand!==null&&(await this.client.send(this.abortMultipartUploadCommand),this.abortMultipartUploadCommand=null)}__notifyProgress(n){this.uploadEvent&&this.emit(this.uploadEvent,n)}async __abortTimeout(n){return new Promise((f,l)=>{n.onabort=()=>{const y=new Error("Upload aborted.");y.name="AbortError",l(y)}})}__validateUploadPart(n){const f=Te(n.data);if(f===void 0)throw new Error(`A dataPart was generated without a measurable data chunk size for part number ${n.partNumber}`);if(!(n.partNumber===1&&n.lastPart)&&!n.lastPart&&f!==this.partSize)throw new Error(`The byte size for part number ${n.partNumber}, size ${f} does not match expected size ${this.partSize}`)}__validateInput(){if(!this.client)throw new Error("InputError: Upload requires a AWS client to do uploads with.");if(this.partSize{n.invalidateQueries({queryKey:["s3","buckets",y.bucket,"objects"]})}},a[0]=n,a[1]=f):f=a[1],gt(f)}async function Gn(a){const{bucket:n,key:f,file:l}=a;try{return await new Ae({client:wt(),params:{Bucket:n,Key:f,Body:l,ContentType:l.type}}).done()}catch{throw new Error("Failed to upload object")}}function ei(){const a=mt.c(2),n=Et();let f;return a[0]!==n?(f={mutationFn:Yn,onSuccess:()=>{n.invalidateQueries({queryKey:["s3","buckets"]})}},a[0]=n,a[1]=f):f=a[1],gt(f)}async function Yn(a){const{bucketName:n}=a;try{const f=new _n({Bucket:n});return await wt().send(f)}catch{throw new Error("Failed to create bucket")}}function ti(){const a=mt.c(2),n=Et();let f;return a[0]!==n?(f={mutationFn:Xn,onSuccess:(l,y)=>{n.invalidateQueries({queryKey:["s3","buckets",y.bucket,"objects"]})}},a[0]=n,a[1]=f):f=a[1],gt(f)}async function Xn(a){const{bucket:n,key:f}=a;try{const l=new Sn({Bucket:n,Key:f});return await wt().send(l)}catch{throw new Error("Failed to delete object")}}export{Jn as a,Pe as b,ti as c,vt as g,ei as u}; +`);this.uploadedParts.sort((g,F)=>g.PartNumber-F.PartNumber);const d={...this.params,Body:void 0,UploadId:this.uploadId,MultipartUpload:{Parts:this.uploadedParts}};l=await this.client.send(new gn(d)),typeof l?.Location=="string"&&l.Location.includes("%2F")&&(l.Location=l.Location.replace(/%2F/g,"/"))}else l=this.singleUploadResult;return this.abortMultipartUploadCommand=null,this.tags.length&&await this.client.send(new An({...this.params,Tagging:{TagSet:this.tags}})),l}async markUploadAsAborted(){this.uploadId&&!this.leavePartsOnError&&this.abortMultipartUploadCommand!==null&&(await this.client.send(this.abortMultipartUploadCommand),this.abortMultipartUploadCommand=null)}__notifyProgress(n){this.uploadEvent&&this.emit(this.uploadEvent,n)}async __abortTimeout(n){return new Promise((o,l)=>{n.onabort=()=>{const y=new Error("Upload aborted.");y.name="AbortError",l(y)}})}__validateUploadPart(n){const o=Te(n.data);if(o===void 0)throw new Error(`A dataPart was generated without a measurable data chunk size for part number ${n.partNumber}`);if(!(n.partNumber===1&&n.lastPart)&&!n.lastPart&&o!==this.partSize)throw new Error(`The byte size for part number ${n.partNumber}, size ${o} does not match expected size ${this.partSize}`)}__validateInput(){if(!this.client)throw new Error("InputError: Upload requires a AWS client to do uploads with.");if(this.partSize{n.invalidateQueries({queryKey:["s3","buckets",y.bucket,"objects"]})}},a[0]=n,a[1]=o):o=a[1],wt(o)}async function Gn(a){const{bucket:n,key:o,file:l}=a;try{return await new Ae({client:Et(),params:{Bucket:n,Key:o,Body:l,ContentType:l.type}}).done()}catch{throw new Error("Failed to upload object")}}function ei(){const a=yt.c(2),n=mt();let o;return a[0]!==n?(o={mutationFn:Yn,onSuccess:()=>{n.invalidateQueries({queryKey:["s3","buckets"]})}},a[0]=n,a[1]=o):o=a[1],wt(o)}async function Yn(a){const{bucketName:n}=a;try{const o=new _n({Bucket:n});return await Et().send(o)}catch{throw new Error("Failed to create bucket")}}function ti(){const a=yt.c(2),n=mt();let o;return a[0]!==n?(o={mutationFn:Xn,onSuccess:(l,y)=>{n.invalidateQueries({queryKey:["s3","buckets",y.bucket,"objects"]})}},a[0]=n,a[1]=o):o=a[1],wt(o)}async function Xn(a){const{bucket:n,key:o}=a;try{const l=new Sn({Bucket:n,Key:o});return await Et().send(l)}catch{throw new Error("Failed to delete object")}}export{Jn as a,Pe as b,ti as c,bt as g,ei as u}; diff --git a/hive/services/hiveui/frontend/package.json b/hive/services/hiveui/frontend/package.json index 61073569c..90257164f 100644 --- a/hive/services/hiveui/frontend/package.json +++ b/hive/services/hiveui/frontend/package.json @@ -10,7 +10,7 @@ "fix": "biome check --fix" }, "dependencies": { - "@aws-sdk/client-ec2": "^3.995.0", + "@aws-sdk/client-ec2": "^3.1000.0", "@aws-sdk/client-s3": "^3.995.0", "@aws-sdk/lib-storage": "^3.995.0", "@base-ui/react": "^1.2.0", @@ -40,8 +40,13 @@ "@vitejs/plugin-react": "^5.1.4", "babel-plugin-react-compiler": "^1.0.0", "typescript": "^5.9.3", - "ultracite": "^7.2.3", + "ultracite": "^7.2.4", "vite": "^7.3.1" }, + "pnpm": { + "overrides": { + "fast-xml-parser": ">=5.3.8" + } + }, "packageManager": "pnpm@10.30.0+sha512.2b5753de015d480eeb88f5b5b61e0051f05b4301808a82ec8b840c9d2adf7748eb352c83f5c1593ca703ff1017295bc3fdd3119abb9686efc96b9fcb18200937" } diff --git a/hive/services/hiveui/frontend/pnpm-lock.yaml b/hive/services/hiveui/frontend/pnpm-lock.yaml index 57647f1dd..a1bbb782c 100644 --- a/hive/services/hiveui/frontend/pnpm-lock.yaml +++ b/hive/services/hiveui/frontend/pnpm-lock.yaml @@ -4,19 +4,22 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + fast-xml-parser: '>=5.3.8' + importers: .: dependencies: '@aws-sdk/client-ec2': - specifier: ^3.995.0 - version: 3.995.0 + specifier: ^3.1000.0 + version: 3.1000.0 '@aws-sdk/client-s3': specifier: ^3.995.0 - version: 3.995.0 + version: 3.1000.0 '@aws-sdk/lib-storage': specifier: ^3.995.0 - version: 3.995.0(@aws-sdk/client-s3@3.995.0) + version: 3.1000.0(@aws-sdk/client-s3@3.1000.0) '@base-ui/react': specifier: ^1.2.0 version: 1.2.0(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -34,7 +37,7 @@ importers: version: 5.90.21(react@19.2.4) '@tanstack/react-router': specifier: ^1.162.1 - version: 1.162.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + version: 1.163.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4) class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -58,7 +61,7 @@ importers: version: 3.5.0 tailwindcss: specifier: ^4.2.0 - version: 4.2.0 + version: 4.2.1 zod: specifier: ^4.3.6 version: 4.3.6 @@ -68,13 +71,13 @@ importers: version: 2.4.4 '@tailwindcss/vite': specifier: ^4.2.0 - version: 4.2.0(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) + version: 4.2.1(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) '@tanstack/router-plugin': specifier: ^1.162.1 - version: 1.162.1(@tanstack/react-router@1.162.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) + version: 1.163.3(@tanstack/react-router@1.163.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) '@types/node': specifier: ^24.10.13 - version: 24.10.13 + version: 24.10.15 '@types/react': specifier: ^19.2.14 version: 19.2.14 @@ -83,10 +86,10 @@ importers: version: 19.2.3(@types/react@19.2.14) '@vitejs/plugin-basic-ssl': specifier: ^2.1.4 - version: 2.1.4(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) + version: 2.1.4(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) '@vitejs/plugin-react': specifier: ^5.1.4 - version: 5.1.4(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) + version: 5.1.4(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0)) babel-plugin-react-compiler: specifier: ^1.0.0 version: 1.0.0 @@ -94,11 +97,11 @@ importers: specifier: ^5.9.3 version: 5.9.3 ultracite: - specifier: ^7.2.3 - version: 7.2.3 + specifier: ^7.2.4 + version: 7.2.4 vite: specifier: ^7.3.1 - version: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) + version: 7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) packages: @@ -125,153 +128,145 @@ packages: '@aws-crypto/util@5.2.0': resolution: {integrity: sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==} - '@aws-sdk/client-ec2@3.995.0': - resolution: {integrity: sha512-sWvQuySZHZAuYxQhW41J/xXXV/GbB58iCWk/gET3MYvtgRbCtqpoBijgYQzv5Nw6VQpFsstgpb6Ru9ZBfjkDOA==} + '@aws-sdk/client-ec2@3.1000.0': + resolution: {integrity: sha512-SLdVSUScYXbUq2VRdKa3MloNRGnKqnmVdXkfQfJ4WyR5Lzrh1Gs6t9MXBxBMYPaFEdZhav/wMK92PSYdqLBKnA==} engines: {node: '>=20.0.0'} - '@aws-sdk/client-s3@3.995.0': - resolution: {integrity: sha512-r+t8qrQ0m9zoovYOH+wilp/glFRB/E+blsDyWzq2C+9qmyhCAQwaxjLaHM8T/uluAmhtZQIYqOH9ILRnvWtRNw==} + '@aws-sdk/client-s3@3.1000.0': + resolution: {integrity: sha512-7kPy33qNGq3NfwHC0412T6LDK1bp4+eiPzetX0sVd9cpTSXuQDKpoOFnB0Njj6uZjJDcLS3n2OeyarwwgkQ0Ow==} engines: {node: '>=20.0.0'} - '@aws-sdk/client-sso@3.993.0': - resolution: {integrity: sha512-VLUN+wIeNX24fg12SCbzTUBnBENlL014yMKZvRhPkcn4wHR6LKgNrjsG3fZ03Xs0XoKaGtNFi1VVrq666sGBoQ==} + '@aws-sdk/core@3.973.15': + resolution: {integrity: sha512-AlC0oQ1/mdJ8vCIqu524j5RB7M8i8E24bbkZmya1CuiQxkY7SdIZAyw7NDNMGaNINQFq/8oGRMX0HeOfCVsl/A==} engines: {node: '>=20.0.0'} - '@aws-sdk/core@3.973.11': - resolution: {integrity: sha512-wdQ8vrvHkKIV7yNUKXyjPWKCdYEUrZTHJ8Ojd5uJxXp9vqPCkUR1dpi1NtOLcrDgueJH7MUH5lQZxshjFPSbDA==} + '@aws-sdk/crc64-nvme@3.972.3': + resolution: {integrity: sha512-UExeK+EFiq5LAcbHm96CQLSia+5pvpUVSAsVApscBzayb7/6dJBJKwV4/onsk4VbWSmqxDMcfuTD+pC4RxgZHg==} engines: {node: '>=20.0.0'} - '@aws-sdk/crc64-nvme@3.972.0': - resolution: {integrity: sha512-ThlLhTqX68jvoIVv+pryOdb5coP1cX1/MaTbB9xkGDCbWbsqQcLqzPxuSoW1DCnAAIacmXCWpzUNOB9pv+xXQw==} + '@aws-sdk/credential-provider-env@3.972.13': + resolution: {integrity: sha512-6ljXKIQ22WFKyIs1jbORIkGanySBHaPPTOI4OxACP5WXgbcR0nDYfqNJfXEGwCK7IzHdNbCSFsNKKs0qCexR8Q==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-env@3.972.9': - resolution: {integrity: sha512-ZptrOwQynfupubvcngLkbdIq/aXvl/czdpEG8XJ8mN8Nb19BR0jaK0bR+tfuMU36Ez9q4xv7GGkHFqEEP2hUUQ==} + '@aws-sdk/credential-provider-http@3.972.15': + resolution: {integrity: sha512-dJuSTreu/T8f24SHDNTjd7eQ4rabr0TzPh2UTCwYexQtzG3nTDKm1e5eIdhiroTMDkPEJeY+WPkA6F9wod/20A==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-http@3.972.11': - resolution: {integrity: sha512-hECWoOoH386bGr89NQc9vA/abkGf5TJrMREt+lhNcnSNmoBS04fK7vc3LrJBSQAUGGVj0Tz3f4dHB3w5veovig==} + '@aws-sdk/credential-provider-ini@3.972.13': + resolution: {integrity: sha512-JKSoGb7XeabZLBJptpqoZIFbROUIS65NuQnEHGOpuT9GuuZwag2qciKANiDLFiYk4u8nSrJC9JIOnWKVvPVjeA==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-ini@3.972.9': - resolution: {integrity: sha512-zr1csEu9n4eDiHMTYJabX1mDGuGLgjgUnNckIivvk43DocJC9/f6DefFrnUPZXE+GHtbW50YuXb+JIxKykU74A==} + '@aws-sdk/credential-provider-login@3.972.13': + resolution: {integrity: sha512-RtYcrxdnJHKY8MFQGLltCURcjuMjnaQpAxPE6+/QEdDHHItMKZgabRe/KScX737F9vJMQsmJy9EmMOkCnoC1JQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-login@3.972.9': - resolution: {integrity: sha512-m4RIpVgZChv0vWS/HKChg1xLgZPpx8Z+ly9Fv7FwA8SOfuC6I3htcSaBz2Ch4bneRIiBUhwP4ziUo0UZgtJStQ==} + '@aws-sdk/credential-provider-node@3.972.14': + resolution: {integrity: sha512-WqoC2aliIjQM/L3oFf6j+op/enT2i9Cc4UTxxMEKrJNECkq4/PlKE5BOjSYFcq6G9mz65EFbXJh7zOU4CvjSKQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-node@3.972.10': - resolution: {integrity: sha512-70nCESlvnzjo4LjJ8By8MYIiBogkYPSXl3WmMZfH9RZcB/Nt9qVWbFpYj6Fk1vLa4Vk8qagFVeXgxdieMxG1QA==} + '@aws-sdk/credential-provider-process@3.972.13': + resolution: {integrity: sha512-rsRG0LQA4VR+jnDyuqtXi2CePYSmfm5GNL9KxiW8DSe25YwJSr06W8TdUfONAC+rjsTI+aIH2rBGG5FjMeANrw==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-process@3.972.9': - resolution: {integrity: sha512-gOWl0Fe2gETj5Bk151+LYKpeGi2lBDLNu+NMNpHRlIrKHdBmVun8/AalwMK8ci4uRfG5a3/+zvZBMpuen1SZ0A==} + '@aws-sdk/credential-provider-sso@3.972.13': + resolution: {integrity: sha512-fr0UU1wx8kNHDhTQBXioc/YviSW8iXuAxHvnH7eQUtn8F8o/FU3uu6EUMvAQgyvn7Ne5QFnC0Cj0BFlwCk+RFw==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-sso@3.972.9': - resolution: {integrity: sha512-ey7S686foGTArvFhi3ifQXmgptKYvLSGE2250BAQceMSXZddz7sUSNERGJT2S7u5KIe/kgugxrt01hntXVln6w==} + '@aws-sdk/credential-provider-web-identity@3.972.13': + resolution: {integrity: sha512-a6iFMh1pgUH0TdcouBppLJUfPM7Yd3R9S1xFodPtCRoLqCz2RQFA3qjA8x4112PVYXEd4/pHX2eihapq39w0rA==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-web-identity@3.972.9': - resolution: {integrity: sha512-8LnfS76nHXoEc9aRRiMMpxZxJeDG0yusdyo3NvPhCgESmBUgpMa4luhGbClW5NoX/qRcGxxM6Z/esqANSNMTow==} - engines: {node: '>=20.0.0'} - - '@aws-sdk/lib-storage@3.995.0': - resolution: {integrity: sha512-gzWRrmTVfrVfgZ8GS4VwOzHKKODcLwbgyzRW7GpVmvazBDIbvKv2HIpLwZNxxa2sjkBFDjS2NAN1bvTrCXFT6Q==} + '@aws-sdk/lib-storage@3.1000.0': + resolution: {integrity: sha512-/5KUjz08OS6ErUAaBBBXosFWcjUQJ7R9taPDYfmeKALQF4YXirS+n4/nholInOG4/8Cg89DeufqA/Ru89jC5Kw==} engines: {node: '>=20.0.0'} peerDependencies: - '@aws-sdk/client-s3': ^3.995.0 + '@aws-sdk/client-s3': ^3.1000.0 - '@aws-sdk/middleware-bucket-endpoint@3.972.3': - resolution: {integrity: sha512-fmbgWYirF67YF1GfD7cg5N6HHQ96EyRNx/rDIrTF277/zTWVuPI2qS/ZHgofwR1NZPe/NWvoppflQY01LrbVLg==} + '@aws-sdk/middleware-bucket-endpoint@3.972.6': + resolution: {integrity: sha512-3H2bhvb7Cb/S6WFsBy/Dy9q2aegC9JmGH1inO8Lb2sWirSqpLJlZmvQHPE29h2tIxzv6el/14X/tLCQ8BQU6ZQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-expect-continue@3.972.3': - resolution: {integrity: sha512-4msC33RZsXQpUKR5QR4HnvBSNCPLGHmB55oDiROqqgyOc+TOfVu2xgi5goA7ms6MdZLeEh2905UfWMnMMF4mRg==} + '@aws-sdk/middleware-expect-continue@3.972.6': + resolution: {integrity: sha512-QMdffpU+GkSGC+bz6WdqlclqIeCsOfgX8JFZ5xvwDtX+UTj4mIXm3uXu7Ko6dBseRcJz1FA6T9OmlAAY6JgJUg==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-flexible-checksums@3.972.9': - resolution: {integrity: sha512-E663+r/UQpvF3aJkD40p5ZANVQFsUcbE39jifMtN7wc0t1M0+2gJJp3i75R49aY9OiSX5lfVyPUNjN/BNRCCZA==} + '@aws-sdk/middleware-flexible-checksums@3.973.1': + resolution: {integrity: sha512-QLXsxsI6VW8LuGK+/yx699wzqP/NMCGk/hSGP+qtB+Lcff+23UlbahyouLlk+nfT7Iu021SkXBhnAuVd6IZcPw==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-host-header@3.972.3': - resolution: {integrity: sha512-aknPTb2M+G3s+0qLCx4Li/qGZH8IIYjugHMv15JTYMe6mgZO8VBpYgeGYsNMGCqCZOcWzuf900jFBG5bopfzmA==} + '@aws-sdk/middleware-host-header@3.972.6': + resolution: {integrity: sha512-5XHwjPH1lHB+1q4bfC7T8Z5zZrZXfaLcjSMwTd1HPSPrCmPFMbg3UQ5vgNWcVj0xoX4HWqTGkSf2byrjlnRg5w==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-location-constraint@3.972.3': - resolution: {integrity: sha512-nIg64CVrsXp67vbK0U1/Is8rik3huS3QkRHn2DRDx4NldrEFMgdkZGI/+cZMKD9k4YOS110Dfu21KZLHrFA/1g==} + '@aws-sdk/middleware-location-constraint@3.972.6': + resolution: {integrity: sha512-XdZ2TLwyj3Am6kvUc67vquQvs6+D8npXvXgyEUJAdkUDx5oMFJKOqpK+UpJhVDsEL068WAJl2NEGzbSik7dGJQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-logger@3.972.3': - resolution: {integrity: sha512-Ftg09xNNRqaz9QNzlfdQWfpqMCJbsQdnZVJP55jfhbKi1+FTWxGuvfPoBhDHIovqWKjqbuiew3HuhxbJ0+OjgA==} + '@aws-sdk/middleware-logger@3.972.6': + resolution: {integrity: sha512-iFnaMFMQdljAPrvsCVKYltPt2j40LQqukAbXvW7v0aL5I+1GO7bZ/W8m12WxW3gwyK5p5u1WlHg8TSAizC5cZw==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-recursion-detection@3.972.3': - resolution: {integrity: sha512-PY57QhzNuXHnwbJgbWYTrqIDHYSeOlhfYERTAuc16LKZpTZRJUjzBFokp9hF7u1fuGeE3D70ERXzdbMBOqQz7Q==} + '@aws-sdk/middleware-recursion-detection@3.972.6': + resolution: {integrity: sha512-dY4v3of5EEMvik6+UDwQ96KfUFDk8m1oZDdkSc5lwi4o7rFrjnv0A+yTV+gu230iybQZnKgDLg/rt2P3H+Vscw==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-sdk-ec2@3.972.8': - resolution: {integrity: sha512-wedzfuOKyQTj6iYM2Q3Vqop5ZLFriGzMHXM755gTcF/kZJlJ7OaTlNah70v1SdPBCXzZdT0oGRrXZNOJfe7EMA==} + '@aws-sdk/middleware-sdk-ec2@3.972.11': + resolution: {integrity: sha512-Yu1kuUlt7ElhqITICXywBZFD+c1fsvNo9W6nwhvbNco/R0PrGd2xJDkeFE38Xb37ROByvOBdbQ+DCFtxvP228A==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-sdk-s3@3.972.11': - resolution: {integrity: sha512-Qr0T7ZQTRMOuR6ahxEoJR1thPVovfWrKB2a6KBGR+a8/ELrFodrgHwhq50n+5VMaGuLtGhHiISU3XGsZmtmVXQ==} + '@aws-sdk/middleware-sdk-s3@3.972.15': + resolution: {integrity: sha512-WDLgssevOU5BFx1s8jA7jj6cE5HuImz28sy9jKOaVtz0AW1lYqSzotzdyiybFaBcQTs5zxXOb2pUfyMxgEKY3Q==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-ssec@3.972.3': - resolution: {integrity: sha512-dU6kDuULN3o3jEHcjm0c4zWJlY1zWVkjG9NPe9qxYLLpcbdj5kRYBS2DdWYD+1B9f910DezRuws7xDEqKkHQIg==} + '@aws-sdk/middleware-ssec@3.972.6': + resolution: {integrity: sha512-acvMUX9jF4I2Ew+Z/EA6gfaFaz9ehci5wxBmXCZeulLuv8m+iGf6pY9uKz8TPjg39bdAz3hxoE0eLP8Qz+IYlA==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-user-agent@3.972.11': - resolution: {integrity: sha512-R8CvPsPHXwzIHCAza+bllY6PrctEk4lYq/SkHJz9NLoBHCcKQrbOcsfXxO6xmipSbUNIbNIUhH0lBsJGgsRdiw==} + '@aws-sdk/middleware-user-agent@3.972.15': + resolution: {integrity: sha512-ABlFVcIMmuRAwBT+8q5abAxOr7WmaINirDJBnqGY5b5jSDo00UMlg/G4a0xoAgwm6oAECeJcwkvDlxDwKf58fQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/nested-clients@3.993.0': - resolution: {integrity: sha512-iOq86f2H67924kQUIPOAvlmMaOAvOLoDOIb66I2YqSUpMYB6ufiuJW3RlREgskxv86S5qKzMnfy/X6CqMjK6XQ==} + '@aws-sdk/nested-clients@3.996.3': + resolution: {integrity: sha512-AU5TY1V29xqwg/MxmA2odwysTez+ccFAhmfRJk+QZT5HNv90UTA9qKd1J9THlsQkvmH7HWTEV1lDNxkQO5PzNw==} engines: {node: '>=20.0.0'} - '@aws-sdk/region-config-resolver@3.972.3': - resolution: {integrity: sha512-v4J8qYAWfOMcZ4MJUyatntOicTzEMaU7j3OpkRCGGFSL2NgXQ5VbxauIyORA+pxdKZ0qQG2tCQjQjZDlXEC3Ow==} + '@aws-sdk/region-config-resolver@3.972.6': + resolution: {integrity: sha512-Aa5PusHLXAqLTX1UKDvI3pHQJtIsF7Q+3turCHqfz/1F61/zDMWfbTC8evjhrrYVAtz9Vsv3SJ/waSUeu7B6gw==} engines: {node: '>=20.0.0'} - '@aws-sdk/signature-v4-multi-region@3.995.0': - resolution: {integrity: sha512-9Qx5JcAucnxnomREPb2D6L8K8GLG0rknt3+VK/BU3qTUynAcV4W21DQ04Z2RKDw+DYpW88lsZpXbVetWST2WUg==} + '@aws-sdk/signature-v4-multi-region@3.996.3': + resolution: {integrity: sha512-gQYI/Buwp0CAGQxY7mR5VzkP56rkWq2Y1ROkFuXh5XY94DsSjJw62B3I0N0lysQmtwiL2ht2KHI9NylM/RP4FA==} engines: {node: '>=20.0.0'} - '@aws-sdk/token-providers@3.993.0': - resolution: {integrity: sha512-+35g4c+8r7sB9Sjp1KPdM8qxGn6B/shBjJtEUN4e+Edw9UEQlZKIzioOGu3UAbyE0a/s450LdLZr4wbJChtmww==} + '@aws-sdk/token-providers@3.999.0': + resolution: {integrity: sha512-cx0hHUlgXULfykx4rdu/ciNAJaa3AL5xz3rieCz7NKJ68MJwlj3664Y8WR5MGgxfyYJBdamnkjNSx5Kekuc0cg==} engines: {node: '>=20.0.0'} - '@aws-sdk/types@3.973.1': - resolution: {integrity: sha512-DwHBiMNOB468JiX6+i34c+THsKHErYUdNQ3HexeXZvVn4zouLjgaS4FejiGSi2HyBuzuyHg7SuOPmjSvoU9NRg==} + '@aws-sdk/types@3.973.4': + resolution: {integrity: sha512-RW60aH26Bsc016Y9B98hC0Plx6fK5P2v/iQYwMzrSjiDh1qRMUCP6KrXHYEHe3uFvKiOC93Z9zk4BJsUi6Tj1Q==} engines: {node: '>=20.0.0'} '@aws-sdk/util-arn-parser@3.972.2': resolution: {integrity: sha512-VkykWbqMjlSgBFDyrY3nOSqupMc6ivXuGmvci6Q3NnLq5kC+mKQe2QBZ4nrWRE/jqOxeFP2uYzLtwncYYcvQDg==} engines: {node: '>=20.0.0'} - '@aws-sdk/util-endpoints@3.993.0': - resolution: {integrity: sha512-j6vioBeRZ4eHX4SWGvGPpwGg/xSOcK7f1GL0VM+rdf3ZFTIsUEhCFmD78B+5r2PgztcECSzEfvHQX01k8dPQPw==} + '@aws-sdk/util-endpoints@3.996.3': + resolution: {integrity: sha512-yWIQSNiCjykLL+ezN5A+DfBb1gfXTytBxm57e64lYmwxDHNmInYHRJYYRAGWG1o77vKEiWaw4ui28e3yb1k5aQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/util-endpoints@3.995.0': - resolution: {integrity: sha512-aym/pjB8SLbo9w2nmkrDdAAVKVlf7CM71B9mKhjDbJTzwpSFBPHqJIMdDyj0mLumKC0aIVDr1H6U+59m9GvMFw==} - engines: {node: '>=20.0.0'} - - '@aws-sdk/util-format-url@3.972.3': - resolution: {integrity: sha512-n7F2ycckcKFXa01vAsT/SJdjFHfKH9s96QHcs5gn8AaaigASICeME8WdUL9uBp8XV/OVwEt8+6gzn6KFUgQa8g==} + '@aws-sdk/util-format-url@3.972.6': + resolution: {integrity: sha512-0YNVNgFyziCejXJx0rzxPiD2rkxTWco4c9wiMF6n37Tb9aQvIF8+t7GyEyIFCwQHZ0VMQaAl+nCZHOYz5I5EKw==} engines: {node: '>=20.0.0'} '@aws-sdk/util-locate-window@3.965.4': resolution: {integrity: sha512-H1onv5SkgPBK2P6JR2MjGgbOnttoNzSPIRoeZTNPZYyaplwGg50zS3amXvXqF0/qfXpWEC9rLWU564QTB9bSog==} engines: {node: '>=20.0.0'} - '@aws-sdk/util-user-agent-browser@3.972.3': - resolution: {integrity: sha512-JurOwkRUcXD/5MTDBcqdyQ9eVedtAsZgw5rBwktsPTN7QtPiS2Ld1jkJepNgYoCufz1Wcut9iup7GJDoIHp8Fw==} + '@aws-sdk/util-user-agent-browser@3.972.6': + resolution: {integrity: sha512-Fwr/llD6GOrFgQnKaI2glhohdGuBDfHfora6iG9qsBBBR8xv1SdCSwbtf5CWlUdCw5X7g76G/9Hf0Inh0EmoxA==} - '@aws-sdk/util-user-agent-node@3.972.10': - resolution: {integrity: sha512-LVXzICPlsheET+sE6tkcS47Q5HkSTrANIlqL1iFxGAY/wRQ236DX/PCAK56qMh9QJoXAfXfoRW0B0Og4R+X7Nw==} + '@aws-sdk/util-user-agent-node@3.973.0': + resolution: {integrity: sha512-A9J2G4Nf236e9GpaC1JnA8wRn6u6GjnOXiTwBLA6NUJhlBTIGfrTy+K1IazmF8y+4OFdW3O5TZlhyspJMqiqjA==} engines: {node: '>=20.0.0'} peerDependencies: aws-crt: '>=1.0.0' @@ -279,8 +274,8 @@ packages: aws-crt: optional: true - '@aws-sdk/xml-builder@3.972.5': - resolution: {integrity: sha512-mCae5Ys6Qm1LDu0qdGwx2UQ63ONUe+FHw908fJzLDqFKTDBK4LDZUqKWm4OkTCNFq19bftjsBSESIGLD/s3/rA==} + '@aws-sdk/xml-builder@3.972.8': + resolution: {integrity: sha512-Ql8elcUdYCha83Ol7NznBsgN5GVZnv3vUd86fEc6waU6oUdY0T1O9NODkEEOS/Uaogr87avDrUC6DSeM4oXjZg==} engines: {node: '>=20.0.0'} '@aws/lambda-invoke-store@0.2.3': @@ -671,426 +666,426 @@ packages: '@rolldown/pluginutils@1.0.0-rc.3': resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==} - '@rollup/rollup-android-arm-eabi@4.58.0': - resolution: {integrity: sha512-mr0tmS/4FoVk1cnaeN244A/wjvGDNItZKR8hRhnmCzygyRXYtKF5jVDSIILR1U97CTzAYmbgIj/Dukg62ggG5w==} + '@rollup/rollup-android-arm-eabi@4.59.0': + resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.58.0': - resolution: {integrity: sha512-+s++dbp+/RTte62mQD9wLSbiMTV+xr/PeRJEc/sFZFSBRlHPNPVaf5FXlzAL77Mr8FtSfQqCN+I598M8U41ccQ==} + '@rollup/rollup-android-arm64@4.59.0': + resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.58.0': - resolution: {integrity: sha512-MFWBwTcYs0jZbINQBXHfSrpSQJq3IUOakcKPzfeSznONop14Pxuqa0Kg19GD0rNBMPQI2tFtu3UzapZpH0Uc1Q==} + '@rollup/rollup-darwin-arm64@4.59.0': + resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.58.0': - resolution: {integrity: sha512-yiKJY7pj9c9JwzuKYLFaDZw5gma3fI9bkPEIyofvVfsPqjCWPglSHdpdwXpKGvDeYDms3Qal8qGMEHZ1M/4Udg==} + '@rollup/rollup-darwin-x64@4.59.0': + resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.58.0': - resolution: {integrity: sha512-x97kCoBh5MOevpn/CNK9W1x8BEzO238541BGWBc315uOlN0AD/ifZ1msg+ZQB05Ux+VF6EcYqpiagfLJ8U3LvQ==} + '@rollup/rollup-freebsd-arm64@4.59.0': + resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.58.0': - resolution: {integrity: sha512-Aa8jPoZ6IQAG2eIrcXPpjRcMjROMFxCt1UYPZZtCxRV68WkuSigYtQ/7Zwrcr2IvtNJo7T2JfDXyMLxq5L4Jlg==} + '@rollup/rollup-freebsd-x64@4.59.0': + resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.58.0': - resolution: {integrity: sha512-Ob8YgT5kD/lSIYW2Rcngs5kNB/44Q2RzBSPz9brf2WEtcGR7/f/E9HeHn1wYaAwKBni+bdXEwgHvUd0x12lQSA==} + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.58.0': - resolution: {integrity: sha512-K+RI5oP1ceqoadvNt1FecL17Qtw/n9BgRSzxif3rTL2QlIu88ccvY+Y9nnHe/cmT5zbH9+bpiJuG1mGHRVwF4Q==} + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.58.0': - resolution: {integrity: sha512-T+17JAsCKUjmbopcKepJjHWHXSjeW7O5PL7lEFaeQmiVyw4kkc5/lyYKzrv6ElWRX/MrEWfPiJWqbTvfIvjM1Q==} + '@rollup/rollup-linux-arm64-gnu@4.59.0': + resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.58.0': - resolution: {integrity: sha512-cCePktb9+6R9itIJdeCFF9txPU7pQeEHB5AbHu/MKsfH/k70ZtOeq1k4YAtBv9Z7mmKI5/wOLYjQ+B9QdxR6LA==} + '@rollup/rollup-linux-arm64-musl@4.59.0': + resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.58.0': - resolution: {integrity: sha512-iekUaLkfliAsDl4/xSdoCJ1gnnIXvoNz85C8U8+ZxknM5pBStfZjeXgB8lXobDQvvPRCN8FPmmuTtH+z95HTmg==} + '@rollup/rollup-linux-loong64-gnu@4.59.0': + resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.58.0': - resolution: {integrity: sha512-68ofRgJNl/jYJbxFjCKE7IwhbfxOl1muPN4KbIqAIe32lm22KmU7E8OPvyy68HTNkI2iV/c8y2kSPSm2mW/Q9Q==} + '@rollup/rollup-linux-loong64-musl@4.59.0': + resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.58.0': - resolution: {integrity: sha512-dpz8vT0i+JqUKuSNPCP5SYyIV2Lh0sNL1+FhM7eLC457d5B9/BC3kDPp5BBftMmTNsBarcPcoz5UGSsnCiw4XQ==} + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.58.0': - resolution: {integrity: sha512-4gdkkf9UJ7tafnweBCR/mk4jf3Jfl0cKX9Np80t5i78kjIH0ZdezUv/JDI2VtruE5lunfACqftJ8dIMGN4oHew==} + '@rollup/rollup-linux-ppc64-musl@4.59.0': + resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.58.0': - resolution: {integrity: sha512-YFS4vPnOkDTD/JriUeeZurFYoJhPf9GQQEF/v4lltp3mVcBmnsAdjEWhr2cjUCZzZNzxCG0HZOvJU44UGHSdzw==} + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.58.0': - resolution: {integrity: sha512-x2xgZlFne+QVNKV8b4wwaCS8pwq3y14zedZ5DqLzjdRITvreBk//4Knbcvm7+lWmms9V9qFp60MtUd0/t/PXPw==} + '@rollup/rollup-linux-riscv64-musl@4.59.0': + resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.58.0': - resolution: {integrity: sha512-jIhrujyn4UnWF8S+DHSkAkDEO3hLX0cjzxJZPLF80xFyzyUIYgSMRcYQ3+uqEoyDD2beGq7Dj7edi8OnJcS/hg==} + '@rollup/rollup-linux-s390x-gnu@4.59.0': + resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.58.0': - resolution: {integrity: sha512-+410Srdoh78MKSJxTQ+hZ/Mx+ajd6RjjPwBPNd0R3J9FtL6ZA0GqiiyNjCO9In0IzZkCNrpGymSfn+kgyPQocg==} + '@rollup/rollup-linux-x64-gnu@4.59.0': + resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.58.0': - resolution: {integrity: sha512-ZjMyby5SICi227y1MTR3VYBpFTdZs823Rs/hpakufleBoufoOIB6jtm9FEoxn/cgO7l6PM2rCEl5Kre5vX0QrQ==} + '@rollup/rollup-linux-x64-musl@4.59.0': + resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.58.0': - resolution: {integrity: sha512-ds4iwfYkSQ0k1nb8LTcyXw//ToHOnNTJtceySpL3fa7tc/AsE+UpUFphW126A6fKBGJD5dhRvg8zw1rvoGFxmw==} + '@rollup/rollup-openbsd-x64@4.59.0': + resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.58.0': - resolution: {integrity: sha512-fd/zpJniln4ICdPkjWFhZYeY/bpnaN9pGa6ko+5WD38I0tTqk9lXMgXZg09MNdhpARngmxiCg0B0XUamNw/5BQ==} + '@rollup/rollup-openharmony-arm64@4.59.0': + resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.58.0': - resolution: {integrity: sha512-YpG8dUOip7DCz3nr/JUfPbIUo+2d/dy++5bFzgi4ugOGBIox+qMbbqt/JoORwvI/C9Kn2tz6+Bieoqd5+B1CjA==} + '@rollup/rollup-win32-arm64-msvc@4.59.0': + resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.58.0': - resolution: {integrity: sha512-b9DI8jpFQVh4hIXFr0/+N/TzLdpBIoPzjt0Rt4xJbW3mzguV3mduR9cNgiuFcuL/TeORejJhCWiAXe3E/6PxWA==} + '@rollup/rollup-win32-ia32-msvc@4.59.0': + resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.58.0': - resolution: {integrity: sha512-CSrVpmoRJFN06LL9xhkitkwUcTZtIotYAF5p6XOR2zW0Zz5mzb3IPpcoPhB02frzMHFNo1reQ9xSF5fFm3hUsQ==} + '@rollup/rollup-win32-x64-gnu@4.59.0': + resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.58.0': - resolution: {integrity: sha512-QFsBgQNTnh5K0t/sBsjJLq24YVqEIVkGpfN2VHsnN90soZyhaiA9UUHufcctVNL4ypJY0wrwad0wslx2KJQ1/w==} + '@rollup/rollup-win32-x64-msvc@4.59.0': + resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} cpu: [x64] os: [win32] - '@smithy/abort-controller@4.2.8': - resolution: {integrity: sha512-peuVfkYHAmS5ybKxWcfraK7WBBP0J+rkfUcbHJJKQ4ir3UAUNQI+Y4Vt/PqSzGqgloJ5O1dk7+WzNL8wcCSXbw==} + '@smithy/abort-controller@4.2.10': + resolution: {integrity: sha512-qocxM/X4XGATqQtUkbE9SPUB6wekBi+FyJOMbPj0AhvyvFGYEmOlz6VB22iMePCQsFmMIvFSeViDvA7mZJG47g==} engines: {node: '>=18.0.0'} - '@smithy/chunked-blob-reader-native@4.2.1': - resolution: {integrity: sha512-lX9Ay+6LisTfpLid2zZtIhSEjHMZoAR5hHCR4H7tBz/Zkfr5ea8RcQ7Tk4mi0P76p4cN+Btz16Ffno7YHpKXnQ==} + '@smithy/chunked-blob-reader-native@4.2.2': + resolution: {integrity: sha512-QzzYIlf4yg0w5TQaC9VId3B3ugSk1MI/wb7tgcHtd7CBV9gNRKZrhc2EPSxSZuDy10zUZ0lomNMgkc6/VVe8xg==} engines: {node: '>=18.0.0'} - '@smithy/chunked-blob-reader@5.2.0': - resolution: {integrity: sha512-WmU0TnhEAJLWvfSeMxBNe5xtbselEO8+4wG0NtZeL8oR21WgH1xiO37El+/Y+H/Ie4SCwBy3MxYWmOYaGgZueA==} + '@smithy/chunked-blob-reader@5.2.1': + resolution: {integrity: sha512-y5d4xRiD6TzeP5BWlb+Ig/VFqF+t9oANNhGeMqyzU7obw7FYgTgVi50i5JqBTeKp+TABeDIeeXFZdz65RipNtA==} engines: {node: '>=18.0.0'} - '@smithy/config-resolver@4.4.6': - resolution: {integrity: sha512-qJpzYC64kaj3S0fueiu3kXm8xPrR3PcXDPEgnaNMRn0EjNSZFoFjvbUp0YUDsRhN1CB90EnHJtbxWKevnH99UQ==} + '@smithy/config-resolver@4.4.9': + resolution: {integrity: sha512-ejQvXqlcU30h7liR9fXtj7PIAau1t/sFbJpgWPfiYDs7zd16jpH0IsSXKcba2jF6ChTXvIjACs27kNMc5xxE2Q==} engines: {node: '>=18.0.0'} - '@smithy/core@3.23.2': - resolution: {integrity: sha512-HaaH4VbGie4t0+9nY3tNBRSxVTr96wzIqexUa6C2qx3MPePAuz7lIxPxYtt1Wc//SPfJLNoZJzfdt0B6ksj2jA==} + '@smithy/core@3.23.6': + resolution: {integrity: sha512-4xE+0L2NrsFKpEVFlFELkIHQddBvMbQ41LRIP74dGCXnY1zQ9DgksrBcRBDJT+iOzGy4VEJIeU3hkUK5mn06kg==} engines: {node: '>=18.0.0'} - '@smithy/credential-provider-imds@4.2.8': - resolution: {integrity: sha512-FNT0xHS1c/CPN8upqbMFP83+ul5YgdisfCfkZ86Jh2NSmnqw/AJ6x5pEogVCTVvSm7j9MopRU89bmDelxuDMYw==} + '@smithy/credential-provider-imds@4.2.10': + resolution: {integrity: sha512-3bsMLJJLTZGZqVGGeBVFfLzuRulVsGTj12BzRKODTHqUABpIr0jMN1vN3+u6r2OfyhAQ2pXaMZWX/swBK5I6PQ==} engines: {node: '>=18.0.0'} - '@smithy/eventstream-codec@4.2.8': - resolution: {integrity: sha512-jS/O5Q14UsufqoGhov7dHLOPCzkYJl9QDzusI2Psh4wyYx/izhzvX9P4D69aTxcdfVhEPhjK+wYyn/PzLjKbbw==} + '@smithy/eventstream-codec@4.2.10': + resolution: {integrity: sha512-A4ynrsFFfSXUHicfTcRehytppFBcY3HQxEGYiyGktPIOye3Ot7fxpiy4VR42WmtGI4Wfo6OXt/c1Ky1nUFxYYQ==} engines: {node: '>=18.0.0'} - '@smithy/eventstream-serde-browser@4.2.8': - resolution: {integrity: sha512-MTfQT/CRQz5g24ayXdjg53V0mhucZth4PESoA5IhvaWVDTOQLfo8qI9vzqHcPsdd2v6sqfTYqF5L/l+pea5Uyw==} + '@smithy/eventstream-serde-browser@4.2.10': + resolution: {integrity: sha512-0xupsu9yj9oDVuQ50YCTS9nuSYhGlrwqdaKQel9y2Fz7LU9fNErVlw9N0o4pm4qqvWEGbSTI4HKc6XJfB30MVw==} engines: {node: '>=18.0.0'} - '@smithy/eventstream-serde-config-resolver@4.3.8': - resolution: {integrity: sha512-ah12+luBiDGzBruhu3efNy1IlbwSEdNiw8fOZksoKoWW1ZHvO/04MQsdnws/9Aj+5b0YXSSN2JXKy/ClIsW8MQ==} + '@smithy/eventstream-serde-config-resolver@4.3.10': + resolution: {integrity: sha512-8kn6sinrduk0yaYHMJDsNuiFpXwQwibR7n/4CDUqn4UgaG+SeBHu5jHGFdU9BLFAM7Q4/gvr9RYxBHz9/jKrhA==} engines: {node: '>=18.0.0'} - '@smithy/eventstream-serde-node@4.2.8': - resolution: {integrity: sha512-cYpCpp29z6EJHa5T9WL0KAlq3SOKUQkcgSoeRfRVwjGgSFl7Uh32eYGt7IDYCX20skiEdRffyDpvF2efEZPC0A==} + '@smithy/eventstream-serde-node@4.2.10': + resolution: {integrity: sha512-uUrxPGgIffnYfvIOUmBM5i+USdEBRTdh7mLPttjphgtooxQ8CtdO1p6K5+Q4BBAZvKlvtJ9jWyrWpBJYzBKsyQ==} engines: {node: '>=18.0.0'} - '@smithy/eventstream-serde-universal@4.2.8': - resolution: {integrity: sha512-iJ6YNJd0bntJYnX6s52NC4WFYcZeKrPUr1Kmmr5AwZcwCSzVpS7oavAmxMR7pMq7V+D1G4s9F5NJK0xwOsKAlQ==} + '@smithy/eventstream-serde-universal@4.2.10': + resolution: {integrity: sha512-aArqzOEvcs2dK+xQVCgLbpJQGfZihw8SD4ymhkwNTtwKbnrzdhJsFDKuMQnam2kF69WzgJYOU5eJlCx+CA32bw==} engines: {node: '>=18.0.0'} - '@smithy/fetch-http-handler@5.3.9': - resolution: {integrity: sha512-I4UhmcTYXBrct03rwzQX1Y/iqQlzVQaPxWjCjula++5EmWq9YGBrx6bbGqluGc1f0XEfhSkiY4jhLgbsJUMKRA==} + '@smithy/fetch-http-handler@5.3.11': + resolution: {integrity: sha512-wbTRjOxdFuyEg0CpumjZO0hkUl+fetJFqxNROepuLIoijQh51aMBmzFLfoQdwRjxsuuS2jizzIUTjPWgd8pd7g==} engines: {node: '>=18.0.0'} - '@smithy/hash-blob-browser@4.2.9': - resolution: {integrity: sha512-m80d/iicI7DlBDxyQP6Th7BW/ejDGiF0bgI754+tiwK0lgMkcaIBgvwwVc7OFbY4eUzpGtnig52MhPAEJ7iNYg==} + '@smithy/hash-blob-browser@4.2.11': + resolution: {integrity: sha512-DrcAx3PM6AEbWZxsKl6CWAGnVwiz28Wp1ZhNu+Hi4uI/6C1PIZBIaPM2VoqBDAsOWbM6ZVzOEQMxFLLdmb4eBQ==} engines: {node: '>=18.0.0'} - '@smithy/hash-node@4.2.8': - resolution: {integrity: sha512-7ZIlPbmaDGxVoxErDZnuFG18WekhbA/g2/i97wGj+wUBeS6pcUeAym8u4BXh/75RXWhgIJhyC11hBzig6MljwA==} + '@smithy/hash-node@4.2.10': + resolution: {integrity: sha512-1VzIOI5CcsvMDvP3iv1vG/RfLJVVVc67dCRyLSB2Hn9SWCZrDO3zvcIzj3BfEtqRW5kcMg5KAeVf1K3dR6nD3w==} engines: {node: '>=18.0.0'} - '@smithy/hash-stream-node@4.2.8': - resolution: {integrity: sha512-v0FLTXgHrTeheYZFGhR+ehX5qUm4IQsjAiL9qehad2cyjMWcN2QG6/4mSwbSgEQzI7jwfoXj7z4fxZUx/Mhj2w==} + '@smithy/hash-stream-node@4.2.10': + resolution: {integrity: sha512-w78xsYrOlwXKwN5tv1GnKIRbHb1HygSpeZMP6xDxCPGf1U/xDHjCpJu64c5T35UKyEPwa0bPeIcvU69VY3khUA==} engines: {node: '>=18.0.0'} - '@smithy/invalid-dependency@4.2.8': - resolution: {integrity: sha512-N9iozRybwAQ2dn9Fot9kI6/w9vos2oTXLhtK7ovGqwZjlOcxu6XhPlpLpC+INsxktqHinn5gS2DXDjDF2kG5sQ==} + '@smithy/invalid-dependency@4.2.10': + resolution: {integrity: sha512-vy9KPNSFUU0ajFYk0sDZIYiUlAWGEAhRfehIr5ZkdFrRFTAuXEPUd41USuqHU6vvLX4r6Q9X7MKBco5+Il0Org==} engines: {node: '>=18.0.0'} '@smithy/is-array-buffer@2.2.0': resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} engines: {node: '>=14.0.0'} - '@smithy/is-array-buffer@4.2.0': - resolution: {integrity: sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==} + '@smithy/is-array-buffer@4.2.1': + resolution: {integrity: sha512-Yfu664Qbf1B4IYIsYgKoABt010daZjkaCRvdU/sPnZG6TtHOB0md0RjNdLGzxe5UIdn9js4ftPICzmkRa9RJ4Q==} engines: {node: '>=18.0.0'} - '@smithy/md5-js@4.2.8': - resolution: {integrity: sha512-oGMaLj4tVZzLi3itBa9TCswgMBr7k9b+qKYowQ6x1rTyTuO1IU2YHdHUa+891OsOH+wCsH7aTPRsTJO3RMQmjQ==} + '@smithy/md5-js@4.2.10': + resolution: {integrity: sha512-Op+Dh6dPLWTjWITChFayDllIaCXRofOed8ecpggTC5fkh8yXes0vAEX7gRUfjGK+TlyxoCAA05gHbZW/zB9JwQ==} engines: {node: '>=18.0.0'} - '@smithy/middleware-content-length@4.2.8': - resolution: {integrity: sha512-RO0jeoaYAB1qBRhfVyq0pMgBoUK34YEJxVxyjOWYZiOKOq2yMZ4MnVXMZCUDenpozHue207+9P5ilTV1zeda0A==} + '@smithy/middleware-content-length@4.2.10': + resolution: {integrity: sha512-TQZ9kX5c6XbjhaEBpvhSvMEZ0klBs1CFtOdPFwATZSbC9UeQfKHPLPN9Y+I6wZGMOavlYTOlHEPDrt42PMSH9w==} engines: {node: '>=18.0.0'} - '@smithy/middleware-endpoint@4.4.16': - resolution: {integrity: sha512-L5GICFCSsNhbJ5JSKeWFGFy16Q2OhoBizb3X2DrxaJwXSEujVvjG9Jt386dpQn2t7jINglQl0b4K/Su69BdbMA==} + '@smithy/middleware-endpoint@4.4.20': + resolution: {integrity: sha512-9W6Np4ceBP3XCYAGLoMCmn8t2RRVzuD1ndWPLBbv7H9CrwM9Bprf6Up6BM9ZA/3alodg0b7Kf6ftBK9R1N04vw==} engines: {node: '>=18.0.0'} - '@smithy/middleware-retry@4.4.33': - resolution: {integrity: sha512-jLqZOdJhtIL4lnA9hXnAG6GgnJlo1sD3FqsTxm9wSfjviqgWesY/TMBVnT84yr4O0Vfe0jWoXlfFbzsBVph3WA==} + '@smithy/middleware-retry@4.4.37': + resolution: {integrity: sha512-/1psZZllBBSQ7+qo5+hhLz7AEPGLx3Z0+e3ramMBEuPK2PfvLK4SrncDB9VegX5mBn+oP/UTDrM6IHrFjvX1ZA==} engines: {node: '>=18.0.0'} - '@smithy/middleware-serde@4.2.9': - resolution: {integrity: sha512-eMNiej0u/snzDvlqRGSN3Vl0ESn3838+nKyVfF2FKNXFbi4SERYT6PR392D39iczngbqqGG0Jl1DlCnp7tBbXQ==} + '@smithy/middleware-serde@4.2.11': + resolution: {integrity: sha512-STQdONGPwbbC7cusL60s7vOa6He6A9w2jWhoapL0mgVjmR19pr26slV+yoSP76SIssMTX/95e5nOZ6UQv6jolg==} engines: {node: '>=18.0.0'} - '@smithy/middleware-stack@4.2.8': - resolution: {integrity: sha512-w6LCfOviTYQjBctOKSwy6A8FIkQy7ICvglrZFl6Bw4FmcQ1Z420fUtIhxaUZZshRe0VCq4kvDiPiXrPZAe8oRA==} + '@smithy/middleware-stack@4.2.10': + resolution: {integrity: sha512-pmts/WovNcE/tlyHa8z/groPeOtqtEpp61q3W0nW1nDJuMq/x+hWa/OVQBtgU0tBqupeXq0VBOLA4UZwE8I0YA==} engines: {node: '>=18.0.0'} - '@smithy/node-config-provider@4.3.8': - resolution: {integrity: sha512-aFP1ai4lrbVlWjfpAfRSL8KFcnJQYfTl5QxLJXY32vghJrDuFyPZ6LtUL+JEGYiFRG1PfPLHLoxj107ulncLIg==} + '@smithy/node-config-provider@4.3.10': + resolution: {integrity: sha512-UALRbJtVX34AdP2VECKVlnNgidLHA2A7YgcJzwSBg1hzmnO/bZBHl/LDQQyYifzUwp1UOODnl9JJ3KNawpUJ9w==} engines: {node: '>=18.0.0'} - '@smithy/node-http-handler@4.4.10': - resolution: {integrity: sha512-u4YeUwOWRZaHbWaebvrs3UhwQwj+2VNmcVCwXcYTvPIuVyM7Ex1ftAj+fdbG/P4AkBwLq/+SKn+ydOI4ZJE9PA==} + '@smithy/node-http-handler@4.4.12': + resolution: {integrity: sha512-zo1+WKJkR9x7ZtMeMDAAsq2PufwiLDmkhcjpWPRRkmeIuOm6nq1qjFICSZbnjBvD09ei8KMo26BWxsu2BUU+5w==} engines: {node: '>=18.0.0'} - '@smithy/property-provider@4.2.8': - resolution: {integrity: sha512-EtCTbyIveCKeOXDSWSdze3k612yCPq1YbXsbqX3UHhkOSW8zKsM9NOJG5gTIya0vbY2DIaieG8pKo1rITHYL0w==} + '@smithy/property-provider@4.2.10': + resolution: {integrity: sha512-5jm60P0CU7tom0eNrZ7YrkgBaoLFXzmqB0wVS+4uK8PPGmosSrLNf6rRd50UBvukztawZ7zyA8TxlrKpF5z9jw==} engines: {node: '>=18.0.0'} - '@smithy/protocol-http@5.3.8': - resolution: {integrity: sha512-QNINVDhxpZ5QnP3aviNHQFlRogQZDfYlCkQT+7tJnErPQbDhysondEjhikuANxgMsZrkGeiAxXy4jguEGsDrWQ==} + '@smithy/protocol-http@5.3.10': + resolution: {integrity: sha512-2NzVWpYY0tRdfeCJLsgrR89KE3NTWT2wGulhNUxYlRmtRmPwLQwKzhrfVaiNlA9ZpJvbW7cjTVChYKgnkqXj1A==} engines: {node: '>=18.0.0'} - '@smithy/querystring-builder@4.2.8': - resolution: {integrity: sha512-Xr83r31+DrE8CP3MqPgMJl+pQlLLmOfiEUnoyAlGzzJIrEsbKsPy1hqH0qySaQm4oWrCBlUqRt+idEgunKB+iw==} + '@smithy/querystring-builder@4.2.10': + resolution: {integrity: sha512-HeN7kEvuzO2DmAzLukE9UryiUvejD3tMp9a1D1NJETerIfKobBUCLfviP6QEk500166eD2IATaXM59qgUI+YDA==} engines: {node: '>=18.0.0'} - '@smithy/querystring-parser@4.2.8': - resolution: {integrity: sha512-vUurovluVy50CUlazOiXkPq40KGvGWSdmusa3130MwrR1UNnNgKAlj58wlOe61XSHRpUfIIh6cE0zZ8mzKaDPA==} + '@smithy/querystring-parser@4.2.10': + resolution: {integrity: sha512-4Mh18J26+ao1oX5wXJfWlTT+Q1OpDR8ssiC9PDOuEgVBGloqg18Fw7h5Ct8DyT9NBYwJgtJ2nLjKKFU6RP1G1Q==} engines: {node: '>=18.0.0'} - '@smithy/service-error-classification@4.2.8': - resolution: {integrity: sha512-mZ5xddodpJhEt3RkCjbmUQuXUOaPNTkbMGR0bcS8FE0bJDLMZlhmpgrvPNCYglVw5rsYTpSnv19womw9WWXKQQ==} + '@smithy/service-error-classification@4.2.10': + resolution: {integrity: sha512-0R/+/Il5y8nB/By90o8hy/bWVYptbIfvoTYad0igYQO5RefhNCDmNzqxaMx7K1t/QWo0d6UynqpqN5cCQt1MCg==} engines: {node: '>=18.0.0'} - '@smithy/shared-ini-file-loader@4.4.3': - resolution: {integrity: sha512-DfQjxXQnzC5UbCUPeC3Ie8u+rIWZTvuDPAGU/BxzrOGhRvgUanaP68kDZA+jaT3ZI+djOf+4dERGlm9mWfFDrg==} + '@smithy/shared-ini-file-loader@4.4.5': + resolution: {integrity: sha512-pHgASxl50rrtOztgQCPmOXFjRW+mCd7ALr/3uXNzRrRoGV5G2+78GOsQ3HlQuBVHCh9o6xqMNvlIKZjWn4Euug==} engines: {node: '>=18.0.0'} - '@smithy/signature-v4@5.3.8': - resolution: {integrity: sha512-6A4vdGj7qKNRF16UIcO8HhHjKW27thsxYci+5r/uVRkdcBEkOEiY8OMPuydLX4QHSrJqGHPJzPRwwVTqbLZJhg==} + '@smithy/signature-v4@5.3.10': + resolution: {integrity: sha512-Wab3wW8468WqTKIxI+aZe3JYO52/RYT/8sDOdzkUhjnLakLe9qoQqIcfih/qxcF4qWEFoWBszY0mj5uxffaVXA==} engines: {node: '>=18.0.0'} - '@smithy/smithy-client@4.11.5': - resolution: {integrity: sha512-xixwBRqoeP2IUgcAl3U9dvJXc+qJum4lzo3maaJxifsZxKUYLfVfCXvhT4/jD01sRrHg5zjd1cw2Zmjr4/SuKQ==} + '@smithy/smithy-client@4.12.0': + resolution: {integrity: sha512-R8bQ9K3lCcXyZmBnQqUZJF4ChZmtWT5NLi6x5kgWx5D+/j0KorXcA0YcFg/X5TOgnTCy1tbKc6z2g2y4amFupQ==} engines: {node: '>=18.0.0'} - '@smithy/types@4.12.0': - resolution: {integrity: sha512-9YcuJVTOBDjg9LWo23Qp0lTQ3D7fQsQtwle0jVfpbUHy9qBwCEgKuVH4FqFB3VYu0nwdHKiEMA+oXz7oV8X1kw==} + '@smithy/types@4.13.0': + resolution: {integrity: sha512-COuLsZILbbQsdrwKQpkkpyep7lCsByxwj7m0Mg5v66/ZTyenlfBc40/QFQ5chO0YN/PNEH1Bi3fGtfXPnYNeDw==} engines: {node: '>=18.0.0'} - '@smithy/url-parser@4.2.8': - resolution: {integrity: sha512-NQho9U68TGMEU639YkXnVMV3GEFFULmmaWdlu1E9qzyIePOHsoSnagTGSDv1Zi8DCNN6btxOSdgmy5E/hsZwhA==} + '@smithy/url-parser@4.2.10': + resolution: {integrity: sha512-uypjF7fCDsRk26u3qHmFI/ePL7bxxB9vKkE+2WKEciHhz+4QtbzWiHRVNRJwU3cKhrYDYQE3b0MRFtqfLYdA4A==} engines: {node: '>=18.0.0'} - '@smithy/util-base64@4.3.0': - resolution: {integrity: sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==} + '@smithy/util-base64@4.3.1': + resolution: {integrity: sha512-BKGuawX4Doq/bI/uEmg+Zyc36rJKWuin3py89PquXBIBqmbnJwBBsmKhdHfNEp0+A4TDgLmT/3MSKZ1SxHcR6w==} engines: {node: '>=18.0.0'} - '@smithy/util-body-length-browser@4.2.0': - resolution: {integrity: sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==} + '@smithy/util-body-length-browser@4.2.1': + resolution: {integrity: sha512-SiJeLiozrAoCrgDBUgsVbmqHmMgg/2bA15AzcbcW+zan7SuyAVHN4xTSbq0GlebAIwlcaX32xacnrG488/J/6g==} engines: {node: '>=18.0.0'} - '@smithy/util-body-length-node@4.2.1': - resolution: {integrity: sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==} + '@smithy/util-body-length-node@4.2.2': + resolution: {integrity: sha512-4rHqBvxtJEBvsZcFQSPQqXP2b/yy/YlB66KlcEgcH2WNoOKCKB03DSLzXmOsXjbl8dJ4OEYTn31knhdznwk7zw==} engines: {node: '>=18.0.0'} '@smithy/util-buffer-from@2.2.0': resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} engines: {node: '>=14.0.0'} - '@smithy/util-buffer-from@4.2.0': - resolution: {integrity: sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==} + '@smithy/util-buffer-from@4.2.1': + resolution: {integrity: sha512-/swhmt1qTiVkaejlmMPPDgZhEaWb/HWMGRBheaxwuVkusp/z+ErJyQxO6kaXumOciZSWlmq6Z5mNylCd33X7Ig==} engines: {node: '>=18.0.0'} - '@smithy/util-config-provider@4.2.0': - resolution: {integrity: sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==} + '@smithy/util-config-provider@4.2.1': + resolution: {integrity: sha512-462id/00U8JWFw6qBuTSWfN5TxOHvDu4WliI97qOIOnuC/g+NDAknTU8eoGXEPlLkRVgWEr03jJBLV4o2FL8+A==} engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-browser@4.3.32': - resolution: {integrity: sha512-092sjYfFMQ/iaPH798LY/OJFBcYu0sSK34Oy9vdixhsU36zlZu8OcYjF3TD4e2ARupyK7xaxPXl+T0VIJTEkkg==} + '@smithy/util-defaults-mode-browser@4.3.36': + resolution: {integrity: sha512-R0smq7EHQXRVMxkAxtH5akJ/FvgAmNF6bUy/GwY/N20T4GrwjT633NFm0VuRpC+8Bbv8R9A0DoJ9OiZL/M3xew==} engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-node@4.2.35': - resolution: {integrity: sha512-miz/ggz87M8VuM29y7jJZMYkn7+IErM5p5UgKIf8OtqVs/h2bXr1Bt3uTsREsI/4nK8a0PQERbAPsVPVNIsG7Q==} + '@smithy/util-defaults-mode-node@4.2.39': + resolution: {integrity: sha512-otWuoDm35btJV1L8MyHrPl462B07QCdMTktKc7/yM+Psv6KbED/ziXiHnmr7yPHUjfIwE9S8Max0LO24Mo3ZVg==} engines: {node: '>=18.0.0'} - '@smithy/util-endpoints@3.2.8': - resolution: {integrity: sha512-8JaVTn3pBDkhZgHQ8R0epwWt+BqPSLCjdjXXusK1onwJlRuN69fbvSK66aIKKO7SwVFM6x2J2ox5X8pOaWcUEw==} + '@smithy/util-endpoints@3.3.1': + resolution: {integrity: sha512-xyctc4klmjmieQiF9I1wssBWleRV0RhJ2DpO8+8yzi2LO1Z+4IWOZNGZGNj4+hq9kdo+nyfrRLmQTzc16Op2Vg==} engines: {node: '>=18.0.0'} - '@smithy/util-hex-encoding@4.2.0': - resolution: {integrity: sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==} + '@smithy/util-hex-encoding@4.2.1': + resolution: {integrity: sha512-c1hHtkgAWmE35/50gmdKajgGAKV3ePJ7t6UtEmpfCWJmQE9BQAQPz0URUVI89eSkcDqCtzqllxzG28IQoZPvwA==} engines: {node: '>=18.0.0'} - '@smithy/util-middleware@4.2.8': - resolution: {integrity: sha512-PMqfeJxLcNPMDgvPbbLl/2Vpin+luxqTGPpW3NAQVLbRrFRzTa4rNAASYeIGjRV9Ytuhzny39SpyU04EQreF+A==} + '@smithy/util-middleware@4.2.10': + resolution: {integrity: sha512-LxaQIWLp4y0r72eA8mwPNQ9va4h5KeLM0I3M/HV9klmFaY2kN766wf5vsTzmaOpNNb7GgXAd9a25P3h8T49PSA==} engines: {node: '>=18.0.0'} - '@smithy/util-retry@4.2.8': - resolution: {integrity: sha512-CfJqwvoRY0kTGe5AkQokpURNCT1u/MkRzMTASWMPPo2hNSnKtF1D45dQl3DE2LKLr4m+PW9mCeBMJr5mCAVThg==} + '@smithy/util-retry@4.2.10': + resolution: {integrity: sha512-HrBzistfpyE5uqTwiyLsFHscgnwB0kgv8vySp7q5kZ0Eltn/tjosaSGGDj/jJ9ys7pWzIP/icE2d+7vMKXLv7A==} engines: {node: '>=18.0.0'} - '@smithy/util-stream@4.5.12': - resolution: {integrity: sha512-D8tgkrmhAX/UNeCZbqbEO3uqyghUnEmmoO9YEvRuwxjlkKKUE7FOgCJnqpTlQPe9MApdWPky58mNQQHbnCzoNg==} + '@smithy/util-stream@4.5.15': + resolution: {integrity: sha512-OlOKnaqnkU9X+6wEkd7mN+WB7orPbCVDauXOj22Q7VtiTkvy7ZdSsOg4QiNAZMgI4OkvNf+/VLUC3VXkxuWJZw==} engines: {node: '>=18.0.0'} - '@smithy/util-uri-escape@4.2.0': - resolution: {integrity: sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==} + '@smithy/util-uri-escape@4.2.1': + resolution: {integrity: sha512-YmiUDn2eo2IOiWYYvGQkgX5ZkBSiTQu4FlDo5jNPpAxng2t6Sjb6WutnZV9l6VR4eJul1ABmCrnWBC9hKHQa6Q==} engines: {node: '>=18.0.0'} '@smithy/util-utf8@2.3.0': resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} engines: {node: '>=14.0.0'} - '@smithy/util-utf8@4.2.0': - resolution: {integrity: sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==} + '@smithy/util-utf8@4.2.1': + resolution: {integrity: sha512-DSIwNaWtmzrNQHv8g7DBGR9mulSit65KSj5ymGEIAknmIN8IpbZefEep10LaMG/P/xquwbmJ1h9ectz8z6mV6g==} engines: {node: '>=18.0.0'} - '@smithy/util-waiter@4.2.8': - resolution: {integrity: sha512-n+lahlMWk+aejGuax7DPWtqav8HYnWxQwR+LCG2BgCUmaGcTe9qZCFsmw8TMg9iG75HOwhrJCX9TCJRLH+Yzqg==} + '@smithy/util-waiter@4.2.10': + resolution: {integrity: sha512-4eTWph/Lkg1wZEDAyObwme0kmhEb7J/JjibY2znJdrYRgKbKqB7YoEhhJVJ4R1g/SYih4zuwX7LpJaM8RsnTVg==} engines: {node: '>=18.0.0'} - '@smithy/uuid@1.1.0': - resolution: {integrity: sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==} + '@smithy/uuid@1.1.1': + resolution: {integrity: sha512-dSfDCeihDmZlV2oyr0yWPTUfh07suS+R5OB+FZGiv/hHyK3hrFBW5rR1UYjfa57vBsrP9lciFkRPzebaV1Qujw==} engines: {node: '>=18.0.0'} '@standard-schema/utils@0.3.0': resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==} - '@tailwindcss/node@4.2.0': - resolution: {integrity: sha512-Yv+fn/o2OmL5fh/Ir62VXItdShnUxfpkMA4Y7jdeC8O81WPB8Kf6TT6GSHvnqgSwDzlB5iT7kDpeXxLsUS0T6Q==} + '@tailwindcss/node@4.2.1': + resolution: {integrity: sha512-jlx6sLk4EOwO6hHe1oCGm1Q4AN/s0rSrTTPBGPM0/RQ6Uylwq17FuU8IeJJKEjtc6K6O07zsvP+gDO6MMWo7pg==} - '@tailwindcss/oxide-android-arm64@4.2.0': - resolution: {integrity: sha512-F0QkHAVaW/JNBWl4CEKWdZ9PMb0khw5DCELAOnu+RtjAfx5Zgw+gqCHFvqg3AirU1IAd181fwOtJQ5I8Yx5wtw==} + '@tailwindcss/oxide-android-arm64@4.2.1': + resolution: {integrity: sha512-eZ7G1Zm5EC8OOKaesIKuw77jw++QJ2lL9N+dDpdQiAB/c/B2wDh0QPFHbkBVrXnwNugvrbJFk1gK2SsVjwWReg==} engines: {node: '>= 20'} cpu: [arm64] os: [android] - '@tailwindcss/oxide-darwin-arm64@4.2.0': - resolution: {integrity: sha512-I0QylkXsBsJMZ4nkUNSR04p6+UptjcwhcVo3Zu828ikiEqHjVmQL9RuQ6uT/cVIiKpvtVA25msu/eRV97JeNSA==} + '@tailwindcss/oxide-darwin-arm64@4.2.1': + resolution: {integrity: sha512-q/LHkOstoJ7pI1J0q6djesLzRvQSIfEto148ppAd+BVQK0JYjQIFSK3JgYZJa+Yzi0DDa52ZsQx2rqytBnf8Hw==} engines: {node: '>= 20'} cpu: [arm64] os: [darwin] - '@tailwindcss/oxide-darwin-x64@4.2.0': - resolution: {integrity: sha512-6TmQIn4p09PBrmnkvbYQ0wbZhLtbaksCDx7Y7R3FYYx0yxNA7xg5KP7dowmQ3d2JVdabIHvs3Hx4K3d5uCf8xg==} + '@tailwindcss/oxide-darwin-x64@4.2.1': + resolution: {integrity: sha512-/f/ozlaXGY6QLbpvd/kFTro2l18f7dHKpB+ieXz+Cijl4Mt9AI2rTrpq7V+t04nK+j9XBQHnSMdeQRhbGyt6fw==} engines: {node: '>= 20'} cpu: [x64] os: [darwin] - '@tailwindcss/oxide-freebsd-x64@4.2.0': - resolution: {integrity: sha512-qBudxDvAa2QwGlq9y7VIzhTvp2mLJ6nD/G8/tI70DCDoneaUeLWBJaPcbfzqRIWraj+o969aDQKvKW9dvkUizw==} + '@tailwindcss/oxide-freebsd-x64@4.2.1': + resolution: {integrity: sha512-5e/AkgYJT/cpbkys/OU2Ei2jdETCLlifwm7ogMC7/hksI2fC3iiq6OcXwjibcIjPung0kRtR3TxEITkqgn0TcA==} engines: {node: '>= 20'} cpu: [x64] os: [freebsd] - '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.0': - resolution: {integrity: sha512-7XKkitpy5NIjFZNUQPeUyNJNJn1CJeV7rmMR+exHfTuOsg8rxIO9eNV5TSEnqRcaOK77zQpsyUkBWmPy8FgdSg==} + '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.1': + resolution: {integrity: sha512-Uny1EcVTTmerCKt/1ZuKTkb0x8ZaiuYucg2/kImO5A5Y/kBz41/+j0gxUZl+hTF3xkWpDmHX+TaWhOtba2Fyuw==} engines: {node: '>= 20'} cpu: [arm] os: [linux] - '@tailwindcss/oxide-linux-arm64-gnu@4.2.0': - resolution: {integrity: sha512-Mff5a5Q3WoQR01pGU1gr29hHM1N93xYrKkGXfPw/aRtK4bOc331Ho4Tgfsm5WDGvpevqMpdlkCojT3qlCQbCpA==} + '@tailwindcss/oxide-linux-arm64-gnu@4.2.1': + resolution: {integrity: sha512-CTrwomI+c7n6aSSQlsPL0roRiNMDQ/YzMD9EjcR+H4f0I1SQ8QqIuPnsVp7QgMkC1Qi8rtkekLkOFjo7OlEFRQ==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] libc: [glibc] - '@tailwindcss/oxide-linux-arm64-musl@4.2.0': - resolution: {integrity: sha512-XKcSStleEVnbH6W/9DHzZv1YhjE4eSS6zOu2eRtYAIh7aV4o3vIBs+t/B15xlqoxt6ef/0uiqJVB6hkHjWD/0A==} + '@tailwindcss/oxide-linux-arm64-musl@4.2.1': + resolution: {integrity: sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] libc: [musl] - '@tailwindcss/oxide-linux-x64-gnu@4.2.0': - resolution: {integrity: sha512-/hlXCBqn9K6fi7eAM0RsobHwJYa5V/xzWspVTzxnX+Ft9v6n+30Pz8+RxCn7sQL/vRHHLS30iQPrHQunu6/vJA==} + '@tailwindcss/oxide-linux-x64-gnu@4.2.1': + resolution: {integrity: sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==} engines: {node: '>= 20'} cpu: [x64] os: [linux] libc: [glibc] - '@tailwindcss/oxide-linux-x64-musl@4.2.0': - resolution: {integrity: sha512-lKUaygq4G7sWkhQbfdRRBkaq4LY39IriqBQ+Gk6l5nKq6Ay2M2ZZb1tlIyRNgZKS8cbErTwuYSor0IIULC0SHw==} + '@tailwindcss/oxide-linux-x64-musl@4.2.1': + resolution: {integrity: sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==} engines: {node: '>= 20'} cpu: [x64] os: [linux] libc: [musl] - '@tailwindcss/oxide-wasm32-wasi@4.2.0': - resolution: {integrity: sha512-xuDjhAsFdUuFP5W9Ze4k/o4AskUtI8bcAGU4puTYprr89QaYFmhYOPfP+d1pH+k9ets6RoE23BXZM1X1jJqoyw==} + '@tailwindcss/oxide-wasm32-wasi@4.2.1': + resolution: {integrity: sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==} engines: {node: '>=14.0.0'} cpu: [wasm32] bundledDependencies: @@ -1101,24 +1096,24 @@ packages: - '@emnapi/wasi-threads' - tslib - '@tailwindcss/oxide-win32-arm64-msvc@4.2.0': - resolution: {integrity: sha512-2UU/15y1sWDEDNJXxEIrfWKC2Yb4YgIW5Xz2fKFqGzFWfoMHWFlfa1EJlGO2Xzjkq/tvSarh9ZTjvbxqWvLLXA==} + '@tailwindcss/oxide-win32-arm64-msvc@4.2.1': + resolution: {integrity: sha512-YlUEHRHBGnCMh4Nj4GnqQyBtsshUPdiNroZj8VPkvTZSoHsilRCwXcVKnG9kyi0ZFAS/3u+qKHBdDc81SADTRA==} engines: {node: '>= 20'} cpu: [arm64] os: [win32] - '@tailwindcss/oxide-win32-x64-msvc@4.2.0': - resolution: {integrity: sha512-CrFadmFoc+z76EV6LPG1jx6XceDsaCG3lFhyLNo/bV9ByPrE+FnBPckXQVP4XRkN76h3Fjt/a+5Er/oA/nCBvQ==} + '@tailwindcss/oxide-win32-x64-msvc@4.2.1': + resolution: {integrity: sha512-rbO34G5sMWWyrN/idLeVxAZgAKWrn5LiR3/I90Q9MkA67s6T1oB0xtTe+0heoBvHSpbU9Mk7i6uwJnpo4u21XQ==} engines: {node: '>= 20'} cpu: [x64] os: [win32] - '@tailwindcss/oxide@4.2.0': - resolution: {integrity: sha512-AZqQzADaj742oqn2xjl5JbIOzZB/DGCYF/7bpvhA8KvjUj9HJkag6bBuwZvH1ps6dfgxNHyuJVlzSr2VpMgdTQ==} + '@tailwindcss/oxide@4.2.1': + resolution: {integrity: sha512-yv9jeEFWnjKCI6/T3Oq50yQEOqmpmpfzG1hcZsAOaXFQPfzWprWrlHSdGPEF3WQTi8zu8ohC9Mh9J470nT5pUw==} engines: {node: '>= 20'} - '@tailwindcss/vite@4.2.0': - resolution: {integrity: sha512-da9mFCaHpoOgtQiWtDGIikTrSpUFBtIZCG3jy/u2BGV+l/X1/pbxzmIUxNt6JWm19N3WtGi4KlJdSH/Si83WOA==} + '@tailwindcss/vite@4.2.1': + resolution: {integrity: sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w==} peerDependencies: vite: ^5.2.0 || ^6 || ^7 @@ -1134,8 +1129,8 @@ packages: peerDependencies: react: ^18 || ^19 - '@tanstack/react-router@1.162.1': - resolution: {integrity: sha512-HF2uSWqLqENWNH7vn+qnz1QY9ZrVunwLNUO57Lonvq5X20tziN/AK5p3z0A4zExej9I5SgEcG6Z/eaIv7aGhPA==} + '@tanstack/react-router@1.163.3': + resolution: {integrity: sha512-hheBbFVb+PbxtrWp8iy6+TTRTbhx3Pn6hKo8Tv/sWlG89ZMcD1xpQWzx8ukHN9K8YWbh5rdzt4kv6u8X4kB28Q==} engines: {node: '>=20.19'} peerDependencies: react: '>=18.0.0 || >=19.0.0' @@ -1147,20 +1142,20 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - '@tanstack/router-core@1.162.1': - resolution: {integrity: sha512-zq/ePd7UhWE1NkY4DZJ/a//2O+yiwOxkCqbFF+v++twnQUsKkTUepUln30S9yrPcnZFe76PlHnIzZSl5UeKm9w==} + '@tanstack/router-core@1.163.3': + resolution: {integrity: sha512-jPptiGq/w3nuPzcMC7RNa79aU+b6OjaDzWJnBcV2UAwL4ThJamRS4h42TdhJE+oF5yH9IEnCOGQdfnbw45LbfA==} engines: {node: '>=20.19'} - '@tanstack/router-generator@1.162.1': - resolution: {integrity: sha512-64NCZBR8QnhiwJRMtF2HOmoLsf4SgLubkzOIYasmJXJ2he24g8/hNNUY5ofhe2pGER74GVASrtOF3SSYCndaKw==} + '@tanstack/router-generator@1.163.3': + resolution: {integrity: sha512-i2rWRtqY/yCYUDXva1li4zeDP20oFjMt/wh9RnGJCrKSLWrvEGnxAOSyXgiOsoJnU96TTQ0mUDbGfXsSTupeZQ==} engines: {node: '>=20.19'} - '@tanstack/router-plugin@1.162.1': - resolution: {integrity: sha512-Rmuu3InFdPaDbv1vds53jZv+l6iqmFBttDb0HHXrG+/ECIk4y5oXG8mnpvt9vo8BMfy4KRCrylYuxueL1eAMRQ==} + '@tanstack/router-plugin@1.163.3': + resolution: {integrity: sha512-JOUYuUX2N9ZHnmkmvmiGzXGbkvrur/5BfW/+vpiZzuifSyvdc0XsfwkTpjvwWx9ymp4ZshSVKiQQKQi09YweIw==} engines: {node: '>=20.19'} peerDependencies: '@rsbuild/core': '>=1.0.2' - '@tanstack/react-router': ^1.162.1 + '@tanstack/react-router': ^1.163.3 vite: '>=5.0.0 || >=6.0.0 || >=7.0.0' vite-plugin-solid: ^2.11.10 webpack: '>=5.92.0' @@ -1202,8 +1197,8 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - '@types/node@24.10.13': - resolution: {integrity: sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==} + '@types/node@24.10.15': + resolution: {integrity: sha512-BgjLoRuSr0MTI5wA6gMw9Xy0sFudAaUuvrnjgGx9wZ522fYYLA5SYJ+1Y30vTcJEG+DRCyDHx/gzQVfofYzSdg==} '@types/react-dom@19.2.3': resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} @@ -1248,9 +1243,9 @@ packages: babel-plugin-react-compiler@1.0.0: resolution: {integrity: sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==} - balanced-match@4.0.3: - resolution: {integrity: sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==} - engines: {node: 20 || >=22} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -1267,9 +1262,9 @@ packages: bowser@2.14.1: resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==} - brace-expansion@5.0.2: - resolution: {integrity: sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==} - engines: {node: 20 || >=22} + brace-expansion@5.0.4: + resolution: {integrity: sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==} + engines: {node: 18 || 20 || >=22} braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} @@ -1283,8 +1278,8 @@ packages: buffer@5.6.0: resolution: {integrity: sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==} - caniuse-lite@1.0.30001770: - resolution: {integrity: sha512-x/2CLQ1jHENRbHg5PSId2sXq1CIO1CISvwWAj027ltMVG2UNgW+w9oH2+HzgEIRFembL8bUlXtfbBHR1fCg2xw==} + caniuse-lite@1.0.30001774: + resolution: {integrity: sha512-DDdwPGz99nmIEv216hKSgLD+D4ikHQHjBC/seF98N9CPqRX4M5mSxT9eTV6oyisnJcuzxtZy4n17yKKQYmYQOA==} chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} @@ -1359,8 +1354,11 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - fast-xml-parser@5.3.6: - resolution: {integrity: sha512-QNI3sAvSvaOiaMl8FYU4trnEzCwiRr8XMWgAHzlrWpTSj+QaCSvOf1h82OEP1s4hiAXhnbXSyFWCf4ldZzZRVA==} + fast-xml-builder@1.0.0: + resolution: {integrity: sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ==} + + fast-xml-parser@5.4.1: + resolution: {integrity: sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==} hasBin: true fdir@6.5.0: @@ -1534,8 +1532,8 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} - minimatch@10.2.2: - resolution: {integrity: sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==} + minimatch@10.2.4: + resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==} engines: {node: 18 || 20 || >=22} minipass@7.1.3: @@ -1626,8 +1624,8 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - rollup@4.58.0: - resolution: {integrity: sha512-wbT0mBmWbIvvq8NeEYWWvevvxnOyhKChir47S66WCxw1SXqhw7ssIYejnQEVt7XYQpsj2y8F9PM+Cr3SNEa0gw==} + rollup@4.59.0: + resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -1681,8 +1679,8 @@ packages: tailwind-merge@3.5.0: resolution: {integrity: sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==} - tailwindcss@4.2.0: - resolution: {integrity: sha512-yYzTZ4++b7fNYxFfpnberEEKu43w44aqDMNM9MHMmcKuCH7lL8jJ4yJ7LGHv7rSwiqM0nkiobF9I6cLlpS2P7Q==} + tailwindcss@4.2.1: + resolution: {integrity: sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw==} tapable@2.3.0: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} @@ -1719,8 +1717,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - ultracite@7.2.3: - resolution: {integrity: sha512-WKNS2sKAZe4BHu+JGbZebXvy/A1QagDaBnndrK/zwOJAze/mQ8jeHfdG2bPlv3qcJ5fdS3w2Kd7c/eIcH78HvA==} + ultracite@7.2.4: + resolution: {integrity: sha512-3b2g2pwZMDSd+PBK8pxYCjEoYaqVSgXD22HS22BxR8GfbmRXJ3VpNu5Z5lNywIxZXsJleWdpGPHibOPYr/xmKg==} hasBin: true peerDependencies: oxlint: ^1.0.0 @@ -1806,20 +1804,20 @@ snapshots: '@aws-crypto/crc32@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 tslib: 2.8.1 '@aws-crypto/crc32c@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 tslib: 2.8.1 '@aws-crypto/sha1-browser@5.2.0': dependencies: '@aws-crypto/supports-web-crypto': 5.2.0 '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 '@aws-sdk/util-locate-window': 3.965.4 '@smithy/util-utf8': 2.3.0 tslib: 2.8.1 @@ -1829,7 +1827,7 @@ snapshots: '@aws-crypto/sha256-js': 5.2.0 '@aws-crypto/supports-web-crypto': 5.2.0 '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 '@aws-sdk/util-locate-window': 3.965.4 '@smithy/util-utf8': 2.3.0 tslib: 2.8.1 @@ -1837,7 +1835,7 @@ snapshots: '@aws-crypto/sha256-js@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 tslib: 2.8.1 '@aws-crypto/supports-web-crypto@5.2.0': @@ -1846,527 +1844,476 @@ snapshots: '@aws-crypto/util@5.2.0': dependencies: - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 '@smithy/util-utf8': 2.3.0 tslib: 2.8.1 - '@aws-sdk/client-ec2@3.995.0': + '@aws-sdk/client-ec2@3.1000.0': dependencies: '@aws-crypto/sha256-browser': 5.2.0 '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/core': 3.973.11 - '@aws-sdk/credential-provider-node': 3.972.10 - '@aws-sdk/middleware-host-header': 3.972.3 - '@aws-sdk/middleware-logger': 3.972.3 - '@aws-sdk/middleware-recursion-detection': 3.972.3 - '@aws-sdk/middleware-sdk-ec2': 3.972.8 - '@aws-sdk/middleware-user-agent': 3.972.11 - '@aws-sdk/region-config-resolver': 3.972.3 - '@aws-sdk/types': 3.973.1 - '@aws-sdk/util-endpoints': 3.995.0 - '@aws-sdk/util-user-agent-browser': 3.972.3 - '@aws-sdk/util-user-agent-node': 3.972.10 - '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.23.2 - '@smithy/fetch-http-handler': 5.3.9 - '@smithy/hash-node': 4.2.8 - '@smithy/invalid-dependency': 4.2.8 - '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/middleware-retry': 4.4.33 - '@smithy/middleware-serde': 4.2.9 - '@smithy/middleware-stack': 4.2.8 - '@smithy/node-config-provider': 4.3.8 - '@smithy/node-http-handler': 4.4.10 - '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-base64': 4.3.0 - '@smithy/util-body-length-browser': 4.2.0 - '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.32 - '@smithy/util-defaults-mode-node': 4.2.35 - '@smithy/util-endpoints': 3.2.8 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-retry': 4.2.8 - '@smithy/util-utf8': 4.2.0 - '@smithy/util-waiter': 4.2.8 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/credential-provider-node': 3.972.14 + '@aws-sdk/middleware-host-header': 3.972.6 + '@aws-sdk/middleware-logger': 3.972.6 + '@aws-sdk/middleware-recursion-detection': 3.972.6 + '@aws-sdk/middleware-sdk-ec2': 3.972.11 + '@aws-sdk/middleware-user-agent': 3.972.15 + '@aws-sdk/region-config-resolver': 3.972.6 + '@aws-sdk/types': 3.973.4 + '@aws-sdk/util-endpoints': 3.996.3 + '@aws-sdk/util-user-agent-browser': 3.972.6 + '@aws-sdk/util-user-agent-node': 3.973.0 + '@smithy/config-resolver': 4.4.9 + '@smithy/core': 3.23.6 + '@smithy/fetch-http-handler': 5.3.11 + '@smithy/hash-node': 4.2.10 + '@smithy/invalid-dependency': 4.2.10 + '@smithy/middleware-content-length': 4.2.10 + '@smithy/middleware-endpoint': 4.4.20 + '@smithy/middleware-retry': 4.4.37 + '@smithy/middleware-serde': 4.2.11 + '@smithy/middleware-stack': 4.2.10 + '@smithy/node-config-provider': 4.3.10 + '@smithy/node-http-handler': 4.4.12 + '@smithy/protocol-http': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/url-parser': 4.2.10 + '@smithy/util-base64': 4.3.1 + '@smithy/util-body-length-browser': 4.2.1 + '@smithy/util-body-length-node': 4.2.2 + '@smithy/util-defaults-mode-browser': 4.3.36 + '@smithy/util-defaults-mode-node': 4.2.39 + '@smithy/util-endpoints': 3.3.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-retry': 4.2.10 + '@smithy/util-utf8': 4.2.1 + '@smithy/util-waiter': 4.2.10 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/client-s3@3.995.0': + '@aws-sdk/client-s3@3.1000.0': dependencies: '@aws-crypto/sha1-browser': 5.2.0 '@aws-crypto/sha256-browser': 5.2.0 '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/core': 3.973.11 - '@aws-sdk/credential-provider-node': 3.972.10 - '@aws-sdk/middleware-bucket-endpoint': 3.972.3 - '@aws-sdk/middleware-expect-continue': 3.972.3 - '@aws-sdk/middleware-flexible-checksums': 3.972.9 - '@aws-sdk/middleware-host-header': 3.972.3 - '@aws-sdk/middleware-location-constraint': 3.972.3 - '@aws-sdk/middleware-logger': 3.972.3 - '@aws-sdk/middleware-recursion-detection': 3.972.3 - '@aws-sdk/middleware-sdk-s3': 3.972.11 - '@aws-sdk/middleware-ssec': 3.972.3 - '@aws-sdk/middleware-user-agent': 3.972.11 - '@aws-sdk/region-config-resolver': 3.972.3 - '@aws-sdk/signature-v4-multi-region': 3.995.0 - '@aws-sdk/types': 3.973.1 - '@aws-sdk/util-endpoints': 3.995.0 - '@aws-sdk/util-user-agent-browser': 3.972.3 - '@aws-sdk/util-user-agent-node': 3.972.10 - '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.23.2 - '@smithy/eventstream-serde-browser': 4.2.8 - '@smithy/eventstream-serde-config-resolver': 4.3.8 - '@smithy/eventstream-serde-node': 4.2.8 - '@smithy/fetch-http-handler': 5.3.9 - '@smithy/hash-blob-browser': 4.2.9 - '@smithy/hash-node': 4.2.8 - '@smithy/hash-stream-node': 4.2.8 - '@smithy/invalid-dependency': 4.2.8 - '@smithy/md5-js': 4.2.8 - '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/middleware-retry': 4.4.33 - '@smithy/middleware-serde': 4.2.9 - '@smithy/middleware-stack': 4.2.8 - '@smithy/node-config-provider': 4.3.8 - '@smithy/node-http-handler': 4.4.10 - '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-base64': 4.3.0 - '@smithy/util-body-length-browser': 4.2.0 - '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.32 - '@smithy/util-defaults-mode-node': 4.2.35 - '@smithy/util-endpoints': 3.2.8 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-retry': 4.2.8 - '@smithy/util-stream': 4.5.12 - '@smithy/util-utf8': 4.2.0 - '@smithy/util-waiter': 4.2.8 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/credential-provider-node': 3.972.14 + '@aws-sdk/middleware-bucket-endpoint': 3.972.6 + '@aws-sdk/middleware-expect-continue': 3.972.6 + '@aws-sdk/middleware-flexible-checksums': 3.973.1 + '@aws-sdk/middleware-host-header': 3.972.6 + '@aws-sdk/middleware-location-constraint': 3.972.6 + '@aws-sdk/middleware-logger': 3.972.6 + '@aws-sdk/middleware-recursion-detection': 3.972.6 + '@aws-sdk/middleware-sdk-s3': 3.972.15 + '@aws-sdk/middleware-ssec': 3.972.6 + '@aws-sdk/middleware-user-agent': 3.972.15 + '@aws-sdk/region-config-resolver': 3.972.6 + '@aws-sdk/signature-v4-multi-region': 3.996.3 + '@aws-sdk/types': 3.973.4 + '@aws-sdk/util-endpoints': 3.996.3 + '@aws-sdk/util-user-agent-browser': 3.972.6 + '@aws-sdk/util-user-agent-node': 3.973.0 + '@smithy/config-resolver': 4.4.9 + '@smithy/core': 3.23.6 + '@smithy/eventstream-serde-browser': 4.2.10 + '@smithy/eventstream-serde-config-resolver': 4.3.10 + '@smithy/eventstream-serde-node': 4.2.10 + '@smithy/fetch-http-handler': 5.3.11 + '@smithy/hash-blob-browser': 4.2.11 + '@smithy/hash-node': 4.2.10 + '@smithy/hash-stream-node': 4.2.10 + '@smithy/invalid-dependency': 4.2.10 + '@smithy/md5-js': 4.2.10 + '@smithy/middleware-content-length': 4.2.10 + '@smithy/middleware-endpoint': 4.4.20 + '@smithy/middleware-retry': 4.4.37 + '@smithy/middleware-serde': 4.2.11 + '@smithy/middleware-stack': 4.2.10 + '@smithy/node-config-provider': 4.3.10 + '@smithy/node-http-handler': 4.4.12 + '@smithy/protocol-http': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/url-parser': 4.2.10 + '@smithy/util-base64': 4.3.1 + '@smithy/util-body-length-browser': 4.2.1 + '@smithy/util-body-length-node': 4.2.2 + '@smithy/util-defaults-mode-browser': 4.3.36 + '@smithy/util-defaults-mode-node': 4.2.39 + '@smithy/util-endpoints': 3.3.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-retry': 4.2.10 + '@smithy/util-stream': 4.5.15 + '@smithy/util-utf8': 4.2.1 + '@smithy/util-waiter': 4.2.10 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso@3.993.0': + '@aws-sdk/core@3.973.15': dependencies: - '@aws-crypto/sha256-browser': 5.2.0 - '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/core': 3.973.11 - '@aws-sdk/middleware-host-header': 3.972.3 - '@aws-sdk/middleware-logger': 3.972.3 - '@aws-sdk/middleware-recursion-detection': 3.972.3 - '@aws-sdk/middleware-user-agent': 3.972.11 - '@aws-sdk/region-config-resolver': 3.972.3 - '@aws-sdk/types': 3.973.1 - '@aws-sdk/util-endpoints': 3.993.0 - '@aws-sdk/util-user-agent-browser': 3.972.3 - '@aws-sdk/util-user-agent-node': 3.972.10 - '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.23.2 - '@smithy/fetch-http-handler': 5.3.9 - '@smithy/hash-node': 4.2.8 - '@smithy/invalid-dependency': 4.2.8 - '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/middleware-retry': 4.4.33 - '@smithy/middleware-serde': 4.2.9 - '@smithy/middleware-stack': 4.2.8 - '@smithy/node-config-provider': 4.3.8 - '@smithy/node-http-handler': 4.4.10 - '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-base64': 4.3.0 - '@smithy/util-body-length-browser': 4.2.0 - '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.32 - '@smithy/util-defaults-mode-node': 4.2.35 - '@smithy/util-endpoints': 3.2.8 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-retry': 4.2.8 - '@smithy/util-utf8': 4.2.0 + '@aws-sdk/types': 3.973.4 + '@aws-sdk/xml-builder': 3.972.8 + '@smithy/core': 3.23.6 + '@smithy/node-config-provider': 4.3.10 + '@smithy/property-provider': 4.2.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/signature-v4': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/util-base64': 4.3.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-utf8': 4.2.1 + tslib: 2.8.1 + + '@aws-sdk/crc64-nvme@3.972.3': + dependencies: + '@smithy/types': 4.13.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-env@3.972.13': + dependencies: + '@aws-sdk/core': 3.973.15 + '@aws-sdk/types': 3.973.4 + '@smithy/property-provider': 4.2.10 + '@smithy/types': 4.13.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-http@3.972.15': + dependencies: + '@aws-sdk/core': 3.973.15 + '@aws-sdk/types': 3.973.4 + '@smithy/fetch-http-handler': 5.3.11 + '@smithy/node-http-handler': 4.4.12 + '@smithy/property-provider': 4.2.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/util-stream': 4.5.15 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-ini@3.972.13': + dependencies: + '@aws-sdk/core': 3.973.15 + '@aws-sdk/credential-provider-env': 3.972.13 + '@aws-sdk/credential-provider-http': 3.972.15 + '@aws-sdk/credential-provider-login': 3.972.13 + '@aws-sdk/credential-provider-process': 3.972.13 + '@aws-sdk/credential-provider-sso': 3.972.13 + '@aws-sdk/credential-provider-web-identity': 3.972.13 + '@aws-sdk/nested-clients': 3.996.3 + '@aws-sdk/types': 3.973.4 + '@smithy/credential-provider-imds': 4.2.10 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/core@3.973.11': + '@aws-sdk/credential-provider-login@3.972.13': dependencies: - '@aws-sdk/types': 3.973.1 - '@aws-sdk/xml-builder': 3.972.5 - '@smithy/core': 3.23.2 - '@smithy/node-config-provider': 4.3.8 - '@smithy/property-provider': 4.2.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/signature-v4': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/util-base64': 4.3.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-utf8': 4.2.0 - tslib: 2.8.1 - - '@aws-sdk/crc64-nvme@3.972.0': - dependencies: - '@smithy/types': 4.12.0 - tslib: 2.8.1 - - '@aws-sdk/credential-provider-env@3.972.9': - dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/types': 3.973.1 - '@smithy/property-provider': 4.2.8 - '@smithy/types': 4.12.0 - tslib: 2.8.1 - - '@aws-sdk/credential-provider-http@3.972.11': - dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/types': 3.973.1 - '@smithy/fetch-http-handler': 5.3.9 - '@smithy/node-http-handler': 4.4.10 - '@smithy/property-provider': 4.2.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/util-stream': 4.5.12 - tslib: 2.8.1 - - '@aws-sdk/credential-provider-ini@3.972.9': - dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/credential-provider-env': 3.972.9 - '@aws-sdk/credential-provider-http': 3.972.11 - '@aws-sdk/credential-provider-login': 3.972.9 - '@aws-sdk/credential-provider-process': 3.972.9 - '@aws-sdk/credential-provider-sso': 3.972.9 - '@aws-sdk/credential-provider-web-identity': 3.972.9 - '@aws-sdk/nested-clients': 3.993.0 - '@aws-sdk/types': 3.973.1 - '@smithy/credential-provider-imds': 4.2.8 - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/nested-clients': 3.996.3 + '@aws-sdk/types': 3.973.4 + '@smithy/property-provider': 4.2.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/credential-provider-login@3.972.9': + '@aws-sdk/credential-provider-node@3.972.14': dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/nested-clients': 3.993.0 - '@aws-sdk/types': 3.973.1 - '@smithy/property-provider': 4.2.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 + '@aws-sdk/credential-provider-env': 3.972.13 + '@aws-sdk/credential-provider-http': 3.972.15 + '@aws-sdk/credential-provider-ini': 3.972.13 + '@aws-sdk/credential-provider-process': 3.972.13 + '@aws-sdk/credential-provider-sso': 3.972.13 + '@aws-sdk/credential-provider-web-identity': 3.972.13 + '@aws-sdk/types': 3.973.4 + '@smithy/credential-provider-imds': 4.2.10 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/credential-provider-node@3.972.10': + '@aws-sdk/credential-provider-process@3.972.13': dependencies: - '@aws-sdk/credential-provider-env': 3.972.9 - '@aws-sdk/credential-provider-http': 3.972.11 - '@aws-sdk/credential-provider-ini': 3.972.9 - '@aws-sdk/credential-provider-process': 3.972.9 - '@aws-sdk/credential-provider-sso': 3.972.9 - '@aws-sdk/credential-provider-web-identity': 3.972.9 - '@aws-sdk/types': 3.973.1 - '@smithy/credential-provider-imds': 4.2.8 - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/types': 3.973.4 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-sso@3.972.13': + dependencies: + '@aws-sdk/core': 3.973.15 + '@aws-sdk/nested-clients': 3.996.3 + '@aws-sdk/token-providers': 3.999.0 + '@aws-sdk/types': 3.973.4 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/credential-provider-process@3.972.9': + '@aws-sdk/credential-provider-web-identity@3.972.13': dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/types': 3.973.1 - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 - tslib: 2.8.1 - - '@aws-sdk/credential-provider-sso@3.972.9': - dependencies: - '@aws-sdk/client-sso': 3.993.0 - '@aws-sdk/core': 3.973.11 - '@aws-sdk/token-providers': 3.993.0 - '@aws-sdk/types': 3.973.1 - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/nested-clients': 3.996.3 + '@aws-sdk/types': 3.973.4 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/credential-provider-web-identity@3.972.9': + '@aws-sdk/lib-storage@3.1000.0(@aws-sdk/client-s3@3.1000.0)': dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/nested-clients': 3.993.0 - '@aws-sdk/types': 3.973.1 - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 - tslib: 2.8.1 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/lib-storage@3.995.0(@aws-sdk/client-s3@3.995.0)': - dependencies: - '@aws-sdk/client-s3': 3.995.0 - '@smithy/abort-controller': 4.2.8 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/smithy-client': 4.11.5 + '@aws-sdk/client-s3': 3.1000.0 + '@smithy/abort-controller': 4.2.10 + '@smithy/middleware-endpoint': 4.4.20 + '@smithy/smithy-client': 4.12.0 buffer: 5.6.0 events: 3.3.0 stream-browserify: 3.0.0 tslib: 2.8.1 - '@aws-sdk/middleware-bucket-endpoint@3.972.3': + '@aws-sdk/middleware-bucket-endpoint@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 '@aws-sdk/util-arn-parser': 3.972.2 - '@smithy/node-config-provider': 4.3.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-config-provider': 4.2.0 + '@smithy/node-config-provider': 4.3.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 + '@smithy/util-config-provider': 4.2.1 tslib: 2.8.1 - '@aws-sdk/middleware-expect-continue@3.972.3': + '@aws-sdk/middleware-expect-continue@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-flexible-checksums@3.972.9': + '@aws-sdk/middleware-flexible-checksums@3.973.1': dependencies: '@aws-crypto/crc32': 5.2.0 '@aws-crypto/crc32c': 5.2.0 '@aws-crypto/util': 5.2.0 - '@aws-sdk/core': 3.973.11 - '@aws-sdk/crc64-nvme': 3.972.0 - '@aws-sdk/types': 3.973.1 - '@smithy/is-array-buffer': 4.2.0 - '@smithy/node-config-provider': 4.3.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-stream': 4.5.12 - '@smithy/util-utf8': 4.2.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/crc64-nvme': 3.972.3 + '@aws-sdk/types': 3.973.4 + '@smithy/is-array-buffer': 4.2.1 + '@smithy/node-config-provider': 4.3.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-stream': 4.5.15 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@aws-sdk/middleware-host-header@3.972.3': + '@aws-sdk/middleware-host-header@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-location-constraint@3.972.3': + '@aws-sdk/middleware-location-constraint@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-logger@3.972.3': + '@aws-sdk/middleware-logger@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-recursion-detection@3.972.3': + '@aws-sdk/middleware-recursion-detection@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 + '@aws-sdk/types': 3.973.4 '@aws/lambda-invoke-store': 0.2.3 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-sdk-ec2@3.972.8': + '@aws-sdk/middleware-sdk-ec2@3.972.11': dependencies: - '@aws-sdk/types': 3.973.1 - '@aws-sdk/util-format-url': 3.972.3 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/protocol-http': 5.3.8 - '@smithy/signature-v4': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@aws-sdk/util-format-url': 3.972.6 + '@smithy/middleware-endpoint': 4.4.20 + '@smithy/protocol-http': 5.3.10 + '@smithy/signature-v4': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-sdk-s3@3.972.11': + '@aws-sdk/middleware-sdk-s3@3.972.15': dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/types': 3.973.1 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/types': 3.973.4 '@aws-sdk/util-arn-parser': 3.972.2 - '@smithy/core': 3.23.2 - '@smithy/node-config-provider': 4.3.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/signature-v4': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/util-config-provider': 4.2.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-stream': 4.5.12 - '@smithy/util-utf8': 4.2.0 + '@smithy/core': 3.23.6 + '@smithy/node-config-provider': 4.3.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/signature-v4': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/util-config-provider': 4.2.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-stream': 4.5.15 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@aws-sdk/middleware-ssec@3.972.3': + '@aws-sdk/middleware-ssec@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/middleware-user-agent@3.972.11': + '@aws-sdk/middleware-user-agent@3.972.15': dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/types': 3.973.1 - '@aws-sdk/util-endpoints': 3.993.0 - '@smithy/core': 3.23.2 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/types': 3.973.4 + '@aws-sdk/util-endpoints': 3.996.3 + '@smithy/core': 3.23.6 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/nested-clients@3.993.0': + '@aws-sdk/nested-clients@3.996.3': dependencies: '@aws-crypto/sha256-browser': 5.2.0 '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/core': 3.973.11 - '@aws-sdk/middleware-host-header': 3.972.3 - '@aws-sdk/middleware-logger': 3.972.3 - '@aws-sdk/middleware-recursion-detection': 3.972.3 - '@aws-sdk/middleware-user-agent': 3.972.11 - '@aws-sdk/region-config-resolver': 3.972.3 - '@aws-sdk/types': 3.973.1 - '@aws-sdk/util-endpoints': 3.993.0 - '@aws-sdk/util-user-agent-browser': 3.972.3 - '@aws-sdk/util-user-agent-node': 3.972.10 - '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.23.2 - '@smithy/fetch-http-handler': 5.3.9 - '@smithy/hash-node': 4.2.8 - '@smithy/invalid-dependency': 4.2.8 - '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/middleware-retry': 4.4.33 - '@smithy/middleware-serde': 4.2.9 - '@smithy/middleware-stack': 4.2.8 - '@smithy/node-config-provider': 4.3.8 - '@smithy/node-http-handler': 4.4.10 - '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-base64': 4.3.0 - '@smithy/util-body-length-browser': 4.2.0 - '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.32 - '@smithy/util-defaults-mode-node': 4.2.35 - '@smithy/util-endpoints': 3.2.8 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-retry': 4.2.8 - '@smithy/util-utf8': 4.2.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/middleware-host-header': 3.972.6 + '@aws-sdk/middleware-logger': 3.972.6 + '@aws-sdk/middleware-recursion-detection': 3.972.6 + '@aws-sdk/middleware-user-agent': 3.972.15 + '@aws-sdk/region-config-resolver': 3.972.6 + '@aws-sdk/types': 3.973.4 + '@aws-sdk/util-endpoints': 3.996.3 + '@aws-sdk/util-user-agent-browser': 3.972.6 + '@aws-sdk/util-user-agent-node': 3.973.0 + '@smithy/config-resolver': 4.4.9 + '@smithy/core': 3.23.6 + '@smithy/fetch-http-handler': 5.3.11 + '@smithy/hash-node': 4.2.10 + '@smithy/invalid-dependency': 4.2.10 + '@smithy/middleware-content-length': 4.2.10 + '@smithy/middleware-endpoint': 4.4.20 + '@smithy/middleware-retry': 4.4.37 + '@smithy/middleware-serde': 4.2.11 + '@smithy/middleware-stack': 4.2.10 + '@smithy/node-config-provider': 4.3.10 + '@smithy/node-http-handler': 4.4.12 + '@smithy/protocol-http': 5.3.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/url-parser': 4.2.10 + '@smithy/util-base64': 4.3.1 + '@smithy/util-body-length-browser': 4.2.1 + '@smithy/util-body-length-node': 4.2.2 + '@smithy/util-defaults-mode-browser': 4.3.36 + '@smithy/util-defaults-mode-node': 4.2.39 + '@smithy/util-endpoints': 3.3.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-retry': 4.2.10 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/region-config-resolver@3.972.3': + '@aws-sdk/region-config-resolver@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/config-resolver': 4.4.6 - '@smithy/node-config-provider': 4.3.8 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/config-resolver': 4.4.9 + '@smithy/node-config-provider': 4.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/signature-v4-multi-region@3.995.0': + '@aws-sdk/signature-v4-multi-region@3.996.3': dependencies: - '@aws-sdk/middleware-sdk-s3': 3.972.11 - '@aws-sdk/types': 3.973.1 - '@smithy/protocol-http': 5.3.8 - '@smithy/signature-v4': 5.3.8 - '@smithy/types': 4.12.0 + '@aws-sdk/middleware-sdk-s3': 3.972.15 + '@aws-sdk/types': 3.973.4 + '@smithy/protocol-http': 5.3.10 + '@smithy/signature-v4': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/token-providers@3.993.0': + '@aws-sdk/token-providers@3.999.0': dependencies: - '@aws-sdk/core': 3.973.11 - '@aws-sdk/nested-clients': 3.993.0 - '@aws-sdk/types': 3.973.1 - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 + '@aws-sdk/core': 3.973.15 + '@aws-sdk/nested-clients': 3.996.3 + '@aws-sdk/types': 3.973.4 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/types@3.973.1': + '@aws-sdk/types@3.973.4': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 '@aws-sdk/util-arn-parser@3.972.2': dependencies: tslib: 2.8.1 - '@aws-sdk/util-endpoints@3.993.0': + '@aws-sdk/util-endpoints@3.996.3': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-endpoints': 3.2.8 + '@aws-sdk/types': 3.973.4 + '@smithy/types': 4.13.0 + '@smithy/url-parser': 4.2.10 + '@smithy/util-endpoints': 3.3.1 tslib: 2.8.1 - '@aws-sdk/util-endpoints@3.995.0': + '@aws-sdk/util-format-url@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-endpoints': 3.2.8 - tslib: 2.8.1 - - '@aws-sdk/util-format-url@3.972.3': - dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/querystring-builder': 4.2.8 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/querystring-builder': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 '@aws-sdk/util-locate-window@3.965.4': dependencies: tslib: 2.8.1 - '@aws-sdk/util-user-agent-browser@3.972.3': + '@aws-sdk/util-user-agent-browser@3.972.6': dependencies: - '@aws-sdk/types': 3.973.1 - '@smithy/types': 4.12.0 + '@aws-sdk/types': 3.973.4 + '@smithy/types': 4.13.0 bowser: 2.14.1 tslib: 2.8.1 - '@aws-sdk/util-user-agent-node@3.972.10': + '@aws-sdk/util-user-agent-node@3.973.0': dependencies: - '@aws-sdk/middleware-user-agent': 3.972.11 - '@aws-sdk/types': 3.973.1 - '@smithy/node-config-provider': 4.3.8 - '@smithy/types': 4.12.0 + '@aws-sdk/middleware-user-agent': 3.972.15 + '@aws-sdk/types': 3.973.4 + '@smithy/node-config-provider': 4.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@aws-sdk/xml-builder@3.972.5': + '@aws-sdk/xml-builder@3.972.8': dependencies: - '@smithy/types': 4.12.0 - fast-xml-parser: 5.3.6 + '@smithy/types': 4.13.0 + fast-xml-parser: 5.4.1 tslib: 2.8.1 '@aws/lambda-invoke-store@0.2.3': {} @@ -2690,329 +2637,329 @@ snapshots: '@rolldown/pluginutils@1.0.0-rc.3': {} - '@rollup/rollup-android-arm-eabi@4.58.0': + '@rollup/rollup-android-arm-eabi@4.59.0': optional: true - '@rollup/rollup-android-arm64@4.58.0': + '@rollup/rollup-android-arm64@4.59.0': optional: true - '@rollup/rollup-darwin-arm64@4.58.0': + '@rollup/rollup-darwin-arm64@4.59.0': optional: true - '@rollup/rollup-darwin-x64@4.58.0': + '@rollup/rollup-darwin-x64@4.59.0': optional: true - '@rollup/rollup-freebsd-arm64@4.58.0': + '@rollup/rollup-freebsd-arm64@4.59.0': optional: true - '@rollup/rollup-freebsd-x64@4.58.0': + '@rollup/rollup-freebsd-x64@4.59.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.58.0': + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.58.0': + '@rollup/rollup-linux-arm-musleabihf@4.59.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.58.0': + '@rollup/rollup-linux-arm64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.58.0': + '@rollup/rollup-linux-arm64-musl@4.59.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.58.0': + '@rollup/rollup-linux-loong64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-loong64-musl@4.58.0': + '@rollup/rollup-linux-loong64-musl@4.59.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.58.0': + '@rollup/rollup-linux-ppc64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-ppc64-musl@4.58.0': + '@rollup/rollup-linux-ppc64-musl@4.59.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.58.0': + '@rollup/rollup-linux-riscv64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.58.0': + '@rollup/rollup-linux-riscv64-musl@4.59.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.58.0': + '@rollup/rollup-linux-s390x-gnu@4.59.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.58.0': + '@rollup/rollup-linux-x64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-x64-musl@4.58.0': + '@rollup/rollup-linux-x64-musl@4.59.0': optional: true - '@rollup/rollup-openbsd-x64@4.58.0': + '@rollup/rollup-openbsd-x64@4.59.0': optional: true - '@rollup/rollup-openharmony-arm64@4.58.0': + '@rollup/rollup-openharmony-arm64@4.59.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.58.0': + '@rollup/rollup-win32-arm64-msvc@4.59.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.58.0': + '@rollup/rollup-win32-ia32-msvc@4.59.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.58.0': + '@rollup/rollup-win32-x64-gnu@4.59.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.58.0': + '@rollup/rollup-win32-x64-msvc@4.59.0': optional: true - '@smithy/abort-controller@4.2.8': + '@smithy/abort-controller@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/chunked-blob-reader-native@4.2.1': + '@smithy/chunked-blob-reader-native@4.2.2': dependencies: - '@smithy/util-base64': 4.3.0 + '@smithy/util-base64': 4.3.1 tslib: 2.8.1 - '@smithy/chunked-blob-reader@5.2.0': + '@smithy/chunked-blob-reader@5.2.1': dependencies: tslib: 2.8.1 - '@smithy/config-resolver@4.4.6': + '@smithy/config-resolver@4.4.9': dependencies: - '@smithy/node-config-provider': 4.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-config-provider': 4.2.0 - '@smithy/util-endpoints': 3.2.8 - '@smithy/util-middleware': 4.2.8 + '@smithy/node-config-provider': 4.3.10 + '@smithy/types': 4.13.0 + '@smithy/util-config-provider': 4.2.1 + '@smithy/util-endpoints': 3.3.1 + '@smithy/util-middleware': 4.2.10 tslib: 2.8.1 - '@smithy/core@3.23.2': + '@smithy/core@3.23.6': dependencies: - '@smithy/middleware-serde': 4.2.9 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-base64': 4.3.0 - '@smithy/util-body-length-browser': 4.2.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-stream': 4.5.12 - '@smithy/util-utf8': 4.2.0 - '@smithy/uuid': 1.1.0 + '@smithy/middleware-serde': 4.2.11 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 + '@smithy/util-base64': 4.3.1 + '@smithy/util-body-length-browser': 4.2.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-stream': 4.5.15 + '@smithy/util-utf8': 4.2.1 + '@smithy/uuid': 1.1.1 tslib: 2.8.1 - '@smithy/credential-provider-imds@4.2.8': + '@smithy/credential-provider-imds@4.2.10': dependencies: - '@smithy/node-config-provider': 4.3.8 - '@smithy/property-provider': 4.2.8 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 + '@smithy/node-config-provider': 4.3.10 + '@smithy/property-provider': 4.2.10 + '@smithy/types': 4.13.0 + '@smithy/url-parser': 4.2.10 tslib: 2.8.1 - '@smithy/eventstream-codec@4.2.8': + '@smithy/eventstream-codec@4.2.10': dependencies: '@aws-crypto/crc32': 5.2.0 - '@smithy/types': 4.12.0 - '@smithy/util-hex-encoding': 4.2.0 + '@smithy/types': 4.13.0 + '@smithy/util-hex-encoding': 4.2.1 tslib: 2.8.1 - '@smithy/eventstream-serde-browser@4.2.8': + '@smithy/eventstream-serde-browser@4.2.10': dependencies: - '@smithy/eventstream-serde-universal': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/eventstream-serde-universal': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/eventstream-serde-config-resolver@4.3.8': + '@smithy/eventstream-serde-config-resolver@4.3.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/eventstream-serde-node@4.2.8': + '@smithy/eventstream-serde-node@4.2.10': dependencies: - '@smithy/eventstream-serde-universal': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/eventstream-serde-universal': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/eventstream-serde-universal@4.2.8': + '@smithy/eventstream-serde-universal@4.2.10': dependencies: - '@smithy/eventstream-codec': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/eventstream-codec': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/fetch-http-handler@5.3.9': + '@smithy/fetch-http-handler@5.3.11': dependencies: - '@smithy/protocol-http': 5.3.8 - '@smithy/querystring-builder': 4.2.8 - '@smithy/types': 4.12.0 - '@smithy/util-base64': 4.3.0 + '@smithy/protocol-http': 5.3.10 + '@smithy/querystring-builder': 4.2.10 + '@smithy/types': 4.13.0 + '@smithy/util-base64': 4.3.1 tslib: 2.8.1 - '@smithy/hash-blob-browser@4.2.9': + '@smithy/hash-blob-browser@4.2.11': dependencies: - '@smithy/chunked-blob-reader': 5.2.0 - '@smithy/chunked-blob-reader-native': 4.2.1 - '@smithy/types': 4.12.0 + '@smithy/chunked-blob-reader': 5.2.1 + '@smithy/chunked-blob-reader-native': 4.2.2 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/hash-node@4.2.8': + '@smithy/hash-node@4.2.10': dependencies: - '@smithy/types': 4.12.0 - '@smithy/util-buffer-from': 4.2.0 - '@smithy/util-utf8': 4.2.0 + '@smithy/types': 4.13.0 + '@smithy/util-buffer-from': 4.2.1 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@smithy/hash-stream-node@4.2.8': + '@smithy/hash-stream-node@4.2.10': dependencies: - '@smithy/types': 4.12.0 - '@smithy/util-utf8': 4.2.0 + '@smithy/types': 4.13.0 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@smithy/invalid-dependency@4.2.8': + '@smithy/invalid-dependency@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 '@smithy/is-array-buffer@2.2.0': dependencies: tslib: 2.8.1 - '@smithy/is-array-buffer@4.2.0': + '@smithy/is-array-buffer@4.2.1': dependencies: tslib: 2.8.1 - '@smithy/md5-js@4.2.8': + '@smithy/md5-js@4.2.10': dependencies: - '@smithy/types': 4.12.0 - '@smithy/util-utf8': 4.2.0 + '@smithy/types': 4.13.0 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@smithy/middleware-content-length@4.2.8': + '@smithy/middleware-content-length@4.2.10': dependencies: - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/middleware-endpoint@4.4.16': + '@smithy/middleware-endpoint@4.4.20': dependencies: - '@smithy/core': 3.23.2 - '@smithy/middleware-serde': 4.2.9 - '@smithy/node-config-provider': 4.3.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-middleware': 4.2.8 + '@smithy/core': 3.23.6 + '@smithy/middleware-serde': 4.2.11 + '@smithy/node-config-provider': 4.3.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 + '@smithy/url-parser': 4.2.10 + '@smithy/util-middleware': 4.2.10 tslib: 2.8.1 - '@smithy/middleware-retry@4.4.33': + '@smithy/middleware-retry@4.4.37': dependencies: - '@smithy/node-config-provider': 4.3.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/service-error-classification': 4.2.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-retry': 4.2.8 - '@smithy/uuid': 1.1.0 + '@smithy/node-config-provider': 4.3.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/service-error-classification': 4.2.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-retry': 4.2.10 + '@smithy/uuid': 1.1.1 tslib: 2.8.1 - '@smithy/middleware-serde@4.2.9': + '@smithy/middleware-serde@4.2.11': dependencies: - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/middleware-stack@4.2.8': + '@smithy/middleware-stack@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/node-config-provider@4.3.8': + '@smithy/node-config-provider@4.3.10': dependencies: - '@smithy/property-provider': 4.2.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 + '@smithy/property-provider': 4.2.10 + '@smithy/shared-ini-file-loader': 4.4.5 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/node-http-handler@4.4.10': + '@smithy/node-http-handler@4.4.12': dependencies: - '@smithy/abort-controller': 4.2.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/querystring-builder': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/abort-controller': 4.2.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/querystring-builder': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/property-provider@4.2.8': + '@smithy/property-provider@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/protocol-http@5.3.8': + '@smithy/protocol-http@5.3.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/querystring-builder@4.2.8': + '@smithy/querystring-builder@4.2.10': dependencies: - '@smithy/types': 4.12.0 - '@smithy/util-uri-escape': 4.2.0 + '@smithy/types': 4.13.0 + '@smithy/util-uri-escape': 4.2.1 tslib: 2.8.1 - '@smithy/querystring-parser@4.2.8': + '@smithy/querystring-parser@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/service-error-classification@4.2.8': + '@smithy/service-error-classification@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 - '@smithy/shared-ini-file-loader@4.4.3': + '@smithy/shared-ini-file-loader@4.4.5': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/signature-v4@5.3.8': + '@smithy/signature-v4@5.3.10': dependencies: - '@smithy/is-array-buffer': 4.2.0 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-hex-encoding': 4.2.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-uri-escape': 4.2.0 - '@smithy/util-utf8': 4.2.0 + '@smithy/is-array-buffer': 4.2.1 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 + '@smithy/util-hex-encoding': 4.2.1 + '@smithy/util-middleware': 4.2.10 + '@smithy/util-uri-escape': 4.2.1 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@smithy/smithy-client@4.11.5': + '@smithy/smithy-client@4.12.0': dependencies: - '@smithy/core': 3.23.2 - '@smithy/middleware-endpoint': 4.4.16 - '@smithy/middleware-stack': 4.2.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-stream': 4.5.12 + '@smithy/core': 3.23.6 + '@smithy/middleware-endpoint': 4.4.20 + '@smithy/middleware-stack': 4.2.10 + '@smithy/protocol-http': 5.3.10 + '@smithy/types': 4.13.0 + '@smithy/util-stream': 4.5.15 tslib: 2.8.1 - '@smithy/types@4.12.0': + '@smithy/types@4.13.0': dependencies: tslib: 2.8.1 - '@smithy/url-parser@4.2.8': + '@smithy/url-parser@4.2.10': dependencies: - '@smithy/querystring-parser': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/querystring-parser': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/util-base64@4.3.0': + '@smithy/util-base64@4.3.1': dependencies: - '@smithy/util-buffer-from': 4.2.0 - '@smithy/util-utf8': 4.2.0 + '@smithy/util-buffer-from': 4.2.1 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@smithy/util-body-length-browser@4.2.0': + '@smithy/util-body-length-browser@4.2.1': dependencies: tslib: 2.8.1 - '@smithy/util-body-length-node@4.2.1': + '@smithy/util-body-length-node@4.2.2': dependencies: tslib: 2.8.1 @@ -3021,65 +2968,65 @@ snapshots: '@smithy/is-array-buffer': 2.2.0 tslib: 2.8.1 - '@smithy/util-buffer-from@4.2.0': + '@smithy/util-buffer-from@4.2.1': dependencies: - '@smithy/is-array-buffer': 4.2.0 + '@smithy/is-array-buffer': 4.2.1 tslib: 2.8.1 - '@smithy/util-config-provider@4.2.0': + '@smithy/util-config-provider@4.2.1': dependencies: tslib: 2.8.1 - '@smithy/util-defaults-mode-browser@4.3.32': + '@smithy/util-defaults-mode-browser@4.3.36': dependencies: - '@smithy/property-provider': 4.2.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 + '@smithy/property-provider': 4.2.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/util-defaults-mode-node@4.2.35': + '@smithy/util-defaults-mode-node@4.2.39': dependencies: - '@smithy/config-resolver': 4.4.6 - '@smithy/credential-provider-imds': 4.2.8 - '@smithy/node-config-provider': 4.3.8 - '@smithy/property-provider': 4.2.8 - '@smithy/smithy-client': 4.11.5 - '@smithy/types': 4.12.0 + '@smithy/config-resolver': 4.4.9 + '@smithy/credential-provider-imds': 4.2.10 + '@smithy/node-config-provider': 4.3.10 + '@smithy/property-provider': 4.2.10 + '@smithy/smithy-client': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/util-endpoints@3.2.8': + '@smithy/util-endpoints@3.3.1': dependencies: - '@smithy/node-config-provider': 4.3.8 - '@smithy/types': 4.12.0 + '@smithy/node-config-provider': 4.3.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/util-hex-encoding@4.2.0': + '@smithy/util-hex-encoding@4.2.1': dependencies: tslib: 2.8.1 - '@smithy/util-middleware@4.2.8': + '@smithy/util-middleware@4.2.10': dependencies: - '@smithy/types': 4.12.0 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/util-retry@4.2.8': + '@smithy/util-retry@4.2.10': dependencies: - '@smithy/service-error-classification': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/service-error-classification': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/util-stream@4.5.12': + '@smithy/util-stream@4.5.15': dependencies: - '@smithy/fetch-http-handler': 5.3.9 - '@smithy/node-http-handler': 4.4.10 - '@smithy/types': 4.12.0 - '@smithy/util-base64': 4.3.0 - '@smithy/util-buffer-from': 4.2.0 - '@smithy/util-hex-encoding': 4.2.0 - '@smithy/util-utf8': 4.2.0 + '@smithy/fetch-http-handler': 5.3.11 + '@smithy/node-http-handler': 4.4.12 + '@smithy/types': 4.13.0 + '@smithy/util-base64': 4.3.1 + '@smithy/util-buffer-from': 4.2.1 + '@smithy/util-hex-encoding': 4.2.1 + '@smithy/util-utf8': 4.2.1 tslib: 2.8.1 - '@smithy/util-uri-escape@4.2.0': + '@smithy/util-uri-escape@4.2.1': dependencies: tslib: 2.8.1 @@ -3088,24 +3035,24 @@ snapshots: '@smithy/util-buffer-from': 2.2.0 tslib: 2.8.1 - '@smithy/util-utf8@4.2.0': + '@smithy/util-utf8@4.2.1': dependencies: - '@smithy/util-buffer-from': 4.2.0 + '@smithy/util-buffer-from': 4.2.1 tslib: 2.8.1 - '@smithy/util-waiter@4.2.8': + '@smithy/util-waiter@4.2.10': dependencies: - '@smithy/abort-controller': 4.2.8 - '@smithy/types': 4.12.0 + '@smithy/abort-controller': 4.2.10 + '@smithy/types': 4.13.0 tslib: 2.8.1 - '@smithy/uuid@1.1.0': + '@smithy/uuid@1.1.1': dependencies: tslib: 2.8.1 '@standard-schema/utils@0.3.0': {} - '@tailwindcss/node@4.2.0': + '@tailwindcss/node@4.2.1': dependencies: '@jridgewell/remapping': 2.3.5 enhanced-resolve: 5.19.0 @@ -3113,65 +3060,65 @@ snapshots: lightningcss: 1.31.1 magic-string: 0.30.21 source-map-js: 1.2.1 - tailwindcss: 4.2.0 + tailwindcss: 4.2.1 - '@tailwindcss/oxide-android-arm64@4.2.0': + '@tailwindcss/oxide-android-arm64@4.2.1': optional: true - '@tailwindcss/oxide-darwin-arm64@4.2.0': + '@tailwindcss/oxide-darwin-arm64@4.2.1': optional: true - '@tailwindcss/oxide-darwin-x64@4.2.0': + '@tailwindcss/oxide-darwin-x64@4.2.1': optional: true - '@tailwindcss/oxide-freebsd-x64@4.2.0': + '@tailwindcss/oxide-freebsd-x64@4.2.1': optional: true - '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.0': + '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.1': optional: true - '@tailwindcss/oxide-linux-arm64-gnu@4.2.0': + '@tailwindcss/oxide-linux-arm64-gnu@4.2.1': optional: true - '@tailwindcss/oxide-linux-arm64-musl@4.2.0': + '@tailwindcss/oxide-linux-arm64-musl@4.2.1': optional: true - '@tailwindcss/oxide-linux-x64-gnu@4.2.0': + '@tailwindcss/oxide-linux-x64-gnu@4.2.1': optional: true - '@tailwindcss/oxide-linux-x64-musl@4.2.0': + '@tailwindcss/oxide-linux-x64-musl@4.2.1': optional: true - '@tailwindcss/oxide-wasm32-wasi@4.2.0': + '@tailwindcss/oxide-wasm32-wasi@4.2.1': optional: true - '@tailwindcss/oxide-win32-arm64-msvc@4.2.0': + '@tailwindcss/oxide-win32-arm64-msvc@4.2.1': optional: true - '@tailwindcss/oxide-win32-x64-msvc@4.2.0': + '@tailwindcss/oxide-win32-x64-msvc@4.2.1': optional: true - '@tailwindcss/oxide@4.2.0': + '@tailwindcss/oxide@4.2.1': optionalDependencies: - '@tailwindcss/oxide-android-arm64': 4.2.0 - '@tailwindcss/oxide-darwin-arm64': 4.2.0 - '@tailwindcss/oxide-darwin-x64': 4.2.0 - '@tailwindcss/oxide-freebsd-x64': 4.2.0 - '@tailwindcss/oxide-linux-arm-gnueabihf': 4.2.0 - '@tailwindcss/oxide-linux-arm64-gnu': 4.2.0 - '@tailwindcss/oxide-linux-arm64-musl': 4.2.0 - '@tailwindcss/oxide-linux-x64-gnu': 4.2.0 - '@tailwindcss/oxide-linux-x64-musl': 4.2.0 - '@tailwindcss/oxide-wasm32-wasi': 4.2.0 - '@tailwindcss/oxide-win32-arm64-msvc': 4.2.0 - '@tailwindcss/oxide-win32-x64-msvc': 4.2.0 + '@tailwindcss/oxide-android-arm64': 4.2.1 + '@tailwindcss/oxide-darwin-arm64': 4.2.1 + '@tailwindcss/oxide-darwin-x64': 4.2.1 + '@tailwindcss/oxide-freebsd-x64': 4.2.1 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.2.1 + '@tailwindcss/oxide-linux-arm64-gnu': 4.2.1 + '@tailwindcss/oxide-linux-arm64-musl': 4.2.1 + '@tailwindcss/oxide-linux-x64-gnu': 4.2.1 + '@tailwindcss/oxide-linux-x64-musl': 4.2.1 + '@tailwindcss/oxide-wasm32-wasi': 4.2.1 + '@tailwindcss/oxide-win32-arm64-msvc': 4.2.1 + '@tailwindcss/oxide-win32-x64-msvc': 4.2.1 - '@tailwindcss/vite@4.2.0(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': + '@tailwindcss/vite@4.2.1(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': dependencies: - '@tailwindcss/node': 4.2.0 - '@tailwindcss/oxide': 4.2.0 - tailwindcss: 4.2.0 - vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) + '@tailwindcss/node': 4.2.1 + '@tailwindcss/oxide': 4.2.1 + tailwindcss: 4.2.1 + vite: 7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) '@tanstack/history@1.161.4': {} @@ -3182,11 +3129,11 @@ snapshots: '@tanstack/query-core': 5.90.20 react: 19.2.4 - '@tanstack/react-router@1.162.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': + '@tanstack/react-router@1.163.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': dependencies: '@tanstack/history': 1.161.4 '@tanstack/react-store': 0.9.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - '@tanstack/router-core': 1.162.1 + '@tanstack/router-core': 1.163.3 isbot: 5.1.35 react: 19.2.4 react-dom: 19.2.4(react@19.2.4) @@ -3200,7 +3147,7 @@ snapshots: react-dom: 19.2.4(react@19.2.4) use-sync-external-store: 1.6.0(react@19.2.4) - '@tanstack/router-core@1.162.1': + '@tanstack/router-core@1.163.3': dependencies: '@tanstack/history': 1.161.4 '@tanstack/store': 0.9.1 @@ -3210,9 +3157,9 @@ snapshots: tiny-invariant: 1.3.3 tiny-warning: 1.0.3 - '@tanstack/router-generator@1.162.1': + '@tanstack/router-generator@1.163.3': dependencies: - '@tanstack/router-core': 1.162.1 + '@tanstack/router-core': 1.163.3 '@tanstack/router-utils': 1.161.4 '@tanstack/virtual-file-routes': 1.161.4 prettier: 3.8.1 @@ -3223,7 +3170,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@tanstack/router-plugin@1.162.1(@tanstack/react-router@1.162.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': + '@tanstack/router-plugin@1.163.3(@tanstack/react-router@1.163.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': dependencies: '@babel/core': 7.29.0 '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) @@ -3231,16 +3178,16 @@ snapshots: '@babel/template': 7.28.6 '@babel/traverse': 7.29.0 '@babel/types': 7.29.0 - '@tanstack/router-core': 1.162.1 - '@tanstack/router-generator': 1.162.1 + '@tanstack/router-core': 1.163.3 + '@tanstack/router-generator': 1.163.3 '@tanstack/router-utils': 1.161.4 '@tanstack/virtual-file-routes': 1.161.4 chokidar: 3.6.0 unplugin: 2.3.11 zod: 3.25.76 optionalDependencies: - '@tanstack/react-router': 1.162.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) + '@tanstack/react-router': 1.163.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + vite: 7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) transitivePeerDependencies: - supports-color @@ -3285,7 +3232,7 @@ snapshots: '@types/estree@1.0.8': {} - '@types/node@24.10.13': + '@types/node@24.10.15': dependencies: undici-types: 7.16.0 @@ -3297,11 +3244,11 @@ snapshots: dependencies: csstype: 3.2.3 - '@vitejs/plugin-basic-ssl@2.1.4(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': + '@vitejs/plugin-basic-ssl@2.1.4(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': dependencies: - vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) + vite: 7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) - '@vitejs/plugin-react@5.1.4(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': + '@vitejs/plugin-react@5.1.4(vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0))': dependencies: '@babel/core': 7.29.0 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.29.0) @@ -3309,7 +3256,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-rc.3 '@types/babel__core': 7.20.5 react-refresh: 0.18.0 - vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) + vite: 7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0) transitivePeerDependencies: - supports-color @@ -3339,7 +3286,7 @@ snapshots: dependencies: '@babel/types': 7.29.0 - balanced-match@4.0.3: {} + balanced-match@4.0.4: {} base64-js@1.5.1: {} @@ -3349,9 +3296,9 @@ snapshots: bowser@2.14.1: {} - brace-expansion@5.0.2: + brace-expansion@5.0.4: dependencies: - balanced-match: 4.0.3 + balanced-match: 4.0.4 braces@3.0.3: dependencies: @@ -3360,7 +3307,7 @@ snapshots: browserslist@4.28.1: dependencies: baseline-browser-mapping: 2.10.0 - caniuse-lite: 1.0.30001770 + caniuse-lite: 1.0.30001774 electron-to-chromium: 1.5.302 node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) @@ -3370,7 +3317,7 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - caniuse-lite@1.0.30001770: {} + caniuse-lite@1.0.30001774: {} chokidar@3.6.0: dependencies: @@ -3452,8 +3399,11 @@ snapshots: events@3.3.0: {} - fast-xml-parser@5.3.6: + fast-xml-builder@1.0.0: {} + + fast-xml-parser@5.4.1: dependencies: + fast-xml-builder: 1.0.0 strnum: 2.1.2 fdir@6.5.0(picomatch@4.0.3): @@ -3479,7 +3429,7 @@ snapshots: glob@13.0.6: dependencies: - minimatch: 10.2.2 + minimatch: 10.2.4 minipass: 7.1.3 path-scurry: 2.0.2 @@ -3576,9 +3526,9 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 - minimatch@10.2.2: + minimatch@10.2.4: dependencies: - brace-expansion: 5.0.2 + brace-expansion: 5.0.4 minipass@7.1.3: {} @@ -3652,35 +3602,35 @@ snapshots: resolve-pkg-maps@1.0.0: {} - rollup@4.58.0: + rollup@4.59.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.58.0 - '@rollup/rollup-android-arm64': 4.58.0 - '@rollup/rollup-darwin-arm64': 4.58.0 - '@rollup/rollup-darwin-x64': 4.58.0 - '@rollup/rollup-freebsd-arm64': 4.58.0 - '@rollup/rollup-freebsd-x64': 4.58.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.58.0 - '@rollup/rollup-linux-arm-musleabihf': 4.58.0 - '@rollup/rollup-linux-arm64-gnu': 4.58.0 - '@rollup/rollup-linux-arm64-musl': 4.58.0 - '@rollup/rollup-linux-loong64-gnu': 4.58.0 - '@rollup/rollup-linux-loong64-musl': 4.58.0 - '@rollup/rollup-linux-ppc64-gnu': 4.58.0 - '@rollup/rollup-linux-ppc64-musl': 4.58.0 - '@rollup/rollup-linux-riscv64-gnu': 4.58.0 - '@rollup/rollup-linux-riscv64-musl': 4.58.0 - '@rollup/rollup-linux-s390x-gnu': 4.58.0 - '@rollup/rollup-linux-x64-gnu': 4.58.0 - '@rollup/rollup-linux-x64-musl': 4.58.0 - '@rollup/rollup-openbsd-x64': 4.58.0 - '@rollup/rollup-openharmony-arm64': 4.58.0 - '@rollup/rollup-win32-arm64-msvc': 4.58.0 - '@rollup/rollup-win32-ia32-msvc': 4.58.0 - '@rollup/rollup-win32-x64-gnu': 4.58.0 - '@rollup/rollup-win32-x64-msvc': 4.58.0 + '@rollup/rollup-android-arm-eabi': 4.59.0 + '@rollup/rollup-android-arm64': 4.59.0 + '@rollup/rollup-darwin-arm64': 4.59.0 + '@rollup/rollup-darwin-x64': 4.59.0 + '@rollup/rollup-freebsd-arm64': 4.59.0 + '@rollup/rollup-freebsd-x64': 4.59.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 + '@rollup/rollup-linux-arm-musleabihf': 4.59.0 + '@rollup/rollup-linux-arm64-gnu': 4.59.0 + '@rollup/rollup-linux-arm64-musl': 4.59.0 + '@rollup/rollup-linux-loong64-gnu': 4.59.0 + '@rollup/rollup-linux-loong64-musl': 4.59.0 + '@rollup/rollup-linux-ppc64-gnu': 4.59.0 + '@rollup/rollup-linux-ppc64-musl': 4.59.0 + '@rollup/rollup-linux-riscv64-gnu': 4.59.0 + '@rollup/rollup-linux-riscv64-musl': 4.59.0 + '@rollup/rollup-linux-s390x-gnu': 4.59.0 + '@rollup/rollup-linux-x64-gnu': 4.59.0 + '@rollup/rollup-linux-x64-musl': 4.59.0 + '@rollup/rollup-openbsd-x64': 4.59.0 + '@rollup/rollup-openharmony-arm64': 4.59.0 + '@rollup/rollup-win32-arm64-msvc': 4.59.0 + '@rollup/rollup-win32-ia32-msvc': 4.59.0 + '@rollup/rollup-win32-x64-gnu': 4.59.0 + '@rollup/rollup-win32-x64-msvc': 4.59.0 fsevents: 2.3.3 safe-buffer@5.2.1: {} @@ -3718,7 +3668,7 @@ snapshots: tailwind-merge@3.5.0: {} - tailwindcss@4.2.0: {} + tailwindcss@4.2.1: {} tapable@2.3.0: {} @@ -3748,7 +3698,7 @@ snapshots: typescript@5.9.3: {} - ultracite@7.2.3: + ultracite@7.2.4: dependencies: '@clack/prompts': 1.0.1 commander: 14.0.3 @@ -3778,16 +3728,16 @@ snapshots: util-deprecate@1.0.2: {} - vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0): + vite@7.3.1(@types/node@24.10.15)(jiti@2.6.1)(lightningcss@1.31.1)(tsx@4.21.0): dependencies: esbuild: 0.27.3 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.58.0 + rollup: 4.59.0 tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 24.10.13 + '@types/node': 24.10.15 fsevents: 2.3.3 jiti: 2.6.1 lightningcss: 1.31.1 diff --git a/hive/services/hiveui/frontend/src/lib/awsClient.ts b/hive/services/hiveui/frontend/src/lib/awsClient.ts index 587f51b9f..12c8adebf 100644 --- a/hive/services/hiveui/frontend/src/lib/awsClient.ts +++ b/hive/services/hiveui/frontend/src/lib/awsClient.ts @@ -3,6 +3,9 @@ import { S3Client } from "@aws-sdk/client-s3" import { getCredentials } from "./auth" +const awsEndpoint = `${window.location.protocol}//${window.location.hostname}:9999` +const s3Endpoint = `${window.location.protocol}//${window.location.hostname}:8443` + // Cached singleton clients let ec2Client: EC2Client | null = null let s3Client: S3Client | null = null @@ -14,7 +17,7 @@ export function getEc2Client(): EC2Client { throw new Error("AWS credentials not configured") } ec2Client = new EC2Client({ - endpoint: "https://localhost:9999", + endpoint: awsEndpoint, region: "ap-southeast-2", credentials: { accessKeyId: credentials.accessKeyId, @@ -32,7 +35,7 @@ export function getS3Client(): S3Client { throw new Error("AWS credentials not configured") } s3Client = new S3Client({ - endpoint: "https://localhost:8443", + endpoint: s3Endpoint, region: "ap-southeast-2", credentials: { accessKeyId: credentials.accessKeyId, diff --git a/hive/services/hiveui/frontend/src/routes/login.tsx b/hive/services/hiveui/frontend/src/routes/login.tsx index 5cdee4c99..5d04669d1 100644 --- a/hive/services/hiveui/frontend/src/routes/login.tsx +++ b/hive/services/hiveui/frontend/src/routes/login.tsx @@ -3,13 +3,7 @@ import { createFileRoute, redirect, useNavigate } from "@tanstack/react-router" import { useForm } from "react-hook-form" import { Button } from "@/components/ui/button" -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Field, FieldError, @@ -53,9 +47,6 @@ function LoginPage() { AWS Credentials - - Run cat ~/hive/config/hive.toml to get your credentials -
diff --git a/hive/services/hiveui/hiveui.go b/hive/services/hiveui/hiveui.go index 05bf44b3f..a5819d827 100644 --- a/hive/services/hiveui/hiveui.go +++ b/hive/services/hiveui/hiveui.go @@ -6,6 +6,7 @@ import ( "fmt" "io/fs" "log/slog" + "net" "net/http" "os" "os/signal" @@ -210,8 +211,10 @@ func (svc *Service) launchService() error { } func securityHeadersMiddleware(next http.Handler) http.Handler { + csp := buildCSP() + slog.Info("Content-Security-Policy configured", "csp", csp) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Security-Policy", "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self'; font-src 'self' data:; connect-src 'self' https://localhost:9999 https://localhost:8443; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests;") + w.Header().Set("Content-Security-Policy", csp) w.Header().Set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), browsing-topics=()") w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin") w.Header().Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains") @@ -220,6 +223,53 @@ func securityHeadersMiddleware(next http.Handler) http.Handler { }) } +// getLocalIPs returns all non-loopback IPv4 addresses on the machine. +func getLocalIPs() []string { + var ips []string + ifaces, err := net.Interfaces() + if err != nil { + slog.Warn("Failed to get network interfaces for CSP", "error", err) + return ips + } + for _, iface := range ifaces { + if iface.Flags&net.FlagUp == 0 || iface.Flags&net.FlagLoopback != 0 { + continue + } + addrs, err := iface.Addrs() + if err != nil { + continue + } + for _, addr := range addrs { + var ip net.IP + switch v := addr.(type) { + case *net.IPNet: + ip = v.IP + case *net.IPAddr: + ip = v.IP + } + if ip == nil || ip.IsLoopback() || ip.To4() == nil { + continue + } + ips = append(ips, ip.String()) + } + } + return ips +} + +// buildCSP constructs the Content-Security-Policy header, dynamically adding +// each local IP with the AWS Gateway (:9999) and daemon (:8443) ports to connect-src. +func buildCSP() string { + var b strings.Builder + b.WriteString("'self' https://localhost:9999 https://localhost:8443") + for _, ip := range getLocalIPs() { + fmt.Fprintf(&b, " https://%s:9999 https://%s:8443", ip, ip) + } + return fmt.Sprintf( + "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self'; font-src 'self' data:; connect-src %s; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests;", + b.String(), + ) +} + func gzipMiddleware(next http.Handler) http.Handler { g, err := gziphandler.GzipHandlerWithOpts(gziphandler.ContentTypes([]string{ "text/html", diff --git a/hive/services/hiveui/hiveui_test.go b/hive/services/hiveui/hiveui_test.go index 72325c555..650818378 100644 --- a/hive/services/hiveui/hiveui_test.go +++ b/hive/services/hiveui/hiveui_test.go @@ -244,6 +244,34 @@ func TestGzipMiddleware_IgnoresNonTextContent(t *testing.T) { assert.NotEqual(t, "gzip", resp.Header.Get("Content-Encoding")) } +func TestGetLocalIPs_ReturnsNonLoopback(t *testing.T) { + ips := getLocalIPs() + for _, ip := range ips { + assert.NotEqual(t, "127.0.0.1", ip, "should not include loopback") + } +} + +func TestBuildCSP_ContainsSelf(t *testing.T) { + csp := buildCSP() + assert.Contains(t, csp, "connect-src 'self'") + assert.Contains(t, csp, "default-src 'self'") +} + +func TestBuildCSP_ContainsLocalIPs(t *testing.T) { + ips := getLocalIPs() + csp := buildCSP() + for _, ip := range ips { + assert.Contains(t, csp, "https://"+ip+":9999") + assert.Contains(t, csp, "https://"+ip+":8443") + } +} + +func TestBuildCSP_ContainsLocalhost(t *testing.T) { + csp := buildCSP() + assert.Contains(t, csp, "https://localhost:9999") + assert.Contains(t, csp, "https://localhost:8443") +} + func TestShutdown_WithServer(t *testing.T) { // Create a real server on a random port so Shutdown exercises the non-nil path mux := http.NewServeMux() diff --git a/hive/utils/utils.go b/hive/utils/utils.go index dde78264c..78bcd636b 100644 --- a/hive/utils/utils.go +++ b/hive/utils/utils.go @@ -887,7 +887,7 @@ func CreateS3Client(cfg *config.Config) *s3.S3 { sess := session.Must(session.NewSession(&aws.Config{ Region: aws.String(cfg.Predastore.Region), Endpoint: aws.String(fmt.Sprintf("https://%s", cfg.Predastore.Host)), - Credentials: credentials.NewStaticCredentials(cfg.AccessKey, cfg.SecretKey, ""), + Credentials: credentials.NewStaticCredentials(cfg.Predastore.AccessKey, cfg.Predastore.SecretKey, ""), S3ForcePathStyle: aws.Bool(true), DisableSSL: aws.Bool(false), HTTPClient: httpClient, diff --git a/scripts/reset-dev-env.sh b/scripts/reset-dev-env.sh index 660bfdc8c..e467ff4d3 100755 --- a/scripts/reset-dev-env.sh +++ b/scripts/reset-dev-env.sh @@ -19,7 +19,7 @@ rm -rf ~/hive/nats/* rm -rf ~/hive/images/* # Enable pprof for development -PPROF_ENABLED=1 PPROF_OUTPUT=/tmp/hive-vm.prof ./scripts/start-dev.sh +PPROF_ENABLED=1 PPROF_OUTPUT=/tmp/hive-vm.prof ./scripts/start-dev.sh --build # Follow INSTALL.md steps echo "Importing AMI" diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh index a022edf40..6688dc614 100755 --- a/scripts/start-dev.sh +++ b/scripts/start-dev.sh @@ -154,7 +154,7 @@ check_service() { local name="$1" local host="$2" local port="$3" - local max_attempts=10 + local max_attempts="${4:-30}" local attempt=1 echo "šŸ” Checking $name connectivity on $host:$port..." @@ -169,8 +169,8 @@ check_service() { ((attempt++)) done - echo " āš ļø $name may not be responding on $host:$port (continuing anyway)" - + echo " āŒ $name failed to start on $host:$port after $max_attempts attempts" + exit 1 } # Pre-flight, compile latest (only with --build flag) @@ -353,7 +353,7 @@ if has_service "awsgw"; then unset HIVE_NATS_HOST unset HIVE_PREDASTORE_HOST - export HIVE_BASE_DIR=$CONFIG_DIR + export HIVE_BASE_DIR=$DATA_DIR export HIVE_CONFIG_PATH=$CONFIG_DIR/hive.toml export HIVE_AWSGW_TLS_CERT=$CONFIG_DIR/server.pem export HIVE_AWSGW_TLS_KEY=$CONFIG_DIR/server.key diff --git a/tests/e2e/TEST_COVERAGE.md b/tests/e2e/TEST_COVERAGE.md index 85c3fdc95..5d059017e 100644 --- a/tests/e2e/TEST_COVERAGE.md +++ b/tests/e2e/TEST_COVERAGE.md @@ -146,6 +146,65 @@ - `delete-key-pair` on non-existent key (expect success — idempotent, matches AWS) - `modify-instance-attribute` on running instance (expect `InvalidInstanceID.NotFound` — running instances not in stopped KV) +### IAM Phase 1: User CRUD +- Root auth via `iam list-users` (root user exists) +- `create-user` (alice, bob with path) +- Duplicate user (expect `EntityAlreadyExists`) +- `get-user` (alice) +- `get-user` non-existent (expect `NoSuchEntity`) +- `list-users` (verify count) +- `list-users` with `--path-prefix` filter + +### IAM Phase 2: Access Key Lifecycle +- `create-access-key` (alice key 1, key 2) +- Third key exceeds limit (expect `LimitExceeded`) +- `create-access-key` for non-existent user (expect `NoSuchEntity`) +- `list-access-keys` (alice: 2 keys, bob: 0 keys) +- `update-access-key` (Inactive, verify status, reactivate) +- `delete-access-key` (verify count decremented) + +### IAM Phase 3: User Authentication +- Configure IAM user profile with access key +- Deactivate key → auth rejected (`InvalidClientTokenId`) +- Reactivate key +- Wrong secret → `SignatureDoesNotMatch` +- Non-existent key ID → `InvalidClientTokenId` +- Multi-user simultaneous auth (root + bob) + +### IAM Phase 4: Policy CRUD +- `create-policy` (EC2ReadOnly, FullAdmin, DenyTerminate, IAMReadOnly, EC2DescribeAll) +- Duplicate policy (expect `EntityAlreadyExists`) +- Malformed JSON (expect `MalformedPolicyDocument`) +- `get-policy` (by ARN) +- `get-policy` non-existent (expect `NoSuchEntity`) +- `get-policy-version` (v1) +- `list-policies` (verify count) + +### IAM Phase 5: Policy Attachment & Enforcement +- Create charlie with access key +- `attach-user-policy` (alice: EC2ReadOnly + IAMReadOnly, bob: DenyTerminate) +- `list-attached-user-policies` (verify count) +- Idempotent attach (no duplicate) +- Attach non-existent policy (expect `NoSuchEntity`) +- Attach to non-existent user (expect `NoSuchEntity`) +- **Default Deny**: charlie (no policies) → `AccessDenied` on ec2 + iam +- **Explicit Allow**: alice → ec2:Describe{Instances,Vpcs} allowed, ec2:DescribeKeyPairs denied, iam:ListUsers allowed, iam:CreateUser denied +- **Deny Override**: bob → ec2:Describe allowed, ec2:TerminateInstances denied (explicit Deny), iam denied +- **Root Bypass**: root user → all actions succeed +- **Prefix Wildcard**: swap alice to EC2DescribeAll (ec2:Describe*) → Describe* allowed, non-Describe denied +- **FullAdmin**: charlie with FullAdmin → all actions allowed + +### IAM Phase 6: Policy Lifecycle — Detach & Delete +- `detach-user-policy` → user loses access +- `delete-policy` while attached (expect `DeleteConflict`) +- Detach then delete → `get-policy` returns `NoSuchEntity` + +### IAM Phase 7: IAM Cleanup +- Delete all test users (remove keys + policies first) +- Verify root-only remains (`list-users` count = 1) +- Delete all test policies (`list-policies` count = 0) +- Clean up AWS CLI profiles + ### Phase 9: Terminate and Verify Cleanup - `delete-snapshot` (CreateImage backing snapshot, so DeleteOnTermination is not blocked) - `terminate-instances` (poll -> terminated) @@ -273,7 +332,45 @@ - Verify crash loop is detected and restarts stop after max attempts (3 in 10-min window) - Verify instance reaches error state (won't restart further) -### Phase 5c: VPC Networking +### Phase 5c: IAM Accounts & Cross-Account Isolation + +#### Step 1: Create Accounts +- `hive admin account create` (Team Alpha, Team Beta) +- Verify sequential 12-digit account IDs +- `hive admin account list` (verify both accounts) + +#### Step 2: Account Admin Auth +- Alpha admin authenticates via ec2 + iam +- Beta admin authenticates via ec2 + iam + +#### Step 3: Account-Scoped Users +- `create-user` alice in Alpha + Beta (same name, different accounts) +- `create-user` team-member (Alpha), dev-user (Beta) +- `list-users` scoped per account (verify different user lists) +- Cross-account isolation: Alpha cannot see Beta's users and vice versa (`NoSuchEntity`) + +#### Step 4: Account-Scoped Access Keys +- `create-access-key` for alice in Alpha + Beta +- Configure separate AWS CLI profiles per account user + +#### Step 5: Account-Scoped Policies & Enforcement +- `create-policy` EC2ReadOnly in Alpha (narrow: DescribeInstances + DescribeVpcs) +- `create-policy` EC2ReadOnly in Beta (broad: ec2:Describe*) +- `attach-user-policy` to alice in both accounts +- Alpha alice: DescribeInstances allowed, DescribeKeyPairs denied (narrow) +- Beta alice: DescribeInstances allowed, DescribeKeyPairs allowed (broad Describe*) +- Both denied: CreateKeyPair + +#### Step 6: Cross-Account Delete Isolation +- Delete Alpha's alice (detach policy, delete key, delete user) +- Verify Alpha alice gone (`NoSuchEntity`) +- Verify Beta alice unaffected (still exists, auth still works) + +#### Step 7: IAM Account Cleanup +- Delete all account users, policies, access keys +- Clean up AWS CLI profiles + +### Phase 5d: VPC Networking - Step 1: `create-vpc` (10.100.0.0/16) + `create-subnet` (10.100.1.0/24) - Step 2: `run-instances` x3 with `--subnet-id` (launch into VPC subnet) - Poll all VPC instances to running state diff --git a/tests/e2e/run-e2e.sh b/tests/e2e/run-e2e.sh index 299578597..14add6ab6 100755 --- a/tests/e2e/run-e2e.sh +++ b/tests/e2e/run-e2e.sh @@ -39,9 +39,19 @@ cleanup() { } trap cleanup EXIT -# Use Hive profile +# Use Hive profile (hive admin init sets endpoint_url, ca_bundle, region in ~/.aws/config) export AWS_PROFILE=hive +# Helper: set up an AWS CLI profile with credentials + endpoint/CA config from the hive profile +setup_test_profile() { + local profile="$1" key_id="$2" secret="$3" + aws configure set aws_access_key_id "$key_id" --profile "$profile" + aws configure set aws_secret_access_key "$secret" --profile "$profile" + aws configure set region "$(aws configure get region)" --profile "$profile" + aws configure set endpoint_url "$(aws configure get endpoint_url)" --profile "$profile" + aws configure set ca_bundle "$(aws configure get ca_bundle)" --profile "$profile" +} + # Ensure we are in the project root cd "$(dirname "$0")/../.." @@ -99,8 +109,7 @@ fi # Wait for daemon NATS subscriptions to be active wait_for_daemon_ready "https://localhost:9999" -# Define common AWS CLI args -AWS_EC2="aws --endpoint-url https://localhost:9999 ec2" +# No need for AWS_EC2/AWS_IAM vars — endpoint_url and ca_bundle are in the profile config # Phase 1b: Cluster Stats CLI echo "Phase 1b: Cluster Stats CLI" @@ -138,11 +147,11 @@ echo "hive get vms (empty) passed" # Phase 2: Discovery & Metadata echo "Phase 2: Discovery & Metadata" # Verify describe-regions (just ensure it returns at least one region) -$AWS_EC2 describe-regions | jq -e '.Regions | length > 0' +aws ec2 describe-regions | jq -e '.Regions | length > 0' # Verify describe-availability-zones echo "Verifying describe-availability-zones..." -AZ_OUTPUT=$($AWS_EC2 describe-availability-zones) +AZ_OUTPUT=$(aws ec2 describe-availability-zones) echo "$AZ_OUTPUT" | jq -e '.AvailabilityZones | length > 0' AZ_NAME=$(echo "$AZ_OUTPUT" | jq -r '.AvailabilityZones[0].ZoneName') AZ_STATE=$(echo "$AZ_OUTPUT" | jq -r '.AvailabilityZones[0].State') @@ -155,7 +164,7 @@ echo "DescribeAvailabilityZones verified (Zone=$AZ_NAME, State=$AZ_STATE)" # Discover available instance types from Hive # Hive generates these based on the host CPU (e.g., m7i.micro, m8g.small, etc.) echo "Discovering available instance types..." -AVAILABLE_TYPES=$($AWS_EC2 describe-instance-types --query 'InstanceTypes[*].InstanceType' --output text) +AVAILABLE_TYPES=$(aws ec2 describe-instance-types --query 'InstanceTypes[*].InstanceType' --output text) echo "Available instance types: $AVAILABLE_TYPES" # Pick the nano instance type for minimal resource usage in tests @@ -167,17 +176,17 @@ fi echo "Selected instance type for test: $INSTANCE_TYPE" # Get architecture for the selected instance type -ARCH=$($AWS_EC2 describe-instance-types --instance-types "$INSTANCE_TYPE" --query 'InstanceTypes[0].ProcessorInfo.SupportedArchitectures[0]' --output text) +ARCH=$(aws ec2 describe-instance-types --instance-types "$INSTANCE_TYPE" --query 'InstanceTypes[0].ProcessorInfo.SupportedArchitectures[0]' --output text) echo "Detected architecture for $INSTANCE_TYPE: $ARCH" # Verify describe-instance-types (ensure the chosen type is available) -$AWS_EC2 describe-instance-types | jq -e ".InstanceTypes[] | select(.InstanceType==\"$INSTANCE_TYPE\")" +aws ec2 describe-instance-types | jq -e ".InstanceTypes[] | select(.InstanceType==\"$INSTANCE_TYPE\")" # Phase 2b: Serial Console Access Settings echo "Phase 2b: Serial Console Access Settings" # Default should be disabled -SERIAL_DEFAULT=$($AWS_EC2 get-serial-console-access-status --query 'SerialConsoleAccessEnabled' --output text) +SERIAL_DEFAULT=$(aws ec2 get-serial-console-access-status --query 'SerialConsoleAccessEnabled' --output text) if [ "$SERIAL_DEFAULT" != "False" ]; then echo "Expected serial console access default to be False, got $SERIAL_DEFAULT" exit 1 @@ -185,12 +194,12 @@ fi echo " Default state: disabled" # Enable -ENABLE_RESULT=$($AWS_EC2 enable-serial-console-access --query 'SerialConsoleAccessEnabled' --output text) +ENABLE_RESULT=$(aws ec2 enable-serial-console-access --query 'SerialConsoleAccessEnabled' --output text) if [ "$ENABLE_RESULT" != "True" ]; then echo "Expected enable to return True, got $ENABLE_RESULT" exit 1 fi -SERIAL_ENABLED=$($AWS_EC2 get-serial-console-access-status --query 'SerialConsoleAccessEnabled' --output text) +SERIAL_ENABLED=$(aws ec2 get-serial-console-access-status --query 'SerialConsoleAccessEnabled' --output text) if [ "$SERIAL_ENABLED" != "True" ]; then echo "Expected serial console access to be True after enable, got $SERIAL_ENABLED" exit 1 @@ -198,12 +207,12 @@ fi echo " Enabled: $SERIAL_ENABLED" # Disable -DISABLE_RESULT=$($AWS_EC2 disable-serial-console-access --query 'SerialConsoleAccessEnabled' --output text) +DISABLE_RESULT=$(aws ec2 disable-serial-console-access --query 'SerialConsoleAccessEnabled' --output text) if [ "$DISABLE_RESULT" != "False" ]; then echo "Expected disable to return False, got $DISABLE_RESULT" exit 1 fi -SERIAL_DISABLED=$($AWS_EC2 get-serial-console-access-status --query 'SerialConsoleAccessEnabled' --output text) +SERIAL_DISABLED=$(aws ec2 get-serial-console-access-status --query 'SerialConsoleAccessEnabled' --output text) if [ "$SERIAL_DISABLED" != "False" ]; then echo "Expected serial console access to be False after disable, got $SERIAL_DISABLED" exit 1 @@ -214,7 +223,7 @@ echo "Serial console access settings tests passed" # Phase 3: SSH Key Management echo "Phase 3: SSH Key Management" # Create test-key-1 (create-key-pair) and verify private key material is returned -KEY_MATERIAL=$($AWS_EC2 create-key-pair --key-name test-key-1 --query 'KeyMaterial' --output text) +KEY_MATERIAL=$(aws ec2 create-key-pair --key-name test-key-1 --query 'KeyMaterial' --output text) if [ -z "$KEY_MATERIAL" ] || [ "$KEY_MATERIAL" == "None" ]; then echo "Failed to create key pair test-key-1" exit 1 @@ -224,15 +233,15 @@ chmod 600 test-key-1.pem # Generate a local RSA key and import it as test-key-2 (import-key-pair) ssh-keygen -t rsa -b 2048 -f test-key-2-local -N "" -$AWS_EC2 import-key-pair --key-name test-key-2 --public-key-material "fileb://test-key-2-local.pub" +aws ec2 import-key-pair --key-name test-key-2 --public-key-material "fileb://test-key-2-local.pub" # Verify both keys are present (describe-key-pairs) -$AWS_EC2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output text | grep test-key-1 -$AWS_EC2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output text | grep test-key-2 +aws ec2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output text | grep test-key-1 +aws ec2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output text | grep test-key-2 # Delete test-key-2 (delete-key-pair) and verify only one remains -$AWS_EC2 delete-key-pair --key-name test-key-2 -REMAINING_KEYS=$($AWS_EC2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output text) +aws ec2 delete-key-pair --key-name test-key-2 +REMAINING_KEYS=$(aws ec2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output text) echo "Remaining keys: $REMAINING_KEYS" echo "$REMAINING_KEYS" | grep test-key-1 if echo "$REMAINING_KEYS" | grep -q test-key-2; then @@ -268,7 +277,7 @@ echo "Captured AMI ID: $AMI_ID" # Verify the AMI exists using its ID (describe-images) echo "Verifying AMI availability..." -$AWS_EC2 describe-images --image-ids "$AMI_ID" | jq -e ".Images[0] | select(.ImageId==\"$AMI_ID\")" +aws ec2 describe-images --image-ids "$AMI_ID" | jq -e ".Images[0] | select(.ImageId==\"$AMI_ID\")" # Phase 5: Instance Lifecycle echo "Phase 5: Instance Lifecycle" @@ -276,7 +285,7 @@ echo "Phase 5: Instance Lifecycle" echo "Running: aws ec2 run-instances --image-id $AMI_ID --instance-type $INSTANCE_TYPE --key-name test-key-1" # Capture full output for debugging set +e # Temporarily disable exit on error to capture output -RUN_OUTPUT=$($AWS_EC2 run-instances --image-id "$AMI_ID" --instance-type "$INSTANCE_TYPE" --key-name test-key-1 2>&1) +RUN_OUTPUT=$(aws ec2 run-instances --image-id "$AMI_ID" --instance-type "$INSTANCE_TYPE" --key-name test-key-1 2>&1) RUN_EXIT_CODE=$? set -e # Re-enable exit on error echo "Run instances exit code: $RUN_EXIT_CODE" @@ -298,7 +307,7 @@ COUNT=0 STATE="unknown" while [ $COUNT -lt 30 ]; do # Capture full output to check if instance even exists in the response - DESCRIBE_OUTPUT=$($AWS_EC2 describe-instances --instance-ids "$INSTANCE_ID") || { + DESCRIBE_OUTPUT=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID") || { echo "āš ļø Gateway request failed, retrying... ($COUNT/30)" sleep 2 COUNT=$((COUNT + 1)) @@ -346,7 +355,7 @@ echo "hive get vms shows running instance" # Phase 5a: Validate instance metadata fields echo "Phase 5a: Instance Metadata Validation" -DESCRIBE_META=$($AWS_EC2 describe-instances --instance-ids "$INSTANCE_ID") +DESCRIBE_META=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID") META_TYPE=$(echo "$DESCRIBE_META" | jq -r '.Reservations[0].Instances[0].InstanceType') META_KEY=$(echo "$DESCRIBE_META" | jq -r '.Reservations[0].Instances[0].KeyName') META_IMAGE=$(echo "$DESCRIBE_META" | jq -r '.Reservations[0].Instances[0].ImageId') @@ -391,7 +400,7 @@ test_ssh_connectivity "$SSH_HOST" "$SSH_PORT" "test-key-1.pem" # Check root volume size via lsblk echo "Verifying root volume size from inside the VM..." -ROOT_VOL_SIZE_API=$($AWS_EC2 describe-volumes --query 'Volumes[0].Size' --output text) +ROOT_VOL_SIZE_API=$(aws ec2 describe-volumes --query 'Volumes[0].Size' --output text) # Find the disk backing the root filesystem (avoids picking up floppy/cdrom devices) # 1. findmnt gets the source device for / (e.g. /dev/vda1) # 2. lsblk PKNAME resolves to parent disk name (e.g. vda) @@ -430,10 +439,12 @@ VM_HOSTNAME=$(ssh -o StrictHostKeyChecking=no \ -i "test-key-1.pem" \ ec2-user@"$SSH_HOST" 'hostname' 2>/dev/null) echo "VM hostname: $VM_HOSTNAME" -if echo "$VM_HOSTNAME" | grep -q "$INSTANCE_ID"; then - echo "Hostname contains instance ID" +# Hostname uses truncated ID: hive-vm- +SHORT_ID=$(echo "$INSTANCE_ID" | sed 's/^i-//' | cut -c1-8) +if echo "$VM_HOSTNAME" | grep -q "$SHORT_ID"; then + echo "Hostname contains instance ID prefix ($SHORT_ID)" else - echo "WARNING: Hostname '$VM_HOSTNAME' does not contain instance ID '$INSTANCE_ID' (non-fatal)" + echo "WARNING: Hostname '$VM_HOSTNAME' does not contain instance ID prefix '$SHORT_ID' (non-fatal)" fi echo "SSH connectivity and volume verification passed" @@ -441,7 +452,7 @@ echo "SSH connectivity and volume verification passed" # Phase 5a-iii: Console Output echo "Phase 5a-iii: Console Output" -CONSOLE_OUTPUT=$($AWS_EC2 get-console-output --instance-id "$INSTANCE_ID") +CONSOLE_OUTPUT=$(aws ec2 get-console-output --instance-id "$INSTANCE_ID") CONSOLE_INSTANCE=$(echo "$CONSOLE_OUTPUT" | jq -r '.InstanceId') CONSOLE_DATA=$(echo "$CONSOLE_OUTPUT" | jq -r '.Output // empty') @@ -454,7 +465,7 @@ echo " GetConsoleOutput succeeded (InstanceId=$CONSOLE_INSTANCE, has output=$([ echo "Console output tests passed" # Verify root volume attached to the instance (describe-volumes) -VOLUME_ID=$($AWS_EC2 describe-volumes --query 'Volumes[0].VolumeId' --output text) +VOLUME_ID=$(aws ec2 describe-volumes --query 'Volumes[0].VolumeId' --output text) if [ -z "$VOLUME_ID" ] || [ "$VOLUME_ID" == "None" ]; then echo "Failed to find volume for instance $INSTANCE_ID" exit 1 @@ -467,7 +478,7 @@ echo "Testing volume create -> resize -> attach -> detach -> delete..." # Create a test volume echo "Creating 10GB volume in ap-southeast-2a..." -CREATE_OUTPUT=$($AWS_EC2 create-volume --size 10 --availability-zone ap-southeast-2a) +CREATE_OUTPUT=$(aws ec2 create-volume --size 10 --availability-zone ap-southeast-2a) TEST_VOLUME_ID=$(echo "$CREATE_OUTPUT" | jq -r '.VolumeId') if [ -z "$TEST_VOLUME_ID" ] || [ "$TEST_VOLUME_ID" == "null" ]; then @@ -480,13 +491,13 @@ echo "Created volume: $TEST_VOLUME_ID" # Resize to 20GB NEW_SIZE=20 echo "Modifying volume to ${NEW_SIZE}GB..." -$AWS_EC2 modify-volume --volume-id "$TEST_VOLUME_ID" --size "$NEW_SIZE" +aws ec2 modify-volume --volume-id "$TEST_VOLUME_ID" --size "$NEW_SIZE" # Verify resize echo "Verifying resize..." COUNT=0 while [ $COUNT -lt 30 ]; do - VOLUME_SIZE=$($AWS_EC2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ + VOLUME_SIZE=$(aws ec2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ --query 'Volumes[0].Size' --output text) if [ "$VOLUME_SIZE" -eq "$NEW_SIZE" ]; then @@ -505,17 +516,17 @@ fi # Attach volume to the running instance echo "Attaching volume $TEST_VOLUME_ID to instance $INSTANCE_ID..." -$AWS_EC2 attach-volume --volume-id "$TEST_VOLUME_ID" --instance-id "$INSTANCE_ID" --device /dev/sdf +aws ec2 attach-volume --volume-id "$TEST_VOLUME_ID" --instance-id "$INSTANCE_ID" --device /dev/sdf # Verify attachment echo "Verifying volume attachment..." COUNT=0 while [ $COUNT -lt 30 ]; do - ATTACH_STATE=$($AWS_EC2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ + ATTACH_STATE=$(aws ec2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ --query 'Volumes[0].Attachments[0].State' --output text) - ATTACH_INSTANCE=$($AWS_EC2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ + ATTACH_INSTANCE=$(aws ec2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ --query 'Volumes[0].Attachments[0].InstanceId' --output text) - VOL_STATE=$($AWS_EC2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ + VOL_STATE=$(aws ec2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ --query 'Volumes[0].State' --output text) if [ "$VOL_STATE" == "in-use" ] && [ "$ATTACH_STATE" == "attached" ] && [ "$ATTACH_INSTANCE" == "$INSTANCE_ID" ]; then @@ -534,13 +545,13 @@ fi # Detach volume (without --instance-id to test gateway resolution path) echo "Detaching volume $TEST_VOLUME_ID..." -$AWS_EC2 detach-volume --volume-id "$TEST_VOLUME_ID" +aws ec2 detach-volume --volume-id "$TEST_VOLUME_ID" # Verify detachment echo "Verifying volume detachment..." COUNT=0 while [ $COUNT -lt 30 ]; do - VOL_STATE=$($AWS_EC2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ + VOL_STATE=$(aws ec2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ --query 'Volumes[0].State' --output text) if [ "$VOL_STATE" == "available" ]; then @@ -559,14 +570,14 @@ fi # Delete the test volume echo "Deleting test volume $TEST_VOLUME_ID..." -$AWS_EC2 delete-volume --volume-id "$TEST_VOLUME_ID" +aws ec2 delete-volume --volume-id "$TEST_VOLUME_ID" # Verify deletion echo "Verifying volume deletion..." COUNT=0 while [ $COUNT -lt 30 ]; do set +e - VOLUME_CHECK=$($AWS_EC2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ + VOLUME_CHECK=$(aws ec2 describe-volumes --volume-ids "$TEST_VOLUME_ID" \ --query 'Volumes[0].VolumeId' --output text 2>&1) DESCRIBE_EXIT=$? set -e @@ -590,7 +601,7 @@ echo "Volume lifecycle test passed (create -> resize -> attach -> detach -> dele # Phase 5b-ii: DescribeVolumeStatus echo "Phase 5b-ii: DescribeVolumeStatus" echo "Testing describe-volume-status on root volume..." -VOL_STATUS_OUTPUT=$($AWS_EC2 describe-volume-status --volume-ids "$VOLUME_ID") +VOL_STATUS_OUTPUT=$(aws ec2 describe-volume-status --volume-ids "$VOLUME_ID") VOL_STATUS_ID=$(echo "$VOL_STATUS_OUTPUT" | jq -r '.VolumeStatuses[0].VolumeId') VOL_STATUS_STATE=$(echo "$VOL_STATUS_OUTPUT" | jq -r '.VolumeStatuses[0].VolumeStatus.Status') @@ -608,12 +619,12 @@ echo "Testing snapshot create -> describe -> copy -> delete..." # viperblockd, which is required for create-snapshot (the ebs.snapshot handler # needs a live VB instance to flush). echo "Using root volume $VOLUME_ID (already attached to $INSTANCE_ID)" -ROOT_VOL_SIZE=$($AWS_EC2 describe-volumes --volume-ids "$VOLUME_ID" \ +ROOT_VOL_SIZE=$(aws ec2 describe-volumes --volume-ids "$VOLUME_ID" \ --query 'Volumes[0].Size' --output text) # Create a snapshot from the attached root volume echo "Creating snapshot from volume $VOLUME_ID..." -SNAP_OUTPUT=$($AWS_EC2 create-snapshot --volume-id "$VOLUME_ID" --description "e2e-test-snapshot") +SNAP_OUTPUT=$(aws ec2 create-snapshot --volume-id "$VOLUME_ID" --description "e2e-test-snapshot") SNAPSHOT_ID=$(echo "$SNAP_OUTPUT" | jq -r '.SnapshotId') if [ -z "$SNAPSHOT_ID" ] || [ "$SNAPSHOT_ID" == "null" ]; then @@ -643,7 +654,7 @@ echo "Snapshot create response verified (State=$SNAP_STATE, VolumeId=$SNAP_VOL_R echo "Waiting for snapshot to complete..." COUNT=0 while [ $COUNT -lt 30 ]; do - SNAP_STATE=$($AWS_EC2 describe-snapshots --snapshot-ids "$SNAPSHOT_ID" \ + SNAP_STATE=$(aws ec2 describe-snapshots --snapshot-ids "$SNAPSHOT_ID" \ --query 'Snapshots[0].State' --output text) if [ "$SNAP_STATE" == "completed" ]; then @@ -662,7 +673,7 @@ fi # Describe snapshot by ID and verify fields echo "Verifying snapshot via describe-snapshots..." -DESCRIBE_SNAP=$($AWS_EC2 describe-snapshots --snapshot-ids "$SNAPSHOT_ID") +DESCRIBE_SNAP=$(aws ec2 describe-snapshots --snapshot-ids "$SNAPSHOT_ID") DESC_VOL_ID=$(echo "$DESCRIBE_SNAP" | jq -r '.Snapshots[0].VolumeId') DESC_SIZE=$(echo "$DESCRIBE_SNAP" | jq -r '.Snapshots[0].VolumeSize') DESC_DESC=$(echo "$DESCRIBE_SNAP" | jq -r '.Snapshots[0].Description') @@ -683,7 +694,7 @@ echo "Describe snapshot verified (VolumeId=$DESC_VOL_ID, Size=$DESC_SIZE, Descri # Copy the snapshot echo "Copying snapshot $SNAPSHOT_ID..." -COPY_OUTPUT=$($AWS_EC2 copy-snapshot --source-snapshot-id "$SNAPSHOT_ID" --source-region ap-southeast-2 --description "e2e-copy") +COPY_OUTPUT=$(aws ec2 copy-snapshot --source-snapshot-id "$SNAPSHOT_ID" --source-region ap-southeast-2 --description "e2e-copy") COPY_SNAPSHOT_ID=$(echo "$COPY_OUTPUT" | jq -r '.SnapshotId') if [ -z "$COPY_SNAPSHOT_ID" ] || [ "$COPY_SNAPSHOT_ID" == "null" ]; then @@ -700,7 +711,7 @@ if [ "$COPY_SNAPSHOT_ID" == "$SNAPSHOT_ID" ]; then fi # Describe all snapshots — should see both original and copy -TOTAL_SNAPS=$($AWS_EC2 describe-snapshots \ +TOTAL_SNAPS=$(aws ec2 describe-snapshots \ --snapshot-ids "$SNAPSHOT_ID" "$COPY_SNAPSHOT_ID" \ --query 'length(Snapshots)' --output text) @@ -711,7 +722,7 @@ fi echo "Both snapshots visible via describe-snapshots" # Verify copy has correct description -COPY_DESC=$($AWS_EC2 describe-snapshots --snapshot-ids "$COPY_SNAPSHOT_ID" \ +COPY_DESC=$(aws ec2 describe-snapshots --snapshot-ids "$COPY_SNAPSHOT_ID" \ --query 'Snapshots[0].Description' --output text) if [ "$COPY_DESC" != "e2e-copy" ]; then echo "Copy description mismatch: expected 'e2e-copy', got '$COPY_DESC'" @@ -720,14 +731,14 @@ fi # Delete the original snapshot echo "Deleting original snapshot $SNAPSHOT_ID..." -$AWS_EC2 delete-snapshot --snapshot-id "$SNAPSHOT_ID" +aws ec2 delete-snapshot --snapshot-id "$SNAPSHOT_ID" # Verify original is gone, copy remains echo "Verifying snapshot deletion..." COUNT=0 while [ $COUNT -lt 30 ]; do set +e - SNAP_CHECK=$($AWS_EC2 describe-snapshots --snapshot-ids "$SNAPSHOT_ID" \ + SNAP_CHECK=$(aws ec2 describe-snapshots --snapshot-ids "$SNAPSHOT_ID" \ --query 'Snapshots[0].SnapshotId' --output text 2>&1) SNAP_EXIT=$? set -e @@ -747,7 +758,7 @@ if [ $COUNT -ge 30 ]; then fi # Verify copy still exists -COPY_STATE=$($AWS_EC2 describe-snapshots --snapshot-ids "$COPY_SNAPSHOT_ID" \ +COPY_STATE=$(aws ec2 describe-snapshots --snapshot-ids "$COPY_SNAPSHOT_ID" \ --query 'Snapshots[0].State' --output text) if [ "$COPY_STATE" != "completed" ]; then echo "Copy snapshot should still exist (State=$COPY_STATE)" @@ -757,7 +768,7 @@ echo "Copy snapshot still intact after original deletion" # Delete the copy echo "Deleting copy snapshot $COPY_SNAPSHOT_ID..." -$AWS_EC2 delete-snapshot --snapshot-id "$COPY_SNAPSHOT_ID" +aws ec2 delete-snapshot --snapshot-id "$COPY_SNAPSHOT_ID" echo "Snapshot lifecycle test passed (create -> describe -> copy -> delete)" @@ -801,7 +812,7 @@ echo "Snapshot-backed instance launch verified" echo "Phase 5e: CreateImage Lifecycle" echo "Creating custom AMI from running instance $INSTANCE_ID..." -CREATE_IMAGE_OUTPUT=$($AWS_EC2 create-image --instance-id "$INSTANCE_ID" --name "e2e-custom-ami" --description "E2E test custom image") +CREATE_IMAGE_OUTPUT=$(aws ec2 create-image --instance-id "$INSTANCE_ID" --name "e2e-custom-ami" --description "E2E test custom image") CUSTOM_AMI_ID=$(echo "$CREATE_IMAGE_OUTPUT" | jq -r '.ImageId') if [ -z "$CUSTOM_AMI_ID" ] || [ "$CUSTOM_AMI_ID" == "null" ]; then @@ -813,7 +824,7 @@ echo "Created custom AMI: $CUSTOM_AMI_ID" # Verify the custom AMI exists via describe-images echo "Verifying custom AMI via describe-images..." -CUSTOM_IMAGE=$($AWS_EC2 describe-images --image-ids "$CUSTOM_AMI_ID") +CUSTOM_IMAGE=$(aws ec2 describe-images --image-ids "$CUSTOM_AMI_ID") CUSTOM_IMAGE_NAME=$(echo "$CUSTOM_IMAGE" | jq -r '.Images[0].Name') CUSTOM_IMAGE_STATE=$(echo "$CUSTOM_IMAGE" | jq -r '.Images[0].State') @@ -840,11 +851,11 @@ echo "Phase 6: Tag Management" # 6a: Create tags on the instance echo "Creating tags on instance $INSTANCE_ID..." -$AWS_EC2 create-tags --resources "$INSTANCE_ID" --tags Key=Name,Value=e2e-test Key=Environment,Value=testing Key=DeleteMe,Value=please +aws ec2 create-tags --resources "$INSTANCE_ID" --tags Key=Name,Value=e2e-test Key=Environment,Value=testing Key=DeleteMe,Value=please # 6b: Verify tags with describe-tags (resource-id filter) echo "Verifying tags on instance..." -TAG_COUNT=$($AWS_EC2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \ +TAG_COUNT=$(aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \ --query 'length(Tags || `[]`)' --output text) if [ "$TAG_COUNT" -ne 3 ]; then echo "Expected 3 tags on instance, got $TAG_COUNT" @@ -854,11 +865,11 @@ echo "Instance has $TAG_COUNT tags" # 6c: Create tags on the root volume echo "Creating tags on volume $VOLUME_ID..." -$AWS_EC2 create-tags --resources "$VOLUME_ID" --tags Key=Name,Value=e2e-root-vol Key=Environment,Value=testing +aws ec2 create-tags --resources "$VOLUME_ID" --tags Key=Name,Value=e2e-root-vol Key=Environment,Value=testing # 6d: Filter by key echo "Testing key filter..." -ENV_TAGS=$($AWS_EC2 describe-tags --filters "Name=key,Values=Environment" \ +ENV_TAGS=$(aws ec2 describe-tags --filters "Name=key,Values=Environment" \ --query 'length(Tags || `[]`)' --output text) if [ "$ENV_TAGS" -ne 2 ]; then echo "Expected 2 'Environment' tags across resources, got $ENV_TAGS" @@ -868,7 +879,7 @@ echo "Key filter returned $ENV_TAGS tags" # 6e: Filter by resource-type echo "Testing resource-type filter..." -INSTANCE_TAGS=$($AWS_EC2 describe-tags --filters "Name=resource-type,Values=instance" \ +INSTANCE_TAGS=$(aws ec2 describe-tags --filters "Name=resource-type,Values=instance" \ --query 'length(Tags || `[]`)' --output text) if [ "$INSTANCE_TAGS" -ne 3 ]; then echo "Expected 3 instance tags, got $INSTANCE_TAGS" @@ -878,8 +889,8 @@ echo "Resource-type filter returned $INSTANCE_TAGS instance tags" # 6f: Overwrite a tag value echo "Overwriting Name tag on instance..." -$AWS_EC2 create-tags --resources "$INSTANCE_ID" --tags Key=Name,Value=e2e-test-updated -UPDATED_NAME=$($AWS_EC2 describe-tags \ +aws ec2 create-tags --resources "$INSTANCE_ID" --tags Key=Name,Value=e2e-test-updated +UPDATED_NAME=$(aws ec2 describe-tags \ --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=Name" \ --query 'Tags[0].Value' --output text) if [ "$UPDATED_NAME" != "e2e-test-updated" ]; then @@ -890,8 +901,8 @@ echo "Tag overwrite verified" # 6g: Delete tag by key (unconditional) echo "Deleting DeleteMe tag unconditionally..." -$AWS_EC2 delete-tags --resources "$INSTANCE_ID" --tags Key=DeleteMe -REMAINING=$($AWS_EC2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \ +aws ec2 delete-tags --resources "$INSTANCE_ID" --tags Key=DeleteMe +REMAINING=$(aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \ --query 'length(Tags || `[]`)' --output text) if [ "$REMAINING" -ne 2 ]; then echo "Expected 2 tags after unconditional delete, got $REMAINING" @@ -901,8 +912,8 @@ echo "Unconditional delete verified ($REMAINING tags remaining)" # 6h: Delete tag with wrong value (should NOT delete) echo "Attempting delete with wrong value (should be no-op)..." -$AWS_EC2 delete-tags --resources "$INSTANCE_ID" --tags Key=Environment,Value=production -ENV_STILL=$($AWS_EC2 describe-tags \ +aws ec2 delete-tags --resources "$INSTANCE_ID" --tags Key=Environment,Value=production +ENV_STILL=$(aws ec2 describe-tags \ --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=Environment" \ --query 'length(Tags || `[]`)' --output text) if [ "$ENV_STILL" -ne 1 ]; then @@ -913,8 +924,8 @@ echo "Value-conditional mismatch preserved tag" # 6i: Delete tag with correct value echo "Deleting Environment tag with correct value..." -$AWS_EC2 delete-tags --resources "$INSTANCE_ID" --tags Key=Environment,Value=testing -ENV_GONE=$($AWS_EC2 describe-tags \ +aws ec2 delete-tags --resources "$INSTANCE_ID" --tags Key=Environment,Value=testing +ENV_GONE=$(aws ec2 describe-tags \ --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=Environment" \ --query 'length(Tags || `[]`)' --output text) if [ "$ENV_GONE" -ne 0 ]; then @@ -924,7 +935,7 @@ fi echo "Value-conditional match deleted tag" # 6j: Verify only Name tag remains on instance -FINAL_COUNT=$($AWS_EC2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \ +FINAL_COUNT=$(aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \ --query 'length(Tags || `[]`)' --output text) if [ "$FINAL_COUNT" -ne 1 ]; then echo "Expected 1 tag remaining on instance, got $FINAL_COUNT" @@ -937,10 +948,10 @@ echo "Phase 7: Instance State Transitions" # Stop instance (stop-instances) and verify transition to stopped (describe-instances) echo "Stopping instance..." -$AWS_EC2 stop-instances --instance-ids "$INSTANCE_ID" +aws ec2 stop-instances --instance-ids "$INSTANCE_ID" COUNT=0 while [ $COUNT -lt 30 ]; do - STATE=$($AWS_EC2 describe-instances --instance-ids "$INSTANCE_ID" --query 'Reservations[0].Instances[0].State.Name' --output text) + STATE=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" --query 'Reservations[0].Instances[0].State.Name' --output text) echo "Instance state: $STATE" if [ "$STATE" == "stopped" ]; then break @@ -957,17 +968,17 @@ fi # Phase 7a: Attach volume to stopped instance (should fail) echo "Phase 7a: Attach Volume to Stopped Instance (Error Path)" echo "Creating a volume to test attach-to-stopped..." -STOPPED_VOL_OUTPUT=$($AWS_EC2 create-volume --size 10 --availability-zone ap-southeast-2a) +STOPPED_VOL_OUTPUT=$(aws ec2 create-volume --size 10 --availability-zone ap-southeast-2a) STOPPED_VOL_ID=$(echo "$STOPPED_VOL_OUTPUT" | jq -r '.VolumeId') echo "Created volume: $STOPPED_VOL_ID" echo "Attempting attach to stopped instance (should fail)..." -expect_error "IncorrectInstanceState" $AWS_EC2 attach-volume \ +expect_error "IncorrectInstanceState" aws ec2 attach-volume \ --volume-id "$STOPPED_VOL_ID" --instance-id "$INSTANCE_ID" --device /dev/sdg echo "Attach-to-stopped correctly rejected" # Clean up the test volume -$AWS_EC2 delete-volume --volume-id "$STOPPED_VOL_ID" +aws ec2 delete-volume --volume-id "$STOPPED_VOL_ID" echo "Cleaned up test volume $STOPPED_VOL_ID" # Phase 7b: ModifyInstanceAttribute (change instance type while stopped, verify via SSH) @@ -980,17 +991,17 @@ echo "Changing instance type from $INSTANCE_TYPE to $MODIFY_TYPE..." # Get expected vCPU and memory for the new type # Note: --instance-types filter may not be supported; use jq to select the correct type -TYPES_JSON=$($AWS_EC2 describe-instance-types) +TYPES_JSON=$(aws ec2 describe-instance-types) EXPECTED_VCPUS=$(echo "$TYPES_JSON" | jq -r ".InstanceTypes[] | select(.InstanceType==\"$MODIFY_TYPE\") | .VCpuInfo.DefaultVCpus") EXPECTED_MEM_MIB=$(echo "$TYPES_JSON" | jq -r ".InstanceTypes[] | select(.InstanceType==\"$MODIFY_TYPE\") | .MemoryInfo.SizeInMiB") echo "Expected resources after modify: ${EXPECTED_VCPUS} vCPUs, ${EXPECTED_MEM_MIB} MiB RAM" # Modify the instance type -$AWS_EC2 modify-instance-attribute --instance-id "$INSTANCE_ID" \ +aws ec2 modify-instance-attribute --instance-id "$INSTANCE_ID" \ --instance-type "{\"Value\": \"$MODIFY_TYPE\"}" # Verify describe-instances reflects the new type -MODIFIED_TYPE=$($AWS_EC2 describe-instances --instance-ids "$INSTANCE_ID" \ +MODIFIED_TYPE=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" \ --query 'Reservations[0].Instances[0].InstanceType' --output text) if [ "$MODIFIED_TYPE" != "$MODIFY_TYPE" ]; then echo "ModifyInstanceAttribute failed: expected type $MODIFY_TYPE, got $MODIFIED_TYPE" @@ -1000,10 +1011,10 @@ echo "Instance type updated to $MODIFIED_TYPE" # Start instance with the new type echo "Starting instance with modified type..." -$AWS_EC2 start-instances --instance-ids "$INSTANCE_ID" +aws ec2 start-instances --instance-ids "$INSTANCE_ID" COUNT=0 while [ $COUNT -lt 30 ]; do - STATE=$($AWS_EC2 describe-instances --instance-ids "$INSTANCE_ID" \ + STATE=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" \ --query 'Reservations[0].Instances[0].State.Name' --output text) echo "Instance state: $STATE" if [ "$STATE" == "running" ]; then @@ -1069,7 +1080,7 @@ echo "ModifyInstanceAttribute test passed (type change + vCPU + memory verified # Phase 7c: RunInstances with count > 1 echo "Phase 7c: RunInstances with MinCount/MaxCount > 1" echo "Launching 2 instances in a single run-instances call..." -MULTI_RUN_OUTPUT=$($AWS_EC2 run-instances \ +MULTI_RUN_OUTPUT=$(aws ec2 run-instances \ --image-id "$AMI_ID" \ --instance-type "$INSTANCE_TYPE" \ --key-name test-key-1 \ @@ -1090,7 +1101,7 @@ for MID in "$MULTI_ID_1" "$MULTI_ID_2"; do echo "Waiting for $MID to reach running state..." COUNT=0 while [ $COUNT -lt 30 ]; do - MSTATE=$($AWS_EC2 describe-instances --instance-ids "$MID" \ + MSTATE=$(aws ec2 describe-instances --instance-ids "$MID" \ --query 'Reservations[0].Instances[0].State.Name' --output text) || { sleep 2 COUNT=$((COUNT + 1)) @@ -1111,11 +1122,11 @@ done # Terminate the multi-launch instances echo "Terminating multi-launch instances..." -$AWS_EC2 terminate-instances --instance-ids "$MULTI_ID_1" "$MULTI_ID_2" +aws ec2 terminate-instances --instance-ids "$MULTI_ID_1" "$MULTI_ID_2" for MID in "$MULTI_ID_1" "$MULTI_ID_2"; do COUNT=0 while [ $COUNT -lt 30 ]; do - MSTATE=$($AWS_EC2 describe-instances --instance-ids "$MID" \ + MSTATE=$(aws ec2 describe-instances --instance-ids "$MID" \ --query 'Reservations[0].Instances[0].State.Name' --output text) if [ "$MSTATE" == "terminated" ] || [ "$MSTATE" == "None" ]; then break @@ -1131,27 +1142,27 @@ echo "Phase 8: Negative / Error Path Tests" # 8a: RunInstances with malformed AMI ID (missing ami- prefix) echo "8a: RunInstances with malformed AMI ID..." -expect_error "InvalidAMIID.Malformed" $AWS_EC2 run-instances \ +expect_error "InvalidAMIID.Malformed" aws ec2 run-instances \ --image-id notanami --instance-type "$INSTANCE_TYPE" --key-name test-key-1 # 8b: RunInstances with invalid instance type echo "8b: RunInstances with invalid instance type..." -expect_error "InvalidInstanceType" $AWS_EC2 run-instances \ +expect_error "InvalidInstanceType" aws ec2 run-instances \ --image-id "$AMI_ID" --instance-type "x99.superlarge" --key-name test-key-1 # 8c: Attach an already in-use volume (root volume is attached to running instance) echo "8c: Attach already in-use volume..." -expect_error "VolumeInUse" $AWS_EC2 attach-volume \ +expect_error "VolumeInUse" aws ec2 attach-volume \ --volume-id "$VOLUME_ID" --instance-id "$INSTANCE_ID" --device /dev/sdg # 8d: Detach boot/root volume (should be rejected) echo "8d: Detach boot volume..." -expect_error "OperationNotPermitted" $AWS_EC2 detach-volume \ +expect_error "OperationNotPermitted" aws ec2 detach-volume \ --volume-id "$VOLUME_ID" --instance-id "$INSTANCE_ID" # 8e: Delete a non-existent snapshot echo "8e: Delete non-existent snapshot..." -expect_error "InvalidSnapshot.NotFound" $AWS_EC2 delete-snapshot \ +expect_error "InvalidSnapshot.NotFound" aws ec2 delete-snapshot \ --snapshot-id snap-nonexistent000000 # 8f: Call an unsupported Action (use raw curl to send an invalid Action) @@ -1169,62 +1180,572 @@ fi # 8g: RunInstances with non-existent AMI (valid format but doesn't exist) echo "8g: RunInstances with non-existent AMI..." -expect_error "InvalidAMIID.NotFound" $AWS_EC2 run-instances \ +expect_error "InvalidAMIID.NotFound" aws ec2 run-instances \ --image-id ami-0000000000000dead --instance-type "$INSTANCE_TYPE" --key-name test-key-1 # 8h: RunInstances with non-existent key pair echo "8h: RunInstances with non-existent key pair..." -expect_error "InvalidKeyPair.NotFound" $AWS_EC2 run-instances \ +expect_error "InvalidKeyPair.NotFound" aws ec2 run-instances \ --image-id "$AMI_ID" --instance-type "$INSTANCE_TYPE" --key-name nonexistent-key-xyz # 8i: DeleteVolume on non-existent volume echo "8i: DeleteVolume non-existent volume..." -expect_error "InvalidVolume.NotFound" $AWS_EC2 delete-volume \ +expect_error "InvalidVolume.NotFound" aws ec2 delete-volume \ --volume-id vol-0000000000000dead # 8j: CreateKeyPair with duplicate name (test-key-1 exists from Phase 3) echo "8j: CreateKeyPair duplicate name..." -expect_error "InvalidKeyPair.Duplicate" $AWS_EC2 create-key-pair \ +expect_error "InvalidKeyPair.Duplicate" aws ec2 create-key-pair \ --key-name test-key-1 # 8k: ImportKeyPair with duplicate name (test-key-1 exists from Phase 3) echo "8k: ImportKeyPair duplicate name..." -expect_error "InvalidKeyPair.Duplicate" $AWS_EC2 import-key-pair \ +expect_error "InvalidKeyPair.Duplicate" aws ec2 import-key-pair \ --key-name test-key-1 --public-key-material "fileb://test-key-2-local.pub" # 8l: ImportKeyPair with invalid key format echo "8l: ImportKeyPair invalid key format..." echo "not-a-valid-public-key" > /tmp/bad-key.pub -expect_error "InvalidKey.Format" $AWS_EC2 import-key-pair \ +expect_error "InvalidKey.Format" aws ec2 import-key-pair \ --key-name bad-format-key --public-key-material "fileb:///tmp/bad-key.pub" # 8m: DescribeVolumes with non-existent volume ID echo "8m: DescribeVolumes non-existent volume..." -expect_error "InvalidVolume.NotFound" $AWS_EC2 describe-volumes \ +expect_error "InvalidVolume.NotFound" aws ec2 describe-volumes \ --volume-ids vol-0000000000000dead # 8n: DescribeImages with non-existent AMI ID echo "8n: DescribeImages non-existent AMI..." -expect_error "InvalidAMIID.NotFound" $AWS_EC2 describe-images \ +expect_error "InvalidAMIID.NotFound" aws ec2 describe-images \ --image-ids ami-0000000000000dead # 8o: CreateImage with duplicate name (e2e-custom-ami exists from Phase 5e) echo "8o: CreateImage duplicate name..." -expect_error "InvalidAMIName.Duplicate" $AWS_EC2 create-image \ +expect_error "InvalidAMIName.Duplicate" aws ec2 create-image \ --instance-id "$INSTANCE_ID" --name "e2e-custom-ami" # 8p: DeleteKeyPair for non-existent key — should succeed (idempotent, matches AWS) echo "8p: DeleteKeyPair non-existent key (idempotent)..." -$AWS_EC2 delete-key-pair --key-name nonexistent-key-99999 +aws ec2 delete-key-pair --key-name nonexistent-key-99999 echo " DeleteKeyPair for non-existent key succeeded (idempotent)" # 8q: ModifyInstanceAttribute on running instance (instance not in stopped KV → NotFound) echo "8q: ModifyInstanceAttribute on running instance..." -expect_error "InvalidInstanceID.NotFound" $AWS_EC2 modify-instance-attribute \ +expect_error "InvalidInstanceID.NotFound" aws ec2 modify-instance-attribute \ --instance-id "$INSTANCE_ID" --instance-type "{\"Value\": \"$INSTANCE_TYPE\"}" echo "Negative test suite passed" +# ============================================================================= +# IAM E2E Tests +# ============================================================================= + +# IAM Phase 1: User CRUD +echo "" +echo "IAM Phase 1: User CRUD" + +# Root auth — verify list-users works (root user exists) +echo " Verifying root auth via iam list-users..." +ROOT_USERS=$(aws iam list-users) +echo "$ROOT_USERS" | jq -e '.Users | length > 0' > /dev/null +echo " Root auth verified" + +# CreateUser — alice +echo " Creating user alice..." +ALICE_OUTPUT=$(aws iam create-user --user-name alice) +echo "$ALICE_OUTPUT" | jq -e '.User.UserName == "alice"' > /dev/null +ALICE_ARN=$(echo "$ALICE_OUTPUT" | jq -r '.User.Arn') +echo " Created alice: $ALICE_ARN" + +# CreateUser — bob with path +echo " Creating user bob with path /engineering/..." +BOB_OUTPUT=$(aws iam create-user --user-name bob --path /engineering/) +echo "$BOB_OUTPUT" | jq -e '.User.Path == "/engineering/"' > /dev/null +echo " Created bob" + +# CreateUser — duplicate (expect EntityAlreadyExists) +echo " Creating duplicate user alice (expect error)..." +expect_error "EntityAlreadyExists" aws iam create-user --user-name alice + +# GetUser +echo " Getting user alice..." +aws iam get-user --user-name alice | jq -e '.User.UserName == "alice"' > /dev/null +echo " GetUser alice passed" + +# GetUser — not found +echo " Getting nonexistent user (expect error)..." +expect_error "NoSuchEntity" aws iam get-user --user-name nonexistent + +# ListUsers — should have root, alice, bob +echo " Listing users..." +USER_COUNT=$(aws iam list-users | jq '.Users | length') +if [ "$USER_COUNT" -lt 3 ]; then + echo " ERROR: Expected at least 3 users (root, alice, bob), got $USER_COUNT" + exit 1 +fi +echo " ListUsers: $USER_COUNT users" + +# ListUsers with path-prefix +echo " Listing users with path-prefix /engineering/..." +ENG_USERS=$(aws iam list-users --path-prefix /engineering/ | jq '.Users | length') +if [ "$ENG_USERS" -ne 1 ]; then + echo " ERROR: Expected 1 user with path /engineering/, got $ENG_USERS" + exit 1 +fi +echo " Path-prefix filter passed" + +echo "IAM Phase 1 passed" + +# IAM Phase 2: Access Key Lifecycle +echo "" +echo "IAM Phase 2: Access Key Lifecycle" + +# CreateAccessKey — alice key 1 +echo " Creating access key 1 for alice..." +KEY1=$(aws iam create-access-key --user-name alice) +ALICE_KEY_ID=$(echo "$KEY1" | jq -r '.AccessKey.AccessKeyId') +ALICE_SECRET=$(echo "$KEY1" | jq -r '.AccessKey.SecretAccessKey') +echo " Key 1: $ALICE_KEY_ID" + +if [ -z "$ALICE_KEY_ID" ] || [ "$ALICE_KEY_ID" == "null" ]; then + echo " ERROR: Failed to create access key for alice" + exit 1 +fi + +# CreateAccessKey — alice key 2 +echo " Creating access key 2 for alice..." +KEY2=$(aws iam create-access-key --user-name alice) +ALICE_KEY2_ID=$(echo "$KEY2" | jq -r '.AccessKey.AccessKeyId') +echo " Key 2: $ALICE_KEY2_ID" + +# CreateAccessKey — alice key 3 (exceed limit) +echo " Creating access key 3 for alice (expect LimitExceeded)..." +expect_error "LimitExceeded" aws iam create-access-key --user-name alice + +# CreateAccessKey — non-existent user +echo " Creating access key for ghost (expect error)..." +expect_error "NoSuchEntity" aws iam create-access-key --user-name ghost + +# ListAccessKeys +echo " Listing access keys for alice..." +ALICE_KEY_COUNT=$(aws iam list-access-keys --user-name alice | jq '.AccessKeyMetadata | length') +if [ "$ALICE_KEY_COUNT" -ne 2 ]; then + echo " ERROR: Expected 2 keys for alice, got $ALICE_KEY_COUNT" + exit 1 +fi +echo " Alice has $ALICE_KEY_COUNT keys" + +echo " Listing access keys for bob (expect 0)..." +BOB_KEY_COUNT=$(aws iam list-access-keys --user-name bob | jq '.AccessKeyMetadata // [] | length') +if [ "${BOB_KEY_COUNT:-0}" -ne 0 ]; then + echo " ERROR: Expected 0 keys for bob, got $BOB_KEY_COUNT" + exit 1 +fi +echo " Bob has 0 keys" + +# UpdateAccessKey — deactivate +echo " Deactivating alice key 1..." +aws iam update-access-key --user-name alice --access-key-id "$ALICE_KEY_ID" --status Inactive +STATUS=$(aws iam list-access-keys --user-name alice | \ + jq -r ".AccessKeyMetadata[] | select(.AccessKeyId == \"$ALICE_KEY_ID\") | .Status") +if [ "$STATUS" != "Inactive" ]; then + echo " ERROR: Expected Inactive, got $STATUS" + exit 1 +fi +echo " Key deactivated" + +# UpdateAccessKey — reactivate +echo " Reactivating alice key 1..." +aws iam update-access-key --user-name alice --access-key-id "$ALICE_KEY_ID" --status Active +echo " Key reactivated" + +# DeleteAccessKey — key 2 +echo " Deleting alice key 2..." +aws iam delete-access-key --user-name alice --access-key-id "$ALICE_KEY2_ID" +ALICE_KEY_COUNT=$(aws iam list-access-keys --user-name alice | jq '.AccessKeyMetadata | length') +if [ "$ALICE_KEY_COUNT" -ne 1 ]; then + echo " ERROR: Expected 1 key after delete, got $ALICE_KEY_COUNT" + exit 1 +fi +echo " Key 2 deleted, alice has $ALICE_KEY_COUNT key" + +echo "IAM Phase 2 passed" + +# IAM Phase 3: User Authentication +echo "" +echo "IAM Phase 3: User Authentication" + +# Configure alice profile +echo " Configuring hive-alice profile..." +setup_test_profile hive-alice "$ALICE_KEY_ID" "$ALICE_SECRET" + +# Deactivate key → auth should fail +echo " Deactivating alice key, verifying auth rejection..." +aws iam update-access-key --user-name alice --access-key-id "$ALICE_KEY_ID" --status Inactive +expect_error "InvalidClientTokenId" \ + aws ec2 describe-instances --profile hive-alice +echo " Inactive key correctly rejected" + +# Reactivate key +echo " Reactivating alice key..." +aws iam update-access-key --user-name alice --access-key-id "$ALICE_KEY_ID" --status Active + +# Bad secret → SignatureDoesNotMatch +echo " Testing bad secret (expect SignatureDoesNotMatch)..." +setup_test_profile hive-bad "$ALICE_KEY_ID" "WRONG_SECRET_KEY_HERE_12345678901" +expect_error "SignatureDoesNotMatch" \ + aws ec2 describe-instances --profile hive-bad + +# Non-existent key ID → InvalidClientTokenId +echo " Testing fake key ID (expect InvalidClientTokenId)..." +setup_test_profile hive-fake "AKIAXXXXXXXXXXXXXXXX" "doesntmatter" +expect_error "InvalidClientTokenId" \ + aws ec2 describe-instances --profile hive-fake + +# Multi-user auth — create bob key and verify both auth +echo " Creating access key for bob..." +BOB_KEY=$(aws iam create-access-key --user-name bob) +BOB_KEY_ID=$(echo "$BOB_KEY" | jq -r '.AccessKey.AccessKeyId') +BOB_SECRET=$(echo "$BOB_KEY" | jq -r '.AccessKey.SecretAccessKey') +setup_test_profile hive-bob "$BOB_KEY_ID" "$BOB_SECRET" + +# Root still works +echo " Verifying root auth..." +aws ec2 describe-instances > /dev/null +echo " Root auth OK" + +echo "IAM Phase 3 passed" + +# IAM Phase 4: Policy CRUD +echo "" +echo "IAM Phase 4: Policy CRUD" + +GLOBAL_ACCOUNT="000000000000" + +# CreatePolicy — EC2ReadOnly +echo " Creating EC2ReadOnly policy..." +aws iam create-policy \ + --policy-name EC2ReadOnly \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": ["ec2:DescribeInstances", "ec2:DescribeVolumes", "ec2:DescribeVpcs"], + "Resource": "*" + }] + }' > /dev/null +echo " Created EC2ReadOnly" + +# CreatePolicy — FullAdmin +echo " Creating FullAdmin policy..." +aws iam create-policy \ + --policy-name FullAdmin \ + --path /admin/ \ + --description "Full access to all services" \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": "*", + "Resource": "*" + }] + }' > /dev/null +echo " Created FullAdmin" + +# CreatePolicy — DenyTerminate (mixed Allow + Deny) +echo " Creating DenyTerminate policy..." +aws iam create-policy \ + --policy-name DenyTerminate \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [ + {"Effect": "Allow", "Action": "ec2:*", "Resource": "*"}, + {"Effect": "Deny", "Action": "ec2:TerminateInstances", "Resource": "*"} + ] + }' > /dev/null +echo " Created DenyTerminate" + +# CreatePolicy — IAMReadOnly +echo " Creating IAMReadOnly policy..." +aws iam create-policy \ + --policy-name IAMReadOnly \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": ["iam:GetUser", "iam:ListUsers", "iam:ListPolicies", "iam:GetPolicy"], + "Resource": "*" + }] + }' > /dev/null +echo " Created IAMReadOnly" + +# CreatePolicy — EC2DescribeAll (wildcard) +echo " Creating EC2DescribeAll policy..." +aws iam create-policy \ + --policy-name EC2DescribeAll \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": "ec2:Describe*", + "Resource": "*" + }] + }' > /dev/null +echo " Created EC2DescribeAll" + +# CreatePolicy — duplicate (expect EntityAlreadyExists) +echo " Creating duplicate EC2ReadOnly (expect error)..." +expect_error "EntityAlreadyExists" aws iam create-policy --policy-name EC2ReadOnly \ + --policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}' + +# CreatePolicy — malformed JSON +echo " Creating policy with malformed JSON (expect error)..." +expect_error "MalformedPolicyDocument" aws iam create-policy --policy-name BadPolicy \ + --policy-document '{"not valid"}' + +# GetPolicy +echo " Getting EC2ReadOnly policy..." +aws iam get-policy \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" | \ + jq -e '.Policy.PolicyName == "EC2ReadOnly"' > /dev/null +echo " GetPolicy passed" + +# GetPolicy — not found +echo " Getting non-existent policy (expect error)..." +expect_error "NoSuchEntity" aws iam get-policy \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/Ghost" + +# GetPolicyVersion +echo " Getting EC2ReadOnly policy version v1..." +aws iam get-policy-version \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" \ + --version-id v1 | jq -e '.PolicyVersion.VersionId == "v1"' > /dev/null +echo " GetPolicyVersion passed" + +# ListPolicies +echo " Listing policies..." +POLICY_COUNT=$(aws iam list-policies | jq '.Policies | length') +if [ "$POLICY_COUNT" -lt 5 ]; then + echo " ERROR: Expected at least 5 policies, got $POLICY_COUNT" + exit 1 +fi +echo " ListPolicies: $POLICY_COUNT policies" + +echo "IAM Phase 4 passed" + +# IAM Phase 5: Policy Attachment & Enforcement +echo "" +echo "IAM Phase 5: Policy Attachment & Enforcement" + +# Create charlie with key +echo " Creating user charlie with access key..." +aws iam create-user --user-name charlie > /dev/null +CHARLIE_KEY=$(aws iam create-access-key --user-name charlie) +CHARLIE_KEY_ID=$(echo "$CHARLIE_KEY" | jq -r '.AccessKey.AccessKeyId') +CHARLIE_SECRET=$(echo "$CHARLIE_KEY" | jq -r '.AccessKey.SecretAccessKey') +setup_test_profile hive-charlie "$CHARLIE_KEY_ID" "$CHARLIE_SECRET" + +# Attach policies +echo " Attaching EC2ReadOnly + IAMReadOnly to alice..." +aws iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" +aws iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/IAMReadOnly" + +echo " Attaching DenyTerminate to bob..." +aws iam attach-user-policy --user-name bob \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/DenyTerminate" + +# ListAttachedUserPolicies +echo " Verifying alice's attached policies..." +ALICE_POLICIES=$(aws iam list-attached-user-policies --user-name alice | jq '.AttachedPolicies | length') +if [ "$ALICE_POLICIES" -ne 2 ]; then + echo " ERROR: Expected 2 policies for alice, got $ALICE_POLICIES" + exit 1 +fi +echo " Alice has $ALICE_POLICIES policies" + +# Idempotent attach +echo " Testing idempotent attach..." +aws iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" +ALICE_POLICIES=$(aws iam list-attached-user-policies --user-name alice | jq '.AttachedPolicies | length') +if [ "$ALICE_POLICIES" -ne 2 ]; then + echo " ERROR: Expected 2 policies after idempotent attach, got $ALICE_POLICIES" + exit 1 +fi +echo " Idempotent attach passed" + +# Attach edge cases +echo " Attaching non-existent policy (expect error)..." +expect_error "NoSuchEntity" aws iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/Ghost" + +echo " Attaching to non-existent user (expect error)..." +expect_error "NoSuchEntity" aws iam attach-user-policy --user-name ghost \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" + +# --- Enforcement Tests --- + +# Default Deny — charlie has no policies +echo " Testing default deny (charlie, no policies)..." +expect_error "AccessDenied" \ + aws ec2 describe-instances --profile hive-charlie +expect_error "AccessDenied" \ + aws iam list-users --profile hive-charlie +echo " Default deny passed" + +# Explicit Allow — alice has EC2ReadOnly + IAMReadOnly +echo " Testing explicit allow (alice, EC2ReadOnly + IAMReadOnly)..." +aws ec2 describe-instances --profile hive-alice > /dev/null +echo " ec2:DescribeInstances — allowed" +aws ec2 describe-vpcs --profile hive-alice > /dev/null +echo " ec2:DescribeVpcs — allowed" +aws iam list-users --profile hive-alice > /dev/null +echo " iam:ListUsers — allowed" + +# Actions NOT in alice's policies → denied +expect_error "AccessDenied" \ + aws ec2 describe-key-pairs --profile hive-alice +echo " ec2:DescribeKeyPairs — denied (not in policy)" +expect_error "AccessDenied" \ + aws iam create-user --user-name hack --profile hive-alice +echo " iam:CreateUser — denied (not in policy)" +echo " Explicit allow passed" + +# Wildcard Allow with Explicit Deny — bob has DenyTerminate (ec2:* Allow + ec2:TerminateInstances Deny) +echo " Testing deny override (bob, DenyTerminate)..." +aws ec2 describe-instances --profile hive-bob > /dev/null +echo " ec2:DescribeInstances — allowed (ec2:* wildcard)" +aws ec2 describe-key-pairs --profile hive-bob > /dev/null +echo " ec2:DescribeKeyPairs — allowed (ec2:* wildcard)" +expect_error "AccessDenied" \ + aws ec2 terminate-instances --instance-ids i-fake --profile hive-bob +echo " ec2:TerminateInstances — denied (explicit Deny overrides Allow)" +expect_error "AccessDenied" \ + aws iam list-users --profile hive-bob +echo " iam:ListUsers — denied (IAM not covered by ec2:*)" +echo " Deny override passed" + +# Root user bypass +echo " Testing root user bypass..." +aws ec2 describe-instances > /dev/null +aws iam list-users > /dev/null +aws iam create-user --user-name temp > /dev/null +aws iam delete-user --user-name temp > /dev/null +echo " Root bypass passed" + +# Prefix wildcard — swap alice to EC2DescribeAll +echo " Testing prefix wildcard (swap alice to EC2DescribeAll)..." +aws iam detach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" +aws iam detach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/IAMReadOnly" +aws iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2DescribeAll" + +aws ec2 describe-instances --profile hive-alice > /dev/null +echo " ec2:DescribeInstances — allowed (Describe*)" +aws ec2 describe-key-pairs --profile hive-alice > /dev/null +echo " ec2:DescribeKeyPairs — allowed (Describe*)" +expect_error "AccessDenied" \ + aws ec2 create-key-pair --key-name x --profile hive-alice +echo " ec2:CreateKeyPair — denied (not Describe*)" +expect_error "AccessDenied" \ + aws iam list-users --profile hive-alice +echo " iam:ListUsers — denied (not ec2:Describe*)" +echo " Prefix wildcard passed" + +# FullAdmin — give charlie full access +echo " Testing FullAdmin (charlie)..." +aws iam attach-user-policy --user-name charlie \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/admin/FullAdmin" +aws ec2 describe-instances --profile hive-charlie > /dev/null +echo " ec2:DescribeInstances — allowed (was denied)" +aws iam list-users --profile hive-charlie > /dev/null +echo " iam:ListUsers — allowed (was denied)" +echo " FullAdmin passed" + +echo "IAM Phase 5 passed" + +# IAM Phase 6: Policy Lifecycle — Detach & Delete +echo "" +echo "IAM Phase 6: Policy Lifecycle — Detach & Delete" + +# Detach alice's policy → she loses access +echo " Detaching EC2DescribeAll from alice..." +aws iam detach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2DescribeAll" +expect_error "AccessDenied" \ + aws ec2 describe-instances --profile hive-alice +echo " Alice lost access after detach" + +# DeletePolicy — conflict (DenyTerminate still attached to bob) +echo " Deleting DenyTerminate while attached (expect DeleteConflict)..." +expect_error "DeleteConflict" aws iam delete-policy \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/DenyTerminate" + +# Detach first, then delete +echo " Detaching DenyTerminate from bob, then deleting..." +aws iam detach-user-policy --user-name bob \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/DenyTerminate" +aws iam delete-policy \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/DenyTerminate" + +# Verify it's gone +expect_error "NoSuchEntity" aws iam get-policy \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/DenyTerminate" +echo " DenyTerminate deleted" + +echo "IAM Phase 6 passed" + +# IAM Phase 7: Cleanup +echo "" +echo "IAM Phase 7: IAM Cleanup" + +# Delete alice (detach remaining, delete key, delete user) +echo " Cleaning up alice..." +aws iam delete-access-key --user-name alice --access-key-id "$ALICE_KEY_ID" +aws iam delete-user --user-name alice + +# Delete bob +echo " Cleaning up bob..." +aws iam delete-access-key --user-name bob --access-key-id "$BOB_KEY_ID" +aws iam delete-user --user-name bob + +# Delete charlie (detach FullAdmin first) +echo " Cleaning up charlie..." +aws iam detach-user-policy --user-name charlie \ + --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/admin/FullAdmin" +aws iam delete-access-key --user-name charlie --access-key-id "$CHARLIE_KEY_ID" +aws iam delete-user --user-name charlie + +# Verify only root remains +FINAL_USER_COUNT=$(aws iam list-users | jq '.Users | length') +if [ "$FINAL_USER_COUNT" -ne 1 ]; then + echo " ERROR: Expected 1 user (root) after cleanup, got $FINAL_USER_COUNT" + exit 1 +fi +echo " Users cleaned up (root only)" + +# Delete remaining policies +echo " Cleaning up policies..." +aws iam delete-policy --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2ReadOnly" +aws iam delete-policy --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/admin/FullAdmin" +aws iam delete-policy --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/IAMReadOnly" +aws iam delete-policy --policy-arn "arn:aws:iam::${GLOBAL_ACCOUNT}:policy/EC2DescribeAll" + +FINAL_POLICY_COUNT=$(aws iam list-policies | jq '.Policies | length') +if [ "$FINAL_POLICY_COUNT" -ne 0 ]; then + echo " ERROR: Expected 0 policies after cleanup, got $FINAL_POLICY_COUNT" + exit 1 +fi +echo " Policies cleaned up" + +echo "IAM Phase 7 passed" +echo "" +echo "IAM E2E Tests Completed Successfully" + # Phase 9: Terminate and Verify Cleanup echo "Phase 9: Terminate and Verify Cleanup" @@ -1236,16 +1757,16 @@ echo "Root volume to verify cleanup: $ROOT_VOLUME_ID" # checkVolumeHasNoSnapshots() correctly blocks volume deletion when snapshots reference it. if [ -n "$CUSTOM_AMI_SNAP_ID" ]; then echo "Deleting CreateImage backing snapshot $CUSTOM_AMI_SNAP_ID before termination..." - $AWS_EC2 delete-snapshot --snapshot-id "$CUSTOM_AMI_SNAP_ID" + aws ec2 delete-snapshot --snapshot-id "$CUSTOM_AMI_SNAP_ID" echo "CreateImage snapshot deleted" fi # Terminate instance (terminate-instances) and verify termination (describe-instances) echo "Terminating instance..." -$AWS_EC2 terminate-instances --instance-ids "$INSTANCE_ID" +aws ec2 terminate-instances --instance-ids "$INSTANCE_ID" COUNT=0 while [ $COUNT -lt 30 ]; do - STATE=$($AWS_EC2 describe-instances --instance-ids "$INSTANCE_ID" --query 'Reservations[0].Instances[0].State.Name' --output text) + STATE=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" --query 'Reservations[0].Instances[0].State.Name' --output text) echo "Instance state: $STATE" if [ "$STATE" == "terminated" ] || [ "$STATE" == "None" ]; then break @@ -1268,7 +1789,7 @@ COUNT=0 VOLUME_CLEANED=false while [ $COUNT -lt 20 ]; do set +e - VOL_CHECK=$($AWS_EC2 describe-volumes --volume-ids "$ROOT_VOLUME_ID" \ + VOL_CHECK=$(aws ec2 describe-volumes --volume-ids "$ROOT_VOLUME_ID" \ --query 'Volumes[0].State' --output text 2>&1) VOL_EXIT=$? set -e diff --git a/tests/e2e/run-multinode-e2e.sh b/tests/e2e/run-multinode-e2e.sh index c2c64b7b6..3424b3669 100755 --- a/tests/e2e/run-multinode-e2e.sh +++ b/tests/e2e/run-multinode-e2e.sh @@ -59,6 +59,8 @@ CLUSTER_SERVICES_STARTED="false" # Use Hive profile for AWS CLI export AWS_PROFILE=hive +# Trust Hive CA for all profiles (AWS CLI v2 bundles its own Python/certifi, ignores system CA store) +export AWS_CA_BUNDLE="$HOME/node1/config/ca.pem" echo "========================================" @@ -177,6 +179,7 @@ wait_for_daemon_ready "https://${NODE1_IP}:${AWSGW_PORT}" # Define AWS CLI args pointing to node1's gateway AWS_EC2="aws --endpoint-url https://${NODE1_IP}:${AWSGW_PORT} ec2" +AWS_IAM="aws --endpoint-url https://${NODE1_IP}:${AWSGW_PORT} iam" # Phase 3b: Cluster Stats CLI (Multi-Node) echo "" @@ -447,10 +450,12 @@ for idx in "${!INSTANCE_IDS[@]}"; do -i "multinode-test-key.pem" \ ec2-user@"$SSH_HOST" 'hostname' 2>/dev/null) echo " VM hostname: $VM_HOSTNAME" - if echo "$VM_HOSTNAME" | grep -q "$instance_id"; then - echo " Hostname contains instance ID" + # Hostname uses truncated ID: hive-vm- + SHORT_ID=$(echo "$instance_id" | sed 's/^i-//' | cut -c1-8) + if echo "$VM_HOSTNAME" | grep -q "$SHORT_ID"; then + echo " Hostname contains instance ID prefix ($SHORT_ID)" else - echo " WARNING: Hostname '$VM_HOSTNAME' does not contain instance ID '$instance_id' (non-fatal)" + echo " WARNING: Hostname '$VM_HOSTNAME' does not contain instance ID prefix '$SHORT_ID' (non-fatal)" fi done @@ -1150,9 +1155,289 @@ fi echo " Crash recovery tests passed" -# Phase 5c: VPC Networking +# Phase 5c: IAM Accounts & Cross-Account Isolation echo "" -echo "Phase 5c: VPC Networking" +echo "Phase 5c: IAM Accounts & Cross-Account Isolation" +echo "========================================" + +AWS_EP="--endpoint-url https://${NODE1_IP}:${AWSGW_PORT}" + +# Step 1: Create accounts +echo "" +echo "Step 1: Create Accounts" +echo "----------------------------------------" + +echo " Creating Team Alpha account..." +ALPHA_OUTPUT=$(./bin/hive admin account create --name "Team Alpha" --config "$HOME/node1/config/hive.toml" 2>&1) +echo "$ALPHA_OUTPUT" +ALPHA_ACCOUNT=$(echo "$ALPHA_OUTPUT" | grep "Account ID:" | awk '{print $NF}') +ALPHA_KEY_ID=$(echo "$ALPHA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') +ALPHA_SECRET=$(echo "$ALPHA_OUTPUT" | grep "Secret Access Key:" | awk '{print $NF}') + +if [ -z "$ALPHA_ACCOUNT" ] || [ -z "$ALPHA_KEY_ID" ]; then + echo " ERROR: Failed to parse Team Alpha account output" + exit 1 +fi +echo " Team Alpha: account=$ALPHA_ACCOUNT key=$ALPHA_KEY_ID" + +# Configure alpha profile (in case auto-config used a different endpoint) +aws configure set aws_access_key_id "$ALPHA_KEY_ID" --profile hive-team-alpha +aws configure set aws_secret_access_key "$ALPHA_SECRET" --profile hive-team-alpha +aws configure set region us-east-1 --profile hive-team-alpha + +echo " Creating Team Beta account..." +BETA_OUTPUT=$(./bin/hive admin account create --name "Team Beta" --config "$HOME/node1/config/hive.toml" 2>&1) +echo "$BETA_OUTPUT" +BETA_ACCOUNT=$(echo "$BETA_OUTPUT" | grep "Account ID:" | awk '{print $NF}') +BETA_KEY_ID=$(echo "$BETA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') +BETA_SECRET=$(echo "$BETA_OUTPUT" | grep "Secret Access Key:" | awk '{print $NF}') + +if [ -z "$BETA_ACCOUNT" ] || [ -z "$BETA_KEY_ID" ]; then + echo " ERROR: Failed to parse Team Beta account output" + exit 1 +fi +echo " Team Beta: account=$BETA_ACCOUNT key=$BETA_KEY_ID" + +aws configure set aws_access_key_id "$BETA_KEY_ID" --profile hive-team-beta +aws configure set aws_secret_access_key "$BETA_SECRET" --profile hive-team-beta +aws configure set region us-east-1 --profile hive-team-beta + +# Verify sequential IDs +echo " Verifying sequential account IDs..." +if [ "$ALPHA_ACCOUNT" == "000000000001" ] && [ "$BETA_ACCOUNT" == "000000000002" ]; then + echo " Sequential IDs correct: $ALPHA_ACCOUNT, $BETA_ACCOUNT" +else + echo " WARNING: Account IDs may not be sequential: $ALPHA_ACCOUNT, $BETA_ACCOUNT" +fi + +# List accounts +echo " Listing accounts..." +ACCOUNT_LIST=$(./bin/hive admin account list --config "$HOME/node1/config/hive.toml" 2>&1) +echo "$ACCOUNT_LIST" +if echo "$ACCOUNT_LIST" | grep -q "Team Alpha" && echo "$ACCOUNT_LIST" | grep -q "Team Beta"; then + echo " Account list verified" +else + echo " ERROR: Account list missing expected accounts" + exit 1 +fi + +# Step 2: Account admin auth +echo "" +echo "Step 2: Account Admin Auth" +echo "----------------------------------------" + +echo " Testing alpha admin auth..." +aws $AWS_EP ec2 describe-instances --profile hive-team-alpha > /dev/null +echo " Alpha admin: ec2 OK" +aws $AWS_EP iam list-users --profile hive-team-alpha > /dev/null +echo " Alpha admin: iam OK" + +echo " Testing beta admin auth..." +aws $AWS_EP ec2 describe-instances --profile hive-team-beta > /dev/null +echo " Beta admin: ec2 OK" +aws $AWS_EP iam list-users --profile hive-team-beta > /dev/null +echo " Beta admin: iam OK" + +# Step 3: Account-scoped users +echo "" +echo "Step 3: Account-Scoped Users" +echo "----------------------------------------" + +# Same username in different accounts +echo " Creating alice in both accounts..." +aws $AWS_EP iam create-user --user-name alice --profile hive-team-alpha > /dev/null +ALPHA_ALICE_ARN=$(aws $AWS_EP iam get-user --user-name alice --profile hive-team-alpha | jq -r '.User.Arn') +echo " Alpha alice: $ALPHA_ALICE_ARN" + +aws $AWS_EP iam create-user --user-name alice --profile hive-team-beta > /dev/null +BETA_ALICE_ARN=$(aws $AWS_EP iam get-user --user-name alice --profile hive-team-beta | jq -r '.User.Arn') +echo " Beta alice: $BETA_ALICE_ARN" + +# Additional users +aws $AWS_EP iam create-user --user-name team-member --profile hive-team-alpha > /dev/null +aws $AWS_EP iam create-user --user-name dev-user --profile hive-team-beta > /dev/null + +# List users — scoped +echo " Verifying scoped user lists..." +ALPHA_USERS=$(aws $AWS_EP iam list-users --profile hive-team-alpha | jq -r '.Users[].UserName' | sort | tr '\n' ',') +echo " Alpha users: $ALPHA_USERS" +BETA_USERS=$(aws $AWS_EP iam list-users --profile hive-team-beta | jq -r '.Users[].UserName' | sort | tr '\n' ',') +echo " Beta users: $BETA_USERS" + +# Cross-account isolation +echo " Verifying cross-account isolation..." +set +e +CROSS_CHECK=$(aws $AWS_EP iam get-user --user-name dev-user --profile hive-team-alpha 2>&1) +set -e +if echo "$CROSS_CHECK" | grep -q "NoSuchEntity"; then + echo " Alpha cannot see Beta's dev-user — isolation OK" +else + echo " ERROR: Alpha can see Beta's user (cross-account leak)" + exit 1 +fi + +set +e +CROSS_CHECK2=$(aws $AWS_EP iam get-user --user-name team-member --profile hive-team-beta 2>&1) +set -e +if echo "$CROSS_CHECK2" | grep -q "NoSuchEntity"; then + echo " Beta cannot see Alpha's team-member — isolation OK" +else + echo " ERROR: Beta can see Alpha's user (cross-account leak)" + exit 1 +fi + +# Step 4: Account-scoped access keys +echo "" +echo "Step 4: Account-Scoped Access Keys" +echo "----------------------------------------" + +ALPHA_ALICE_KEY=$(aws $AWS_EP iam create-access-key --user-name alice --profile hive-team-alpha) +ALPHA_ALICE_KEY_ID=$(echo "$ALPHA_ALICE_KEY" | jq -r '.AccessKey.AccessKeyId') +ALPHA_ALICE_SECRET=$(echo "$ALPHA_ALICE_KEY" | jq -r '.AccessKey.SecretAccessKey') +echo " Alpha alice key: $ALPHA_ALICE_KEY_ID" + +aws configure set aws_access_key_id "$ALPHA_ALICE_KEY_ID" --profile hive-alpha-alice +aws configure set aws_secret_access_key "$ALPHA_ALICE_SECRET" --profile hive-alpha-alice +aws configure set region us-east-1 --profile hive-alpha-alice + +BETA_ALICE_KEY=$(aws $AWS_EP iam create-access-key --user-name alice --profile hive-team-beta) +BETA_ALICE_KEY_ID=$(echo "$BETA_ALICE_KEY" | jq -r '.AccessKey.AccessKeyId') +BETA_ALICE_SECRET=$(echo "$BETA_ALICE_KEY" | jq -r '.AccessKey.SecretAccessKey') +echo " Beta alice key: $BETA_ALICE_KEY_ID" + +aws configure set aws_access_key_id "$BETA_ALICE_KEY_ID" --profile hive-beta-alice +aws configure set aws_secret_access_key "$BETA_ALICE_SECRET" --profile hive-beta-alice +aws configure set region us-east-1 --profile hive-beta-alice + +# Step 5: Account-scoped policies & enforcement +echo "" +echo "Step 5: Account-Scoped Policies & Enforcement" +echo "----------------------------------------" + +# Alpha: narrow EC2 read-only +echo " Creating EC2ReadOnly in Alpha (narrow)..." +aws $AWS_EP iam create-policy \ + --policy-name EC2ReadOnly \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": ["ec2:DescribeInstances", "ec2:DescribeVpcs"], + "Resource": "*" + }] + }' --profile hive-team-alpha > /dev/null + +# Beta: broad EC2 Describe* wildcard +echo " Creating EC2ReadOnly in Beta (broad Describe*)..." +aws $AWS_EP iam create-policy \ + --policy-name EC2ReadOnly \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": "ec2:Describe*", + "Resource": "*" + }] + }' --profile hive-team-beta > /dev/null + +# Attach policies +echo " Attaching policies..." +aws $AWS_EP iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-alpha +aws $AWS_EP iam attach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-beta + +# Verify scoped enforcement +echo " Verifying scoped enforcement..." + +# Alpha alice: narrow policy +aws $AWS_EP ec2 describe-instances --profile hive-alpha-alice > /dev/null +echo " Alpha alice: describe-instances — allowed" +aws $AWS_EP ec2 describe-vpcs --profile hive-alpha-alice > /dev/null +echo " Alpha alice: describe-vpcs — allowed" +expect_error "AccessDenied" aws $AWS_EP ec2 describe-key-pairs --profile hive-alpha-alice +echo " Alpha alice: describe-key-pairs — denied (narrow policy)" + +# Beta alice: broad policy +aws $AWS_EP ec2 describe-instances --profile hive-beta-alice > /dev/null +echo " Beta alice: describe-instances — allowed" +aws $AWS_EP ec2 describe-key-pairs --profile hive-beta-alice > /dev/null +echo " Beta alice: describe-key-pairs — allowed (Describe* wildcard)" + +# Both denied non-Describe +expect_error "AccessDenied" aws $AWS_EP ec2 create-key-pair --key-name x --profile hive-alpha-alice +echo " Alpha alice: create-key-pair — denied" +expect_error "AccessDenied" aws $AWS_EP ec2 create-key-pair --key-name x --profile hive-beta-alice +echo " Beta alice: create-key-pair — denied" + +echo " Scoped enforcement verified" + +# Step 6: Cross-account delete isolation +echo "" +echo "Step 6: Cross-Account Delete Isolation" +echo "----------------------------------------" + +# Delete Alpha's alice +echo " Deleting Alpha's alice..." +aws $AWS_EP iam detach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-alpha +aws $AWS_EP iam delete-access-key --user-name alice \ + --access-key-id "$ALPHA_ALICE_KEY_ID" --profile hive-team-alpha +aws $AWS_EP iam delete-user --user-name alice --profile hive-team-alpha + +# Verify Alpha alice gone +set +e +ALPHA_CHECK=$(aws $AWS_EP iam get-user --user-name alice --profile hive-team-alpha 2>&1) +set -e +if echo "$ALPHA_CHECK" | grep -q "NoSuchEntity"; then + echo " Alpha alice deleted" +else + echo " ERROR: Alpha alice still exists after delete" + exit 1 +fi + +# Verify Beta alice unaffected +aws $AWS_EP iam get-user --user-name alice --profile hive-team-beta > /dev/null +echo " Beta alice still exists (isolation OK)" + +aws $AWS_EP ec2 describe-instances --profile hive-beta-alice > /dev/null +echo " Beta alice auth still works (isolation OK)" + +# Step 7: IAM Account Cleanup +echo "" +echo "Step 7: IAM Account Cleanup" +echo "----------------------------------------" + +# Beta cleanup +echo " Cleaning up Beta account resources..." +aws $AWS_EP iam detach-user-policy --user-name alice \ + --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-beta +aws $AWS_EP iam delete-access-key --user-name alice \ + --access-key-id "$BETA_ALICE_KEY_ID" --profile hive-team-beta +aws $AWS_EP iam delete-user --user-name alice --profile hive-team-beta +aws $AWS_EP iam delete-user --user-name dev-user --profile hive-team-beta +aws $AWS_EP iam delete-policy \ + --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-beta + +# Alpha cleanup (alice already deleted) +echo " Cleaning up Alpha account resources..." +aws $AWS_EP iam delete-user --user-name team-member --profile hive-team-alpha +aws $AWS_EP iam delete-policy \ + --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-alpha + +# Clean up AWS CLI profiles +for p in hive-team-alpha hive-team-beta hive-alpha-alice hive-beta-alice; do + aws configure set aws_access_key_id "" --profile $p 2>/dev/null || true + aws configure set aws_secret_access_key "" --profile $p 2>/dev/null || true +done + +echo " IAM account cleanup complete" +echo "" +echo " IAM Accounts & Cross-Account Isolation tests passed" + +# Phase 5d: VPC Networking +echo "" +echo "Phase 5d: VPC Networking" echo "========================================" echo "Testing VPC instance launch, PrivateIpAddress, and same-subnet connectivity..."