From 7f29580d3b1bc6136d2d71afef2f49cac67273cb Mon Sep 17 00:00:00 2001 From: allanice001 Date: Mon, 1 Sep 2025 23:53:48 +0100 Subject: [PATCH] Servers Page & API --- docs/docs.go | 445 +++++++++++ docs/swagger.json | 445 +++++++++++ docs/swagger.yaml | 293 ++++++++ internal/api/routes.go | 11 + internal/db/database.go | 1 + internal/db/models/server.go | 17 + internal/handlers/servers/dto.go | 35 + internal/handlers/servers/funcs.go | 47 ++ internal/handlers/servers/servers.go | 296 ++++++++ .../{icons-CHRYRpwL.js => icons-BROtNQ6N.js} | 72 +- internal/ui/dist/assets/index-C5NwS5VO.js | 1 + internal/ui/dist/assets/index-CJrhsj7s.css | 1 - internal/ui/dist/assets/index-DXA6UWYz.css | 1 + internal/ui/dist/assets/index-YQeQnKJK.js | 1 - .../{radix-DN_DrUzo.js => radix-9eRs70j8.js} | 8 +- ...{router-CyXg69m3.js => router-CcA--AgE.js} | 2 +- ...{vendor-Cnbx_Mrt.js => vendor-D1z0LlOQ.js} | 4 +- internal/ui/dist/index.html | 14 +- ui/src/App.tsx | 6 +- ui/src/pages/core/servers-page.tsx | 699 ++++++++++++++++++ 20 files changed, 2350 insertions(+), 49 deletions(-) create mode 100644 internal/db/models/server.go create mode 100644 internal/handlers/servers/dto.go create mode 100644 internal/handlers/servers/funcs.go create mode 100644 internal/handlers/servers/servers.go rename internal/ui/dist/assets/{icons-CHRYRpwL.js => icons-BROtNQ6N.js} (72%) create mode 100644 internal/ui/dist/assets/index-C5NwS5VO.js delete mode 100644 internal/ui/dist/assets/index-CJrhsj7s.css create mode 100644 internal/ui/dist/assets/index-DXA6UWYz.css delete mode 100644 internal/ui/dist/assets/index-YQeQnKJK.js rename internal/ui/dist/assets/{radix-DN_DrUzo.js => radix-9eRs70j8.js} (73%) rename internal/ui/dist/assets/{router-CyXg69m3.js => router-CcA--AgE.js} (99%) rename internal/ui/dist/assets/{vendor-Cnbx_Mrt.js => vendor-D1z0LlOQ.js} (99%) create mode 100644 ui/src/pages/core/servers-page.tsx diff --git a/docs/docs.go b/docs/docs.go index 94291d7..ba0e89c 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1121,6 +1121,365 @@ const docTemplate = `{ } } }, + "/api/v1/servers": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Returns servers for the organization in X-Org-ID. Optional filters: status, role.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "List servers (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Filter by status (pending|provisioning|ready|failed)", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "Filter by role", + "name": "role", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/servers.serverResponse" + } + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "500": { + "description": "failed to list servers", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Create server (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "description": "Server payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/servers.createServerRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/servers.serverResponse" + } + }, + "400": { + "description": "invalid json / missing fields / invalid status / invalid ssh_key_id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "500": { + "description": "create failed", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/servers/{id}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Returns one server in the given organization.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Get server by ID (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Server ID (UUID)", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/servers.serverResponse" + } + }, + "400": { + "description": "invalid id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "404": { + "description": "not found", + "schema": { + "type": "string" + } + }, + "500": { + "description": "fetch failed", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Permanently deletes the server.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Delete server (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Server ID (UUID)", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "type": "string" + } + }, + "400": { + "description": "invalid id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "500": { + "description": "delete failed", + "schema": { + "type": "string" + } + } + } + }, + "patch": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Partially update fields; changing ssh_key_id validates ownership.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Update server (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Server ID (UUID)", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Fields to update", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/servers.updateServerRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/servers.serverResponse" + } + }, + "400": { + "description": "invalid id / invalid json / invalid status / invalid ssh_key_id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "404": { + "description": "not found", + "schema": { + "type": "string" + } + }, + "500": { + "description": "update failed", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/ssh": { "get": { "security": [ @@ -1844,6 +2203,92 @@ const docTemplate = `{ } } }, + "servers.createServerRequest": { + "type": "object", + "properties": { + "hostname": { + "type": "string" + }, + "ip_address": { + "type": "string" + }, + "role": { + "type": "string", + "example": "master|worker|bastion" + }, + "ssh_key_id": { + "type": "string" + }, + "ssh_user": { + "type": "string" + }, + "status": { + "type": "string", + "example": "pending|provisioning|ready|failed" + } + } + }, + "servers.serverResponse": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "id": { + "type": "string" + }, + "ip_address": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "role": { + "type": "string" + }, + "ssh_key_id": { + "type": "string" + }, + "ssh_user": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "servers.updateServerRequest": { + "type": "object", + "properties": { + "hostname": { + "type": "string" + }, + "ip_address": { + "type": "string" + }, + "role": { + "type": "string", + "example": "master|worker|bastion" + }, + "ssh_key_id": { + "type": "string" + }, + "ssh_user": { + "type": "string" + }, + "status": { + "description": "enum: pending,provisioning,ready,failed", + "type": "string", + "example": "pending|provisioning|ready|failed" + } + } + }, "ssh.createSSHRequest": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 7b98d6b..ccdfb83 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1117,6 +1117,365 @@ } } }, + "/api/v1/servers": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Returns servers for the organization in X-Org-ID. Optional filters: status, role.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "List servers (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Filter by status (pending|provisioning|ready|failed)", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "Filter by role", + "name": "role", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/servers.serverResponse" + } + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "500": { + "description": "failed to list servers", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Create server (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "description": "Server payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/servers.createServerRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/servers.serverResponse" + } + }, + "400": { + "description": "invalid json / missing fields / invalid status / invalid ssh_key_id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "500": { + "description": "create failed", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/servers/{id}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Returns one server in the given organization.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Get server by ID (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Server ID (UUID)", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/servers.serverResponse" + } + }, + "400": { + "description": "invalid id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "404": { + "description": "not found", + "schema": { + "type": "string" + } + }, + "500": { + "description": "fetch failed", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Permanently deletes the server.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Delete server (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Server ID (UUID)", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "type": "string" + } + }, + "400": { + "description": "invalid id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "500": { + "description": "delete failed", + "schema": { + "type": "string" + } + } + } + }, + "patch": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Partially update fields; changing ssh_key_id validates ownership.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "servers" + ], + "summary": "Update server (org scoped)", + "parameters": [ + { + "type": "string", + "description": "Organization UUID", + "name": "X-Org-ID", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Server ID (UUID)", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Fields to update", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/servers.updateServerRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/servers.serverResponse" + } + }, + "400": { + "description": "invalid id / invalid json / invalid status / invalid ssh_key_id", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "organization required", + "schema": { + "type": "string" + } + }, + "404": { + "description": "not found", + "schema": { + "type": "string" + } + }, + "500": { + "description": "update failed", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/ssh": { "get": { "security": [ @@ -1840,6 +2199,92 @@ } } }, + "servers.createServerRequest": { + "type": "object", + "properties": { + "hostname": { + "type": "string" + }, + "ip_address": { + "type": "string" + }, + "role": { + "type": "string", + "example": "master|worker|bastion" + }, + "ssh_key_id": { + "type": "string" + }, + "ssh_user": { + "type": "string" + }, + "status": { + "type": "string", + "example": "pending|provisioning|ready|failed" + } + } + }, + "servers.serverResponse": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "id": { + "type": "string" + }, + "ip_address": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "role": { + "type": "string" + }, + "ssh_key_id": { + "type": "string" + }, + "ssh_user": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "servers.updateServerRequest": { + "type": "object", + "properties": { + "hostname": { + "type": "string" + }, + "ip_address": { + "type": "string" + }, + "role": { + "type": "string", + "example": "master|worker|bastion" + }, + "ssh_key_id": { + "type": "string" + }, + "ssh_user": { + "type": "string" + }, + "status": { + "description": "enum: pending,provisioning,ready,failed", + "type": "string", + "example": "pending|provisioning|ready|failed" + } + } + }, "ssh.createSSHRequest": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index b76d91b..eeddfca 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -243,6 +243,64 @@ definitions: slug: type: string type: object + servers.createServerRequest: + properties: + hostname: + type: string + ip_address: + type: string + role: + example: master|worker|bastion + type: string + ssh_key_id: + type: string + ssh_user: + type: string + status: + example: pending|provisioning|ready|failed + type: string + type: object + servers.serverResponse: + properties: + created_at: + type: string + hostname: + type: string + id: + type: string + ip_address: + type: string + organization_id: + type: string + role: + type: string + ssh_key_id: + type: string + ssh_user: + type: string + status: + type: string + updated_at: + type: string + type: object + servers.updateServerRequest: + properties: + hostname: + type: string + ip_address: + type: string + role: + example: master|worker|bastion + type: string + ssh_key_id: + type: string + ssh_user: + type: string + status: + description: 'enum: pending,provisioning,ready,failed' + example: pending|provisioning|ready|failed + type: string + type: object ssh.createSSHRequest: properties: bits: @@ -1003,6 +1061,241 @@ paths: summary: Remove member from organization tags: - organizations + /api/v1/servers: + get: + consumes: + - application/json + description: 'Returns servers for the organization in X-Org-ID. Optional filters: + status, role.' + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + required: true + type: string + - description: Filter by status (pending|provisioning|ready|failed) + in: query + name: status + type: string + - description: Filter by role + in: query + name: role + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/servers.serverResponse' + type: array + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "500": + description: failed to list servers + schema: + type: string + security: + - BearerAuth: [] + summary: List servers (org scoped) + tags: + - servers + post: + consumes: + - application/json + description: Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id + belongs to the org. + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + required: true + type: string + - description: Server payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/servers.createServerRequest' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/servers.serverResponse' + "400": + description: invalid json / missing fields / invalid status / invalid ssh_key_id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "500": + description: create failed + schema: + type: string + security: + - BearerAuth: [] + summary: Create server (org scoped) + tags: + - servers + /api/v1/servers/{id}: + delete: + consumes: + - application/json + description: Permanently deletes the server. + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + required: true + type: string + - description: Server ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "500": + description: delete failed + schema: + type: string + security: + - BearerAuth: [] + summary: Delete server (org scoped) + tags: + - servers + get: + consumes: + - application/json + description: Returns one server in the given organization. + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + required: true + type: string + - description: Server ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/servers.serverResponse' + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: fetch failed + schema: + type: string + security: + - BearerAuth: [] + summary: Get server by ID (org scoped) + tags: + - servers + patch: + consumes: + - application/json + description: Partially update fields; changing ssh_key_id validates ownership. + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + required: true + type: string + - description: Server ID (UUID) + in: path + name: id + required: true + type: string + - description: Fields to update + in: body + name: body + required: true + schema: + $ref: '#/definitions/servers.updateServerRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/servers.serverResponse' + "400": + description: invalid id / invalid json / invalid status / invalid ssh_key_id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: update failed + schema: + type: string + security: + - BearerAuth: [] + summary: Update server (org scoped) + tags: + - servers /api/v1/ssh: get: consumes: diff --git a/internal/api/routes.go b/internal/api/routes.go index a755f1d..7c0a56e 100644 --- a/internal/api/routes.go +++ b/internal/api/routes.go @@ -7,6 +7,7 @@ import ( "github.com/glueops/autoglue/internal/handlers/authn" "github.com/glueops/autoglue/internal/handlers/health" "github.com/glueops/autoglue/internal/handlers/orgs" + "github.com/glueops/autoglue/internal/handlers/servers" "github.com/glueops/autoglue/internal/handlers/ssh" "github.com/glueops/autoglue/internal/middleware" "github.com/glueops/autoglue/internal/ui" @@ -69,6 +70,16 @@ func RegisterRoutes(r chi.Router) { s.Delete("/{id}", ssh.DeleteSSHKey) s.Get("/{id}/download", ssh.DownloadSSHKey) }) + + v1.Route("/servers", func(s chi.Router) { + s.Use(authMW) + s.Get("/", servers.ListServers) + s.Post("/", servers.CreateServer) + s.Get("/{id}", servers.GetServer) + s.Patch("/{id}", servers.UpdateServer) + s.Delete("/{id}", servers.DeleteServer) + }) + }) }) diff --git a/internal/db/database.go b/internal/db/database.go index c13276a..1b984a3 100644 --- a/internal/db/database.go +++ b/internal/db/database.go @@ -35,6 +35,7 @@ func Connect() { &models.OrganizationKey{}, &models.PasswordReset{}, &models.RefreshToken{}, + &models.Server{}, &models.SshKey{}, &models.User{}, ) diff --git a/internal/db/models/server.go b/internal/db/models/server.go new file mode 100644 index 0000000..8230d86 --- /dev/null +++ b/internal/db/models/server.go @@ -0,0 +1,17 @@ +package models + +import "github.com/google/uuid" + +type Server struct { + ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"` + OrganizationID uuid.UUID `gorm:"type:uuid;not null" json:"organization_id"` + Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"` + Hostname string `json:"hostname"` + IPAddress string `gorm:"not null"` + SSHUser string `gorm:"not null"` + SshKeyID uuid.UUID `gorm:"type:uuid;not null"` + SshKey SshKey `gorm:"foreignKey:SshKeyID"` + Role string `gorm:"not null"` // e.g., "master", "worker", "bastion" + Status string `gorm:"default:'pending'"` // pending, provisioning, ready, failed + Timestamped +} diff --git a/internal/handlers/servers/dto.go b/internal/handlers/servers/dto.go new file mode 100644 index 0000000..23e8cfe --- /dev/null +++ b/internal/handlers/servers/dto.go @@ -0,0 +1,35 @@ +package servers + +import "github.com/google/uuid" + +type createServerRequest struct { + Hostname string `json:"hostname,omitempty"` + IPAddress string `json:"ip_address"` + SSHUser string `json:"ssh_user"` + SshKeyID string `json:"ssh_key_id"` + Role string `json:"role" example:"master|worker|bastion"` + Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed"` +} + +type updateServerRequest struct { + Hostname *string `json:"hostname,omitempty"` + IPAddress *string `json:"ip_address,omitempty"` + SSHUser *string `json:"ssh_user,omitempty"` + SshKeyID *string `json:"ssh_key_id,omitempty"` + Role *string `json:"role,omitempty" example:"master|worker|bastion"` + // enum: pending,provisioning,ready,failed + Status *string `json:"status,omitempty" example:"pending|provisioning|ready|failed"` +} + +type serverResponse struct { + ID uuid.UUID `json:"id"` + OrganizationID uuid.UUID `json:"organization_id"` + Hostname string `json:"hostname"` + IPAddress string `json:"ip_address"` + SSHUser string `json:"ssh_user"` + SshKeyID uuid.UUID `json:"ssh_key_id"` + Role string `json:"role"` + Status string `json:"status"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` +} diff --git a/internal/handlers/servers/funcs.go b/internal/handlers/servers/funcs.go new file mode 100644 index 0000000..88b57ed --- /dev/null +++ b/internal/handlers/servers/funcs.go @@ -0,0 +1,47 @@ +package servers + +import ( + "errors" + "strings" + "time" + + "github.com/glueops/autoglue/internal/db" + "github.com/glueops/autoglue/internal/db/models" + "github.com/google/uuid" + "gorm.io/gorm" +) + +func toResponse(s models.Server) serverResponse { + return serverResponse{ + ID: s.ID, + OrganizationID: s.OrganizationID, + Hostname: s.Hostname, + IPAddress: s.IPAddress, + SSHUser: s.SSHUser, + SshKeyID: s.SshKeyID, + Role: s.Role, + Status: s.Status, + CreatedAt: s.CreatedAt.UTC().Format(time.RFC3339), + UpdatedAt: s.UpdatedAt.UTC().Format(time.RFC3339), + } +} + +func validStatus(s string) bool { + switch strings.ToLower(s) { + case "pending", "provisioning", "ready", "failed", "": + return true + default: + return false + } +} + +func ensureKeyBelongsToOrg(orgID uuid.UUID, keyID uuid.UUID) error { + var k models.SshKey + if err := db.DB.Where("id = ? AND organization_id = ?", keyID, orgID).First(&k).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return errors.New("ssh key not found for this organization") + } + return err + } + return nil +} diff --git a/internal/handlers/servers/servers.go b/internal/handlers/servers/servers.go new file mode 100644 index 0000000..574d435 --- /dev/null +++ b/internal/handlers/servers/servers.go @@ -0,0 +1,296 @@ +package servers + +import ( + "encoding/json" + "errors" + "net/http" + "strings" + + "github.com/glueops/autoglue/internal/db" + "github.com/glueops/autoglue/internal/db/models" + "github.com/glueops/autoglue/internal/middleware" + "github.com/glueops/autoglue/internal/response" + "github.com/go-chi/chi/v5" + "github.com/google/uuid" + "gorm.io/gorm" +) + +// ListServers godoc +// @Summary List servers (org scoped) +// @Description Returns servers for the organization in X-Org-ID. Optional filters: status, role. +// @Tags servers +// @Accept json +// @Produce json +// @Param X-Org-ID header string true "Organization UUID" +// @Param status query string false "Filter by status (pending|provisioning|ready|failed)" +// @Param role query string false "Filter by role" +// @Security BearerAuth +// @Success 200 {array} serverResponse +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 500 {string} string "failed to list servers" +// @Router /api/v1/servers [get] +func ListServers(w http.ResponseWriter, r *http.Request) { + ac := middleware.GetAuthContext(r) + if ac == nil || ac.OrganizationID == uuid.Nil { + http.Error(w, "organization required", http.StatusForbidden) + return + } + + q := db.DB.Where("organization_id = ?", ac.OrganizationID) + if s := strings.TrimSpace(r.URL.Query().Get("status")); s != "" { + if !validStatus(s) { + http.Error(w, "invalid status", http.StatusBadRequest) + return + } + q = q.Where("status = ?", strings.ToLower(s)) + } + if role := strings.TrimSpace(r.URL.Query().Get("role")); role != "" { + q = q.Where("role = ?", role) + } + + var rows []models.Server + if err := q.Order("created_at DESC").Find(&rows).Error; err != nil { + http.Error(w, "failed to list servers", http.StatusInternalServerError) + return + } + + out := make([]serverResponse, 0, len(rows)) + for _, s := range rows { + out = append(out, toResponse(s)) + } + + _ = response.JSON(w, http.StatusOK, out) +} + +// GetServer godoc +// @Summary Get server by ID (org scoped) +// @Description Returns one server in the given organization. +// @Tags servers +// @Accept json +// @Produce json +// @Param X-Org-ID header string true "Organization UUID" +// @Param id path string true "Server ID (UUID)" +// @Security BearerAuth +// @Success 200 {object} serverResponse +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "fetch failed" +// @Router /api/v1/servers/{id} [get] +func GetServer(w http.ResponseWriter, r *http.Request) { + ac := middleware.GetAuthContext(r) + if ac == nil || ac.OrganizationID == uuid.Nil { + http.Error(w, "organization required", http.StatusForbidden) + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + http.Error(w, "invalid id", http.StatusBadRequest) + return + } + + var s models.Server + if err := db.DB.Where("id = ? AND organization_id = ?", id, ac.OrganizationID).First(&s).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + http.Error(w, "not found", http.StatusNotFound) + return + } + http.Error(w, "fetch failed", http.StatusInternalServerError) + return + } + + _ = response.JSON(w, http.StatusOK, toResponse(s)) +} + +// CreateServer godoc +// @Summary Create server (org scoped) +// @Description Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org. +// @Tags servers +// @Accept json +// @Produce json +// @Param X-Org-ID header string true "Organization UUID" +// @Param body body createServerRequest true "Server payload" +// @Security BearerAuth +// @Success 201 {object} serverResponse +// @Failure 400 {string} string "invalid json / missing fields / invalid status / invalid ssh_key_id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 500 {string} string "create failed" +// @Router /api/v1/servers [post] +func CreateServer(w http.ResponseWriter, r *http.Request) { + ac := middleware.GetAuthContext(r) + if ac == nil || ac.OrganizationID == uuid.Nil { + http.Error(w, "organization required", http.StatusForbidden) + return + } + + var req createServerRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + http.Error(w, "invalid json", http.StatusBadRequest) + return + } + if req.IPAddress == "" || req.SSHUser == "" || req.SshKeyID == "" || req.Role == "" { + http.Error(w, "ip_address, ssh_user, ssh_key_id and role are required", http.StatusBadRequest) + return + } + if req.Status != "" && !validStatus(req.Status) { + http.Error(w, "invalid status", http.StatusBadRequest) + return + } + + keyID, err := uuid.Parse(req.SshKeyID) + if err != nil { + http.Error(w, "invalid ssh_key_id", http.StatusBadRequest) + return + } + if err := ensureKeyBelongsToOrg(ac.OrganizationID, keyID); err != nil { + http.Error(w, "invalid or unauthorized ssh_key_id", http.StatusBadRequest) + return + } + + s := models.Server{ + OrganizationID: ac.OrganizationID, + Hostname: req.Hostname, + IPAddress: req.IPAddress, + SSHUser: req.SSHUser, + SshKeyID: keyID, + Role: req.Role, + Status: "pending", + } + if req.Status != "" { + s.Status = strings.ToLower(req.Status) + } + + if err := db.DB.Create(&s).Error; err != nil { + http.Error(w, "create failed", http.StatusInternalServerError) + return + } + + _ = response.JSON(w, http.StatusCreated, toResponse(s)) +} + +// UpdateServer godoc +// @Summary Update server (org scoped) +// @Description Partially update fields; changing ssh_key_id validates ownership. +// @Tags servers +// @Accept json +// @Produce json +// @Param X-Org-ID header string true "Organization UUID" +// @Param id path string true "Server ID (UUID)" +// @Param body body updateServerRequest true "Fields to update" +// @Security BearerAuth +// @Success 200 {object} serverResponse +// @Failure 400 {string} string "invalid id / invalid json / invalid status / invalid ssh_key_id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "update failed" +// @Router /api/v1/servers/{id} [patch] +func UpdateServer(w http.ResponseWriter, r *http.Request) { + ac := middleware.GetAuthContext(r) + if ac == nil || ac.OrganizationID == uuid.Nil { + http.Error(w, "organization required", http.StatusForbidden) + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + http.Error(w, "invalid id", http.StatusBadRequest) + return + } + + var s models.Server + if err := db.DB.Where("id = ? AND organization_id = ?", id, ac.OrganizationID).First(&s).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + http.Error(w, "not found", http.StatusNotFound) + return + } + http.Error(w, "fetch failed", http.StatusInternalServerError) + return + } + + var req updateServerRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + http.Error(w, "invalid json", http.StatusBadRequest) + return + } + + if req.Hostname != nil { + s.Hostname = *req.Hostname + } + if req.IPAddress != nil { + s.IPAddress = *req.IPAddress + } + if req.SSHUser != nil { + s.SSHUser = *req.SSHUser + } + if req.Role != nil { + s.Role = *req.Role + } + if req.Status != nil { + if !validStatus(*req.Status) { + http.Error(w, "invalid status", http.StatusBadRequest) + return + } + s.Status = strings.ToLower(*req.Status) + } + if req.SshKeyID != nil { + keyID, err := uuid.Parse(*req.SshKeyID) + if err != nil { + http.Error(w, "invalid ssh_key_id", http.StatusBadRequest) + return + } + if err := ensureKeyBelongsToOrg(ac.OrganizationID, keyID); err != nil { + http.Error(w, "invalid or unauthorized ssh_key_id", http.StatusBadRequest) + return + } + s.SshKeyID = keyID + } + + if err := db.DB.Save(&s).Error; err != nil { + http.Error(w, "update failed", http.StatusInternalServerError) + return + } + + _ = response.JSON(w, http.StatusOK, toResponse(s)) +} + +// DeleteServer godoc +// @Summary Delete server (org scoped) +// @Description Permanently deletes the server. +// @Tags servers +// @Accept json +// @Produce json +// @Param X-Org-ID header string true "Organization UUID" +// @Param id path string true "Server ID (UUID)" +// @Security BearerAuth +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 500 {string} string "delete failed" +// @Router /api/v1/servers/{id} [delete] +func DeleteServer(w http.ResponseWriter, r *http.Request) { + ac := middleware.GetAuthContext(r) + if ac == nil || ac.OrganizationID == uuid.Nil { + http.Error(w, "organization required", http.StatusForbidden) + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + http.Error(w, "invalid id", http.StatusBadRequest) + return + } + + if err := db.DB.Where("id = ? AND organization_id = ?", id, ac.OrganizationID). + Delete(&models.Server{}).Error; err != nil { + http.Error(w, "delete failed", http.StatusInternalServerError) + return + } + + response.NoContent(w) +} diff --git a/internal/ui/dist/assets/icons-CHRYRpwL.js b/internal/ui/dist/assets/icons-BROtNQ6N.js similarity index 72% rename from internal/ui/dist/assets/icons-CHRYRpwL.js rename to internal/ui/dist/assets/icons-BROtNQ6N.js index a477002..2fae19b 100644 --- a/internal/ui/dist/assets/icons-CHRYRpwL.js +++ b/internal/ui/dist/assets/icons-BROtNQ6N.js @@ -1,9 +1,9 @@ -import{r as d,R as s}from"./vendor-Cnbx_Mrt.js";/** +import{r as d,R as s}from"./vendor-D1z0LlOQ.js";/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),x=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,c)=>c?c.toUpperCase():a.toLowerCase()),k=e=>{const t=x(e);return t.charAt(0).toUpperCase()+t.slice(1)},v=(...e)=>e.filter((t,a,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===a).join(" ").trim(),z=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** + */const b=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),x=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,c)=>c?c.toUpperCase():a.toLowerCase()),k=e=>{const t=x(e);return t.charAt(0).toUpperCase()+t.slice(1)},v=(...e)=>e.filter((t,a,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===a).join(" ").trim(),z=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. @@ -13,144 +13,154 @@ import{r as d,R as s}from"./vendor-Cnbx_Mrt.js";/** * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:n="",children:o,iconNode:p,...i},h)=>d.createElement("svg",{ref:h,...j,width:t,height:t,stroke:e,strokeWidth:c?Number(a)*24/Number(t):a,className:v("lucide",n),...!o&&!z(i)&&{"aria-hidden":"true"},...i},[...p.map(([b,w])=>d.createElement(b,w)),...Array.isArray(o)?o:[o]]));/** + */const N=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:o="",children:n,iconNode:p,...i},h)=>d.createElement("svg",{ref:h,...j,width:t,height:t,stroke:e,strokeWidth:c?Number(a)*24/Number(t):a,className:v("lucide",o),...!n&&!z(i)&&{"aria-hidden":"true"},...i},[...p.map(([w,_])=>d.createElement(w,_)),...Array.isArray(n)?n:[n]]));/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const r=(e,t)=>{const a=d.forwardRef(({className:c,...n},o)=>d.createElement(N,{ref:o,iconNode:t,className:v(`lucide-${_(k(e))}`,`lucide-${e}`,c),...n}));return a.displayName=k(e),a};/** + */const r=(e,t)=>{const a=d.forwardRef(({className:c,...o},n)=>d.createElement(N,{ref:n,iconNode:t,className:v(`lucide-${b(k(e))}`,`lucide-${e}`,c),...o}));return a.displayName=k(e),a};/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const C=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],i1=r("boxes",C);/** + */const C=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],y1=r("boxes",C);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const O=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"m10.852 9.228-.383-.923",key:"1fjppe"}],["path",{d:"m13.148 14.772.382.924",key:"je3va1"}],["path",{d:"m13.531 8.305-.383.923",key:"18epck"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 0 0-5.63-1.446 3 3 0 0 0-.368 1.571 4 4 0 0 0-2.525 5.771",key:"jcbbz1"}],["path",{d:"M17.998 5.125a4 4 0 0 1 2.525 5.771",key:"1kkn7e"}],["path",{d:"M19.505 10.294a4 4 0 0 1-1.5 7.706",key:"18bmuc"}],["path",{d:"M4.032 17.483A4 4 0 0 0 11.464 20c.18-.311.892-.311 1.072 0a4 4 0 0 0 7.432-2.516",key:"uozx0d"}],["path",{d:"M4.5 10.291A4 4 0 0 0 6 18",key:"whdemb"}],["path",{d:"M6.002 5.125a3 3 0 0 0 .4 1.375",key:"1kqy2g"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],d1=r("brain-cog",O);/** + */const O=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"m10.852 9.228-.383-.923",key:"1fjppe"}],["path",{d:"m13.148 14.772.382.924",key:"je3va1"}],["path",{d:"m13.531 8.305-.383.923",key:"18epck"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 0 0-5.63-1.446 3 3 0 0 0-.368 1.571 4 4 0 0 0-2.525 5.771",key:"jcbbz1"}],["path",{d:"M17.998 5.125a4 4 0 0 1 2.525 5.771",key:"1kkn7e"}],["path",{d:"M19.505 10.294a4 4 0 0 1-1.5 7.706",key:"18bmuc"}],["path",{d:"M4.032 17.483A4 4 0 0 0 11.464 20c.18-.311.892-.311 1.072 0a4 4 0 0 0 7.432-2.516",key:"uozx0d"}],["path",{d:"M4.5 10.291A4 4 0 0 0 6 18",key:"whdemb"}],["path",{d:"M6.002 5.125a3 3 0 0 0 .4 1.375",key:"1kqy2g"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],l1=r("brain-cog",O);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],y1=r("building",$);/** + */const $=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],p1=r("building",$);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],l1=r("check",P);/** + */const P=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],k1=r("check",P);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],p1=r("chevron-down",q);/** + */const q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],u1=r("chevron-down",q);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const A=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],k1=r("chevron-up",A);/** + */const A=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],m1=r("chevron-up",A);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],u1=r("component",V);/** + */const V=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],v1=r("cloud-download",V);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const L=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]],m1=r("file-key-2",L);/** + */const L=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],f1=r("component",L);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const E=[["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-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],v1=r("house",E);/** + */const E=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],M1=r("copy",E);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const H=[["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"}]],f1=r("key",H);/** + */const H=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]],g1=r("file-key-2",H);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const S=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],M1=r("laptop",S);/** + */const S=[["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-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],w1=r("house",S);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const B=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],g1=r("list-todo",B);/** + */const B=[["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"}]],_1=r("key",B);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const U=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],b1=r("lock-keyhole",U);/** + */const D=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],b1=r("laptop",D);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const D=[["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"}]],w1=r("moon",D);/** + */const U=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],x1=r("list-todo",U);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const I=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],_1=r("pencil",I);/** + */const I=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],z1=r("lock-keyhole",I);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const K=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],x1=r("plus",K);/** + */const K=[["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"}]],j1=r("moon",K);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T=[["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"}]],z1=r("server",T);/** + */const T=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],N1=r("pencil",T);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const R=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],j1=r("settings",R);/** + */const R=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],C1=r("plus",R);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const W=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],N1=r("shield-check",W);/** + */const W=[["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"}]],O1=r("server",W);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z=[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]],C1=r("spray-can",Z);/** + */const Z=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$1=r("settings",Z);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const F=[["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"}]],O1=r("sun",F);/** + */const F=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],P1=r("shield-check",F);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],$1=r("tags",G);/** + */const G=[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]],q1=r("spray-can",G);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],P1=r("trash",X);/** + */const X=[["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"}]],A1=r("sun",X);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]],q1=r("user-round-plus",J);/** + */const J=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],V1=r("tags",J);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],A1=r("user",Q);/** + */const Q=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],L1=r("trash",Q);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Y=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],V1=r("users",Y);/** + */const Y=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]],E1=r("user-round-plus",Y);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],L1=r("x",e1);var f={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u=s.createContext&&s.createContext(f),t1=["attr","size","title"];function a1(e,t){if(e==null)return{};var a=c1(e,t),c,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,c)&&(a[c]=e[c])}return a}function c1(e,t){if(e==null)return{};var a={};for(var c in e)if(Object.prototype.hasOwnProperty.call(e,c)){if(t.indexOf(c)>=0)continue;a[c]=e[c]}return a}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.createElement(t.tag,l({key:a},t.attr),M(t.child)))}function g(e){return t=>s.createElement(h1,y({attr:l({},e.attr)},t),M(e.child))}function h1(e){var t=a=>{var{attr:c,size:n,title:o}=e,p=a1(e,t1),i=n||a.size||"1em",h;return a.className&&(h=a.className),e.className&&(h=(h?h+" ":"")+e.className),s.createElement("svg",y({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,c,p,{className:h,style:l(l({color:e.color||a.color},a.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&s.createElement("title",null,o),e.children)};return u!==void 0?s.createElement(u.Consumer,null,a=>t(a)):t(f)}function E1(e){return g({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(e)}function H1(e){return g({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}export{E1 as A,i1 as B,l1 as C,m1 as F,v1 as H,f1 as K,M1 as L,w1 as M,x1 as P,O1 as S,$1 as T,V1 as U,L1 as X,u1 as a,C1 as b,z1 as c,d1 as d,b1 as e,g1 as f,y1 as g,A1 as h,j1 as i,N1 as j,p1 as k,H1 as l,k1 as m,q1 as n,P1 as o,_1 as p}; + */const e1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],H1=r("user",e1);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],S1=r("users",t1);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],B1=r("x",a1);var f={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u=s.createContext&&s.createContext(f),c1=["attr","size","title"];function r1(e,t){if(e==null)return{};var a=o1(e,t),c,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,c)&&(a[c]=e[c])}return a}function o1(e,t){if(e==null)return{};var a={};for(var c in e)if(Object.prototype.hasOwnProperty.call(e,c)){if(t.indexOf(c)>=0)continue;a[c]=e[c]}return a}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.createElement(t.tag,l({key:a},t.attr),M(t.child)))}function g(e){return t=>s.createElement(i1,y({attr:l({},e.attr)},t),M(e.child))}function i1(e){var t=a=>{var{attr:c,size:o,title:n}=e,p=r1(e,c1),i=o||a.size||"1em",h;return a.className&&(h=a.className),e.className&&(h=(h?h+" ":"")+e.className),s.createElement("svg",y({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,c,p,{className:h,style:l(l({color:e.color||a.color},a.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),n&&s.createElement("title",null,n),e.children)};return u!==void 0?s.createElement(u.Consumer,null,a=>t(a)):t(f)}function D1(e){return g({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(e)}function U1(e){return g({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}export{D1 as A,y1 as B,k1 as C,g1 as F,w1 as H,_1 as K,b1 as L,j1 as M,C1 as P,A1 as S,V1 as T,S1 as U,B1 as X,f1 as a,q1 as b,O1 as c,l1 as d,z1 as e,x1 as f,p1 as g,H1 as h,$1 as i,P1 as j,u1 as k,U1 as l,m1 as m,N1 as n,L1 as o,E1 as p,M1 as q,v1 as r}; diff --git a/internal/ui/dist/assets/index-C5NwS5VO.js b/internal/ui/dist/assets/index-C5NwS5VO.js new file mode 100644 index 0000000..88288a9 --- /dev/null +++ b/internal/ui/dist/assets/index-C5NwS5VO.js @@ -0,0 +1 @@ +import{t as It,m as _t,r as u,j as e,n as Ee,z as st,F as Et,C as zt,p as Ot,q as Dt,v as G,w as L,_ as be,x as Z,y as At,A as U,B,D as p,T as Tt,J as Lt,E as $t}from"./vendor-D1z0LlOQ.js";import{S as xe,R as Ft,a as at,C as rt,b as nt,T as it,D as ot,P as lt,O as dt,c as Mt,d as Rt,e as Pt,f as Vt,g as Ut,A as Bt,h as Ht,i as Gt,j as Kt,k as qt,l as Jt,m as Wt,n as Yt,I as Xt,o as Qt,p as Zt,q as es,r as ts,s as ss,t as as,u as rs,v as ns,w as is,x as os,y as ls,z as ds,B as cs,E as us,V as ms,F as xs,G as hs,H as fs,J as gs,K as ps,L as js,M as bs,N as vs}from"./radix-9eRs70j8.js";import{X as ct,S as ws,M as ys,L as Ns,C as ge,H as Ss,A as Cs,B as ks,a as Is,T as _s,b as Es,c as zs,d as Os,K as Ds,F as As,e as Ts,f as Ls,g as $s,U as Je,h as Fs,i as Ms,j as Rs,k as ze,l as Ps,m as Vs,P as ut,n as Us,o as ve,p as We,q as Bs,r as Hs}from"./icons-BROtNQ6N.js";import{u as we,L as Y,O as Oe,N as De,a as he,b as mt,R as Gs,c as N,B as Ks}from"./router-CcA--AgE.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const d of l)if(d.type==="childList")for(const x of d.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&r(x)}).observe(document,{childList:!0,subtree:!0});function a(l){const d={};return l.integrity&&(d.integrity=l.integrity),l.referrerPolicy&&(d.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?d.credentials="include":l.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(l){if(l.ep)return;l.ep=!0;const d=a(l);fetch(l.href,d)}})();function c(...t){return It(_t(t))}function Ye(t){return t.toLowerCase().trim().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"")}const Ne=768;function qs(){const[t,s]=u.useState(void 0);return u.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Ne-1}px)`),r=()=>{s(window.innerWidtha.removeEventListener("change",r)},[]),!!t}const Ae=Ee("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:t,variant:s,size:a,asChild:r=!1,...l}){const d=r?xe:"button";return e.jsx(d,{"data-slot":"button",className:c(Ae({variant:s,size:a,className:t})),...l})}function D({className:t,type:s,...a}){return e.jsx("input",{type:s,"data-slot":"input",className:c("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...a})}function re({className:t,orientation:s="horizontal",decorative:a=!0,...r}){return e.jsx(Ft,{"data-slot":"separator",decorative:a,orientation:s,className:c("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function Js({...t}){return e.jsx(at,{"data-slot":"sheet",...t})}function Ws({...t}){return e.jsx(lt,{"data-slot":"sheet-portal",...t})}function Ys({className:t,...s}){return e.jsx(dt,{"data-slot":"sheet-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function Xs({className:t,children:s,side:a="right",...r}){return e.jsxs(Ws,{children:[e.jsx(Ys,{}),e.jsxs(rt,{"data-slot":"sheet-content",className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[s,e.jsxs(nt,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(ct,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qs({className:t,...s}){return e.jsx("div",{"data-slot":"sheet-header",className:c("flex flex-col gap-1.5 p-4",t),...s})}function Zs({className:t,...s}){return e.jsx(it,{"data-slot":"sheet-title",className:c("text-foreground font-semibold",t),...s})}function ea({className:t,...s}){return e.jsx(ot,{"data-slot":"sheet-description",className:c("text-muted-foreground text-sm",t),...s})}function J({className:t,...s}){return e.jsx("div",{"data-slot":"skeleton",className:c("bg-accent animate-pulse rounded-md",t),...s})}function Te({delayDuration:t=0,...s}){return e.jsx(Mt,{"data-slot":"tooltip-provider",delayDuration:t,...s})}function xt({...t}){return e.jsx(Te,{children:e.jsx(Rt,{"data-slot":"tooltip",...t})})}function ht({...t}){return e.jsx(Pt,{"data-slot":"tooltip-trigger",...t})}function ft({className:t,sideOffset:s=0,children:a,...r}){return e.jsx(Vt,{children:e.jsxs(Ut,{"data-slot":"tooltip-content",sideOffset:s,className:c("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...r,children:[a,e.jsx(Bt,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const ta="sidebar_state",sa=3600*24*7,aa="16rem",ra="18rem",na="3rem",ia="b",gt=u.createContext(null);function pt(){const t=u.useContext(gt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function oa({defaultOpen:t=!0,open:s,onOpenChange:a,className:r,style:l,children:d,...x}){const m=qs(),[j,h]=u.useState(!1),[v,w]=u.useState(t),y=s??v,b=u.useCallback(n=>{const o=typeof n=="function"?n(y):n;a?a(o):w(o),document.cookie=`${ta}=${o}; path=/; max-age=${sa}`},[a,y]),A=u.useCallback(()=>m?h(n=>!n):b(n=>!n),[m,b,h]);u.useEffect(()=>{const n=o=>{o.key===ia&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),A())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[A]);const O=y?"expanded":"collapsed",V=u.useMemo(()=>({state:O,open:y,setOpen:b,isMobile:m,openMobile:j,setOpenMobile:h,toggleSidebar:A}),[O,y,b,m,j,h,A]);return e.jsx(gt.Provider,{value:V,children:e.jsx(Te,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":aa,"--sidebar-width-icon":na,...l},className:c("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...x,children:d})})})}function la({side:t="left",variant:s="sidebar",collapsible:a="offcanvas",className:r,children:l,...d}){const{isMobile:x,state:m,openMobile:j,setOpenMobile:h}=pt();return a==="none"?e.jsx("div",{"data-slot":"sidebar",className:c("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...d,children:l}):x?e.jsx(Js,{open:j,onOpenChange:h,...d,children:e.jsxs(Xs,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":ra},side:t,children:[e.jsxs(Qs,{className:"sr-only",children:[e.jsx(Zs,{children:"Sidebar"}),e.jsx(ea,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":m,"data-collapsible":m==="collapsed"?a:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:c("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:c("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="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",r),...d,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:l})})]})}function da({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:c("flex flex-col gap-2 p-2",t),...s})}function ca({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:c("flex flex-col gap-2 p-2",t),...s})}function ua({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:c("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})}function ma({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:c("relative flex w-full min-w-0 flex-col p-2",t),...s})}function xa({className:t,asChild:s=!1,...a}){const r=s?xe:"div";return e.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:c("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...a})}function ha({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:c("w-full text-sm",t),...s})}function fa({className:t,...s}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:c("flex w-full min-w-0 flex-col gap-1",t),...s})}function ga({className:t,...s}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:c("group/menu-item relative",t),...s})}const pa=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm 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=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=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-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ja({asChild:t=!1,isActive:s=!1,variant:a="default",size:r="default",tooltip:l,className:d,...x}){const m=t?xe:"button",{isMobile:j,state:h}=pt(),v=e.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":s,className:c(pa({variant:a,size:r}),d),...x});return l?(typeof l=="string"&&(l={children:l}),e.jsxs(xt,{children:[e.jsx(ht,{asChild:!0,children:v}),e.jsx(ft,{side:"right",align:"center",hidden:h!=="collapsed"||j,...l})]})):v}const pe="";class T extends Error{status;body;constructor(s,a,r){super(a),this.status=s,this.body=r}}function ba(t){const s={};if(!t)return s;if(t instanceof Headers)t.forEach((a,r)=>s[r]=a);else if(Array.isArray(t))for(const[a,r]of t)s[a]=r;else Object.assign(s,t);return s}function va(){const t={},s=localStorage.getItem("access_token");return s&&(t.Authorization=`Bearer ${s}`),t}function wa(){const t=localStorage.getItem("active_org_id");return t?{"X-Org-ID":t}:{}}async function te(t,s,a,r={}){const d={...{"Content-Type":"application/json"},...r.auth===!1?{}:va(),...wa(),...ba(r.headers)},x=await fetch(`${pe}${t}`,{method:s,headers:d,body:a===void 0?void 0:JSON.stringify(a),...r}),j=(x.headers.get("content-type")||"").includes("application/json"),h=j?await x.json().catch(()=>{}):await x.text().catch(()=>"");if(!x.ok){const v=j&&h&&typeof h=="object"&&"error"in h&&h.error||j&&h&&typeof h=="object"&&"message"in h&&h.message||typeof h=="string"&&h||`HTTP ${x.status}`;throw new T(x.status,String(v),h)}return console.debug("API ->",s,`${pe}${t}`,d),j?h:void 0}const E={get:(t,s)=>te(t,"GET",void 0,s),post:(t,s,a)=>te(t,"POST",s,a),put:(t,s,a)=>te(t,"PUT",s,a),patch:(t,s,a)=>te(t,"PATCH",s,a),delete:(t,s)=>te(t,"DELETE",void 0,s)};function ya(t){return t&&(t.user||t.user_id)}function jt(t){return ya(t)?.role==="admin"}function Na(t){return(t?.org_role??"")==="admin"}const P={isAuthenticated(){return!!localStorage.getItem("access_token")},async login(t,s){const a=await E.post("/api/v1/auth/login",{email:t,password:s});localStorage.setItem("access_token",a.access_token),localStorage.setItem("refresh_token",a.refresh_token)},async register(t,s,a){await E.post("/api/v1/auth/register",{name:t,email:s,password:a})},async me(){return await E.get("/api/v1/auth/me")},async logout(){const t=localStorage.getItem("refresh_token");if(t)try{await E.post("/api/v1/auth/logout",{refresh_token:t})}catch{}localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")},async forgot(t){await E.post("/api/v1/auth/password/forgot",{email:t})},async reset(t,s){await E.post("/api/v1/auth/password/reset",{token:t,new_password:s})},async verify(t){const s=await fetch(`${pe}/api/v1/auth/verify?token=${encodeURIComponent(t)}`);if(!s.ok){const a=await s.text();throw new Error(a)}}};function Sa({...t}){return e.jsx(Ht,{"data-slot":"collapsible",...t})}function Ca({...t}){return e.jsx(Gt,{"data-slot":"collapsible-trigger",...t})}function ka({...t}){return e.jsx(Kt,{"data-slot":"collapsible-content",...t})}function Le({...t}){return e.jsx(qt,{"data-slot":"dropdown-menu",...t})}function $e({...t}){return e.jsx(Jt,{"data-slot":"dropdown-menu-trigger",...t})}function Fe({className:t,sideOffset:s=4,...a}){return e.jsx(Wt,{children:e.jsx(Yt,{"data-slot":"dropdown-menu-content",sideOffset:s,className:c("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...a})})}function W({className:t,inset:s,variant:a="default",...r}){return e.jsx(Xt,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":a,className:c("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function Ia(){const{setTheme:t,theme:s}=st();return e.jsxs(Le,{children:[e.jsx($e,{asChild:!0,children:e.jsx(g,{variant:"outline",size:"icon","aria-label":"Toggle theme",children:s==="light"?e.jsx(ws,{className:"h-5 w-5"}):s==="dark"?e.jsx(ys,{className:"h-5 w-5"}):e.jsx(Ns,{className:"h-5 w-5"})})}),e.jsxs(Fe,{align:"end",children:[e.jsxs(W,{onClick:()=>t("light"),children:[s==="light"&&e.jsx(ge,{}),"Light"]}),e.jsxs(W,{onClick:()=>t("dark"),children:[s==="dark"&&e.jsx(ge,{}),"Dark"]}),e.jsxs(W,{onClick:()=>t("system"),children:[s==="system"&&e.jsx(ge,{}),"System"]})]})]})}const Se="active_org_id",X="active-org-changed",ie="orgs-changed";function q(){return localStorage.getItem(Se)}function ne(t){t?localStorage.setItem(Se,t):localStorage.removeItem(Se),window.dispatchEvent(new CustomEvent(X,{detail:t}))}function Xe(){window.dispatchEvent(new Event(ie))}const _a=()=>{const[t,s]=u.useState([]),[a,r]=u.useState(null);async function l(){try{const m=await E.get("/api/v1/orgs");s(m),!q()&&m.length>0&&(ne(m[0].id),r(m[0].id))}catch(m){const j=m instanceof T?m.message:"Failed to load organizations";console.error(j)}}u.useEffect(()=>{r(q()),l();const m=v=>{v.key==="active_org_id"&&r(v.newValue)};window.addEventListener("storage",m);const j=v=>r(v.detail??null),h=()=>void l();return window.addEventListener(X,j),window.addEventListener(ie,h),()=>{window.removeEventListener("storage",m),window.removeEventListener(X,j),window.removeEventListener(ie,h)}},[]);const d=m=>{ne(m),r(m)},x=t.find(m=>m.id===a)?.name??"Select Org";return e.jsxs(Le,{children:[e.jsx($e,{asChild:!0,children:e.jsx(g,{variant:"outline",className:"w-full justify-start",children:x})}),e.jsx(Fe,{className:"w-48",children:t.length===0?e.jsx(W,{disabled:!0,children:"No organizations"}):t.map(m=>e.jsx(W,{onClick:()=>d(m.id),className:m.id===a?"font-semibold":void 0,children:m.name},m.id))})]})},Qe=[{label:"Dashboard",icon:Ss,to:"/dashboard"},{label:"Core",icon:Os,items:[{label:"Cluster",to:"/core/cluster",icon:Cs},{label:"Node Pools",icon:ks,to:"/core/node-pools"},{label:"Annotations",icon:Is,to:"/core/annotations"},{label:"Labels",icon:_s,to:"/core/labels"},{label:"Taints",icon:Es,to:"/core/taints"},{label:"Servers",icon:zs,to:"/core/servers"}]},{label:"Security",icon:Ts,items:[{label:"Keys & Tokens",icon:Ds,to:"/security/keys"},{label:"SSH Keys",to:"/security/ssh",icon:As}]},{label:"Tasks",icon:Ls,items:[]},{label:"Settings",icon:Ms,items:[{label:"Organizations",to:"/settings/orgs",icon:$s},{label:"Members",to:"/settings/members",icon:Je},{label:"Profile",to:"/settings/me",icon:Fs}]},{label:"Admin",icon:Rs,requiresAdmin:!0,items:[{label:"Users",to:"/admin/users",icon:Je,requiresAdmin:!0}]}];function bt(t,s,a){return t.filter(r=>!(r.requiresAdmin&&!s||r.requiresOrgAdmin&&!a)).map(r=>({...r,items:r.items?bt(r.items,s,a):void 0})).filter(r=>!r.items||r.items.length>0)}const vt=({item:t})=>{const s=we(),a=t.icon;return t.to?e.jsxs(Y,{to:t.to,className:`hover:bg-accent hover:text-accent-foreground flex items-center space-x-2 rounded-md px-4 py-2 text-sm ${s.pathname===t.to?"bg-accent text-accent-foreground":""}`,children:[e.jsx(a,{className:"mr-4 h-4 w-4"}),t.label]}):t.items?e.jsx(Sa,{defaultOpen:!0,className:"group/collapsible",children:e.jsxs(ma,{children:[e.jsx(xa,{asChild:!0,children:e.jsxs(Ca,{children:[e.jsx(a,{className:"mr-4 h-4 w-4"}),t.label,e.jsx(ze,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e.jsx(ka,{children:e.jsx(ha,{children:e.jsx(fa,{children:t.items.map((r,l)=>e.jsx(ga,{children:e.jsx(ja,{asChild:!0,children:e.jsx(vt,{item:r})})},l))})})})]})}):null},Ea=()=>{const[t,s]=u.useState(null),[a,r]=u.useState(!0);u.useEffect(()=>{let d=!0;return(async()=>{try{const x=await P.me();if(!d)return;s(x)}catch{}finally{if(!d)return;r(!1)}})(),()=>{d=!1}},[]);const l=u.useMemo(()=>{const d=jt(t),x=Na(t);return bt(Qe,d,x)},[t]);return e.jsxs(la,{children:[e.jsx(da,{className:"flex items-center justify-between p-4",children:e.jsx("h1",{className:"text-xl font-bold",children:"AutoGlue"})}),e.jsx(ua,{children:(a?Qe:l).map((d,x)=>e.jsx(vt,{item:d},x))}),e.jsxs(ca,{className:"space-y-2 p-4",children:[e.jsx(_a,{}),e.jsx(Ia,{}),e.jsx(g,{onClick:()=>{localStorage.clear(),window.location.reload()},className:"w-full",children:"Logout"})]})]})};function za(){return e.jsx("footer",{className:"border-t",children:e.jsxs("div",{className:"container flex flex-col items-center justify-between gap-4 py-10 md:h-24 md:flex-row md:py-0",children:[e.jsx("div",{className:"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0",children:e.jsxs("p",{className:"text-muted-foreground text-center text-sm leading-loose md:text-left",children:["Built for"," ",e.jsx("a",{href:"https://www.glueops.dev/",target:"_blank",rel:"noreferrer",className:"font-medium underline underline-offset-4",children:"GlueOps"}),". The source code is available on"," ",e.jsx("a",{href:"https://github.com/GlueOps/autoglue",target:"_blank",rel:"noreferrer",className:"font-medium underline underline-offset-4",children:"GitHub"}),"."]})}),e.jsx("div",{className:"flex items-center space-x-4",children:e.jsx("a",{href:"https://github.com/GlueOps/autoglue",target:"_blank",rel:"noreferrer",children:e.jsx(Ps,{className:"h-5 w-5"})})})]})})}function Oa(){return e.jsx("div",{className:"flex h-screen",children:e.jsxs(oa,{children:[e.jsx(Ea,{}),e.jsxs("div",{className:"flex flex-1 flex-col",children:[e.jsx("main",{className:"flex-1 overflow-auto p-4",children:e.jsx(Oe,{})}),e.jsx(za,{})]})]})})}function Da({children:t}){const s=we();return P.isAuthenticated()?t?e.jsx(e.Fragment,{children:t}):e.jsx(Oe,{}):e.jsx(De,{to:"/auth/login",state:{from:s},replace:!0})}function Aa({children:t}){const[s,a]=u.useState(!0),[r,l]=u.useState(!1),d=we();return u.useEffect(()=>{let x=!0;return(async()=>{try{const m=await P.me();if(!x)return;l(jt(m))}catch{if(!x)return;l(!1)}finally{if(a(!1),!x)return}})(),()=>{x=!1}},[]),s?null:r?t?e.jsx(e.Fragment,{children:t}):e.jsx(Oe,{}):e.jsx(De,{to:"/403",replace:!0,state:{from:d}})}function Me({...t}){return e.jsx(Qt,{"data-slot":"alert-dialog",...t})}function Re({...t}){return e.jsx(Zt,{"data-slot":"alert-dialog-trigger",...t})}function Ta({...t}){return e.jsx(ns,{"data-slot":"alert-dialog-portal",...t})}function La({className:t,...s}){return e.jsx(is,{"data-slot":"alert-dialog-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function Pe({className:t,...s}){return e.jsxs(Ta,{children:[e.jsx(La,{}),e.jsx(es,{"data-slot":"alert-dialog-content",className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...s})]})}function Ve({className:t,...s}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:c("flex flex-col gap-2 text-center sm:text-left",t),...s})}function Ue({className:t,...s}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function Be({className:t,...s}){return e.jsx(ts,{"data-slot":"alert-dialog-title",className:c("text-lg font-semibold",t),...s})}function He({className:t,...s}){return e.jsx(ss,{"data-slot":"alert-dialog-description",className:c("text-muted-foreground text-sm",t),...s})}function Ge({className:t,...s}){return e.jsx(rs,{className:c(Ae(),t),...s})}function Ke({className:t,...s}){return e.jsx(as,{className:c(Ae({variant:"outline"}),t),...s})}function F({className:t,...s}){return e.jsx("div",{"data-slot":"card",className:c("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...s})}function M({className:t,...s}){return e.jsx("div",{"data-slot":"card-header",className:c("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function K({className:t,...s}){return e.jsx("div",{"data-slot":"card-title",className:c("leading-none font-semibold",t),...s})}function R({className:t,...s}){return e.jsx("div",{"data-slot":"card-content",className:c("px-6",t),...s})}function oe({className:t,...s}){return e.jsx("div",{"data-slot":"card-footer",className:c("flex items-center px-6 [.border-t]:pt-6",t),...s})}function le({...t}){return e.jsx(at,{"data-slot":"dialog",...t})}function wt({...t}){return e.jsx(os,{"data-slot":"dialog-trigger",...t})}function $a({...t}){return e.jsx(lt,{"data-slot":"dialog-portal",...t})}function Fa({className:t,...s}){return e.jsx(dt,{"data-slot":"dialog-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function de({className:t,children:s,showCloseButton:a=!0,...r}){return e.jsxs($a,{"data-slot":"dialog-portal",children:[e.jsx(Fa,{}),e.jsxs(rt,{"data-slot":"dialog-content",className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...r,children:[s,a&&e.jsxs(nt,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(ct,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ce({className:t,...s}){return e.jsx("div",{"data-slot":"dialog-header",className:c("flex flex-col gap-2 text-center sm:text-left",t),...s})}function ue({className:t,...s}){return e.jsx("div",{"data-slot":"dialog-footer",className:c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function me({className:t,...s}){return e.jsx(it,{"data-slot":"dialog-title",className:c("text-lg leading-none font-semibold",t),...s})}function je({className:t,...s}){return e.jsx(ot,{"data-slot":"dialog-description",className:c("text-muted-foreground text-sm",t),...s})}function Ma({className:t,...s}){return e.jsx(ls,{"data-slot":"label",className:c("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...s})}const H=Et,yt=u.createContext({}),S=({...t})=>e.jsx(yt.Provider,{value:{name:t.name},children:e.jsx(zt,{...t})}),ye=()=>{const t=u.useContext(yt),s=u.useContext(Nt),{getFieldState:a}=Ot(),r=Dt({name:t.name}),l=a(t.name,r);if(!t)throw new Error("useFormField should be used within ");const{id:d}=s;return{id:d,name:t.name,formItemId:`${d}-form-item`,formDescriptionId:`${d}-form-item-description`,formMessageId:`${d}-form-item-message`,...l}},Nt=u.createContext({});function C({className:t,...s}){const a=u.useId();return e.jsx(Nt.Provider,{value:{id:a},children:e.jsx("div",{"data-slot":"form-item",className:c("grid gap-2",t),...s})})}function k({className:t,...s}){const{error:a,formItemId:r}=ye();return e.jsx(Ma,{"data-slot":"form-label","data-error":!!a,className:c("data-[error=true]:text-destructive",t),htmlFor:r,...s})}function I({...t}){const{error:s,formItemId:a,formDescriptionId:r,formMessageId:l}=ye();return e.jsx(xe,{"data-slot":"form-control",id:a,"aria-describedby":s?`${r} ${l}`:`${r}`,"aria-invalid":!!s,...t})}function Ze({className:t,...s}){const{formDescriptionId:a}=ye();return e.jsx("p",{"data-slot":"form-description",id:a,className:c("text-muted-foreground text-sm",t),...s})}function _({className:t,...s}){const{error:a,formMessageId:r}=ye(),l=a?String(a?.message??""):s.children;return l?e.jsx("p",{"data-slot":"form-message",id:r,className:c("text-destructive text-sm",t),...s,children:l}):null}function Ce({...t}){return e.jsx(ds,{"data-slot":"select",...t})}function ke({...t}){return e.jsx(ms,{"data-slot":"select-value",...t})}function Ie({className:t,size:s="default",children:a,...r}){return e.jsxs(cs,{"data-slot":"select-trigger","data-size":s,className:c("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[a,e.jsx(us,{asChild:!0,children:e.jsx(ze,{className:"size-4 opacity-50"})})]})}function _e({className:t,children:s,position:a="popper",...r}){return e.jsx(xs,{children:e.jsxs(hs,{"data-slot":"select-content",className:c("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...r,children:[e.jsx(Ra,{}),e.jsx(fs,{className:c("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:s}),e.jsx(Pa,{})]})})}function Q({className:t,children:s,...a}){return e.jsxs(gs,{"data-slot":"select-item",className:c("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(ps,{children:e.jsx(ge,{className:"size-4"})})}),e.jsx(js,{children:s})]})}function Ra({className:t,...s}){return e.jsx(bs,{"data-slot":"select-scroll-up-button",className:c("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Vs,{className:"size-4"})})}function Pa({className:t,...s}){return e.jsx(vs,{"data-slot":"select-scroll-down-button",className:c("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(ze,{className:"size-4"})})}const Va=G({name:L().min(1,"Name required"),email:Z("Enter a valid email"),role:be(["user","admin"]),password:L().min(8,"Min 8 characters")}),Ua=G({name:L().min(1,"Name required"),email:Z("Enter a valid email"),role:be(["user","admin"]),password:L().min(8,"Min 8 characters").optional().or(At(""))});function Ba(){const[t,s]=u.useState([]),[a,r]=u.useState(!0),[l,d]=u.useState(!1),[x,m]=u.useState(!1),[j,h]=u.useState(null),[v,w]=u.useState(null),y=U({resolver:B(Va),mode:"onChange",defaultValues:{name:"",email:"",role:"user",password:""}}),b=U({resolver:B(Ua),mode:"onChange",defaultValues:{name:"",email:"",role:"user",password:""}});async function A(){r(!0);try{const i=await E.get("/api/v1/admin/users?page=1&page_size=100");s(i.users??[])}catch(i){p.error(i instanceof T?i.message:"Failed to load users")}finally{r(!1)}}u.useEffect(()=>{A()},[]);async function O(i){try{const f=await E.post("/api/v1/admin/users",i);s(z=>[f,...z]),d(!1),y.reset({name:"",email:"",role:"user",password:""}),p.success(`Created ${f.email}`)}catch(f){p.error(f instanceof T?f.message:"Failed to create user")}}function V(i){h(i),b.reset({name:i.name||"",email:i.email,role:i.role??"user",password:""}),m(!0)}async function n(i){if(!j)return;const f={name:i.name,email:i.email,role:i.role};i.password&&i.password.length>=8&&(f.password=i.password);try{const z=await E.patch(`/api/v1/admin/users/${j.id}`,f);s($=>$.map(fe=>fe.id===z.id?z:fe)),m(!1),h(null),p.success(`Updated ${z.email}`)}catch(z){p.error(z instanceof T?z.message:"Failed to update user")}}async function o(i){try{w(i),await E.delete(`/api/v1/admin/users/${i}`),s(f=>f.filter(z=>z.id!==i)),p.success("User deleted")}catch(f){p.error(f instanceof T?f.message:"Failed to delete user")}finally{w(null)}}return e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Users"}),e.jsxs(g,{onClick:()=>d(!0),children:[e.jsx(ut,{className:"mr-2 h-4 w-4"}),"New user"]})]}),e.jsx(re,{}),a?e.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading…"}):t.length===0?e.jsx("div",{className:"text-muted-foreground text-sm",children:"No users yet."}):e.jsx("div",{className:"grid grid-cols-1 gap-4 pr-2 md:grid-cols-2 lg:grid-cols-3",children:t.map(i=>e.jsxs(F,{className:"flex flex-col",children:[e.jsx(M,{children:e.jsx(K,{className:"text-base",children:i.name||i.email})}),e.jsxs(R,{className:"text-muted-foreground space-y-1 text-sm",children:[e.jsxs("div",{children:["Email: ",i.email]}),e.jsxs("div",{children:["Role: ",i.role]}),e.jsxs("div",{children:["Verified: ",i.email_verified?"Yes":"No"]}),e.jsxs("div",{children:["Joined: ",new Date(i.created_at).toLocaleString()]})]}),e.jsxs(oe,{className:"mt-auto w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(g,{variant:"outline",onClick:()=>V(i),children:[e.jsx(Us,{className:"mr-2 h-4 w-4"})," Edit"]}),e.jsxs(Me,{children:[e.jsx(Re,{asChild:!0,children:e.jsxs(g,{variant:"destructive",disabled:v===i.id,children:[e.jsx(ve,{className:"mr-2 h-4 w-4"}),v===i.id?"Deleting…":"Delete"]})}),e.jsxs(Pe,{children:[e.jsxs(Ve,{children:[e.jsx(Be,{children:"Delete user?"}),e.jsxs(He,{children:["This will permanently delete ",e.jsx("b",{children:i.email}),"."]})]}),e.jsxs(Ue,{className:"sm:justify-between",children:[e.jsx(Ke,{disabled:v===i.id,children:"Cancel"}),e.jsx(Ge,{asChild:!0,disabled:v===i.id,children:e.jsx(g,{variant:"destructive",onClick:()=>o(i.id),children:"Confirm delete"})})]})]})]})]})]},i.id))}),e.jsx(le,{open:l,onOpenChange:d,children:e.jsxs(de,{className:"sm:max-w-[520px]",children:[e.jsxs(ce,{children:[e.jsx(me,{children:"Create user"}),e.jsx(je,{children:"Add a new user account."})]}),e.jsx(H,{...y,children:e.jsxs("form",{onSubmit:y.handleSubmit(O),className:"grid gap-4 py-2",children:[e.jsx(S,{name:"name",control:y.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(D,{...i,placeholder:"Jane Doe"})}),e.jsx(_,{})]})}),e.jsx(S,{name:"email",control:y.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(D,{type:"email",...i,placeholder:"jane@example.com"})}),e.jsx(_,{})]})}),e.jsx(S,{name:"role",control:y.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Role"}),e.jsxs(Ce,{value:i.value,onValueChange:i.onChange,children:[e.jsx(I,{children:e.jsx(Ie,{className:"w-[200px]",children:e.jsx(ke,{placeholder:"Select role"})})}),e.jsxs(_e,{children:[e.jsx(Q,{value:"user",children:"User"}),e.jsx(Q,{value:"admin",children:"Admin"})]})]}),e.jsx(_,{})]})}),e.jsx(S,{name:"password",control:y.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Password"}),e.jsx(I,{children:e.jsx(D,{type:"password",...i,placeholder:"••••••••"})}),e.jsx(_,{})]})}),e.jsxs(ue,{className:"mt-2 flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!y.formState.isValid||y.formState.isSubmitting,children:y.formState.isSubmitting?"Creating…":"Create"})]})]})})]})}),e.jsx(le,{open:x,onOpenChange:m,children:e.jsxs(de,{className:"sm:max-w-[520px]",children:[e.jsxs(ce,{children:[e.jsx(me,{children:"Edit user"}),e.jsx(je,{children:"Update user details. Leave password blank to keep it unchanged."})]}),e.jsx(H,{...b,children:e.jsxs("form",{onSubmit:b.handleSubmit(n),className:"grid gap-4 py-2",children:[e.jsx(S,{name:"name",control:b.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(D,{...i})}),e.jsx(_,{})]})}),e.jsx(S,{name:"email",control:b.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(D,{type:"email",...i})}),e.jsx(_,{})]})}),e.jsx(S,{name:"role",control:b.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Role"}),e.jsxs(Ce,{value:i.value,onValueChange:i.onChange,children:[e.jsx(I,{children:e.jsx(Ie,{className:"w-[200px]",children:e.jsx(ke,{placeholder:"Select role"})})}),e.jsxs(_e,{children:[e.jsx(Q,{value:"user",children:"User"}),e.jsx(Q,{value:"admin",children:"Admin"})]})]}),e.jsx(_,{})]})}),e.jsx(S,{name:"password",control:b.control,render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"New password (optional)"}),e.jsx(I,{children:e.jsx(D,{type:"password",...i,placeholder:"Leave blank to keep"})}),e.jsx(_,{})]})}),e.jsxs(ue,{className:"mt-2 flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!b.formState.isValid||b.formState.isSubmitting,children:b.formState.isSubmitting?"Saving…":"Save changes"})]})]})})]})})]})}const Ha=G({email:Z()});function Ga(){const t=U({resolver:B(Ha),defaultValues:{email:""}});async function s(a){try{await P.forgot(a.email),p.success("If that email exists, we've sent instructions.")}catch(r){p.error(r.message||"Something went wrong")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(K,{children:"Forgot password"})}),e.jsx(R,{children:e.jsx(H,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(s),className:"space-y-4",children:[e.jsx(S,{name:"email",control:t.control,render:({field:a})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(D,{placeholder:"you@example.com",...a})}),e.jsx(_,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Send reset link"})]})})})]})})}const Ka=G({email:Z(),password:L().min(6)});function qa(){const t=he(),s=we(),a=U({resolver:B(Ka),defaultValues:{email:"",password:""}});async function r(l){try{await P.login(l.email,l.password),p.success("Welcome back!");const d=s.state?.from?.pathname??"/settings/me";t(d,{replace:!0})}catch(d){p.error(d.message||"Login failed")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(K,{children:"Sign in"})}),e.jsxs(R,{children:[e.jsx(H,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(r),className:"space-y-4",children:[e.jsx(S,{name:"email",control:a.control,render:({field:l})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(D,{placeholder:"you@example.com",...l})}),e.jsx(_,{})]})}),e.jsx(S,{name:"password",control:a.control,render:({field:l})=>e.jsxs(C,{children:[e.jsx(k,{children:"Password"}),e.jsx(I,{children:e.jsx(D,{type:"password",placeholder:"••••••••",...l})}),e.jsx(_,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Sign in"})]})}),e.jsxs("div",{className:"mt-4 flex justify-between text-sm",children:[e.jsx(Y,{to:"/auth/forgot",className:"underline",children:"Forgot password?"}),e.jsx(Y,{to:"/auth/register",className:"underline",children:"Create an account"})]})]})]})})}function Ja(){const[t,s]=u.useState(null),a=he();u.useEffect(()=>{(async()=>{try{const l=await P.me();s(l)}catch(l){p.error(l.message||"Failed to load profile")}})()},[]);async function r(){await P.logout(),a("/auth/login")}return e.jsx("div",{className:"mx-auto max-w-xl",children:e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(K,{children:"My Account"})}),e.jsxs(R,{className:"space-y-3",children:[t?e.jsx("pre",{className:"bg-muted overflow-auto rounded p-3 text-sm",children:JSON.stringify(t,null,2)}):e.jsx("p",{children:"Loading…"}),e.jsx(g,{onClick:r,children:"Sign out"})]})]})})}const Wa=G({name:L().min(2),email:Z(),password:L().min(6)});function Ya(){const t=he(),s=U({resolver:B(Wa),defaultValues:{name:"",email:"",password:""}});async function a(r){try{await P.register(r.name,r.email,r.password),p.success("Account created! Check your email to verify."),t("/auth/login")}catch(l){p.error(l.message||"Registration failed")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(K,{children:"Create account"})}),e.jsxs(R,{children:[e.jsx(H,{...s,children:e.jsxs("form",{onSubmit:s.handleSubmit(a),className:"space-y-4",children:[e.jsx(S,{name:"name",control:s.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(D,{placeholder:"Jane Doe",...r})}),e.jsx(_,{})]})}),e.jsx(S,{name:"email",control:s.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(D,{placeholder:"you@example.com",...r})}),e.jsx(_,{})]})}),e.jsx(S,{name:"password",control:s.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Password"}),e.jsx(I,{children:e.jsx(D,{type:"password",placeholder:"••••••••",...r})}),e.jsx(_,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Create account"})]})}),e.jsxs("div",{className:"mt-4 text-sm",children:["Already have an account?"," ",e.jsx(Y,{to:"/auth/login",className:"underline",children:"Sign in"})]})]})]})})}const Xa=G({new_password:L().min(6)});function Qa(){const[t]=mt(),s=t.get("token"),a=U({resolver:B(Xa),defaultValues:{new_password:""}}),r=he();async function l(d){if(!s){p.error("Missing token");return}try{await P.reset(s,d.new_password),p.success("Password updated. Please sign in."),r("/auth/login")}catch(x){p.error(x.message||"Reset failed")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(K,{children:"Reset password"})}),e.jsxs(R,{children:[e.jsx(H,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[e.jsx(S,{name:"new_password",control:a.control,render:({field:d})=>e.jsxs(C,{children:[e.jsx(k,{children:"New password"}),e.jsx(I,{children:e.jsx(D,{type:"password",placeholder:"••••••••",...d})}),e.jsx(_,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Update password"})]})}),e.jsx("div",{className:"mt-4 text-sm",children:e.jsx(Y,{to:"/auth/login",className:"underline",children:"Back to sign in"})})]})]})})}function Za(){const[t]=mt(),s=t.get("token"),[a,r]=u.useState("idle");return u.useEffect(()=>{async function l(){if(!s){r("error");return}try{await P.verify(s),r("ok")}catch(d){p.error(d.message||"Verification failed"),r("error")}}l()},[s]),e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(K,{children:"Email verification"})}),e.jsxs(R,{className:"space-y-3",children:[a==="idle"&&e.jsx("p",{children:"Verifying…"}),a==="ok"&&e.jsxs("div",{children:[e.jsx("p",{children:"Your email has been verified. You can now sign in."}),e.jsx(g,{asChild:!0,className:"mt-3",children:e.jsx(Y,{to:"/auth/login",children:"Go to sign in"})})]}),a==="error"&&e.jsxs("div",{children:[e.jsx("p",{children:"Verification failed. Please request a new verification email."}),e.jsx(g,{asChild:!0,className:"mt-3",children:e.jsx(Y,{to:"/auth/login",children:"Back to sign in"})})]})]})]})})}function er(){return e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"403 — Forbidden"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"You don’t have access to this area."})]})}const et=()=>{const t=he();return e.jsxs("div",{className:"bg-background text-foreground flex min-h-screen flex-col items-center justify-center",children:[e.jsx("h1",{className:"mb-4 text-6xl font-bold",children:"404"}),e.jsx("p",{className:"mb-8 text-2xl",children:"Oops! Page not found"}),e.jsx(g,{onClick:()=>t("/dashboard"),children:"Go back to Dashboard"})]})};function tr(t){const s=t?.user_id??t?.UserID??t?.user?.id??t?.User?.ID??"",a=t?.email??t?.Email??t?.user?.email??t?.User?.Email,r=t?.name??t?.Name??t?.user?.name??t?.User?.Name,l=t?.role??t?.Role??"member",d=t?.created_at??t?.CreatedAt;return{userId:String(s),email:a,name:r,role:String(l),joinedAt:d}}const sr=G({email:Z("Enter a valid email"),role:be(["member","admin"])}),ar=()=>{const[t,s]=u.useState(!0),[a,r]=u.useState([]),[l,d]=u.useState(null),[x,m]=u.useState(!1),[j,h]=u.useState(!1),[v,w]=u.useState(null),y=u.useMemo(()=>q(),[]),b=U({resolver:B(sr),defaultValues:{email:"",role:"member"},mode:"onChange"});async function A(){try{const o=await E.get("/api/v1/auth/me");d(o)}catch{}}async function O(o){if(!o){r([]),s(!1);return}s(!0);try{const i=await E.get("/api/v1/orgs/members");r((i??[]).map(tr))}catch(i){const f=i instanceof T?i.message:"Failed to load members";p.error(f)}finally{s(!1)}}u.useEffect(()=>{A(),O(y)},[y]),u.useEffect(()=>{const o=()=>void O(q()),i=f=>{f.key==="active_org_id"&&o()};return window.addEventListener(X,o),window.addEventListener("storage",i),()=>{window.removeEventListener(X,o),window.removeEventListener("storage",i)}},[]);async function V(o){const i=q();if(!i){p.error("Select an organization first");return}try{h(!0),await E.post("/api/v1/orgs/invite",o),p.success(`Invited ${o.email}`),m(!1),b.reset({email:"",role:"member"}),O(i)}catch(f){const z=f instanceof T?f.message:"Failed to invite member";p.error(z)}finally{h(!1)}}async function n(o){const i=q();if(!i){p.error("Select an organization first");return}try{w(o),await E.delete(`/api/v1/orgs/members/${o}`,{headers:{"X-Org-ID":i}}),r(f=>f.filter(z=>z.userId!==o)),p.success("Member removed")}catch(f){const z=f instanceof T?f.message:"Failed to remove member";p.error(z)}finally{w(null)}}return t?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Members"}),e.jsxs(g,{disabled:!0,children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),"Invite"]})]}),e.jsx(re,{}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((o,i)=>e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(J,{className:"h-5 w-40"})}),e.jsxs(R,{className:"space-y-2",children:[e.jsx(J,{className:"h-4 w-56"}),e.jsx(J,{className:"h-4 w-40"})]}),e.jsx(oe,{children:e.jsx(J,{className:"h-9 w-24"})})]},i))})]}):q()?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Members"}),e.jsxs(le,{open:x,onOpenChange:m,children:[e.jsx(wt,{asChild:!0,children:e.jsxs(g,{children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),"Invite"]})}),e.jsxs(de,{className:"sm:max-w-[520px]",children:[e.jsxs(ce,{children:[e.jsx(me,{children:"Invite member"}),e.jsx(je,{children:"Send an invite to join this organization."})]}),e.jsx(H,{...b,children:e.jsxs("form",{onSubmit:b.handleSubmit(V),className:"grid gap-4 py-2",children:[e.jsx(S,{control:b.control,name:"email",render:({field:o})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(D,{type:"email",placeholder:"jane@example.com",...o})}),e.jsx(_,{})]})}),e.jsx(S,{control:b.control,name:"role",render:({field:o})=>e.jsxs(C,{children:[e.jsx(k,{children:"Role"}),e.jsxs(Ce,{onValueChange:o.onChange,defaultValue:o.value,children:[e.jsx(I,{children:e.jsx(Ie,{className:"w-[200px]",children:e.jsx(ke,{placeholder:"Select role"})})}),e.jsxs(_e,{children:[e.jsx(Q,{value:"member",children:"Member"}),e.jsx(Q,{value:"admin",children:"Admin"})]})]}),e.jsx(_,{})]})}),e.jsxs(ue,{className:"mt-2 flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!b.formState.isValid||j,children:j?"Sending…":"Send invite"})]})]})})]})]})]}),e.jsx(re,{}),a.length===0?e.jsx("div",{className:"text-muted-foreground text-sm",children:"No members yet."}):e.jsx("div",{className:"grid grid-cols-1 gap-4 pr-2 sm:grid-cols-2 lg:grid-cols-3",children:a.map(o=>{const i=l?.id&&o.userId===l.id;return e.jsxs(F,{className:"flex flex-col",children:[e.jsx(M,{children:e.jsx(K,{className:"text-base",children:o.name||o.email||o.userId})}),e.jsxs(R,{className:"text-muted-foreground space-y-1 text-sm",children:[o.email&&e.jsxs("div",{children:["Email: ",o.email]}),e.jsxs("div",{children:["Role: ",o.role]}),o.joinedAt&&e.jsxs("div",{children:["Joined: ",new Date(o.joinedAt).toLocaleString()]})]}),e.jsxs(oe,{className:"mt-auto w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{}),e.jsxs(Me,{children:[e.jsx(Re,{asChild:!0,children:e.jsxs(g,{variant:"destructive",disabled:i||v===o.userId,className:"ml-auto",children:[e.jsx(ve,{className:"mr-2 h-5 w-5"}),v===o.userId?"Removing…":"Remove"]})}),e.jsxs(Pe,{children:[e.jsxs(Ve,{children:[e.jsx(Be,{children:"Remove member?"}),e.jsxs(He,{children:["This will remove ",e.jsx("b",{children:o.name||o.email||o.userId})," from the organization."]})]}),e.jsxs(Ue,{className:"sm:justify-between",children:[e.jsx(Ke,{disabled:v===o.userId,children:"Cancel"}),e.jsx(Ge,{asChild:!0,disabled:v===o.userId,children:e.jsx(g,{variant:"destructive",onClick:()=>n(o.userId),children:"Confirm remove"})})]})]})]})]})]},o.userId)})})]}):e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("h1",{className:"text-2xl font-bold",children:"Members"})}),e.jsx(re,{}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"No organization selected. Choose an organization to manage its members."})]})},rr=G({name:L().min(2).max(100),slug:L().min(2).max(50).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/,"Use lowercase letters, numbers, and hyphens.")}),nr=()=>{const[t,s]=u.useState([]),[a,r]=u.useState(!0),[l,d]=u.useState(!1),[x,m]=u.useState(null),[j,h]=u.useState(null),v=u.useRef(!1),w=U({resolver:B(rr),mode:"onChange",defaultValues:{name:"",slug:""}}),y=w.watch("name");u.useEffect(()=>{v.current||w.setValue("slug",Ye(y||""),{shouldValidate:!0})},[y,w]);const b=async()=>{r(!0);try{const n=await E.get("/api/v1/orgs");s(n),d(n.length===0)}catch(n){const o=n instanceof T?n.message:"Failed to load organizations";p.error(o)}finally{r(!1)}};u.useEffect(()=>{m(q()),b();const n=f=>{f.key==="active_org_id"&&m(f.newValue)};window.addEventListener("storage",n);const o=f=>{const z=f.detail??null;m(z)};window.addEventListener(X,o);const i=()=>void b();return window.addEventListener(ie,i),()=>{window.removeEventListener("storage",n),window.removeEventListener(X,o),window.removeEventListener(ie,i)}},[]);async function A(n){try{const o=await E.post("/api/v1/orgs",n);s(i=>[o,...i]),ne(o.id),m(o.id),Xe(),p.success(`Created ${o.name}`),d(!1),w.reset({name:"",slug:""}),v.current=!1}catch(o){const i=o instanceof T?o.message:"Failed to create organization";p.error(i)}}function O(n){ne(n.id),m(n.id),p.success(`Switched to ${n.name}`)}async function V(n){try{h(n.id),await E.delete(`/api/v1/orgs/${n.id}`),s(o=>{const i=o.filter(f=>f.id!==n.id);if(x===n.id){const f=i[0]?.id??null;ne(f),m(f)}return i}),Xe(),p.success(`Deleted ${n.name}`)}catch(o){const i=o instanceof T?o.message:"Failed to delete organization";p.error(i)}finally{h(null)}}return a?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:e.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Organizations"})}),e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((n,o)=>e.jsxs(F,{children:[e.jsx(M,{children:e.jsx(J,{className:"h-5 w-40"})}),e.jsxs(R,{children:[e.jsx(J,{className:"mb-2 h-4 w-24"}),e.jsx(J,{className:"h-4 w-48"})]}),e.jsx(oe,{children:e.jsx(J,{className:"h-9 w-24"})})]},o))})]}):e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Organizations"}),e.jsx(g,{onClick:()=>d(!0),children:"New organization"})]}),e.jsx(re,{}),t.length===0?e.jsx("div",{className:"text-muted-foreground text-sm",children:"No organizations yet."}):e.jsx("div",{className:"grid grid-cols-1 gap-4 pr-2 sm:grid-cols-2 lg:grid-cols-3",children:t.map(n=>e.jsxs(F,{className:"flex flex-col",children:[e.jsx(M,{children:e.jsx(K,{className:"text-base",children:n.name})}),e.jsxs(R,{className:"text-muted-foreground text-sm",children:[e.jsxs("div",{children:["Slug: ",n.slug]}),e.jsxs("div",{className:"mt-1",children:["ID: ",n.id]})]}),e.jsxs(oe,{className:"mt-auto w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{onClick:()=>O(n),children:n.id===x?"Selected":"Select"}),e.jsxs(Me,{children:[e.jsx(Re,{asChild:!0,children:e.jsxs(g,{variant:"destructive",className:"ml-auto",disabled:j===n.id,children:[e.jsx(ve,{className:"mr-2 h-5 w-5"}),j===n.id?"Deleting…":"Delete"]})}),e.jsxs(Pe,{children:[e.jsxs(Ve,{children:[e.jsx(Be,{children:"Delete organization?"}),e.jsxs(He,{children:["This will permanently delete ",e.jsx("b",{children:n.name}),". This action cannot be undone."]})]}),e.jsxs(Ue,{className:"sm:justify-between",children:[e.jsx(Ke,{disabled:j===n.id,children:"Cancel"}),e.jsx(Ge,{asChild:!0,disabled:j===n.id,children:e.jsx(g,{variant:"destructive",onClick:()=>V(n),children:"Confirm delete"})})]})]})]})]})]},n.id))}),e.jsx(le,{open:l,onOpenChange:d,children:e.jsxs(de,{className:"sm:max-w-[480px]",children:[e.jsxs(ce,{children:[e.jsx(me,{children:"Create organization"}),e.jsx(je,{children:"Set a name and a URL-friendly slug."})]}),e.jsx(H,{...w,children:e.jsxs("form",{onSubmit:w.handleSubmit(A),className:"space-y-4",children:[e.jsx(S,{control:w.control,name:"name",render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(D,{placeholder:"Acme Inc",autoFocus:!0,...n})}),e.jsx(Ze,{children:"This is your organization’s display name."}),e.jsx(_,{})]})}),e.jsx(S,{control:w.control,name:"slug",render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Slug"}),e.jsx(I,{children:e.jsx(D,{placeholder:"acme-inc",...n,onChange:o=>{v.current=!0,n.onChange(o)},onBlur:o=>{const i=Ye(o.target.value);w.setValue("slug",i,{shouldValidate:!0}),n.onBlur()}})}),e.jsx(Ze,{children:"Lowercase, numbers and hyphens only."}),e.jsx(_,{})]})}),e.jsxs(ue,{className:"flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>{w.reset(),d(!1),v.current=!1},children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!w.formState.isValid||w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating...":"Create"})]})]})})]})})]})},ir=Ee("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function or({className:t,variant:s,asChild:a=!1,...r}){const l=a?xe:"span";return e.jsx(l,{"data-slot":"badge",className:c(ir({variant:s}),t),...r})}function lr({className:t,...s}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:c("w-full caption-bottom text-sm",t),...s})})}function dr({className:t,...s}){return e.jsx("thead",{"data-slot":"table-header",className:c("[&_tr]:border-b",t),...s})}function cr({className:t,...s}){return e.jsx("tbody",{"data-slot":"table-body",className:c("[&_tr:last-child]:border-0",t),...s})}function tt({className:t,...s}){return e.jsx("tr",{"data-slot":"table-row",className:c("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...s})}function se({className:t,...s}){return e.jsx("th",{"data-slot":"table-head",className:c("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function ae({className:t,...s}){return e.jsx("td",{"data-slot":"table-cell",className:c("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}const ur=G({name:L().min(1,"Name is required").max(100,"Max 100 characters"),comment:L().trim().max(100,"Max 100 characters").default(""),bits:be(["2048","3072","4096"])});function mr(t,s="download.bin"){if(!t)return s;const a=/filename\*=UTF-8''([^;]+)/i.exec(t);return a?.[1]?decodeURIComponent(a[1]):/filename="?([^"]+)"?/i.exec(t)?.[1]??s}function xr(t,s=24){return!t||t.length<=s*2+3?t:`${t.slice(0,s)}…${t.slice(-s)}`}function hr(t){return t?.split(/\s+/)?.[0]??"ssh-key"}async function fr(t){try{await navigator.clipboard.writeText(t)}catch{const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="absolute",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}}const gr=()=>{const[t,s]=u.useState([]),[a,r]=u.useState(null),[l,d]=u.useState(!0),[x,m]=u.useState(""),[j,h]=u.useState(!1),v=u.useMemo(()=>!!localStorage.getItem("active_org_id"),[]);async function w(){d(!0),r(null);try{if(!v){s([]),r("Select an organization first.");return}const n=await E.get("/api/v1/ssh");s(n??[])}catch(n){console.error(n),r("Failed to fetch SSH keys")}finally{d(!1)}}u.useEffect(()=>{w();const n=o=>{o.key==="active_org_id"&&w()};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},[]);const y=t.filter(n=>`${n.name} ${n.public_keys} ${n.fingerprint}`.toLowerCase().includes(x.toLowerCase()));async function b(n,o="both"){const i=localStorage.getItem("access_token"),f=localStorage.getItem("active_org_id"),z=`${pe}/api/v1/ssh/${encodeURIComponent(n)}/download?part=${encodeURIComponent(o)}`;try{const $=await fetch(z,{method:"GET",headers:{...i?{Authorization:`Bearer ${i}`}:{},...f?{"X-Org-ID":f}:{}}});if(!$.ok){const kt=await $.text().catch(()=>"");throw new Error(kt||`HTTP ${$.status}`)}const fe=await $.blob(),St=o==="both"?`ssh_key_${n}.zip`:o==="public"?`id_rsa_${n}.pub`:`id_rsa_${n}.pem`,Ct=mr($.headers.get("content-disposition")??void 0,St),qe=URL.createObjectURL(fe),ee=document.createElement("a");ee.href=qe,ee.download=Ct,document.body.appendChild(ee),ee.click(),ee.remove(),URL.revokeObjectURL(qe)}catch($){console.error($),alert($ instanceof Error?$.message:"Download failed")}}async function A(n){try{await E.delete(`/api/v1/ssh/${encodeURIComponent(n)}`),await w()}catch(o){console.error(o),alert("Failed to delete key")}}const O=U({resolver:B(ur),defaultValues:{name:"",comment:"deploy@autoglue",bits:"4096"}});async function V(n){try{await E.post("/api/v1/ssh",{bits:Number(n.bits),comment:n.comment?.trim()??"",name:n.name.trim(),download:"none"}),h(!1),O.reset(),await w()}catch(o){console.error(o),alert("Failed to create key")}}return l?e.jsx("div",{className:"p-6",children:"Loading SSH Keys…"}):a?e.jsx("div",{className:"p-6 text-red-500",children:a}):e.jsx(Te,{children:e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"SSH Keys"}),e.jsx("div",{className:"w-full max-w-sm",children:e.jsx(D,{value:x,onChange:n=>m(n.target.value),placeholder:"Search by name, fingerprint or key"})}),e.jsxs(le,{open:j,onOpenChange:h,children:[e.jsx(wt,{asChild:!0,children:e.jsxs(g,{onClick:()=>h(!0),children:[e.jsx(ut,{className:"mr-2 h-4 w-4"}),"Create New Keypair"]})}),e.jsxs(de,{className:"sm:max-w-lg",children:[e.jsx(ce,{children:e.jsx(me,{children:"Create SSH Keypair"})}),e.jsx(H,{...O,children:e.jsxs("form",{onSubmit:O.handleSubmit(V),className:"space-y-4",children:[e.jsx(S,{control:O.control,name:"name",render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(D,{placeholder:"e.g., CI deploy key",...n})}),e.jsx(_,{})]})}),e.jsx(S,{control:O.control,name:"comment",render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Comment"}),e.jsx(I,{children:e.jsx(D,{placeholder:"e.g., deploy@autoglue",...n})}),e.jsx(_,{})]})}),e.jsx(S,{control:O.control,name:"bits",render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Key size"}),e.jsx(I,{children:e.jsxs("select",{className:"bg-background w-full rounded-md border px-3 py-2 text-sm",value:n.value,onChange:n.onChange,children:[e.jsx("option",{value:"2048",children:"2048"}),e.jsx("option",{value:"3072",children:"3072"}),e.jsx("option",{value:"4096",children:"4096"})]})}),e.jsx(_,{})]})}),e.jsxs(ue,{className:"gap-2",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:O.formState.isSubmitting,children:O.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]}),e.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(lr,{children:[e.jsx(dr,{children:e.jsxs(tt,{children:[e.jsx(se,{children:"Name"}),e.jsx(se,{className:"min-w-[360px]",children:"Public Key"}),e.jsx(se,{children:"Fingerprint"}),e.jsx(se,{children:"Created"}),e.jsx(se,{className:"w-[160px] text-right",children:"Actions"})]})}),e.jsx(cr,{children:y.map(n=>{const o=hr(n.public_keys),i=xr(n.public_keys,18);return e.jsxs(tt,{children:[e.jsx(ae,{className:"align-top",children:n.name}),e.jsx(ae,{className:"align-top",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(or,{variant:"secondary",className:"whitespace-nowrap",children:o}),e.jsxs(xt,{children:[e.jsx(ht,{asChild:!0,children:e.jsx("code",{className:"font-mono text-sm break-all md:max-w-[48ch] md:truncate md:break-normal",children:i})}),e.jsx(ft,{className:"max-w-[70vw]",children:e.jsx("div",{className:"max-w-full",children:e.jsx("p",{className:"font-mono text-xs break-all",children:n.public_keys})})})]})]})}),e.jsx(ae,{className:"align-top",children:e.jsx("code",{className:"font-mono text-sm",children:n.fingerprint})}),e.jsx(ae,{className:"align-top",children:new Date(n.created_at).toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),e.jsx(ae,{className:"align-top",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>fr(n.public_keys),title:"Copy public key",children:[e.jsx(Bs,{className:"mr-2 h-4 w-4"}),"Copy"]}),e.jsxs(Le,{children:[e.jsx($e,{asChild:!0,children:e.jsxs(g,{variant:"outline",size:"sm",children:[e.jsx(Hs,{className:"mr-2 h-4 w-4"}),"Download"]})}),e.jsxs(Fe,{align:"end",children:[e.jsx(W,{onClick:()=>b(n.id,"both"),children:"Public + Private (.zip)"}),e.jsx(W,{onClick:()=>b(n.id,"public"),children:"Public only (.pub)"}),e.jsx(W,{onClick:()=>b(n.id,"private"),children:"Private only (.pem)"})]})]}),e.jsxs(g,{variant:"destructive",size:"sm",onClick:()=>A(n.id),children:[e.jsx(ve,{className:"mr-2 h-4 w-4"}),"Delete"]})]})})]},n.id)})})]})})})]})})};function pr(){return e.jsxs(Gs,{children:[e.jsx(N,{path:"/403",element:e.jsx(er,{})}),e.jsx(N,{path:"/",element:e.jsx(De,{to:"/auth/login",replace:!0})}),e.jsxs(N,{path:"/auth",children:[e.jsx(N,{path:"login",element:e.jsx(qa,{})}),e.jsx(N,{path:"register",element:e.jsx(Ya,{})}),e.jsx(N,{path:"forgot",element:e.jsx(Ga,{})}),e.jsx(N,{path:"reset",element:e.jsx(Qa,{})}),e.jsx(N,{path:"verify",element:e.jsx(Za,{})})]}),e.jsx(N,{element:e.jsx(Da,{}),children:e.jsxs(N,{element:e.jsx(Oa,{}),children:[e.jsx(N,{element:e.jsx(Aa,{}),children:e.jsx(N,{path:"/admin",children:e.jsx(N,{path:"users",element:e.jsx(Ba,{})})})}),e.jsx(N,{path:"/core"}),e.jsx(N,{path:"/security",children:e.jsx(N,{path:"ssh",element:e.jsx(gr,{})})}),e.jsxs(N,{path:"/settings",children:[e.jsx(N,{path:"orgs",element:e.jsx(nr,{})}),e.jsx(N,{path:"members",element:e.jsx(ar,{})}),e.jsx(N,{path:"me",element:e.jsx(Ja,{})})]}),e.jsx(N,{path:"*",element:e.jsx(et,{})})]})}),e.jsx(N,{path:"*",element:e.jsx(et,{})})]})}const jr=({...t})=>{const{theme:s="system"}=st();return e.jsx(Tt,{theme:s,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})};function br({children:t,defaultTheme:s="system",storageKey:a="vite-ui-theme"}){return e.jsx(Lt,{attribute:"class",defaultTheme:s,enableSystem:!0,storageKey:a,disableTransitionOnChange:!0,children:t})}$t.createRoot(document.getElementById("root")).render(e.jsx(u.StrictMode,{children:e.jsx(Ks,{children:e.jsxs(br,{defaultTheme:"system",storageKey:"dragon-theme",children:[e.jsx(pr,{}),e.jsx(jr,{richColors:!0,position:"top-right"})]})})})); diff --git a/internal/ui/dist/assets/index-CJrhsj7s.css b/internal/ui/dist/assets/index-CJrhsj7s.css deleted file mode 100644 index 7676b65..0000000 --- a/internal/ui/dist/assets/index-CJrhsj7s.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-widest:.1em;--leading-loose:2;--radius-xs:.125rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\.5{top:calc(var(--spacing)*1.5)}.top-3\.5{top:calc(var(--spacing)*3.5)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-4{margin-right:calc(var(--spacing)*4)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-24{width:calc(var(--spacing)*24)}.w-40{width:calc(var(--spacing)*40)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-\[200px\]{width:200px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-md{max-width:var(--container-md)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-sidebar-border{border-color:var(--sidebar-border)}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-primary{fill:var(--primary)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-6{padding-block:calc(var(--spacing)*6)}.py-10{padding-block:calc(var(--spacing)*10)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-loose{--tw-leading:var(--leading-loose);line-height:var(--leading-loose)}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground)70%,transparent)}}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media (hover:hover){.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing)*8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing)*-8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing)*8)!important;height:calc(var(--spacing)*8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing)*0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing)*-4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing)*0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\/collapsible\:rotate-180:is(:where(.group\/collapsible)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing)*1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing)*2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing)*1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing)*-2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}@media (hover:hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media (min-width:40rem){.sm\:flex{display:flex}.sm\:max-w-\[480px\]{max-width:480px}.sm\:max-w-\[520px\]{max-width:520px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media (min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:h-24{height:calc(var(--spacing)*24)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-2{gap:calc(var(--spacing)*2)}.md\:px-0{padding-inline:calc(var(--spacing)*0)}.md\:py-0{padding-block:calc(var(--spacing)*0)}.md\:text-left{text-align:left}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:opacity-0{opacity:0}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing)*2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing)*0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing)*2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media (min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing)*-2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing)*-2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.1% .005 285.823);--card:oklch(100% 0 0);--card-foreground:oklch(14.1% .005 285.823);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.1% .005 285.823);--primary:oklch(21% .006 285.885);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(96.7% .001 286.375);--secondary-foreground:oklch(21% .006 285.885);--muted:oklch(96.7% .001 286.375);--muted-foreground:oklch(55.2% .016 285.938);--accent:oklch(96.7% .001 286.375);--accent-foreground:oklch(21% .006 285.885);--destructive:oklch(57.7% .245 27.325);--border:oklch(92% .004 286.32);--input:oklch(92% .004 286.32);--ring:oklch(70.5% .015 286.067);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.1% .005 285.823);--sidebar-primary:oklch(21% .006 285.885);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(96.7% .001 286.375);--sidebar-accent-foreground:oklch(21% .006 285.885);--sidebar-border:oklch(92% .004 286.32);--sidebar-ring:oklch(70.5% .015 286.067)}.dark{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92% .004 286.32);--primary-foreground:oklch(21% .006 285.885);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(27.4% .006 286.033);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(21% .006 285.885);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(27.4% .006 286.033);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.2% .016 285.938)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/internal/ui/dist/assets/index-DXA6UWYz.css b/internal/ui/dist/assets/index-DXA6UWYz.css new file mode 100644 index 0000000..4d11639 --- /dev/null +++ b/internal/ui/dist/assets/index-DXA6UWYz.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-widest:.1em;--leading-loose:2;--radius-xs:.125rem;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\.5{top:calc(var(--spacing)*1.5)}.top-3\.5{top:calc(var(--spacing)*3.5)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-4{margin-right:calc(var(--spacing)*4)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-24{width:calc(var(--spacing)*24)}.w-40{width:calc(var(--spacing)*40)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-\[160px\]{width:160px}.w-\[200px\]{width:200px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-\[70vw\]{max-width:70vw}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[360px\]{min-width:360px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[2px\]{border-radius:2px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-primary{fill:var(--primary)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-6{padding-block:calc(var(--spacing)*6)}.py-10{padding-block:calc(var(--spacing)*10)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-loose{--tw-leading:var(--leading-loose);line-height:var(--leading-loose)}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground)70%,transparent)}}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media (hover:hover){.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing)*8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing)*-8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing)*8)!important;height:calc(var(--spacing)*8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing)*0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing)*-4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing)*0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\/collapsible\:rotate-180:is(:where(.group\/collapsible)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing)*1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing)*2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing)*1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing)*-2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}@media (hover:hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media (min-width:40rem){.sm\:flex{display:flex}.sm\:max-w-\[480px\]{max-width:480px}.sm\:max-w-\[520px\]{max-width:520px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media (min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:h-24{height:calc(var(--spacing)*24)}.md\:max-w-\[48ch\]{max-width:48ch}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-2{gap:calc(var(--spacing)*2)}.md\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md\:px-0{padding-inline:calc(var(--spacing)*0)}.md\:py-0{padding-block:calc(var(--spacing)*0)}.md\:text-left{text-align:left}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:break-normal{overflow-wrap:normal;word-break:normal}.md\:opacity-0{opacity:0}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing)*2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing)*0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing)*2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media (min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing)*-2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing)*-2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media (hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.1% .005 285.823);--card:oklch(100% 0 0);--card-foreground:oklch(14.1% .005 285.823);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.1% .005 285.823);--primary:oklch(21% .006 285.885);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(96.7% .001 286.375);--secondary-foreground:oklch(21% .006 285.885);--muted:oklch(96.7% .001 286.375);--muted-foreground:oklch(55.2% .016 285.938);--accent:oklch(96.7% .001 286.375);--accent-foreground:oklch(21% .006 285.885);--destructive:oklch(57.7% .245 27.325);--border:oklch(92% .004 286.32);--input:oklch(92% .004 286.32);--ring:oklch(70.5% .015 286.067);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.1% .005 285.823);--sidebar-primary:oklch(21% .006 285.885);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(96.7% .001 286.375);--sidebar-accent-foreground:oklch(21% .006 285.885);--sidebar-border:oklch(92% .004 286.32);--sidebar-ring:oklch(70.5% .015 286.067)}.dark{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92% .004 286.32);--primary-foreground:oklch(21% .006 285.885);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(27.4% .006 286.033);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(21% .006 285.885);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(27.4% .006 286.033);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.2% .016 285.938)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/internal/ui/dist/assets/index-YQeQnKJK.js b/internal/ui/dist/assets/index-YQeQnKJK.js deleted file mode 100644 index e0c5db2..0000000 --- a/internal/ui/dist/assets/index-YQeQnKJK.js +++ /dev/null @@ -1 +0,0 @@ -import{t as ht,m as ft,r as u,j as e,n as Ge,z as Ke,F as gt,C as pt,p as jt,q as bt,v as K,w as X,x as U,y as H,A as p,B as $,_ as ye,D as vt,T as wt,J as yt,E as Nt}from"./vendor-Cnbx_Mrt.js";import{S as me,R as St,a as qe,C as Je,b as We,T as Ye,D as Xe,P as Qe,O as Ze,c as Ct,d as kt,e as It,f as Et,g as _t,A as Ot,h as zt,i as Dt,j as At,k as Tt,l as Lt,m as Mt,n as Ft,I as $t,o as Rt,p as Pt,q as Vt,r as Bt,s as Ut,t as Ht,u as Gt,v as Kt,w as qt,x as Jt,y as Wt,z as Yt,B as Xt,E as Qt,V as Zt,F as es,G as ts,H as ss,J as as,K as ns,L as rs,M as is,N as os}from"./radix-DN_DrUzo.js";import{X as et,S as ls,M as ds,L as cs,C as re,H as us,A as ms,B as xs,a as hs,T as fs,b as gs,c as ps,d as js,K as bs,F as vs,e as ws,f as ys,g as Ns,U as $e,h as Ss,i as Cs,j as ks,k as Ne,l as Is,m as Es,n as Re,o as Se,P as _s,p as Os}from"./icons-CHRYRpwL.js";import{u as xe,L as J,O as Ce,N as ke,a as ne,b as tt,R as zs,c as N,B as Ds}from"./router-CyXg69m3.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const x of l.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&n(x)}).observe(document,{childList:!0,subtree:!0});function a(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(o){if(o.ep)return;o.ep=!0;const l=a(o);fetch(o.href,l)}})();function c(...t){return ht(ft(t))}function Pe(t){return t.toLowerCase().trim().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"")}const fe=768;function As(){const[t,s]=u.useState(void 0);return u.useEffect(()=>{const a=window.matchMedia(`(max-width: ${fe-1}px)`),n=()=>{s(window.innerWidtha.removeEventListener("change",n)},[]),!!t}const Ie=Ge("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:t,variant:s,size:a,asChild:n=!1,...o}){const l=n?me:"button";return e.jsx(l,{"data-slot":"button",className:c(Ie({variant:s,size:a,className:t})),...o})}function z({className:t,type:s,...a}){return e.jsx("input",{type:s,"data-slot":"input",className:c("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...a})}function Z({className:t,orientation:s="horizontal",decorative:a=!0,...n}){return e.jsx(St,{"data-slot":"separator",decorative:a,orientation:s,className:c("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function Ts({...t}){return e.jsx(qe,{"data-slot":"sheet",...t})}function Ls({...t}){return e.jsx(Qe,{"data-slot":"sheet-portal",...t})}function Ms({className:t,...s}){return e.jsx(Ze,{"data-slot":"sheet-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function Fs({className:t,children:s,side:a="right",...n}){return e.jsxs(Ls,{children:[e.jsx(Ms,{}),e.jsxs(Je,{"data-slot":"sheet-content",className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...n,children:[s,e.jsxs(We,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(et,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function $s({className:t,...s}){return e.jsx("div",{"data-slot":"sheet-header",className:c("flex flex-col gap-1.5 p-4",t),...s})}function Rs({className:t,...s}){return e.jsx(Ye,{"data-slot":"sheet-title",className:c("text-foreground font-semibold",t),...s})}function Ps({className:t,...s}){return e.jsx(Xe,{"data-slot":"sheet-description",className:c("text-muted-foreground text-sm",t),...s})}function B({className:t,...s}){return e.jsx("div",{"data-slot":"skeleton",className:c("bg-accent animate-pulse rounded-md",t),...s})}function st({delayDuration:t=0,...s}){return e.jsx(Ct,{"data-slot":"tooltip-provider",delayDuration:t,...s})}function Vs({...t}){return e.jsx(st,{children:e.jsx(kt,{"data-slot":"tooltip",...t})})}function Bs({...t}){return e.jsx(It,{"data-slot":"tooltip-trigger",...t})}function Us({className:t,sideOffset:s=0,children:a,...n}){return e.jsx(Et,{children:e.jsxs(_t,{"data-slot":"tooltip-content",sideOffset:s,className:c("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[a,e.jsx(Ot,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Hs="sidebar_state",Gs=3600*24*7,Ks="16rem",qs="18rem",Js="3rem",Ws="b",at=u.createContext(null);function nt(){const t=u.useContext(at);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Ys({defaultOpen:t=!0,open:s,onOpenChange:a,className:n,style:o,children:l,...x}){const m=As(),[j,f]=u.useState(!1),[b,y]=u.useState(t),w=s??b,v=u.useCallback(d=>{const i=typeof d=="function"?d(w):d;a?a(i):y(i),document.cookie=`${Hs}=${i}; path=/; max-age=${Gs}`},[a,w]),M=u.useCallback(()=>m?f(d=>!d):v(d=>!d),[m,v,f]);u.useEffect(()=>{const d=i=>{i.key===Ws&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),M())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[M]);const F=w?"expanded":"collapsed",q=u.useMemo(()=>({state:F,open:w,setOpen:v,isMobile:m,openMobile:j,setOpenMobile:f,toggleSidebar:M}),[F,w,v,m,j,f,M]);return e.jsx(at.Provider,{value:q,children:e.jsx(st,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ks,"--sidebar-width-icon":Js,...o},className:c("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...x,children:l})})})}function Xs({side:t="left",variant:s="sidebar",collapsible:a="offcanvas",className:n,children:o,...l}){const{isMobile:x,state:m,openMobile:j,setOpenMobile:f}=nt();return a==="none"?e.jsx("div",{"data-slot":"sidebar",className:c("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...l,children:o}):x?e.jsx(Ts,{open:j,onOpenChange:f,...l,children:e.jsxs(Fs,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":qs},side:t,children:[e.jsxs($s,{className:"sr-only",children:[e.jsx(Rs,{children:"Sidebar"}),e.jsx(Ps,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":m,"data-collapsible":m==="collapsed"?a:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:c("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:c("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="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",n),...l,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Qs({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:c("flex flex-col gap-2 p-2",t),...s})}function Zs({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:c("flex flex-col gap-2 p-2",t),...s})}function ea({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:c("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})}function ta({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:c("relative flex w-full min-w-0 flex-col p-2",t),...s})}function sa({className:t,asChild:s=!1,...a}){const n=s?me:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:c("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...a})}function aa({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:c("w-full text-sm",t),...s})}function na({className:t,...s}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:c("flex w-full min-w-0 flex-col gap-1",t),...s})}function ra({className:t,...s}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:c("group/menu-item relative",t),...s})}const ia=Ge("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm 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=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=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-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function oa({asChild:t=!1,isActive:s=!1,variant:a="default",size:n="default",tooltip:o,className:l,...x}){const m=t?me:"button",{isMobile:j,state:f}=nt(),b=e.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":s,className:c(ia({variant:a,size:n}),l),...x});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(Vs,{children:[e.jsx(Bs,{asChild:!0,children:b}),e.jsx(Us,{side:"right",align:"center",hidden:f!=="collapsed"||j,...o})]})):b}function la({...t}){return e.jsx(zt,{"data-slot":"collapsible",...t})}function da({...t}){return e.jsx(Dt,{"data-slot":"collapsible-trigger",...t})}function ca({...t}){return e.jsx(At,{"data-slot":"collapsible-content",...t})}function rt({...t}){return e.jsx(Tt,{"data-slot":"dropdown-menu",...t})}function it({...t}){return e.jsx(Lt,{"data-slot":"dropdown-menu-trigger",...t})}function ot({className:t,sideOffset:s=4,...a}){return e.jsx(Mt,{children:e.jsx(Ft,{"data-slot":"dropdown-menu-content",sideOffset:s,className:c("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...a})})}function ee({className:t,inset:s,variant:a="default",...n}){return e.jsx($t,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":a,className:c("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function ua(){const{setTheme:t,theme:s}=Ke();return e.jsxs(rt,{children:[e.jsx(it,{asChild:!0,children:e.jsx(g,{variant:"outline",size:"icon","aria-label":"Toggle theme",children:s==="light"?e.jsx(ls,{className:"h-5 w-5"}):s==="dark"?e.jsx(ds,{className:"h-5 w-5"}):e.jsx(cs,{className:"h-5 w-5"})})}),e.jsxs(ot,{align:"end",children:[e.jsxs(ee,{onClick:()=>t("light"),children:[s==="light"&&e.jsx(re,{}),"Light"]}),e.jsxs(ee,{onClick:()=>t("dark"),children:[s==="dark"&&e.jsx(re,{}),"Dark"]}),e.jsxs(ee,{onClick:()=>t("system"),children:[s==="system"&&e.jsx(re,{}),"System"]})]})]})}const ge="";class D extends Error{status;body;constructor(s,a,n){super(a),this.status=s,this.body=n}}function ma(t){const s={};if(!t)return s;if(t instanceof Headers)t.forEach((a,n)=>s[n]=a);else if(Array.isArray(t))for(const[a,n]of t)s[a]=n;else Object.assign(s,t);return s}function xa(){const t={},s=localStorage.getItem("access_token");return s&&(t.Authorization=`Bearer ${s}`),t}function ha(){const t=localStorage.getItem("active_org_id");return t?{"X-Org-ID":t}:{}}async function Q(t,s,a,n={}){const l={...{"Content-Type":"application/json"},...n.auth===!1?{}:xa(),...ha(),...ma(n.headers)},x=await fetch(`${ge}${t}`,{method:s,headers:l,body:a===void 0?void 0:JSON.stringify(a),...n}),j=(x.headers.get("content-type")||"").includes("application/json"),f=j?await x.json().catch(()=>{}):await x.text().catch(()=>"");if(!x.ok){const b=j&&f&&typeof f=="object"&&"error"in f&&f.error||j&&f&&typeof f=="object"&&"message"in f&&f.message||typeof f=="string"&&f||`HTTP ${x.status}`;throw new D(x.status,String(b),f)}return console.debug("API ->",s,`${ge}${t}`,l),j?f:void 0}const O={get:(t,s)=>Q(t,"GET",void 0,s),post:(t,s,a)=>Q(t,"POST",s,a),put:(t,s,a)=>Q(t,"PUT",s,a),patch:(t,s,a)=>Q(t,"PATCH",s,a),delete:(t,s)=>Q(t,"DELETE",void 0,s)},pe="active_org_id",W="active-org-changed",se="orgs-changed";function V(){return localStorage.getItem(pe)}function te(t){t?localStorage.setItem(pe,t):localStorage.removeItem(pe),window.dispatchEvent(new CustomEvent(W,{detail:t}))}function Ve(){window.dispatchEvent(new Event(se))}const fa=()=>{const[t,s]=u.useState([]),[a,n]=u.useState(null);async function o(){try{const m=await O.get("/api/v1/orgs");s(m),!V()&&m.length>0&&(te(m[0].id),n(m[0].id))}catch(m){const j=m instanceof D?m.message:"Failed to load organizations";console.error(j)}}u.useEffect(()=>{n(V()),o();const m=b=>{b.key==="active_org_id"&&n(b.newValue)};window.addEventListener("storage",m);const j=b=>n(b.detail??null),f=()=>void o();return window.addEventListener(W,j),window.addEventListener(se,f),()=>{window.removeEventListener("storage",m),window.removeEventListener(W,j),window.removeEventListener(se,f)}},[]);const l=m=>{te(m),n(m)},x=t.find(m=>m.id===a)?.name??"Select Org";return e.jsxs(rt,{children:[e.jsx(it,{asChild:!0,children:e.jsx(g,{variant:"outline",className:"w-full justify-start",children:x})}),e.jsx(ot,{className:"w-48",children:t.length===0?e.jsx(ee,{disabled:!0,children:"No organizations"}):t.map(m=>e.jsx(ee,{onClick:()=>l(m.id),className:m.id===a?"font-semibold":void 0,children:m.name},m.id))})]})},Be=[{label:"Dashboard",icon:us,to:"/dashboard"},{label:"Core",icon:js,items:[{label:"Cluster",to:"/core/cluster",icon:ms},{label:"Node Pools",icon:xs,to:"/core/node-pools"},{label:"Annotations",icon:hs,to:"/core/annotations"},{label:"Labels",icon:fs,to:"/core/labels"},{label:"Taints",icon:gs,to:"/core/taints"},{label:"Servers",icon:ps,to:"/core/servers"}]},{label:"Security",icon:ws,items:[{label:"Keys & Tokens",icon:bs,to:"/security/keys"},{label:"SSH Keys",to:"/security/ssh",icon:vs}]},{label:"Tasks",icon:ys,items:[]},{label:"Settings",icon:Cs,items:[{label:"Organizations",to:"/settings/orgs",icon:Ns},{label:"Members",to:"/settings/members",icon:$e},{label:"Profile",to:"/settings/me",icon:Ss}]},{label:"Admin",icon:ks,requiresAdmin:!0,items:[{label:"Users",to:"/admin/users",icon:$e,requiresAdmin:!0}]}];function ga(t){return t&&(t.user||t.user_id)}function lt(t){return ga(t)?.role==="admin"}function pa(t){return(t?.org_role??"")==="admin"}const R={isAuthenticated(){return!!localStorage.getItem("access_token")},async login(t,s){const a=await O.post("/api/v1/auth/login",{email:t,password:s});localStorage.setItem("access_token",a.access_token),localStorage.setItem("refresh_token",a.refresh_token)},async register(t,s,a){await O.post("/api/v1/auth/register",{name:t,email:s,password:a})},async me(){return await O.get("/api/v1/auth/me")},async logout(){const t=localStorage.getItem("refresh_token");if(t)try{await O.post("/api/v1/auth/logout",{refresh_token:t})}catch{}localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")},async forgot(t){await O.post("/api/v1/auth/password/forgot",{email:t})},async reset(t,s){await O.post("/api/v1/auth/password/reset",{token:t,new_password:s})},async verify(t){const s=await fetch(`${ge}/api/v1/auth/verify?token=${encodeURIComponent(t)}`);if(!s.ok){const a=await s.text();throw new Error(a)}}};function dt(t,s,a){return t.filter(n=>!(n.requiresAdmin&&!s||n.requiresOrgAdmin&&!a)).map(n=>({...n,items:n.items?dt(n.items,s,a):void 0})).filter(n=>!n.items||n.items.length>0)}const ct=({item:t})=>{const s=xe(),a=t.icon;return t.to?e.jsxs(J,{to:t.to,className:`hover:bg-accent hover:text-accent-foreground flex items-center space-x-2 rounded-md px-4 py-2 text-sm ${s.pathname===t.to?"bg-accent text-accent-foreground":""}`,children:[e.jsx(a,{className:"mr-4 h-4 w-4"}),t.label]}):t.items?e.jsx(la,{defaultOpen:!0,className:"group/collapsible",children:e.jsxs(ta,{children:[e.jsx(sa,{asChild:!0,children:e.jsxs(da,{children:[e.jsx(a,{className:"mr-4 h-4 w-4"}),t.label,e.jsx(Ne,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e.jsx(ca,{children:e.jsx(aa,{children:e.jsx(na,{children:t.items.map((n,o)=>e.jsx(ra,{children:e.jsx(oa,{asChild:!0,children:e.jsx(ct,{item:n})})},o))})})})]})}):null},ja=()=>{const[t,s]=u.useState(null),[a,n]=u.useState(!0);u.useEffect(()=>{let l=!0;return(async()=>{try{const x=await R.me();if(!l)return;s(x)}catch{}finally{if(!l)return;n(!1)}})(),()=>{l=!1}},[]);const o=u.useMemo(()=>{const l=lt(t),x=pa(t);return dt(Be,l,x)},[t]);return e.jsxs(Xs,{children:[e.jsx(Qs,{className:"flex items-center justify-between p-4",children:e.jsx("h1",{className:"text-xl font-bold",children:"AutoGlue"})}),e.jsx(ea,{children:(a?Be:o).map((l,x)=>e.jsx(ct,{item:l},x))}),e.jsxs(Zs,{className:"space-y-2 p-4",children:[e.jsx(fa,{}),e.jsx(ua,{}),e.jsx(g,{onClick:()=>{localStorage.clear(),window.location.reload()},className:"w-full",children:"Logout"})]})]})};function ba(){return e.jsx("footer",{className:"border-t",children:e.jsxs("div",{className:"container flex flex-col items-center justify-between gap-4 py-10 md:h-24 md:flex-row md:py-0",children:[e.jsx("div",{className:"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0",children:e.jsxs("p",{className:"text-muted-foreground text-center text-sm leading-loose md:text-left",children:["Built for"," ",e.jsx("a",{href:"https://www.glueops.dev/",target:"_blank",rel:"noreferrer",className:"font-medium underline underline-offset-4",children:"GlueOps"}),". The source code is available on"," ",e.jsx("a",{href:"https://github.com/GlueOps/autoglue",target:"_blank",rel:"noreferrer",className:"font-medium underline underline-offset-4",children:"GitHub"}),"."]})}),e.jsx("div",{className:"flex items-center space-x-4",children:e.jsx("a",{href:"https://github.com/GlueOps/autoglue",target:"_blank",rel:"noreferrer",children:e.jsx(Is,{className:"h-5 w-5"})})})]})})}function va(){return e.jsx("div",{className:"flex h-screen",children:e.jsxs(Ys,{children:[e.jsx(ja,{}),e.jsxs("div",{className:"flex flex-1 flex-col",children:[e.jsx("main",{className:"flex-1 overflow-auto p-4",children:e.jsx(Ce,{})}),e.jsx(ba,{})]})]})})}function wa({children:t}){const s=xe();return R.isAuthenticated()?t?e.jsx(e.Fragment,{children:t}):e.jsx(Ce,{}):e.jsx(ke,{to:"/auth/login",state:{from:s},replace:!0})}function A({className:t,...s}){return e.jsx("div",{"data-slot":"card",className:c("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...s})}function T({className:t,...s}){return e.jsx("div",{"data-slot":"card-header",className:c("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function P({className:t,...s}){return e.jsx("div",{"data-slot":"card-title",className:c("leading-none font-semibold",t),...s})}function L({className:t,...s}){return e.jsx("div",{"data-slot":"card-content",className:c("px-6",t),...s})}function ae({className:t,...s}){return e.jsx("div",{"data-slot":"card-footer",className:c("flex items-center px-6 [.border-t]:pt-6",t),...s})}function ya({className:t,...s}){return e.jsx(Rt,{"data-slot":"label",className:c("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...s})}const G=gt,ut=u.createContext({}),S=({...t})=>e.jsx(ut.Provider,{value:{name:t.name},children:e.jsx(pt,{...t})}),he=()=>{const t=u.useContext(ut),s=u.useContext(mt),{getFieldState:a}=jt(),n=bt({name:t.name}),o=a(t.name,n);if(!t)throw new Error("useFormField should be used within ");const{id:l}=s;return{id:l,name:t.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...o}},mt=u.createContext({});function C({className:t,...s}){const a=u.useId();return e.jsx(mt.Provider,{value:{id:a},children:e.jsx("div",{"data-slot":"form-item",className:c("grid gap-2",t),...s})})}function k({className:t,...s}){const{error:a,formItemId:n}=he();return e.jsx(ya,{"data-slot":"form-label","data-error":!!a,className:c("data-[error=true]:text-destructive",t),htmlFor:n,...s})}function I({...t}){const{error:s,formItemId:a,formDescriptionId:n,formMessageId:o}=he();return e.jsx(me,{"data-slot":"form-control",id:a,"aria-describedby":s?`${n} ${o}`:`${n}`,"aria-invalid":!!s,...t})}function Ue({className:t,...s}){const{formDescriptionId:a}=he();return e.jsx("p",{"data-slot":"form-description",id:a,className:c("text-muted-foreground text-sm",t),...s})}function E({className:t,...s}){const{error:a,formMessageId:n}=he(),o=a?String(a?.message??""):s.children;return o?e.jsx("p",{"data-slot":"form-message",id:n,className:c("text-destructive text-sm",t),...s,children:o}):null}const Na=K({email:X()});function Sa(){const t=U({resolver:H(Na),defaultValues:{email:""}});async function s(a){try{await R.forgot(a.email),p.success("If that email exists, we've sent instructions.")}catch(n){p.error(n.message||"Something went wrong")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(P,{children:"Forgot password"})}),e.jsx(L,{children:e.jsx(G,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(s),className:"space-y-4",children:[e.jsx(S,{name:"email",control:t.control,render:({field:a})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(z,{placeholder:"you@example.com",...a})}),e.jsx(E,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Send reset link"})]})})})]})})}const Ca=K({email:X(),password:$().min(6)});function ka(){const t=ne(),s=xe(),a=U({resolver:H(Ca),defaultValues:{email:"",password:""}});async function n(o){try{await R.login(o.email,o.password),p.success("Welcome back!");const l=s.state?.from?.pathname??"/settings/me";t(l,{replace:!0})}catch(l){p.error(l.message||"Login failed")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(P,{children:"Sign in"})}),e.jsxs(L,{children:[e.jsx(G,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(n),className:"space-y-4",children:[e.jsx(S,{name:"email",control:a.control,render:({field:o})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(z,{placeholder:"you@example.com",...o})}),e.jsx(E,{})]})}),e.jsx(S,{name:"password",control:a.control,render:({field:o})=>e.jsxs(C,{children:[e.jsx(k,{children:"Password"}),e.jsx(I,{children:e.jsx(z,{type:"password",placeholder:"••••••••",...o})}),e.jsx(E,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Sign in"})]})}),e.jsxs("div",{className:"mt-4 flex justify-between text-sm",children:[e.jsx(J,{to:"/auth/forgot",className:"underline",children:"Forgot password?"}),e.jsx(J,{to:"/auth/register",className:"underline",children:"Create an account"})]})]})]})})}function Ia(){const[t,s]=u.useState(null),a=ne();u.useEffect(()=>{(async()=>{try{const o=await R.me();s(o)}catch(o){p.error(o.message||"Failed to load profile")}})()},[]);async function n(){await R.logout(),a("/auth/login")}return e.jsx("div",{className:"mx-auto max-w-xl",children:e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(P,{children:"My Account"})}),e.jsxs(L,{className:"space-y-3",children:[t?e.jsx("pre",{className:"bg-muted overflow-auto rounded p-3 text-sm",children:JSON.stringify(t,null,2)}):e.jsx("p",{children:"Loading…"}),e.jsx(g,{onClick:n,children:"Sign out"})]})]})})}const Ea=K({name:$().min(2),email:X(),password:$().min(6)});function _a(){const t=ne(),s=U({resolver:H(Ea),defaultValues:{name:"",email:"",password:""}});async function a(n){try{await R.register(n.name,n.email,n.password),p.success("Account created! Check your email to verify."),t("/auth/login")}catch(o){p.error(o.message||"Registration failed")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(P,{children:"Create account"})}),e.jsxs(L,{children:[e.jsx(G,{...s,children:e.jsxs("form",{onSubmit:s.handleSubmit(a),className:"space-y-4",children:[e.jsx(S,{name:"name",control:s.control,render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(z,{placeholder:"Jane Doe",...n})}),e.jsx(E,{})]})}),e.jsx(S,{name:"email",control:s.control,render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(z,{placeholder:"you@example.com",...n})}),e.jsx(E,{})]})}),e.jsx(S,{name:"password",control:s.control,render:({field:n})=>e.jsxs(C,{children:[e.jsx(k,{children:"Password"}),e.jsx(I,{children:e.jsx(z,{type:"password",placeholder:"••••••••",...n})}),e.jsx(E,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Create account"})]})}),e.jsxs("div",{className:"mt-4 text-sm",children:["Already have an account?"," ",e.jsx(J,{to:"/auth/login",className:"underline",children:"Sign in"})]})]})]})})}const Oa=K({new_password:$().min(6)});function za(){const[t]=tt(),s=t.get("token"),a=U({resolver:H(Oa),defaultValues:{new_password:""}}),n=ne();async function o(l){if(!s){p.error("Missing token");return}try{await R.reset(s,l.new_password),p.success("Password updated. Please sign in."),n("/auth/login")}catch(x){p.error(x.message||"Reset failed")}}return e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(P,{children:"Reset password"})}),e.jsxs(L,{children:[e.jsx(G,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(o),className:"space-y-4",children:[e.jsx(S,{name:"new_password",control:a.control,render:({field:l})=>e.jsxs(C,{children:[e.jsx(k,{children:"New password"}),e.jsx(I,{children:e.jsx(z,{type:"password",placeholder:"••••••••",...l})}),e.jsx(E,{})]})}),e.jsx(g,{type:"submit",className:"w-full",children:"Update password"})]})}),e.jsx("div",{className:"mt-4 text-sm",children:e.jsx(J,{to:"/auth/login",className:"underline",children:"Back to sign in"})})]})]})})}function Da(){const[t]=tt(),s=t.get("token"),[a,n]=u.useState("idle");return u.useEffect(()=>{async function o(){if(!s){n("error");return}try{await R.verify(s),n("ok")}catch(l){p.error(l.message||"Verification failed"),n("error")}}o()},[s]),e.jsx("div",{className:"mx-auto max-w-md",children:e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(P,{children:"Email verification"})}),e.jsxs(L,{className:"space-y-3",children:[a==="idle"&&e.jsx("p",{children:"Verifying…"}),a==="ok"&&e.jsxs("div",{children:[e.jsx("p",{children:"Your email has been verified. You can now sign in."}),e.jsx(g,{asChild:!0,className:"mt-3",children:e.jsx(J,{to:"/auth/login",children:"Go to sign in"})})]}),a==="error"&&e.jsxs("div",{children:[e.jsx("p",{children:"Verification failed. Please request a new verification email."}),e.jsx(g,{asChild:!0,className:"mt-3",children:e.jsx(J,{to:"/auth/login",children:"Back to sign in"})})]})]})]})})}const He=()=>{const t=ne();return e.jsxs("div",{className:"bg-background text-foreground flex min-h-screen flex-col items-center justify-center",children:[e.jsx("h1",{className:"mb-4 text-6xl font-bold",children:"404"}),e.jsx("p",{className:"mb-8 text-2xl",children:"Oops! Page not found"}),e.jsx(g,{onClick:()=>t("/dashboard"),children:"Go back to Dashboard"})]})};function Ee({...t}){return e.jsx(Pt,{"data-slot":"alert-dialog",...t})}function _e({...t}){return e.jsx(Vt,{"data-slot":"alert-dialog-trigger",...t})}function Aa({...t}){return e.jsx(qt,{"data-slot":"alert-dialog-portal",...t})}function Ta({className:t,...s}){return e.jsx(Jt,{"data-slot":"alert-dialog-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function Oe({className:t,...s}){return e.jsxs(Aa,{children:[e.jsx(Ta,{}),e.jsx(Bt,{"data-slot":"alert-dialog-content",className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...s})]})}function ze({className:t,...s}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:c("flex flex-col gap-2 text-center sm:text-left",t),...s})}function De({className:t,...s}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function Ae({className:t,...s}){return e.jsx(Ut,{"data-slot":"alert-dialog-title",className:c("text-lg font-semibold",t),...s})}function Te({className:t,...s}){return e.jsx(Ht,{"data-slot":"alert-dialog-description",className:c("text-muted-foreground text-sm",t),...s})}function Le({className:t,...s}){return e.jsx(Kt,{className:c(Ie(),t),...s})}function Me({className:t,...s}){return e.jsx(Gt,{className:c(Ie({variant:"outline"}),t),...s})}function ie({...t}){return e.jsx(qe,{"data-slot":"dialog",...t})}function La({...t}){return e.jsx(Wt,{"data-slot":"dialog-trigger",...t})}function Ma({...t}){return e.jsx(Qe,{"data-slot":"dialog-portal",...t})}function Fa({className:t,...s}){return e.jsx(Ze,{"data-slot":"dialog-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function oe({className:t,children:s,showCloseButton:a=!0,...n}){return e.jsxs(Ma,{"data-slot":"dialog-portal",children:[e.jsx(Fa,{}),e.jsxs(Je,{"data-slot":"dialog-content",className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[s,a&&e.jsxs(We,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(et,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function le({className:t,...s}){return e.jsx("div",{"data-slot":"dialog-header",className:c("flex flex-col gap-2 text-center sm:text-left",t),...s})}function de({className:t,...s}){return e.jsx("div",{"data-slot":"dialog-footer",className:c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function ce({className:t,...s}){return e.jsx(Ye,{"data-slot":"dialog-title",className:c("text-lg leading-none font-semibold",t),...s})}function ue({className:t,...s}){return e.jsx(Xe,{"data-slot":"dialog-description",className:c("text-muted-foreground text-sm",t),...s})}function je({...t}){return e.jsx(Yt,{"data-slot":"select",...t})}function be({...t}){return e.jsx(Zt,{"data-slot":"select-value",...t})}function ve({className:t,size:s="default",children:a,...n}){return e.jsxs(Xt,{"data-slot":"select-trigger","data-size":s,className:c("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[a,e.jsx(Qt,{asChild:!0,children:e.jsx(Ne,{className:"size-4 opacity-50"})})]})}function we({className:t,children:s,position:a="popper",...n}){return e.jsx(es,{children:e.jsxs(ts,{"data-slot":"select-content",className:c("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...n,children:[e.jsx($a,{}),e.jsx(ss,{className:c("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:s}),e.jsx(Ra,{})]})})}function Y({className:t,children:s,...a}){return e.jsxs(as,{"data-slot":"select-item",className:c("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(ns,{children:e.jsx(re,{className:"size-4"})})}),e.jsx(rs,{children:s})]})}function $a({className:t,...s}){return e.jsx(is,{"data-slot":"select-scroll-up-button",className:c("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Es,{className:"size-4"})})}function Ra({className:t,...s}){return e.jsx(os,{"data-slot":"select-scroll-down-button",className:c("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Ne,{className:"size-4"})})}function Pa(t){const s=t?.user_id??t?.UserID??t?.user?.id??t?.User?.ID??"",a=t?.email??t?.Email??t?.user?.email??t?.User?.Email,n=t?.name??t?.Name??t?.user?.name??t?.User?.Name,o=t?.role??t?.Role??"member",l=t?.created_at??t?.CreatedAt;return{userId:String(s),email:a,name:n,role:String(o),joinedAt:l}}const Va=K({email:X("Enter a valid email"),role:ye(["member","admin"])}),Ba=()=>{const[t,s]=u.useState(!0),[a,n]=u.useState([]),[o,l]=u.useState(null),[x,m]=u.useState(!1),[j,f]=u.useState(!1),[b,y]=u.useState(null),w=u.useMemo(()=>V(),[]),v=U({resolver:H(Va),defaultValues:{email:"",role:"member"},mode:"onChange"});async function M(){try{const i=await O.get("/api/v1/auth/me");l(i)}catch{}}async function F(i){if(!i){n([]),s(!1);return}s(!0);try{const r=await O.get("/api/v1/orgs/members");n((r??[]).map(Pa))}catch(r){const h=r instanceof D?r.message:"Failed to load members";p.error(h)}finally{s(!1)}}u.useEffect(()=>{M(),F(w)},[w]),u.useEffect(()=>{const i=()=>void F(V()),r=h=>{h.key==="active_org_id"&&i()};return window.addEventListener(W,i),window.addEventListener("storage",r),()=>{window.removeEventListener(W,i),window.removeEventListener("storage",r)}},[]);async function q(i){const r=V();if(!r){p.error("Select an organization first");return}try{f(!0),await O.post("/api/v1/orgs/invite",i),p.success(`Invited ${i.email}`),m(!1),v.reset({email:"",role:"member"}),F(r)}catch(h){const _=h instanceof D?h.message:"Failed to invite member";p.error(_)}finally{f(!1)}}async function d(i){const r=V();if(!r){p.error("Select an organization first");return}try{y(i),await O.delete(`/api/v1/orgs/members/${i}`,{headers:{"X-Org-ID":r}}),n(h=>h.filter(_=>_.userId!==i)),p.success("Member removed")}catch(h){const _=h instanceof D?h.message:"Failed to remove member";p.error(_)}finally{y(null)}}return t?e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Members"}),e.jsxs(g,{disabled:!0,children:[e.jsx(Re,{className:"mr-2 h-4 w-4"}),"Invite"]})]}),e.jsx(Z,{}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((i,r)=>e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(B,{className:"h-5 w-40"})}),e.jsxs(L,{className:"space-y-2",children:[e.jsx(B,{className:"h-4 w-56"}),e.jsx(B,{className:"h-4 w-40"})]}),e.jsx(ae,{children:e.jsx(B,{className:"h-9 w-24"})})]},r))})]}):V()?e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Members"}),e.jsxs(ie,{open:x,onOpenChange:m,children:[e.jsx(La,{asChild:!0,children:e.jsxs(g,{children:[e.jsx(Re,{className:"mr-2 h-4 w-4"}),"Invite"]})}),e.jsxs(oe,{className:"sm:max-w-[520px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Invite member"}),e.jsx(ue,{children:"Send an invite to join this organization."})]}),e.jsx(G,{...v,children:e.jsxs("form",{onSubmit:v.handleSubmit(q),className:"grid gap-4 py-2",children:[e.jsx(S,{control:v.control,name:"email",render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(z,{type:"email",placeholder:"jane@example.com",...i})}),e.jsx(E,{})]})}),e.jsx(S,{control:v.control,name:"role",render:({field:i})=>e.jsxs(C,{children:[e.jsx(k,{children:"Role"}),e.jsxs(je,{onValueChange:i.onChange,defaultValue:i.value,children:[e.jsx(I,{children:e.jsx(ve,{className:"w-[200px]",children:e.jsx(be,{placeholder:"Select role"})})}),e.jsxs(we,{children:[e.jsx(Y,{value:"member",children:"Member"}),e.jsx(Y,{value:"admin",children:"Admin"})]})]}),e.jsx(E,{})]})}),e.jsxs(de,{className:"mt-2 flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!v.formState.isValid||j,children:j?"Sending…":"Send invite"})]})]})})]})]})]}),e.jsx(Z,{}),a.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No members yet."}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 pr-2",children:a.map(i=>{const r=o?.id&&i.userId===o.id;return e.jsxs(A,{className:"flex flex-col",children:[e.jsx(T,{children:e.jsx(P,{className:"text-base",children:i.name||i.email||i.userId})}),e.jsxs(L,{className:"text-sm text-muted-foreground space-y-1",children:[i.email&&e.jsxs("div",{children:["Email: ",i.email]}),e.jsxs("div",{children:["Role: ",i.role]}),i.joinedAt&&e.jsxs("div",{children:["Joined: ",new Date(i.joinedAt).toLocaleString()]})]}),e.jsxs(ae,{className:"mt-auto w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{}),e.jsxs(Ee,{children:[e.jsx(_e,{asChild:!0,children:e.jsxs(g,{variant:"destructive",disabled:r||b===i.userId,className:"ml-auto",children:[e.jsx(Se,{className:"h-5 w-5 mr-2"}),b===i.userId?"Removing…":"Remove"]})}),e.jsxs(Oe,{children:[e.jsxs(ze,{children:[e.jsx(Ae,{children:"Remove member?"}),e.jsxs(Te,{children:["This will remove ",e.jsx("b",{children:i.name||i.email||i.userId})," from the organization."]})]}),e.jsxs(De,{className:"sm:justify-between",children:[e.jsx(Me,{disabled:b===i.userId,children:"Cancel"}),e.jsx(Le,{asChild:!0,disabled:b===i.userId,children:e.jsx(g,{variant:"destructive",onClick:()=>d(i.userId),children:"Confirm remove"})})]})]})]})]})]},i.userId)})})]}):e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("h1",{className:"text-2xl font-bold",children:"Members"})}),e.jsx(Z,{}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No organization selected. Choose an organization to manage its members."})]})},Ua=K({name:$().min(2).max(100),slug:$().min(2).max(50).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/,"Use lowercase letters, numbers, and hyphens.")}),Ha=()=>{const[t,s]=u.useState([]),[a,n]=u.useState(!0),[o,l]=u.useState(!1),[x,m]=u.useState(null),[j,f]=u.useState(null),b=u.useRef(!1),y=U({resolver:H(Ua),mode:"onChange",defaultValues:{name:"",slug:""}}),w=y.watch("name");u.useEffect(()=>{b.current||y.setValue("slug",Pe(w||""),{shouldValidate:!0})},[w,y]);const v=async()=>{n(!0);try{const d=await O.get("/api/v1/orgs");s(d),l(d.length===0)}catch(d){const i=d instanceof D?d.message:"Failed to load organizations";p.error(i)}finally{n(!1)}};u.useEffect(()=>{m(V()),v();const d=h=>{h.key==="active_org_id"&&m(h.newValue)};window.addEventListener("storage",d);const i=h=>{const _=h.detail??null;m(_)};window.addEventListener(W,i);const r=()=>void v();return window.addEventListener(se,r),()=>{window.removeEventListener("storage",d),window.removeEventListener(W,i),window.removeEventListener(se,r)}},[]);async function M(d){try{const i=await O.post("/api/v1/orgs",d);s(r=>[i,...r]),te(i.id),m(i.id),Ve(),p.success(`Created ${i.name}`),l(!1),y.reset({name:"",slug:""}),b.current=!1}catch(i){const r=i instanceof D?i.message:"Failed to create organization";p.error(r)}}function F(d){te(d.id),m(d.id),p.success(`Switched to ${d.name}`)}async function q(d){try{f(d.id),await O.delete(`/api/v1/orgs/${d.id}`),s(i=>{const r=i.filter(h=>h.id!==d.id);if(x===d.id){const h=r[0]?.id??null;te(h),m(h)}return r}),Ve(),p.success(`Deleted ${d.name}`)}catch(i){const r=i instanceof D?i.message:"Failed to delete organization";p.error(r)}finally{f(null)}}return a?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:e.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Organizations"})}),e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((d,i)=>e.jsxs(A,{children:[e.jsx(T,{children:e.jsx(B,{className:"h-5 w-40"})}),e.jsxs(L,{children:[e.jsx(B,{className:"mb-2 h-4 w-24"}),e.jsx(B,{className:"h-4 w-48"})]}),e.jsx(ae,{children:e.jsx(B,{className:"h-9 w-24"})})]},i))})]}):e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Organizations"}),e.jsx(g,{onClick:()=>l(!0),children:"New organization"})]}),e.jsx(Z,{}),t.length===0?e.jsx("div",{className:"text-muted-foreground text-sm",children:"No organizations yet."}):e.jsx("div",{className:"grid grid-cols-1 gap-4 pr-2 sm:grid-cols-2 lg:grid-cols-3",children:t.map(d=>e.jsxs(A,{className:"flex flex-col",children:[e.jsx(T,{children:e.jsx(P,{className:"text-base",children:d.name})}),e.jsxs(L,{className:"text-muted-foreground text-sm",children:[e.jsxs("div",{children:["Slug: ",d.slug]}),e.jsxs("div",{className:"mt-1",children:["ID: ",d.id]})]}),e.jsxs(ae,{className:"mt-auto w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{onClick:()=>F(d),children:d.id===x?"Selected":"Select"}),e.jsxs(Ee,{children:[e.jsx(_e,{asChild:!0,children:e.jsxs(g,{variant:"destructive",className:"ml-auto",disabled:j===d.id,children:[e.jsx(Se,{className:"mr-2 h-5 w-5"}),j===d.id?"Deleting…":"Delete"]})}),e.jsxs(Oe,{children:[e.jsxs(ze,{children:[e.jsx(Ae,{children:"Delete organization?"}),e.jsxs(Te,{children:["This will permanently delete ",e.jsx("b",{children:d.name}),". This action cannot be undone."]})]}),e.jsxs(De,{className:"sm:justify-between",children:[e.jsx(Me,{disabled:j===d.id,children:"Cancel"}),e.jsx(Le,{asChild:!0,disabled:j===d.id,children:e.jsx(g,{variant:"destructive",onClick:()=>q(d),children:"Confirm delete"})})]})]})]})]})]},d.id))}),e.jsx(ie,{open:o,onOpenChange:l,children:e.jsxs(oe,{className:"sm:max-w-[480px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Create organization"}),e.jsx(ue,{children:"Set a name and a URL-friendly slug."})]}),e.jsx(G,{...y,children:e.jsxs("form",{onSubmit:y.handleSubmit(M),className:"space-y-4",children:[e.jsx(S,{control:y.control,name:"name",render:({field:d})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(z,{placeholder:"Acme Inc",autoFocus:!0,...d})}),e.jsx(Ue,{children:"This is your organization’s display name."}),e.jsx(E,{})]})}),e.jsx(S,{control:y.control,name:"slug",render:({field:d})=>e.jsxs(C,{children:[e.jsx(k,{children:"Slug"}),e.jsx(I,{children:e.jsx(z,{placeholder:"acme-inc",...d,onChange:i=>{b.current=!0,d.onChange(i)},onBlur:i=>{const r=Pe(i.target.value);y.setValue("slug",r,{shouldValidate:!0}),d.onBlur()}})}),e.jsx(Ue,{children:"Lowercase, numbers and hyphens only."}),e.jsx(E,{})]})}),e.jsxs(de,{className:"flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>{y.reset(),l(!1),b.current=!1},children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!y.formState.isValid||y.formState.isSubmitting,children:y.formState.isSubmitting?"Creating...":"Create"})]})]})})]})})]})};function Ga(){return e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"403 — Forbidden"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don’t have access to this area."})]})}function Ka({children:t}){const[s,a]=u.useState(!0),[n,o]=u.useState(!1),l=xe();return u.useEffect(()=>{let x=!0;return(async()=>{try{const m=await R.me();if(!x)return;o(lt(m))}catch{if(!x)return;o(!1)}finally{if(!x)return;a(!1)}})(),()=>{x=!1}},[]),s?null:n?t?e.jsx(e.Fragment,{children:t}):e.jsx(Ce,{}):e.jsx(ke,{to:"/403",replace:!0,state:{from:l}})}const qa=K({name:$().min(1,"Name required"),email:X("Enter a valid email"),role:ye(["user","admin"]),password:$().min(8,"Min 8 characters")}),Ja=K({name:$().min(1,"Name required"),email:X("Enter a valid email"),role:ye(["user","admin"]),password:$().min(8,"Min 8 characters").optional().or(vt(""))});function Wa(){const[t,s]=u.useState([]),[a,n]=u.useState(!0),[o,l]=u.useState(!1),[x,m]=u.useState(!1),[j,f]=u.useState(null),[b,y]=u.useState(null),w=U({resolver:H(qa),mode:"onChange",defaultValues:{name:"",email:"",role:"user",password:""}}),v=U({resolver:H(Ja),mode:"onChange",defaultValues:{name:"",email:"",role:"user",password:""}});async function M(){n(!0);try{const r=await O.get("/api/v1/admin/users?page=1&page_size=100");s(r.users??[])}catch(r){p.error(r instanceof D?r.message:"Failed to load users")}finally{n(!1)}}u.useEffect(()=>{M()},[]);async function F(r){try{const h=await O.post("/api/v1/admin/users",r);s(_=>[h,..._]),l(!1),w.reset({name:"",email:"",role:"user",password:""}),p.success(`Created ${h.email}`)}catch(h){p.error(h instanceof D?h.message:"Failed to create user")}}function q(r){f(r),v.reset({name:r.name||"",email:r.email,role:r.role??"user",password:""}),m(!0)}async function d(r){if(!j)return;const h={name:r.name,email:r.email,role:r.role};r.password&&r.password.length>=8&&(h.password=r.password);try{const _=await O.patch(`/api/v1/admin/users/${j.id}`,h);s(xt=>xt.map(Fe=>Fe.id===_.id?_:Fe)),m(!1),f(null),p.success(`Updated ${_.email}`)}catch(_){p.error(_ instanceof D?_.message:"Failed to update user")}}async function i(r){try{y(r),await O.delete(`/api/v1/admin/users/${r}`),s(h=>h.filter(_=>_.id!==r)),p.success("User deleted")}catch(h){p.error(h instanceof D?h.message:"Failed to delete user")}finally{y(null)}}return e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Users"}),e.jsxs(g,{onClick:()=>l(!0),children:[e.jsx(_s,{className:"mr-2 h-4 w-4"}),"New user"]})]}),e.jsx(Z,{}),a?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading…"}):t.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No users yet."}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 pr-2",children:t.map(r=>e.jsxs(A,{className:"flex flex-col",children:[e.jsx(T,{children:e.jsx(P,{className:"text-base",children:r.name||r.email})}),e.jsxs(L,{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("div",{children:["Email: ",r.email]}),e.jsxs("div",{children:["Role: ",r.role]}),e.jsxs("div",{children:["Verified: ",r.email_verified?"Yes":"No"]}),e.jsxs("div",{children:["Joined: ",new Date(r.created_at).toLocaleString()]})]}),e.jsxs(ae,{className:"mt-auto w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(g,{variant:"outline",onClick:()=>q(r),children:[e.jsx(Os,{className:"mr-2 h-4 w-4"})," Edit"]}),e.jsxs(Ee,{children:[e.jsx(_e,{asChild:!0,children:e.jsxs(g,{variant:"destructive",disabled:b===r.id,children:[e.jsx(Se,{className:"mr-2 h-4 w-4"}),b===r.id?"Deleting…":"Delete"]})}),e.jsxs(Oe,{children:[e.jsxs(ze,{children:[e.jsx(Ae,{children:"Delete user?"}),e.jsxs(Te,{children:["This will permanently delete ",e.jsx("b",{children:r.email}),"."]})]}),e.jsxs(De,{className:"sm:justify-between",children:[e.jsx(Me,{disabled:b===r.id,children:"Cancel"}),e.jsx(Le,{asChild:!0,disabled:b===r.id,children:e.jsx(g,{variant:"destructive",onClick:()=>i(r.id),children:"Confirm delete"})})]})]})]})]})]},r.id))}),e.jsx(ie,{open:o,onOpenChange:l,children:e.jsxs(oe,{className:"sm:max-w-[520px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Create user"}),e.jsx(ue,{children:"Add a new user account."})]}),e.jsx(G,{...w,children:e.jsxs("form",{onSubmit:w.handleSubmit(F),className:"grid gap-4 py-2",children:[e.jsx(S,{name:"name",control:w.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(z,{...r,placeholder:"Jane Doe"})}),e.jsx(E,{})]})}),e.jsx(S,{name:"email",control:w.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(z,{type:"email",...r,placeholder:"jane@example.com"})}),e.jsx(E,{})]})}),e.jsx(S,{name:"role",control:w.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Role"}),e.jsxs(je,{value:r.value,onValueChange:r.onChange,children:[e.jsx(I,{children:e.jsx(ve,{className:"w-[200px]",children:e.jsx(be,{placeholder:"Select role"})})}),e.jsxs(we,{children:[e.jsx(Y,{value:"user",children:"User"}),e.jsx(Y,{value:"admin",children:"Admin"})]})]}),e.jsx(E,{})]})}),e.jsx(S,{name:"password",control:w.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Password"}),e.jsx(I,{children:e.jsx(z,{type:"password",...r,placeholder:"••••••••"})}),e.jsx(E,{})]})}),e.jsxs(de,{className:"mt-2 flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!w.formState.isValid||w.formState.isSubmitting,children:w.formState.isSubmitting?"Creating…":"Create"})]})]})})]})}),e.jsx(ie,{open:x,onOpenChange:m,children:e.jsxs(oe,{className:"sm:max-w-[520px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit user"}),e.jsx(ue,{children:"Update user details. Leave password blank to keep it unchanged."})]}),e.jsx(G,{...v,children:e.jsxs("form",{onSubmit:v.handleSubmit(d),className:"grid gap-4 py-2",children:[e.jsx(S,{name:"name",control:v.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Name"}),e.jsx(I,{children:e.jsx(z,{...r})}),e.jsx(E,{})]})}),e.jsx(S,{name:"email",control:v.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Email"}),e.jsx(I,{children:e.jsx(z,{type:"email",...r})}),e.jsx(E,{})]})}),e.jsx(S,{name:"role",control:v.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"Role"}),e.jsxs(je,{value:r.value,onValueChange:r.onChange,children:[e.jsx(I,{children:e.jsx(ve,{className:"w-[200px]",children:e.jsx(be,{placeholder:"Select role"})})}),e.jsxs(we,{children:[e.jsx(Y,{value:"user",children:"User"}),e.jsx(Y,{value:"admin",children:"Admin"})]})]}),e.jsx(E,{})]})}),e.jsx(S,{name:"password",control:v.control,render:({field:r})=>e.jsxs(C,{children:[e.jsx(k,{children:"New password (optional)"}),e.jsx(I,{children:e.jsx(z,{type:"password",...r,placeholder:"Leave blank to keep"})}),e.jsx(E,{})]})}),e.jsxs(de,{className:"mt-2 flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!v.formState.isValid||v.formState.isSubmitting,children:v.formState.isSubmitting?"Saving…":"Save changes"})]})]})})]})})]})}function Ya(){return e.jsxs(zs,{children:[e.jsx(N,{path:"/403",element:e.jsx(Ga,{})}),e.jsx(N,{path:"/",element:e.jsx(ke,{to:"/auth/login",replace:!0})}),e.jsxs(N,{path:"/auth",children:[e.jsx(N,{path:"login",element:e.jsx(ka,{})}),e.jsx(N,{path:"register",element:e.jsx(_a,{})}),e.jsx(N,{path:"forgot",element:e.jsx(Sa,{})}),e.jsx(N,{path:"reset",element:e.jsx(za,{})}),e.jsx(N,{path:"verify",element:e.jsx(Da,{})})]}),e.jsx(N,{element:e.jsx(wa,{}),children:e.jsxs(N,{element:e.jsx(va,{}),children:[e.jsx(N,{element:e.jsx(Ka,{}),children:e.jsx(N,{path:"/admin",children:e.jsx(N,{path:"users",element:e.jsx(Wa,{})})})}),e.jsx(N,{path:"/core"}),e.jsx(N,{path:"/security"}),e.jsxs(N,{path:"/settings",children:[e.jsx(N,{path:"orgs",element:e.jsx(Ha,{})}),e.jsx(N,{path:"members",element:e.jsx(Ba,{})}),e.jsx(N,{path:"me",element:e.jsx(Ia,{})})]}),e.jsx(N,{path:"*",element:e.jsx(He,{})})]})}),e.jsx(N,{path:"*",element:e.jsx(He,{})})]})}const Xa=({...t})=>{const{theme:s="system"}=Ke();return e.jsx(wt,{theme:s,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})};function Qa({children:t,defaultTheme:s="system",storageKey:a="vite-ui-theme"}){return e.jsx(yt,{attribute:"class",defaultTheme:s,enableSystem:!0,storageKey:a,disableTransitionOnChange:!0,children:t})}Nt.createRoot(document.getElementById("root")).render(e.jsx(u.StrictMode,{children:e.jsx(Ds,{children:e.jsxs(Qa,{defaultTheme:"system",storageKey:"dragon-theme",children:[e.jsx(Ya,{}),e.jsx(Xa,{richColors:!0,position:"top-right"})]})})})); diff --git a/internal/ui/dist/assets/radix-DN_DrUzo.js b/internal/ui/dist/assets/radix-9eRs70j8.js similarity index 73% rename from internal/ui/dist/assets/radix-DN_DrUzo.js rename to internal/ui/dist/assets/radix-9eRs70j8.js index 6bf8067..0209055 100644 --- a/internal/ui/dist/assets/radix-DN_DrUzo.js +++ b/internal/ui/dist/assets/radix-9eRs70j8.js @@ -1,11 +1,11 @@ -import{r as s,j as l,a as xt,b as on,c as Sr,h as wt,d as Ct,u as br,o as Rr,s as Pr,f as _r,e as Tr,g as Ir,i as Mr,l as Ar,k as Dr,R as me}from"./vendor-Cnbx_Mrt.js";function Vt(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ge(...e){return n=>{let t=!1;const o=e.map(r=>{const a=Vt(r,n);return!t&&typeof a=="function"&&(t=!0),a});if(t)return()=>{for(let r=0;r{const{children:a,...i}=o,c=s.Children.toArray(a),u=c.find(Or);if(u){const d=u.props.children,f=c.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(n,{...i,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(n,{...i,ref:r,children:a})});return t.displayName=`${e}.Slot`,t}var vc=ge("Slot");function Nr(e){const n=s.forwardRef((t,o)=>{const{children:r,...a}=t;if(s.isValidElement(r)){const i=Lr(r),c=jr(a,r.props);return r.type!==s.Fragment&&(c.ref=o?Ge(o,i):i),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var rn=Symbol("radix.slottable");function sn(e){const n=({children:t})=>l.jsx(l.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=rn,n}function Or(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rn}function jr(e,n){const t={...n};for(const o in n){const r=e[o],a=n[o];/^on[A-Z]/.test(o)?r&&a?t[o]=(...c)=>{const u=a(...c);return r(...c),u}:r&&(t[o]=r):o==="style"?t[o]={...r,...a}:o==="className"&&(t[o]=[r,a].filter(Boolean).join(" "))}return{...e,...t}}function Lr(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var Fr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_=Fr.reduce((e,n)=>{const t=ge(`Primitive.${n}`),o=s.forwardRef((r,a)=>{const{asChild:i,...c}=r,u=i?t:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:a})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function an(e,n){e&&xt.flushSync(()=>e.dispatchEvent(n))}var kr="Separator",zt="horizontal",$r=["horizontal","vertical"],cn=s.forwardRef((e,n)=>{const{decorative:t,orientation:o=zt,...r}=e,a=Br(o)?o:zt,c=t?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return l.jsx(_.div,{"data-orientation":a,...c,...r,ref:n})});cn.displayName=kr;function Br(e){return $r.includes(e)}var mc=cn;function E(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(e?.(r),t===!1||!r.defaultPrevented)return n?.(r)}}function Ur(e,n){const t=s.createContext(n),o=a=>{const{children:i,...c}=a,u=s.useMemo(()=>c,Object.values(c));return l.jsx(t.Provider,{value:u,children:i})};o.displayName=e+"Provider";function r(a){const i=s.useContext(t);if(i)return i;if(n!==void 0)return n;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function ie(e,n=[]){let t=[];function o(a,i){const c=s.createContext(i),u=t.length;t=[...t,i];const d=p=>{const{scope:g,children:h,...w}=p,v=g?.[e]?.[u]||c,m=s.useMemo(()=>w,Object.values(w));return l.jsx(v.Provider,{value:m,children:h})};d.displayName=a+"Provider";function f(p,g){const h=g?.[e]?.[u]||c,w=s.useContext(h);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=t.map(i=>s.createContext(i));return function(c){const u=c?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[o,Hr(r,...n)]}function Hr(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const i=o.reduce((c,{useScope:u,scopeName:d})=>{const p=u(a)[`__scope${d}`];return{...c,...p}},{});return s.useMemo(()=>({[`__scope${n.scopeName}`]:i}),[i])}};return t.scopeName=n.scopeName,t}var K=globalThis?.document?s.useLayoutEffect:()=>{},Gr=on[" useId ".trim().toString()]||(()=>{}),Kr=0;function oe(e){const[n,t]=s.useState(Gr());return K(()=>{t(o=>o??String(Kr++))},[e]),e||(n?`radix-${n}`:"")}var Wr=on[" useInsertionEffect ".trim().toString()]||K;function he({prop:e,defaultProp:n,onChange:t=()=>{},caller:o}){const[r,a,i]=Vr({defaultProp:n,onChange:t}),c=e!==void 0,u=c?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const d=s.useCallback(f=>{if(c){const p=zr(f)?f(e):f;p!==e&&i.current?.(p)}else a(f)},[c,e,a,i]);return[u,d]}function Vr({defaultProp:e,onChange:n}){const[t,o]=s.useState(e),r=s.useRef(t),a=s.useRef(n);return Wr(()=>{a.current=n},[n]),s.useEffect(()=>{r.current!==t&&(a.current?.(t),r.current=t)},[t,r]),[t,o,a]}function zr(e){return typeof e=="function"}function ae(e){const n=s.useRef(e);return s.useEffect(()=>{n.current=e}),s.useMemo(()=>(...t)=>n.current?.(...t),[])}function Yr(e,n=globalThis?.document){const t=ae(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&t(r)};return n.addEventListener("keydown",o,{capture:!0}),()=>n.removeEventListener("keydown",o,{capture:!0})},[t,n])}var Xr="DismissableLayer",ct="dismissableLayer.update",qr="dismissableLayer.pointerDownOutside",Zr="dismissableLayer.focusOutside",Yt,ln=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),De=s.forwardRef((e,n)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:c,...u}=e,d=s.useContext(ln),[f,p]=s.useState(null),g=f?.ownerDocument??globalThis?.document,[,h]=s.useState({}),w=M(n,P=>p(P)),v=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=v.indexOf(m),x=f?v.indexOf(f):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,b=x>=C,I=es(P=>{const T=P.target,k=[...d.branches].some(F=>F.contains(T));!b||k||(r?.(P),i?.(P),P.defaultPrevented||c?.())},g),O=ts(P=>{const T=P.target;[...d.branches].some(F=>F.contains(T))||(a?.(P),i?.(P),P.defaultPrevented||c?.())},g);return Yr(P=>{x===d.layers.size-1&&(o?.(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},g),s.useEffect(()=>{if(f)return t&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yt=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Xt(),()=>{t&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Yt)}},[f,g,t,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Xt())},[f,d]),s.useEffect(()=>{const P=()=>h({});return document.addEventListener(ct,P),()=>document.removeEventListener(ct,P)},[]),l.jsx(_.div,{...u,ref:w,style:{pointerEvents:y?b?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,O.onFocusCapture),onBlurCapture:E(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,I.onPointerDownCapture)})});De.displayName=Xr;var Jr="DismissableLayerBranch",Qr=s.forwardRef((e,n)=>{const t=s.useContext(ln),o=s.useRef(null),r=M(n,o);return s.useEffect(()=>{const a=o.current;if(a)return t.branches.add(a),()=>{t.branches.delete(a)}},[t.branches]),l.jsx(_.div,{...e,ref:r})});Qr.displayName=Jr;function es(e,n=globalThis?.document){const t=ae(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=c=>{if(c.target&&!o.current){let u=function(){un(qr,t,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",r.current),r.current=u,n.addEventListener("click",r.current,{once:!0})):u()}else n.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{n.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),n.removeEventListener("pointerdown",a),n.removeEventListener("click",r.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function ts(e,n=globalThis?.document){const t=ae(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&un(Zr,t,{originalEvent:a},{discrete:!1})};return n.addEventListener("focusin",r),()=>n.removeEventListener("focusin",r)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Xt(){const e=new CustomEvent(ct);document.dispatchEvent(e)}function un(e,n,t,{discrete:o}){const r=t.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&r.addEventListener(e,n,{once:!0}),o?an(r,a):r.dispatchEvent(a)}var rt="focusScope.autoFocusOnMount",st="focusScope.autoFocusOnUnmount",qt={bubbles:!1,cancelable:!0},ns="FocusScope",Ke=s.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...i}=e,[c,u]=s.useState(null),d=ae(r),f=ae(a),p=s.useRef(null),g=M(n,v=>u(v)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let v=function(y){if(h.paused||!c)return;const b=y.target;c.contains(b)?p.current=b:de(p.current,{select:!0})},m=function(y){if(h.paused||!c)return;const b=y.relatedTarget;b!==null&&(c.contains(b)||de(p.current,{select:!0}))},C=function(y){if(document.activeElement===document.body)for(const I of y)I.removedNodes.length>0&&de(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const x=new MutationObserver(C);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),x.disconnect()}}},[o,c,h.paused]),s.useEffect(()=>{if(c){Jt.add(h);const v=document.activeElement;if(!c.contains(v)){const C=new CustomEvent(rt,qt);c.addEventListener(rt,d),c.dispatchEvent(C),C.defaultPrevented||(os(cs(dn(c)),{select:!0}),document.activeElement===v&&de(c))}return()=>{c.removeEventListener(rt,d),setTimeout(()=>{const C=new CustomEvent(st,qt);c.addEventListener(st,f),c.dispatchEvent(C),C.defaultPrevented||de(v??document.body,{select:!0}),c.removeEventListener(st,f),Jt.remove(h)},0)}}},[c,d,f,h]);const w=s.useCallback(v=>{if(!t&&!o||h.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,C=document.activeElement;if(m&&C){const x=v.currentTarget,[y,b]=rs(x);y&&b?!v.shiftKey&&C===b?(v.preventDefault(),t&&de(y,{select:!0})):v.shiftKey&&C===y&&(v.preventDefault(),t&&de(b,{select:!0})):C===x&&v.preventDefault()}},[t,o,h.paused]);return l.jsx(_.div,{tabIndex:-1,...i,ref:g,onKeyDown:w})});Ke.displayName=ns;function os(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(de(o,{select:n}),document.activeElement!==t)return}function rs(e){const n=dn(e),t=Zt(n,e),o=Zt(n.reverse(),e);return[t,o]}function dn(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Zt(e,n){for(const t of e)if(!ss(t,{upTo:n}))return t}function ss(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function as(e){return e instanceof HTMLInputElement&&"select"in e}function de(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&as(e)&&n&&e.select()}}var Jt=is();function is(){let e=[];return{add(n){const t=e[0];n!==t&&t?.pause(),e=Qt(e,n),e.unshift(n)},remove(n){e=Qt(e,n),e[0]?.resume()}}}function Qt(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function cs(e){return e.filter(n=>n.tagName!=="A")}var ls="Portal",Ne=s.forwardRef((e,n)=>{const{container:t,...o}=e,[r,a]=s.useState(!1);K(()=>a(!0),[]);const i=t||r&&globalThis?.document?.body;return i?Sr.createPortal(l.jsx(_.div,{...o,ref:n}),i):null});Ne.displayName=ls;function us(e,n){return s.useReducer((t,o)=>n[t][o]??t,e)}var re=e=>{const{present:n,children:t}=e,o=ds(n),r=typeof t=="function"?t({present:o.isPresent}):s.Children.only(t),a=M(o.ref,fs(r));return typeof t=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};re.displayName="Presence";function ds(e){const[n,t]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[c,u]=us(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=ke(o.current);a.current=c==="mounted"?d:"none"},[c]),K(()=>{const d=o.current,f=r.current;if(f!==e){const g=a.current,h=ke(d);e?u("MOUNT"):h==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&g!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),K(()=>{if(n){let d;const f=n.ownerDocument.defaultView??window,p=h=>{const v=ke(o.current).includes(CSS.escape(h.animationName));if(h.target===n&&v&&(u("ANIMATION_END"),!r.current)){const m=n.style.animationFillMode;n.style.animationFillMode="forwards",d=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=m)})}},g=h=>{h.target===n&&(a.current=ke(o.current))};return n.addEventListener("animationstart",g),n.addEventListener("animationcancel",p),n.addEventListener("animationend",p),()=>{f.clearTimeout(d),n.removeEventListener("animationstart",g),n.removeEventListener("animationcancel",p),n.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(d=>{o.current=d?getComputedStyle(d):null,t(d)},[])}}function ke(e){return e?.animationName||"none"}function fs(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var at=0;function yt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??en()),document.body.insertAdjacentElement("beforeend",e[1]??en()),at++,()=>{at===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),at--}},[])}function en(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var We="Dialog",[fn,pn]=ie(We),[ps,se]=fn(We),vn=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,f]=he({prop:o,defaultProp:r??!1,onChange:a,caller:We});return l.jsx(ps,{scope:n,triggerRef:c,contentRef:u,contentId:oe(),titleId:oe(),descriptionId:oe(),open:d,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(p=>!p),[f]),modal:i,children:t})};vn.displayName=We;var mn="DialogTrigger",gn=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(mn,t),a=M(n,r.triggerRef);return l.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":bt(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)})});gn.displayName=mn;var Et="DialogPortal",[vs,hn]=fn(Et,{forceMount:void 0}),xn=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:r}=e,a=se(Et,n);return l.jsx(vs,{scope:n,forceMount:t,children:s.Children.map(o,i=>l.jsx(re,{present:t||a.open,children:l.jsx(Ne,{asChild:!0,container:r,children:i})}))})};xn.displayName=Et;var $e="DialogOverlay",wn=s.forwardRef((e,n)=>{const t=hn($e,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=se($e,e.__scopeDialog);return a.modal?l.jsx(re,{present:o||a.open,children:l.jsx(gs,{...r,ref:n})}):null});wn.displayName=$e;var ms=ge("DialogOverlay.RemoveScroll"),gs=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se($e,t);return l.jsx(Ct,{as:ms,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(_.div,{"data-state":bt(r.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),xe="DialogContent",Cn=s.forwardRef((e,n)=>{const t=hn(xe,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=se(xe,e.__scopeDialog);return l.jsx(re,{present:o||a.open,children:a.modal?l.jsx(hs,{...r,ref:n}):l.jsx(xs,{...r,ref:n})})});Cn.displayName=xe;var hs=s.forwardRef((e,n)=>{const t=se(xe,e.__scopeDialog),o=s.useRef(null),r=M(n,t.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return wt(a)},[]),l.jsx(yn,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{a.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault())})}),xs=s.forwardRef((e,n)=>{const t=se(xe,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return l.jsx(yn,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||t.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;t.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),yn=s.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,c=se(xe,t),u=s.useRef(null),d=M(n,u);return yt(),l.jsxs(l.Fragment,{children:[l.jsx(Ke,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:l.jsx(De,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":bt(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Cs,{titleId:c.titleId}),l.jsx(Es,{contentRef:u,descriptionId:c.descriptionId})]})]})}),St="DialogTitle",En=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(St,t);return l.jsx(_.h2,{id:r.titleId,...o,ref:n})});En.displayName=St;var Sn="DialogDescription",bn=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(Sn,t);return l.jsx(_.p,{id:r.descriptionId,...o,ref:n})});bn.displayName=Sn;var Rn="DialogClose",Pn=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(Rn,t);return l.jsx(_.button,{type:"button",...o,ref:n,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Pn.displayName=Rn;function bt(e){return e?"open":"closed"}var _n="DialogTitleWarning",[ws,Tn]=Ur(_n,{contentName:xe,titleName:St,docsSlug:"dialog"}),Cs=({titleId:e})=>{const n=Tn(_n),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users. +import{r as s,j as l,a as xt,b as on,c as Sr,h as wt,d as Ct,u as br,o as Rr,s as Pr,f as _r,e as Tr,g as Ir,i as Mr,l as Ar,k as Dr,R as me}from"./vendor-D1z0LlOQ.js";function Vt(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ge(...e){return n=>{let t=!1;const o=e.map(r=>{const a=Vt(r,n);return!t&&typeof a=="function"&&(t=!0),a});if(t)return()=>{for(let r=0;r{const{children:a,...i}=o,c=s.Children.toArray(a),u=c.find(Or);if(u){const d=u.props.children,f=c.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(n,{...i,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(n,{...i,ref:r,children:a})});return t.displayName=`${e}.Slot`,t}var vc=ge("Slot");function Nr(e){const n=s.forwardRef((t,o)=>{const{children:r,...a}=t;if(s.isValidElement(r)){const i=Lr(r),c=jr(a,r.props);return r.type!==s.Fragment&&(c.ref=o?Ge(o,i):i),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var rn=Symbol("radix.slottable");function sn(e){const n=({children:t})=>l.jsx(l.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=rn,n}function Or(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rn}function jr(e,n){const t={...n};for(const o in n){const r=e[o],a=n[o];/^on[A-Z]/.test(o)?r&&a?t[o]=(...c)=>{const u=a(...c);return r(...c),u}:r&&(t[o]=r):o==="style"?t[o]={...r,...a}:o==="className"&&(t[o]=[r,a].filter(Boolean).join(" "))}return{...e,...t}}function Lr(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var Fr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_=Fr.reduce((e,n)=>{const t=ge(`Primitive.${n}`),o=s.forwardRef((r,a)=>{const{asChild:i,...c}=r,u=i?t:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:a})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function an(e,n){e&&xt.flushSync(()=>e.dispatchEvent(n))}var kr="Separator",zt="horizontal",$r=["horizontal","vertical"],cn=s.forwardRef((e,n)=>{const{decorative:t,orientation:o=zt,...r}=e,a=Br(o)?o:zt,c=t?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return l.jsx(_.div,{"data-orientation":a,...c,...r,ref:n})});cn.displayName=kr;function Br(e){return $r.includes(e)}var mc=cn;function E(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(e?.(r),t===!1||!r.defaultPrevented)return n?.(r)}}function Ur(e,n){const t=s.createContext(n),o=a=>{const{children:i,...c}=a,u=s.useMemo(()=>c,Object.values(c));return l.jsx(t.Provider,{value:u,children:i})};o.displayName=e+"Provider";function r(a){const i=s.useContext(t);if(i)return i;if(n!==void 0)return n;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function ie(e,n=[]){let t=[];function o(a,i){const c=s.createContext(i),u=t.length;t=[...t,i];const d=p=>{const{scope:g,children:h,...w}=p,v=g?.[e]?.[u]||c,m=s.useMemo(()=>w,Object.values(w));return l.jsx(v.Provider,{value:m,children:h})};d.displayName=a+"Provider";function f(p,g){const h=g?.[e]?.[u]||c,w=s.useContext(h);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=t.map(i=>s.createContext(i));return function(c){const u=c?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[o,Hr(r,...n)]}function Hr(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const i=o.reduce((c,{useScope:u,scopeName:d})=>{const p=u(a)[`__scope${d}`];return{...c,...p}},{});return s.useMemo(()=>({[`__scope${n.scopeName}`]:i}),[i])}};return t.scopeName=n.scopeName,t}var K=globalThis?.document?s.useLayoutEffect:()=>{},Gr=on[" useId ".trim().toString()]||(()=>{}),Kr=0;function oe(e){const[n,t]=s.useState(Gr());return K(()=>{t(o=>o??String(Kr++))},[e]),e||(n?`radix-${n}`:"")}var Wr=on[" useInsertionEffect ".trim().toString()]||K;function he({prop:e,defaultProp:n,onChange:t=()=>{},caller:o}){const[r,a,i]=Vr({defaultProp:n,onChange:t}),c=e!==void 0,u=c?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const d=s.useCallback(f=>{if(c){const p=zr(f)?f(e):f;p!==e&&i.current?.(p)}else a(f)},[c,e,a,i]);return[u,d]}function Vr({defaultProp:e,onChange:n}){const[t,o]=s.useState(e),r=s.useRef(t),a=s.useRef(n);return Wr(()=>{a.current=n},[n]),s.useEffect(()=>{r.current!==t&&(a.current?.(t),r.current=t)},[t,r]),[t,o,a]}function zr(e){return typeof e=="function"}function ae(e){const n=s.useRef(e);return s.useEffect(()=>{n.current=e}),s.useMemo(()=>(...t)=>n.current?.(...t),[])}function Yr(e,n=globalThis?.document){const t=ae(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&t(r)};return n.addEventListener("keydown",o,{capture:!0}),()=>n.removeEventListener("keydown",o,{capture:!0})},[t,n])}var Xr="DismissableLayer",ct="dismissableLayer.update",qr="dismissableLayer.pointerDownOutside",Zr="dismissableLayer.focusOutside",Yt,ln=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),De=s.forwardRef((e,n)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:c,...u}=e,d=s.useContext(ln),[f,p]=s.useState(null),g=f?.ownerDocument??globalThis?.document,[,h]=s.useState({}),w=M(n,P=>p(P)),v=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=v.indexOf(m),x=f?v.indexOf(f):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,b=x>=C,I=es(P=>{const T=P.target,k=[...d.branches].some(F=>F.contains(T));!b||k||(r?.(P),i?.(P),P.defaultPrevented||c?.())},g),O=ts(P=>{const T=P.target;[...d.branches].some(F=>F.contains(T))||(a?.(P),i?.(P),P.defaultPrevented||c?.())},g);return Yr(P=>{x===d.layers.size-1&&(o?.(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},g),s.useEffect(()=>{if(f)return t&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yt=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Xt(),()=>{t&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Yt)}},[f,g,t,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Xt())},[f,d]),s.useEffect(()=>{const P=()=>h({});return document.addEventListener(ct,P),()=>document.removeEventListener(ct,P)},[]),l.jsx(_.div,{...u,ref:w,style:{pointerEvents:y?b?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,O.onFocusCapture),onBlurCapture:E(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,I.onPointerDownCapture)})});De.displayName=Xr;var Jr="DismissableLayerBranch",Qr=s.forwardRef((e,n)=>{const t=s.useContext(ln),o=s.useRef(null),r=M(n,o);return s.useEffect(()=>{const a=o.current;if(a)return t.branches.add(a),()=>{t.branches.delete(a)}},[t.branches]),l.jsx(_.div,{...e,ref:r})});Qr.displayName=Jr;function es(e,n=globalThis?.document){const t=ae(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=c=>{if(c.target&&!o.current){let u=function(){un(qr,t,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",r.current),r.current=u,n.addEventListener("click",r.current,{once:!0})):u()}else n.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{n.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),n.removeEventListener("pointerdown",a),n.removeEventListener("click",r.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function ts(e,n=globalThis?.document){const t=ae(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&un(Zr,t,{originalEvent:a},{discrete:!1})};return n.addEventListener("focusin",r),()=>n.removeEventListener("focusin",r)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Xt(){const e=new CustomEvent(ct);document.dispatchEvent(e)}function un(e,n,t,{discrete:o}){const r=t.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&r.addEventListener(e,n,{once:!0}),o?an(r,a):r.dispatchEvent(a)}var rt="focusScope.autoFocusOnMount",st="focusScope.autoFocusOnUnmount",qt={bubbles:!1,cancelable:!0},ns="FocusScope",Ke=s.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...i}=e,[c,u]=s.useState(null),d=ae(r),f=ae(a),p=s.useRef(null),g=M(n,v=>u(v)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let v=function(y){if(h.paused||!c)return;const b=y.target;c.contains(b)?p.current=b:de(p.current,{select:!0})},m=function(y){if(h.paused||!c)return;const b=y.relatedTarget;b!==null&&(c.contains(b)||de(p.current,{select:!0}))},C=function(y){if(document.activeElement===document.body)for(const I of y)I.removedNodes.length>0&&de(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const x=new MutationObserver(C);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),x.disconnect()}}},[o,c,h.paused]),s.useEffect(()=>{if(c){Jt.add(h);const v=document.activeElement;if(!c.contains(v)){const C=new CustomEvent(rt,qt);c.addEventListener(rt,d),c.dispatchEvent(C),C.defaultPrevented||(os(cs(dn(c)),{select:!0}),document.activeElement===v&&de(c))}return()=>{c.removeEventListener(rt,d),setTimeout(()=>{const C=new CustomEvent(st,qt);c.addEventListener(st,f),c.dispatchEvent(C),C.defaultPrevented||de(v??document.body,{select:!0}),c.removeEventListener(st,f),Jt.remove(h)},0)}}},[c,d,f,h]);const w=s.useCallback(v=>{if(!t&&!o||h.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,C=document.activeElement;if(m&&C){const x=v.currentTarget,[y,b]=rs(x);y&&b?!v.shiftKey&&C===b?(v.preventDefault(),t&&de(y,{select:!0})):v.shiftKey&&C===y&&(v.preventDefault(),t&&de(b,{select:!0})):C===x&&v.preventDefault()}},[t,o,h.paused]);return l.jsx(_.div,{tabIndex:-1,...i,ref:g,onKeyDown:w})});Ke.displayName=ns;function os(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(de(o,{select:n}),document.activeElement!==t)return}function rs(e){const n=dn(e),t=Zt(n,e),o=Zt(n.reverse(),e);return[t,o]}function dn(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Zt(e,n){for(const t of e)if(!ss(t,{upTo:n}))return t}function ss(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function as(e){return e instanceof HTMLInputElement&&"select"in e}function de(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&as(e)&&n&&e.select()}}var Jt=is();function is(){let e=[];return{add(n){const t=e[0];n!==t&&t?.pause(),e=Qt(e,n),e.unshift(n)},remove(n){e=Qt(e,n),e[0]?.resume()}}}function Qt(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function cs(e){return e.filter(n=>n.tagName!=="A")}var ls="Portal",Ne=s.forwardRef((e,n)=>{const{container:t,...o}=e,[r,a]=s.useState(!1);K(()=>a(!0),[]);const i=t||r&&globalThis?.document?.body;return i?Sr.createPortal(l.jsx(_.div,{...o,ref:n}),i):null});Ne.displayName=ls;function us(e,n){return s.useReducer((t,o)=>n[t][o]??t,e)}var re=e=>{const{present:n,children:t}=e,o=ds(n),r=typeof t=="function"?t({present:o.isPresent}):s.Children.only(t),a=M(o.ref,fs(r));return typeof t=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};re.displayName="Presence";function ds(e){const[n,t]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[c,u]=us(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=ke(o.current);a.current=c==="mounted"?d:"none"},[c]),K(()=>{const d=o.current,f=r.current;if(f!==e){const g=a.current,h=ke(d);e?u("MOUNT"):h==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&g!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),K(()=>{if(n){let d;const f=n.ownerDocument.defaultView??window,p=h=>{const v=ke(o.current).includes(CSS.escape(h.animationName));if(h.target===n&&v&&(u("ANIMATION_END"),!r.current)){const m=n.style.animationFillMode;n.style.animationFillMode="forwards",d=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=m)})}},g=h=>{h.target===n&&(a.current=ke(o.current))};return n.addEventListener("animationstart",g),n.addEventListener("animationcancel",p),n.addEventListener("animationend",p),()=>{f.clearTimeout(d),n.removeEventListener("animationstart",g),n.removeEventListener("animationcancel",p),n.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(d=>{o.current=d?getComputedStyle(d):null,t(d)},[])}}function ke(e){return e?.animationName||"none"}function fs(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var at=0;function yt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??en()),document.body.insertAdjacentElement("beforeend",e[1]??en()),at++,()=>{at===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),at--}},[])}function en(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var We="Dialog",[fn,pn]=ie(We),[ps,se]=fn(We),vn=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,f]=he({prop:o,defaultProp:r??!1,onChange:a,caller:We});return l.jsx(ps,{scope:n,triggerRef:c,contentRef:u,contentId:oe(),titleId:oe(),descriptionId:oe(),open:d,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(p=>!p),[f]),modal:i,children:t})};vn.displayName=We;var mn="DialogTrigger",gn=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(mn,t),a=M(n,r.triggerRef);return l.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":bt(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)})});gn.displayName=mn;var Et="DialogPortal",[vs,hn]=fn(Et,{forceMount:void 0}),xn=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:r}=e,a=se(Et,n);return l.jsx(vs,{scope:n,forceMount:t,children:s.Children.map(o,i=>l.jsx(re,{present:t||a.open,children:l.jsx(Ne,{asChild:!0,container:r,children:i})}))})};xn.displayName=Et;var $e="DialogOverlay",wn=s.forwardRef((e,n)=>{const t=hn($e,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=se($e,e.__scopeDialog);return a.modal?l.jsx(re,{present:o||a.open,children:l.jsx(gs,{...r,ref:n})}):null});wn.displayName=$e;var ms=ge("DialogOverlay.RemoveScroll"),gs=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se($e,t);return l.jsx(Ct,{as:ms,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(_.div,{"data-state":bt(r.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),xe="DialogContent",Cn=s.forwardRef((e,n)=>{const t=hn(xe,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=se(xe,e.__scopeDialog);return l.jsx(re,{present:o||a.open,children:a.modal?l.jsx(hs,{...r,ref:n}):l.jsx(xs,{...r,ref:n})})});Cn.displayName=xe;var hs=s.forwardRef((e,n)=>{const t=se(xe,e.__scopeDialog),o=s.useRef(null),r=M(n,t.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return wt(a)},[]),l.jsx(yn,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{a.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault())})}),xs=s.forwardRef((e,n)=>{const t=se(xe,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return l.jsx(yn,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||t.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;t.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),yn=s.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,c=se(xe,t),u=s.useRef(null),d=M(n,u);return yt(),l.jsxs(l.Fragment,{children:[l.jsx(Ke,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:l.jsx(De,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":bt(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Cs,{titleId:c.titleId}),l.jsx(Es,{contentRef:u,descriptionId:c.descriptionId})]})]})}),St="DialogTitle",En=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(St,t);return l.jsx(_.h2,{id:r.titleId,...o,ref:n})});En.displayName=St;var Sn="DialogDescription",bn=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(Sn,t);return l.jsx(_.p,{id:r.descriptionId,...o,ref:n})});bn.displayName=Sn;var Rn="DialogClose",Pn=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=se(Rn,t);return l.jsx(_.button,{type:"button",...o,ref:n,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Pn.displayName=Rn;function bt(e){return e?"open":"closed"}var _n="DialogTitleWarning",[ws,Tn]=Ur(_n,{contentName:xe,titleName:St,docsSlug:"dialog"}),Cs=({titleId:e})=>{const n=Tn(_n),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(t))},[t,e]),null},ys="DialogDescriptionWarning",Es=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tn(ys).contentName}}.`;return s.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");n&&r&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},Ss=vn,bs=gn,Rs=xn,Ps=wn,_s=Cn,Ts=En,Is=bn,In=Pn,Ms="Arrow",Mn=s.forwardRef((e,n)=>{const{children:t,width:o=10,height:r=5,...a}=e;return l.jsx(_.svg,{...a,ref:n,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Mn.displayName=Ms;var As=Mn;function Ds(e){const[n,t]=s.useState(void 0);return K(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let i,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;t({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}var Rt="Popper",[An,Re]=ie(Rt),[Ns,Dn]=An(Rt),Nn=e=>{const{__scopePopper:n,children:t}=e,[o,r]=s.useState(null);return l.jsx(Ns,{scope:n,anchor:o,onAnchorChange:r,children:t})};Nn.displayName=Rt;var On="PopperAnchor",jn=s.forwardRef((e,n)=>{const{__scopePopper:t,virtualRef:o,...r}=e,a=Dn(On,t),i=s.useRef(null),c=M(n,i),u=s.useRef(null);return s.useEffect(()=>{const d=u.current;u.current=o?.current||i.current,d!==u.current&&a.onAnchorChange(u.current)}),o?null:l.jsx(_.div,{...r,ref:c})});jn.displayName=On;var Pt="PopperContent",[Os,js]=An(Pt),Ln=s.forwardRef((e,n)=>{const{__scopePopper:t,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:w,...v}=e,m=Dn(Pt,t),[C,x]=s.useState(null),y=M(n,S=>x(S)),[b,I]=s.useState(null),O=Ds(b),P=O?.width??0,T=O?.height??0,k=o+(a!=="center"?"-"+a:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(d)?d:[d],H=B.length>0,U={padding:F,boundary:B.filter(Fs),altBoundary:H},{refs:W,floatingStyles:V,placement:A,isPositioned:G,middlewareData:L}=br({strategy:"fixed",placement:k,whileElementsMounted:(...S)=>Dr(...S,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[Rr({mainAxis:r+T,alignmentAxis:i}),u&&Pr({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ar():void 0,...U}),u&&_r({...U}),Tr({...U,apply:({elements:S,rects:D,availableWidth:Y,availableHeight:N})=>{const{width:j,height:$}=D.reference,Q=S.floating.style;Q.setProperty("--radix-popper-available-width",`${Y}px`),Q.setProperty("--radix-popper-available-height",`${N}px`),Q.setProperty("--radix-popper-anchor-width",`${j}px`),Q.setProperty("--radix-popper-anchor-height",`${$}px`)}}),b&&Ir({element:b,padding:c}),ks({arrowWidth:P,arrowHeight:T}),g&&Mr({strategy:"referenceHidden",...U})]}),[R,Z]=$n(A),z=ae(w);K(()=>{G&&z?.()},[G,z]);const te=L.arrow?.x,ce=L.arrow?.y,J=L.arrow?.centerOffset!==0,[le,q]=s.useState();return K(()=>{C&&q(window.getComputedStyle(C).zIndex)},[C]),l.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:G?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Os,{scope:t,placedSide:R,onArrowChange:I,arrowX:te,arrowY:ce,shouldHideArrow:J,children:l.jsx(_.div,{"data-side":R,"data-align":Z,...v,ref:y,style:{...v.style,animation:G?void 0:"none"}})})})});Ln.displayName=Pt;var Fn="PopperArrow",Ls={top:"bottom",right:"left",bottom:"top",left:"right"},kn=s.forwardRef(function(n,t){const{__scopePopper:o,...r}=n,a=js(Fn,o),i=Ls[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(As,{...r,ref:t,style:{...r.style,display:"block"}})})});kn.displayName=Fn;function Fs(e){return e!==null}var ks=e=>({name:"transformOrigin",options:e,fn(n){const{placement:t,rects:o,middlewareData:r}=n,i=r.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=$n(t),p={start:"0%",center:"50%",end:"100%"}[f],g=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+u/2;let w="",v="";return d==="bottom"?(w=i?p:`${g}px`,v=`${-u}px`):d==="top"?(w=i?p:`${g}px`,v=`${o.floating.height+u}px`):d==="right"?(w=`${-u}px`,v=i?p:`${h}px`):d==="left"&&(w=`${o.floating.width+u}px`,v=i?p:`${h}px`),{data:{x:w,y:v}}}});function $n(e){const[n,t="center"]=e.split("-");return[n,t]}var _t=Nn,Tt=jn,It=Ln,Mt=kn,Bn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$s="VisuallyHidden",Un=s.forwardRef((e,n)=>l.jsx(_.span,{...e,ref:n,style:{...Bn,...e.style}}));Un.displayName=$s;var Bs=Un,[Ve,gc]=ie("Tooltip",[Re]),ze=Re(),Hn="TooltipProvider",Us=700,lt="tooltip.open",[Hs,At]=Ve(Hn),Gn=e=>{const{__scopeTooltip:n,delayDuration:t=Us,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:a}=e,i=s.useRef(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(Hs,{scope:n,isOpenDelayedRef:i,delayDuration:t,onOpen:s.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(d=>{c.current=d},[]),disableHoverableContent:r,children:a})};Gn.displayName=Hn;var Ie="Tooltip",[Gs,Oe]=Ve(Ie),Kn=e=>{const{__scopeTooltip:n,children:t,open:o,defaultOpen:r,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,u=At(Ie,e.__scopeTooltip),d=ze(n),[f,p]=s.useState(null),g=oe(),h=s.useRef(0),w=i??u.disableHoverableContent,v=c??u.delayDuration,m=s.useRef(!1),[C,x]=he({prop:o,defaultProp:r??!1,onChange:P=>{P?(u.onOpen(),document.dispatchEvent(new CustomEvent(lt))):u.onClose(),a?.(P)},caller:Ie}),y=s.useMemo(()=>C?m.current?"delayed-open":"instant-open":"closed",[C]),b=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m.current=!1,x(!0)},[x]),I=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),O=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=!0,x(!0),h.current=0},v)},[v,x]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),l.jsx(_t,{...d,children:l.jsx(Gs,{scope:n,contentId:g,open:C,stateAttribute:y,trigger:f,onTriggerChange:p,onTriggerEnter:s.useCallback(()=>{u.isOpenDelayedRef.current?O():b()},[u.isOpenDelayedRef,O,b]),onTriggerLeave:s.useCallback(()=>{w?I():(window.clearTimeout(h.current),h.current=0)},[I,w]),onOpen:b,onClose:I,disableHoverableContent:w,children:t})})};Kn.displayName=Ie;var ut="TooltipTrigger",Wn=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=Oe(ut,t),a=At(ut,t),i=ze(t),c=s.useRef(null),u=M(n,c,r.onTriggerChange),d=s.useRef(!1),f=s.useRef(!1),p=s.useCallback(()=>d.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(Tt,{asChild:!0,...i,children:l.jsx(_.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:u,onPointerMove:E(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:E(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:E(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:E(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:E(e.onBlur,r.onClose),onClick:E(e.onClick,r.onClose)})})});Wn.displayName=ut;var Dt="TooltipPortal",[Ks,Ws]=Ve(Dt,{forceMount:void 0}),Vn=e=>{const{__scopeTooltip:n,forceMount:t,children:o,container:r}=e,a=Oe(Dt,n);return l.jsx(Ks,{scope:n,forceMount:t,children:l.jsx(re,{present:t||a.open,children:l.jsx(Ne,{asChild:!0,container:r,children:o})})})};Vn.displayName=Dt;var be="TooltipContent",zn=s.forwardRef((e,n)=>{const t=Ws(be,e.__scopeTooltip),{forceMount:o=t.forceMount,side:r="top",...a}=e,i=Oe(be,e.__scopeTooltip);return l.jsx(re,{present:o||i.open,children:i.disableHoverableContent?l.jsx(Yn,{side:r,...a,ref:n}):l.jsx(Vs,{side:r,...a,ref:n})})}),Vs=s.forwardRef((e,n)=>{const t=Oe(be,e.__scopeTooltip),o=At(be,e.__scopeTooltip),r=s.useRef(null),a=M(n,r),[i,c]=s.useState(null),{trigger:u,onClose:d}=t,f=r.current,{onPointerInTransitChange:p}=o,g=s.useCallback(()=>{c(null),p(!1)},[p]),h=s.useCallback((w,v)=>{const m=w.currentTarget,C={x:w.clientX,y:w.clientY},x=qs(C,m.getBoundingClientRect()),y=Zs(C,x),b=Js(v.getBoundingClientRect()),I=ea([...y,...b]);c(I),p(!0)},[p]);return s.useEffect(()=>()=>g(),[g]),s.useEffect(()=>{if(u&&f){const w=m=>h(m,f),v=m=>h(m,u);return u.addEventListener("pointerleave",w),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",v)}}},[u,f,h,g]),s.useEffect(()=>{if(i){const w=v=>{const m=v.target,C={x:v.clientX,y:v.clientY},x=u?.contains(m)||f?.contains(m),y=!Qs(C,i);x?g():y&&(g(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[u,f,i,d,g]),l.jsx(Yn,{...e,ref:a})}),[zs,Ys]=Ve(Ie,{isInside:!1}),Xs=sn("TooltipContent"),Yn=s.forwardRef((e,n)=>{const{__scopeTooltip:t,children:o,"aria-label":r,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,u=Oe(be,t),d=ze(t),{onClose:f}=u;return s.useEffect(()=>(document.addEventListener(lt,f),()=>document.removeEventListener(lt,f)),[f]),s.useEffect(()=>{if(u.trigger){const p=g=>{g.target?.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),l.jsx(De,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(It,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Xs,{children:o}),l.jsx(zs,{scope:t,isInside:!0,children:l.jsx(Bs,{id:u.contentId,role:"tooltip",children:r||o})})]})})});zn.displayName=be;var Xn="TooltipArrow",qn=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=ze(t);return Ys(Xn,t).isInside?null:l.jsx(Mt,{...r,...o,ref:n})});qn.displayName=Xn;function qs(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),a=Math.abs(n.left-e.x);switch(Math.min(t,o,r,a)){case a:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zs(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function Js(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Qs(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;ao!=g>o&&t<(p-d)*(o-f)/(g-f)+d&&(r=!r)}return r}function ea(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),ta(n)}function ta(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var hc=Gn,xc=Kn,wc=Wn,Cc=Vn,yc=zn,Ec=qn,Ye="Collapsible",[na,Sc]=ie(Ye),[oa,Nt]=na(Ye),Zn=s.forwardRef((e,n)=>{const{__scopeCollapsible:t,open:o,defaultOpen:r,disabled:a,onOpenChange:i,...c}=e,[u,d]=he({prop:o,defaultProp:r??!1,onChange:i,caller:Ye});return l.jsx(oa,{scope:t,disabled:a,contentId:oe(),open:u,onOpenToggle:s.useCallback(()=>d(f=>!f),[d]),children:l.jsx(_.div,{"data-state":jt(u),"data-disabled":a?"":void 0,...c,ref:n})})});Zn.displayName=Ye;var Jn="CollapsibleTrigger",ra=s.forwardRef((e,n)=>{const{__scopeCollapsible:t,...o}=e,r=Nt(Jn,t);return l.jsx(_.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":jt(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:n,onClick:E(e.onClick,r.onOpenToggle)})});ra.displayName=Jn;var Ot="CollapsibleContent",sa=s.forwardRef((e,n)=>{const{forceMount:t,...o}=e,r=Nt(Ot,e.__scopeCollapsible);return l.jsx(re,{present:t||r.open,children:({present:a})=>l.jsx(aa,{...o,ref:n,present:a})})});sa.displayName=Ot;var aa=s.forwardRef((e,n)=>{const{__scopeCollapsible:t,present:o,children:r,...a}=e,i=Nt(Ot,t),[c,u]=s.useState(o),d=s.useRef(null),f=M(n,d),p=s.useRef(0),g=p.current,h=s.useRef(0),w=h.current,v=i.open||c,m=s.useRef(v),C=s.useRef(void 0);return s.useEffect(()=>{const x=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(x)},[]),K(()=>{const x=d.current;if(x){C.current=C.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const y=x.getBoundingClientRect();p.current=y.height,h.current=y.width,m.current||(x.style.transitionDuration=C.current.transitionDuration,x.style.animationName=C.current.animationName),u(o)}},[i.open,o]),l.jsx(_.div,{"data-state":jt(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:v&&r})});function jt(e){return e?"open":"closed"}var bc=Zn;function Lt(e){const n=e+"CollectionProvider",[t,o]=ie(n),[r,a]=t(n,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:m,children:C}=v,x=me.useRef(null),y=me.useRef(new Map).current;return l.jsx(r,{scope:m,itemMap:y,collectionRef:x,children:C})};i.displayName=n;const c=e+"CollectionSlot",u=ge(c),d=me.forwardRef((v,m)=>{const{scope:C,children:x}=v,y=a(c,C),b=M(m,y.collectionRef);return l.jsx(u,{ref:b,children:x})});d.displayName=c;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ge(f),h=me.forwardRef((v,m)=>{const{scope:C,children:x,...y}=v,b=me.useRef(null),I=M(m,b),O=a(f,C);return me.useEffect(()=>(O.itemMap.set(b,{ref:b,...y}),()=>void O.itemMap.delete(b))),l.jsx(g,{[p]:"",ref:I,children:x})});h.displayName=f;function w(v){const m=a(e+"CollectionConsumer",v);return me.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((O,P)=>y.indexOf(O.ref.current)-y.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},w,o]}var ia=s.createContext(void 0);function Ft(e){const n=s.useContext(ia);return e||n||"ltr"}var it="rovingFocusGroup.onEntryFocus",ca={bubbles:!1,cancelable:!0},je="RovingFocusGroup",[dt,Qn,la]=Lt(je),[ua,eo]=ie(je,[la]),[da,fa]=ua(je),to=s.forwardRef((e,n)=>l.jsx(dt.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(dt.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(pa,{...e,ref:n})})}));to.displayName=je;var pa=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:r=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=s.useRef(null),h=M(n,g),w=Ft(a),[v,m]=he({prop:i,defaultProp:c??null,onChange:u,caller:je}),[C,x]=s.useState(!1),y=ae(d),b=Qn(t),I=s.useRef(!1),[O,P]=s.useState(0);return s.useEffect(()=>{const T=g.current;if(T)return T.addEventListener(it,y),()=>T.removeEventListener(it,y)},[y]),l.jsx(da,{scope:t,orientation:o,dir:w,loop:r,currentTabStopId:v,onItemFocus:s.useCallback(T=>m(T),[m]),onItemShiftTab:s.useCallback(()=>x(!0),[]),onFocusableItemAdd:s.useCallback(()=>P(T=>T+1),[]),onFocusableItemRemove:s.useCallback(()=>P(T=>T-1),[]),children:l.jsx(_.div,{tabIndex:C||O===0?-1:0,"data-orientation":o,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{I.current=!0}),onFocus:E(e.onFocus,T=>{const k=!I.current;if(T.target===T.currentTarget&&k&&!C){const F=new CustomEvent(it,ca);if(T.currentTarget.dispatchEvent(F),!F.defaultPrevented){const B=b().filter(A=>A.focusable),H=B.find(A=>A.active),U=B.find(A=>A.id===v),V=[H,U,...B].filter(Boolean).map(A=>A.ref.current);ro(V,f)}}I.current=!1}),onBlur:E(e.onBlur,()=>x(!1))})})}),no="RovingFocusGroupItem",oo=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:r=!1,tabStopId:a,children:i,...c}=e,u=oe(),d=a||u,f=fa(no,t),p=f.currentTabStopId===d,g=Qn(t),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:v}=f;return s.useEffect(()=>{if(o)return h(),()=>w()},[o,h,w]),l.jsx(dt.ItemSlot,{scope:t,id:d,focusable:o,active:r,children:l.jsx(_.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:E(e.onMouseDown,m=>{o?f.onItemFocus(d):m.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:E(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){f.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const C=ga(m,f.orientation,f.dir);if(C!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=g().filter(b=>b.focusable).map(b=>b.ref.current);if(C==="last")y.reverse();else if(C==="prev"||C==="next"){C==="prev"&&y.reverse();const b=y.indexOf(m.currentTarget);y=f.loop?ha(y,b+1):y.slice(b+1)}setTimeout(()=>ro(y))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:v!=null}):i})})});oo.displayName=no;var va={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ma(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ga(e,n,t){const o=ma(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return va[o]}function ro(e,n=!1){const t=document.activeElement;for(const o of e)if(o===t||(o.focus({preventScroll:n}),document.activeElement!==t))return}function ha(e,n){return e.map((t,o)=>e[(n+o)%e.length])}var xa=to,wa=oo,ft=["Enter"," "],Ca=["ArrowDown","PageUp","Home"],so=["ArrowUp","PageDown","End"],ya=[...Ca,...so],Ea={ltr:[...ft,"ArrowRight"],rtl:[...ft,"ArrowLeft"]},Sa={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Le="Menu",[Me,ba,Ra]=Lt(Le),[ye,ao]=ie(Le,[Ra,Re,eo]),Xe=Re(),io=eo(),[Pa,Ee]=ye(Le),[_a,Fe]=ye(Le),co=e=>{const{__scopeMenu:n,open:t=!1,children:o,dir:r,onOpenChange:a,modal:i=!0}=e,c=Xe(n),[u,d]=s.useState(null),f=s.useRef(!1),p=ae(a),g=Ft(r);return s.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),l.jsx(_t,{...c,children:l.jsx(Pa,{scope:n,open:t,onOpenChange:p,content:u,onContentChange:d,children:l.jsx(_a,{scope:n,onClose:s.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:g,modal:i,children:o})})})};co.displayName=Le;var Ta="MenuAnchor",kt=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=Xe(t);return l.jsx(Tt,{...r,...o,ref:n})});kt.displayName=Ta;var $t="MenuPortal",[Ia,lo]=ye($t,{forceMount:void 0}),uo=e=>{const{__scopeMenu:n,forceMount:t,children:o,container:r}=e,a=Ee($t,n);return l.jsx(Ia,{scope:n,forceMount:t,children:l.jsx(re,{present:t||a.open,children:l.jsx(Ne,{asChild:!0,container:r,children:o})})})};uo.displayName=$t;var ee="MenuContent",[Ma,Bt]=ye(ee),fo=s.forwardRef((e,n)=>{const t=lo(ee,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ee(ee,e.__scopeMenu),i=Fe(ee,e.__scopeMenu);return l.jsx(Me.Provider,{scope:e.__scopeMenu,children:l.jsx(re,{present:o||a.open,children:l.jsx(Me.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Aa,{...r,ref:n}):l.jsx(Da,{...r,ref:n})})})})}),Aa=s.forwardRef((e,n)=>{const t=Ee(ee,e.__scopeMenu),o=s.useRef(null),r=M(n,o);return s.useEffect(()=>{const a=o.current;if(a)return wt(a)},[]),l.jsx(Ut,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Da=s.forwardRef((e,n)=>{const t=Ee(ee,e.__scopeMenu);return l.jsx(Ut,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Na=ge("MenuContent.ScrollLock"),Ut=s.forwardRef((e,n)=>{const{__scopeMenu:t,loop:o=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:h,disableOutsideScroll:w,...v}=e,m=Ee(ee,t),C=Fe(ee,t),x=Xe(t),y=io(t),b=ba(t),[I,O]=s.useState(null),P=s.useRef(null),T=M(n,P,m.onContentChange),k=s.useRef(0),F=s.useRef(""),B=s.useRef(0),H=s.useRef(null),U=s.useRef("right"),W=s.useRef(0),V=w?Ct:s.Fragment,A=w?{as:Na,allowPinchZoom:!0}:void 0,G=R=>{const Z=F.current+R,z=b().filter(S=>!S.disabled),te=document.activeElement,ce=z.find(S=>S.ref.current===te)?.textValue,J=z.map(S=>S.textValue),le=Wa(J,Z,ce),q=z.find(S=>S.textValue===le)?.ref.current;(function S(D){F.current=D,window.clearTimeout(k.current),D!==""&&(k.current=window.setTimeout(()=>S(""),1e3))})(Z),q&&setTimeout(()=>q.focus())};s.useEffect(()=>()=>window.clearTimeout(k.current),[]),yt();const L=s.useCallback(R=>U.current===H.current?.side&&za(R,H.current?.area),[]);return l.jsx(Ma,{scope:t,searchRef:F,onItemEnter:s.useCallback(R=>{L(R)&&R.preventDefault()},[L]),onItemLeave:s.useCallback(R=>{L(R)||(P.current?.focus(),O(null))},[L]),onTriggerLeave:s.useCallback(R=>{L(R)&&R.preventDefault()},[L]),pointerGraceTimerRef:B,onPointerGraceIntentChange:s.useCallback(R=>{H.current=R},[]),children:l.jsx(V,{...A,children:l.jsx(Ke,{asChild:!0,trapped:r,onMountAutoFocus:E(a,R=>{R.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(De,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:h,children:l.jsx(xa,{asChild:!0,...y,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:I,onCurrentTabStopIdChange:O,onEntryFocus:E(u,R=>{C.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(It,{role:"menu","aria-orientation":"vertical","data-state":To(m.open),"data-radix-menu-content":"",dir:C.dir,...x,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:E(v.onKeyDown,R=>{const z=R.target.closest("[data-radix-menu-content]")===R.currentTarget,te=R.ctrlKey||R.altKey||R.metaKey,ce=R.key.length===1;z&&(R.key==="Tab"&&R.preventDefault(),!te&&ce&&G(R.key));const J=P.current;if(R.target!==J||!ya.includes(R.key))return;R.preventDefault();const q=b().filter(S=>!S.disabled).map(S=>S.ref.current);so.includes(R.key)&&q.reverse(),Ga(q)}),onBlur:E(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(k.current),F.current="")}),onPointerMove:E(e.onPointerMove,Ae(R=>{const Z=R.target,z=W.current!==R.clientX;if(R.currentTarget.contains(Z)&&z){const te=R.clientX>W.current?"right":"left";U.current=te,W.current=R.clientX}}))})})})})})})});fo.displayName=ee;var Oa="MenuGroup",Ht=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return l.jsx(_.div,{role:"group",...o,ref:n})});Ht.displayName=Oa;var ja="MenuLabel",po=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return l.jsx(_.div,{...o,ref:n})});po.displayName=ja;var Be="MenuItem",tn="menu.itemSelect",qe=s.forwardRef((e,n)=>{const{disabled:t=!1,onSelect:o,...r}=e,a=s.useRef(null),i=Fe(Be,e.__scopeMenu),c=Bt(Be,e.__scopeMenu),u=M(n,a),d=s.useRef(!1),f=()=>{const p=a.current;if(!t&&p){const g=new CustomEvent(tn,{bubbles:!0,cancelable:!0});p.addEventListener(tn,h=>o?.(h),{once:!0}),an(p,g),g.defaultPrevented?d.current=!1:i.onClose()}};return l.jsx(vo,{...r,ref:u,disabled:t,onClick:E(e.onClick,f),onPointerDown:p=>{e.onPointerDown?.(p),d.current=!0},onPointerUp:E(e.onPointerUp,p=>{d.current||p.currentTarget?.click()}),onKeyDown:E(e.onKeyDown,p=>{const g=c.searchRef.current!=="";t||g&&p.key===" "||ft.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});qe.displayName=Be;var vo=s.forwardRef((e,n)=>{const{__scopeMenu:t,disabled:o=!1,textValue:r,...a}=e,i=Bt(Be,t),c=io(t),u=s.useRef(null),d=M(n,u),[f,p]=s.useState(!1),[g,h]=s.useState("");return s.useEffect(()=>{const w=u.current;w&&h((w.textContent??"").trim())},[a.children]),l.jsx(Me.ItemSlot,{scope:t,disabled:o,textValue:r??g,children:l.jsx(wa,{asChild:!0,...c,focusable:!o,children:l.jsx(_.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:E(e.onPointerMove,Ae(w=>{o?i.onItemLeave(w):(i.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:E(e.onPointerLeave,Ae(w=>i.onItemLeave(w))),onFocus:E(e.onFocus,()=>p(!0)),onBlur:E(e.onBlur,()=>p(!1))})})})}),La="MenuCheckboxItem",mo=s.forwardRef((e,n)=>{const{checked:t=!1,onCheckedChange:o,...r}=e;return l.jsx(Co,{scope:e.__scopeMenu,checked:t,children:l.jsx(qe,{role:"menuitemcheckbox","aria-checked":Ue(t)?"mixed":t,...r,ref:n,"data-state":Kt(t),onSelect:E(r.onSelect,()=>o?.(Ue(t)?!0:!t),{checkForDefaultPrevented:!1})})})});mo.displayName=La;var go="MenuRadioGroup",[Fa,ka]=ye(go,{value:void 0,onValueChange:()=>{}}),ho=s.forwardRef((e,n)=>{const{value:t,onValueChange:o,...r}=e,a=ae(o);return l.jsx(Fa,{scope:e.__scopeMenu,value:t,onValueChange:a,children:l.jsx(Ht,{...r,ref:n})})});ho.displayName=go;var xo="MenuRadioItem",wo=s.forwardRef((e,n)=>{const{value:t,...o}=e,r=ka(xo,e.__scopeMenu),a=t===r.value;return l.jsx(Co,{scope:e.__scopeMenu,checked:a,children:l.jsx(qe,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":Kt(a),onSelect:E(o.onSelect,()=>r.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});wo.displayName=xo;var Gt="MenuItemIndicator",[Co,$a]=ye(Gt,{checked:!1}),yo=s.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:o,...r}=e,a=$a(Gt,t);return l.jsx(re,{present:o||Ue(a.checked)||a.checked===!0,children:l.jsx(_.span,{...r,ref:n,"data-state":Kt(a.checked)})})});yo.displayName=Gt;var Ba="MenuSeparator",Eo=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return l.jsx(_.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});Eo.displayName=Ba;var Ua="MenuArrow",So=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=Xe(t);return l.jsx(Mt,{...r,...o,ref:n})});So.displayName=Ua;var Ha="MenuSub",[Rc,bo]=ye(Ha),_e="MenuSubTrigger",Ro=s.forwardRef((e,n)=>{const t=Ee(_e,e.__scopeMenu),o=Fe(_e,e.__scopeMenu),r=bo(_e,e.__scopeMenu),a=Bt(_e,e.__scopeMenu),i=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},f=s.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return s.useEffect(()=>f,[f]),s.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),l.jsx(kt,{asChild:!0,...d,children:l.jsx(vo,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":To(t.open),...e,ref:Ge(n,r.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:E(e.onPointerMove,Ae(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!t.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{t.onOpenChange(!0),f()},100))})),onPointerLeave:E(e.onPointerLeave,Ae(p=>{f();const g=t.content?.getBoundingClientRect();if(g){const h=t.content?.dataset.side,w=h==="right",v=w?-5:5,m=g[w?"left":"right"],C=g[w?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:m,y:g.top},{x:C,y:g.top},{x:C,y:g.bottom},{x:m,y:g.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:E(e.onKeyDown,p=>{const g=a.searchRef.current!=="";e.disabled||g&&p.key===" "||Ea[o.dir].includes(p.key)&&(t.onOpenChange(!0),t.content?.focus(),p.preventDefault())})})})});Ro.displayName=_e;var Po="MenuSubContent",_o=s.forwardRef((e,n)=>{const t=lo(ee,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ee(ee,e.__scopeMenu),i=Fe(ee,e.__scopeMenu),c=bo(Po,e.__scopeMenu),u=s.useRef(null),d=M(n,u);return l.jsx(Me.Provider,{scope:e.__scopeMenu,children:l.jsx(re,{present:o||a.open,children:l.jsx(Me.Slot,{scope:e.__scopeMenu,children:l.jsx(Ut,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:E(e.onFocusOutside,f=>{f.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:E(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:E(e.onKeyDown,f=>{const p=f.currentTarget.contains(f.target),g=Sa[i.dir].includes(f.key);p&&g&&(a.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});_o.displayName=Po;function To(e){return e?"open":"closed"}function Ue(e){return e==="indeterminate"}function Kt(e){return Ue(e)?"indeterminate":e?"checked":"unchecked"}function Ga(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function Ka(e,n){return e.map((t,o)=>e[(n+o)%e.length])}function Wa(e,n,t){const r=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,a=t?e.indexOf(t):-1;let i=Ka(e,Math.max(a,0));r.length===1&&(i=i.filter(d=>d!==t));const u=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==t?u:void 0}function Va(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;ao!=g>o&&t<(p-d)*(o-f)/(g-f)+d&&(r=!r)}return r}function za(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return Va(t,n)}function Ae(e){return n=>n.pointerType==="mouse"?e(n):void 0}var Ya=co,Xa=kt,qa=uo,Za=fo,Ja=Ht,Qa=po,ei=qe,ti=mo,ni=ho,oi=wo,ri=yo,si=Eo,ai=So,ii=Ro,ci=_o,Ze="DropdownMenu",[li,Pc]=ie(Ze,[ao]),X=ao(),[ui,Io]=li(Ze),Mo=e=>{const{__scopeDropdownMenu:n,children:t,dir:o,open:r,defaultOpen:a,onOpenChange:i,modal:c=!0}=e,u=X(n),d=s.useRef(null),[f,p]=he({prop:r,defaultProp:a??!1,onChange:i,caller:Ze});return l.jsx(ui,{scope:n,triggerId:oe(),triggerRef:d,contentId:oe(),open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(g=>!g),[p]),modal:c,children:l.jsx(Ya,{...u,open:f,onOpenChange:p,dir:o,modal:c,children:t})})};Mo.displayName=Ze;var Ao="DropdownMenuTrigger",Do=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,disabled:o=!1,...r}=e,a=Io(Ao,t),i=X(t);return l.jsx(Xa,{asChild:!0,...i,children:l.jsx(_.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:Ge(n,a.triggerRef),onPointerDown:E(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(a.onOpenToggle(),a.open||c.preventDefault())}),onKeyDown:E(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&a.onOpenToggle(),c.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Do.displayName=Ao;var di="DropdownMenuPortal",No=e=>{const{__scopeDropdownMenu:n,...t}=e,o=X(n);return l.jsx(qa,{...o,...t})};No.displayName=di;var Oo="DropdownMenuContent",jo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=Io(Oo,t),a=X(t),i=s.useRef(!1);return l.jsx(Za,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...o,ref:n,onCloseAutoFocus:E(e.onCloseAutoFocus,c=>{i.current||r.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:E(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jo.displayName=Oo;var fi="DropdownMenuGroup",pi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(Ja,{...r,...o,ref:n})});pi.displayName=fi;var vi="DropdownMenuLabel",mi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(Qa,{...r,...o,ref:n})});mi.displayName=vi;var gi="DropdownMenuItem",Lo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ei,{...r,...o,ref:n})});Lo.displayName=gi;var hi="DropdownMenuCheckboxItem",xi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ti,{...r,...o,ref:n})});xi.displayName=hi;var wi="DropdownMenuRadioGroup",Ci=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ni,{...r,...o,ref:n})});Ci.displayName=wi;var yi="DropdownMenuRadioItem",Ei=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(oi,{...r,...o,ref:n})});Ei.displayName=yi;var Si="DropdownMenuItemIndicator",bi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ri,{...r,...o,ref:n})});bi.displayName=Si;var Ri="DropdownMenuSeparator",Pi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(si,{...r,...o,ref:n})});Pi.displayName=Ri;var _i="DropdownMenuArrow",Ti=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ai,{...r,...o,ref:n})});Ti.displayName=_i;var Ii="DropdownMenuSubTrigger",Mi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ii,{...r,...o,ref:n})});Mi.displayName=Ii;var Ai="DropdownMenuSubContent",Di=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ci,{...r,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Di.displayName=Ai;var _c=Mo,Tc=Do,Ic=No,Mc=jo,Ac=Lo,Ni="Label",Fo=s.forwardRef((e,n)=>l.jsx(_.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Fo.displayName=Ni;var Dc=Fo,ko="AlertDialog",[Oi,Nc]=ie(ko,[pn]),ue=pn(),$o=e=>{const{__scopeAlertDialog:n,...t}=e,o=ue(n);return l.jsx(Ss,{...o,...t,modal:!0})};$o.displayName=ko;var ji="AlertDialogTrigger",Bo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(bs,{...r,...o,ref:n})});Bo.displayName=ji;var Li="AlertDialogPortal",Uo=e=>{const{__scopeAlertDialog:n,...t}=e,o=ue(n);return l.jsx(Rs,{...o,...t})};Uo.displayName=Li;var Fi="AlertDialogOverlay",Ho=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(Ps,{...r,...o,ref:n})});Ho.displayName=Fi;var Se="AlertDialogContent",[ki,$i]=Oi(Se),Bi=sn("AlertDialogContent"),Go=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,children:o,...r}=e,a=ue(t),i=s.useRef(null),c=M(n,i),u=s.useRef(null);return l.jsx(ws,{contentName:Se,titleName:Ko,docsSlug:"alert-dialog",children:l.jsx(ki,{scope:t,cancelRef:u,children:l.jsxs(_s,{role:"alertdialog",...a,...r,ref:c,onOpenAutoFocus:E(r.onOpenAutoFocus,d=>{d.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[l.jsx(Bi,{children:o}),l.jsx(Hi,{contentRef:i})]})})})});Go.displayName=Se;var Ko="AlertDialogTitle",Wo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(Ts,{...r,...o,ref:n})});Wo.displayName=Ko;var Vo="AlertDialogDescription",zo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(Is,{...r,...o,ref:n})});zo.displayName=Vo;var Ui="AlertDialogAction",Yo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(In,{...r,...o,ref:n})});Yo.displayName=Ui;var Xo="AlertDialogCancel",qo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,{cancelRef:r}=$i(Xo,t),a=ue(t),i=M(n,r);return l.jsx(In,{...a,...o,ref:i})});qo.displayName=Xo;var Hi=({contentRef:e})=>{const n=`\`${Se}\` requires a description for the component to be accessible for screen reader users. +For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(t))},[t,e]),null},ys="DialogDescriptionWarning",Es=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tn(ys).contentName}}.`;return s.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");n&&r&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},Ss=vn,bs=gn,Rs=xn,Ps=wn,_s=Cn,Ts=En,Is=bn,In=Pn,Ms="Arrow",Mn=s.forwardRef((e,n)=>{const{children:t,width:o=10,height:r=5,...a}=e;return l.jsx(_.svg,{...a,ref:n,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Mn.displayName=Ms;var As=Mn;function Ds(e){const[n,t]=s.useState(void 0);return K(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let i,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;t({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}var Rt="Popper",[An,Re]=ie(Rt),[Ns,Dn]=An(Rt),Nn=e=>{const{__scopePopper:n,children:t}=e,[o,r]=s.useState(null);return l.jsx(Ns,{scope:n,anchor:o,onAnchorChange:r,children:t})};Nn.displayName=Rt;var On="PopperAnchor",jn=s.forwardRef((e,n)=>{const{__scopePopper:t,virtualRef:o,...r}=e,a=Dn(On,t),i=s.useRef(null),c=M(n,i),u=s.useRef(null);return s.useEffect(()=>{const d=u.current;u.current=o?.current||i.current,d!==u.current&&a.onAnchorChange(u.current)}),o?null:l.jsx(_.div,{...r,ref:c})});jn.displayName=On;var Pt="PopperContent",[Os,js]=An(Pt),Ln=s.forwardRef((e,n)=>{const{__scopePopper:t,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:w,...v}=e,m=Dn(Pt,t),[C,x]=s.useState(null),y=M(n,S=>x(S)),[b,I]=s.useState(null),O=Ds(b),P=O?.width??0,T=O?.height??0,k=o+(a!=="center"?"-"+a:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(d)?d:[d],H=B.length>0,U={padding:F,boundary:B.filter(Fs),altBoundary:H},{refs:W,floatingStyles:V,placement:A,isPositioned:G,middlewareData:L}=br({strategy:"fixed",placement:k,whileElementsMounted:(...S)=>Dr(...S,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[Rr({mainAxis:r+T,alignmentAxis:i}),u&&Pr({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ar():void 0,...U}),u&&_r({...U}),Tr({...U,apply:({elements:S,rects:D,availableWidth:Y,availableHeight:N})=>{const{width:j,height:$}=D.reference,Q=S.floating.style;Q.setProperty("--radix-popper-available-width",`${Y}px`),Q.setProperty("--radix-popper-available-height",`${N}px`),Q.setProperty("--radix-popper-anchor-width",`${j}px`),Q.setProperty("--radix-popper-anchor-height",`${$}px`)}}),b&&Ir({element:b,padding:c}),ks({arrowWidth:P,arrowHeight:T}),g&&Mr({strategy:"referenceHidden",...U})]}),[R,Z]=$n(A),z=ae(w);K(()=>{G&&z?.()},[G,z]);const te=L.arrow?.x,ce=L.arrow?.y,J=L.arrow?.centerOffset!==0,[le,q]=s.useState();return K(()=>{C&&q(window.getComputedStyle(C).zIndex)},[C]),l.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:G?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Os,{scope:t,placedSide:R,onArrowChange:I,arrowX:te,arrowY:ce,shouldHideArrow:J,children:l.jsx(_.div,{"data-side":R,"data-align":Z,...v,ref:y,style:{...v.style,animation:G?void 0:"none"}})})})});Ln.displayName=Pt;var Fn="PopperArrow",Ls={top:"bottom",right:"left",bottom:"top",left:"right"},kn=s.forwardRef(function(n,t){const{__scopePopper:o,...r}=n,a=js(Fn,o),i=Ls[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(As,{...r,ref:t,style:{...r.style,display:"block"}})})});kn.displayName=Fn;function Fs(e){return e!==null}var ks=e=>({name:"transformOrigin",options:e,fn(n){const{placement:t,rects:o,middlewareData:r}=n,i=r.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=$n(t),p={start:"0%",center:"50%",end:"100%"}[f],g=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+u/2;let w="",v="";return d==="bottom"?(w=i?p:`${g}px`,v=`${-u}px`):d==="top"?(w=i?p:`${g}px`,v=`${o.floating.height+u}px`):d==="right"?(w=`${-u}px`,v=i?p:`${h}px`):d==="left"&&(w=`${o.floating.width+u}px`,v=i?p:`${h}px`),{data:{x:w,y:v}}}});function $n(e){const[n,t="center"]=e.split("-");return[n,t]}var _t=Nn,Tt=jn,It=Ln,Mt=kn,Bn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$s="VisuallyHidden",Un=s.forwardRef((e,n)=>l.jsx(_.span,{...e,ref:n,style:{...Bn,...e.style}}));Un.displayName=$s;var Bs=Un,[Ve,gc]=ie("Tooltip",[Re]),ze=Re(),Hn="TooltipProvider",Us=700,lt="tooltip.open",[Hs,At]=Ve(Hn),Gn=e=>{const{__scopeTooltip:n,delayDuration:t=Us,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:a}=e,i=s.useRef(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(Hs,{scope:n,isOpenDelayedRef:i,delayDuration:t,onOpen:s.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(d=>{c.current=d},[]),disableHoverableContent:r,children:a})};Gn.displayName=Hn;var Ie="Tooltip",[Gs,Oe]=Ve(Ie),Kn=e=>{const{__scopeTooltip:n,children:t,open:o,defaultOpen:r,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,u=At(Ie,e.__scopeTooltip),d=ze(n),[f,p]=s.useState(null),g=oe(),h=s.useRef(0),w=i??u.disableHoverableContent,v=c??u.delayDuration,m=s.useRef(!1),[C,x]=he({prop:o,defaultProp:r??!1,onChange:P=>{P?(u.onOpen(),document.dispatchEvent(new CustomEvent(lt))):u.onClose(),a?.(P)},caller:Ie}),y=s.useMemo(()=>C?m.current?"delayed-open":"instant-open":"closed",[C]),b=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m.current=!1,x(!0)},[x]),I=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),O=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=!0,x(!0),h.current=0},v)},[v,x]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),l.jsx(_t,{...d,children:l.jsx(Gs,{scope:n,contentId:g,open:C,stateAttribute:y,trigger:f,onTriggerChange:p,onTriggerEnter:s.useCallback(()=>{u.isOpenDelayedRef.current?O():b()},[u.isOpenDelayedRef,O,b]),onTriggerLeave:s.useCallback(()=>{w?I():(window.clearTimeout(h.current),h.current=0)},[I,w]),onOpen:b,onClose:I,disableHoverableContent:w,children:t})})};Kn.displayName=Ie;var ut="TooltipTrigger",Wn=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=Oe(ut,t),a=At(ut,t),i=ze(t),c=s.useRef(null),u=M(n,c,r.onTriggerChange),d=s.useRef(!1),f=s.useRef(!1),p=s.useCallback(()=>d.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(Tt,{asChild:!0,...i,children:l.jsx(_.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:u,onPointerMove:E(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:E(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:E(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:E(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:E(e.onBlur,r.onClose),onClick:E(e.onClick,r.onClose)})})});Wn.displayName=ut;var Dt="TooltipPortal",[Ks,Ws]=Ve(Dt,{forceMount:void 0}),Vn=e=>{const{__scopeTooltip:n,forceMount:t,children:o,container:r}=e,a=Oe(Dt,n);return l.jsx(Ks,{scope:n,forceMount:t,children:l.jsx(re,{present:t||a.open,children:l.jsx(Ne,{asChild:!0,container:r,children:o})})})};Vn.displayName=Dt;var be="TooltipContent",zn=s.forwardRef((e,n)=>{const t=Ws(be,e.__scopeTooltip),{forceMount:o=t.forceMount,side:r="top",...a}=e,i=Oe(be,e.__scopeTooltip);return l.jsx(re,{present:o||i.open,children:i.disableHoverableContent?l.jsx(Yn,{side:r,...a,ref:n}):l.jsx(Vs,{side:r,...a,ref:n})})}),Vs=s.forwardRef((e,n)=>{const t=Oe(be,e.__scopeTooltip),o=At(be,e.__scopeTooltip),r=s.useRef(null),a=M(n,r),[i,c]=s.useState(null),{trigger:u,onClose:d}=t,f=r.current,{onPointerInTransitChange:p}=o,g=s.useCallback(()=>{c(null),p(!1)},[p]),h=s.useCallback((w,v)=>{const m=w.currentTarget,C={x:w.clientX,y:w.clientY},x=qs(C,m.getBoundingClientRect()),y=Zs(C,x),b=Js(v.getBoundingClientRect()),I=ea([...y,...b]);c(I),p(!0)},[p]);return s.useEffect(()=>()=>g(),[g]),s.useEffect(()=>{if(u&&f){const w=m=>h(m,f),v=m=>h(m,u);return u.addEventListener("pointerleave",w),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",v)}}},[u,f,h,g]),s.useEffect(()=>{if(i){const w=v=>{const m=v.target,C={x:v.clientX,y:v.clientY},x=u?.contains(m)||f?.contains(m),y=!Qs(C,i);x?g():y&&(g(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[u,f,i,d,g]),l.jsx(Yn,{...e,ref:a})}),[zs,Ys]=Ve(Ie,{isInside:!1}),Xs=sn("TooltipContent"),Yn=s.forwardRef((e,n)=>{const{__scopeTooltip:t,children:o,"aria-label":r,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,u=Oe(be,t),d=ze(t),{onClose:f}=u;return s.useEffect(()=>(document.addEventListener(lt,f),()=>document.removeEventListener(lt,f)),[f]),s.useEffect(()=>{if(u.trigger){const p=g=>{g.target?.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),l.jsx(De,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(It,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Xs,{children:o}),l.jsx(zs,{scope:t,isInside:!0,children:l.jsx(Bs,{id:u.contentId,role:"tooltip",children:r||o})})]})})});zn.displayName=be;var Xn="TooltipArrow",qn=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=ze(t);return Ys(Xn,t).isInside?null:l.jsx(Mt,{...r,...o,ref:n})});qn.displayName=Xn;function qs(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),a=Math.abs(n.left-e.x);switch(Math.min(t,o,r,a)){case a:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zs(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function Js(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Qs(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;ao!=g>o&&t<(p-d)*(o-f)/(g-f)+d&&(r=!r)}return r}function ea(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),ta(n)}function ta(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var hc=Gn,xc=Kn,wc=Wn,Cc=Vn,yc=zn,Ec=qn,Ye="Collapsible",[na,Sc]=ie(Ye),[oa,Nt]=na(Ye),Zn=s.forwardRef((e,n)=>{const{__scopeCollapsible:t,open:o,defaultOpen:r,disabled:a,onOpenChange:i,...c}=e,[u,d]=he({prop:o,defaultProp:r??!1,onChange:i,caller:Ye});return l.jsx(oa,{scope:t,disabled:a,contentId:oe(),open:u,onOpenToggle:s.useCallback(()=>d(f=>!f),[d]),children:l.jsx(_.div,{"data-state":jt(u),"data-disabled":a?"":void 0,...c,ref:n})})});Zn.displayName=Ye;var Jn="CollapsibleTrigger",ra=s.forwardRef((e,n)=>{const{__scopeCollapsible:t,...o}=e,r=Nt(Jn,t);return l.jsx(_.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":jt(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:n,onClick:E(e.onClick,r.onOpenToggle)})});ra.displayName=Jn;var Ot="CollapsibleContent",sa=s.forwardRef((e,n)=>{const{forceMount:t,...o}=e,r=Nt(Ot,e.__scopeCollapsible);return l.jsx(re,{present:t||r.open,children:({present:a})=>l.jsx(aa,{...o,ref:n,present:a})})});sa.displayName=Ot;var aa=s.forwardRef((e,n)=>{const{__scopeCollapsible:t,present:o,children:r,...a}=e,i=Nt(Ot,t),[c,u]=s.useState(o),d=s.useRef(null),f=M(n,d),p=s.useRef(0),g=p.current,h=s.useRef(0),w=h.current,v=i.open||c,m=s.useRef(v),C=s.useRef(void 0);return s.useEffect(()=>{const x=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(x)},[]),K(()=>{const x=d.current;if(x){C.current=C.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const y=x.getBoundingClientRect();p.current=y.height,h.current=y.width,m.current||(x.style.transitionDuration=C.current.transitionDuration,x.style.animationName=C.current.animationName),u(o)}},[i.open,o]),l.jsx(_.div,{"data-state":jt(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:v&&r})});function jt(e){return e?"open":"closed"}var bc=Zn;function Lt(e){const n=e+"CollectionProvider",[t,o]=ie(n),[r,a]=t(n,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:m,children:C}=v,x=me.useRef(null),y=me.useRef(new Map).current;return l.jsx(r,{scope:m,itemMap:y,collectionRef:x,children:C})};i.displayName=n;const c=e+"CollectionSlot",u=ge(c),d=me.forwardRef((v,m)=>{const{scope:C,children:x}=v,y=a(c,C),b=M(m,y.collectionRef);return l.jsx(u,{ref:b,children:x})});d.displayName=c;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ge(f),h=me.forwardRef((v,m)=>{const{scope:C,children:x,...y}=v,b=me.useRef(null),I=M(m,b),O=a(f,C);return me.useEffect(()=>(O.itemMap.set(b,{ref:b,...y}),()=>void O.itemMap.delete(b))),l.jsx(g,{[p]:"",ref:I,children:x})});h.displayName=f;function w(v){const m=a(e+"CollectionConsumer",v);return me.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((O,P)=>y.indexOf(O.ref.current)-y.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},w,o]}var ia=s.createContext(void 0);function Ft(e){const n=s.useContext(ia);return e||n||"ltr"}var it="rovingFocusGroup.onEntryFocus",ca={bubbles:!1,cancelable:!0},je="RovingFocusGroup",[dt,Qn,la]=Lt(je),[ua,eo]=ie(je,[la]),[da,fa]=ua(je),to=s.forwardRef((e,n)=>l.jsx(dt.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(dt.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(pa,{...e,ref:n})})}));to.displayName=je;var pa=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:r=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=s.useRef(null),h=M(n,g),w=Ft(a),[v,m]=he({prop:i,defaultProp:c??null,onChange:u,caller:je}),[C,x]=s.useState(!1),y=ae(d),b=Qn(t),I=s.useRef(!1),[O,P]=s.useState(0);return s.useEffect(()=>{const T=g.current;if(T)return T.addEventListener(it,y),()=>T.removeEventListener(it,y)},[y]),l.jsx(da,{scope:t,orientation:o,dir:w,loop:r,currentTabStopId:v,onItemFocus:s.useCallback(T=>m(T),[m]),onItemShiftTab:s.useCallback(()=>x(!0),[]),onFocusableItemAdd:s.useCallback(()=>P(T=>T+1),[]),onFocusableItemRemove:s.useCallback(()=>P(T=>T-1),[]),children:l.jsx(_.div,{tabIndex:C||O===0?-1:0,"data-orientation":o,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{I.current=!0}),onFocus:E(e.onFocus,T=>{const k=!I.current;if(T.target===T.currentTarget&&k&&!C){const F=new CustomEvent(it,ca);if(T.currentTarget.dispatchEvent(F),!F.defaultPrevented){const B=b().filter(A=>A.focusable),H=B.find(A=>A.active),U=B.find(A=>A.id===v),V=[H,U,...B].filter(Boolean).map(A=>A.ref.current);ro(V,f)}}I.current=!1}),onBlur:E(e.onBlur,()=>x(!1))})})}),no="RovingFocusGroupItem",oo=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:r=!1,tabStopId:a,children:i,...c}=e,u=oe(),d=a||u,f=fa(no,t),p=f.currentTabStopId===d,g=Qn(t),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:v}=f;return s.useEffect(()=>{if(o)return h(),()=>w()},[o,h,w]),l.jsx(dt.ItemSlot,{scope:t,id:d,focusable:o,active:r,children:l.jsx(_.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:E(e.onMouseDown,m=>{o?f.onItemFocus(d):m.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:E(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){f.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const C=ga(m,f.orientation,f.dir);if(C!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=g().filter(b=>b.focusable).map(b=>b.ref.current);if(C==="last")y.reverse();else if(C==="prev"||C==="next"){C==="prev"&&y.reverse();const b=y.indexOf(m.currentTarget);y=f.loop?ha(y,b+1):y.slice(b+1)}setTimeout(()=>ro(y))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:v!=null}):i})})});oo.displayName=no;var va={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ma(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ga(e,n,t){const o=ma(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return va[o]}function ro(e,n=!1){const t=document.activeElement;for(const o of e)if(o===t||(o.focus({preventScroll:n}),document.activeElement!==t))return}function ha(e,n){return e.map((t,o)=>e[(n+o)%e.length])}var xa=to,wa=oo,ft=["Enter"," "],Ca=["ArrowDown","PageUp","Home"],so=["ArrowUp","PageDown","End"],ya=[...Ca,...so],Ea={ltr:[...ft,"ArrowRight"],rtl:[...ft,"ArrowLeft"]},Sa={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Le="Menu",[Me,ba,Ra]=Lt(Le),[ye,ao]=ie(Le,[Ra,Re,eo]),Xe=Re(),io=eo(),[Pa,Ee]=ye(Le),[_a,Fe]=ye(Le),co=e=>{const{__scopeMenu:n,open:t=!1,children:o,dir:r,onOpenChange:a,modal:i=!0}=e,c=Xe(n),[u,d]=s.useState(null),f=s.useRef(!1),p=ae(a),g=Ft(r);return s.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),l.jsx(_t,{...c,children:l.jsx(Pa,{scope:n,open:t,onOpenChange:p,content:u,onContentChange:d,children:l.jsx(_a,{scope:n,onClose:s.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:g,modal:i,children:o})})})};co.displayName=Le;var Ta="MenuAnchor",kt=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=Xe(t);return l.jsx(Tt,{...r,...o,ref:n})});kt.displayName=Ta;var $t="MenuPortal",[Ia,lo]=ye($t,{forceMount:void 0}),uo=e=>{const{__scopeMenu:n,forceMount:t,children:o,container:r}=e,a=Ee($t,n);return l.jsx(Ia,{scope:n,forceMount:t,children:l.jsx(re,{present:t||a.open,children:l.jsx(Ne,{asChild:!0,container:r,children:o})})})};uo.displayName=$t;var ee="MenuContent",[Ma,Bt]=ye(ee),fo=s.forwardRef((e,n)=>{const t=lo(ee,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ee(ee,e.__scopeMenu),i=Fe(ee,e.__scopeMenu);return l.jsx(Me.Provider,{scope:e.__scopeMenu,children:l.jsx(re,{present:o||a.open,children:l.jsx(Me.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Aa,{...r,ref:n}):l.jsx(Da,{...r,ref:n})})})})}),Aa=s.forwardRef((e,n)=>{const t=Ee(ee,e.__scopeMenu),o=s.useRef(null),r=M(n,o);return s.useEffect(()=>{const a=o.current;if(a)return wt(a)},[]),l.jsx(Ut,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Da=s.forwardRef((e,n)=>{const t=Ee(ee,e.__scopeMenu);return l.jsx(Ut,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Na=ge("MenuContent.ScrollLock"),Ut=s.forwardRef((e,n)=>{const{__scopeMenu:t,loop:o=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:h,disableOutsideScroll:w,...v}=e,m=Ee(ee,t),C=Fe(ee,t),x=Xe(t),y=io(t),b=ba(t),[I,O]=s.useState(null),P=s.useRef(null),T=M(n,P,m.onContentChange),k=s.useRef(0),F=s.useRef(""),B=s.useRef(0),H=s.useRef(null),U=s.useRef("right"),W=s.useRef(0),V=w?Ct:s.Fragment,A=w?{as:Na,allowPinchZoom:!0}:void 0,G=R=>{const Z=F.current+R,z=b().filter(S=>!S.disabled),te=document.activeElement,ce=z.find(S=>S.ref.current===te)?.textValue,J=z.map(S=>S.textValue),le=Wa(J,Z,ce),q=z.find(S=>S.textValue===le)?.ref.current;(function S(D){F.current=D,window.clearTimeout(k.current),D!==""&&(k.current=window.setTimeout(()=>S(""),1e3))})(Z),q&&setTimeout(()=>q.focus())};s.useEffect(()=>()=>window.clearTimeout(k.current),[]),yt();const L=s.useCallback(R=>U.current===H.current?.side&&za(R,H.current?.area),[]);return l.jsx(Ma,{scope:t,searchRef:F,onItemEnter:s.useCallback(R=>{L(R)&&R.preventDefault()},[L]),onItemLeave:s.useCallback(R=>{L(R)||(P.current?.focus(),O(null))},[L]),onTriggerLeave:s.useCallback(R=>{L(R)&&R.preventDefault()},[L]),pointerGraceTimerRef:B,onPointerGraceIntentChange:s.useCallback(R=>{H.current=R},[]),children:l.jsx(V,{...A,children:l.jsx(Ke,{asChild:!0,trapped:r,onMountAutoFocus:E(a,R=>{R.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(De,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:h,children:l.jsx(xa,{asChild:!0,...y,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:I,onCurrentTabStopIdChange:O,onEntryFocus:E(u,R=>{C.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(It,{role:"menu","aria-orientation":"vertical","data-state":To(m.open),"data-radix-menu-content":"",dir:C.dir,...x,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:E(v.onKeyDown,R=>{const z=R.target.closest("[data-radix-menu-content]")===R.currentTarget,te=R.ctrlKey||R.altKey||R.metaKey,ce=R.key.length===1;z&&(R.key==="Tab"&&R.preventDefault(),!te&&ce&&G(R.key));const J=P.current;if(R.target!==J||!ya.includes(R.key))return;R.preventDefault();const q=b().filter(S=>!S.disabled).map(S=>S.ref.current);so.includes(R.key)&&q.reverse(),Ga(q)}),onBlur:E(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(k.current),F.current="")}),onPointerMove:E(e.onPointerMove,Ae(R=>{const Z=R.target,z=W.current!==R.clientX;if(R.currentTarget.contains(Z)&&z){const te=R.clientX>W.current?"right":"left";U.current=te,W.current=R.clientX}}))})})})})})})});fo.displayName=ee;var Oa="MenuGroup",Ht=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return l.jsx(_.div,{role:"group",...o,ref:n})});Ht.displayName=Oa;var ja="MenuLabel",po=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return l.jsx(_.div,{...o,ref:n})});po.displayName=ja;var Be="MenuItem",tn="menu.itemSelect",qe=s.forwardRef((e,n)=>{const{disabled:t=!1,onSelect:o,...r}=e,a=s.useRef(null),i=Fe(Be,e.__scopeMenu),c=Bt(Be,e.__scopeMenu),u=M(n,a),d=s.useRef(!1),f=()=>{const p=a.current;if(!t&&p){const g=new CustomEvent(tn,{bubbles:!0,cancelable:!0});p.addEventListener(tn,h=>o?.(h),{once:!0}),an(p,g),g.defaultPrevented?d.current=!1:i.onClose()}};return l.jsx(vo,{...r,ref:u,disabled:t,onClick:E(e.onClick,f),onPointerDown:p=>{e.onPointerDown?.(p),d.current=!0},onPointerUp:E(e.onPointerUp,p=>{d.current||p.currentTarget?.click()}),onKeyDown:E(e.onKeyDown,p=>{const g=c.searchRef.current!=="";t||g&&p.key===" "||ft.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});qe.displayName=Be;var vo=s.forwardRef((e,n)=>{const{__scopeMenu:t,disabled:o=!1,textValue:r,...a}=e,i=Bt(Be,t),c=io(t),u=s.useRef(null),d=M(n,u),[f,p]=s.useState(!1),[g,h]=s.useState("");return s.useEffect(()=>{const w=u.current;w&&h((w.textContent??"").trim())},[a.children]),l.jsx(Me.ItemSlot,{scope:t,disabled:o,textValue:r??g,children:l.jsx(wa,{asChild:!0,...c,focusable:!o,children:l.jsx(_.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:E(e.onPointerMove,Ae(w=>{o?i.onItemLeave(w):(i.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:E(e.onPointerLeave,Ae(w=>i.onItemLeave(w))),onFocus:E(e.onFocus,()=>p(!0)),onBlur:E(e.onBlur,()=>p(!1))})})})}),La="MenuCheckboxItem",mo=s.forwardRef((e,n)=>{const{checked:t=!1,onCheckedChange:o,...r}=e;return l.jsx(Co,{scope:e.__scopeMenu,checked:t,children:l.jsx(qe,{role:"menuitemcheckbox","aria-checked":Ue(t)?"mixed":t,...r,ref:n,"data-state":Kt(t),onSelect:E(r.onSelect,()=>o?.(Ue(t)?!0:!t),{checkForDefaultPrevented:!1})})})});mo.displayName=La;var go="MenuRadioGroup",[Fa,ka]=ye(go,{value:void 0,onValueChange:()=>{}}),ho=s.forwardRef((e,n)=>{const{value:t,onValueChange:o,...r}=e,a=ae(o);return l.jsx(Fa,{scope:e.__scopeMenu,value:t,onValueChange:a,children:l.jsx(Ht,{...r,ref:n})})});ho.displayName=go;var xo="MenuRadioItem",wo=s.forwardRef((e,n)=>{const{value:t,...o}=e,r=ka(xo,e.__scopeMenu),a=t===r.value;return l.jsx(Co,{scope:e.__scopeMenu,checked:a,children:l.jsx(qe,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":Kt(a),onSelect:E(o.onSelect,()=>r.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});wo.displayName=xo;var Gt="MenuItemIndicator",[Co,$a]=ye(Gt,{checked:!1}),yo=s.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:o,...r}=e,a=$a(Gt,t);return l.jsx(re,{present:o||Ue(a.checked)||a.checked===!0,children:l.jsx(_.span,{...r,ref:n,"data-state":Kt(a.checked)})})});yo.displayName=Gt;var Ba="MenuSeparator",Eo=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return l.jsx(_.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});Eo.displayName=Ba;var Ua="MenuArrow",So=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=Xe(t);return l.jsx(Mt,{...r,...o,ref:n})});So.displayName=Ua;var Ha="MenuSub",[Rc,bo]=ye(Ha),_e="MenuSubTrigger",Ro=s.forwardRef((e,n)=>{const t=Ee(_e,e.__scopeMenu),o=Fe(_e,e.__scopeMenu),r=bo(_e,e.__scopeMenu),a=Bt(_e,e.__scopeMenu),i=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},f=s.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return s.useEffect(()=>f,[f]),s.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),l.jsx(kt,{asChild:!0,...d,children:l.jsx(vo,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":To(t.open),...e,ref:Ge(n,r.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:E(e.onPointerMove,Ae(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!t.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{t.onOpenChange(!0),f()},100))})),onPointerLeave:E(e.onPointerLeave,Ae(p=>{f();const g=t.content?.getBoundingClientRect();if(g){const h=t.content?.dataset.side,w=h==="right",v=w?-5:5,m=g[w?"left":"right"],C=g[w?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:m,y:g.top},{x:C,y:g.top},{x:C,y:g.bottom},{x:m,y:g.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:E(e.onKeyDown,p=>{const g=a.searchRef.current!=="";e.disabled||g&&p.key===" "||Ea[o.dir].includes(p.key)&&(t.onOpenChange(!0),t.content?.focus(),p.preventDefault())})})})});Ro.displayName=_e;var Po="MenuSubContent",_o=s.forwardRef((e,n)=>{const t=lo(ee,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ee(ee,e.__scopeMenu),i=Fe(ee,e.__scopeMenu),c=bo(Po,e.__scopeMenu),u=s.useRef(null),d=M(n,u);return l.jsx(Me.Provider,{scope:e.__scopeMenu,children:l.jsx(re,{present:o||a.open,children:l.jsx(Me.Slot,{scope:e.__scopeMenu,children:l.jsx(Ut,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:E(e.onFocusOutside,f=>{f.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:E(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:E(e.onKeyDown,f=>{const p=f.currentTarget.contains(f.target),g=Sa[i.dir].includes(f.key);p&&g&&(a.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});_o.displayName=Po;function To(e){return e?"open":"closed"}function Ue(e){return e==="indeterminate"}function Kt(e){return Ue(e)?"indeterminate":e?"checked":"unchecked"}function Ga(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function Ka(e,n){return e.map((t,o)=>e[(n+o)%e.length])}function Wa(e,n,t){const r=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,a=t?e.indexOf(t):-1;let i=Ka(e,Math.max(a,0));r.length===1&&(i=i.filter(d=>d!==t));const u=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==t?u:void 0}function Va(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;ao!=g>o&&t<(p-d)*(o-f)/(g-f)+d&&(r=!r)}return r}function za(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return Va(t,n)}function Ae(e){return n=>n.pointerType==="mouse"?e(n):void 0}var Ya=co,Xa=kt,qa=uo,Za=fo,Ja=Ht,Qa=po,ei=qe,ti=mo,ni=ho,oi=wo,ri=yo,si=Eo,ai=So,ii=Ro,ci=_o,Ze="DropdownMenu",[li,Pc]=ie(Ze,[ao]),X=ao(),[ui,Io]=li(Ze),Mo=e=>{const{__scopeDropdownMenu:n,children:t,dir:o,open:r,defaultOpen:a,onOpenChange:i,modal:c=!0}=e,u=X(n),d=s.useRef(null),[f,p]=he({prop:r,defaultProp:a??!1,onChange:i,caller:Ze});return l.jsx(ui,{scope:n,triggerId:oe(),triggerRef:d,contentId:oe(),open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(g=>!g),[p]),modal:c,children:l.jsx(Ya,{...u,open:f,onOpenChange:p,dir:o,modal:c,children:t})})};Mo.displayName=Ze;var Ao="DropdownMenuTrigger",Do=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,disabled:o=!1,...r}=e,a=Io(Ao,t),i=X(t);return l.jsx(Xa,{asChild:!0,...i,children:l.jsx(_.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:Ge(n,a.triggerRef),onPointerDown:E(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(a.onOpenToggle(),a.open||c.preventDefault())}),onKeyDown:E(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&a.onOpenToggle(),c.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Do.displayName=Ao;var di="DropdownMenuPortal",No=e=>{const{__scopeDropdownMenu:n,...t}=e,o=X(n);return l.jsx(qa,{...o,...t})};No.displayName=di;var Oo="DropdownMenuContent",jo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=Io(Oo,t),a=X(t),i=s.useRef(!1);return l.jsx(Za,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...o,ref:n,onCloseAutoFocus:E(e.onCloseAutoFocus,c=>{i.current||r.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:E(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jo.displayName=Oo;var fi="DropdownMenuGroup",pi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(Ja,{...r,...o,ref:n})});pi.displayName=fi;var vi="DropdownMenuLabel",mi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(Qa,{...r,...o,ref:n})});mi.displayName=vi;var gi="DropdownMenuItem",Lo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ei,{...r,...o,ref:n})});Lo.displayName=gi;var hi="DropdownMenuCheckboxItem",xi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ti,{...r,...o,ref:n})});xi.displayName=hi;var wi="DropdownMenuRadioGroup",Ci=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ni,{...r,...o,ref:n})});Ci.displayName=wi;var yi="DropdownMenuRadioItem",Ei=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(oi,{...r,...o,ref:n})});Ei.displayName=yi;var Si="DropdownMenuItemIndicator",bi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ri,{...r,...o,ref:n})});bi.displayName=Si;var Ri="DropdownMenuSeparator",Pi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(si,{...r,...o,ref:n})});Pi.displayName=Ri;var _i="DropdownMenuArrow",Ti=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ai,{...r,...o,ref:n})});Ti.displayName=_i;var Ii="DropdownMenuSubTrigger",Mi=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ii,{...r,...o,ref:n})});Mi.displayName=Ii;var Ai="DropdownMenuSubContent",Di=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=X(t);return l.jsx(ci,{...r,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Di.displayName=Ai;var _c=Mo,Tc=Do,Ic=No,Mc=jo,Ac=Lo,Fo="AlertDialog",[Ni,Dc]=ie(Fo,[pn]),ue=pn(),ko=e=>{const{__scopeAlertDialog:n,...t}=e,o=ue(n);return l.jsx(Ss,{...o,...t,modal:!0})};ko.displayName=Fo;var Oi="AlertDialogTrigger",$o=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(bs,{...r,...o,ref:n})});$o.displayName=Oi;var ji="AlertDialogPortal",Bo=e=>{const{__scopeAlertDialog:n,...t}=e,o=ue(n);return l.jsx(Rs,{...o,...t})};Bo.displayName=ji;var Li="AlertDialogOverlay",Uo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(Ps,{...r,...o,ref:n})});Uo.displayName=Li;var Se="AlertDialogContent",[Fi,ki]=Ni(Se),$i=sn("AlertDialogContent"),Ho=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,children:o,...r}=e,a=ue(t),i=s.useRef(null),c=M(n,i),u=s.useRef(null);return l.jsx(ws,{contentName:Se,titleName:Go,docsSlug:"alert-dialog",children:l.jsx(Fi,{scope:t,cancelRef:u,children:l.jsxs(_s,{role:"alertdialog",...a,...r,ref:c,onOpenAutoFocus:E(r.onOpenAutoFocus,d=>{d.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[l.jsx($i,{children:o}),l.jsx(Ui,{contentRef:i})]})})})});Ho.displayName=Se;var Go="AlertDialogTitle",Ko=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(Ts,{...r,...o,ref:n})});Ko.displayName=Go;var Wo="AlertDialogDescription",Vo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(Is,{...r,...o,ref:n})});Vo.displayName=Wo;var Bi="AlertDialogAction",zo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=ue(t);return l.jsx(In,{...r,...o,ref:n})});zo.displayName=Bi;var Yo="AlertDialogCancel",Xo=s.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,{cancelRef:r}=ki(Yo,t),a=ue(t),i=M(n,r);return l.jsx(In,{...a,...o,ref:i})});Xo.displayName=Yo;var Ui=({contentRef:e})=>{const n=`\`${Se}\` requires a description for the component to be accessible for screen reader users. -You can add a description to the \`${Se}\` by passing a \`${Vo}\` component as a child, which also benefits sighted users by adding visible context to the dialog. +You can add a description to the \`${Se}\` by passing a \`${Wo}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Se}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(n)},[n,e]),null},Oc=$o,jc=Bo,Lc=Uo,Fc=Ho,kc=Go,$c=Yo,Bc=qo,Uc=Wo,Hc=zo;function nn(e,[n,t]){return Math.min(t,Math.max(n,e))}function Gi(e){const n=s.useRef({value:e,previous:e});return s.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var Ki=[" ","Enter","ArrowUp","ArrowDown"],Wi=[" ","Enter"],we="Select",[Je,Qe,Vi]=Lt(we),[Pe,Gc]=ie(we,[Vi,Re]),et=Re(),[zi,fe]=Pe(we),[Yi,Xi]=Pe(we),Zo=e=>{const{__scopeSelect:n,children:t,open:o,defaultOpen:r,onOpenChange:a,value:i,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:g,required:h,form:w}=e,v=et(n),[m,C]=s.useState(null),[x,y]=s.useState(null),[b,I]=s.useState(!1),O=Ft(d),[P,T]=he({prop:o,defaultProp:r??!1,onChange:a,caller:we}),[k,F]=he({prop:i,defaultProp:c,onChange:u,caller:we}),B=s.useRef(null),H=m?w||!!m.closest("form"):!0,[U,W]=s.useState(new Set),V=Array.from(U).map(A=>A.props.value).join(";");return l.jsx(_t,{...v,children:l.jsxs(zi,{required:h,scope:n,trigger:m,onTriggerChange:C,valueNode:x,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:I,contentId:oe(),value:k,onValueChange:F,open:P,onOpenChange:T,dir:O,triggerPointerDownPosRef:B,disabled:g,children:[l.jsx(Je.Provider,{scope:n,children:l.jsx(Yi,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(A=>{W(G=>new Set(G).add(A))},[]),onNativeOptionRemove:s.useCallback(A=>{W(G=>{const L=new Set(G);return L.delete(A),L})},[]),children:t})}),H?l.jsxs(wr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:k,onChange:A=>F(A.target.value),disabled:g,form:w,children:[k===void 0?l.jsx("option",{value:""}):null,Array.from(U)]},V):null]})})};Zo.displayName=we;var Jo="SelectTrigger",Qo=s.forwardRef((e,n)=>{const{__scopeSelect:t,disabled:o=!1,...r}=e,a=et(t),i=fe(Jo,t),c=i.disabled||o,u=M(n,i.onTriggerChange),d=Qe(t),f=s.useRef("touch"),[p,g,h]=yr(v=>{const m=d().filter(y=>!y.disabled),C=m.find(y=>y.value===i.value),x=Er(m,v,C);x!==void 0&&i.onValueChange(x.value)}),w=v=>{c||(i.onOpenChange(!0),h()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return l.jsx(Tt,{asChild:!0,...a,children:l.jsx(_.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Cr(i.value)?"":void 0,...r,ref:u,onClick:E(r.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&w(v)}),onPointerDown:E(r.onPointerDown,v=>{f.current=v.pointerType;const m=v.target;m.hasPointerCapture(v.pointerId)&&m.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:E(r.onKeyDown,v=>{const m=p.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&g(v.key),!(m&&v.key===" ")&&Ki.includes(v.key)&&(w(),v.preventDefault())})})})});Qo.displayName=Jo;var er="SelectValue",tr=s.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:r,children:a,placeholder:i="",...c}=e,u=fe(er,t),{onValueNodeHasChildrenChange:d}=u,f=a!==void 0,p=M(n,u.onValueNodeChange);return K(()=>{d(f)},[d,f]),l.jsx(_.span,{...c,ref:p,style:{pointerEvents:"none"},children:Cr(u.value)?l.jsx(l.Fragment,{children:i}):a})});tr.displayName=er;var qi="SelectIcon",nr=s.forwardRef((e,n)=>{const{__scopeSelect:t,children:o,...r}=e;return l.jsx(_.span,{"aria-hidden":!0,...r,ref:n,children:o||"▼"})});nr.displayName=qi;var Zi="SelectPortal",or=e=>l.jsx(Ne,{asChild:!0,...e});or.displayName=Zi;var Ce="SelectContent",rr=s.forwardRef((e,n)=>{const t=fe(Ce,e.__scopeSelect),[o,r]=s.useState();if(K(()=>{r(new DocumentFragment)},[]),!t.open){const a=o;return a?xt.createPortal(l.jsx(sr,{scope:e.__scopeSelect,children:l.jsx(Je.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),a):null}return l.jsx(ar,{...e,ref:n})});rr.displayName=Ce;var ne=10,[sr,pe]=Pe(Ce),Ji="SelectContentImpl",Qi=ge("SelectContent.RemoveScroll"),ar=s.forwardRef((e,n)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:m,...C}=e,x=fe(Ce,t),[y,b]=s.useState(null),[I,O]=s.useState(null),P=M(n,S=>b(S)),[T,k]=s.useState(null),[F,B]=s.useState(null),H=Qe(t),[U,W]=s.useState(!1),V=s.useRef(!1);s.useEffect(()=>{if(y)return wt(y)},[y]),yt();const A=s.useCallback(S=>{const[D,...Y]=H().map($=>$.ref.current),[N]=Y.slice(-1),j=document.activeElement;for(const $ of S)if($===j||($?.scrollIntoView({block:"nearest"}),$===D&&I&&(I.scrollTop=0),$===N&&I&&(I.scrollTop=I.scrollHeight),$?.focus(),document.activeElement!==j))return},[H,I]),G=s.useCallback(()=>A([T,y]),[A,T,y]);s.useEffect(()=>{U&&G()},[U,G]);const{onOpenChange:L,triggerPointerDownPosRef:R}=x;s.useEffect(()=>{if(y){let S={x:0,y:0};const D=N=>{S={x:Math.abs(Math.round(N.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(N.pageY)-(R.current?.y??0))}},Y=N=>{S.x<=10&&S.y<=10?N.preventDefault():y.contains(N.target)||L(!1),document.removeEventListener("pointermove",D),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",D),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",Y,{capture:!0})}}},[y,L,R]),s.useEffect(()=>{const S=()=>L(!1);return window.addEventListener("blur",S),window.addEventListener("resize",S),()=>{window.removeEventListener("blur",S),window.removeEventListener("resize",S)}},[L]);const[Z,z]=yr(S=>{const D=H().filter(j=>!j.disabled),Y=D.find(j=>j.ref.current===document.activeElement),N=Er(D,S,Y);N&&setTimeout(()=>N.ref.current.focus())}),te=s.useCallback((S,D,Y)=>{const N=!V.current&&!Y;(x.value!==void 0&&x.value===D||N)&&(k(S),N&&(V.current=!0))},[x.value]),ce=s.useCallback(()=>y?.focus(),[y]),J=s.useCallback((S,D,Y)=>{const N=!V.current&&!Y;(x.value!==void 0&&x.value===D||N)&&B(S)},[x.value]),le=o==="popper"?pt:ir,q=le===pt?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:m}:{};return l.jsx(sr,{scope:t,content:y,viewport:I,onViewportChange:O,itemRefCallback:te,selectedItem:T,onItemLeave:ce,itemTextRefCallback:J,focusSelectedItem:G,selectedItemText:F,position:o,isPositioned:U,searchRef:Z,children:l.jsx(Ct,{as:Qi,allowPinchZoom:!0,children:l.jsx(Ke,{asChild:!0,trapped:x.open,onMountAutoFocus:S=>{S.preventDefault()},onUnmountAutoFocus:E(r,S=>{x.trigger?.focus({preventScroll:!0}),S.preventDefault()}),children:l.jsx(De,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:S=>S.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:S=>S.preventDefault(),...C,...q,onPlaced:()=>W(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:E(C.onKeyDown,S=>{const D=S.ctrlKey||S.altKey||S.metaKey;if(S.key==="Tab"&&S.preventDefault(),!D&&S.key.length===1&&z(S.key),["ArrowUp","ArrowDown","Home","End"].includes(S.key)){let N=H().filter(j=>!j.disabled).map(j=>j.ref.current);if(["ArrowUp","End"].includes(S.key)&&(N=N.slice().reverse()),["ArrowUp","ArrowDown"].includes(S.key)){const j=S.target,$=N.indexOf(j);N=N.slice($+1)}setTimeout(()=>A(N)),S.preventDefault()}})})})})})})});ar.displayName=Ji;var ec="SelectItemAlignedPosition",ir=s.forwardRef((e,n)=>{const{__scopeSelect:t,onPlaced:o,...r}=e,a=fe(Ce,t),i=pe(Ce,t),[c,u]=s.useState(null),[d,f]=s.useState(null),p=M(n,P=>f(P)),g=Qe(t),h=s.useRef(!1),w=s.useRef(!0),{viewport:v,selectedItem:m,selectedItemText:C,focusSelectedItem:x}=i,y=s.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&m&&C){const P=a.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),F=C.getBoundingClientRect();if(a.dir!=="rtl"){const j=F.left-T.left,$=k.left-j,Q=P.left-$,ve=P.width+Q,tt=Math.max(ve,T.width),nt=window.innerWidth-ne,ot=nn($,[ne,Math.max(ne,nt-tt)]);c.style.minWidth=ve+"px",c.style.left=ot+"px"}else{const j=T.right-F.right,$=window.innerWidth-k.right-j,Q=window.innerWidth-P.right-$,ve=P.width+Q,tt=Math.max(ve,T.width),nt=window.innerWidth-ne,ot=nn($,[ne,Math.max(ne,nt-tt)]);c.style.minWidth=ve+"px",c.style.right=ot+"px"}const B=g(),H=window.innerHeight-ne*2,U=v.scrollHeight,W=window.getComputedStyle(d),V=parseInt(W.borderTopWidth,10),A=parseInt(W.paddingTop,10),G=parseInt(W.borderBottomWidth,10),L=parseInt(W.paddingBottom,10),R=V+A+U+L+G,Z=Math.min(m.offsetHeight*5,R),z=window.getComputedStyle(v),te=parseInt(z.paddingTop,10),ce=parseInt(z.paddingBottom,10),J=P.top+P.height/2-ne,le=H-J,q=m.offsetHeight/2,S=m.offsetTop+q,D=V+A+S,Y=R-D;if(D<=J){const j=B.length>0&&m===B[B.length-1].ref.current;c.style.bottom="0px";const $=d.clientHeight-v.offsetTop-v.offsetHeight,Q=Math.max(le,q+(j?ce:0)+$+G),ve=D+Q;c.style.height=ve+"px"}else{const j=B.length>0&&m===B[0].ref.current;c.style.top="0px";const Q=Math.max(J,V+v.offsetTop+(j?te:0)+q)+Y;c.style.height=Q+"px",v.scrollTop=D-J+v.offsetTop}c.style.margin=`${ne}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=H+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[g,a.trigger,a.valueNode,c,d,v,m,C,a.dir,o]);K(()=>y(),[y]);const[b,I]=s.useState();K(()=>{d&&I(window.getComputedStyle(d).zIndex)},[d]);const O=s.useCallback(P=>{P&&w.current===!0&&(y(),x?.(),w.current=!1)},[y,x]);return l.jsx(nc,{scope:t,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:l.jsx(_.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ir.displayName=ec;var tc="SelectPopperPosition",pt=s.forwardRef((e,n)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=ne,...a}=e,i=et(t);return l.jsx(It,{...i,...a,ref:n,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});pt.displayName=tc;var[nc,Wt]=Pe(Ce,{}),vt="SelectViewport",cr=s.forwardRef((e,n)=>{const{__scopeSelect:t,nonce:o,...r}=e,a=pe(vt,t),i=Wt(vt,t),c=M(n,a.onViewportChange),u=s.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Je.Slot,{scope:t,children:l.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g?.current&&p){const h=Math.abs(u.current-f.scrollTop);if(h>0){const w=window.innerHeight-ne*2,v=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),C=Math.max(v,m);if(C0?b:0,p.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});cr.displayName=vt;var lr="SelectGroup",[oc,rc]=Pe(lr),sc=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=oe();return l.jsx(oc,{scope:t,id:r,children:l.jsx(_.div,{role:"group","aria-labelledby":r,...o,ref:n})})});sc.displayName=lr;var ur="SelectLabel",ac=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=rc(ur,t);return l.jsx(_.div,{id:r.id,...o,ref:n})});ac.displayName=ur;var He="SelectItem",[ic,dr]=Pe(He),fr=s.forwardRef((e,n)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:a,...i}=e,c=fe(He,t),u=pe(He,t),d=c.value===o,[f,p]=s.useState(a??""),[g,h]=s.useState(!1),w=M(n,x=>u.itemRefCallback?.(x,o,r)),v=oe(),m=s.useRef("touch"),C=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(ic,{scope:t,value:o,disabled:r,textId:v,isSelected:d,onItemTextChange:s.useCallback(x=>{p(y=>y||(x?.textContent??"").trim())},[]),children:l.jsx(Je.ItemSlot,{scope:t,value:o,disabled:r,textValue:f,children:l.jsx(_.div,{role:"option","aria-labelledby":v,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:w,onFocus:E(i.onFocus,()=>h(!0)),onBlur:E(i.onBlur,()=>h(!1)),onClick:E(i.onClick,()=>{m.current!=="mouse"&&C()}),onPointerUp:E(i.onPointerUp,()=>{m.current==="mouse"&&C()}),onPointerDown:E(i.onPointerDown,x=>{m.current=x.pointerType}),onPointerMove:E(i.onPointerMove,x=>{m.current=x.pointerType,r?u.onItemLeave?.():m.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:E(i.onKeyDown,x=>{u.searchRef?.current!==""&&x.key===" "||(Wi.includes(x.key)&&C(),x.key===" "&&x.preventDefault())})})})})});fr.displayName=He;var Te="SelectItemText",pr=s.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:r,...a}=e,i=fe(Te,t),c=pe(Te,t),u=dr(Te,t),d=Xi(Te,t),[f,p]=s.useState(null),g=M(n,C=>p(C),u.onItemTextChange,C=>c.itemTextRefCallback?.(C,u.value,u.disabled)),h=f?.textContent,w=s.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:h},u.value),[u.disabled,u.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:m}=d;return K(()=>(v(w),()=>m(w)),[v,m,w]),l.jsxs(l.Fragment,{children:[l.jsx(_.span,{id:u.textId,...a,ref:g}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?xt.createPortal(a.children,i.valueNode):null]})});pr.displayName=Te;var vr="SelectItemIndicator",mr=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return dr(vr,t).isSelected?l.jsx(_.span,{"aria-hidden":!0,...o,ref:n}):null});mr.displayName=vr;var mt="SelectScrollUpButton",gr=s.forwardRef((e,n)=>{const t=pe(mt,e.__scopeSelect),o=Wt(mt,e.__scopeSelect),[r,a]=s.useState(!1),i=M(n,o.onScrollButtonChange);return K(()=>{if(t.viewport&&t.isPositioned){let c=function(){const d=u.scrollTop>0;a(d)};const u=t.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?l.jsx(xr,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=t;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});gr.displayName=mt;var gt="SelectScrollDownButton",hr=s.forwardRef((e,n)=>{const t=pe(gt,e.__scopeSelect),o=Wt(gt,e.__scopeSelect),[r,a]=s.useState(!1),i=M(n,o.onScrollButtonChange);return K(()=>{if(t.viewport&&t.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)u.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?l.jsx(xr,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=t;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});hr.displayName=gt;var xr=s.forwardRef((e,n)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=e,a=pe("SelectScrollButton",t),i=s.useRef(null),c=Qe(t),u=s.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),K(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),l.jsx(_.div,{"aria-hidden":!0,...r,ref:n,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:E(r.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:E(r.onPointerLeave,()=>{u()})})}),cc="SelectSeparator",lc=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return l.jsx(_.div,{"aria-hidden":!0,...o,ref:n})});lc.displayName=cc;var ht="SelectArrow",uc=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=et(t),a=fe(ht,t),i=pe(ht,t);return a.open&&i.position==="popper"?l.jsx(Mt,{...r,...o,ref:n}):null});uc.displayName=ht;var dc="SelectBubbleInput",wr=s.forwardRef(({__scopeSelect:e,value:n,...t},o)=>{const r=s.useRef(null),a=M(o,r),i=Gi(n);return s.useEffect(()=>{const c=r.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==n&&f){const p=new Event("change",{bubbles:!0});f.call(c,n),c.dispatchEvent(p)}},[i,n]),l.jsx(_.select,{...t,style:{...Bn,...t.style},ref:a,defaultValue:n})});wr.displayName=dc;function Cr(e){return e===""||e===void 0}function yr(e){const n=ae(e),t=s.useRef(""),o=s.useRef(0),r=s.useCallback(i=>{const c=t.current+i;n(c),(function u(d){t.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>u(""),1e3))})(c)},[n]),a=s.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,a]}function Er(e,n,t){const r=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,a=t?e.indexOf(t):-1;let i=fc(e,Math.max(a,0));r.length===1&&(i=i.filter(d=>d!==t));const u=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return u!==t?u:void 0}function fc(e,n){return e.map((t,o)=>e[(n+o)%e.length])}var Kc=Zo,Wc=Qo,Vc=tr,zc=nr,Yc=or,Xc=rr,qc=cr,Zc=fr,Jc=pr,Qc=mr,el=gr,tl=hr;export{Ec as A,Wc as B,_s as C,Is as D,zc as E,Yc as F,Xc as G,qc as H,Ac as I,Zc as J,Qc as K,Jc as L,el as M,tl as N,Ps as O,Rs as P,mc as R,vc as S,Ts as T,Vc as V,Ss as a,In as b,hc as c,xc as d,wc as e,Cc as f,yc as g,bc as h,ra as i,sa as j,_c as k,Tc as l,Ic as m,Mc as n,Dc as o,Oc as p,jc as q,kc as r,Uc as s,Hc as t,Bc as u,$c as v,Lc as w,Fc as x,bs as y,Kc as z}; +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(n)},[n,e]),null},Nc=ko,Oc=$o,jc=Bo,Lc=Uo,Fc=Ho,kc=zo,$c=Xo,Bc=Ko,Uc=Vo,Hi="Label",qo=s.forwardRef((e,n)=>l.jsx(_.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));qo.displayName=Hi;var Hc=qo;function nn(e,[n,t]){return Math.min(t,Math.max(n,e))}function Gi(e){const n=s.useRef({value:e,previous:e});return s.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var Ki=[" ","Enter","ArrowUp","ArrowDown"],Wi=[" ","Enter"],we="Select",[Je,Qe,Vi]=Lt(we),[Pe,Gc]=ie(we,[Vi,Re]),et=Re(),[zi,fe]=Pe(we),[Yi,Xi]=Pe(we),Zo=e=>{const{__scopeSelect:n,children:t,open:o,defaultOpen:r,onOpenChange:a,value:i,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:g,required:h,form:w}=e,v=et(n),[m,C]=s.useState(null),[x,y]=s.useState(null),[b,I]=s.useState(!1),O=Ft(d),[P,T]=he({prop:o,defaultProp:r??!1,onChange:a,caller:we}),[k,F]=he({prop:i,defaultProp:c,onChange:u,caller:we}),B=s.useRef(null),H=m?w||!!m.closest("form"):!0,[U,W]=s.useState(new Set),V=Array.from(U).map(A=>A.props.value).join(";");return l.jsx(_t,{...v,children:l.jsxs(zi,{required:h,scope:n,trigger:m,onTriggerChange:C,valueNode:x,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:I,contentId:oe(),value:k,onValueChange:F,open:P,onOpenChange:T,dir:O,triggerPointerDownPosRef:B,disabled:g,children:[l.jsx(Je.Provider,{scope:n,children:l.jsx(Yi,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(A=>{W(G=>new Set(G).add(A))},[]),onNativeOptionRemove:s.useCallback(A=>{W(G=>{const L=new Set(G);return L.delete(A),L})},[]),children:t})}),H?l.jsxs(wr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:k,onChange:A=>F(A.target.value),disabled:g,form:w,children:[k===void 0?l.jsx("option",{value:""}):null,Array.from(U)]},V):null]})})};Zo.displayName=we;var Jo="SelectTrigger",Qo=s.forwardRef((e,n)=>{const{__scopeSelect:t,disabled:o=!1,...r}=e,a=et(t),i=fe(Jo,t),c=i.disabled||o,u=M(n,i.onTriggerChange),d=Qe(t),f=s.useRef("touch"),[p,g,h]=yr(v=>{const m=d().filter(y=>!y.disabled),C=m.find(y=>y.value===i.value),x=Er(m,v,C);x!==void 0&&i.onValueChange(x.value)}),w=v=>{c||(i.onOpenChange(!0),h()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return l.jsx(Tt,{asChild:!0,...a,children:l.jsx(_.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Cr(i.value)?"":void 0,...r,ref:u,onClick:E(r.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&w(v)}),onPointerDown:E(r.onPointerDown,v=>{f.current=v.pointerType;const m=v.target;m.hasPointerCapture(v.pointerId)&&m.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:E(r.onKeyDown,v=>{const m=p.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&g(v.key),!(m&&v.key===" ")&&Ki.includes(v.key)&&(w(),v.preventDefault())})})})});Qo.displayName=Jo;var er="SelectValue",tr=s.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:r,children:a,placeholder:i="",...c}=e,u=fe(er,t),{onValueNodeHasChildrenChange:d}=u,f=a!==void 0,p=M(n,u.onValueNodeChange);return K(()=>{d(f)},[d,f]),l.jsx(_.span,{...c,ref:p,style:{pointerEvents:"none"},children:Cr(u.value)?l.jsx(l.Fragment,{children:i}):a})});tr.displayName=er;var qi="SelectIcon",nr=s.forwardRef((e,n)=>{const{__scopeSelect:t,children:o,...r}=e;return l.jsx(_.span,{"aria-hidden":!0,...r,ref:n,children:o||"▼"})});nr.displayName=qi;var Zi="SelectPortal",or=e=>l.jsx(Ne,{asChild:!0,...e});or.displayName=Zi;var Ce="SelectContent",rr=s.forwardRef((e,n)=>{const t=fe(Ce,e.__scopeSelect),[o,r]=s.useState();if(K(()=>{r(new DocumentFragment)},[]),!t.open){const a=o;return a?xt.createPortal(l.jsx(sr,{scope:e.__scopeSelect,children:l.jsx(Je.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),a):null}return l.jsx(ar,{...e,ref:n})});rr.displayName=Ce;var ne=10,[sr,pe]=Pe(Ce),Ji="SelectContentImpl",Qi=ge("SelectContent.RemoveScroll"),ar=s.forwardRef((e,n)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:m,...C}=e,x=fe(Ce,t),[y,b]=s.useState(null),[I,O]=s.useState(null),P=M(n,S=>b(S)),[T,k]=s.useState(null),[F,B]=s.useState(null),H=Qe(t),[U,W]=s.useState(!1),V=s.useRef(!1);s.useEffect(()=>{if(y)return wt(y)},[y]),yt();const A=s.useCallback(S=>{const[D,...Y]=H().map($=>$.ref.current),[N]=Y.slice(-1),j=document.activeElement;for(const $ of S)if($===j||($?.scrollIntoView({block:"nearest"}),$===D&&I&&(I.scrollTop=0),$===N&&I&&(I.scrollTop=I.scrollHeight),$?.focus(),document.activeElement!==j))return},[H,I]),G=s.useCallback(()=>A([T,y]),[A,T,y]);s.useEffect(()=>{U&&G()},[U,G]);const{onOpenChange:L,triggerPointerDownPosRef:R}=x;s.useEffect(()=>{if(y){let S={x:0,y:0};const D=N=>{S={x:Math.abs(Math.round(N.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(N.pageY)-(R.current?.y??0))}},Y=N=>{S.x<=10&&S.y<=10?N.preventDefault():y.contains(N.target)||L(!1),document.removeEventListener("pointermove",D),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",D),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",Y,{capture:!0})}}},[y,L,R]),s.useEffect(()=>{const S=()=>L(!1);return window.addEventListener("blur",S),window.addEventListener("resize",S),()=>{window.removeEventListener("blur",S),window.removeEventListener("resize",S)}},[L]);const[Z,z]=yr(S=>{const D=H().filter(j=>!j.disabled),Y=D.find(j=>j.ref.current===document.activeElement),N=Er(D,S,Y);N&&setTimeout(()=>N.ref.current.focus())}),te=s.useCallback((S,D,Y)=>{const N=!V.current&&!Y;(x.value!==void 0&&x.value===D||N)&&(k(S),N&&(V.current=!0))},[x.value]),ce=s.useCallback(()=>y?.focus(),[y]),J=s.useCallback((S,D,Y)=>{const N=!V.current&&!Y;(x.value!==void 0&&x.value===D||N)&&B(S)},[x.value]),le=o==="popper"?pt:ir,q=le===pt?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:m}:{};return l.jsx(sr,{scope:t,content:y,viewport:I,onViewportChange:O,itemRefCallback:te,selectedItem:T,onItemLeave:ce,itemTextRefCallback:J,focusSelectedItem:G,selectedItemText:F,position:o,isPositioned:U,searchRef:Z,children:l.jsx(Ct,{as:Qi,allowPinchZoom:!0,children:l.jsx(Ke,{asChild:!0,trapped:x.open,onMountAutoFocus:S=>{S.preventDefault()},onUnmountAutoFocus:E(r,S=>{x.trigger?.focus({preventScroll:!0}),S.preventDefault()}),children:l.jsx(De,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:S=>S.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:S=>S.preventDefault(),...C,...q,onPlaced:()=>W(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:E(C.onKeyDown,S=>{const D=S.ctrlKey||S.altKey||S.metaKey;if(S.key==="Tab"&&S.preventDefault(),!D&&S.key.length===1&&z(S.key),["ArrowUp","ArrowDown","Home","End"].includes(S.key)){let N=H().filter(j=>!j.disabled).map(j=>j.ref.current);if(["ArrowUp","End"].includes(S.key)&&(N=N.slice().reverse()),["ArrowUp","ArrowDown"].includes(S.key)){const j=S.target,$=N.indexOf(j);N=N.slice($+1)}setTimeout(()=>A(N)),S.preventDefault()}})})})})})})});ar.displayName=Ji;var ec="SelectItemAlignedPosition",ir=s.forwardRef((e,n)=>{const{__scopeSelect:t,onPlaced:o,...r}=e,a=fe(Ce,t),i=pe(Ce,t),[c,u]=s.useState(null),[d,f]=s.useState(null),p=M(n,P=>f(P)),g=Qe(t),h=s.useRef(!1),w=s.useRef(!0),{viewport:v,selectedItem:m,selectedItemText:C,focusSelectedItem:x}=i,y=s.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&m&&C){const P=a.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),F=C.getBoundingClientRect();if(a.dir!=="rtl"){const j=F.left-T.left,$=k.left-j,Q=P.left-$,ve=P.width+Q,tt=Math.max(ve,T.width),nt=window.innerWidth-ne,ot=nn($,[ne,Math.max(ne,nt-tt)]);c.style.minWidth=ve+"px",c.style.left=ot+"px"}else{const j=T.right-F.right,$=window.innerWidth-k.right-j,Q=window.innerWidth-P.right-$,ve=P.width+Q,tt=Math.max(ve,T.width),nt=window.innerWidth-ne,ot=nn($,[ne,Math.max(ne,nt-tt)]);c.style.minWidth=ve+"px",c.style.right=ot+"px"}const B=g(),H=window.innerHeight-ne*2,U=v.scrollHeight,W=window.getComputedStyle(d),V=parseInt(W.borderTopWidth,10),A=parseInt(W.paddingTop,10),G=parseInt(W.borderBottomWidth,10),L=parseInt(W.paddingBottom,10),R=V+A+U+L+G,Z=Math.min(m.offsetHeight*5,R),z=window.getComputedStyle(v),te=parseInt(z.paddingTop,10),ce=parseInt(z.paddingBottom,10),J=P.top+P.height/2-ne,le=H-J,q=m.offsetHeight/2,S=m.offsetTop+q,D=V+A+S,Y=R-D;if(D<=J){const j=B.length>0&&m===B[B.length-1].ref.current;c.style.bottom="0px";const $=d.clientHeight-v.offsetTop-v.offsetHeight,Q=Math.max(le,q+(j?ce:0)+$+G),ve=D+Q;c.style.height=ve+"px"}else{const j=B.length>0&&m===B[0].ref.current;c.style.top="0px";const Q=Math.max(J,V+v.offsetTop+(j?te:0)+q)+Y;c.style.height=Q+"px",v.scrollTop=D-J+v.offsetTop}c.style.margin=`${ne}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=H+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[g,a.trigger,a.valueNode,c,d,v,m,C,a.dir,o]);K(()=>y(),[y]);const[b,I]=s.useState();K(()=>{d&&I(window.getComputedStyle(d).zIndex)},[d]);const O=s.useCallback(P=>{P&&w.current===!0&&(y(),x?.(),w.current=!1)},[y,x]);return l.jsx(nc,{scope:t,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:l.jsx(_.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ir.displayName=ec;var tc="SelectPopperPosition",pt=s.forwardRef((e,n)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=ne,...a}=e,i=et(t);return l.jsx(It,{...i,...a,ref:n,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});pt.displayName=tc;var[nc,Wt]=Pe(Ce,{}),vt="SelectViewport",cr=s.forwardRef((e,n)=>{const{__scopeSelect:t,nonce:o,...r}=e,a=pe(vt,t),i=Wt(vt,t),c=M(n,a.onViewportChange),u=s.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Je.Slot,{scope:t,children:l.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g?.current&&p){const h=Math.abs(u.current-f.scrollTop);if(h>0){const w=window.innerHeight-ne*2,v=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),C=Math.max(v,m);if(C0?b:0,p.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});cr.displayName=vt;var lr="SelectGroup",[oc,rc]=Pe(lr),sc=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=oe();return l.jsx(oc,{scope:t,id:r,children:l.jsx(_.div,{role:"group","aria-labelledby":r,...o,ref:n})})});sc.displayName=lr;var ur="SelectLabel",ac=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=rc(ur,t);return l.jsx(_.div,{id:r.id,...o,ref:n})});ac.displayName=ur;var He="SelectItem",[ic,dr]=Pe(He),fr=s.forwardRef((e,n)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:a,...i}=e,c=fe(He,t),u=pe(He,t),d=c.value===o,[f,p]=s.useState(a??""),[g,h]=s.useState(!1),w=M(n,x=>u.itemRefCallback?.(x,o,r)),v=oe(),m=s.useRef("touch"),C=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(ic,{scope:t,value:o,disabled:r,textId:v,isSelected:d,onItemTextChange:s.useCallback(x=>{p(y=>y||(x?.textContent??"").trim())},[]),children:l.jsx(Je.ItemSlot,{scope:t,value:o,disabled:r,textValue:f,children:l.jsx(_.div,{role:"option","aria-labelledby":v,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:w,onFocus:E(i.onFocus,()=>h(!0)),onBlur:E(i.onBlur,()=>h(!1)),onClick:E(i.onClick,()=>{m.current!=="mouse"&&C()}),onPointerUp:E(i.onPointerUp,()=>{m.current==="mouse"&&C()}),onPointerDown:E(i.onPointerDown,x=>{m.current=x.pointerType}),onPointerMove:E(i.onPointerMove,x=>{m.current=x.pointerType,r?u.onItemLeave?.():m.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:E(i.onKeyDown,x=>{u.searchRef?.current!==""&&x.key===" "||(Wi.includes(x.key)&&C(),x.key===" "&&x.preventDefault())})})})})});fr.displayName=He;var Te="SelectItemText",pr=s.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:r,...a}=e,i=fe(Te,t),c=pe(Te,t),u=dr(Te,t),d=Xi(Te,t),[f,p]=s.useState(null),g=M(n,C=>p(C),u.onItemTextChange,C=>c.itemTextRefCallback?.(C,u.value,u.disabled)),h=f?.textContent,w=s.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:h},u.value),[u.disabled,u.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:m}=d;return K(()=>(v(w),()=>m(w)),[v,m,w]),l.jsxs(l.Fragment,{children:[l.jsx(_.span,{id:u.textId,...a,ref:g}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?xt.createPortal(a.children,i.valueNode):null]})});pr.displayName=Te;var vr="SelectItemIndicator",mr=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return dr(vr,t).isSelected?l.jsx(_.span,{"aria-hidden":!0,...o,ref:n}):null});mr.displayName=vr;var mt="SelectScrollUpButton",gr=s.forwardRef((e,n)=>{const t=pe(mt,e.__scopeSelect),o=Wt(mt,e.__scopeSelect),[r,a]=s.useState(!1),i=M(n,o.onScrollButtonChange);return K(()=>{if(t.viewport&&t.isPositioned){let c=function(){const d=u.scrollTop>0;a(d)};const u=t.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?l.jsx(xr,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=t;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});gr.displayName=mt;var gt="SelectScrollDownButton",hr=s.forwardRef((e,n)=>{const t=pe(gt,e.__scopeSelect),o=Wt(gt,e.__scopeSelect),[r,a]=s.useState(!1),i=M(n,o.onScrollButtonChange);return K(()=>{if(t.viewport&&t.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)u.removeEventListener("scroll",c)}},[t.viewport,t.isPositioned]),r?l.jsx(xr,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=t;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});hr.displayName=gt;var xr=s.forwardRef((e,n)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=e,a=pe("SelectScrollButton",t),i=s.useRef(null),c=Qe(t),u=s.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),K(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),l.jsx(_.div,{"aria-hidden":!0,...r,ref:n,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:E(r.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:E(r.onPointerLeave,()=>{u()})})}),cc="SelectSeparator",lc=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return l.jsx(_.div,{"aria-hidden":!0,...o,ref:n})});lc.displayName=cc;var ht="SelectArrow",uc=s.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=et(t),a=fe(ht,t),i=pe(ht,t);return a.open&&i.position==="popper"?l.jsx(Mt,{...r,...o,ref:n}):null});uc.displayName=ht;var dc="SelectBubbleInput",wr=s.forwardRef(({__scopeSelect:e,value:n,...t},o)=>{const r=s.useRef(null),a=M(o,r),i=Gi(n);return s.useEffect(()=>{const c=r.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==n&&f){const p=new Event("change",{bubbles:!0});f.call(c,n),c.dispatchEvent(p)}},[i,n]),l.jsx(_.select,{...t,style:{...Bn,...t.style},ref:a,defaultValue:n})});wr.displayName=dc;function Cr(e){return e===""||e===void 0}function yr(e){const n=ae(e),t=s.useRef(""),o=s.useRef(0),r=s.useCallback(i=>{const c=t.current+i;n(c),(function u(d){t.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>u(""),1e3))})(c)},[n]),a=s.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,a]}function Er(e,n,t){const r=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,a=t?e.indexOf(t):-1;let i=fc(e,Math.max(a,0));r.length===1&&(i=i.filter(d=>d!==t));const u=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return u!==t?u:void 0}function fc(e,n){return e.map((t,o)=>e[(n+o)%e.length])}var Kc=Zo,Wc=Qo,Vc=tr,zc=nr,Yc=or,Xc=rr,qc=cr,Zc=fr,Jc=pr,Qc=mr,el=gr,tl=hr;export{Ec as A,Wc as B,_s as C,Is as D,zc as E,Yc as F,Xc as G,qc as H,Ac as I,Zc as J,Qc as K,Jc as L,el as M,tl as N,Ps as O,Rs as P,mc as R,vc as S,Ts as T,Vc as V,Ss as a,In as b,hc as c,xc as d,wc as e,Cc as f,yc as g,bc as h,ra as i,sa as j,_c as k,Tc as l,Ic as m,Mc as n,Nc as o,Oc as p,Fc as q,Bc as r,Uc as s,$c as t,kc as u,jc as v,Lc as w,bs as x,Hc as y,Kc as z}; diff --git a/internal/ui/dist/assets/router-CyXg69m3.js b/internal/ui/dist/assets/router-CcA--AgE.js similarity index 99% rename from internal/ui/dist/assets/router-CyXg69m3.js rename to internal/ui/dist/assets/router-CcA--AgE.js index bd3f5f5..e8596db 100644 --- a/internal/ui/dist/assets/router-CyXg69m3.js +++ b/internal/ui/dist/assets/router-CcA--AgE.js @@ -1,4 +1,4 @@ -import{r as i}from"./vendor-Cnbx_Mrt.js";function Zt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}/** +import{r as i}from"./vendor-D1z0LlOQ.js";function Zt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}/** * react-router v7.8.2 * * Copyright (c) Remix Software Inc. diff --git a/internal/ui/dist/assets/vendor-Cnbx_Mrt.js b/internal/ui/dist/assets/vendor-D1z0LlOQ.js similarity index 99% rename from internal/ui/dist/assets/vendor-Cnbx_Mrt.js rename to internal/ui/dist/assets/vendor-D1z0LlOQ.js index 5d398fc..c3f2447 100644 --- a/internal/ui/dist/assets/vendor-Cnbx_Mrt.js +++ b/internal/ui/dist/assets/vendor-D1z0LlOQ.js @@ -1,4 +1,4 @@ -import{g as Av}from"./router-CyXg69m3.js";function q0(n,l){for(var i=0;iu[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var Tc={exports:{}},oi={};/** +import{g as Av}from"./router-CcA--AgE.js";function q0(n,l){for(var i=0;iu[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var Tc={exports:{}},oi={};/** * @license React * react-jsx-runtime.production.js * @@ -103,4 +103,4 @@ import{g as Av}from"./router-CyXg69m3.js";function q0(n,l){for(var i=0;i")&&(Y=Y.replace("",t.displayName)),Y}while(1<=r&&0<=o);break}}}finally{wo=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?vl(a):""}function Vy(t){switch(t.tag){case 26:case 27:case 5:return vl(t.type);case 16:return vl("Lazy");case 13:return vl("Suspense");case 19:return vl("SuspenseList");case 0:case 15:return xo(t.type,!1);case 11:return xo(t.type.render,!1);case 1:return xo(t.type,!0);case 31:return vl("Activity");default:return""}}function Nf(t){try{var e="";do e+=Vy(t),t=t.return;while(t);return e}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}function rn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Uf(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function By(t){var e=Uf(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,s=a.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(h){r=""+h,s.call(this,h)}}),Object.defineProperty(t,e,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(h){r=""+h},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function zi(t){t._valueTracker||(t._valueTracker=By(t))}function Zf(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=Uf(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Ti(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Hy=/[\n"\\]/g;function un(t){return t.replace(Hy,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Eo(t,e,a,r,o,s,h,g){t.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.type=h:t.removeAttribute("type"),e!=null?h==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+rn(e)):t.value!==""+rn(e)&&(t.value=""+rn(e)):h!=="submit"&&h!=="reset"||t.removeAttribute("value"),e!=null?Ao(t,h,rn(e)):a!=null?Ao(t,h,rn(a)):r!=null&&t.removeAttribute("value"),o==null&&s!=null&&(t.defaultChecked=!!s),o!=null&&(t.checked=o&&typeof o!="function"&&typeof o!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.name=""+rn(g):t.removeAttribute("name")}function Vf(t,e,a,r,o,s,h,g){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||a!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;a=a!=null?""+rn(a):"",e=e!=null?""+rn(e):a,g||e===t.value||(t.value=e),t.defaultValue=e}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=g?t.checked:!!r,t.defaultChecked=!!r,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.name=h)}function Ao(t,e,a){e==="number"&&Ti(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function yl(t,e,a,r){if(t=t.options,e){e={};for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Do=!1;if(Xn)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){Do=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{Do=!1}var da=null,Mo=null,Ri=null;function Gf(){if(Ri)return Ri;var t,e=Mo,a=e.length,r,o="value"in da?da.value:da.textContent,s=o.length;for(t=0;t=Sr),Ff=" ",Wf=!1;function Pf(t,e){switch(t){case"keyup":return hp.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function If(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _l=!1;function gp(t,e){switch(t){case"compositionend":return If(e);case"keypress":return e.which!==32?null:(Wf=!0,Ff);case"textInput":return t=e.data,t===Ff&&Wf?null:t;default:return null}}function vp(t,e){if(_l)return t==="compositionend"||!Zo&&Pf(t,e)?(t=Gf(),Ri=Mo=da=null,_l=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:a,offset:e-t};t=r}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=ud(a)}}function sd(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?sd(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function cd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ti(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=Ti(t.document)}return e}function Ho(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Ep=Xn&&"documentMode"in document&&11>=document.documentMode,wl=null,jo=null,Er=null,Lo=!1;function fd(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Lo||wl==null||wl!==Ti(r)||(r=wl,"selectionStart"in r&&Ho(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&xr(Er,r)||(Er=r,r=bu(jo,"onSelect"),0>=h,o-=h,$n=1<<32-jt(e)+o|a<s?s:8;var h=A.T,g={};A.T=g,zs(t,!1,e,a);try{var S=o(),R=A.S;if(R!==null&&R(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var Y=kp(S,r);Hr(t,e,Y,Ie(t))}else Hr(t,e,r,Ie(t))}catch($){Hr(t,e,{then:function(){},status:"rejected",reason:$},Ie())}finally{L.p=s,A.T=h}}function Bp(){}function Es(t,e,a,r){if(t.tag!==5)throw Error(u(476));var o=dh(t).queue;fh(t,o,e,U,a===null?Bp:function(){return hh(t),a(r)})}function dh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:U},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function hh(t){var e=dh(t).next.queue;Hr(t,e,{},Ie())}function As(){return Ne(ai)}function mh(){return he().memoizedState}function gh(){return he().memoizedState}function Hp(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=Ie();t=ga(a);var r=va(e,t,a);r!==null&&(tn(r,e,a),kr(r,e,a)),e={cache:es()},t.payload=e;return}e=e.return}}function jp(t,e,a){var r=Ie();a={lane:r,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Ii(t)?yh(e,a):(a=Xo(t,e,a,r),a!==null&&(tn(a,t,r),ph(a,e,r)))}function vh(t,e,a){var r=Ie();Hr(t,e,a,r)}function Hr(t,e,a,r){var o={lane:r,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ii(t))yh(e,o);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var h=e.lastRenderedState,g=s(h,a);if(o.hasEagerState=!0,o.eagerState=g,Ke(g,h))return Zi(t,e,o,0),Jt===null&&Ui(),!1}catch{}finally{}if(a=Xo(t,e,o,r),a!==null)return tn(a,t,r),ph(a,e,r),!0}return!1}function zs(t,e,a,r){if(r={lane:2,revertLane:lc(),action:r,hasEagerState:!1,eagerState:null,next:null},Ii(t)){if(e)throw Error(u(479))}else e=Xo(t,a,r,2),e!==null&&tn(e,t,2)}function Ii(t){var e=t.alternate;return t===Mt||e!==null&&e===Mt}function yh(t,e){Cl=$i=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function ph(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,le(t,a)}}var tu={readContext:Ne,use:Ji,useCallback:ue,useContext:ue,useEffect:ue,useImperativeHandle:ue,useLayoutEffect:ue,useInsertionEffect:ue,useMemo:ue,useReducer:ue,useRef:ue,useState:ue,useDebugValue:ue,useDeferredValue:ue,useTransition:ue,useSyncExternalStore:ue,useId:ue,useHostTransitionStatus:ue,useFormState:ue,useActionState:ue,useOptimistic:ue,useMemoCache:ue,useCacheRefresh:ue},bh={readContext:Ne,use:Ji,useCallback:function(t,e){return Le().memoizedState=[t,e===void 0?null:e],t},useContext:Ne,useEffect:nh,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Pi(4194308,4,ih.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Pi(4194308,4,t,e)},useInsertionEffect:function(t,e){Pi(4,2,t,e)},useMemo:function(t,e){var a=Le();e=e===void 0?null:e;var r=t();if(Ia){kt(!0);try{t()}finally{kt(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=Le();if(a!==void 0){var o=a(e);if(Ia){kt(!0);try{a(e)}finally{kt(!1)}}}else o=e;return r.memoizedState=r.baseState=o,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:o},r.queue=t,t=t.dispatch=jp.bind(null,Mt,t),[r.memoizedState,t]},useRef:function(t){var e=Le();return t={current:t},e.memoizedState=t},useState:function(t){t=Ss(t);var e=t.queue,a=vh.bind(null,Mt,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:ws,useDeferredValue:function(t,e){var a=Le();return xs(a,t,e)},useTransition:function(){var t=Ss(!1);return t=fh.bind(null,Mt,t.queue,!0,!1),Le().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=Mt,o=Le();if(Ht){if(a===void 0)throw Error(u(407));a=a()}else{if(a=e(),Jt===null)throw Error(u(349));(Vt&124)!==0||jd(r,e,a)}o.memoizedState=a;var s={value:a,getSnapshot:e};return o.queue=s,nh(Yd.bind(null,r,s,t),[t]),r.flags|=2048,Nl(9,Wi(),Ld.bind(null,r,s,a,e),null),a},useId:function(){var t=Le(),e=Jt.identifierPrefix;if(Ht){var a=Kn,r=$n;a=(r&~(1<<32-jt(r)-1)).toString(32)+a,e="«"+e+"R"+a,a=Ki++,0wt?(Oe=pt,pt=null):Oe=pt.sibling;var Bt=M(z,pt,O[wt],G);if(Bt===null){pt===null&&(pt=Oe);break}t&&pt&&Bt.alternate===null&&e(z,pt),E=s(Bt,E,wt),Nt===null?ct=Bt:Nt.sibling=Bt,Nt=Bt,pt=Oe}if(wt===O.length)return a(z,pt),Ht&&$a(z,wt),ct;if(pt===null){for(;wtwt?(Oe=pt,pt=null):Oe=pt.sibling;var ka=M(z,pt,Bt.value,G);if(ka===null){pt===null&&(pt=Oe);break}t&&pt&&ka.alternate===null&&e(z,pt),E=s(ka,E,wt),Nt===null?ct=ka:Nt.sibling=ka,Nt=ka,pt=Oe}if(Bt.done)return a(z,pt),Ht&&$a(z,wt),ct;if(pt===null){for(;!Bt.done;wt++,Bt=O.next())Bt=$(z,Bt.value,G),Bt!==null&&(E=s(Bt,E,wt),Nt===null?ct=Bt:Nt.sibling=Bt,Nt=Bt);return Ht&&$a(z,wt),ct}for(pt=r(pt);!Bt.done;wt++,Bt=O.next())Bt=N(pt,z,wt,Bt.value,G),Bt!==null&&(t&&Bt.alternate!==null&&pt.delete(Bt.key===null?wt:Bt.key),E=s(Bt,E,wt),Nt===null?ct=Bt:Nt.sibling=Bt,Nt=Bt);return t&&pt.forEach(function(Y0){return e(z,Y0)}),Ht&&$a(z,wt),ct}function Qt(z,E,O,G){if(typeof O=="object"&&O!==null&&O.type===k&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case x:t:{for(var ct=O.key;E!==null;){if(E.key===ct){if(ct=O.type,ct===k){if(E.tag===7){a(z,E.sibling),G=o(E,O.props.children),G.return=z,z=G;break t}}else if(E.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===W&&_h(ct)===E.type){a(z,E.sibling),G=o(E,O.props),Lr(G,O),G.return=z,z=G;break t}a(z,E);break}else e(z,E);E=E.sibling}O.type===k?(G=Xa(O.props.children,z.mode,G,O.key),G.return=z,z=G):(G=Bi(O.type,O.key,O.props,null,z.mode,G),Lr(G,O),G.return=z,z=G)}return h(z);case T:t:{for(ct=O.key;E!==null;){if(E.key===ct)if(E.tag===4&&E.stateNode.containerInfo===O.containerInfo&&E.stateNode.implementation===O.implementation){a(z,E.sibling),G=o(E,O.children||[]),G.return=z,z=G;break t}else{a(z,E);break}else e(z,E);E=E.sibling}G=Ko(O,z.mode,G),G.return=z,z=G}return h(z);case W:return ct=O._init,O=ct(O._payload),Qt(z,E,O,G)}if(bt(O))return xt(z,E,O,G);if(lt(O)){if(ct=lt(O),typeof ct!="function")throw Error(u(150));return O=ct.call(O),_t(z,E,O,G)}if(typeof O.then=="function")return Qt(z,E,eu(O),G);if(O.$$typeof===K)return Qt(z,E,Yi(z,O),G);nu(z,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,E!==null&&E.tag===6?(a(z,E.sibling),G=o(E,O),G.return=z,z=G):(a(z,E),G=$o(O,z.mode,G),G.return=z,z=G),h(z)):a(z,E)}return function(z,E,O,G){try{jr=0;var ct=Qt(z,E,O,G);return Ul=null,ct}catch(pt){if(pt===Mr||pt===Gi)throw pt;var Nt=Je(29,pt,null,z.mode);return Nt.lanes=G,Nt.return=z,Nt}finally{}}}var Zl=wh(!0),xh=wh(!1),dn=Q(null),Dn=null;function pa(t){var e=t.alternate;j(pe,pe.current&1),j(dn,t),Dn===null&&(e===null||Ml.current!==null||e.memoizedState!==null)&&(Dn=t)}function Eh(t){if(t.tag===22){if(j(pe,pe.current),j(dn,t),Dn===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Dn=t)}}else ba()}function ba(){j(pe,pe.current),j(dn,dn.current)}function Pn(t){at(dn),Dn===t&&(Dn=null),at(pe)}var pe=Q(0);function au(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||vc(a)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function Ts(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:b({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Os={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=Ie(),o=ga(r);o.payload=e,a!=null&&(o.callback=a),e=va(t,o,r),e!==null&&(tn(e,t,r),kr(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=Ie(),o=ga(r);o.tag=1,o.payload=e,a!=null&&(o.callback=a),e=va(t,o,r),e!==null&&(tn(e,t,r),kr(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=Ie(),r=ga(a);r.tag=2,e!=null&&(r.callback=e),e=va(t,r,a),e!==null&&(tn(e,t,a),kr(e,t,a))}};function Ah(t,e,a,r,o,s,h){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,h):e.prototype&&e.prototype.isPureReactComponent?!xr(a,r)||!xr(o,s):!0}function zh(t,e,a,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,r),e.state!==t&&Os.enqueueReplaceState(e,e.state,null)}function tl(t,e){var a=e;if("ref"in e){a={};for(var r in e)r!=="ref"&&(a[r]=e[r])}if(t=t.defaultProps){a===e&&(a=b({},a));for(var o in t)a[o]===void 0&&(a[o]=t[o])}return a}var lu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Th(t){lu(t)}function Oh(t){console.error(t)}function Rh(t){lu(t)}function ru(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function Dh(t,e,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Rs(t,e,a){return a=ga(a),a.tag=3,a.payload={element:null},a.callback=function(){ru(t,e)},a}function Mh(t){return t=ga(t),t.tag=3,t}function Ch(t,e,a,r){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var s=r.value;t.payload=function(){return o(s)},t.callback=function(){Dh(e,a,r)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(t.callback=function(){Dh(e,a,r),typeof o!="function"&&(Aa===null?Aa=new Set([this]):Aa.add(this));var g=r.stack;this.componentDidCatch(r.value,{componentStack:g!==null?g:""})})}function Yp(t,e,a,r,o){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&Or(e,a,o,!0),a=dn.current,a!==null){switch(a.tag){case 13:return Dn===null?Is():a.alternate===null&&ae===0&&(ae=3),a.flags&=-257,a.flags|=65536,a.lanes=o,r===ls?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),ec(t,r,o)),!1;case 22:return a.flags|=65536,r===ls?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([r]):a.add(r)),ec(t,r,o)),!1}throw Error(u(435,a.tag))}return ec(t,r,o),Is(),!1}if(Ht)return e=dn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=o,r!==Wo&&(t=Error(u(422),{cause:r}),Tr(on(t,a)))):(r!==Wo&&(e=Error(u(423),{cause:r}),Tr(on(e,a))),t=t.current.alternate,t.flags|=65536,o&=-o,t.lanes|=o,r=on(r,a),o=Rs(t.stateNode,r,o),us(t,o),ae!==4&&(ae=2)),!1;var s=Error(u(520),{cause:r});if(s=on(s,a),Kr===null?Kr=[s]:Kr.push(s),ae!==4&&(ae=2),e===null)return!0;r=on(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=o&-o,a.lanes|=t,t=Rs(a.stateNode,r,t),us(a,t),!1;case 1:if(e=a.type,s=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Aa===null||!Aa.has(s))))return a.flags|=65536,o&=-o,a.lanes|=o,o=Mh(o),Ch(o,t,a,r),us(a,o),!1}a=a.return}while(a!==null);return!1}var kh=Error(u(461)),ze=!1;function Me(t,e,a,r){e.child=t===null?xh(e,null,a,r):Zl(e,t.child,a,r)}function Nh(t,e,a,r,o){a=a.render;var s=e.ref;if("ref"in r){var h={};for(var g in r)g!=="ref"&&(h[g]=r[g])}else h=r;return Wa(e),r=ds(t,e,a,h,s,o),g=hs(),t!==null&&!ze?(ms(t,e,o),In(t,e,o)):(Ht&&g&&Jo(e),e.flags|=1,Me(t,e,r,o),e.child)}function Uh(t,e,a,r,o){if(t===null){var s=a.type;return typeof s=="function"&&!Qo(s)&&s.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=s,Zh(t,e,s,r,o)):(t=Bi(a.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!Vs(t,o)){var h=s.memoizedProps;if(a=a.compare,a=a!==null?a:xr,a(h,r)&&t.ref===e.ref)return In(t,e,o)}return e.flags|=1,t=Qn(s,r),t.ref=e.ref,t.return=e,e.child=t}function Zh(t,e,a,r,o){if(t!==null){var s=t.memoizedProps;if(xr(s,r)&&t.ref===e.ref)if(ze=!1,e.pendingProps=r=s,Vs(t,o))(t.flags&131072)!==0&&(ze=!0);else return e.lanes=t.lanes,In(t,e,o)}return Ds(t,e,a,r,o)}function Vh(t,e,a){var r=e.pendingProps,o=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden"){if((e.flags&128)!==0){if(r=s!==null?s.baseLanes|a:a,t!==null){for(o=e.child=t.child,s=0;o!==null;)s=s|o.lanes|o.childLanes,o=o.sibling;e.childLanes=s&~r}else e.childLanes=0,e.child=null;return Bh(t,e,r,a)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&qi(e,s!==null?s.cachePool:null),s!==null?Zd(e,s):ss(),Eh(e);else return e.lanes=e.childLanes=536870912,Bh(t,e,s!==null?s.baseLanes|a:a,a)}else s!==null?(qi(e,s.cachePool),Zd(e,s),ba(),e.memoizedState=null):(t!==null&&qi(e,null),ss(),ba());return Me(t,e,o,a),e.child}function Bh(t,e,a,r){var o=as();return o=o===null?null:{parent:ye._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&qi(e,null),ss(),Eh(e),t!==null&&Or(t,e,r,!0),null}function iu(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function Ds(t,e,a,r,o){return Wa(e),a=ds(t,e,a,r,void 0,o),r=hs(),t!==null&&!ze?(ms(t,e,o),In(t,e,o)):(Ht&&r&&Jo(e),e.flags|=1,Me(t,e,a,o),e.child)}function Hh(t,e,a,r,o,s){return Wa(e),e.updateQueue=null,a=Bd(e,r,a,o),Vd(t),r=hs(),t!==null&&!ze?(ms(t,e,s),In(t,e,s)):(Ht&&r&&Jo(e),e.flags|=1,Me(t,e,a,s),e.child)}function jh(t,e,a,r,o){if(Wa(e),e.stateNode===null){var s=zl,h=a.contextType;typeof h=="object"&&h!==null&&(s=Ne(h)),s=new a(r,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Os,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=r,s.state=e.memoizedState,s.refs={},rs(e),h=a.contextType,s.context=typeof h=="object"&&h!==null?Ne(h):zl,s.state=e.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(Ts(e,a,h,r),s.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(h=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),h!==s.state&&Os.enqueueReplaceState(s,s.state,null),Ur(e,r,s,o),Nr(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){s=e.stateNode;var g=e.memoizedProps,S=tl(a,g);s.props=S;var R=s.context,Y=a.contextType;h=zl,typeof Y=="object"&&Y!==null&&(h=Ne(Y));var $=a.getDerivedStateFromProps;Y=typeof $=="function"||typeof s.getSnapshotBeforeUpdate=="function",g=e.pendingProps!==g,Y||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g||R!==h)&&zh(e,s,r,h),ma=!1;var M=e.memoizedState;s.state=M,Ur(e,r,s,o),Nr(),R=e.memoizedState,g||M!==R||ma?(typeof $=="function"&&(Ts(e,a,$,r),R=e.memoizedState),(S=ma||Ah(e,a,S,r,M,R,h))?(Y||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=R),s.props=r,s.state=R,s.context=h,r=S):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,is(t,e),h=e.memoizedProps,Y=tl(a,h),s.props=Y,$=e.pendingProps,M=s.context,R=a.contextType,S=zl,typeof R=="object"&&R!==null&&(S=Ne(R)),g=a.getDerivedStateFromProps,(R=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(h!==$||M!==S)&&zh(e,s,r,S),ma=!1,M=e.memoizedState,s.state=M,Ur(e,r,s,o),Nr();var N=e.memoizedState;h!==$||M!==N||ma||t!==null&&t.dependencies!==null&&Li(t.dependencies)?(typeof g=="function"&&(Ts(e,a,g,r),N=e.memoizedState),(Y=ma||Ah(e,a,Y,r,M,N,S)||t!==null&&t.dependencies!==null&&Li(t.dependencies))?(R||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,N,S),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,N,S)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||h===t.memoizedProps&&M===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||h===t.memoizedProps&&M===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=N),s.props=r,s.state=N,s.context=S,r=Y):(typeof s.componentDidUpdate!="function"||h===t.memoizedProps&&M===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||h===t.memoizedProps&&M===t.memoizedState||(e.flags|=1024),r=!1)}return s=r,iu(t,e),r=(e.flags&128)!==0,s||r?(s=e.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&r?(e.child=Zl(e,t.child,null,o),e.child=Zl(e,null,a,o)):Me(t,e,a,o),e.memoizedState=s.state,t=e.child):t=In(t,e,o),t}function Lh(t,e,a,r){return zr(),e.flags|=256,Me(t,e,a,r),e.child}var Ms={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cs(t){return{baseLanes:t,cachePool:Od()}}function ks(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=hn),t}function Yh(t,e,a){var r=e.pendingProps,o=!1,s=(e.flags&128)!==0,h;if((h=s)||(h=t!==null&&t.memoizedState===null?!1:(pe.current&2)!==0),h&&(o=!0,e.flags&=-129),h=(e.flags&32)!==0,e.flags&=-33,t===null){if(Ht){if(o?pa(e):ba(),Ht){var g=ne,S;if(S=g){t:{for(S=g,g=Rn;S.nodeType!==8;){if(!g){g=null;break t}if(S=bn(S.nextSibling),S===null){g=null;break t}}g=S}g!==null?(e.memoizedState={dehydrated:g,treeContext:Qa!==null?{id:$n,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},S=Je(18,null,null,0),S.stateNode=g,S.return=e,e.child=S,Be=e,ne=null,S=!0):S=!1}S||Ja(e)}if(g=e.memoizedState,g!==null&&(g=g.dehydrated,g!==null))return vc(g)?e.lanes=32:e.lanes=536870912,null;Pn(e)}return g=r.children,r=r.fallback,o?(ba(),o=e.mode,g=uu({mode:"hidden",children:g},o),r=Xa(r,o,a,null),g.return=e,r.return=e,g.sibling=r,e.child=g,o=e.child,o.memoizedState=Cs(a),o.childLanes=ks(t,h,a),e.memoizedState=Ms,r):(pa(e),Ns(e,g))}if(S=t.memoizedState,S!==null&&(g=S.dehydrated,g!==null)){if(s)e.flags&256?(pa(e),e.flags&=-257,e=Us(t,e,a)):e.memoizedState!==null?(ba(),e.child=t.child,e.flags|=128,e=null):(ba(),o=r.fallback,g=e.mode,r=uu({mode:"visible",children:r.children},g),o=Xa(o,g,a,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,Zl(e,t.child,null,a),r=e.child,r.memoizedState=Cs(a),r.childLanes=ks(t,h,a),e.memoizedState=Ms,e=o);else if(pa(e),vc(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var R=h.dgst;h=R,r=Error(u(419)),r.stack="",r.digest=h,Tr({value:r,source:null,stack:null}),e=Us(t,e,a)}else if(ze||Or(t,e,a,!1),h=(a&t.childLanes)!==0,ze||h){if(h=Jt,h!==null&&(r=a&-a,r=(r&42)!==0?1:fe(r),r=(r&(h.suspendedLanes|a))!==0?0:r,r!==0&&r!==S.retryLane))throw S.retryLane=r,Al(t,r),tn(h,t,r),kh;g.data==="$?"||Is(),e=Us(t,e,a)}else g.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=S.treeContext,ne=bn(g.nextSibling),Be=e,Ht=!0,Ka=null,Rn=!1,t!==null&&(cn[fn++]=$n,cn[fn++]=Kn,cn[fn++]=Qa,$n=t.id,Kn=t.overflow,Qa=e),e=Ns(e,r.children),e.flags|=4096);return e}return o?(ba(),o=r.fallback,g=e.mode,S=t.child,R=S.sibling,r=Qn(S,{mode:"hidden",children:r.children}),r.subtreeFlags=S.subtreeFlags&65011712,R!==null?o=Qn(R,o):(o=Xa(o,g,a,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,g=t.child.memoizedState,g===null?g=Cs(a):(S=g.cachePool,S!==null?(R=ye._currentValue,S=S.parent!==R?{parent:R,pool:R}:S):S=Od(),g={baseLanes:g.baseLanes|a,cachePool:S}),o.memoizedState=g,o.childLanes=ks(t,h,a),e.memoizedState=Ms,r):(pa(e),a=t.child,t=a.sibling,a=Qn(a,{mode:"visible",children:r.children}),a.return=e,a.sibling=null,t!==null&&(h=e.deletions,h===null?(e.deletions=[t],e.flags|=16):h.push(t)),e.child=a,e.memoizedState=null,a)}function Ns(t,e){return e=uu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function uu(t,e){return t=Je(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Us(t,e,a){return Zl(e,t.child,null,a),t=Ns(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function qh(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Io(t.return,e,a)}function Zs(t,e,a,r,o){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=a,s.tailMode=o)}function Gh(t,e,a){var r=e.pendingProps,o=r.revealOrder,s=r.tail;if(Me(t,e,r.children,a),r=pe.current,(r&2)!==0)r=r&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qh(t,a,e);else if(t.tag===19)qh(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}switch(j(pe,r),o){case"forwards":for(a=e.child,o=null;a!==null;)t=a.alternate,t!==null&&au(t)===null&&(o=a),a=a.sibling;a=o,a===null?(o=e.child,e.child=null):(o=a.sibling,a.sibling=null),Zs(e,!1,o,a,s);break;case"backwards":for(a=null,o=e.child,e.child=null;o!==null;){if(t=o.alternate,t!==null&&au(t)===null){e.child=o;break}t=o.sibling,o.sibling=a,a=o,o=t}Zs(e,!0,a,null,s);break;case"together":Zs(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function In(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Ea|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(Or(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(u(153));if(e.child!==null){for(t=e.child,a=Qn(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Qn(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function Vs(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Li(t)))}function qp(t,e,a){switch(e.tag){case 3:St(e,e.stateNode.containerInfo),ha(e,ye,t.memoizedState.cache),zr();break;case 27:case 5:Re(e);break;case 4:St(e,e.stateNode.containerInfo);break;case 10:ha(e,e.type,e.memoizedProps.value);break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(pa(e),e.flags|=128,null):(a&e.child.childLanes)!==0?Yh(t,e,a):(pa(e),t=In(t,e,a),t!==null?t.sibling:null);pa(e);break;case 19:var o=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(Or(t,e,a,!1),r=(a&e.childLanes)!==0),o){if(r)return Gh(t,e,a);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),j(pe,pe.current),r)break;return null;case 22:case 23:return e.lanes=0,Vh(t,e,a);case 24:ha(e,ye,t.memoizedState.cache)}return In(t,e,a)}function Xh(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)ze=!0;else{if(!Vs(t,a)&&(e.flags&128)===0)return ze=!1,qp(t,e,a);ze=(t.flags&131072)!==0}else ze=!1,Ht&&(e.flags&1048576)!==0&&_d(e,ji,e.index);switch(e.lanes=0,e.tag){case 16:t:{t=e.pendingProps;var r=e.elementType,o=r._init;if(r=o(r._payload),e.type=r,typeof r=="function")Qo(r)?(t=tl(r,t),e.tag=1,e=jh(null,e,r,t,a)):(e.tag=0,e=Ds(null,e,r,t,a));else{if(r!=null){if(o=r.$$typeof,o===F){e.tag=11,e=Nh(null,e,r,t,a);break t}else if(o===ut){e.tag=14,e=Uh(null,e,r,t,a);break t}}throw e=yt(r)||r,Error(u(306,e,""))}}return e;case 0:return Ds(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,o=tl(r,e.pendingProps),jh(t,e,r,o,a);case 3:t:{if(St(e,e.stateNode.containerInfo),t===null)throw Error(u(387));r=e.pendingProps;var s=e.memoizedState;o=s.element,is(t,e),Ur(e,r,null,a);var h=e.memoizedState;if(r=h.cache,ha(e,ye,r),r!==s.cache&&ts(e,[ye],a,!0),Nr(),r=h.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:h.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=Lh(t,e,r,a);break t}else if(r!==o){o=on(Error(u(424)),e),Tr(o),e=Lh(t,e,r,a);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ne=bn(t.firstChild),Be=e,Ht=!0,Ka=null,Rn=!0,a=xh(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(zr(),r===o){e=In(t,e,a);break t}Me(t,e,r,a)}e=e.child}return e;case 26:return iu(t,e),t===null?(a=Jm(e.type,null,e.pendingProps,null))?e.memoizedState=a:Ht||(a=e.type,t=e.pendingProps,r=_u(mt.current).createElement(a),r[ie]=e,r[Kt]=t,ke(r,a,t),Ae(r),e.stateNode=r):e.memoizedState=Jm(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Re(e),t===null&&Ht&&(r=e.stateNode=Qm(e.type,e.pendingProps,mt.current),Be=e,Rn=!0,o=ne,Oa(e.type)?(yc=o,ne=bn(r.firstChild)):ne=o),Me(t,e,e.pendingProps.children,a),iu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Ht&&((o=r=ne)&&(r=y0(r,e.type,e.pendingProps,Rn),r!==null?(e.stateNode=r,Be=e,ne=bn(r.firstChild),Rn=!1,o=!0):o=!1),o||Ja(e)),Re(e),o=e.type,s=e.pendingProps,h=t!==null?t.memoizedProps:null,r=s.children,hc(o,s)?r=null:h!==null&&hc(o,h)&&(e.flags|=32),e.memoizedState!==null&&(o=ds(t,e,Up,null,null,a),ai._currentValue=o),iu(t,e),Me(t,e,r,a),e.child;case 6:return t===null&&Ht&&((t=a=ne)&&(a=p0(a,e.pendingProps,Rn),a!==null?(e.stateNode=a,Be=e,ne=null,t=!0):t=!1),t||Ja(e)),null;case 13:return Yh(t,e,a);case 4:return St(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Zl(e,null,r,a):Me(t,e,r,a),e.child;case 11:return Nh(t,e,e.type,e.pendingProps,a);case 7:return Me(t,e,e.pendingProps,a),e.child;case 8:return Me(t,e,e.pendingProps.children,a),e.child;case 12:return Me(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,ha(e,e.type,r.value),Me(t,e,r.children,a),e.child;case 9:return o=e.type._context,r=e.pendingProps.children,Wa(e),o=Ne(o),r=r(o),e.flags|=1,Me(t,e,r,a),e.child;case 14:return Uh(t,e,e.type,e.pendingProps,a);case 15:return Zh(t,e,e.type,e.pendingProps,a);case 19:return Gh(t,e,a);case 31:return r=e.pendingProps,a=e.mode,r={mode:r.mode,children:r.children},t===null?(a=uu(r,a),a.ref=e.ref,e.child=a,a.return=e,e=a):(a=Qn(t.child,r),a.ref=e.ref,e.child=a,a.return=e,e=a),e;case 22:return Vh(t,e,a);case 24:return Wa(e),r=Ne(ye),t===null?(o=as(),o===null&&(o=Jt,s=es(),o.pooledCache=s,s.refCount++,s!==null&&(o.pooledCacheLanes|=a),o=s),e.memoizedState={parent:r,cache:o},rs(e),ha(e,ye,o)):((t.lanes&a)!==0&&(is(t,e),Ur(e,null,null,a),Nr()),o=t.memoizedState,s=e.memoizedState,o.parent!==r?(o={parent:r,cache:r},e.memoizedState=o,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=o),ha(e,ye,r)):(r=s.cache,ha(e,ye,r),r!==o.cache&&ts(e,[ye],a,!0))),Me(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(u(156,e.tag))}function ta(t){t.flags|=4}function Qh(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!tg(e)){if(e=dn.current,e!==null&&((Vt&4194048)===Vt?Dn!==null:(Vt&62914560)!==Vt&&(Vt&536870912)===0||e!==Dn))throw Cr=ls,Rd;t.flags|=8192}}function ou(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?wi():536870912,t.lanes|=e,jl|=e)}function Yr(t,e){if(!Ht)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function te(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(e)for(var o=t.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=t,o=o.sibling;else for(o=t.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=t,o=o.sibling;return t.subtreeFlags|=r,t.childLanes=a,e}function Gp(t,e,a){var r=e.pendingProps;switch(Fo(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return te(e),null;case 1:return te(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Fn(ye),Wt(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Ar(e)?ta(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Ed())),te(e),null;case 26:return a=e.memoizedState,t===null?(ta(e),a!==null?(te(e),Qh(e,a)):(te(e),e.flags&=-16777217)):a?a!==t.memoizedState?(ta(e),te(e),Qh(e,a)):(te(e),e.flags&=-16777217):(t.memoizedProps!==r&&ta(e),te(e),e.flags&=-16777217),null;case 27:Ze(e),a=mt.current;var o=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ta(e);else{if(!r){if(e.stateNode===null)throw Error(u(166));return te(e),null}t=P.current,Ar(e)?wd(e):(t=Qm(o,r,a),e.stateNode=t,ta(e))}return te(e),null;case 5:if(Ze(e),a=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ta(e);else{if(!r){if(e.stateNode===null)throw Error(u(166));return te(e),null}if(t=P.current,Ar(e))wd(e);else{switch(o=_u(mt.current),t){case 1:t=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:t=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":t=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":t=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":t=o.createElement("div"),t.innerHTML=" - - - - - + + + + + +
diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 6de7d66..e7e8712 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -10,11 +10,12 @@ import { Me } from "@/pages/auth/me.tsx" import { Register } from "@/pages/auth/register.tsx" import { ResetPassword } from "@/pages/auth/reset-password.tsx" import { VerifyEmail } from "@/pages/auth/verify-email.tsx" +import { ServersPage } from "@/pages/core/servers-page.tsx" import { Forbidden } from "@/pages/error/forbidden.tsx" import { NotFoundPage } from "@/pages/error/not-found.tsx" +import { SshKeysPage } from "@/pages/security/ssh.tsx" import { MemberManagement } from "@/pages/settings/members.tsx" import { OrgManagement } from "@/pages/settings/orgs.tsx" -import {SshKeysPage} from "@/pages/security/ssh.tsx"; function App() { return ( @@ -39,10 +40,11 @@ function App() { + } /> {/* } /> } /> - } /> + } /> */} diff --git a/ui/src/pages/core/servers-page.tsx b/ui/src/pages/core/servers-page.tsx new file mode 100644 index 0000000..c70f7de --- /dev/null +++ b/ui/src/pages/core/servers-page.tsx @@ -0,0 +1,699 @@ +// src/pages/core/servers-page.tsx +import { useEffect, useMemo, useState } from "react" +import { zodResolver } from "@hookform/resolvers/zod" +import { Pencil, Plus, RefreshCw, Search, Trash } from "lucide-react" +import { useForm } from "react-hook-form" +import { z } from "zod" + +import { api } from "@/lib/api.ts" +import { Badge } from "@/components/ui/badge.tsx" +import { Button } from "@/components/ui/button.tsx" +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog.tsx" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu.tsx" +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form.tsx" +import { Input } from "@/components/ui/input.tsx" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select.tsx" +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table.tsx" +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip.tsx" + +type Server = { + id: string + hostname?: string | null + ip_address: string + role: string + ssh_key_id: string + ssh_user: string + status: "pending" | "provisioning" | "ready" | "failed" | string + organization_id: string + created_at: string + updated_at: string +} + +type SshKey = { + id: string + name?: string | null + public_keys: string + fingerprint: string + created_at: string + updated_at: string + organization_id: string +} + +const STATUS = ["pending", "provisioning", "ready", "failed"] as const +type Status = (typeof STATUS)[number] + +const ROLE_OPTIONS = ["master", "worker", "bastion"] as const +type Role = (typeof ROLE_OPTIONS)[number] + +const CreateServerSchema = z.object({ + hostname: z.string().trim().max(120, "Max 120 chars").optional(), + ip_address: z.string().trim().min(1, "IP address is required"), + role: z.enum(ROLE_OPTIONS), + ssh_key_id: z.string().uuid("Pick a valid SSH key"), + ssh_user: z.string().trim().min(1, "SSH user is required"), + status: z.enum(STATUS).default("pending"), +}) +type CreateServerInput = z.input +type CreateServerValues = z.output + +const UpdateServerSchema = CreateServerSchema.partial() +type UpdateServerValues = z.infer + +function StatusBadge({ status }: { status: string }) { + const v = + status === "ready" + ? "default" + : status === "provisioning" + ? "secondary" + : status === "failed" + ? "destructive" + : "outline" + return ( + + {status} + + ) +} + +function truncateMiddle(str: string, keep = 16) { + if (!str || str.length <= keep * 2 + 3) return str + return `${str.slice(0, keep)}…${str.slice(-keep)}` +} + +export const ServersPage = () => { + const [servers, setServers] = useState([]) + const [sshKeys, setSshKeys] = useState([]) + const [loading, setLoading] = useState(false) + const [err, setErr] = useState(null) + + const [q, setQ] = useState("") + const [statusFilter, setStatusFilter] = useState("") + const [roleFilter, setRoleFilter] = useState("") + + const [createOpen, setCreateOpen] = useState(false) + const [editTarget, setEditTarget] = useState(null) + + function buildServersURL() { + const qs = new URLSearchParams() + if (statusFilter) qs.set("status", statusFilter) + if (roleFilter) qs.set("role", roleFilter) + const suffix = qs.toString() ? `?${qs.toString()}` : "" + return `/api/v1/servers${suffix}` + } + + async function loadAll() { + setLoading(true) + setErr(null) + try { + // NOTE: your api.get returns parsed JSON directly + const [srv, keys] = await Promise.all([ + api.get(buildServersURL()), + api.get("/api/v1/ssh"), + ]) + setServers(srv ?? []) + setSshKeys(keys ?? []) + } catch (e) { + console.error(e) + setErr("Failed to load servers or SSH keys") + } finally { + setLoading(false) + } + } + + useEffect(() => { + loadAll() + const onStorage = (e: StorageEvent) => { + if (e.key === "active_org_id") loadAll() + } + window.addEventListener("storage", onStorage) + return () => window.removeEventListener("storage", onStorage) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + useEffect(() => { + loadAll() + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [statusFilter, roleFilter]) + + const keyById = useMemo(() => { + const m = new Map() + sshKeys.forEach((k) => m.set(k.id, k)) + return m + }, [sshKeys]) + + const filtered = useMemo(() => { + const needle = q.trim().toLowerCase() + if (!needle) return servers + return servers.filter( + (s) => + (s.hostname ?? "").toLowerCase().includes(needle) || + s.ip_address.toLowerCase().includes(needle) || + s.role.toLowerCase().includes(needle) || + s.ssh_user.toLowerCase().includes(needle) + ) + }, [servers, q]) + + async function deleteServer(id: string) { + if (!confirm("Delete this server? This cannot be undone.")) return + await api.delete(`/api/v1/servers/${encodeURIComponent(id)}`) + await loadAll() + } + + const createForm = useForm({ + resolver: zodResolver(CreateServerSchema), + defaultValues: { + hostname: "", + ip_address: "", + role: "worker", + ssh_key_id: "", + ssh_user: "ubuntu", + status: "pending", + }, + }) + + const submitCreate = async (values: CreateServerValues) => { + const payload: Record = { + ip_address: values.ip_address.trim(), + role: values.role, + ssh_key_id: values.ssh_key_id, + ssh_user: values.ssh_user.trim(), + status: values.status, + } + if (values.hostname && values.hostname.trim()) { + payload.hostname = values.hostname.trim() + } + + await api.post("/api/v1/servers", payload) + setCreateOpen(false) + createForm.reset() + await loadAll() + } + + const editForm = useForm({ + resolver: zodResolver(UpdateServerSchema), + defaultValues: {}, + }) + + function openEdit(s: Server) { + setEditTarget(s) + editForm.reset({ + hostname: s.hostname ?? "", + ip_address: s.ip_address, + role: (ROLE_OPTIONS.includes(s.role as Role) ? (s.role as Role) : "worker") as any, + ssh_key_id: s.ssh_key_id, + ssh_user: s.ssh_user, + status: (STATUS.includes(s.status as Status) ? (s.status as Status) : "pending") as any, + }) + } + + const submitEdit = async (values: UpdateServerValues) => { + if (!editTarget) return + const payload: Record = {} + if (values.hostname !== undefined) payload.hostname = values.hostname?.trim() || "" + if (values.ip_address !== undefined) payload.ip_address = values.ip_address.trim() + if (values.role !== undefined) payload.role = values.role + if (values.ssh_key_id !== undefined) payload.ssh_key_id = values.ssh_key_id + if (values.ssh_user !== undefined) payload.ssh_user = values.ssh_user.trim() + if (values.status !== undefined) payload.status = values.status + + await api.patch(`/api/v1/servers/${encodeURIComponent(editTarget.id)}`, payload) + setEditTarget(null) + await loadAll() + } + + if (loading) return
Loading servers…
+ if (err) return
{err}
+ + return ( + +
+
+

Servers

+ +
+
+ + setQ(e.target.value)} + placeholder="Search hostname, IP, role, user…" + className="w-64 pl-8" + /> +
+ + + + + + + + + + + + + + Create server + + +
+ + ( + + Hostname + + + + + + )} + /> + + ( + + IP address + + + + + + )} + /> + +
+ ( + + Role + + + + )} + /> + + ( + + SSH user + + + + + + )} + /> +
+ + ( + + SSH key + + + + )} + /> + + ( + + Initial status + + + + )} + /> + + + + + + + +
+
+
+
+ +
+
+ + + + Hostname + IP address + Role + SSH user + SSH key + Status + Created + Actions + + + + {filtered.map((s) => { + const key = keyById.get(s.ssh_key_id) + return ( + + {s.hostname || "—"} + + {s.ip_address} + + {s.role} + + {s.ssh_user} + + + {key ? ( + + + + {key.name || "SSH key"} + + {truncateMiddle(key.fingerprint, 8)} + + + + +

{key.public_keys}

+
+
+ ) : ( + Unknown + )} +
+ + + + {new Date(s.created_at).toLocaleString()} + +
+ + + + + + + + deleteServer(s.id)}> + Confirm delete + + + +
+
+
+ ) + })} + + {filtered.length === 0 && ( + + + No servers match your filters. + + + )} +
+
+
+
+
+ + {/* Edit dialog */} + !o && setEditTarget(null)}> + + + Edit server + + +
+ + ( + + Hostname + + + + + + )} + /> + + ( + + IP address + + + + + + )} + /> + +
+ ( + + Role + + + + )} + /> + + ( + + SSH user + + + + + + )} + /> +
+ + ( + + SSH key + + + + )} + /> + + ( + + Status + + + + )} + /> + + + + + + + +
+
+
+ ) +}